Index: /branches/new-dialogs-merge/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/lang/pt_br.js (revision 901)
@@ -0,0 +1,184 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Initial basic work by Alex Piaz <webmaster@globalmap.com>
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt)
+{
+  "About": "Sobre",
+  "About Xinha": "Sobre o Xinha",
+  "Absbottom": "Inferior absoluto",
+  "Absmiddle": "Meio absoluto",
+  "Alignment:": "Alinhamento",
+  "Alternate text:": "Texto alternativo",
+  "Baseline": "Linha base",
+  "Bold": "Negrito",
+  "Border thickness:": "Espessura da borda",
+  "Bottom": "Botão",
+  "CTRL-0 (zero)": "CTRL-0 (zero)",
+  "CTRL-1 .. CTRL-6": "CTRL-1 .. CTRL-6",
+  "CTRL-A": "CTRL-A",
+  "CTRL-B": "CTRL-B",
+  "CTRL-C": "CTRL-C",
+  "CTRL-E": "CTRL-E",
+  "CTRL-I": "CTRL-I",
+  "CTRL-J": "CTRL-J",
+  "CTRL-L": "CTRL-L",
+  "CTRL-N": "CTRL-N",
+  "CTRL-R": "CTRL-R",
+  "CTRL-S": "CTRL-S",
+  "CTRL-U": "CTRL-U",
+  "CTRL-V": "CTRL-V",
+  "CTRL-X": "CTRL-X",
+  "CTRL-Y": "CTRL-Y",
+  "CTRL-Z": "CTRL-Z",
+  "Cancel": "Cancelar",
+  "Cell padding:": "Espaçamento interno da célula:",
+  "Cell spacing:": "Espaçamento da célula:",
+  "Clean content pasted from Word": "Limpar conteúdo copiado do Word",
+  "Close": "Fechar",
+  "Collapse borders:": "Bordas fechadas:",
+  "Cols:": "Colunas:",
+  "Constructing object": "Construindo objeto",
+  "Copy selection": "Copiar seleção",
+  "Create Statusbar": "Criar barra de informação (statusbar)",
+  "Create Toolbar": "Criar Barra de Ferramentas",
+  "Current style": "Estilo Atual",
+  "Cut selection": "Recortar seleção",
+  "Developer": "Desenvolvedor",
+  "ENTER": "ENTRAR",
+  "Editor Help": "Ajuda do Editor",
+  "Em": "Em",
+  "Enter the image URL here": "Entre aqui com a URL da imagem",
+  "Finishing": "Terminando",
+  "Fixed width columns": "Colunas com largura fixa",
+  "For browsers that don't support images": "Para navegadores que não suportam imagens",
+  "Generate Xinha framework": "Gerar Área de Trabalho do Xinha",
+  "Headings": "Títulos",
+  "Horizontal padding": "Espaçamento interno horizontal",
+  "Horizontal:": "Horizontal:",
+  "Image Preview:": "Visualização da Imagem:",
+  "Image URL:": "URL da imagem:",
+  "Init editor size": "Iniciar tamanho do editor",
+  "Insert Image": "Inserir Imagem",
+  "Insert Table": "Inserir Tabela",
+  "Insert/Modify Link": "Inserir/Modificar Link",
+  "Italic": "Itálico",
+  "Justify Center": "Justificar Centralizado",
+  "Justify Full": "Justificar Completamente",
+  "Justify Left": "Justificar à Esquerda",
+  "Justify Right": "Justificar à Direita",
+  "Keyboard shortcuts": "Atalhos de Teclado",
+  "Layout": "Esquema",
+  "Leave empty for no border": "Deixe em branco para não ter bordas",
+  "Left": "Esquerda",
+  "License": "Licença",
+  "Loading in progress. Please wait!": "Carregamento em processo. Por favor, aguarde!",
+  "Middle": "Meio",
+  "Name": "Nome",
+  "New window (_blank)": "Nova janela (_blank)",
+  "None (use implicit)": "Nenhum (uso implicito)",
+  "Not set": "Não definido",
+  "Number of columns": "Número de colunas",
+  "Number of rows": "Número de linhas",
+  "OK": "OK",
+  "Paste from clipboard": "Colar da Área de Transferência",
+  "Path": "Caminho",
+  "Percent": "Porcentagem",
+  "Pixels": "Pixels",
+  "Plugins": "Plugins",
+  "Positioning of this image": "Posicionamento desta imagem",
+  "Positioning of this table": "Posicionamento desta tabela",
+  "Preview": "Visualização",
+  "Preview the image in a new window": "Visualizar a imagem em uma nova janela",
+  "Redoes your last action": "Refazer sua última ação",
+  "Right": "Direita",
+  "Rows:": "Linhas:",
+  "SHIFT-ENTER": "SHIFT-ENTER",
+  "Same frame (_self)": "Mesmo frame (_self)",
+  "Select Color": "Selecionar côr",
+  "Select all": "Selecionar tudo",
+  "Set format to paragraph": "Definir formato para o parágrafo",
+  "Space between adjacent cells": "Espaço entre células adjacentes",
+  "Space between content and border in cell": "Espaço entre conteúdo e borda na célula",
+  "Spacing": "Espaçamento",
+  "Sponsored by": "Patrocinado por",
+  "Strikethrough": "Tachado",
+  "Target:": "Destino:",
+  "Texttop": "Texto no topo",
+  "Thanks": "Agradecimentos",
+  "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "O botão Colar não funciona em navegadores baseado no Mozilla (por razões técnicas de segurança). Pressione CTRL-V no seu teclado para colar diretamente.",
+  "The editor provides the following key combinations:": "Este editor fornece a seguinte combinação de teclas:",
+  "Title (tooltip):": "Título (tooltip)",
+  "Top": "Topo",
+  "Top frame (_top)": "Frame no topo (_top)",
+  "URL:": "URL:",
+  "Underline": "Sublinhado",
+  "Undoes your last action": "Desfazer sua última ação",
+  "Version": "Versão",
+  "Vertical padding": "Espaçamento interno vertical",
+  "Vertical:": "Vertical:",
+  "Width of the table": "Larguran da tabela",
+  "Width unit": "Unidade de largura",
+  "Width:": "Largura:",
+  "Would you like to clear font colours?": "Deseja limpar as cores de fonte",
+  "Would you like to clear font sizes?": "Deseja limpar os tamanhos de fonte",
+  "Would you like to clear font typefaces?": "Deseja limpar os tipos de fonte",
+  "Xinha Help": "Ajuda do Xinha",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Você está no MODO TEXTO.  Use o botão [<>] para mudar para o modo de Visualização (WYSIWYG)",
+  "Your Document is not well formed. Check JavaScript console for details.": "Seu Documento não está formatado corretamente. Verifique o console do JavaScript para maiores detalhes.",
+  "insert linebreak": "inserir quebra de linha",
+  "new paragraph": "novo parágrafo",
+  
+  // not find with lc_parse_strings.php
+  "Subscript": "Subescrito",
+  "Superscript": "Sobrescrito",
+  "Direction left to right": "Da esquerda para direita",
+  "Direction right to left": "Da direita para esquerda",
+  "Remove formatting": "Remover formatação",
+  "Select all": "Selecionar tudo",
+  "Print document": "Imprimir documento",
+  "Clear MSOffice tags": "Limpar tags do MS Office",
+  "Clear Inline Font Specifications": "Limpar especificações de fontes inline",
+  "Split Block": "Dividir Bloco",
+  "Toggle Borders": "Mudar Bordas",
+  "Save as": "Salvar como",
+  "Insert/Overwrite": "Inserir/Sobrescrever",
+  "&mdash; format &mdash;": "&mdash; formato &mdash;",
+  "Heading 1": "Título 1",
+  "Heading 2": "Título 2",
+  "Heading 3": "Título 3",
+  "Heading 4": "Título 4",
+  "Heading 5": "Título 5",
+  "Heading 6": "Título 6",
+  "Normal": "Normal",
+  "Address": "Endereço",
+  "Formatted": "Formatado",
+  "&mdash; font &mdash;": "&mdash; fonte &mdash;",
+  "&mdash; size &mdash;": "&mdash; tamanho &mdash;",
+  "Ordered List": "Lista Numerada",
+  "Bulleted List": "Lista Marcadores",
+  "Decrease Indent": "Diminuir Indentação",
+  "Increase Indent": "Aumentar Indentação",
+  "Font Color": "Cor da Fonte",
+  "Background Color": "Cor do Fundo",
+  "Horizontal Rule": "Linha Horizontal",
+  "Insert Web Link": "Inserir Link",
+  "Insert/Modify Image": "Inserir/Modificar Imagem",
+  "Insert Table": "Inserir Tabela",
+  "Toggle HTML Source": "Ver Código-Fonte",
+  "Enlarge Editor": "Expandir Editor",
+  "About this editor": "Sobre este editor",
+  "Help using editor": "Ajuda - Usando o editor"
+}
Index: /branches/new-dialogs-merge/lang/b5.js
===================================================================
--- /branches/new-dialogs-merge/lang/b5.js (revision 856)
+++ /branches/new-dialogs-merge/lang/b5.js (revision 856)
@@ -0,0 +1,35 @@
+// I18N constants -- UTF-8
+// by Dave Lo -- dlo@interactivetools.com
+{
+  "Bold": "ç²é«",
+  "Italic": "æé«",
+  "Underline": "åºç·",
+  "Strikethrough": "åªé€ç·",
+  "Subscript": "äžæš",
+  "Superscript": "äžæš",
+  "Justify Left": "äœçœ®é å·Š",
+  "Justify Center": "äœçœ®å±
+äž­",
+  "Justify Right": "äœçœ®é å³",
+  "Justify Full": "äœçœ®å·Šå³å¹³ç­",
+  "Ordered List": "é åºæž
+å®",
+  "Bulleted List": "ç¡åºæž
+å®",
+  "Decrease Indent": "æžå°è¡åç©ºçœ",
+  "Increase Indent": "å å¯¬è¡åç©ºçœ",
+  "Font Color": "æå­é¡è²",
+  "Background Color": "èæ¯é¡è²",
+  "Horizontal Rule": "æ°Žå¹³ç·",
+  "Insert Web Link": "æå
+¥é£çµ",
+  "Insert/Modify Image": "æå
+¥ååœ¢",
+  "Insert Table": "æå
+¥è¡šæ Œ",
+  "Toggle HTML Source": "åæHTMLåå§ç¢Œ",
+  "Enlarge Editor": "æŸå€§",
+  "About this editor": "éæŒ Xinha",
+  "Help using editor": "èªªæ",
+  "Current style": "å­é«äŸå­"
+}
Index: /branches/new-dialogs-merge/lang/es.js
===================================================================
--- /branches/new-dialogs-merge/lang/es.js (revision 944)
+++ /branches/new-dialogs-merge/lang/es.js (revision 944)
@@ -0,0 +1,167 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+{
+  "Bold": "Negrita",
+  "Italic": "Cursiva",
+  "Underline": "Subrayado",
+  "Strikethrough": "Tachado",
+  "Subscript": "SubÃ­ndice",
+  "Superscript": "SuperÃ­ndice",
+  "Justify Left": "Alinear a la izquierda",
+  "Justify Center": "Alinear al centro",
+  "Justify Right": "Alinear a la derecha",
+  "Justify Full": "Justificar",
+  "Ordered List": "Lista numerada",
+  "Bulleted List": "Lista no numerada",
+  "Decrease Indent": "Reducir sangrÃ­a",
+  "Increase Indent": "Aumentar sangrÃ­a",
+  "Font Color": "Color de la fuente",
+  "Background Color": "Color de fondo",
+  "Horizontal Rule": "Regla horizontal",
+  "Insert Web Link": "Insertar enlace web",
+  "Insert/Modify Image": "Insertar/modificar imagen",
+  "Insert Table": "Insertar una tabla",
+  "Toggle HTML Source": "Ver HTML",
+  "Enlarge Editor": "Editor a pantalla completa",
+  "About this editor": "Sobre este Editor",
+  "Help using editor": "Ayuda",
+  "Current style": "Estilo actual",
+  "Undoes your last action": "Deshacer",
+  "Redoes your last action": "Rehacer",
+  "Cut selection": "Cortar",
+  "Copy selection": "Copiar",
+  "Paste from clipboard": "Pegar desde el portapapeles",
+  "Direction left to right": "DirecciÃ³n de izquierda a derecha",
+  "Direction right to left": "DirecciÃ³n de derecha a izquierda",
+  "Remove formatting": "Borrar formato",
+  "Select all": "Seleccionar todo",
+  "Print document": "Imprimir documento",
+  "Clear MSOffice tags": "Borrar etiquetas de MSOffice",
+  "Clear Inline Font Specifications": "Borrar las etiquetas de fuente",
+  "Would you like to clear font typefaces?": "Â¿Desea eliminar las definiciaones de tipo de fuente?",
+  "Would you like to clear font sizes?": "Â¿Desea eliminar las definiciones de tamaÃ±o de fuente?",
+  "Would you like to clear font colours?": "Â¿Desea eliminar las definiciones de color de fuente?",
+  "Split Block": "Dividir el bloque",
+  "Toggle Borders": "AÃ±adir/Quitar bordes",
+  "Save as": "Guardar como",
+  "Insert/Overwrite": "Insertar/Sobreescribir",
+  "&mdash; format &mdash;": "&mdash; formato &mdash;",
+  "&mdash; font &mdash;": "&mdash; fuente &mdash;",
+  "&mdash; size &mdash;": "&mdash; tamaÃ±o &mdash;",
+  "Heading 1": "Cabecera 1",
+  "Heading 2": "Cabecera 2",
+  "Heading 3": "Cabecera 3",
+  "Heading 4": "Cabecera 4",
+  "Heading 5": "Cabecera 5",
+  "Heading 6": "Cabecera 6",
+  "Normal": "Normal",
+  "Address": "DirecciÃ³n",
+  "Formatted": "Formateado",
+
+  //dialogs
+  "OK": "Aceptar",
+  "Cancel": "Cancelar",
+  "Path": "Ruta",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Se encuentra en MODO TEXTO. Use el botÃ³n [<>] para cambiar de nuevo al modo WYSIWYG",
+   "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "El botÃ³n de pegar no funciona en los navegadores de Mozilla por motivos de seguridad. Presione CTRL-V en su teclado para pegarlo directamente",
+
+  "You need to select some text before create a link": "Necesita seleccionar algÃºn texto antes de crear un link",
+  "Your Document is not well formed. Check JavaScript console for details.": "Su documento no estÃ¡ bien formado. Compruebe la consola de JavaScript para obtener mÃ¡s detalles",
+
+  "Alignment:": "AlineaciÃ³n:",
+  "Not set": "No definido",
+  "Left": "Izquierda",
+  "Right": "Derecha",
+  "Texttop": "Texto Superior",
+  "Absmiddle": "Medio Absoluto",
+  "Baseline": "LÃ­nea base",
+  "Absbottom": "Inferior absoluto",
+  "Bottom": "Inferior",
+  "Middle": "Medio",
+  "Top": "Superior",
+
+  "Layout": "DistribuciÃ³n",
+  "Spacing": "Espaciado",
+  "Horizontal:": "horizontal:",
+  "Horizontal padding": "Relleno horizontal",
+  "Vertical:": "Vertical:",
+  "Vertical padding": "Relleno Vertical",
+  "Border thickness:": "TamaÃ±o del borde:",
+  "Leave empty for no border": "VacÃ­o si no desea ningÃºn borde",
+
+  //Insert Link
+  "Insert/Modify Link": "Insertar/Modificar un enlace",
+  "None (use implicit)": "VacÃ­o ( usar implÃ­cito )",
+  "New window (_blank)": "Nueva ventana (_blank)",
+  "Same frame (_self)": "Mismo marco (_self)",
+  "Top frame (_top)": "Marco superior (_top)",
+  "Other": "Otro",
+  "Target:": "Destino:",
+  "Title (tooltip):": "TÃ­tulo (Tooltip):",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Debe introducir la URL a donde apunta este enlace",
+
+  // Insert Table
+  "Insert Table": "AÃ±adir una tabla",
+  "Rows:": "Filas:",
+  "Number of rows": "NÃºmero de filas",
+  "Cols:": "Columnas:",
+  "Number of columns": "NÃºmero de columnas",
+  "Width:": "Ancho:",
+  "Width of the table": "Ancho de la tabla",
+  "Percent": "Porcentaje",
+  "Pixels": "Pixels",
+  "Em": "Em",
+  "Width unit": "Unidad de anchura",
+  "Fixed width columns": "Columnas de ancho fijo",
+  "Positioning of this table": "PosiciÃ³n de esta tabla",
+  "Cell spacing:": "Espaciado entre celdas:",
+  "Space between adjacent cells": "Espaciado entre celdas adyacentes",
+  "Cell padding:": "Relleno de celdas:",
+  "Space between content and border in cell": "Escapcio entre el contenido y el borde de la celda",
+  "You must enter a number of rows": "Debe introducir un nÃºmero de filas",
+  "You must enter a number of columns": "Debe introducir un nÃºmero de columnas",
+
+  // Insert Image
+  "Insert Image": "Insertar una imagen",
+  "Image URL:": "Imagen URL:",
+  "Enter the image URL here": "",
+  "Preview": "Previsualizar",
+  "Preview the image in a new window": "Previsualizar en una nueva ventana",
+  "Alternate text:": "Texto alternativo:",
+  "For browsers that don't support images": "Para navegadores que no soportan imÃ¡genes",
+  "Positioning of this image": "PosiciÃ³n de la imagen",
+  "Image Preview:": "PrevisualizaciÃ³n de la imagen:",
+  "You must enter the URL": "Debe introducir la URL",
+
+  // Editor Help
+  "Keyboard shortcuts": "Atajos de teclado",
+  "The editor provides the following key combinations:": "El editor proporciona las siguientes combinaciones:",
+  "new paragraph": "Nuevo parrafo",
+  "insert linebreak": "Insertar salto de lÃ­nea",
+  "Set format to paragraph": "EStablecer el formato a parrafo",
+  "Clean content pasted from Word": "Limpiar el contenido pegado desde Word",
+  "Headings": "Cabeceras",
+  "Close": "Cerrar",
+
+  // Loading messages
+  "Loading in progress. Please wait!": "Carga en proceso. Por favor espere.",
+  "Loading plugin $plugin" : "Cargando el plugin $plugin",
+  "Register plugin $plugin" : "Registro de plugin $plugin", 
+  "Constructing object": "Construyendo objeto",
+  "Generate Xinha framework": "Generar Xinha framework",
+  "Init editor size":"Iniciar el tamaÃ±o del editor", 
+  "Create Toolbar": "Crear barra de herramientas",
+  "Create Statusbar" : "Crear barra de estado",
+  "Register right panel" : "Registrar panel derecho", 
+  "Register left panel" : "Registrar panel izquierdo", 
+  "Register bottom panel" : "Registar panel inferior", 
+  "Register top panel" : "Registar panel superior", 
+  "Finishing" : "Finalizando",
+  
+  // ColorPicker
+  "Click a color..." : "Seleccione un color...",
+  "Sample" : "Muestra",
+  "Web Safe: " : "Color web: ",
+  "Color: " : "Color: "
+}
Index: /branches/new-dialogs-merge/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/lang/fr.js (revision 825)
+++ /branches/new-dialogs-merge/lang/fr.js (revision 825)
@@ -0,0 +1,169 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Bold": "Gras",
+  "Italic": "Italique",
+  "Underline": "SoulignÃ©",
+  "Strikethrough": "BarrÃ©",
+  "Subscript": "Indice",
+  "Superscript": "Exposant",
+  "Justify Left": "Aligner Ã  gauche",
+  "Justify Center": "Centrer",
+  "Justify Right": "Aligner Ã  droite",
+  "Justify Full": "Justifier",
+  "Ordered List": "Liste numÃ©rotÃ©e",
+  "Bulleted List": "Liste Ã  puces",
+  "Decrease Indent": "Diminuer le retrait",
+  "Increase Indent": "Augmenter le retrait",
+  "Font Color": "Couleur de police",
+  "Background Color": "Surlignage",
+  "Horizontal Rule": "Ligne horizontale",
+  "Insert Web Link": "InsÃ©rer un lien",
+  "Insert/Modify Image": "InsÃ©rer / Modifier une image",
+  "Insert Table": "InsÃ©rer un tableau",
+  "Toggle HTML Source": "Afficher / Masquer code source",
+  "Enlarge Editor": "Agrandir l'Ã©diteur",
+  "About this editor": "A propos",
+  "Help using editor": "Aide",
+  "Current style": "Style courant",
+  "Undoes your last action": "Annuler la derniÃšre action",
+  "Redoes your last action": "RÃ©pÃ©ter la derniÃšre action",
+  "Cut selection": "Couper la sÃ©lection",
+  "Copy selection": "Copier la sÃ©lection",
+  "Paste from clipboard": "Coller depuis le presse-papier",
+  "Direction left to right": "Direction de gauche Ã  droite",
+  "Direction right to left": "Direction de droite Ã  gauche",
+  "Remove formatting": "Supprimer mise en forme",
+  "Select all": "Tout sÃ©lectionner",
+  "Print document": "Imprimer document",
+  "Clear MSOffice tags": "Supprimer tags MSOffice",
+  "Clear Inline Font Specifications": "Supprimer paramÃštres inline de la police",
+  "Would you like to clear font typefaces?": "Voulez-vous supprimer les types ?",
+  "Would you like to clear font sizes?": "Voulez-vous supprimer les tailles ?",
+  "Would you like to clear font colours?": "Voulez-vous supprimer les couleurs ?",
+  "Split Block": "SÃ©parer les blocs",
+  "Toggle Borders": "Afficher / Masquer les bordures",
+  "Save as": "Enregistrer sous",
+  "Insert/Overwrite": "Insertion / Remplacement",
+  "&mdash; format &mdash;": "&mdash; Format &mdash;",
+  "Heading 1": "Titre 1",
+  "Heading 2": "Titre 2",
+  "Heading 3": "Titre 3",
+  "Heading 4": "Titre 4",
+  "Heading 5": "Titre 5",
+  "Heading 6": "Titre 6",
+  "Normal": "Normal",
+  "Address": "Adresse",
+  "Formatted": "FormatÃ©",
+
+  //dialogs
+  "OK": "OK",
+  "Cancel": "Annuler",
+  "Path": "Chemin",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Vous Ãªtes en MODE TEXTE.  Appuyez sur le bouton [<>] pour retourner au mode WYSIWYG.",
+  "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Le bouton Coller ne fonctionne pas sur les navigateurs basÃ©s sur Mozilla (pour des raisons de sÃ©curitÃ©). Pressez CTRL-V au clavier pour coller directement.",
+  "Your Document is not well formed. Check JavaScript console for details.": "Le document est mal formÃ©. VÃ©rifiez la console JavaScript pour plus de dÃ©tails.",
+
+  "Alignment:": "Alignement",
+  "Not set": "IndÃ©fini",
+  "Left": "Gauche",
+  "Right": "Droite",
+  "Texttop": "Texttop",
+  "Absmiddle": "Absmiddle",
+  "Baseline": "Baseline",
+  "Absbottom": "Absbottom",
+  "Bottom": "Bas",
+  "Middle": "Milieu",
+  "Top": "Haut",
+
+  "Layout": "Mise en page",
+  "Spacing": "Espacement",
+  "Horizontal:": "Horizontal",
+  "Horizontal padding": "Marge horizontale interne",
+  "Vertical:": "Vertical",
+  "Vertical padding": "Marge verticale interne",
+  "Border thickness:": "Epaisseur de bordure",
+  "Leave empty for no border": "Laisser vide pour pas de bordure",
+
+  //Insert Link
+  "Insert/Modify Link": "InsÃ©rer / Modifier un lien",
+  "None (use implicit)": "Aucune (implicite)",
+  "New window (_blank)": "Nouvelle fenÃªtre (_blank)",
+  "Same frame (_self)": "MÃªme frame (_self)",
+  "Top frame (_top)": "Frame principale (_top)",
+  "Other": "Autre",
+  "Target:": "Cible",
+  "Title (tooltip):": "Texte alternatif",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Vous devez entrer l'URL de ce lien",
+  "You need to select some text before creating a link": "Vous devez sÃ©lectionner du texte avant de crÃ©er un lien",
+
+  // Insert Table
+  "Insert Table": "InsÃ©rer un tableau",
+  "Rows:": "Lignes",
+  "Number of rows": "Nombre de lignes",
+  "Cols:": "Colonnes",
+  "Number of columns": "Nombre de colonnes",
+  "Width:": "Largeur",
+  "Width of the table": "Largeur du tableau",
+  "Percent": "Pourcent",
+  "Pixels": "Pixels",
+  "Em": "Em",
+  "Width unit": "UnitÃ©s de largeur",
+  "Fixed width columns": "Colonnes Ã  taille fixe",
+  "Positioning of this table": "Position du tableau",
+  "Cell spacing:": "Espacement",
+  "Space between adjacent cells": "Espace entre les cellules adjacentes",
+  "Cell padding:": "Marge interne",
+  "Space between content and border in cell": "Espace entre le contenu et la bordure d'une cellule",
+  "You must enter a number of rows": "Vous devez entrer le nombre de lignes",
+  "You must enter a number of columns": "Vous devez entrer le nombre de colonnes",
+
+  // Insert Image
+  "Insert Image": "InsÃ©rer une image",
+  "Image URL:": "URL image",
+  "Enter the image URL here": "Entrer l'URL de l'image ici",
+  "Preview": "PrÃ©visualiser",
+  "Preview the image in a new window": "PrÃ©visualiser l'image dans une nouvelle fenÃªtre",
+  "Alternate text:": "Texte alternatif",
+  "For browsers that don't support images": "Pour les navigateurs qui ne supportent pas les images",
+  "Positioning of this image": "Position de l'image",
+  "Image Preview:": "PrÃ©visualisation",
+  "You must enter the URL": "Vous devez entrer l'URL",
+
+  // toolbar
+  "button_bold": "fr/bold.gif",
+  "button_underline": "fr/underline.gif",
+  "button_strikethrough": "fr/strikethrough.gif",
+
+  // Editor Help
+  "Xinha Help": "Aide Xinha",
+  "Editor Help": "Aide de l'Ã©diteur",
+  "Keyboard shortcuts": "Raccourcis clavier",
+  "The editor provides the following key combinations:": "L'Ã©diteur fournit les combinaisons de touches suivantes :",
+  "ENTER": "ENTREE",
+  "new paragraph": "Nouveau paragraphe",
+  "SHIFT-ENTER": "SHIFT+ENTREE",
+  "insert linebreak": "InsÃšre un saut de ligne",
+  "Set format to paragraph": "Applique le format paragraphe",
+  "Clean content pasted from Word": "Nettoyage du contenu copiÃ© depuis Word",
+  "Headings": "Titres",
+  "Close": "Fermer",
+
+  // Loading messages
+  "Loading in progress. Please wait!": "Chargement en cours. Veuillez patienter!",
+  "Finishing" : "Chargement bientÃŽt terminÃ©", 
+  "Constructing object": "Construction de l'objet",
+  "Create Toolbar": "Construction de la barre d'icones",
+  "Create Statusbar": "Construction de la barre de status",
+  "Register right panel" : "Enregistrement du panneau droit", 
+  "Register left panel" : "Enregistrement du panneau gauche", 
+  "Register bottom panel" : "Enregistrement du panneau supÃ©rieur", 
+  "Register top panel" : "Enregistrement du panneau infÃ©rieur", 
+  "Generate Xinha framework": "GÃ©nÃ©ration de Xinha",
+  "Init editor size": "Initialisation de la taille d'Ã©dition",
+  "Init IFrame": "Initialisation de l'iframe",
+  "Register plugin $plugin": "Enregistrement du plugin $plugin",
+  "Loading plugin $plugin" : "Chargement du plugin $plugin"
+
+};
Index: /branches/new-dialogs-merge/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/lang/nl.js (revision 856)
+++ /branches/new-dialogs-merge/lang/nl.js (revision 856)
@@ -0,0 +1,64 @@
+// I18N constants
+
+// LANG: "nl", ENCODING: UTF-8
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.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.)
+
+{
+  "Bold": "Vet",
+  "Italic": "Cursief",
+  "Underline": "Onderstrepen",
+  "Strikethrough": "Doorhalen",
+  "Subscript": "Subscript",
+  "Superscript": "Superscript",
+  "Justify Left": "Links uitlijnen",
+  "Justify Center": "Centreren",
+  "Justify Right": "Rechts uitlijnen",
+  "Justify Full": "Uitvullen",
+  "Ordered List": "Nummering",
+  "Bulleted List": "Opsommingstekens",
+  "Decrease Indent": "Inspringing verkleinen",
+  "Increase Indent": "Inspringing vergroten",
+  "Font Color": "Tekstkleur",
+  "Background Color": "Achtergrondkleur",
+  "Horizontal Rule": "Horizontale lijn",
+  "Insert Web Link": "Hyperlink invoegen/aanpassen",
+  "Insert/Modify Image": "Afbeelding invoegen/aanpassen",
+  "Insert Table": "Tabel invoegen",
+  "Toggle HTML Source": "HTML broncode",
+  "Enlarge Editor": "Vergroot Editor",
+  "About this editor": "Over deze editor",
+  "Help using editor": "Xinha help",
+  "Current style": "Huidige stijl",
+  "Undoes your last action": "Ongedaan maken",
+  "Redoes your last action": "Herhalen",
+  "Cut selection": "Knippen",
+  "Copy selection": "Kopi?ren",
+  "Paste from clipboard": "Plakken",
+  "Direction left to right": "Tekstrichting links naar rechts",
+  "Direction right to left": "Tekstrichting rechts naar links",
+  "OK": "OK",
+  "Cancel": "Annuleren",
+  "Path": "Pad",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser die we niet kunnen omzeilen. Hierdoor kunnen de volgende effecten optreden: verknoeide teksten, een verlies aan editor-functionaliteit en/of willekeurig vastlopen van de webbrowser. Als u Windows 95 of 98 gebruikt, is het zeer waarschijnlijk dat u een algemene beschermingsfout (",
+  "Cancel": "Annuleren",
+  "Insert/Modify Link": "Hyperlink invoegen/aanpassen",
+  "New window (_blank)": "Nieuw venster (_blank)",
+  "None (use implicit)": "Geen",
+  "Other": "Ander",
+  "Same frame (_self)": "Zelfde frame (_self)",
+  "Target:": "Doel:",
+  "Title (tooltip):": "Titel (tooltip):",
+  "Top frame (_top)": "Bovenste frame (_top)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Geef de URL in waar de link naar verwijst"
+}
Index: /branches/new-dialogs-merge/lang/eu.js
===================================================================
--- /branches/new-dialogs-merge/lang/eu.js (revision 820)
+++ /branches/new-dialogs-merge/lang/eu.js (revision 820)
@@ -0,0 +1,169 @@
+// I18N constants
+// LANG: "eu", ENCODING: UTF-8
+{
+  "Bold": "Lodia",
+  "Italic": "Etzana",
+  "Underline": "Azpimarratua",
+  "Strikethrough": "Marratua",
+  "Subscript": "Azpindizea",
+  "Superscript": "Goi-indizea",
+  "Justify Left": "Ezkerretara lerrokatu",
+  "Justify Center": "Zentratu",
+  "Justify Right": "Eskuinetara lerrokatu",
+  "Justify Full": "Justifikatu",
+  "Ordered List": "Zerrenda ordenatua",
+  "Bulleted List": "Zerrenda ez ordenatua",
+  "Decrease Indent": "Koska handitu",
+  "Increase Indent": "Koska txikitu",
+  "Font Color": "Testu-kolorea",
+  "Background Color": "Atzeko kolorea",
+  "Horizontal Rule": "Marra horizontala",
+  "Insert Web Link": "Lotura txertatu",
+  "Insert/Modify Image": "Irudia txertatu",
+  "Insert Table": "Taula txertatu",
+  "Toggle HTML Source": "Ikusi dokumentua HTML-n",
+  "Enlarge Editor": "Editorea handitu",
+  "About this editor": "Editoreari buruz...",
+  "Help using editor": "Laguntza",
+  "Current style": "Uneko estiloa",
+  "Undoes your last action": "Desegin",
+  "Redoes your last action": "Berregin",
+  "Cut selection": "Ebaki hautaketa",
+  "Copy selection": "Kopiatu hautaketa",
+  "Paste from clipboard": "Itsatsi arbelean dagoena",
+  "Direction left to right": "Ezkerretik eskuinetarako norabidea",
+  "Direction right to left": "Eskuinetik ezkerretarako norabidea",
+  "Remove formatting": "Formatoa kendu",
+  "Select all": "Dena aukeratu",
+  "Print document": "Dokumentua inprimatu",
+  "Clear MSOffice tags": "MSOffice etiketak ezabatu",
+  "Clear Inline Font Specifications": "Ezabatu testuaren ezaugarriak",
+  "Would you like to clear font typefaces?": "Letra-tipoak ezabatu nahi al dituzu?",
+  "Would you like to clear font sizes?": "Letra-tipoen neurriak ezabatu nahi al dituzu?",
+  "Would you like to clear font colours?": "Letra-tipoen koloreak ezabatu nahi al dituzu?",
+  "Split Block": "Blokea zatitu",
+  "Toggle Borders": "Ertzak trukatu",
+  "Save as": "Gorde honela:",
+  "Insert/Overwrite": "Txertatu/Gainidatzi",
+  "&mdash; format &mdash;": "&mdash; Formatua &mdash;",
+  "Heading 1": "Goiburua 1",
+  "Heading 2": "Goiburua 2",
+  "Heading 3": "Goiburua 3",
+  "Heading 4": "Goiburua 4",
+  "Heading 5": "Goiburua 5",
+  "Heading 6": "Goiburua 6",
+  "Normal": "Normala",
+  "Address": "Helbidea",
+  "Formatted": "Formateatua",
+
+  //dialogs
+  "OK": "Ados",
+  "Cancel": "Utzi",
+  "Path": "Bidea",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "TESTU eran ari zara. Erabil ezazu [<>] botoia WYSIWIG erara itzultzeko.",
+   "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Itsatsi botoia ez dabil Mozillan oinarritutako nabigatzaileetan (arrazoi teknikoengatik). Sacatu CTRL-V zure teklatuan, zuzenean itsasteko.",
+
+  "You need to select some text before create a link": "Testu-atal bat aukeratu behar duzu lehendabizi, lotura bat sortzeko",
+  "Your Document is not well formed. Check JavaScript console for details.": "Zure dokumentuak ez du formatu zuzena. Begira ezazu JavaScript kontsola xehetasunetarako.",
+
+  "Alignment:": "Lerrokatzea:",
+  "Not set": "Ez gaitua",
+  "Left": "Ezkerretara",
+  "Right": "Eskuinetara",
+  "Texttop": "Irudiaren goialdean",
+  "Absmiddle": "Irudiaren erdian",
+  "Baseline": "Irudiaren oinean",
+  "Absbottom": "Irudiaren behekaldean",
+  "Bottom": "Behean",
+  "Middle": "Erdian",
+  "Top": "Goian",
+
+  "Layout": "Diseinua",
+  "Spacing": "Tartea",
+  "Horizontal:": "Horizontala:",
+  "Horizontal padding": "Betegarri horizontala",
+  "Vertical:": "Bertikala:",
+  "Vertical padding": "Betegarri bertikala",
+  "Border thickness:": "Ertzaren lodiera:",
+  "Leave empty for no border": "Uztazu hutsik ertzik ez sortzeko",
+
+  //Insert Link
+  "Insert/Modify Link": "Lotura txertatu/aldatu",
+  "None (use implicit)": "Bat ere ez (implizituki erabili)",
+  "New window (_blank)": "Lehio berrian (_blank)",
+  "Same frame (_self)": "Frame berean (_self)",
+  "Top frame (_top)": "Goiko frame-an (_top)",
+  "Other": "Beste bat",
+  "Target:": "Helburua:",
+  "Title (tooltip):": "Izenburua (argibidea):",
+  "URL:": "URL-a:",
+  "You must enter the URL where this link points to": "Loturaren helburu den URL-a idatzi behar duzu",
+
+  // Insert Table
+  "Insert Table": "Taula txertatu",
+  "Rows:": "Lerroak:",
+  "Number of rows": "Lerro-kopurua",
+  "Cols:": "Zutabeak:",
+  "Number of columns": "Zutabe-kopurua",
+  "Width:": "Zabalera:",
+  "Width of the table": "Taularen zabalera",
+  "Percent": "Portzentaia",
+  "Pixels": "Pixelak",
+  "Em": "Em",
+  "Width unit": "Zabalera-unitatea",
+  "Fixed width columns": "Zabalera finkodun zutabeak",
+  "Positioning of this table": "Taula honen kokapena",
+  "Cell spacing:": "Gelaxka-tartea:",
+  "Space between adjacent cells": "Gelaxka auzokideen arteko tartea",
+  "Cell padding:": "Gelaxkaren betegarria:",
+  "Space between content and border in cell": "Gelaxkaren edukia eta ertzaren arteko tartea",
+  "You must enter a number of rows": "Lerro-kopurua idatzi behar duzu",
+  "You must enter a number of columns": "Zutabe-kopurua idatzi behar duzu",
+
+  // Insert Image
+  "Insert Image": "Irudia txertatu",
+  "Image URL:": "Irudiaren URL-a:",
+  "Enter the image URL here": "Idatz ezazu irudiaren URL-a hemen",
+  "Preview": "Aurrebista",
+  "Preview the image in a new window": "Aurreikusi irudia beste lehio batean",
+  "Alternate text:": "Testu alternatiboa:",
+  "For browsers that don't support images": "Irudirik onartzen ez duten nabigatzaileentzat",
+  "Positioning of this image": "Irudiaren kokapena",
+  "Image Preview:": "Irudiaren aurrebista:",
+  "You must enter the URL": "URL-a idatzi behar duzu",
+
+  "button_bold": "de/bold.gif",
+  "button_italic": "de/italic.gif",
+  "button_underline": "de/underline.gif",
+
+  // Editor Help
+  "Keyboard shortcuts": "Laster-teklak",
+  "The editor provides the following key combinations:": "Editoreak ondorengo tekla-konbinazioak eskaintzen ditu:",
+  "new paragraph": "Paragrafo berria",
+  "insert linebreak": "Lerro-jauzia txertatu",
+  "Set format to paragraph": "Formatua ezarri paragrafoari",
+  "Clean content pasted from Word": "Word-etik itsatsitako edukia ezabatu",
+  "Headings": "Goiburuak",
+  "Close": "Itxi",
+
+  // Loading messages
+  "Loading in progress. Please wait!": "Kargatzen. Itxaron mesedez",
+  "Loading plugin $plugin" : "$plugin plugina kargatzen",
+  "Register plugin $plugin" : "$plugin plugina erregistratu", 
+  "Constructing object": "Objektua eraikitzen",
+  "Generate Xinha framework": "Xinha Framework sortzen",
+  "Init editor size":"Editorearen hasierako neurria", 
+  "Create Toolbar": "Tresna-barra sortu",
+  "Create Statusbar" : "Egoera-barra sortu",
+  "Register right panel" : "Eskuin-panela erregistratu", 
+  "Register left panel" : "Ezker-panela erregistratu", 
+  "Register bottom panel" : "Beheko panela erregistratu", 
+  "Register top panel" : "Goiko panela erregistratu", 
+  "Finishing" : "Bukatzen", 
+  
+  // ColorPicker
+  "Click a color..." : "Kolore bat aukeratu...",
+  "Sample" : "Lagina",
+  "Web Safe: " : "Web Safe: ",
+  "Color: " : "Kolorea: "
+};
Index: /branches/new-dialogs-merge/lang/sh.js
===================================================================
--- /branches/new-dialogs-merge/lang/sh.js (revision 901)
+++ /branches/new-dialogs-merge/lang/sh.js (revision 901)
@@ -0,0 +1,140 @@
+﻿// I18N constants
+
+// LANG: "sh", ENCODING: UTF-8 | ISO-8859-2
+// Author: Ljuba Ranković, http://www.rankovic.net/ljubar
+
+// 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.)
+
+{
+		"Bold": "Masno",
+		"Italic": "Kurziv",
+		"Underline": "Podvučeno",
+		"Strikethrough": "Precrtano",
+		"Subscript": "Indeks-tekst",
+		"Superscript": "Eksponent-tekst",
+		"Justify Left":"Ravnanje ulevo",
+		"Justify Center": "Ravnanje po simetrali",
+		"Justify Right": "Ravnanje udesno",
+		"Justify Full": "Puno ravnanje",
+		"Ordered List": "Lista sa rednim brojevima",
+		"Bulleted List": "Lista sa simbolima",
+		"Decrease Indent": "smanji uvlačenje",
+		"Increase Indent": "Povećaj uvlačenje",
+		"Font Color": "Boja slova",
+		"Background Color": "Boja pozadine",
+		"Horizontal Rule": "Horizontalna linija",
+		"Insert Web Link": "Dodaj web link",
+		"Insert/Modify Image": "Dodaj/promeni sliku",
+		"Insert Table": "Ubaci tabelu",
+		"Toggle HTML Source": "Prebaci na HTML kod",
+		"Enlarge Editor": "Povećaj editor",
+		"About this editor": "O ovom editoru",
+		"Help using editor": "Pomoć pri korišćenju editora",
+		"Current style": "Važeći stil",
+		"Undoes your last action": "Poništava poslednju radnju",
+		"Redoes your last action": "Vraća poslednju radnju",
+		"Cut selection": "Iseci izabrano",
+		"Copy selection": "Kopiraj izabrano",
+		"Paste from clipboard": "Zalepi iz klipborda",
+		"Direction left to right": "Pravac s leva na desno",
+		"Direction right to left": "Pravac s desna na levo",
+        "Remove formatting": "Ukoni formatiranje",
+        "Select all": "Izaberi sve",
+        "Print document": "Štampaj dokument",
+        "Clear MSOffice tags": "Obriši MSOffice tagove",
+        "Clear Inline Font Specifications": "Obriši dodeljene osobine fonta",
+        "Split Block": "Podeli blok",
+        "Toggle Borders": "Izmeni okvire",
+
+        "&mdash; format &mdash;": "&mdash; Format &mdash;",
+        "Heading 1": "Zaglavlje 1",
+        "Heading 2": "Zaglavlje 2",
+        "Heading 3": "Zaglavlje 3",
+        "Heading 4": "Zaglavlje 4",
+        "Heading 5": "Zaglavlje 5",
+        "Heading 6": "Zaglavlje 6",
+        "Normal": "Običan",
+        "Address": "Adresa",
+        "Formatted": "Formatiran",
+        
+        // dialogs
+		"OK": "OK",
+		"Cancel": "Poništi",
+		"Path": "Putanja",
+		"You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Nalazite se u TEXT režimu.  Koristite [<>] dugme za povratak na WYSIWYG.",
+
+		"The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "",
+
+        "Alignment:": "Ravnanje",
+        "Not set": "Nije postavljeno",
+        "Left": "Levo",
+        "Right": "Desno",
+        "Texttop": "Vrh teksta",
+        "Absmiddle": "Apsolutna sredina",
+        "Baseline": "Donja linija",
+        "Absbottom": "Apsolutno dno",
+        "Bottom": "Dno",
+        "Middle": "Sredina",
+        "Top": "Vrh",
+
+        "Layout": "Prelom",
+        "Spacing": "Razmak",
+        "Horizontal:": "Po horizontali",
+        "Horizontal padding": "Horizontalno odstojanje",
+        "Vertical:": "Po vertikali",
+        "Vertical padding": "Vertikalno odstojanje",
+        "Border thickness:": "Debljina okvira",
+        "Leave empty for no border": "Ostavi prazno kad nema okvira",
+		
+        // Insert Link
+		"Insert/Modify Link": "Dodaj/promeni Link",
+		"None (use implicit)": "koristi podrazumevano",
+		"New window (_blank)": "Novom prozoru (_blank)",
+		"Same frame (_self)": "Isti frejm (_self)",
+		"Top frame (_top)": "Glavni frejm (_top)",
+		"Other": "Drugo",
+		"Target:": "Otvori u:",
+		"Title (tooltip):": "Naziv (tooltip):",
+		"URL:": "URL:",
+		"You must enter the URL where this link points to": "Morate uneti URL na koji vodi ovaj link",
+		
+        // Insert Table
+        "Insert Table": "Ubaci tabelu",
+        "Rows:": "Redovi",
+        "Number of rows": "Broj redova",
+        "Cols:": "Kolone",
+        "Number of columns": "Broj kolona",
+        "Width:": "Širina",
+        "Width of the table": "Širina tabele",
+        "Percent": "Procenat",
+        "Pixels": "Pikseli",
+        "Em": "Em",
+        "Width unit": "Jedinica širine",
+        "Fixed width columns": "Fiksirana širina kolona",
+        "Positioning of this table": "Postavljanje ove tabele",
+        "Cell spacing:": "Rastojanje ćelija",
+        "Space between adjacent cells": "Rastojanje naspramnih ćelija",
+        "Cell padding:": "Unutrašnja odstojanja u ćeliji",
+        "Space between content and border in cell": "Rastojanje između sadržaja i okvira ćelije",
+
+        // Insert Image
+        "Insert Image": "Ubaci sliku",
+        "Image URL:": "URL slike",
+        "Enter the image URL here": "Unesite URL slike ovde",
+        "Preview": "Pregled",
+        "Preview the image in a new window": "Pregledaj sliku u novom prozoru",
+        "Alternate text:": "Alternativni tekst",
+        "For browsers that don't support images": "Za pretraživače koji ne podržavaju slike",
+        "Positioning of this image": "Postavljanje ove slike",
+        "Image Preview:": "Pregled slike",
+        
+        // Select Color popup
+		"Select Color": "Izaberite boju"
+};
Index: /branches/new-dialogs-merge/lang/th.js
===================================================================
--- /branches/new-dialogs-merge/lang/th.js (revision 885)
+++ /branches/new-dialogs-merge/lang/th.js (revision 885)
@@ -0,0 +1,50 @@
+// I18N constants
+
+// LANG: "th", ENCODING: UTF-8
+// Author: Suchin Prasongbundit, <suchin@joolsoft.com>
+
+// 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.)
+
+{
+  "Bold": "àžàž±àž§àž«àžàž²",
+  "Italic": "àžàž±àž§à¹àž­àžµàž¢àž",
+  "Underline": "àžàžµàžà¹àžªà¹àžà¹àžà¹",
+  "Strikethrough": "àžàžµàžàžàž±àž",
+  "Subscript": "àžàž±àž§àž«à¹àž­àž¢",
+  "Superscript": "àžàž±àž§àž¢àž",
+  "Justify Left": "àžàž±àžàžàžŽàžàžà¹àž²àž¢",
+  "Justify Center": "àžàž±àžàžàž¶à¹àžàžàž¥àž²àž",
+  "Justify Right": "àžàž±àžàžàžŽàžàžàž§àž²",
+  "Justify Full": "àžàž±àžà¹àžà¹àž¡àžàž­àž",
+  "Ordered List": "à¹àž¥àžàž¥àž³àžàž±àž",
+  "Bulleted List": "àž¥àž³àžàž±àž",
+  "Decrease Indent": "àž¥àžàž¢à¹àž­àž«àžà¹àž²",
+  "Increase Indent": "à¹àžàžŽà¹àž¡àž¢à¹àž­àž«àžà¹àž²",
+  "Font Color": "àžªàžµàžàž­àžà¹àžàžàž­àž±àžàž©àž£",
+  "Background Color": "àžªàžµàžàž·à¹àžàž«àž¥àž±àž",
+  "Horizontal Rule": "à¹àžªà¹àžàžàž¶à¹àžàžàž¥àž²àž",
+  "Insert Web Link": "àžŽà¹àžàžŽà¹àž¡àž¥àžŽà¹àžàžà¹",
+  "Insert/Modify Image": "à¹àžàžŽà¹àž¡/à¹àžà¹à¹àžàž àž²àž",
+  "Insert Table": "à¹àžàžŽà¹àž¡àžàž²àž£àž²àž",
+  "Toggle HTML Source": "àžªàž¥àž±àžàžàž²àž£à¹àžªàžàžà¹àžà¹àž HTML",
+  "Enlarge Editor": "àžàž¢àž²àž¢à¹àž«à¹à¹àžà¹àž¡àžàž­",
+  "About this editor": "à¹àžàžµà¹àž¢àž§àžàž±àžà¹àžàž£à¹àžàž£àž¡àžàžµà¹",
+  "Help using editor": "àžàž²àž£à¹àžà¹àžàž²àžà¹àžàž£à¹àžàž£àž¡",
+  "Current style": "àž£àž¹àžà¹àžàžàžàž±àžàžàžžàžàž±àž",
+  "Undoes your last action": "àž¢à¹àž­àžàžàž¥àž±àž",
+  "Redoes your last action": "àžàž³àžà¹àž³",
+  "Cut selection": "àžàž±àžàžªà¹àž§àžàžàžµà¹à¹àž¥àž·àž­àž",
+  "Copy selection": "àžªàž³à¹àžàž²àžªà¹àž§àžàžàžµà¹à¹àž¥àž·àž­àž",
+  "Paste from clipboard": "àž§àž²àžàžàž²àžàžàž¥àžŽàžàžàž­àž£à¹àž",
+  "OK": "àžàžàž¥àž",
+  "Cancel": "àž¢àžà¹àž¥àžŽàž",
+  "Path": "à¹àžªà¹àžàžàž²àž",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "àžàžžàžàž­àž¢àž¹à¹à¹àžà¹àž«àž¡àžàžàž£àž£àž¡àžàž² àžàžàžàžµà¹àžàžžà¹àž¡ [<>] à¹àžàž·à¹àž­àžªàž¥àž±àžàžàž¥àž±àžà¹àžàž¢àž±àžà¹àž«àž¡àžàžàžŽàž¡àžà¹àžàž²àžà¹àžàžà¹àž§àžŽàž£à¹àž"
+}
Index: /branches/new-dialogs-merge/lang/si.js
===================================================================
--- /branches/new-dialogs-merge/lang/si.js (revision 60)
+++ /branches/new-dialogs-merge/lang/si.js (revision 60)
@@ -0,0 +1,50 @@
+// I18N constants
+
+// LANG: "si", ENCODING: UTF-8
+// Author: Tomaz Kregar, x_tomo_x@email.si
+
+// 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.)
+
+{
+  "Bold": "Krepko",
+  "Italic": "LeÅŸeÄe",
+  "Underline": "PodÄrtano",
+  "Strikethrough": "PreÄrtano",
+  "Subscript": "Podpisano",
+  "Superscript": "Nadpisano",
+  "Justify Left": "Poravnaj levo",
+  "Justify Center": "Na sredino",
+  "Justify Right": "Poravnaj desno",
+  "Justify Full": "Porazdeli vsebino",
+  "Ordered List": "OÅ¡tevilÄevanje",
+  "Bulleted List": "OznaÄevanje",
+  "Decrease Indent": "ZmanjÅ¡aj zamik",
+  "Increase Indent": "PoveÄaj zamik",
+  "Font Color": "Barva pisave",
+  "Background Color": "Barva ozadja",
+  "Horizontal Rule": "Vodoravna Ärta",
+  "Insert Web Link": "Vstavi hiperpovezavo",
+  "Insert/Modify Image": "Vstavi sliko",
+  "Insert Table": "Vstavi tabelo",
+  "Toggle HTML Source": "Preklopi na HTML kodo",
+  "Enlarge Editor": "PoveÄaj urejevalnik",
+  "About this editor": "Vizitka za urejevalnik",
+  "Help using editor": "PomoÄ za urejevalnik",
+  "Current style": "Trenutni slog",
+  "Undoes your last action": "Razveljavi zadnjo akcijo",
+  "Redoes your last action": "Uveljavi zadnjo akcijo",
+  "Cut selection": "IzreÅŸi",
+  "Copy selection": "Kopiraj",
+  "Paste from clipboard": "Prilepi",
+  "OK": "V redu",
+  "Cancel": "PrekliÄi",
+  "Path": "Pot",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Si v tekstovnem naÄinu.  Uporabi [<>] gumb za prklop nazaj na WYSIWYG."
+}
Index: /branches/new-dialogs-merge/lang/pl.js
===================================================================
--- /branches/new-dialogs-merge/lang/pl.js (revision 592)
+++ /branches/new-dialogs-merge/lang/pl.js (revision 592)
@@ -0,0 +1,136 @@
+// I18N constants
+// LANG: "pl", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl
+{
+  "Bold": "Pogrubienie",
+  "Italic": "Pochylenie",
+  "Underline": "PodkreÅlenie",
+  "Strikethrough": "PrzekreÅlenie",
+  "Subscript": "Indeks dolny",
+  "Superscript": "Indeks gÃ³rny",
+  "Justify Left": "WyrÃ³wnaj do lewej",
+  "Justify Center": "WyÅrodkuj",
+  "Justify Right": "WyrÃ³wnaj do prawej",
+  "Justify Full": "Wyjustuj",
+  "Ordered List": "Numerowanie",
+  "Bulleted List": "Wypunktowanie",
+  "Decrease Indent": "Zmniejsz wciÄcie",
+  "Increase Indent": "ZwiÄksz wciÄcie",
+  "Font Color": "Kolor czcionki",
+  "Background Color": "Kolor tÅa",
+  "Horizontal Rule": "Linia pozioma",
+  "Insert Web Link": "Wstaw adres sieci Web",
+  "Insert/Modify Image": "Wstaw obraz",
+  "Insert Table": "Wstaw tabelÄ",
+  "Toggle HTML Source": "Edycja WYSIWYG/w ÅºrÃ³dle strony",
+  "Enlarge Editor": "PeÅny ekran",
+  "About this editor": "Informacje o tym edytorze",
+  "Help using editor": "Pomoc",
+  "Current style": "Obecny styl",
+  "Undoes your last action": "Cofa ostatnio wykonane polecenie",
+  "Redoes your last action": "Ponawia ostatnio wykonane polecenie",
+  "Cut selection": "Wycina zaznaczenie do schowka",
+  "Copy selection": "Kopiuje zaznaczenie do schowka",
+  "Paste from clipboard": "Wkleja zawartoÅÄ schowka",
+  "Direction left to right": "Kierunek tekstu lewo-prawo",
+  "Direction right to left": "Kierunek tekstu prawo-lewo",
+  "Remove formatting": "UsuÅ formatowanie",
+  "Select all": "Zaznacz wszystko",
+  "Print document": "Drukuj dokument",
+  "Clear MSOffice tags": "WyczyÅÄ tagi MSOffice",
+  "Clear Inline Font Specifications": "Wycisz bezpoÅrednie przypisania czcionek",
+  "Split Block": "Podziel blok",
+  "Toggle Borders": "WÅÄ
+cz / wyÅÄ
+cz ramki",
+
+  "&mdash; format &mdash;": "&mdash; Format &mdash;",
+  "Heading 1": "NagÅÃ³wek 1",
+  "Heading 2": "NagÅÃ³wek 2",
+  "Heading 3": "NagÅÃ³wek 3",
+  "Heading 4": "NagÅÃ³wek 4",
+  "Heading 5": "NagÅÃ³wek 5",
+  "Heading 6": "NagÅÃ³wek 6",
+  "Normal": "Normalny",
+  "Address": "Adres",
+  "Formatted": "Preformatowany",
+
+  //dialogs
+  "OK": "OK",
+  "Cancel": "Anuluj",
+  "Path": "ÅcieÅŒka",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "JesteÅ w TRYBIE TEKSTOWYM. UÅŒyj przycisku [<>], aby przeÅÄ
+czyÄ siÄ na tryb WYSIWYG.",
+  "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Przycisk Wklej nie dziaÅa w przeglÄ
+darkach Mozilla z uwagi na ustawienia bezpieczeÅstwa. NaciÅnij CRTL-V, aby wkleiÄ zawartoÅÄ schowka.",
+
+  "Alignment:": "WyrÃ³wnanie:",
+  "Not set": "Nie ustawione",
+  "Left": "Do lewej",
+  "Right": "Do prawej",
+  "Texttop": "GÃ³ra tekstu",
+  "Absmiddle": "Abs. Årodek",
+  "Baseline": "Linia bazowa",
+  "Absbottom": "Abs. dÃ³Å",
+  "Bottom": "DÃ³Å",
+  "Middle": "Årodek",
+  "Top": "GÃ³ra",
+
+  "Layout": "Layout",
+  "Spacing": "Spacjowanie",
+  "Horizontal:": "Poziome:",
+  "Horizontal padding": "WciÄcie poziome",
+  "Vertical:": "Pionowe:",
+  "Vertical padding": "WciÄcie pionowe",
+  "Border thickness:": "GruboÅÄ obramowania:",
+  "Leave empty for no border": "Bez ramek - zostaw puste",
+
+  //Insert Link
+  "Insert/Modify Link": "Wstaw/edytuj odnoÅnik",
+  "None (use implicit)": "Brak",
+  "New window (_blank)": "Nowe okno (_blank)",
+  "Same frame (_self)": "Ta sama ramka (_self)",
+  "Top frame (_top)": "GÅÃ³wna ramka (_top)",
+  "Other": "Inne",
+  "Target:": "Okno docelowe:",
+  "Title (tooltip):": "TytuÅ (tooltip):",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Musisz podaÄ URL, na jaki bÄdzie wskazywaÅ odnoÅnik",
+
+  // Insert Table
+  "Insert Table": "Wstaw tabelÄ",
+  "Rows:": "Wierszy:",
+  "Number of rows": "Liczba wierszy",
+  "Cols:": "Kolumn:",
+  "Number of columns": "Liczba kolumn",
+  "Width:": "SzerokoÅÄ:",
+  "Width of the table": "SzerokoÅÄ tabeli",
+  "Percent": "Procent",
+  "Pixels": "Pikseli",
+  "Em": "Em",
+  "Width unit": "Jednostka",
+  "Fixed width columns": "Kolumny o staÅej szerokoÅci",
+  "Positioning of this table": "Pozycjonowanie tabeli",
+  "Cell spacing:": "OdstÄp komÃ³rek:",
+  "Space between adjacent cells": "PrzestrzeÅ pomiÄdzy komÃ³rkami",
+  "Cell padding:": "WciÄcie komÃ³rek:",
+  "Space between content and border in cell": "PrzestrzeÅ miÄdzy krawÄdziÄ
+ a zawartoÅciÄ
+ komÃ³rki",
+
+  // Insert Image
+  "Insert Image": "Wstaw obrazek",
+  "Image URL:": "URL obrazka:",
+  "Enter the image URL here": "Podaj URL obrazka",
+  "Preview": "PodglÄ
+d",
+  "Preview the image in a new window": "PodglÄ
+d obrazka w nowym oknie",
+  "Alternate text:": "Tekst alternatywny:",
+  "For browsers that don't support images": "Dla przeglÄ
+darek, ktÃ³re nie obsÅugujÄ
+ obrazkÃ³w",
+  "Positioning of this image": "Pozycjonowanie obrazka",
+  "Image Preview:": "PodglÄ
+d obrazka:"
+}
Index: /branches/new-dialogs-merge/lang/cz.js
===================================================================
--- /branches/new-dialogs-merge/lang/cz.js (revision 60)
+++ /branches/new-dialogs-merge/lang/cz.js (revision 60)
@@ -0,0 +1,50 @@
+// I18N constants
+
+// LANG: "cz", ENCODING: UTF-8
+// Author: Jiri LÃ¶w, <jirilow@jirilow.com>
+
+// 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.)
+
+{
+  "Bold": "TuÄnÄ",
+  "Italic": "KurzÃ­va",
+  "Underline": "PodtrÅŸenÃ­",
+  "Strikethrough": "PÅeÅ¡krtnutÃ­",
+  "Subscript": "DolnÃ­ index",
+  "Superscript": "HornÃ­ index",
+  "Justify Left": "Zarovnat doleva",
+  "Justify Center": "Na stÅed",
+  "Justify Right": "Zarovnat doprava",
+  "Justify Full": "Zarovnat do stran",
+  "Ordered List": "Seznam",
+  "Bulleted List": "OdrÃ¡ÅŸky",
+  "Decrease Indent": "PÅedsadit",
+  "Increase Indent": "Odsadit",
+  "Font Color": "Barva pÃ­sma",
+  "Background Color": "Barva pozadÃ­",
+  "Horizontal Rule": "VodorovnÃ¡ ÄÃ¡ra",
+  "Insert Web Link": "VloÅŸit odkaz",
+  "Insert/Modify Image": "VloÅŸit obrÃ¡zek",
+  "Insert Table": "VloÅŸit tabulku",
+  "Toggle HTML Source": "PÅepnout HTML",
+  "Enlarge Editor": "NovÃ© okno editoru",
+  "About this editor": "O tÃ©to aplikaci",
+  "Help using editor": "NÃ¡povÄda aplikace",
+  "Current style": "ZvolenÃœ styl",
+  "Undoes your last action": "VrÃ¡tÃ­ poslednÃ­ akci",
+  "Redoes your last action": "Opakuje poslednÃ­ akci",
+  "Cut selection": "Vyjmout",
+  "Copy selection": "KopÃ­rovat",
+  "Paste from clipboard": "VloÅŸit",
+  "OK": "OK",
+  "Cancel": "ZruÅ¡it",
+  "Path": "Cesta",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Jste v TEXTOVÃM REÅœIMU.  PouÅŸijte tlaÄÃ­tko [<>] pro pÅepnutÃ­ do WYSIWIG."
+}
Index: /branches/new-dialogs-merge/lang/hu.js
===================================================================
--- /branches/new-dialogs-merge/lang/hu.js (revision 104)
+++ /branches/new-dialogs-merge/lang/hu.js (revision 104)
@@ -0,0 +1,64 @@
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: MiklÃ³s Somogyi, <somogyine@vnet.hu>
+
+// 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.)
+
+{
+  "Bold": "FÃ©lkÃ¶vÃ©r",
+  "Italic": "DÅlt",
+  "Underline": "AlÃ¡hÃºzott",
+  "Strikethrough": "ÃthÃºzott",
+  "Subscript": "AlsÃ³ index",
+  "Superscript": "FelsÅ index",
+  "Justify Left": "Balra zÃ¡rt",
+  "Justify Center": "KÃ¶zÃ©pre zÃ¡rt",
+  "Justify Right": "Jobbra zÃ¡rt",
+  "Justify Full": "SorkizÃ¡rt",
+  "Ordered List": "SzÃ¡mozott lista",
+  "Bulleted List": "SzÃ¡mozatlan lista",
+  "Decrease Indent": "BehÃºzÃ¡s csÃ¶kkentÃ©se",
+  "Increase Indent": "BehÃºzÃ¡s nÃ¶velÃ©se",
+  "Font Color": "KarakterszÃ­n",
+  "Background Color": "HÃ¡ttÃ©rszÃ­n",
+  "Horizontal Rule": "ElvÃ¡lasztÃ³ vonal",
+  "Insert Web Link": "HiperhivatkozÃ¡s beszÃºrÃ¡sa",
+  "Insert/Modify Image": "KÃ©p beszÃºrÃ¡sa",
+  "Insert Table": "TÃ¡blÃ¡zat beszÃºrÃ¡sa",
+  "Toggle HTML Source": "HTML forrÃ¡s be/ki",
+  "Enlarge Editor": "SzerkesztÅ kÃŒlÃ¶n ablakban",
+  "About this editor": "NÃ©vjegy",
+  "Help using editor": "SÃºgÃ³",
+  "Current style": "AktuÃ¡lis stÃ­lus",
+  "Undoes your last action": "VisszavonÃ¡s",
+  "Redoes your last action": "Ãjra vÃ©grehajtÃ¡s",
+  "Cut selection": "KivÃ¡gÃ¡s",
+  "Copy selection": "MÃ¡solÃ¡s",
+  "Paste from clipboard": "BeillesztÃ©s",
+  "Direction left to right": "IrÃ¡ny balrÃ³l jobbra",
+  "Direction right to left": "IrÃ¡ny jobbrÃ³l balra",
+  "OK": "Rendben",
+  "Cancel": "MÃ©gsem",
+  "Path": "Hierarchia",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "ForrÃ¡s mÃ³d. VisszavÃ¡ltÃ¡s [<>] gomb",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "A teljeskÃ©prenyÅs szerkesztÃ©s hibÃ¡t okozhat Internet Explorer hasznÃ¡lata esetÃ©n, ez a bÃ¶ngÃ©szÅ a hibÃ¡ja, amit nem tudunk kikerÃŒlni. Szemetet Ã©szlelhet a kÃ©prenyÅn, illetve nÃ©hÃ¡ny funkciÃ³ hiÃ¡nyozhat Ã©s/vagy vÃ©letlenszerÅ±en lefagyhat a bÃ¶ngÃ©szÅ. Windows 9x operaciÃ³s futtatÃ¡sa esetÃ©n elÃ©g valÃ³szÃ­nÅ±, hogy ",
+  "Cancel": "MÃ©gsem",
+  "Insert/Modify Link": "HivatkozÃ¡s BeszÃºrÃ¡sa/MÃ³dosÃ­tÃ¡sa",
+  "New window (_blank)": "Ãj ablak (_blank)",
+  "None (use implicit)": "Nincs (use implicit)",
+  "Other": "MÃ¡s",
+  "Same frame (_self)": "Ugyanabba a keretbe (_self)",
+  "Target:": "CÃ©l:",
+  "Title (tooltip):": "CÃ­m (tooltip):",
+  "Top frame (_top)": "FelsÅ keret (_top)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Be kell Ã­rnia az URL-t, ahova a hivatkozÃ¡s mutasson"
+}
Index: /branches/new-dialogs-merge/lang/it.js
===================================================================
--- /branches/new-dialogs-merge/lang/it.js (revision 856)
+++ /branches/new-dialogs-merge/lang/it.js (revision 856)
@@ -0,0 +1,55 @@
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8
+// Author: Mattia Landoni, http://www.webpresident.org/
+
+{
+  "Bold": "Grassetto",
+  "Italic": "Corsivo",
+  "Underline": "Sottolineato",
+  "Strikethrough": "Barrato",
+  "Subscript": "Pedice",
+  "Superscript": "Apice",
+  "Justify Left": "Sinistra",
+  "Justify Center": "Centrato",
+  "Justify Right": "Destra",
+  "Justify Full": "Giustificato",
+  "Ordered List": "Lista numerata",
+  "Bulleted List": "Lista non numerata",
+  "Decrease Indent": "Diminuisci indentazione",
+  "Increase Indent": "Aumenta indentazione",
+  "Font Color": "Colore font",
+  "Background Color": "Colore sfondo",
+  "Horizontal Rule": "Righello orizzontale",
+  "Insert Web Link": "Inserisci link",
+  "Insert/Modify Image": "Inserisci/modifica Immagine",
+  "Insert Table": "Inserisci tabella",
+  "Toggle HTML Source": "Visualizza/nascondi sorgente HTML",
+  "Enlarge Editor": "Allarga editor",
+  "About this editor": "Informazioni su Xinha",
+  "Help using editor": "Aiuto",
+  "Current style": "Stile corrente",
+  "Undoes your last action": "Annulla ultima azione",
+  "Redoes your last action": "Ripeti ultima azione",
+  "Cut selection": "Taglia",
+  "Copy selection": "Copia",
+  "Paste from clipboard": "Incolla",
+  "Direction left to right": "Testo da sx a dx",
+  "Direction right to left": "Testo da dx a sx",
+  "OK": "OK",
+  "Cancel": "Annulla",
+  "Path": "Percorso",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Sei in MODALITA",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "E",
+  "Cancel": "Annulla",
+  "Insert/Modify Link": "Inserisci/modifica link",
+  "New window (_blank)": "Nuova finestra (_blank)",
+  "None (use implicit)": "Niente (usa implicito)",
+  "Other": "Altro",
+  "Same frame (_self)": "Stessa frame (_self)",
+  "Target:": "Target:",
+  "Title (tooltip):": "Title (suggerimento):",
+  "Top frame (_top)": "Pagina intera (_top)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Devi inserire l'indirizzo a cui punta il link"
+}
Index: /branches/new-dialogs-merge/lang/lt.js
===================================================================
--- /branches/new-dialogs-merge/lang/lt.js (revision 104)
+++ /branches/new-dialogs-merge/lang/lt.js (revision 104)
@@ -0,0 +1,64 @@
+// I18N constants
+
+// LANG: "lt", ENCODING: UTF-8
+// Author: Jaroslav Å atkeviÄ, <jaro@akl.lt>
+
+{
+  "Bold": "ParyÅ¡kinti",
+  "Italic": "Kursyvas",
+  "Underline": "Pabraukti",
+  "Strikethrough": "Perbraukti",
+  "Subscript": "Apatinis indeksas",
+  "Superscript": "VirÅ¡utinis indeksas",
+  "Justify Left": "Lygiavimas pagal kairÄ",
+  "Justify Center": "Lygiavimas pagal centrÄ
+",
+  "Justify Right": "Lygiavimas pagal deÅ¡inÄ",
+  "Justify Full": "Lygiuoti pastraipÄ
+",
+  "Ordered List": "Numeruotas sÄ
+raÅ¡as",
+  "Bulleted List": "SuÅŸenklintas sÄ
+raÅ¡as",
+  "Decrease Indent": "SumaÅŸinti paraÅ¡tÄ",
+  "Increase Indent": "Padidinti paraÅ¡tÄ",
+  "Font Color": "Å rifto spalva",
+  "Background Color": "Fono spalva",
+  "Horizontal Rule": "Horizontali linija",
+  "Insert Web Link": "Ä®terpti nuorodÄ
+",
+  "Insert/Modify Image": "Ä®terpti paveiksliukÄ
+",
+  "Insert Table": "Ä®terpti lentelÄ",
+  "Toggle HTML Source": "Perjungti Ä¯ HTML/WYSIWYG",
+  "Enlarge Editor": "IÅ¡plÄstas redagavimo ekranas/Enlarge Editor",
+  "About this editor": "Apie redaktoriÅ³",
+  "Help using editor": "Pagalba naudojant redaktoriÅ³",
+  "Current style": "Dabartinis stilius",
+  "Undoes your last action": "AtÅ¡aukia paskutini jÅ«sÅ³ veiksmÄ
+",
+  "Redoes your last action": "Pakartoja paskutinÄ¯ atÅ¡auktÄ
+ jÅ«sÅ³ veiksmÄ
+",
+  "Cut selection": "IÅ¡kirpti",
+  "Copy selection": "Kopijuoti",
+  "Paste from clipboard": "Ä®terpti",
+  "OK": "OK",
+  "Cancel": "AtÅ¡aukti",
+  "Path": "Kelias",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "JÅ«s esete teksto reÅŸime.  Naudokite [<>] mygtukÄ
+ grÄ¯ÅŸimui Ä¯ WYSIWYG.",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren",
+  "Cancel": "AtÅ¡aukti",
+  "Insert/Modify Link": "IdÄti/Modifikuoti",
+  "New window (_blank)": "Naujas langas (_blank)",
+  "None (use implicit)": "None (use implicit)",
+  "Other": "Kitas",
+  "Same frame (_self)": "Same frame (_self)",
+  "Target:": "Target:",
+  "Title (tooltip):": "Pavadinimas (tooltip):",
+  "Top frame (_top)": "Top frame (_top)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Jus privalote nurodyti URL Ä¯ kuri rodo Å¡itÄ
+ nuoroda"
+}
Index: /branches/new-dialogs-merge/lang/ro.js
===================================================================
--- /branches/new-dialogs-merge/lang/ro.js (revision 104)
+++ /branches/new-dialogs-merge/lang/ro.js (revision 104)
@@ -0,0 +1,63 @@
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// 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.)
+
+{
+  "Bold": "ÃngroÅat",
+  "Italic": "Italic",
+  "Underline": "Subliniat",
+  "Strikethrough": "TÄiat",
+  "Subscript": "Indice jos",
+  "Superscript": "Indice sus",
+  "Justify Left": "Aliniere la stÃ¢nga",
+  "Justify Center": "Aliniere pe centru",
+  "Justify Right": "Aliniere la dreapta",
+  "Justify Full": "Aliniere Ã®n ambele pÄrÅ£i",
+  "Ordered List": "ListÄ ordonatÄ",
+  "Bulleted List": "ListÄ marcatÄ",
+  "Decrease Indent": "MicÅoreazÄ alineatul",
+  "Increase Indent": "MÄreÅte alineatul",
+  "Font Color": "Culoarea textului",
+  "Background Color": "Culoare de fundal",
+  "Horizontal Rule": "Linie orizontalÄ",
+  "Insert Web Link": "InsereazÄ/modificÄ link",
+  "Insert/Modify Image": "InsereazÄ/modificÄ imagine",
+  "Insert Table": "InsereazÄ un tabel",
+  "Toggle HTML Source": "Sursa HTML / WYSIWYG",
+  "Enlarge Editor": "MaximizeazÄ editorul",
+  "About this editor": "Despre editor",
+  "Help using editor": "DocumentaÅ£ie (devel)",
+  "Current style": "Stilul curent",
+  "Undoes your last action": "AnuleazÄ ultima acÅ£iune",
+  "Redoes your last action": "Reface ultima acÅ£iune anulatÄ",
+  "Cut selection": "Taie Ã®n clipboard",
+  "Copy selection": "Copie Ã®n clipboard",
+  "Paste from clipboard": "Aduce din clipboard",
+  "Direction left to right": "DirecÅ£ia de scriere: stÃ¢nga - dreapta",
+  "Direction right to left": "DirecÅ£ia de scriere: dreapta - stÃ¢nga",
+  "OK": "OK",
+  "Cancel": "AnuleazÄ",
+  "Path": "Calea",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "EÅti Ã®n modul TEXT.  ApasÄ butonul [<>] pentru a te Ã®ntoarce Ã®n modul WYSIWYG.",
+  "Cancel": "RenunÅ£Ä",
+  "Insert/Modify Link": "InsereazÄ/modifcÄ link",
+  "New window (_blank)": "FereastrÄ nouÄ (_blank)",
+  "None (use implicit)": "Nimic (foloseÅte ce-i implicit)",
+  "Other": "Alt target",
+  "Same frame (_self)": "AceeaÅi fereastrÄ (_self)",
+  "Target:": "Å¢inta:",
+  "Title (tooltip):": "Titlul (tooltip):",
+  "Top frame (_top)": "Fereastra principalÄ (_top)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Trebuie sÄ introduceÅ£i un URL"
+}
Index: /branches/new-dialogs-merge/lang/lv.js
===================================================================
--- /branches/new-dialogs-merge/lang/lv.js (revision 60)
+++ /branches/new-dialogs-merge/lang/lv.js (revision 60)
@@ -0,0 +1,42 @@
+// I18N constants
+
+// LANG: "lv", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+// Translated by: Janis Klavins, <janis.klavins@devia.lv>
+
+{
+  "Bold": "Trekniem burtiem",
+  "Italic": "Kursîvâ",
+  "Underline": "Pasvîtrots",
+  "Strikethrough": "Pârsvîtrots",
+  "Subscript": "Novietot zem rindas",
+  "Superscript": "Novietot virs rindas",
+  "Justify Left": "Izlîdzinât pa kreisi",
+  "Justify Center": "Izlîdzinât centrâ",
+  "Justify Right": "Izlîdzinât pa labi",
+  "Justify Full": "Izlîdzinât pa visu lapu",
+  "Ordered List": "Numurçts saraksts",
+  "Bulleted List": "Saraksts",
+  "Decrease Indent": "Samazinât atkâpi",
+  "Increase Indent": "Palielinât atkâpi",
+  "Font Color": "Burtu krâsa",
+  "Background Color": "Fona krâsa",
+  "Horizontal Rule": "Horizontâla atdalîtâjsvîtra",
+  "Insert Web Link": "Ievietot hipersaiti",
+  "Insert/Modify Image": "Ievietot attçlu",
+  "Insert Table": "Ievietot tabulu",
+  "Toggle HTML Source": "Skatît HTML kodu",
+  "Enlarge Editor": "Palielinât Rediìçtâju",
+  "About this editor": "Par ðo rediìçtâju",
+  "Help using editor": "Rediìçtâja palîgs",
+  "Current style": "Patreizçjais stils",
+  "Undoes your last action": "Atcelt pçdçjo darbîbu",
+  "Redoes your last action": "Atkârtot pçdçjo darbîbu",
+  "Cut selection": "Izgriezt iezîmçto",
+  "Copy selection": "Kopçt iezîmçto",
+  "Paste from clipboard": "Ievietot iezîmçto",
+  "OK": "Labi",
+  "Cancel": "Atcelt",
+  "Path": "Ceïð",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Jûs patlaban darbojaties TEKSTA REÞÎMÂ. Lai pârietu atpakaï uz GRAFISKO REÞÎMU (WYSIWIG), lietojiet [<>] pogu."
+}
Index: /branches/new-dialogs-merge/lang/vn.js
===================================================================
--- /branches/new-dialogs-merge/lang/vn.js (revision 60)
+++ /branches/new-dialogs-merge/lang/vn.js (revision 60)
@@ -0,0 +1,57 @@
+// I18N constants : Vietnamese
+// LANG: "en", ENCODING: UTF-8
+// Author: Nguyá»
+n ÄÃ¬nh Nam, <hncryptologist@yahoo.com>
+// Modified 21/07/2004 by Pháº¡m Mai QuÃ¢n <pmquan@4vn.org>
+
+{
+  "Bold": "Äáº­m",
+  "Italic": "NghiÃªng",
+  "Underline": "Gáº¡ch ChÃ¢n",
+  "Strikethrough": "Gáº¡ch XÃ³a",
+  "Subscript": "Viáº¿t Xuá»ng DÆ°á»i",
+  "Superscript": "Viáº¿t LÃªn TrÃªn",
+  "Justify Left": "CÄn TrÃ¡i",
+  "Justify Center": "CÄn Giá»¯a",
+  "Justify Right": "CÄn Pháº£i",
+  "Justify Full": "CÄn Äá»u",
+  "Ordered List": "Danh SÃ¡ch CÃ³ Thá»© Tá»± (1, 2, 3)",
+  "Bulleted List": "Danh SÃ¡ch Phi Thá»© Tá»± (Cháº¥m Äáº§u dÃ²ng)",
+  "Decrease Indent": "LÃ¹i Ra NgoÃ i",
+  "Increase Indent": "Thá»¥t VÃ o Trong",
+  "Font Color": "MÃ u Chá»¯",
+  "Background Color": "MÃ u Ná»n",
+  "Horizontal Rule": "DÃ²ng Káº» Ngang",
+  "Insert Web Link": "Táº¡o LiÃªn Káº¿t",
+  "Insert/Modify Image": "ChÃšn áº¢nh",
+  "Insert Table": "ChÃšn Báº£ng",
+  "Toggle HTML Source": "Cháº¿ Äá» MÃ£ HTML",
+  "Enlarge Editor": "PhÃ³ng To Ã Soáº¡n Tháº£o",
+  "About this editor": "Tá»± Giá»i Thiá»u",
+  "Help using editor": "GiÃºp Äá»¡",
+  "Current style": "Äá»nh Dáº¡ng Hiá»n Thá»i",
+  "Undoes your last action": "Há»§y thao tÃ¡c trÆ°á»c",
+  "Redoes your last action": "Láº¥y láº¡i thao tÃ¡c vá»«a bá»",
+  "Cut selection": "Cáº¯t",
+  "Copy selection": "Sao chÃ©p",
+  "Paste from clipboard": "DÃ¡n",
+  "Direction left to right": "Viáº¿t tá»« trÃ¡i sang pháº£i",
+  "Direction right to left": "Viáº¿t tá»« pháº£i sang trÃ¡i",
+  "OK": "Äá»ng Ãœ",
+  "Cancel": "Há»§y",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Cháº¿ Äá» phÃ³ng to ÃŽ soáº¡n tháº£o cÃ³ thá» gÃ¢y lá»i vá»i Internet Explorer vÃ¬ má»t sá» lá»i cá»§a trÃ¬nh duyá»t nÃ y, vÃ¬ tháº¿ cháº¿ Äá» nÃ y cÃ³ thá» sáºœ khÃŽng cháº¡y. Hiá»n thá» khÃŽng ÄÃºng, lá»n xá»n, khÃŽng cÃ³ Äáº§y Äá»§ chá»©c nÄng, vÃ  cÅ©ng cÃ³ thá» lÃ m trÃ¬nh duyá»t cá»§a báº¡n bá» táº¯t ngang. Náº¿u báº¡n Äang sá»­ dá»¥ng Windows 9x báº¡n cÃ³ thá» bá» bÃ¡o lá»i ",
+  "Path": "ÄÆ°á»ng Dáº«n",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Báº¡n Äang á» cháº¿ Äá» text.  Sá»­ dá»¥ng nÃºt [<>] Äá» chuyá»n láº¡i cháº¿ Äá» WYSIWIG.",
+  "Cancel": "Há»§y",
+  "Insert/Modify Link": "ThÃªm/Chá»nh sá»­a ÄÆ°á»ng dáº«n",
+  "New window (_blank)": "Cá»­a sá» má»i (_blank)",
+  "None (use implicit)": "KhÃŽng (sá»­ dá»¥ng implicit)",
+  "OK": "Äá»ng Ãœ",
+  "Other": "KhÃ¡c",
+  "Same frame (_self)": "TrÃªn cÃ¹ng khung (_self)",
+  "Target:": "NÆ¡i hiá»n thá»:",
+  "Title (tooltip):": "TiÃªu Äá» (cá»§a hÆ°á»ng dáº«n):",
+  "Top frame (_top)": "Khung trÃªn cÃ¹ng (_top)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Báº¡n pháº£i Äiá»n Äá»a chá» (URL) mÃ  ÄÆ°á»ng dáº«n sáºœ liÃªn káº¿t tá»i"
+}
Index: /branches/new-dialogs-merge/lang/da.js
===================================================================
--- /branches/new-dialogs-merge/lang/da.js (revision 60)
+++ /branches/new-dialogs-merge/lang/da.js (revision 60)
@@ -0,0 +1,30 @@
+// LANG: "da", ENCODING: UTF-8
+// Author: rene, <rene@laerke.net>
+
+{
+  "Bold": "Fed",
+  "Italic": "Kursiv",
+  "Underline": "Understregning",
+  "Strikethrough": "Overstregning ",
+  "Subscript": "SÃŠnket skrift",
+  "Superscript": "HÃŠvet skrift",
+  "Justify Left": "Venstrejuster",
+  "Justify Center": "Centrer",
+  "Justify Right": "HÃžjrejuster",
+  "Justify Full": "Lige margener",
+  "Ordered List": "Opstilling med tal",
+  "Bulleted List": "Opstilling med punkttegn",
+  "Decrease Indent": "Formindsk indrykning",
+  "Increase Indent": "ForÃžg indrykning",
+  "Font Color": "Skriftfarve",
+  "Background Color": "Baggrundsfarve",
+  "Horizontal Rule": "Horisontal linie",
+  "Insert Web Link": "IndsÃŠt hyperlink",
+  "Insert/Modify Image": "IndsÃŠt billede",
+  "Insert Table": "IndsÃŠt tabel",
+  "Toggle HTML Source": "HTML visning",
+  "Enlarge Editor": "Vis editor i popup",
+  "About this editor": "Om htmlarea",
+  "Help using editor": "HjÃŠlp",
+  "Current style": "Anvendt stil"
+}
Index: /branches/new-dialogs-merge/lang/sr.js
===================================================================
--- /branches/new-dialogs-merge/lang/sr.js (revision 901)
+++ /branches/new-dialogs-merge/lang/sr.js (revision 901)
@@ -0,0 +1,140 @@
+﻿// I18N constants
+
+// LANG: "sh", ENCODING: UTF-8 | ISO-8859-5
+// Author: Ljuba Ranković, http://www.rankovic.net/ljubar
+
+// 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.)
+
+{
+		"Bold": "Масно",
+		"Italic": "Курзив",
+		"Underline": "Подвучено",
+		"Strikethrough": "Прецртано",
+		"Subscript": "Индекс-текст",
+		"Superscript": "Експонент-текст",
+		"Justify Left": "Равнање улево",
+		"Justify Center": "Равнање по симетрали",
+		"Justify Right": "Равнање удесно",
+		"Justify Full": "Пуно равнање",
+		"Ordered List": "Листа са редним бројевима",
+		"Bulleted List": "Листа са симболима",
+		"Decrease Indent": "Смањи увлачење",
+		"Increase Indent": "Повећај увлачење",
+		"Font Color": "Боја слова",
+		"Background Color": "Боја позадине",
+		"Horizontal Rule": "Хоризонтална линија",
+		"Insert Web Link": "додај веб линк",
+		"Insert/Modify Image": "додај/промени слику",
+		"Insert Table": "Убаци табелу",
+		"Toggle HTML Source": "Пребаци на приказ ХТМЛ кода",
+		"Enlarge Editor": "Повећај едитор",
+		"About this editor": "О овом едитору",
+		"Help using editor": "Помоћ при коришћењу едитора",
+		"Current style": "Важећи стил",
+		"Undoes your last action": "Поништава последњу радњу",
+		"Redoes your last action": "Враћа последњу радњу",
+		"Cut selection": "Исеци изабрано",
+		"Copy selection": "Копирај изабрано",
+		"Paste from clipboard": "Залепи из клипборда",
+		"Direction left to right": "Правац с лева на десно",
+		"Direction right to left": "Правац с десна на лево",
+        "Remove formatting": "Уклони форматирање",
+        "Select all": "Изабери све",
+        "Print document": "Штампај документ",
+        "Clear MSOffice tags": "Обриши MSOffice тагове",
+        "Clear Inline Font Specifications": "Обриши примењене особине фонта",
+        "Split Block": "Подели блок",
+        "Toggle Borders": "Пребаци оквирне линије",
+
+        "&mdash; format &mdash;": "&mdash; Format &mdash;",
+        "Heading 1": "Заглавље 1",
+        "Heading 2": "Заглавље 2",
+        "Heading 3": "Заглавље 3",
+        "Heading 4": "Заглавље 4",
+        "Heading 5": "Заглавље 5",
+        "Heading 6": "Заглавље 6",
+        "Normal": "обичан",
+        "Address": "адреса",
+        "Formatted": "форматиран",		
+		
+        // dialogs
+		"OK": "OK",
+		"Cancel": "Поништи",
+		"Path": "Путања",
+		"You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.":    "Налазите се у ТЕКСТ режиму.  Користите [<>] дугме за повратак на ШВТИД (WYSIWYG).",
+
+		"The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Дугме 'залепи' не ради у претраживачима породице Mozilla (из разлога сигурности). Притисните CTRL-V на тастатури да директно залепите.",
+		
+        "Alignment:": "Равнање",
+        "Not set": "Није постављено",
+        "Left": "Лево",
+        "Right": "Десно",
+        "Texttop": "Врх текста",
+        "Absmiddle": "Апсолутна средина",
+        "Baseline": "Доња линија",
+        "Absbottom": "Апсолутно дно",
+        "Bottom": "Дно",
+        "Middle": "Средина",
+        "Top": "Врх",
+
+        "Layout": "Прелом",
+        "Spacing": "Размак",
+        "Horizontal:": "По хоризонтали",
+        "Horizontal padding": "Хортизонтално одстојање",
+        "Vertical:": "По вертикали",
+        "Vertical padding": "Вертикално одстојање",
+        "Border thickness:": "Дебљина оквира",
+        "Leave empty for no border": "Остави празно кад нема оквира",
+
+        // Insert Link
+		"Insert/Modify Link": "додај/промени линк",
+		"None (use implicit)": "користи подразумевано",
+		"New window (_blank)": "Новом прозору (_blank)",
+		"Same frame (_self)": "Исти фрејм (_self)",
+		"Top frame (_top)": "Главни фрејм (_top)",
+		"Other": "Друго",
+		"Target:": "Отвори у:",
+		"Title (tooltip):": "Назив (tooltip):",
+		"URL:": "УРЛ:",
+		"You must enter the URL where this link points to": "Морате унети УРЛ на који води овај линк",
+
+        // Insert Table
+        "Insert Table": "Убаци табелу",
+        "Rows:": "Редови",
+        "Number of rows": "Број редова",
+        "Cols:": "Колоне",
+        "Number of columns": "Број колона",
+        "Width:": "Ширина",
+        "Width of the table": "Ширина табеле",
+        "Percent": "Процената",
+        "Pixels": "Пиксела",
+        "Em": "Ем",
+        "Width unit": "Јединица ширине",
+        "Fixed width columns": "Фиксирана ширина колоне",
+        "Positioning of this table": "Постављање ове табеле",
+        "Cell spacing:": "Размак између ћелија",
+        "Space between adjacent cells": "Размак између наспрамних ћелија",
+        "Cell padding:": "Унутрашња одстојања од ивица ћелије",
+        "Space between content and border in cell": "Растојање између садржаја у ћелији и њеног оквира",
+
+        // Insert Image
+        "Insert Image": "Убаци слику",
+        "Image URL:": "УРЛ слике",
+        "Enter the image URL here": "Унесите УРЛ слике овде",
+        "Preview": "Преглед",
+        "Preview the image in a new window": "Прегледај слику у новом прозору",
+        "Alternate text:": "алтернативни текст",
+        "For browsers that don't support images": "За претраживаче који не подржавају слике",
+        "Positioning of this image": "Постављање ове слике",
+        "Image Preview:": "Преглед слике",
+
+        // Select Color popup
+		"Select Color": "Изабери боју"
+};
Index: /branches/new-dialogs-merge/lang/fa.js
===================================================================
--- /branches/new-dialogs-merge/lang/fa.js (revision 934)
+++ /branches/new-dialogs-merge/lang/fa.js (revision 934)
@@ -0,0 +1,169 @@
+﻿// I18N constants
+// LANG: "fa", ENCODING: UTF-8
+{
+  "Bold": "ضخیم",
+  "Italic": "مورب",
+  "Underline": "زیر خط",
+  "Strikethrough": "رو خط",
+  "Subscript": "زیروند",
+  "Superscript": "بالاوند",
+  "Justify Left": "تراز از چپ",
+  "Justify Center": "تراز در وسط",
+  "Justify Right": "تراز در راست",
+  "Justify Full": "تراز از چپ و راست",
+  "Ordered List": "فهرست مرتب",
+  "Bulleted List": "فهرست گلوله ای",
+  "Decrease Indent": "کاهش سر خط",
+  "Increase Indent": "افزایش سر خط",
+  "Font Color": "رنگ فلم",
+  "Background Color": "رنگ پس زمینه",
+  "Horizontal Rule": "خط افقی",
+  "Insert Web Link": "افزودن لینک وب",
+  "Insert/Modify Image": "افزودن یا ویرایش تصویر",
+  "Insert Table": "افزودن جدول",
+  "Toggle HTML Source": "مشاهده یا عدم مشاهده متن در قالب HTML",
+  "Enlarge Editor": "بزرگ کردن ویرایش گر",
+  "About this editor": "درباره این ویرایش گر",
+  "Help using editor": "راهنمای استفاده ویرایش گر",
+  "Current style": "شیوه کنونی",
+  "Undoes your last action": "برگرداندن آخرین عمل",
+  "Redoes your last action": "انجام مجدد آخرین عمل",
+  "Cut selection": "بریدن انتخاب شده",
+  "Copy selection": "کپی انتخاب شده",
+  "Paste from clipboard": "چسباندن از تخته کار",
+  "Direction left to right": "جهت از چپ به راست",
+  "Direction right to left": "جهت از راست به چپ",
+  "Remove formatting": "حذف فرمت بندی",
+  "Select all": "انتخاب همه",
+  "Print document": "چاپ سند",
+  "Clear MSOffice tags": "پاک کردن متن از برچسب های MSOffice",
+  "Clear Inline Font Specifications": "پاک کردن متن از مشخصات فونت",
+  "Would you like to clear font typefaces?": "آیا تمایل دارید ظاهر فلم را پاک کنید؟",
+  "Would you like to clear font sizes?": "آیا تمایل دارید اندازه قلم را پاک کنید",
+  "Would you like to clear font colours?": "آیا تمایل دارید رنگ قلم را پاک کنید؟",
+  "Split Block": "بلاک جداسازی",
+  "Toggle Borders": "فعال/غیر فعال کردن لبه ها",
+  "Save as": "ذخیره مانند...",
+  "Insert/Overwrite": "افزودن/جانویسی",
+  "&mdash; format &mdash;": "&mdash; قالب &mdash;",
+  "Heading 1": "تیتر 1",
+  "Heading 2": "تیتر 2",
+  "Heading 3": "تیتر 3",
+  "Heading 4": "تیتر 4",
+  "Heading 5": "تیتر 5",
+  "Heading 6": "تیتر 6",
+  "Normal": "معمولی",
+  "Address": "آدرس",
+  "Formatted": "قالب بندی شده",
+
+  //dialogs
+  "OK": "بله",
+  "Cancel": "انصراف",
+  "Path": "مسیر",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "در مد متنی هستید.  از دکمه [<>] استفاده نمایید تا به مد WYSIWYG برگردید.",
+  "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "دکمه چسباندن در مرورگرهای سری Mozilla کار نمی کند (به دلایل فنی امنیتی).برای چسباندن مستقیم ، دکمه CTRL-V را در صفحه کلید بزنید.",
+  "Your Document is not well formed. Check JavaScript console for details.": "سند شما بدرستی قالب بندی نشده است. برای اطلاعات بیشتر پایانه نمایش جاوااسکریپت را بررسی کنید.",
+
+  "Alignment:": "تراز بندی",
+  "Not set": "تنظیم نشده",
+  "Left": "چپ",
+  "Right": "راست",
+  "Texttop": "بالای متن",
+  "Absmiddle": "دقیقا وسط",
+  "Baseline": "ابتدای خط",
+  "Absbottom": "دقیقا پایین",
+  "Bottom": "پایین",
+  "Middle": "وسط",
+  "Top": "بالا",
+
+  "Layout": "لایه",
+  "Spacing": "فاصله گذاری",
+  "Horizontal:": "افقی",
+  "Horizontal padding": "پرکننده افقی",
+  "Vertical:": "عمودی",
+  "Vertical padding": "پرکننده عمودی",
+  "Border thickness:": "ضخامت لبه",
+  "Leave empty for no border": "برای بدون لبه خالی رها کن",
+
+  //Insert Link
+  "Insert/Modify Link": "افزودن / ویرایش لینک",
+  "None (use implicit)": "هیچکدام (استفاده از بدون شرط)",
+  "New window (_blank)": "پنجره جدید (_blank)",
+  "Same frame (_self)": "فریم یکسان (_self)",
+  "Top frame (_top)": "فریم بالایی (_top)",
+  "Other": "سایر",
+  "Target:": "هدف",
+  "Title (tooltip):": "عنوان (راهنمای یک خطی)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "باید URLی که این لینک به آن اشاره دارد را وارد کنید",
+  "You need to select some text before creating a link": "باید قبل از ساخت لینک ، متنی را انتخاب نمایید",
+
+  // Insert Table
+  "Insert Table": "افزودن جدول",
+  "Rows:": "ردیف ها",
+  "Number of rows": "تعداد ردیف ها",
+  "Cols:": "ستون ها",
+  "Number of columns": "تعداد ستون ها",
+  "Width:": "طول",
+  "Width of the table": "طول جدول",
+  "Percent": "درصد",
+  "Pixels": "پیکسل ها",
+  "Em": "Em",
+  "Width unit": "واحد طول",
+  "Fixed width columns": "ستون های طول ثابت",
+  "Positioning of this table": "موقعیت یابی این جدول",
+  "Cell spacing:": "فاصله سلول ها",
+  "Space between adjacent cells": "فاصله بین سلول های همجوار",
+  "Cell padding:": "پر کننده سلول",
+  "Space between content and border in cell": "فاصله بین محتوا و لبه در سلول",
+  "You must enter a number of rows": "باید تعداد ردیف ها را وارد کنید",
+  "You must enter a number of columns": "باید تعداد ستون ها را وارد کنید",
+
+  // Insert Image
+  "Insert Image": "افزودن تصویر",
+  "Image URL:": "URL تصویر",
+  "Enter the image URL here": "URL تصویر را اینجا وارد کنید",
+  "Preview": "پیش نمایش",
+  "Preview the image in a new window": "پیش نمایش تصویر در پنجره ای جدید",
+  "Alternate text:": "متن جایگزین",
+  "For browsers that don't support images": "برای مرورگرهایی که از تصاویر پشتیبانی نمی کنند",
+  "Positioning of this image": "موقعیت یابی تصویر",
+  "Image Preview:": "پیش نمایش تصویر",
+  "You must enter the URL": "شما باید URL را وارد کنید",
+
+  // toolbar
+  /*
+  "button_bold": "fr/bold.gif",
+  "button_underline": "fr/underline.gif",
+  "button_strikethrough": "fr/strikethrough.gif",
+  */
+
+  // Editor Help
+  "Xinha Help": "راهنمای Xinha",
+  "Editor Help": "راهنمای ویرایشگر",
+  "Keyboard shortcuts": "میانبرهای صفحه کلید",
+  "The editor provides the following key combinations:": "ویرایشگر استفاده از کلید های گروهی زیر را مسیر می سازد :",
+  "ENTER": "ENTREE",
+  "new paragraph": "پاراگراف جدید",
+  "SHIFT-ENTER": "SHIFT+ENTREE",
+  "insert linebreak": "افزودن جدا کننده خط",
+  "Set format to paragraph": "تغییر قالب به پاراگراف",
+  "Clean content pasted from Word": "تمیز کردن محتوای چسبانده شده از Word",
+  "Headings": "عنوان گذاری",
+  "Close": "بستن",
+
+  // Loading messages
+  "Loading in progress. Please wait !": "بارگذاری در حال انجام است. لطفا صبر کنید !",
+  "Constructing main object": "ساختن شیء اصلی",
+  "Constructing object": "ساختن شیء",
+  "Register panel right": "ثبت قاب راست",
+  "Register panel left": "ثبت قاب چپ",
+  "Register panel top": "ثبت قاب بالا",
+  "Register panel bottom": "ثبت قاب پایین",
+  "Create Toolbar": "ساخت نوار ابزار",
+  "Create StatusBar": "ساخت نوار وضعیت",
+  "Generate Xinha object": "تولید شیء Xinha",
+  "Init editor size": "مقدار دهی اندازه ویرایشگر",
+  "Init IFrame": "مقدار دهی IFrame",
+  "Register plugin $plugin": "ثبت پلاگین $plugin"
+};
Index: /branches/new-dialogs-merge/lang/ru.js
===================================================================
--- /branches/new-dialogs-merge/lang/ru.js (revision 517)
+++ /branches/new-dialogs-merge/lang/ru.js (revision 517)
@@ -0,0 +1,193 @@
+// I18N constants
+
+// LANG: "ru", ENCODING: UTF-8
+// Author: Yulya Shtyryakova, <yulya@vdcom.ru>
+
+// Some additions by: Alexey Kirpichnikov, <alexkir@kiwistudio.ru>
+// I took French version as a source of English phrases because French version was the most comprehensive
+// (fr.js was the largest file, actually) %)
+
+// 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.)
+
+{
+  "Bold": "ÐÐŸÐ»ÑÐ¶ÐžÑÐœÑÐ¹",
+  "Italic": "ÐÐ°ÐºÐ»ÐŸÐœÐœÑÐ¹",
+  "Underline": "ÐÐŸÐŽÑÐµÑÐºÐœÑÑÑÐ¹",
+  "Strikethrough": "ÐÐµÑÐµÑÐµÑÐºÐœÑÑÑÐ¹",
+  "Subscript": "ÐÐžÐ¶ÐœÐžÐ¹ ÐžÐœÐŽÐµÐºÑ",
+  "Superscript": "ÐÐµÑÑ
+ÐœÐžÐ¹ ÐžÐœÐŽÐµÐºÑ",
+  "Justify Left": "ÐÐŸ Ð»ÐµÐ²ÐŸÐŒÑ ÐºÑÐ°Ñ",
+  "Justify Center": "ÐÐŸ ÑÐµÐœÑÑÑ",
+  "Justify Right": "ÐÐŸ Ð¿ÑÐ°Ð²ÐŸÐŒÑ ÐºÑÐ°Ñ",
+  "Justify Full": "ÐÐŸ ÑÐžÑÐžÐœÐµ",
+  "Ordered List": "ÐÑÐŒÐµÑÐŸÐ²Ð°ÐœÐœÑÐ¹ ÑÐ¿ÐžÑÐŸÐº",
+  "Bulleted List": "ÐÐ°ÑÐºÐžÑÐŸÐ²Ð°ÐœÐœÑÐ¹ ÑÐ¿ÐžÑÐŸÐº",
+  "Decrease Indent": "Ð£ÐŒÐµÐœÑÑÐžÑÑ ÐŸÑÑÑÑÐ¿",
+  "Increase Indent": "Ð£Ð²ÐµÐ»ÐžÑÐžÑÑ ÐŸÑÑÑÑÐ¿",
+  "Font Color": "ÐŠÐ²ÐµÑ ÑÑÐžÑÑÐ°",
+  "Background Color": "ÐŠÐ²ÐµÑ ÑÐŸÐœÐ°",
+  "Horizontal Rule": "ÐÐŸÑÐžÐ·ÐŸÐœÑÐ°Ð»ÑÐœÑÐ¹ ÑÐ°Ð·ÐŽÐµÐ»ÐžÑÐµÐ»Ñ",
+  "Insert Web Link": "ÐÑÑÐ°Ð²ÐžÑÑ Ð³ÐžÐ¿ÐµÑÑÑÑÐ»ÐºÑ",
+  "Insert/Modify Image": "ÐÑÑÐ°Ð²ÐžÑÑ ÐžÐ·ÐŸÐ±ÑÐ°Ð¶ÐµÐœÐžÐµ",
+  "Insert Table": "ÐÑÑÐ°Ð²ÐžÑÑ ÑÐ°Ð±Ð»ÐžÑÑ",
+  "Toggle HTML Source": "ÐÐŸÐºÐ°Ð·Ð°ÑÑ Html-ÐºÐŸÐŽ",
+  "Enlarge Editor": "Ð£Ð²ÐµÐ»ÐžÑÐžÑÑ ÑÐµÐŽÐ°ÐºÑÐŸÑ",
+  "About this editor": "Ð ÑÐµÐŽÐ°ÐºÑÐŸÑÐµ",
+  "Help using editor": "ÐÐŸÐŒÐŸÑÑ",
+  "Current style": "Ð¢ÐµÐºÑÑÐžÐ¹ ÑÑÐžÐ»Ñ",
+  "Undoes your last action": "ÐÑÐŒÐµÐœÐžÑÑ",
+  "Redoes your last action": "ÐÐŸÐ²ÑÐŸÑÐžÑÑ",
+  "Cut selection": "ÐÑÑÐµÐ·Ð°ÑÑ",
+  "Copy selection": "ÐÐŸÐ¿ÐžÑÐŸÐ²Ð°ÑÑ",
+  "Paste from clipboard": "ÐÑÑÐ°Ð²ÐžÑÑ",
+  "Direction left to right": "ÐÐ°Ð¿ÑÐ°Ð²Ð»ÐµÐœÐžÐµ ÑÐ»ÐµÐ²Ð° ÐœÐ°Ð¿ÑÐ°Ð²ÐŸ",
+  "Direction right to left": "ÐÐ°Ð¿ÑÐ°Ð²Ð»ÐµÐœÐžÐµ ÑÐ¿ÑÐ°Ð²Ð° ÐœÐ°Ð»ÐµÐ²ÐŸ",
+  "Remove formatting": "Ð£Ð±ÑÐ°ÑÑ ÑÐŸÑÐŒÐ°ÑÐžÑÐŸÐ²Ð°ÐœÐžÐµ",
+  "Select all": "ÐÑÐŽÐµÐ»ÐžÑÑ Ð²ÑÐµ",
+  "Print document": "ÐÐµÑÐ°ÑÑ",
+  "Clear MSOffice tags": "Ð£ÐŽÐ°Ð»ÐžÑÑ ÑÐ°Ð·ÐŒÐµÑÐºÑ MSOffice",
+  "Clear Inline Font Specifications": "Ð£ÐŽÐ°Ð»ÐžÑÑ ÐœÐµÐ¿ÐŸÑÑÐµÐŽÑÑÐ²ÐµÐœÐœÐŸÐµ Ð·Ð°ÐŽÐ°ÐœÐžÐµ ÑÑÐžÑÑÐŸÐ²",
+  "Would you like to clear font typefaces?": "Ð£ÐŽÐ°Ð»ÐžÑÑ ÑÐžÐ¿Ñ ÑÑÐžÑÑÐŸÐ²?",
+  "Would you like to clear font sizes?": "Ð£ÐŽÐ°Ð»ÐžÑÑ ÑÐ°Ð·ÐŒÐµÑÑ ÑÑÐžÑÑÐŸÐ² ?",
+  "Would you like to clear font colours?": "Ð£ÐŽÐ°Ð»ÐžÑÑ ÑÐ²ÐµÑÐ° ÑÑÐžÑÑÐŸÐ² ?",
+  "Split Block": "Ð Ð°Ð·ÐŽÐµÐ»ÐžÑÑ Ð±Ð»ÐŸÐº",
+  "Toggle Borders": "ÐÐºÐ»ÑÑÐžÑÑ/Ð²ÑÐºÐ»ÑÑÐžÑÑ ÐŸÑÐŸÐ±ÑÐ°Ð¶ÐµÐœÐžÐµ Ð³ÑÐ°ÐœÐžÑ",
+  "Save as": "Ð¡ÐŸÑ
+ÑÐ°ÐœÐžÑÑ ÐºÐ°Ðº",
+  "Insert/Overwrite": "ÐÑÑÐ°Ð²ÐºÐ°/Ð·Ð°ÐŒÐµÐœÐ°",
+  "&mdash; format &mdash;": "&mdash; ÑÐŸÑÐŒÐ°ÑÐžÑÐŸÐ²Ð°ÐœÐžÐµ &mdash;",
+  "Heading 1": "ÐÐ°Ð³ÐŸÐ»ÐŸÐ²ÐŸÐº 1",
+  "Heading 2": "ÐÐ°Ð³ÐŸÐ»ÐŸÐ²ÐŸÐº 2",
+  "Heading 3": "ÐÐ°Ð³ÐŸÐ»ÐŸÐ²ÐŸÐº 3",
+  "Heading 4": "ÐÐ°Ð³ÐŸÐ»ÐŸÐ²ÐŸÐº 4",
+  "Heading 5": "ÐÐ°Ð³ÐŸÐ»ÐŸÐ²ÐŸÐº 5",
+  "Heading 6": "ÐÐ°Ð³ÐŸÐ»ÐŸÐ²ÐŸÐº 6",
+  "Normal": "ÐÐ±ÑÑÐœÑÐ¹ ÑÐµÐºÑÑ",
+  "Address": "ÐÐŽÑÐµÑ",
+  "Formatted": "ÐÑÑÐŸÑÐŒÐ°ÑÐžÑÐŸÐ²Ð°ÐœÐœÑÐ¹ ÑÐµÐºÑÑ",
+
+  "&mdash; font &mdash;": "&mdash; ÑÑÐžÑÑ &mdash;",
+  "&mdash; size &mdash;": "&mdash; ÑÐ°Ð·ÐŒÐµÑ &mdash;",
+
+
+// ÐÐžÐ°Ð»ÐŸÐ³Ðž
+
+  "OK": "OK",
+  "Cancel": "ÐÑÐŒÐµÐœÐ°",
+  "Path": "ÐÑÑÑ",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "ÐÑ Ð² ÑÐµÐ¶ÐžÐŒÐµ ÐŸÑÐŸÐ±ÑÐ°Ð¶ÐµÐœÐžÑ Html-ÐºÐŸÐŽÐ°. ÐœÐ°Ð¶ÐŒÐžÑÐµ ÐºÐœÐŸÐ¿ÐºÑ [<>], ÑÑÐŸÐ±Ñ Ð¿ÐµÑÐµÐºÐ»ÑÑÐžÑÑÑÑ Ð² Ð²ÐžÐ·ÑÐ°Ð»ÑÐœÑÐ¹ ÑÐµÐ¶ÐžÐŒ.",
+
+"The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "ÐÐœÐŸÐ¿ÐºÐ° ÐÑÑÐ°Ð²ÐžÑÑ ÐœÐµ ÑÐ°Ð±ÐŸÑÐ°ÐµÑ Ð² Ð±ÑÐ°ÑÐ·ÐµÑÐ°Ñ
+ ÐœÐ° ÐŸÑÐœÐŸÐ²Ðµ Mozilla (Ð¿ÐŸ ÑÐµÑ
+ÐœÐžÑÐµÑÐºÐžÐŒ Ð¿ÑÐžÑÐžÐœÐ°ÐŒ, ÑÐ²ÑÐ·Ð°ÐœÐœÑÐŒ Ñ Ð±ÐµÐ·ÐŸÐ¿Ð°ÑÐœÐŸÑÑÑÑ). ÐÐ°Ð¶ÐŒÐžÑÐµ Ctrl-V ÐœÐ° ÐºÐ»Ð°Ð²ÐžÐ°ÑÑÑÐµ, ÑÑÐŸÐ±Ñ Ð²ÑÑÐ°Ð²ÐžÑÑ.",
+
+  "Your Document is not well formed. Check JavaScript console for details.": "ÐÐ°Ñ ÐŽÐŸÐºÑÐŒÐµÐœÑ ÐœÐµÐ¿ÑÐ°Ð²ÐžÐ»ÑÐœÐŸ ÑÑÐŸÑÐŒÐžÑÐŸÐ²Ð°Ðœ. ÐÐŸÑÐŒÐŸÑÑÐžÑÐµ ÐÐŸÐœÑÐŸÐ»Ñ JavaScript, ÑÑÐŸÐ±Ñ ÑÐ·ÐœÐ°ÑÑ Ð¿ÐŸÐŽÑÐŸÐ±ÐœÐŸÑÑÐž.",
+
+  "Alignment:": "ÐÑÑÐ°Ð²ÐœÐžÐ²Ð°ÐœÐžÐµ",
+  "Not set": "ÐÐµ ÑÑÑÐ°ÐœÐŸÐ²Ð»ÐµÐœÐŸ",
+  "Left": "ÐÐŸ Ð»ÐµÐ²ÐŸÐŒÑ ÐºÑÐ°Ñ",
+  "Right": "ÐÐŸ Ð¿ÑÐ°Ð²ÐŸÐŒÑ ÐºÑÐ°Ñ",
+  "Texttop": "ÐÐŸ Ð²ÐµÑÑ
+ÐœÐµÐ¹ Ð³ÑÐ°ÐœÐžÑÐµ ÑÐµÐºÑÑÐ°",
+  "Absmiddle": "ÐÐŸ ÑÐµÑÐµÐŽÐžÐœÐµ ÑÐµÐºÑÑÐ°",
+  "Baseline": "ÐÐŸ ÐœÐžÐ¶ÐœÐµÐ¹ Ð³ÑÐ°ÐœÐžÑÐµ ÑÐµÐºÑÑÐ°",
+  "Absbottom": "ÐÐŸ ÐœÐžÐ¶ÐœÐµÐ¹ Ð³ÑÐ°ÐœÐžÑÐµ",
+  "Bottom": "ÐÐŸ ÐœÐžÐ¶ÐœÐµÐŒÑ ÐºÑÐ°Ñ",
+  "Middle": "ÐÐŸÑÑÐµÐŽÐžÐœÐµ",
+  "Top": "ÐÐŸ Ð²ÐµÑÑ
+ÐœÐµÐŒÑ ÐºÑÐ°Ñ",
+
+  "Layout": "Ð Ð°ÑÐ¿ÐŸÐ»ÐŸÐ¶ÐµÐœÐžÐµ",
+  "Spacing": "ÐÐŸÐ»Ñ",
+  "Horizontal:": "ÐÐŸ Ð³ÐŸÑÐžÐ·ÐŸÐœÑÐ°Ð»Ðž",
+  "Horizontal padding": "ÐÐŸÑÐžÐ·ÐŸÐœÑÐ°Ð»ÑÐœÑÐµ Ð¿ÐŸÐ»Ñ",
+  "Vertical:": "ÐÐŸ Ð²ÐµÑÑÐžÐºÐ°Ð»Ðž",
+  "Vertical padding": "ÐÐµÑÑÐžÐºÐ°Ð»ÑÐœÑÐµ Ð¿ÐŸÐ»Ñ",
+  "Border thickness:": "Ð¢ÐŸÐ»ÑÐžÐœÐ° ÑÐ°ÐŒÐºÐž",
+  "Leave empty for no border": "ÐÑÑÐ°Ð²ÑÑÐµ Ð¿ÑÑÑÑÐŒ, ÑÑÐŸÐ±Ñ ÑÐ±ÑÐ°ÑÑ ÑÐ°ÐŒÐºÑ",
+
+  //Insert Link
+  "Insert/Modify Link": "ÐÑÑÐ°Ð²ÐºÐ°/ÐžÐ·ÐŒÐµÐœÐµÐœÐžÐµ ÑÑÑÐ»ÐºÐž",
+  "None (use implicit)": "ÐÐŸ ÑÐŒÐŸÐ»ÑÐ°ÐœÐžÑ",
+  "New window (_blank)": "ÐÐŸÐ²ÐŸÐµ ÐŸÐºÐœÐŸ (_blank)",
+  "Same frame (_self)": "Ð¢ÐŸ Ð¶Ðµ ÐŸÐºÐœÐŸ (_self)",
+  "Top frame (_top)": "Ð ÐŸÐŽÐžÑÐµÐ»ÑÑÐºÐŸÐµ ÐŸÐºÐœÐŸ (_top)",
+  "Other": "ÐÑÑÐ³ÐŸÐµ",
+  "Target:": "ÐÑÐºÑÑÐ²Ð°ÑÑ Ð² ÐŸÐºÐœÐµ:",
+  "Title (tooltip):": "ÐÑÐ¿Ð»ÑÐ²Ð°ÑÑÐ°Ñ Ð¿ÐŸÐŽÑÐºÐ°Ð·ÐºÐ°",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "ÐÑ ÐŽÐŸÐ»Ð¶ÐœÑ ÑÐºÐ°Ð·Ð°ÑÑ URL, ÐœÐ° ÐºÐŸÑÐŸÑÑÐ¹ Ð±ÑÐŽÐµÑ ÑÐºÐ°Ð·ÑÐ²Ð°ÑÑ ÑÑÑÐ»ÐºÐ°",
+  "You need to select some text before creating a link": "ÐÑ ÐŽÐŸÐ»Ð¶ÐœÑ Ð²ÑÐŽÐµÐ»ÐžÑÑ ÑÐµÐºÑÑ, ÐºÐŸÑÐŸÑÑÐ¹ Ð±ÑÐŽÐµÑ Ð¿ÑÐµÐŸÐ±ÑÐ°Ð·ÐŸÐ²Ð°Ðœ Ð² ÑÑÑÐ»ÐºÑ",
+
+  // Insert Table
+  "Insert Table": "ÐÑÑÐ°Ð²ÐºÐ° ÑÐ°Ð±Ð»ÐžÑÑ",
+  "Rows:": "Ð¡ÑÑÐŸÐºÐž",
+  "Number of rows": "ÐÐŸÐ»ÐžÑÐµÑÑÐ²ÐŸ ÑÑÑÐŸÐº",
+  "Cols:": "Ð¡ÑÐŸÐ»Ð±ÑÑ",
+  "Number of columns": "ÐÐŸÐ»ÐžÑÐµÑÑÐ²ÐŸ ÑÑÐŸÐ»Ð±ÑÐŸÐ²",
+  "Width:": "ÐšÐžÑÐžÐœÐ°",
+  "Width of the table": "ÐšÐžÑÐžÐœÐ° ÑÐ°Ð±Ð»ÐžÑÑ",
+  "Percent": "Ð¿ÑÐŸÑÐµÐœÑÑ",
+  "Pixels": "Ð¿ÐžÐºÑÐµÐ»Ñ",
+  "Em": "em",
+  "Width unit": "ÐÐŽÐžÐœÐžÑÑ ÐžÐ·ÐŒÐµÑÐµÐœÐžÑ",
+  "Fixed width columns": "Ð¡ÑÐŸÐ»Ð±ÑÑ ÑÐžÐºÑÐžÑÐŸÐ²Ð°ÐœÐœÐŸÐ¹ ÑÐžÑÐžÐœÑ",
+  "Positioning of this table": "Ð Ð°ÑÐ¿ÐŸÐ»ÐŸÐ¶ÐµÐœÐžÐµ ÑÐ°Ð±Ð»ÐžÑÑ",
+  "Cell spacing:": "Ð Ð°ÑÑÑÐŸÑÐœÐžÐµ ÐŒÐµÐ¶ÐŽÑ ÑÑÐµÐ¹ÐºÐ°ÐŒÐž",
+  "Space between adjacent cells": "Ð Ð°ÑÑÑÐŸÑÐœÐžÐµ ÐŒÐµÐ¶ÐŽÑ ÑÐŸÑÐµÐŽÐœÐžÐŒÐž ÑÑÐµÐ¹ÐºÐ°ÐŒÐž",
+  "Cell padding:": "ÐÐŸÐ»Ñ Ð² ÑÑÐµÐ¹ÐºÐ°Ñ
+",
+  "Space between content and border in cell": "Ð Ð°ÑÑÑÐŸÑÐœÐžÐµ ÐŒÐµÐ¶ÐŽÑ Ð³ÑÐ°ÐœÐžÑÐµÐ¹ ÑÑÐµÐ¹ÐºÐž Ðž ÑÐµÐºÑÑÐŸÐŒ",
+  "You must enter a number of rows": "ÐÑ ÐŽÐŸÐ»Ð¶ÐœÑ Ð²Ð²ÐµÑÑÐž ÐºÐŸÐ»ÐžÑÐµÑÑÐ²ÐŸ ÑÑÑÐŸÐº",
+  "You must enter a number of columns": "ÐÑ ÐŽÐŸÐ»Ð¶ÐœÑ Ð²Ð²ÐµÑÑÐž ÐºÐŸÐ»ÐžÑÐµÑÑÐ²ÐŸ ÑÑÐŸÐ»Ð±ÑÐŸÐ²",
+
+  // Insert Image
+  "Insert Image": "ÐÑÑÐ°Ð²ÐºÐ° ÐžÐ·ÐŸÐ±ÑÐ°Ð¶ÐµÐœÐžÑ",
+  "Image URL:": "URL ÐžÐ·ÐŸÐ±ÑÐ°Ð¶ÐµÐœÐžÑ",
+  "Enter the image URL here": "ÐÑÑÐ°Ð²ÑÑÐµ Ð°ÐŽÑÐµÑ ÐžÐ·ÐŸÐ±ÑÐ°Ð¶ÐµÐœÐžÑ",
+  "Preview": "ÐÑÐµÐŽÐ²Ð°ÑÐžÑÐµÐ»ÑÐœÑÐ¹ Ð¿ÑÐŸÑÐŒÐŸÑÑ",
+  "Preview the image in a new window": "ÐÑÐµÐŽÐ²Ð°ÑÐžÑÐµÐ»ÑÐœÑÐ¹ Ð¿ÑÐŸÑÐŒÐŸÑÑ Ð² ÐŸÑÐŽÐµÐ»ÑÐœÐŸÐŒ ÐŸÐºÐœÐµ",
+  "Alternate text:": "ÐÐ»ÑÑÐµÑÐœÐ°ÑÐžÐ²ÐœÑÐ¹ ÑÐµÐºÑÑ",
+  "For browsers that don't support images": "ÐÐ»Ñ Ð±ÑÐ°ÑÐ·ÐµÑÐŸÐ², ÐºÐŸÑÐŸÑÑÐµ ÐœÐµ ÐŸÑÐŸÐ±ÑÐ°Ð¶Ð°ÑÑ ÐºÐ°ÑÑÐžÐœÐºÐž",
+  "Positioning of this image": "Ð Ð°ÑÐ¿ÐŸÐ»ÐŸÐ¶ÐµÐœÐžÐµ ÐžÐ·ÐŸÐ±ÑÐ°Ð¶ÐµÐœÐžÑ",
+  "Image Preview:": "ÐÑÐµÐŽÐ²Ð°ÑÐžÑÐµÐ»ÑÐœÑÐ¹ Ð¿ÑÐŸÑÐŒÐŸÑÑ",
+  "You must enter the URL": "ÐÑ ÐŽÐŸÐ»Ð¶ÐœÑ Ð²Ð²ÐµÑÑÐž URL",
+
+  // Editor Help
+  "Xinha Help": "ÐÐŸÐŒÐŸÑÑ",
+  "Editor Help": "ÐÐŸÐŒÐŸÑÑ",
+  "Keyboard shortcuts": "ÐÐŸÑÑÑÐžÐµ ÐºÐ»Ð°Ð²ÐžÑÐž",
+  "The editor provides the following key combinations:": "Ð ÐµÐŽÐ°ÐºÑÐŸÑ Ð¿ÐŸÐŽÐŽÐµÑÐ¶ÐžÐ²Ð°ÐµÑ ÑÐ»ÐµÐŽÑÑÑÐžÐµ ÐºÐŸÐŒÐ±ÐžÐœÐ°ÑÐžÐž ÐºÐ»Ð°Ð²ÐžÑ:",
+  "ENTER": "ENTER",
+  "new paragraph": "ÐœÐŸÐ²ÑÐ¹ Ð°Ð±Ð·Ð°Ñ",
+  "SHIFT-ENTER": "SHIFT+ENTER",
+  "insert linebreak": "Ð¿ÐµÑÐµÐœÐŸÑ ÑÑÑÐŸÐºÐž",
+  "Set format to paragraph": "ÐÑÑÐŸÑÐŒÐ°ÑÐžÑÐŸÐ²Ð°ÑÑ Ð°Ð±Ð·Ð°Ñ",
+  "Clean content pasted from Word": "ÐÑÐžÑÑÐžÑÑ ÑÐµÐºÑÑ, Ð²ÑÑÐ°Ð²Ð»ÐµÐœÐœÑÐ¹ ÐžÐ· Word",
+  "Headings": "ÐÐ°Ð³ÐŸÐ»ÐŸÐ²ÐºÐž",
+  "Close": "ÐÐ°ÐºÑÑÑÑ",
+
+  // Loading messages
+  "Loading in progress. Please wait !": "ÐÐ°Ð³ÑÑÐ·ÐºÐ°... ÐÐŸÐ¶Ð°Ð»ÑÐ¹ÑÑÐ°, Ð¿ÐŸÐŽÐŸÐ¶ÐŽÐžÑÐµ.",
+  "Constructing main object": "Ð¡ÐŸÐ·ÐŽÐ°ÐœÐžÐµ Ð³Ð»Ð°Ð²ÐœÐŸÐ³ÐŸ ÐŸÐ±ÑÐµÐºÑÐ°",
+  "Constructing object": "Ð¡ÐŸÐ·ÐŽÐ°ÐœÐžÐµ ÐŸÐ±ÑÐµÐºÑÐ°",
+  "Register panel right": "Ð ÐµÐ³ÐžÑÑÑÐ°ÑÐžÑ Ð¿ÑÐ°Ð²ÐŸÐ¹ Ð¿Ð°ÐœÐµÐ»Ðž",
+  "Register panel left": "Ð ÐµÐ³ÐžÑÑÑÐ°ÑÐžÑ Ð»ÐµÐ²ÐŸÐ¹ Ð¿Ð°ÐœÐµÐ»Ðž",
+  "Register panel top": "Ð ÐµÐ³ÐžÑÑÑÐ°ÑÐžÑ Ð²ÐµÑÑ
+ÐœÐµÐ¹ Ð¿Ð°ÐœÐµÐ»Ðž",
+  "Register panel bottom": "Ð ÐµÐ³ÐžÑÑÑÐ°ÑÐžÑ ÐœÐžÐ¶ÐœÐµÐ¹ Ð¿Ð°ÐœÐµÐ»Ðž",
+  "Create Toolbar": "Ð¡ÐŸÐ·ÐŽÐ°ÐœÐžÐµ Ð¿Ð°ÐœÐµÐ»Ðž ÐžÐœÑÑÑÑÐŒÐµÐœÑÐŸÐ²",
+  "Create StatusBar": "Ð¡ÐŸÐ·ÐŽÐ°ÐœÐžÐµ Ð¿Ð°ÐœÐµÐ»Ðž ÑÐŸÑÑÐŸÑÐœÐžÑ",
+  "Generate Xinha object": "Ð¡ÐŸÐ·ÐŽÐ°ÐœÐžÐµ ÐŸÐ±ÑÐµÐºÑÐ° Xinha",
+  "Init editor size": "ÐÐœÐžÑÐžÐ°Ð»ÐžÐ·Ð°ÑÐžÑ ÑÐ°Ð·ÐŒÐµÑÐ° ÑÐµÐŽÐ°ÐºÑÐŸÑÐ°",
+  "Init IFrame": "ÐžÐœÐžÑÐžÐ°Ð»ÐžÐ·Ð°ÑÐžÑ iframe",
+  "Register plugin $plugin": "Ð ÐµÐ³ÐžÑÑÑÐ°ÑÐžÑ $plugin"
+};
Index: /branches/new-dialogs-merge/lang/gb.js
===================================================================
--- /branches/new-dialogs-merge/lang/gb.js (revision 856)
+++ /branches/new-dialogs-merge/lang/gb.js (revision 856)
@@ -0,0 +1,36 @@
+// I18N constants -- Chinese GB
+// by Dave Lo -- dlo@interactivetools.com
+{
+  "Bold": "ç²äœ",
+  "Italic": "æäœ",
+  "Underline": "åºçº¿",
+  "Strikethrough": "å é€çº¿",
+  "Subscript": "äžæ ",
+  "Superscript": "äžæ ",
+  "Justify Left": "äœçœ®é å·Š",
+  "Justify Center": "äœçœ®å±
+äž­",
+  "Justify Right": "äœçœ®é å³",
+  "Justify Full": "äœçœ®å·Šå³å¹³ç­",
+  "Ordered List": "é¡ºåºæž
+å",
+  "Bulleted List": "æ åºæž
+å",
+  "Decrease Indent": "åå°è¡åç©ºçœ",
+  "Increase Indent": "å å®œè¡åç©ºçœ",
+  "Font Color": "æå­é¢è²",
+  "Background Color": "èæ¯é¢è²",
+  "Horizontal Rule": "æ°Žå¹³çº¿",
+  "Insert Web Link": "æå
+¥è¿ç»",
+  "Insert/Modify Image": "æå
+¥åŸåœ¢",
+  "Insert Table": "æå
+¥è¡šæ Œ",
+  "Toggle HTML Source": "åæ¢HTMLåå§ç ",
+  "Enlarge Editor": "æŸå€§",
+  "About this editor": "å
+³æŒ Xinha",
+  "Help using editor": "è¯Žæ",
+  "Current style": "å­äœäŸå­"
+}
Index: /branches/new-dialogs-merge/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/lang/de.js (revision 798)
+++ /branches/new-dialogs-merge/lang/de.js (revision 798)
@@ -0,0 +1,169 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+{
+  "Bold": "Fett",
+  "Italic": "Kursiv",
+  "Underline": "Unterstrichen",
+  "Strikethrough": "Durchgestrichen",
+  "Subscript": "Tiefgestellt",
+  "Superscript": "Hochgestellt",
+  "Justify Left": "LinksbÃŒndig",
+  "Justify Center": "Zentriert",
+  "Justify Right": "RechtsbÃŒndig",
+  "Justify Full": "Blocksatz",
+  "Ordered List": "Nummerierte Liste",
+  "Bulleted List": "AufzÃ€hlungsliste",
+  "Decrease Indent": "Einzug verkleinern",
+  "Increase Indent": "Einzug vergrÃ¶Ãern",
+  "Font Color": "Schriftfarbe",
+  "Background Color": "Hindergrundfarbe",
+  "Horizontal Rule": "Horizontale Linie",
+  "Insert Web Link": "Hyperlink einfÃŒgen",
+  "Insert/Modify Image": "Bild einfÃŒgen/verÃ€ndern",
+  "Insert Table": "Tabelle einfÃŒgen",
+  "Toggle HTML Source": "HTML Quelltext ein/ausschalten",
+  "Enlarge Editor": "Editor vergrÃ¶Ãern",
+  "About this editor": "Ãber diesen Editor",
+  "Help using editor": "Hilfe",
+  "Current style": "Derzeitiger Stil",
+  "Undoes your last action": "RÃŒckgÃ€ngig",
+  "Redoes your last action": "Wiederholen",
+  "Cut selection": "Ausschneiden",
+  "Copy selection": "Kopieren",
+  "Paste from clipboard": "EinfÃŒgen aus der Zwischenablage",
+  "Direction left to right": "Textrichtung von Links nach Rechts",
+  "Direction right to left": "Textrichtung von Rechts nach Links",
+  "Remove formatting": "Formatierung entfernen",
+  "Select all": "Alles markieren",
+  "Print document": "Dokument ausdrucken",
+  "Clear MSOffice tags": "MSOffice filter",
+  "Clear Inline Font Specifications": "Zeichensatz Formatierungen entfernen",
+  "Would you like to clear font typefaces?": "Wollen Sie Zeichensatztypen entfernen",
+  "Would you like to clear font sizes?": "Wollen Sie ZeichensatzgrÃ¶Ãen entfernen",
+  "Would you like to clear font colours?": "Wollen sie Zeichensatzfarben entfernen",
+  "Split Block": "Block teilen",
+  "Toggle Borders": "TabellenrÃ€nder ein/ausblenden",
+  "Save as": "speichern unter",
+  "Insert/Overwrite": "EinfÃŒgen/Ãberschreiben",
+  "&mdash; format &mdash;": "&mdash; Format &mdash;",
+  "Heading 1": "Ãberschrift 1",
+  "Heading 2": "Ãberschrift 2",
+  "Heading 3": "Ãberschrift 3",
+  "Heading 4": "Ãberschrift 4",
+  "Heading 5": "Ãberschrift 5",
+  "Heading 6": "Ãberschrift 6",
+  "Normal": "Normal (Absatz)",
+  "Address": "Adresse",
+  "Formatted": "Formatiert",
+
+  //dialogs
+  "OK": "OK",
+  "Cancel": "Abbrechen",
+  "Path": "Pfad",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Sie sind im Text-Modus. Benutzen Sie den [<>] Button, um in den visuellen Modus (WYSIWIG) zu gelangen.",
+   "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Aus SicherheitsgrÃŒnden dÃŒrfen Skripte normalerweise nicht auf Ausschneiden/Kopieren/EinfÃŒgen zugreifen. Benutzen Sie bitte die entsprechenden Tastatur-Kommandos (Strg + x/c/v).",
+
+  "You need to select some text before create a link": "Sie mÃŒssen einen Text markieren, um einen Link zu erstellen",
+  "Your Document is not well formed. Check JavaScript console for details.": "Ihr Dokument ist in keinem sauberen Format. Benutzen Sie die Javascript Console fÃŒr weitere Informationen.",
+
+  "Alignment:": "Ausrichtung:",
+  "Not set": "nicht eingestellt",
+  "Left": "links",
+  "Right": "rechts",
+  "Texttop": "oben bÃŒndig",
+  "Absmiddle": "mittig",
+  "Baseline": "Grundlinie",
+  "Absbottom": "unten bÃŒndig",
+  "Bottom": "unten",
+  "Middle": "zentriert",
+  "Top": "oben",
+
+  "Layout": "Layout",
+  "Spacing": "Abstand",
+  "Horizontal:": "horizontal:",
+  "Horizontal padding": "horizontaler Inhaltsabstand",
+  "Vertical:": "vertikal:",
+  "Vertical padding": "vertikaler Inhaltsabstand",
+  "Border thickness:": "RandstÃ€rke:",
+  "Leave empty for no border": "leer lassen fÃŒr keinen Rand",
+
+  //Insert Link
+  "Insert/Modify Link": "VerknÃŒpfung hinzufÃŒgen/Ã€ndern",
+  "None (use implicit)": "k.A. (implizit)",
+  "New window (_blank)": "Neues Fenster (_blank)",
+  "Same frame (_self)": "Selber Rahmen (_self)",
+  "Top frame (_top)": "Oberster Rahmen (_top)",
+  "Other": "Anderes",
+  "Target:": "Ziel:",
+  "Title (tooltip):": "Titel (Tooltip):",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "Sie mÃŒssen eine Ziel-URL angeben fÃŒr die VerknÃŒpfung angeben",
+
+  // Insert Table
+  "Insert Table": "Tabelle einfÃŒgen",
+  "Rows:": "Zeilen:",
+  "Number of rows": "Zeilenanzahl",
+  "Cols:": "Spalten:",
+  "Number of columns": "Spaltenanzahl",
+  "Width:": "Breite:",
+  "Width of the table": "Tabellenbreite",
+  "Percent": "Prozent",
+  "Pixels": "Pixel",
+  "Em": "Geviert",
+  "Width unit": "GrÃ¶Ãeneinheit",
+  "Fixed width columns": "Spalten mit fester Breite",
+  "Positioning of this table": "Positionierung der Tabelle",
+  "Cell spacing:": "Zellenabstand:",
+  "Space between adjacent cells": "Raum zwischen angrenzenden Zellen",
+  "Cell padding:": "Innenabstand:",
+  "Space between content and border in cell": "Raum zwischen Inhalt und Rand der Zelle",
+  "You must enter a number of rows": "Bitte geben Sie die Anzahl der Zeilen an",
+  "You must enter a number of columns": "Bitte geben Sie die Anzahl der Spalten an",
+
+  // Insert Image
+  "Insert Image": "Bild einfÃŒgen",
+  "Image URL:": "Bild URL:",
+  "Enter the image URL here": "Bitte geben sie hier die Bild URL ein",
+  "Preview": "Voransicht",
+  "Preview the image in a new window": "Voransicht des Bildes in einem neuen Fenster",
+  "Alternate text:": "Alternativer Text:",
+  "For browsers that don't support images": "fÃŒr Browser, die keine Bilder unterstÃŒtzen",
+  "Positioning of this image": "Positionierung dieses Bildes",
+  "Image Preview:": "Bild Voransicht:",
+  "You must enter the URL": "Bitte geben Sie die URL ein",
+
+  "button_bold": "de/bold.gif",
+  "button_italic": "de/italic.gif",
+  "button_underline": "de/underline.gif",
+
+  // Editor Help
+  "Keyboard shortcuts": "TastaturkÃŒrzel",
+  "The editor provides the following key combinations:": "Der Editor unterstÃŒtzt die folgenden kombinationen:",
+  "new paragraph": "Neuer Absatz(Paragraph)",
+  "insert linebreak": "Harter Umbruch einfÃŒgen",
+  "Set format to paragraph": "Setze Formatierung auf Absatz",
+  "Clean content pasted from Word": "Von Word eingefÃŒgter Text bereinigen",
+  "Headings": "Ãberschrift Typ 1 bis 6",
+  "Close": "SchlieÃen",
+
+  // Loading messages
+  "Loading in progress. Please wait!": "Editor wird geladen. Bitte warten !",
+  "Loading plugin $plugin" : "Plugin $plugin wird geladen",
+  "Register plugin $plugin" : "Plugin $plugin wird registriert", 
+  "Constructing object": "Objekt wird generiert",
+  "Generate Xinha framework": "Xinha Framework wird generiert",
+  "Init editor size":"GrÃ¶Ãe wird berechnet", 
+  "Create Toolbar": "Werkzeugleiste wird generiert",
+  "Create Statusbar" : "Statusleiste wird generiert",
+  "Register right panel" : "Rechtes Panel wird generiert", 
+  "Register left panel" : "Linkes Panel wird generiert", 
+  "Register bottom panel" : "Unteres Panel wird generiert", 
+  "Register top panel" : "Oberes Panel wird generiert", 
+  "Finishing" : "Laden wird abgeschlossen", 
+  
+  // ColorPicker
+  "Click a color..." : "Farbe wÃ€hlen",
+  "Sample" : "Beispiel",
+  "Web Safe: " : "Web Safe: ",
+  "Color: " : "Farbe: "
+};
Index: /branches/new-dialogs-merge/lang/sv.js
===================================================================
--- /branches/new-dialogs-merge/lang/sv.js (revision 481)
+++ /branches/new-dialogs-merge/lang/sv.js (revision 481)
@@ -0,0 +1,117 @@
+// I18N constants
+// LANG: "sv", ENCODING: UTF-8
+
+// Swedish version for htmlArea v3.0
+// Initital translation by pat <pat@engvall.nu>
+// Synced with additional contants in rev. 477 (Mar 2006) by Thomas Loo <tloo@saltstorm.net>
+
+{
+  "Bold": "Fet",
+  "Italic": "Kursiv",
+  "Underline": "Understruken",
+  "Strikethrough": "Genomstruken",
+  "Subscript": "NedsÃ€nkt",
+  "Superscript": "UpphÃ¶jd",
+  "Justify Left": "VÃ€nsterjustera",
+  "Justify Center": "Centrera",
+  "Justify Right": "HÃ¶gerjustera",
+  "Justify Full": "Marginaljustera",
+  "Ordered List": "Numrerad lista",
+  "Bulleted List": "Punktlista",
+  "Decrease Indent": "Minska indrag",
+  "Increase Indent": "Ãka indrag",
+  "Font Color": "TextfÃ€rg",
+  "Background Color": "BakgrundsfÃ€rg",
+  "Horizontal Rule": "VÃ¥grÃ€t linje",
+  "Insert Web Link": "Infoga lÃ€nk",
+  "Insert/Modify Image": "Infoga bild",
+  "Toggle HTML Source": "Visa kÃ€llkod",
+  "Enlarge Editor": "Visa i eget fÃ¶nster",
+  "About this editor": "Om denna editor",
+  "Help using editor": "HjÃ€lp",
+  "Current style": "Nuvarande stil",
+
+  "Undoes your last action": "Ã
+ngra kommando",
+  "Redoes your last action": "Upprepa kommando",
+  "Select all": "Markera allt",
+  "Print document": "Skriv ut",
+  "Clear MSOffice tags": "StÃ€da bort MS Office taggar",
+  "Clear Inline Font Specifications": "Rensa inbÃ€ddad typsnittsinformation",
+  "Remove formatting": "Rensa formattering",
+  "Toggle Borders": "Objektramar",
+  "Split Block": "Dela block",
+  "Direction left to right": "VÃ€nster till hÃ¶ger",
+  "Direction right to left": "HÃ¶ger till vÃ€nster",
+
+  "Insert/Overwrite": "Infoga/Skriv Ã¶ver",
+  "OK": "OK",
+  "Cancel": "Avbryt",
+  "Path": "Objekt",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Du befinner dig i texlÃ€ge. Klicka pÃ¥ ikonen [<>] ovan fÃ¶r att vÃ€xla tillbaka till WYSIWIG lÃ€ge",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Visning i fullskÃ€rmslÃ€ga fungerar dÃ¥ligt i din weblÃ€sare. MÃ¶jliga problem resulterar i en ryckig editor, saknade editorfunktioner och/eller att weblÃ€saren kraschar. Om du anvÃ€nder Windows 95/98 finns ocksÃ¥ mÃ¶jligheten att Windows kraschar.\n\nTryck ",
+  "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Denna knapp fungerar ej i Mozillabaserad weblÃ€sare, anvÃ€nd istÃ€llet snabbtangenterna CTRL-V pÃ¥ tangentbordet fÃ¶r att klistra in.",
+
+  "Insert/Modify Link": "Redigera lÃ€nk",
+  "New window (_blank)": "Nytt fÃ¶nster (_blank)",
+  "None (use implicit)": "Ingen (anvÃ€nd standardinstÃ€lling)",
+  "Other": "Annan",
+  "Same frame (_self)": "Samma ram (_self)",
+  "Target:": "MÃ¥l:",
+  "Title (tooltip):": "Titel (tooltip):",
+  "Top frame (_top)": "Toppram (_top)",
+  "URL:": "SÃ¶kvÃ€g:",
+  "You must enter the URL where this link points to": "Du mÃ¥sta ange en adress till vilken lÃ€nken skall peka pÃ¥",
+  "Would you like to clear font typefaces?": "Radera alla typsnittsinformation ?",
+  "Would you like to clear font sizes?": "Radera alla fontstorlekar ?",
+  "Would you like to clear font colours?": "Ta bort all textfÃ€rger ?",
+
+  "You need to select some text before creating a link": "Du mÃ¥sta markera ett objekt att applicera lÃ€nken pÃ¥!",
+
+  // Insert Table
+  "Insert Table": "Infoga tabell",
+  "Rows:": "Rader:",
+  "Number of rows": "Antal rader",
+  "Cols:": "Kolumner:",
+  "Number of columns": "Antal kolumner",
+  "Width:": "Bredd:",
+  "Width of the table": "Tabellbredd",
+  "Percent": "Procent",
+  "Pixels": "Pixlar",
+  "Em": "",
+  "Width unit": "Breddenheter",
+  "Fixed width columns": "Fixerad bredd",
+  "Alignment:": "Marginaljustering",
+  "Positioning of this table": "Tabellposition",
+  "Border thickness:": "Ramtjocklek",
+  "Leave empty for no border": "LÃ€mna fÃ€ltet tomt fÃ¶r att undvika ramar",
+  "Spacing": "Cellegenskaper",
+  "Cell spacing:": "Cellmarginaler:",
+  "Space between adjacent cells": "Utrymme mellan celler",
+  "Cell padding:": "Cellindrag:",
+  "Space between content and border in cell": "Utrymme mellan ram och cellinnehÃ¥ll",
+  "You must enter a number of rows": "Ange ental rader",
+  "You must enter a number of columns": "Ange antal kolumner",
+
+  // Editor Help
+  "Keyboard shortcuts": "Snabbtangenter",
+  "The editor provides the following key combinations:": "Editorn nyttjar fÃ¶ljande kombinationer:",
+  "new paragraph": "Ny paragraf ",
+  "insert linebreak": "Infoga radbrytning ",
+  "Set format to paragraph": "Aktivera paragraflÃ€ge",
+  "Clean content pasted from Word": "Rensa innehÃ¥ll inklistrat frÃ¥n MS Word",
+  "Headings": "Skapa standardrubrik",
+  "Cut selection": "Klipp ut markering",
+  "Copy selection": "Kopiera  markering",
+  "Paste from clipboard": "Klistra in",
+  "Close": "StÃ€ng",
+
+  // Loading messages
+  "Loading in progress. Please wait !": "Editorn laddas. VÃ€nta...",
+  "Constructing main object": "Skapar huvudobjekt",
+  "Create Toolbar": "Skapar verktygspanel",
+  "Register panel right": "Registerar panel hÃ¶ger",
+  "Register panel left": "Registerar panel vÃ€nster",
+  "Register panel top": "Registerar toppanel",
+  "Register panel bottom": "Registerar fotpanel"
+}
Index: /branches/new-dialogs-merge/lang/ee.js
===================================================================
--- /branches/new-dialogs-merge/lang/ee.js (revision 60)
+++ /branches/new-dialogs-merge/lang/ee.js (revision 60)
@@ -0,0 +1,50 @@
+// I18N constants
+
+// LANG: "ee", ENCODING: UTF-8
+// Author: Martin Raie, <albertvill@hot.ee>
+
+// 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.)
+
+{
+  "Bold": "Paks",
+  "Italic": "Kursiiv",
+  "Underline": "Allakriipsutatud",
+  "Strikethrough": "LÃ€bikriipsutatud",
+  "Subscript": "Allindeks",
+  "Superscript": "Ãlaindeks",
+  "Justify Left": "Joonda vasakule",
+  "Justify Center": "Joonda keskele",
+  "Justify Right": "Joonda paremale",
+  "Justify Full": "RÃ¶Ã¶pjoonda",
+  "Ordered List": "Nummerdus",
+  "Bulleted List": "TÃ€pploend",
+  "Decrease Indent": "VÃ€henda taanet",
+  "Increase Indent": "Suurenda taanet",
+  "Font Color": "Fondi vÃ€rv",
+  "Background Color": "Tausta vÃ€rv",
+  "Horizontal Rule": "Horisontaaljoon",
+  "Insert Web Link": "Lisa viit",
+  "Insert/Modify Image": "Lisa pilt",
+  "Insert Table": "Lisa tabel",
+  "Toggle HTML Source": "HTML/tavaline vaade",
+  "Enlarge Editor": "Suurenda toimeti aken",
+  "About this editor": "Teave toimeti kohta",
+  "Help using editor": "Spikker",
+  "Current style": "Kirjastiil",
+  "Undoes your last action": "VÃµta tagasi",
+  "Redoes your last action": "Tee uuesti",
+  "Cut selection": "LÃµika",
+  "Copy selection": "Kopeeri",
+  "Paste from clipboard": "Kleebi",
+  "OK": "OK",
+  "Cancel": "Loobu",
+  "Path": "Path",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Sa oled tekstireziimis.  Kasuta nuppu [<>] lÃŒlitamaks tagasi WYSIWIG reziimi."
+}
Index: /branches/new-dialogs-merge/lang/ch.js
===================================================================
--- /branches/new-dialogs-merge/lang/ch.js (revision 856)
+++ /branches/new-dialogs-merge/lang/ch.js (revision 856)
@@ -0,0 +1,67 @@
+// I18N constants
+
+// LANG: "ch", ENCODING: UTF-8
+// Samuel Stone, http://stonemicro.com/
+
+{
+  "Bold": "ç²é«",
+  "Italic": "æé«",
+  "Underline": "åºç·",
+  "Strikethrough": "åªç·",
+  "Subscript": "äžæš",
+  "Superscript": "äžæš",
+  "Justify Left": "é å·Š",
+  "Justify Center": "å±
+äž­",
+  "Justify Right": "é å³",
+  "Justify Full": "æŽéœ",
+  "Ordered List": "é åºæž
+å®",
+  "Bulleted List": "ç¡åºæž
+å®",
+  "Decrease Indent": "äŒžæ",
+  "Increase Indent": "çž®æ",
+  "Font Color": "æå­é¡è²",
+  "Background Color": "èæ¯é¡è²",
+  "Horizontal Rule": "æ°Žå¹³ç·",
+  "Insert Web Link": "æå
+¥é£çµ",
+  "Insert/Modify Image": "æå
+¥åå",
+  "Insert Table": "æå
+¥è¡šæ Œ",
+  "Toggle HTML Source": "åæHTMLåå§ç¢Œ",
+  "Enlarge Editor": "äŒžåºç·šèŒ¯ç³»çµ±",
+  "About this editor": "éæŒ Xinha",
+  "Help using editor": "èªªæ",
+  "Current style": "å­é«äŸå­",
+  "Undoes your last action": "åå",
+  "Redoes your last action": "éæ¥",
+  "Cut selection": "åªå¶éé¡¹",
+  "Copy selection": "å€å¶éé¡¹",
+  "Paste from clipboard": "èŽŽäž",
+  "Direction left to right": "ä»å·Šå°å³",
+  "Direction right to left": "ä»å³å°å·Š",
+  "OK": "å¥œ",
+  "Cancel": "åæ¶",
+  "Path": "éåŸ",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "äœ åšçšçŽå­ç·šèŒ¯æ¹åŒ.  çš [<>] æéèœå æèŠå³æåŸ ç·šèŒ¯æ¹åŒ.",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "æŽé åŒåšInternet Explorer äžåžžåºåé¡, å çºéæ¯ Internet Explorer çç¡ååé¡ïŒæåç¡æ³è§£æ±ºãäœ å¯èœçèŠäžäºååŸïŒæéå°å
+¶ä»åé¡ãæåå·²è­Šåäºäœ . åŠæèŠèœå° æ­£é åŒ è«æ å¥œ.",
+  "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.",
+  "Cancel": "åæ¶",
+  "Insert/Modify Link": "æå
+¥/æ¹å¯«é£çµ",
+  "New window (_blank)": "æ°çªæ·(_blank)",
+  "None (use implicit)": "ç¡(use implicit)",
+  "Other": "å
+¶ä»",
+  "Same frame (_self)": "æ¬å¡ (_self)",
+  "Target:": "ç®æšå¡:",
+  "Title (tooltip):": "äž»é¡ (tooltip):",
+  "Top frame (_top)": "äžå¡ (_top)",
+  "URL:": "ç¶²å:",
+  "You must enter the URL where this link points to": "äœ å¿
+é èŒžå
+¥äœ èŠè¿ç»çç¶²å"
+}
Index: /branches/new-dialogs-merge/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/lang/ja.js (revision 809)
+++ /branches/new-dialogs-merge/lang/ja.js (revision 809)
@@ -0,0 +1,207 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8N
+
+{
+  "Bold": "å€ªå­",
+  "Italic": "æäœ",
+  "Underline": "äžç·",
+  "Strikethrough": "æã¡æ¶ãç·",
+  "Subscript": "äžä»ãæ·»ãå­",
+  "Superscript": "äžä»ãæ·»ãå­",
+  "Justify Left": "å·Šå¯ã",
+  "Justify Center": "äž­å€®å¯ã",
+  "Justify Right": "å³å¯ã",
+  "Justify Full": "åç­å²ä»",
+  "Ordered List": "çªå·ä»ãç®æ¡æžã",
+  "Bulleted List": "èšå·ä»ãç®æ¡æžã",
+  "Decrease Indent": "ã€ã³ãã³ãè§£é€",
+  "Increase Indent": "ã€ã³ãã³ãèš­å®",
+  "Font Color": "æå­è²",
+  "Background Color": "èæ¯è²",
+  "Horizontal Rule": "æ°Žå¹³ç·",
+  "Insert Web Link": "ãªã³ã¯ã®æ¿å
+¥",
+  "Insert/Modify Image": "ç»åã®æ¿å
+¥/ä¿®æ­£",
+  "Insert Table": "ããŒãã«ãæ¿å
+¥",
+  "Toggle HTML Source": "HTMLç·šéã¢ãŒããåæ¿",
+  "Enlarge Editor": "ãšãã£ã¿ãæå€§å",
+  "About this editor": "ããŒãžã§ã³æ
+å ±",
+  "Help using editor": "ãã«ã",
+  "Current style": "çŸåšã®ã¹ã¿ã€ã«",
+  "Undoes your last action": "å
+ã«æ»ã",
+  "Redoes your last action": "ããçŽã",
+  "Cut selection": "åãåã",
+  "Copy selection": "ã³ããŒ",
+  "Paste from clipboard": "è²Œãä»ã",
+  "Direction left to right": "å·Šããå³ãž",
+  "Direction right to left": "å³ããå·Šãž",
+  "Remove formatting": "æžåŒåé€",
+  "Select all": "ãã¹ãŠéžæ",
+  "Print document": "å°å·",
+  "Clear MSOffice tags": "MSOfficeã¿ã°ãã¯ãªã¢",
+  "Clear Inline Font Specifications": "ã€ã³ã©ã€ã³ãã©ã³ãæå®ãã¯ãªã¢",
+  "Would you like to clear font typefaces?": "ãã©ã³ãåãã¯ãªã¢ããŸãã?",
+  "Would you like to clear font sizes?": "ãµã€ãºãã¯ãªã¢ããŸãã?",
+  "Would you like to clear font colours?": "è²ãã¯ãªã¢ããŸãã?",
+  "Split Block": "é ååå²",
+  "Toggle Borders": "å¢çç·ã®åæ¿",
+  "Save as": "ååãã€ããŠä¿å­",
+  "Insert/Overwrite": "æ¿å
+¥/äžæžã",
+  "&mdash; format &mdash;": "&mdash; æžåŒ &mdash;",
+  "Heading 1": "èŠåºã1",
+  "Heading 2": "èŠåºã2",
+  "Heading 3": "èŠåºã3",
+  "Heading 4": "èŠåºã4",
+  "Heading 5": "èŠåºã5",
+  "Heading 6": "èŠåºã6",
+  "Normal": "æšæº",
+  "Address": "ã¢ãã¬ã¹",
+  "Formatted": "æŽåœ¢æžã¿",
+  "&mdash; font &mdash;": "&mdash; ãã©ã³ã &mdash;",
+  "&mdash; size &mdash;": "&mdash; ãµã€ãº &mdash;",
+  
+  //dialogs
+  "OK": "OK",
+  "Cancel": "äž­æ­¢",
+  "Path": "ãã¹",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "ãã­ã¹ãã¢ãŒãã§æäœããŠããŸããWYSIWYGç·šéã«æ»ãã«ã¯[<>]ãã¿ã³ãäœ¿ã£ãŠãã ããã",
+  "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "MozillaããŒã¹ã®Webãã©ãŠã¶ã§ã¯ãè²Œãä»ããã¿ã³ã¯æ©èœããŸããïŒæè¡çãªã»ã­ã¥ãªãã£äžã®çç±ã§ïŒãCtrl+Vã­ãŒãæŒããŠçŽæ¥è²Œãä»ããŠãã ããã",
+  "Your Document is not well formed. Check JavaScript console for details.": "ãã®ææžã«ã¯æ§æçãªåé¡ããããŸããè©³çŽ°ã¯JavaScriptã³ã³ãœãŒã«ãåç
+§ããŠãã ããã",
+  "You need to select some text before creating a link": "ãªã³ã¯ãäœæããã«ã¯ãã­ã¹ããéžæããå¿
+èŠããããŸã",
+
+  "Alignment:": "è¡æã:",
+  "Not set": "ãªã",
+  "Left": "å·Š",
+  "Right": "å³",
+  "Texttop": "ãã­ã¹ãäžéš",
+  "Absmiddle": "äž­å€®(çµ¶å¯Ÿç)",
+  "Baseline": "ããŒã¹ã©ã€ã³",
+  "Absbottom": "äž(çµ¶å¯Ÿç)",
+  "Bottom": "äž",
+  "Middle": "äž­å€®",
+  "Top": "äž",
+
+  "Layout": "ã¬ã€ã¢ãŠã",
+  "Spacing": "éé",
+  "Horizontal:": "æ°Žå¹³:",
+  "Horizontal padding": "æ°Žå¹³äœçœ",
+  "Vertical:": "åçŽ:",
+  "Vertical padding": "åçŽäœçœ",
+  "Border thickness:": "å¢çç·ã®å€ªã:",
+  "Leave empty for no border": "å¢çç·ããªãå Žåã¯ç©ºã®ãŸãŸã«ãã",
+
+  //Insert Link
+  "Insert/Modify Link": "ãªã³ã¯ã®æ¿å
+¥/ä¿®æ­£",
+  "None (use implicit)": "ãªã (ããã©ã«ãã«ä»»ãã)",
+  "New window (_blank)": "æ°ãããŠã£ã³ããŠ (_blank)",
+  "Same frame (_self)": "èªå·±ãã¬ãŒã å
+ (_self)",
+  "Top frame (_top)": "æäžäœãã¬ãŒã  (_top)",
+  "Other": "ãã®ä»",
+  "Target:": "ã¿ãŒã²ãã:",
+  "Title (tooltip):": "ã¿ã€ãã«:",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "ãã®ãªã³ã¯ãæãç€ºãURLãå
+¥åããŠãã ãã",
+
+  // Insert Table
+  "Insert Table": "ããŒãã«ã®æ¿å
+¥",
+  "Rows:": "è¡:",
+  "Number of rows": "è¡æ°",
+  "Cols:": "å:",
+  "Number of columns": "åæ°",
+  "Width:": "å¹
+:",
+  "Width of the table": "ããŒãã«ã®å¹
+",
+  "Percent": "ããŒã»ã³ã(%)",
+  "Pixels": "ãã¯ã»ã«(px)",
+  "Em": "çžå¯Ÿå€(em)",
+  "Width unit": "å¹
+ã®åäœ",
+  "Fixed width columns": "åã®å¹
+ãåºå®",
+  "Positioning of this table": "ãã®ããŒãã«ã®é
+çœ®",
+  "Cell spacing:": "ã»ã«éé:",
+  "Space between adjacent cells": "é£æ¥ããã»ã«éã®è·é¢",
+  "Cell padding:": "ã»ã«äœçœ:",
+  "Space between content and border in cell": "ã»ã«å
+ã«ãããå
+å®¹ãšå¢çç·ãšã®è·é¢",
+  "You must enter a number of rows": "è¡æ°ãå
+¥åããŠãã ãã",
+  "You must enter a number of columns": "åæ°ãå
+¥åããŠãã ãã",
+
+  // Insert Image
+  "Insert Image": "ç»åã®æ¿å
+¥",
+  "Image URL:": "ç»åURL:",
+  "Enter the image URL here": "ç»åã®URLãããã«å
+¥åããŸã",
+  "Preview": "è¡šç€º",
+  "Preview the image in a new window": "ãŠã£ã³ããŠã§ç»åãè¡šç€º",
+  "Alternate text:": "ä»£æ¿ãã­ã¹ã:",
+  "For browsers that don't support images": "ç»åè¡šç€ºããµããŒãããªããã©ãŠã¶ã«å¿
+èŠã§ã",
+  "Positioning of this image": "ç»åã®é
+çœ®",
+  "Image Preview:": "ç»åè¡šç€º:",
+  "You must enter the URL": "URLãå
+¥åããå¿
+èŠããããŸã",
+
+  //"button_bold": "fr/bold.gif",
+  //"button_underline": "fr/underline.gif",
+  //"button_strikethrough": "fr/strikethrough.gif",
+
+  // Editor Help
+  "Xinha Help": "ãã«ã",
+  "Editor Help": "ãšãã£ã¿ã®ãã«ã",
+  "Keyboard shortcuts": "ã­ãŒããŒãã·ã§ãŒãã«ãã",
+  "The editor provides the following key combinations:": "ãšãã£ã¿ã¯ä»¥äžã®ã­ãŒæäœãæäŸããŠããŸã:",
+  "ENTER": "ENTER",
+  "new paragraph": "æ°èŠæ®µèœ",
+  "SHIFT-ENTER": "SHIFT+ENTER",
+  "insert linebreak": "æ®µèœå
+æ¹è¡ã®æ¿å
+¥",
+  "Set format to paragraph": "æ®µèœæžåŒã®èš­å®",
+  "Clean content pasted from Word": "Wordããè²Œãä»ããããå
+å®¹ã®æž
+æž",
+  "Headings": "èŠåºã",
+  "Close": "éãã",
+
+  // Loading messages
+  "Loading in progress. Please wait!": "ã­ãŒãäž­ã§ãããã°ãããåŸ
+ã¡ãã ãã",
+  "Loading plugin $plugin" : "ã­ãŒãäž­ãã©ã°ã€ã³ $plugin",
+  "Register plugin $plugin" : "ç»é²äž­ãã©ã°ã€ã³ $plugin", 
+  "Constructing object": "ãªããžã§ã¯ãæ§ç¯äž­",
+  "Generate Xinha framework": "Xinhaãã¬ãŒã ã¯ãŒã¯çæäž­",
+  "Init editor size":"ãšãã£ã¿ãµã€ãºã®åæå", 
+  "Create Toolbar": "ããŒã«ããŒã®äœæ",
+  "Create Statusbar" : "ã¹ããŒã¿ã¹ããŒã®äœæ",
+  "Register right panel" : "ç»é² å³ããã«", 
+  "Register left panel" : "ç»é² å·Šããã«", 
+  "Register bottom panel" : "ç»é² äžããã«", 
+  "Register top panel" : "ç»é² äžããã«", 
+  "Finishing" : "å®äº",
+  
+  // ColorPicker
+  "Click a color..." : "è²ãã¯ãªãã¯...",
+  "Sample" : "ãµã³ãã«",
+  "Web Safe: " : "Webã»ãŒã: ",
+  "Color: " : "è²: "  
+};
Index: /branches/new-dialogs-merge/lang/he.js
===================================================================
--- /branches/new-dialogs-merge/lang/he.js (revision 104)
+++ /branches/new-dialogs-merge/lang/he.js (revision 104)
@@ -0,0 +1,64 @@
+// I18N constants
+
+// LANG: "he", ENCODING: UTF-8
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>
+
+// 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.)
+
+{
+  "Bold": "×××××©",
+  "Italic": "× ×××",
+  "Underline": "×§× ×ª××ª×",
+  "Strikethrough": "×§× ×××Š×¢",
+  "Subscript": "××ª× ×¢×××",
+  "Superscript": "××ª× ×ª××ª×",
+  "Justify Left": " ××©××š ××©×××",
+  "Justify Center": "××©××š ×××š××",
+  "Justify Right": "××©××š ×××××",
+  "Justify Full": "××©××š ××©××š× ××××",
+  "Ordered List": "×š×©××× ××××¡×€×š×ª",
+  "Bulleted List": "×š×©××× ×× ××××¡×€×š×ª",
+  "Decrease Indent": "××§×× ×× ××¡×",
+  "Increase Indent": "×××× ×× ××¡×",
+  "Font Color": "×Š××¢ ×××€×",
+  "Background Color": "×Š××¢ ×š×§×¢",
+  "Horizontal Rule": "×§× ×× ××",
+  "Insert Web Link": "××× ×¡ ×××€×š-×§××©××š",
+  "Insert/Modify Image": "××× ×¡/×©× × ×ª××× ×",
+  "Insert Table": "××× ×¡ ××××",
+  "Toggle HTML Source": "×©× × ××Š× ×§×× HTML",
+  "Enlarge Editor": "×××× ××ª ××¢××š×",
+  "About this editor": "×××××ª ×¢××š× ××",
+  "Help using editor": "×¢××š× ××©××××© ××¢××š×",
+  "Current style": "×¡×× ×× × ××××",
+  "Undoes your last action": "×××× ××ª ×€×¢×××ª× ××××š×× ×",
+  "Redoes your last action": "×××Š×¢ ××××© ××ª ××€×¢××× ××××š×× × ×©×××××ª",
+  "Cut selection": "××××š ××××š×",
+  "Copy selection": "××¢×ª×§ ××××š×",
+  "Paste from clipboard": "××××§ ×××××",
+  "Direction left to right": "××××× ××©××× ×××××",
+  "Direction right to left": "××××× ××××× ××©×××",
+  "OK": "×××©××š",
+  "Cancel": "×××××",
+  "Path": "× ×ª×× ×¢××Š××",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "××ª× ×××Š× ××§×¡× × ×§× (×§××). ××©×ª××© ×××€×ª××š [<>] ××× ×××××š ×××Š× WYSIWYG (×ª×Š×××ª ×¢××Š××).",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "××Š× ××¡× ××× ×××Š×š ××¢×××ª ×××€××€× Internet Explorer, ×¢×§× ××××× ×××€××€× ×× ××××× × ××€×ª××š ××ª ××.  ××ª/× ×¢×××/× ×××××ª ×ª×Š×××ª ×××,  ××¢×××ª ××ª×€×§×× ××¢××š× ×/×× ×§×š××¡× ×©× ×××€××€×.  ×× ×××¢×š××ª ×©×× ××× Windows 9x ×¡×××š ××× ×× ×©×ª×§××/× ",
+  "Cancel": "×××××",
+  "Insert/Modify Link": "×××¡×£/×©× × ×§××©××š",
+  "New window (_blank)": "×××× ×××© (_blank)",
+  "None (use implicit)": "××× (××©×ª××© ×-frame ××§×××)",
+  "Other": "×××š",
+  "Same frame (_self)": "×××ª× frame (_self)",
+  "Target:": "××¢×:",
+  "Title (tooltip):": "×××ª×š×ª (tooltip):",
+  "Top frame (_top)": "Frame ×¢×××× (_top)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "×××× ×××ª×× URL ×©×××× ×§××©××š ×× ××Š×××¢"
+}
Index: /branches/new-dialogs-merge/lang/fi.js
===================================================================
--- /branches/new-dialogs-merge/lang/fi.js (revision 301)
+++ /branches/new-dialogs-merge/lang/fi.js (revision 301)
@@ -0,0 +1,38 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8
+
+{
+  "Bold": "Lihavoitu",
+  "Italic": "Kursivoitu",
+  "Underline": "Alleviivattu",
+  "Strikethrough": "Yliviivattu",
+  "Subscript": "Alaindeksi",
+  "Superscript": "YlÃ€indeksi",
+  "Justify Left": "Tasaa vasemmat reunat",
+  "Justify Center": "KeskitÃ€",
+  "Justify Right": "Tasaa oikeat reunat",
+  "Justify Full": "Tasaa molemmat reunat",
+  "Ordered List": "Numerointi",
+  "Bulleted List": "Luettelomerkit",
+  "Decrease Indent": "PienennÃ€ sisennystÃ€",
+  "Increase Indent": "LisÃ€Ã€ sisennystÃ€",
+  "Font Color": "Fontin vÃ€ri",
+  "Background Color": "TaustavÃ€ri",
+  "Horizontal Rule": "Vaakaviiva",
+  "Insert Web Link": "LisÃ€Ã€ linkki",
+  "Insert/Modify Image": "LisÃ€Ã€ kuva",
+  "Insert Table": "LisÃ€Ã€ taulukko",
+  "Toggle HTML Source": "HTML-lÃ€hdekoodi vs WYSIWYG",
+  "Enlarge Editor": "Suurenna editori",
+  "About this editor": "Tietoja editorista",
+  "Help using editor": "NÃ€ytÃ€ ohje",
+  "Current style": "Nykyinen tyyli",
+  "Undoes your last action": "Peruuta viimeinen toiminto",
+  "Redoes your last action": "Palauta viimeinen toiminto",
+  "Cut selection": "Leikkaa maalattu",
+  "Copy selection": "Kopioi maalattu",
+  "Paste from clipboard": "LiitÃ€ leikepyÃ¶dÃ€ltÃ€",
+  "OK": "HyvÃ€ksy",
+  "Cancel": "Peruuta"
+}
Index: /branches/new-dialogs-merge/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/lang/nb.js (revision 561)
+++ /branches/new-dialogs-merge/lang/nb.js (revision 561)
@@ -0,0 +1,78 @@
+// I18N constants
+
+// LANG: "nb", ENCODING: UTF-8
+
+// - translated by ses<ses@online.no>
+// Additional translations by HÃ¥vard Wigtil <havardw@extend.no>
+// Additional translations by Kim Steinhaug <kim@steinhaug.com>
+
+{
+  "Bold": "Fet",
+  "Italic": "Kursiv",
+  "Underline": "Understreket",
+  "Strikethrough": "Gjennomstreket",
+  "Subscript": "Nedsenket",
+  "Superscript": "OpphÃžyet",
+  "Justify Left": "Venstrejuster",
+  "Justify Center": "Midtjuster",
+  "Justify Right": "HÃžyrejuster",
+  "Justify Full": "Blokkjuster",
+  "Ordered List": "Nummerert liste",
+  "Bulleted List": "Punktliste",
+  "Decrease Indent": "Reduser innrykk",
+  "Increase Indent": "Ãke innrykk",
+  "Font Color": "Tekstfarge",
+  "Background Color": "Bakgrundsfarge",
+  "Horizontal Rule": "Vannrett linje",
+  "Insert Web Link": "Lag lenke",
+  "Insert/Modify Image": "Sett inn bilde",
+  "Insert Table": "Sett inn tabell",
+  "Toggle HTML Source": "Vis kildekode",
+  "Enlarge Editor": "Vis i eget vindu",
+  "About this editor": "Om denne editor",
+  "Help using editor": "Hjelp",
+  "Current style": "NÃ¥vÃŠrende stil",
+  "Undoes your last action": "Angrer siste redigering",
+  "Redoes your last action": "GjÃžr om siste angring",
+  "Cut selection": "Klipp ut omrÃ¥de",
+  "Copy selection": "Kopier omrÃ¥de",
+  "Save as": "Lagre som",
+  "Paste from clipboard": "Lim inn",
+  "Remove formatting": "Fjern formattering",
+  "Direction left to right": "Fra venstre mot hÃžyre",
+  "Direction right to left": "Fra hÃžyre mot venstre",
+  "Insert/Overwrite": "Sett inn/Overskriv",
+  "OK": "OK",
+  "Cancel": "Avbryt",
+  "Path": "Tekstvelger",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "Du er i tekstmodus  Klikk pÃ¥ [<>] for Ã¥ gÃ¥ tilbake til WYSIWIG.",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Visning i eget vindu har kjente problemer med Internet Explorer, pÃ¥ grunn av problemer med denne nettleseren. Mulige problemer er et uryddig skjermbilde, manglende editorfunksjoner og/eller at nettleseren crasher. Hvis du bruker Windows 95 eller Windows 98 er det ogsÃ¥ muligheter for at Windows will crashe.\n\nTrykk ",
+  "Cancel": "Avbryt",
+  "Insert/Modify Link": "Rediger lenke",
+  "New window (_blank)": "Eget vindu (_blank)",
+  "None (use implicit)": "Ingen (bruk standardinnstilling)",
+  "Other": "Annen",
+  "Same frame (_self)": "Samme ramme (_self)",
+  "Target:": "MÃ¥l:",
+  "Title (tooltip):": "Tittel (tooltip):",
+  "Top frame (_top)": "Toppramme (_top)",
+  "URL:": "Adresse:",
+  "You must enter the URL where this link points to": "Du mÃ¥ skrive inn en adresse som denne lenken skal peke til",
+  "Clear Inline Font Specifications": "Fjerne inline font spesifikasjoner",
+  "Would you like to clear font typefaces?": "Ãnsker du Ã¥ fjerne skrifttyper",
+  "Would you like to clear font sizes?": "Ãnsker du Ã¥ fjerne skrift stÃžrrelser",
+  "Would you like to clear font colours?": "Ãnsker du Ã¥ fjerne farger pÃ¥ skriften",
+  "Print document": "Skriv ut dokumentet",
+  "Split Block": "Seperasjonsblokk",
+  "Toggle Borders": "Skru av/pÃ¥ hjelpelinjer pÃ¥ tabeller",
+  "Select all": "Merk alt",
+  // Loading messages
+  "Loading in progress. Please wait !": "WYSIWYG laster, vennligst vent!",
+  "Constructing main object": "Vennligst vent",
+  "Create Toolbar": "Lag verktÃžylinje",
+  "Register panel right": "Registrer hÃžyrepanel",
+  "Register panel left": "Registrer venstrepanel",
+  "Register panel top": "Registrer toppanel",
+  "Register panel bottom": "Registrer bunnpanel"
+
+};
Index: /branches/new-dialogs-merge/lang/el.js
===================================================================
--- /branches/new-dialogs-merge/lang/el.js (revision 104)
+++ /branches/new-dialogs-merge/lang/el.js (revision 104)
@@ -0,0 +1,121 @@
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+{
+  "Bold": "ÎÂÎÂœÎÂÎÎÎÂœÎÂ±",
+  "Italic": "ÎÂ ÎÂ»ÎÂ¬ÎÂ³ÎÎÎÂ±",
+  "Underline": "Îï¿œÎÂÎÎÎÂ³ÎÂÎÂ±ÎÎÎÎÎÎÎÂÎÎÎÂ­ÎÂœÎÂ±",
+  "Strikethrough": "ÎÂÎÎÎÂ±ÎÂ³ÎÂÎÂ±ÎÎÎÎÎÂ­ÎÂœÎÂ±",
+  "Subscript": "ÎÂÎÎ
+ÎâÎÎÎÂÎÂ·ÎÂ",
+  "Superscript": "ÎÂÎÎ
+ÎâÎÎÎÂÎÂ·ÎÂ",
+  "Justify Left": "ÎÂ£ÎÂÎÎÎâÎÂÎÎÎÂÎÂ· ÎÂÎÂÎÎÎÂÎÂÎÎ
+ÎÂÎÂ¬",
+  "Justify Center": "ÎÂ£ÎÂÎÎÎâÎÂÎÎÎÂÎÂ· ÎÂÎÂ­ÎÂœÎÂÎÂÎÎ",
+  "Justify Right": "ÎÂ£ÎÂÎÎÎâÎÂÎÎÎÂÎÂ· ÎÂÎÎ
+ÎÎÎÎÎÂ¬",
+  "Justify Full": "ÎÂ ÎÂ»Îï¿œÎÂÎÂ·ÎÂ ÎÂ£ÎÂÎÎÎâÎÂÎÎÎÂÎÂ·",
+  "Ordered List": "ÎÂÎÂÎâÎÎÎÎÎÂ·ÎÂÎÂ·",
+  "Bulleted List": "ÎÂÎÎÎÂ
+ÎÎÎÎÎâÎÎÎÎ
+ÎÂ",
+  "Decrease Indent": "ÎÂÎÎ
+ÎâÎÂÎÂÎÂ· ÎÂÎÂÎÎÎÂÎï¿œÎÂ",
+  "Increase Indent": "ÎÂÎÂÎÎÎÂ·ÎÂÎÂ· ÎÂÎÂÎÎÎÂÎï¿œÎÂ",
+  "Font Color": "ÎÂ§ÎÂÎÂÎÎÎÂ± ÎÂÎÂÎÂ±ÎÎÎÎÎÂ±ÎÂÎÎÎÂÎÎ
+ÎÎÎÂÎÂ¬ÎÂ",
+  "Background Color": "ÎÂ§ÎÂÎÂÎÎÎÂ± ÎÂŠÎÂÎÂœÎÂÎÎÎÂ
+",
+  "Horizontal Rule": "ÎÂÎÂÎÎÎÎÎÂÎÂœÎÂÎÎÎÂ± ÎÂÎÂÎÂ±ÎÎÎÎÎï¿œ",
+  "Insert Web Link": "ÎÂÎÎÎÂÎÂ±ÎÂ³ÎÂÎÂ³Îï¿œ ÎÂ£ÎÂ
+ÎÂœÎÎÎÂ­ÎÂÎÎÎÎÎÂ
+",
+  "Insert/Modify Image": "ÎÂÎÎÎÂÎÂ±ÎÂ³ÎÂÎÂ³Îï¿œ/Îï¿œÎÂÎÎÎÂÎÎÎÂÎÎÎâÎÂ·ÎÂÎÂ· ÎÂÎÎÎÎÎÂÎÂœÎÂ±ÎÂ",
+  "Insert Table": "ÎÂÎÎÎÂÎÂ±ÎÂ³ÎÂÎÂ³Îï¿œ ÎÂ ÎâÎÂœÎÂ±ÎÎÎÂ±",
+  "Toggle HTML Source": "ÎÂÎÂœÎÂ±ÎÂ»ÎÂ»ÎÂ±ÎÂ³Îï¿œ ÎÂÎÎ
+/ÎÂ±ÎÂÎÂ HTML",
+  "Enlarge Editor": "ÎÂÎÎ
+ÎÂ³ÎÂ­ÎÂœÎÎÎÂ
+ÎÂœÎÂÎÂ· ÎÎ
+ÎÂÎÎ
+ÎÎÎÎ
+ÎÂÎÂ³ÎÂ±ÎÂÎÂÎï¿œ",
+  "About this editor": "ÎÂ ÎÂ»ÎÂ·ÎÂÎÎÎÂÎÎÎÂÎâÎÎ
+ÎÂ",
+  "Help using editor": "ÎÂÎÎÎï¿œÎÎÎÎ
+ÎÎÎÂ±",
+  "Current style": "ÎÂ ÎÂ±ÎÂÎÂÎÂœ ÎÂÎÂÎÂ
+ÎÂ»",
+  "Undoes your last action": "ÎÂÎÂœÎÂ±ÎâÎÂÎÎ
+ÎÂÎÂ· ÎÂÎÎ
+ÎÂ»ÎÎ
+ÎÂ
+ÎÂÎÂ±ÎâÎÂ±ÎÂ ÎÎ
+ÎÂœÎÂ­ÎÂÎÂ³ÎÎ
+ÎÎÎÂ±ÎÂ",
+  "Redoes your last action": "ÎÂÎÂÎÂ±ÎÂœÎÂ±ÎÂÎÎÎÂÎÂ¬ ÎÂ±ÎÂÎÂ ÎÂ±ÎÂœÎÂ±ÎâÎÂÎÎ
+ÎÂÎÂ·",
+  "Cut selection": "ÎÂÎÂÎÎÎÎÎÎÎÂÎï¿œ",
+  "Copy selection": "ÎÂÎÂœÎÂÎÎÎÂ³ÎÂÎÂ±ÎÂÎï¿œ",
+  "Paste from clipboard": "ÎÂÎÂÎÎÎÎÎÂÎÂ»ÎÂ»ÎÂ·ÎÂÎÂ·",
+  "Direction left to right": "ÎÂÎÂ±ÎÂÎÎ
+ÎÂÎÎÎÂ
+ÎÂœÎÂÎÂ· ÎÂ±ÎÂÎÎÎÂÎÂÎÎ
+ÎÂÎÂ¬ ÎÂÎÂÎÎÎÂ ÎÎÎÎ
+ÎÎÎÎÎÂ¬",
+  "Direction right to left": "ÎÂÎÂ±ÎÂÎÎ
+ÎÂÎÎÎÂ
+ÎÂœÎÂÎÂ· ÎÂ±ÎÂÎÂ ÎÎÎÎ
+ÎÎÎÎÎÂ¬ ÎÂÎÂÎÎÎÂ ÎÂÎÂ± ÎÂ±ÎÂÎÎÎÂÎÂÎÎ
+ÎÂÎÂ¬",
+  "OK": "OK",
+  "Cancel": "ÎÂÎÎÎÂÎÂÎÂÎÂÎÂ·",
+  "Path": "ÎÂÎÎÎÂ±ÎÎÎÂÎÎÎÎÎï¿œ",
+  "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.": "ÎÂÎâÎÂÎÂÎÎ
+ ÎÂÎÎ
+ TEXT MODE.  ÎÂ§ÎÂÎÂ·ÎÂÎÎÎÎÎÎÎÂÎÎÎÎÎï¿œÎÂÎÂÎÎ
+ ÎÂÎÎ ÎÎÎÎÎÂ
+ÎÎÎÂÎâ [<>] ÎÂ³ÎÎÎÂ± ÎÂœÎÂ± ÎÎ
+ÎÂÎÂ±ÎÂœÎÂ­ÎÂÎÎÎÎ
+ÎÂÎÎ
+ ÎÂÎÂÎÎ WYSIWIG.",
+  "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "ÎÂ ÎÎÎÂ±ÎÂÎÂ¬ÎÂÎÂÎÂ±ÎÂÎÂ· ÎÂÎÂ»Îï¿œÎÂÎÂ·ÎÂ ÎÎÎÎÎÂÎÂœÎÂ·ÎÂ ÎÂ­ÎÂÎÎ
+ÎÎ ÎÂÎÂÎÎÎÂ²ÎÂ»Îï¿œÎÎÎÂ±ÎÂÎÂ± ÎÎÎÎ
+ ÎÂÎÎÎÂœ Internet Explorer, ÎÂ»ÎÂÎÂ³ÎÂ ÎÂÎÂÎÂ±ÎÂ»ÎÎÎÂ¬ÎÂÎÂÎÂœ ÎÂÎÂÎÎÎÂœ ÎâÎÎÎÎÎÎ ÎÂÎÎÎÂœ browser.  ÎÂÎÂœ ÎÂÎÎ ÎÂÎÂÎÂÎÂÎÂ·ÎÎÎÂ± ÎÂÎÂ±ÎÂ ÎÎ
+ÎâÎÂœÎÂ±ÎÎ Windows 9x ÎÎÎÂÎÎÎÂÎÎ
+Îâ ÎÎÎÂ±ÎÎ ÎÂœÎÂ± ÎÂÎÂÎÎ
+ÎÎÎÂ±ÎÂÎÂÎÎ
+ÎâÎÂÎÎ
+ reboot. ÎÂÎÂœ ÎÎ
+ÎâÎÂÎÂÎÎ
+ ÎÂÎâÎÂ³ÎÎÎÂ
+ÎÂÎÎÎÎ, ÎÂÎÂ±ÎÂÎï¿œÎÂÎÂÎÎ
+ ÎÂÎÂ.",
+  "Cancel": "ÎÂÎÎÎÂÎÂÎÂÎÂÎÂ·",
+  "Insert/Modify Link": "ÎÂÎÎÎÂÎÂ±ÎÂ³ÎÂÎÂ³Îï¿œ/Îï¿œÎÂÎÎÎÂÎÎÎÂÎÎÎâÎÂ·ÎÂÎÂ· ÎÂÎÂÎÂœÎÎÎÎ
+ÎÂÎÎÎÎÎÂ
+",
+  "New window (_blank)": "ÎÂÎÂ­ÎÎ ÎÂÎÂ±ÎÂÎÂ¬ÎÎÎÂ
+ÎÂÎÎ (_blank)",
+  "None (use implicit)": "ÎÂÎÂ±ÎÂœÎÂ­ÎÂœÎÂ± (ÎÂÎÂÎï¿œÎÂÎÂ· ÎÂ±ÎÂÎÂÎÂ»ÎÂ
+ÎÂÎÎÎÂ
+)",
+  "Other": "ÎÂÎÂ»ÎÂ»ÎÎ",
+  "Same frame (_self)": "ÎÂÎÎÎÎÎÎ frame (_self)",
+  "Target:": "Target:",
+  "Title (tooltip):": "Îï¿œÎâÎÂÎÂ»ÎÎÎÂ (tooltip):",
+  "Top frame (_top)": "ÎÂ ÎÂ¬ÎÂœÎÂ frame (_top)",
+  "URL:": "URL:",
+  "You must enter the URL where this link points to": "ÎÂ ÎÂÎÂ­ÎÂÎÎ
+ÎÎ ÎÂœÎÂ± ÎÎ
+ÎÎÎÂÎÂ¬ÎÂ³ÎÎ
+ÎÂÎÎ
+ ÎÂÎÎ URL ÎÂÎÎÎÂ
+ ÎÎÎÎÎÂ·ÎÂ³ÎÎ
+Îâ ÎÂ±ÎÂ
+ÎÂÎÂÎÂ ÎÎ ÎÂÎÂÎÂœÎÎÎÎ
+ÎÂÎÎÎÎÎÂ"
+}
Index: /branches/new-dialogs-merge/plugins/LangMarks/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/LangMarks/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/LangMarks/lang/pt_br.js (revision 901)
@@ -0,0 +1,23 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "language select": "Selecionar idioma",
+  "&mdash; language &mdash;":	"&mdash; Idioma &mdash;",
+  "Greek": "Grego",
+  "English": "Inglês",
+  "French": "Francês",
+  "Latin": "Latim"
+};
Index: /branches/new-dialogs-merge/plugins/LangMarks/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/LangMarks/lang/fr.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/LangMarks/lang/fr.js (revision 901)
@@ -0,0 +1,10 @@
+﻿// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "language select": "Sélection de la langue",
+  "&mdash; language &mdash;":	"&mdash; Langue &mdash;",
+  "Greek": "grec",
+  "English": "anglais",
+  "French": "français",
+  "Latin": "latin"
+};
Index: /branches/new-dialogs-merge/plugins/LangMarks/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/LangMarks/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/LangMarks/lang/de.js (revision 677)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "language select": "Sprachauswahl",
+  "&mdash; language &mdash;":	"&mdash; Sprache &mdash;",
+  "Greek": "griechisch",
+  "English": "englisch",
+  "French": "franzÃ¶sisch",
+  "Latin": "lateinisch"
+};
Index: /branches/new-dialogs-merge/plugins/LangMarks/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/LangMarks/lang/nl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/LangMarks/lang/nl.js (revision 677)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "language select": "Taalkeuze",
+  "&mdash; language &mdash;":	"&mdash; taal &mdash;",
+  "Greek": "Grieks",
+  "English": "Engels",
+  "French": "Frans",
+  "Latin": "Latijns"
+};
Index: /branches/new-dialogs-merge/plugins/LangMarks/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/LangMarks/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/LangMarks/lang/ja.js (revision 715)
@@ -0,0 +1,10 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "language select": "èšèªã®éžæ",
+  "&mdash; language &mdash;":	"&mdash; èšèª &mdash;",
+  "Greek": "ã®ãªã·ã£èª",
+  "English": "è±èª",
+  "French": "ãã©ã³ã¹èª",
+  "Latin": "ã©ãã³èª"
+};
Index: /branches/new-dialogs-merge/plugins/LangMarks/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/LangMarks/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/LangMarks/lang/nb.js (revision 677)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "language select": "SprÃ¥kvalg",
+  "&mdash; language &mdash;":	"&mdash; SprÃ¥k &mdash;",
+  "Greek": "grekisk",
+  "English": "engelsk",
+  "French": "fransk",
+  "Latin": "latin"
+};
Index: /branches/new-dialogs-merge/plugins/LangMarks/lang-marks.css
===================================================================
--- /branches/new-dialogs-merge/plugins/LangMarks/lang-marks.css (revision 995)
+++ /branches/new-dialogs-merge/plugins/LangMarks/lang-marks.css (revision 995)
@@ -0,0 +1,15 @@
+span.haslang {
+	border-bottom: 1px dashed #aaa;
+	white-space : nowrap;
+}
+span[lang]::after {
+	content: attr(lang);
+	text-transform: uppercase;
+	font-family: sans-serif;
+	color: white;
+	background: red;
+	border: 1px solid red;
+	font-size: x-small;
+	font-weight: normal;
+	vertical-align: top;
+}
Index: /branches/new-dialogs-merge/plugins/LangMarks/lang-marks.js
===================================================================
--- /branches/new-dialogs-merge/plugins/LangMarks/lang-marks.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/LangMarks/lang-marks.js (revision 999)
@@ -0,0 +1,127 @@
+// Mask Language plugin for Xinha
+// Implementation by Udo Schmal
+//
+// (c) Udo Schmal & Schaffrath NeueMedien 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function LangMarks(editor, args) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+  var options = {};
+  options[this._lc("&mdash; language &mdash;")] = '';
+	for (var i in cfg.LangMarks)
+	{
+		if (typeof i != 'string') continue;
+		options[this._lc(i)] = cfg.LangMarks[i];
+	}
+
+  cfg.registerDropdown({
+    id	: "langmarks",
+    tooltip	: this._lc("language select"),
+    options	: options,
+    action	: function(editor) { self.onSelect(editor, this); },
+    refresh	: function(editor) { self.updateValue(editor, this); }
+  });
+  cfg.addToolbarElement("langmarks", "inserthorizontalrule", 1);
+}
+
+LangMarks._pluginInfo = {
+  name          : "LangMarks",
+  version       : "1.0",
+  developer     : "Udo Schmal",
+  developer_url : "",
+  sponsor       : "L.N.Schaffrath NeueMedien",
+  sponsor_url   : "http://www.schaffrath-neuemedien.de/",
+  c_owner       : "Udo Schmal & Schaffrath NeueMedien",
+  license       : "htmlArea"
+};
+
+Xinha.Config.prototype.LangMarks = {
+  "Greek" : "el",
+  "English" : "en",
+  "French" : "fr",
+  "Latin" : "la"
+};
+
+LangMarks.prototype._lc = function(string) {
+  return Xinha._lc(string, 'LangMarks');
+};
+
+LangMarks.prototype.onGenerate = function() {
+	 this.editor.addEditorStylesheet(Xinha.getPluginDir("LangMarks") + '/lang-marks.css');
+};
+
+LangMarks.prototype.onSelect = function(editor, obj, context, updatecontextclass) {
+  var tbobj = editor._toolbarObjects[obj.id];
+  var index = tbobj.element.selectedIndex;
+  var language = tbobj.element.value;
+
+  // retrieve parent element of the selection
+  var parent = editor.getParentElement();
+  var surround = true;
+
+  var is_span = (parent && parent.tagName.toLowerCase() == "span");
+  var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context);
+
+  if (update_parent) {
+    parent.className = "haslang";
+    parent.lang = language;
+    editor.updateToolbar();
+    return;
+  }
+
+  if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) {
+    while (parent.firstChild) {
+      parent.parentNode.insertBefore(parent.firstChild, parent);
+    }
+    parent.parentNode.removeChild(parent);
+    editor.updateToolbar();
+    return;
+  }
+
+  if (is_span) {
+    // maybe we could simply change the class of the parent node?
+    if (parent.childNodes.length == 1) {
+      parent.className = "haslang";
+      parent.lang = language;
+      surround = false;
+      // in this case we should handle the toolbar updation
+      // ourselves.
+      editor.updateToolbar();
+    }
+  }
+
+  // Other possibilities could be checked but require a lot of code.  We
+  // can't afford to do that now.
+  if (surround) {
+    // shit happens ;-) most of the time.  this method works, but
+    // it's dangerous when selection spans multiple block-level
+    // elements.
+    editor.surroundHTML('<span lang="' + language + '" class="haslang">', '</span>');
+  }
+};
+
+LangMarks.prototype.updateValue = function(editor, obj) {
+  var select = editor._toolbarObjects[obj.id].element;
+  var parents = editor.getAllAncestors();
+  var parent;
+	for (var i=0;i<parents.length;i++)
+	{
+		if (parents[i].lang) parent = parents[i];
+	}
+	if (parent) {
+    var options = select.options;
+    var value = parent.lang;
+    for (var i = options.length; --i >= 0;) {
+      var option = options[i];
+      if (value == option.value) {
+        select.selectedIndex = i;
+        return;
+      }
+    }
+  }
+  else select.selectedIndex = 0;
+
+};
Index: /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/pt_br.js (revision 901)
@@ -0,0 +1,18 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Spell Check using ieSpell": "Verificação Ortográfica utilizando ieSpell"
+}
Index: /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/de.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "Spell Check using ieSpell": "Englische Rechtschreibkontrolle mit ieSpell",
+  "ieSpell can only be used in Internet Explorer": "ieSpell kann nur mit dem Internet Explorer benutzt werden",
+  "ieSpell not detected.  Click Ok to go to download page.": "ieSpell wurde nicht gefunden. DrÃŒcken sie Ok um ieSpeck herunter zu laden."
+};
Index: /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/nl.js (revision 872)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Spell Check using ieSpell": "Engelse spellingscontrole met ieSpell",
+  "ieSpell can only be used in Internet Explorer": "ieSpell kan alleen worden gebruikt in Internet Explorer",
+  "ieSpell not detected.  Click Ok to go to download page.": "ieSpell werd niet gevonden. Klik op Ok om ieSpell te downloaden"
+};
Index: /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/ja.js (revision 715)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Spell Check using ieSpell": "ã¹ãã«ãã§ãã¯ã« ieSpell ãäœ¿ã",
+  "ieSpell can only be used in Internet Explorer": "ieSpell ã¯ Internet Explorer ã§ã®ã¿äœ¿çšã§ããŸã",
+  "ieSpell not detected.  Click Ok to go to download page.": "ieSpell ãæ€ç¥ãããŸããã§ãããOK ãã¯ãªãã¯ããŠããŠã³ã­ãŒãããŒãžãéããŠãã ããã"
+};
Index: /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/lang/nb.js (revision 677)
@@ -0,0 +1,3 @@
+// Dummy file
+
+{};
Index: /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/clientside-spellcheck.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/clientside-spellcheck.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/ClientsideSpellcheck/clientside-spellcheck.js (revision 856)
@@ -0,0 +1,62 @@
+// IE Spell Implementation for XINHA
+//Client-side spell check plugin
+//This implements the API for ieSpell, which is owned by Red Egg Software 
+//For more info about ieSpell, go to http://www.iespell.com/index.htm
+// Distributed under the same terms as Xinha itself.
+// This notice MUST stay intact for use (see license.txt).
+
+
+function ClientsideSpellcheck(editor) {
+  this.editor = editor;
+
+  var cfg = editor.config;
+  var bl = ClientsideSpellcheck.btnList;
+  var self = this;
+
+  // see if we can find the mode switch button, insert this before that
+  var id = "clientsidespellcheck";
+  
+  
+  cfg.registerButton(id, this._lc("Spell Check using ieSpell"), editor.imgURL("clientside-spellcheck.gif", "ClientsideSpellcheck"), false,
+             function(editor, id) {
+               // dispatch button press event
+               self.buttonPress(editor, id);
+             });
+
+  if(Xinha.is_ie) {
+    cfg.addToolbarElement("clientsidespellcheck", "print", 1);
+}
+
+}
+
+ClientsideSpellcheck._pluginInfo = {
+  name          : "ClientsideSpellcheck",
+  version       : "1.0",
+  developer     : "Michael Harris",
+  developer_url : "http://www.jonesinternational.edu",
+  c_owner       : "Red Egg Software",
+  sponsor       : "Jones International University",
+  sponsor_url   : "http://www.jonesinternational.edu",
+  license       : "htmlArea"
+};
+
+
+ClientsideSpellcheck.prototype._lc = function(string) {
+  return Xinha._lc(string, 'ClientsideSpellcheck');
+};
+
+ClientsideSpellcheck.prototype.buttonPress = function(editor) {
+
+	try {
+		var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
+		tmpis.CheckAllLinkedDocuments(document);
+	}
+	catch(exception) {
+ 		if(exception.number==-2146827859) {
+			if (confirm(this.lc("ieSpell not detected.  Click Ok to go to download page.")))
+				window.open("http://www.iespell.com/download.php","DownLoad");
+		} else {
+			alert(this.lc("ieSpell can only be used in Internet Explorer"));
+		}
+	}
+};
Index: /branches/new-dialogs-merge/plugins/EditTag/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/EditTag/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/EditTag/lang/pt_br.js (revision 901)
@@ -0,0 +1,22 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Cancel": "Cancelar",
+  "Edit HTML for selected text": "Editar HTML para texto selecionado",
+  "Edit Tag By Peg": "Editar Tag por Peg",
+  "OK": "OK",
+  "Tag Editor": "Editor de Tag"
+}
Index: /branches/new-dialogs-merge/plugins/EditTag/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/EditTag/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/EditTag/lang/fr.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Edit HTML for selected text": "Editer le code HTML du texte sÃ©lectionnÃ©",
+  "Tag Editor": "Editeur de tag HTML"
+};
Index: /branches/new-dialogs-merge/plugins/EditTag/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/EditTag/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/EditTag/lang/de.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "Edit HTML for selected text": "HTML im ausgewÃ€hlten Bereich bearbeiten",
+  "Tag Editor": "HTML tag Editor"
+};
Index: /branches/new-dialogs-merge/plugins/EditTag/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/EditTag/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/EditTag/lang/nl.js (revision 872)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Edit HTML for selected text": "HTML bewerken voor geselecteerde tekst",
+  "Tag Editor": "HTML tag Editor"
+};
Index: /branches/new-dialogs-merge/plugins/EditTag/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/EditTag/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/EditTag/lang/ja.js (revision 715)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Edit HTML for selected text": "éžæäž­ãã­ã¹ãã®HTMLãç·šéããŸã",
+  "Tag Editor": "ã¿ã°ãšãã£ã¿"
+};
Index: /branches/new-dialogs-merge/plugins/EditTag/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/EditTag/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/EditTag/lang/nb.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Edit HTML for selected text": "Rediger HTML for den valgte teksten"
+};
Index: /branches/new-dialogs-merge/plugins/EditTag/popups/edit_tag.html
===================================================================
--- /branches/new-dialogs-merge/plugins/EditTag/popups/edit_tag.html (revision 740)
+++ /branches/new-dialogs-merge/plugins/EditTag/popups/edit_tag.html (revision 740)
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <title>Edit Tag By Peg</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+<script language="javascript">
+  window.resizeTo(600, 450);
+function Init() {
+  __dlg_translate("EditTag");
+  __dlg_init();
+
+  var param = window.dialogArguments;
+  document.getElementById("TAG").value = param["content"];
+  document.getElementById("TAG").focus();
+}
+
+function onCancel() {
+  __dlg_close( null );
+  return false;
+}
+
+function onOK() {
+  var ret = document.getElementById("TAG").value;
+  __dlg_close( ret );
+}
+</script>
+</head>
+
+<body class="dialog" onLoad="Init();">
+<div class="title">Tag Editor</div>
+<textarea name="TAG" id="TAG" cols=22 rows=5 style="width: 100%; height: 315px; margin-top: 8px; margin-bottom: 4px; font-family: monospace; font-size: 11px;"></textarea>
+<div id="buttons">
+    <button type="submit" name="ok" onclick="return onOK();">OK</button>
+    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/EditTag/edit-tag.js
===================================================================
--- /branches/new-dialogs-merge/plugins/EditTag/edit-tag.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/EditTag/edit-tag.js (revision 856)
@@ -0,0 +1,56 @@
+// Character Map plugin for Xinha
+// Sponsored by http://www.systemconcept.de
+// Implementation by Holger Hees based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/)
+// Original Author - Bernhard Pfeifer novocaine@gmx.net 
+//
+// (c) systemconcept.de 2004
+// Distributed under the same terms as Xinha itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function EditTag(editor) {
+  this.editor = editor;
+	var cfg = editor.config;
+	var self = this;
+        
+	cfg.registerButton({
+                id       : "edittag",
+                tooltip  : this._lc("Edit HTML for selected text"),
+                image    : editor.imgURL("ed_edit_tag.gif", "EditTag"),
+                textMode : false,
+                action   : function(editor) {
+                             self.buttonPress(editor);
+                           }
+            });
+
+	cfg.addToolbarElement("edittag", "htmlmode",1);
+
+}
+
+EditTag._pluginInfo = {
+	name          : "EditTag",
+	version       : "1.0",
+	developer     : "Pegoraro Marco",
+	developer_url : "http://www.sin-italia.com/",
+	c_owner       : "Marco Pegoraro",
+	sponsor       : "Sin Italia",
+	sponsor_url   : "http://www.sin-italia.com/",
+	license       : "htmlArea"
+};
+
+EditTag.prototype._lc = function(string) {
+    return Xinha._lc(string, 'EditTag');
+};
+
+EditTag.prototype.buttonPress = function(editor) {
+	// Costruzione dell'oggetto parametri da passare alla dialog.
+	outparam = {
+		content : editor.getSelectedHTML()
+	}; // Fine costruzione parametri per il passaggio alla dialog.
+	editor._popupDialog( "plugin://EditTag/edit_tag", function( html ) {
+		if ( !html ) {  
+			//user must have pressed Cancel
+			return false;
+		}
+		editor.insertHTML( html );
+	}, outparam);
+};
Index: /branches/new-dialogs-merge/plugins/PasteText/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/PasteText/lang/pt_br.js (revision 901)
@@ -0,0 +1,21 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt)
+{
+  "Cancel": "Cancelar",
+  "OK": "OK",
+  "Paste Text": "Colar Texto",
+  "Paste as Plain Text": "Colar um texto básico"
+}
Index: /branches/new-dialogs-merge/plugins/PasteText/lang/ru.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/lang/ru.js (revision 989)
+++ /branches/new-dialogs-merge/plugins/PasteText/lang/ru.js (revision 989)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "ru", ENCODING: UTF-8
+{
+  "Paste as Plain Text": "ÐÑÑÐ°Ð²ÐžÑÑ ÐºÐ°Ðº ÐŸÐ±ÑÑÐœÑÐ¹ ÑÐµÐºÑÑ"
+};
Index: /branches/new-dialogs-merge/plugins/PasteText/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/PasteText/lang/fr.js (revision 677)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Paste as Plain Text": "Copier comme texte pur"
+};
Index: /branches/new-dialogs-merge/plugins/PasteText/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/PasteText/lang/de.js (revision 677)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+{
+  "Paste as Plain Text": "unformatierten Text einfÃŒgen"
+};
Index: /branches/new-dialogs-merge/plugins/PasteText/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/PasteText/lang/nl.js (revision 872)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Paste as Plain Text": "Kopieer als platte tekst (geen opmaak)"
+};
Index: /branches/new-dialogs-merge/plugins/PasteText/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/PasteText/lang/ja.js (revision 715)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Paste as Plain Text": "ãã¬ãŒã³ãã­ã¹ããšããŠè²Œãä»ã"
+};
Index: /branches/new-dialogs-merge/plugins/PasteText/lang/pl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/lang/pl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/PasteText/lang/pl.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "pl", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl
+{
+  "Paste as Plain Text": "Wklej jako czysty tekst"
+};
Index: /branches/new-dialogs-merge/plugins/PasteText/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/PasteText/lang/nb.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Paste as Plain Text": "Lim inn som ren tekst"
+};
Index: /branches/new-dialogs-merge/plugins/PasteText/popups/paste_text.html
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/popups/paste_text.html (revision 858)
+++ /branches/new-dialogs-merge/plugins/PasteText/popups/paste_text.html (revision 858)
@@ -0,0 +1,52 @@
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Paste Text</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+<script type="text/javascript">
+
+function init() {
+
+  __dlg_translate("PasteText");
+  __dlg_init(null,{width:600,height:480});
+
+  var param = window.dialogArguments;
+  document.getElementById("paragraphOption").style.display = (param.showParagraphOption) ? '' : 'none';
+   document.getElementById("insertParagraphs").checked = param.newParagraphDefault;
+  document.getElementById("inputArea").focus();
+}
+
+function onCancel() {
+  __dlg_close( null );
+  return false;
+}
+
+function onOK() {
+  var ret = {};
+  ret.text = document.getElementById("inputArea").value;
+  ret.insertParagraphs = document.getElementById("insertParagraphs").checked;
+  __dlg_close( ret );
+}
+window.onload = init;
+</script>
+</head>
+
+<body class="dialog">
+<div class="title">Paste as Plain Text</div>
+<form>
+<div>
+<textarea name="inputArea" id="inputArea" cols=22 rows=5 style="width: 100%; height: 315px; margin-top: 8px; margin-bottom: 4px; font-family: monospace; font-size: 11px;"></textarea>
+<div id="buttons">
+<label for="insertParagraphs" style="float:left;display:none" id="paragraphOption">
+<input type="checkbox" id="insertParagraphs" /> Insert text in new paragraph 
+</label>
+    <button type="button" name="ok" onclick="return onOK();">OK</button>
+    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/PasteText/paste-text.js
===================================================================
--- /branches/new-dialogs-merge/plugins/PasteText/paste-text.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/PasteText/paste-text.js (revision 999)
@@ -0,0 +1,75 @@
+// Paste Plain Text plugin for Xinha
+
+// Distributed under the same terms as Xinha itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function PasteText(editor) {
+	this.editor = editor;
+	var cfg = editor.config;
+	var self = this;
+        
+	cfg.registerButton({
+                id       : "pastetext",
+                tooltip  : this._lc("Paste as Plain Text"),
+                image    : editor.imgURL("ed_paste_text.gif", "PasteText"),
+                textMode : false,
+                action   : function(editor) {
+                             self.buttonPress(editor);
+                           }
+            });
+
+	cfg.addToolbarElement("pastetext", ["paste", "killword"], 1);
+}
+
+PasteText._pluginInfo = {
+	name          : "PasteText",
+	version       : "1.2",
+	developer     : "Michael Harris",
+	developer_url : "http://www.jonesadvisorygroup.com",
+	c_owner       : "Jones Advisory Group",
+	sponsor       : "Jones International University",
+	sponsor_url   : "http://www.jonesinternational.edu",
+	license       : "htmlArea"
+};
+
+PasteText.prototype._lc = function(string) {
+    return Xinha._lc(string, 'PasteText');
+};
+
+Xinha.Config.prototype.PasteText =
+{
+	showParagraphOption : true,
+	newParagraphDefault :true
+}
+
+PasteText.prototype.buttonPress = function(editor) {
+
+	var editor = this.editor;
+	var outparam = editor.config.PasteText; 
+	var action = function( ret ) {
+		var html = ret.text;
+		var insertParagraphs = ret.insertParagraphs;
+		html = html.replace(/</g, "&lt;");
+  		html = html.replace(/>/g, "&gt;");
+  		if ( ret.insertParagraphs)
+  		{
+  			html = html.replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;");
+			html = html.replace(/\n/g,"</p><p>");
+			html="<p>" + html + "</p>";
+			if (Xinha.is_ie)
+			{
+				editor.insertHTML(html);
+			}
+			else
+			{
+				editor.execCommand("inserthtml",false,html);
+			}
+		}
+		else
+		{
+			html = html.replace(/\n/g,"<br />");
+			editor.insertHTML(html);
+		}
+	}
+	Dialog( Xinha.getPluginDir("PasteText")+ "/popups/paste_text.html", action, outparam);
+};
Index: /branches/new-dialogs-merge/plugins/BackgroundImage/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/BackgroundImage/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/BackgroundImage/lang/pt_br.js (revision 901)
@@ -0,0 +1,21 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Cancel": "Cancelar",
+  "Remove Current Background": "Remover fundo atual",
+  "Set Page Background Image": "Definir Imagem de Fundo",
+  "Set page background image": "Definir imagem de fundo"
+}
Index: /branches/new-dialogs-merge/plugins/BackgroundImage/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/BackgroundImage/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/BackgroundImage/lang/fr.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Set page background image": "DÃ©finir l'image de fond",
+  "Set Page Background Image": "DÃ©finir l'Image de Fond",
+  "Remove Current Background": "Supprimer le fond actuel",
+  "Cancel": "Annuler"
+};
Index: /branches/new-dialogs-merge/plugins/BackgroundImage/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/BackgroundImage/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/BackgroundImage/lang/de.js (revision 677)
@@ -0,0 +1,9 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "Set page background image": "Seiten-Hintergrundbild setzen",
+  "Set Page Background Image": "Seiten-Hintergrundbild setzen",
+  "Remove Current Background": "Aktuellen Hintergrund entfernen",
+  "Cancel": "Abbrechen"
+};
Index: /branches/new-dialogs-merge/plugins/BackgroundImage/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/BackgroundImage/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/BackgroundImage/lang/nl.js (revision 872)
@@ -0,0 +1,9 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Set page background image": "Pagina achtergrond afbeelding instellen",
+  "Set Page Background Image": "Pagina Achtergrond Afbeelding Instellen",
+  "Remove Current Background": "Huidige Achtergrond Afbeelding Verwijderen",
+  "Cancel": "Annuleren"
+};
Index: /branches/new-dialogs-merge/plugins/BackgroundImage/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/BackgroundImage/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/BackgroundImage/lang/ja.js (revision 715)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Set page background image": "ããŒãžã®èæ¯ç»åãèš­å®",
+  "Set Page Background Image": "ããŒãžã®èæ¯ç»åãèš­å®",
+  "Remove Current Background": "çŸåšã®èæ¯ç»åãé€å»",
+  "Cancel": "äž­æ­¢"
+};
Index: /branches/new-dialogs-merge/plugins/BackgroundImage/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/BackgroundImage/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/BackgroundImage/lang/nb.js (revision 677)
@@ -0,0 +1,9 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Set page background image": "Velg bakgrunnsbilde pÃ¥ siden",
+  "Set Page Background Image": "Velg bakgrunnsbilde pÃ¥ Siden",
+  "Remove Current Background": "Fjern gjeldende bakgrunn",
+  "Cancel": "Avbryt"
+};
Index: /branches/new-dialogs-merge/plugins/BackgroundImage/popups/bgimage.html
===================================================================
--- /branches/new-dialogs-merge/plugins/BackgroundImage/popups/bgimage.html (revision 999)
+++ /branches/new-dialogs-merge/plugins/BackgroundImage/popups/bgimage.html (revision 999)
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Set Page Background Image</title>
+<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+<script language='JavaScript' type='text/javascript'>
+window.resizeTo(350, 195);
+function Init() {
+	
+  __dlg_translate("BackgroundImage");
+  __dlg_init();
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+function insertbg(image) {
+	__dlg_close(window.opener.Xinha.getPluginDir('BackgroundImage') + "/backgrounds/" + image);
+	return false;
+}
+
+function onDelete() {
+  __dlg_close("*");
+  return false;
+}
+</script>
+</head>
+<body class="dialog" onload="Init()">
+<form action="" method="get">
+  <div class="title">Set Page Background Image</div>
+<table style="text-align: center;" border="0" cellspacing="0" cellpadding="6">
+<tr style="text-align: center; vertical-align: top;">
+<td><img onclick="insertbg('blufur.jpg')" border="1" src="../backgrounds/thumbnails/blufur.jpg" width="50" height="50"></td>
+<td><img onclick="insertbg('palecnvs.jpg')" border="1" src="../backgrounds/thumbnails/palecnvs.jpg" width="50" height="50"></td>
+<td><img onclick="insertbg('ppplcnvs.jpg')" border="1" src="../backgrounds/thumbnails/ppplcnvs.jpg" width="50" height="50"></td>
+<td><img onclick="insertbg('ylwsand.jpg')" border="1" src="../backgrounds/thumbnails/ylwsand.jpg" width="50" height="50"></td>
+</tr>
+</table>
+<div class="space"></div>
+<div id="buttons">
+<button type="button" name="delete" onclick="return onDelete()" style="width:auto">Remove Current Background</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/BackgroundImage/background-image.js
===================================================================
--- /branches/new-dialogs-merge/plugins/BackgroundImage/background-image.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/BackgroundImage/background-image.js (revision 856)
@@ -0,0 +1,52 @@
+// BackgroundImage plugin for Xinha
+// Sponsored by http://www.schaffrath-neuemedien.de
+// Implementation by Udo Schmal
+// based on TinyMCE (http://tinymce.moxiecode.com/) Distributed under LGPL by Moxiecode Systems AB
+//
+// Distributed under the same terms as Xinha itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function BackgroundImage(editor) {
+  this.editor = editor;
+	var cfg = editor.config;
+	var self = this;
+  cfg.registerButton({
+                id       : "bgImage",
+                tooltip  : this._lc("Set page background image"),
+                image    : editor.imgURL("ed_bgimage.gif", "BackgroundImage"),
+                textMode : false,
+                action   : function(editor) {
+                                self.buttonPress(editor);
+                           }
+            })
+	cfg.addToolbarElement("bgImage", "inserthorizontalrule", 1);
+}
+
+BackgroundImage._pluginInfo = {
+	name          : "BackgroundImage",
+	version       : "1.0",
+	developer     : "Udo Schmal",
+	developer_url : "http://www.schaffrath-neuemedien.de/",
+	c_owner       : "Udo Schmal & Schaffrath NeueMedien",
+	sponsor       : "L.N.Schaffrath NeueMedien",
+	sponsor_url   : "http://www.schaffrath-neuemedien.de.de/",
+	license       : "htmlArea"
+};
+
+BackgroundImage.prototype._lc = function(string) {
+    return Xinha._lc(string, 'BackgroundImage');
+};
+
+BackgroundImage.prototype.buttonPress = function(editor) {
+		//var doc = this.editor._doc;
+    editor._popupDialog( "plugin://BackgroundImage/bgimage", function( bgImage ) {
+        if(bgImage) {
+					if(Xinha.is_ie) editor.focusEditor();
+					if(bgImage=="*") {
+						editor._doc.body.background = "";
+					} else {
+					  editor._doc.body.background = bgImage;
+					}
+				}	
+    }, null);
+};
Index: /branches/new-dialogs-merge/plugins/SmartReplace/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SmartReplace/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/SmartReplace/lang/pt_br.js (revision 901)
@@ -0,0 +1,24 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+{
+  "Cancel": "Cancelar",
+  "Convert all quotes and dashes in the current document": "Converter todas as citações e hífens no documento atual",
+  "Enable automatic replacements": "Ativar substituições automáticas",
+  "OK": "OK",
+  "SmartReplace": "Substituição Rápida",
+  "SmartReplace Settings": "Configurações da Substituição Rápida"
+}
Index: /branches/new-dialogs-merge/plugins/SmartReplace/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SmartReplace/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/SmartReplace/lang/de.js (revision 677)
@@ -0,0 +1,19 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+{
+	"SmartReplace Settings" : "SmartReplace Einstellungen",
+	"Enable automatic replacements" : "Automatische Ersetzung aktivieren",
+	"Convert all quotes and dashes in the current document": "Alle AnfÃŒhrungszeichen und Gedankenstriche umwandeln",
+	
+	"OpeningDoubleQuotes": "â",
+	"ClosingDoubleQuotes": "â",
+	"OpeningSingleQuote": "â",
+	"ClosingSingleQuote": "â"
+	
+	/*
+	"OpeningDoubleQuotes": "Â»",
+	"ClosingDoubleQuotes": "Â«",
+	"OpeningSingleQuote": "âº",
+	"ClosingSingleQuote": "â¹"
+*/
+};
Index: /branches/new-dialogs-merge/plugins/SmartReplace/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SmartReplace/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/SmartReplace/lang/nl.js (revision 872)
@@ -0,0 +1,20 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+	"SmartReplace Settings" : "SmartReplace Instellingen",
+	"Enable automatic replacements" : "Automatisch vervangen inschakelen",
+	"Convert all quotes and dashes in the current document": "Converteer alle quotes en schuine strepen",
+	
+	"OpeningDoubleQuotes": "â",
+	"ClosingDoubleQuotes": "â",
+	"OpeningSingleQuote": "â",
+	"ClosingSingleQuote": "â"
+	
+	/*
+	"OpeningDoubleQuotes": "Â»",
+	"ClosingDoubleQuotes": "Â«",
+	"OpeningSingleQuote": "âº",
+	"ClosingSingleQuote": "â¹"
+*/
+};
Index: /branches/new-dialogs-merge/plugins/SmartReplace/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SmartReplace/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/SmartReplace/lang/ja.js (revision 715)
@@ -0,0 +1,20 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+	"SmartReplace Settings" : "SmartReplaceèš­å®",
+	"Enable automatic replacements" : "èªåçœ®æã®æå¹å",
+	"Convert all quotes and dashes in the current document": "ææžå
+ã®åŒçšç¬Šãšããã·ã¥ããã¹ãŠå€æ",
+	
+	"OpeningDoubleQuotes": "â",
+	"ClosingDoubleQuotes": "â",
+	"OpeningSingleQuote": "â",
+	"ClosingSingleQuote": "â"
+	
+	/*
+	"OpeningDoubleQuotes": "Â»",
+	"ClosingDoubleQuotes": "Â«",
+	"OpeningSingleQuote": "âº",
+	"ClosingSingleQuote": "â¹"
+*/
+};
Index: /branches/new-dialogs-merge/plugins/SmartReplace/dialog.html
===================================================================
--- /branches/new-dialogs-merge/plugins/SmartReplace/dialog.html (revision 752)
+++ /branches/new-dialogs-merge/plugins/SmartReplace/dialog.html (revision 752)
@@ -0,0 +1,17 @@
+<h1 id="[h1]"><l10n>SmartReplace Settings</l10n></h1>
+<div style="margin-left: 10px;">
+<table style="width: 100%;border:none">
+  <tr>
+    <td style="width:15px"><input type="checkbox" id="[enable]" name="[enable]"  /></td>
+    <td style="text-align:left"><l10n>Enable automatic replacements</l10n></td>
+  </tr>
+  <tr>
+    <td style="width:15px"><input type="checkbox" id="[convert]" name="[convert]" /></td>
+    <td style="text-align:left"><l10n>Convert all quotes and dashes in the current document</l10n></td>
+  </tr>
+</table>
+  <div style="margin-top: 10px;">
+    <input type="button" id="[ok]"     value="_(OK)"     />
+    <input type="button" id="[cancel]" value="_(Cancel)" />
+  </div>
+</div>
Index: /branches/new-dialogs-merge/plugins/SmartReplace/smart-replace.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SmartReplace/smart-replace.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/SmartReplace/smart-replace.js (revision 999)
@@ -0,0 +1,393 @@
+/*------------------------------------------*\
+ SmartReplace for Xinha
+ _______________________
+	 
+\*------------------------------------------*/
+
+function SmartReplace(editor) {
+	this.editor = editor;
+	
+	var cfg = editor.config;
+	var self = this;
+	
+	cfg.registerButton
+	({
+		id       : "smartreplace",
+		tooltip  : this._lc("SmartReplace"),
+		image    : Xinha.getPluginDir('SmartReplace')+"/img/smartquotes.gif",
+		textMode : false,
+		action   : function(e, objname, obj) { self.buttonPress(null, obj); }
+	});
+	cfg.addToolbarElement("smartreplace", "htmlmode", 1);
+}
+
+SmartReplace._pluginInfo = {
+  name          : "SmartReplace",
+  version       : "1.0",
+  developer     : "Raimund Meyer",
+  developer_url : "http://x-webservice.net",
+  c_owner       : "Raimund Meyer",
+  sponsor       : "",
+  sponsor_url   : "",
+  license       : "LGPL"
+};
+
+SmartReplace.prototype._lc = function(string) {
+	return Xinha._lc(string, 'SmartReplace');
+};
+
+Xinha.Config.prototype.SmartReplace =
+{
+	'defaultActive' : true,
+	'quotes' : null//[String.fromCharCode(187),String.fromCharCode(171),String.fromCharCode(8250),String.fromCharCode(8249)]
+}
+SmartReplace.prototype.toggleActivity = function(newState) 
+{
+	if (typeof newState != 'undefined')
+	{
+		this.active = newState;
+	}
+	else
+	{
+		this.active = this.active ? false : true;		
+	}
+	this.editor._toolbarObjects.smartreplace.state("active", this.active);
+}
+
+SmartReplace.prototype.onUpdateToolbar = function() {
+	this.editor._toolbarObjects.smartreplace.state("active", this.active);
+}
+
+SmartReplace.prototype.onGenerate = function() {
+	this.active = this.editor.config.SmartReplace.defaultActive;
+	this.editor._toolbarObjects.smartreplace.state("active", this.active);
+	
+	var self = this;
+	Xinha._addEvent(
+		self.editor._doc,
+		 "keypress",
+		function (event)
+		{
+		  return self.keyEvent(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event);
+		});
+	
+	var quotes = this.editor.config.SmartReplace.quotes;
+   
+	if (quotes && typeof quotes == 'object')
+	{
+		this.openingQuotes = quotes[0];
+		this.closingQuotes = quotes[1];
+		this.openingQuote  = quotes[2];
+		this.closingQuote  = quotes[3];
+	}
+	else
+	{
+		this.openingQuotes = this._lc("OpeningDoubleQuotes");
+		this.closingQuote  = this._lc("ClosingSingleQuote");
+		this.closingQuotes = this._lc("ClosingDoubleQuotes");
+		this.openingQuote  = this._lc("OpeningSingleQuote");
+	}
+	
+	if (this.openingQuotes == 'OpeningDoubleQuotes') //If nothing else is defined, English style as default
+	{
+		this.openingQuotes = String.fromCharCode(8220);
+		this.closingQuotes = String.fromCharCode(8221);
+		this.openingQuote = String.fromCharCode(8216);
+		this.closingQuote = String.fromCharCode(8217);
+	}
+};
+
+SmartReplace.prototype.keyEvent = function(ev)
+{ 
+	if ( !this.active) return true;
+	var editor = this.editor;
+	var charCode =  Xinha.is_ie ? ev.keyCode : ev.which;
+
+	var key = String.fromCharCode(charCode);
+
+	if ( key == '"' || key == "'")
+	{
+		Xinha._stopEvent(ev);
+		return this.smartQuotes(key);
+	}
+	if (charCode == 32) //space bar
+	{
+		return this.smartReplace(ev, 2, /^\s-/, ' â', false); // space-space -> dash 
+	}
+	if ( key == '.' ) // ... -> ellipsis
+	{
+		return this.smartReplace(ev, 2, /\.\./, 'âŠ', true);
+	}
+	return true;
+}
+
+SmartReplace.prototype.smartQuotes = function(kind)
+{
+	if (kind == "'")
+	{
+		var opening = this.openingQuote;
+		var closing = this.closingQuote;
+	}
+	else
+	{
+		var opening = this.openingQuotes;
+		var closing = this.closingQuotes;
+	}
+	
+	var editor = this.editor;
+		
+	var sel = editor.getSelection();
+
+	if (Xinha.is_ie)
+	{
+		var r = editor.createRange(sel);
+		if (r.text !== '')
+		{
+			r.text = '';
+		}
+		r.moveStart('character', -1);
+		
+		if(r.text.match(/\S/))
+		{
+			r.moveStart('character', +1);
+			r.text = closing;
+			
+		}
+		else
+		{
+			r.moveStart('character', +1);
+			r.text = opening;
+		}
+	}
+	else
+	{
+		var r = editor.createRange(sel);
+
+		if (!r.collapsed)
+		{
+			editor.insertNodeAtSelection(document.createTextNode(''));
+		}
+		if (r.startOffset > 0) r.setStart(r.startContainer, r.startOffset -1);
+
+		
+		if(r.toString().match(/[^\s\xA0]/))
+		{
+			r.collapse(false);
+			editor.insertNodeAtSelection(document.createTextNode(closing));
+		}
+		else
+		{
+			editor.insertNodeAtSelection(document.createTextNode(opening));				
+		}
+		editor.getSelection().collapseToEnd();
+	}
+	return false;
+}
+
+SmartReplace.prototype.smartReplace = function(ev, lookback, re, replace, stopEvent)
+{
+	var editor = this.editor;
+	var sel = this.editor.getSelection();
+	var r = this.editor.createRange(sel);
+	
+	if (Xinha.is_ie)
+	{
+		r.moveStart('character', -lookback);
+		
+		if(r.text.match(re))
+		{
+			r.text = replace;
+			if (stopEvent) 
+			{
+				Xinha._stopEvent(ev);
+				return false
+			}
+		}
+	}
+	else
+	{
+		if (r.startOffset > 1) r.setStart(r.startContainer, r.startOffset -lookback);
+
+		if(r.toString().match(re))
+		{
+			this.editor.insertNodeAtSelection(document.createTextNode(replace));
+			r.deleteContents();
+			r.collapse(true);
+		  if (stopEvent) 
+		  {
+				Xinha._stopEvent(ev);
+				return false
+		  }
+		}
+		editor.getSelection().collapseToEnd();
+	}
+	return true;
+}
+
+
+SmartReplace.prototype.replaceAll = function()
+{
+	var doubleQuotes = [
+							'&quot;',
+							String.fromCharCode(8220),
+							String.fromCharCode(8221),
+							String.fromCharCode(8222),
+							String.fromCharCode(187),
+							String.fromCharCode(171)
+							
+						];
+	var singleQuotes = [
+							"'",
+							String.fromCharCode(8216),
+							String.fromCharCode(8217),
+							String.fromCharCode(8218),
+							String.fromCharCode(8250),
+							String.fromCharCode(8249)
+						];
+	
+	var html = this.editor.getHTML();
+	var reOpeningDouble = new RegExp ('(\\s|^|>)('+doubleQuotes.join('|')+')(\\S)','g');
+	html = html.replace(reOpeningDouble,'$1'+this.openingQuotes+'$3');
+	
+	var reOpeningSingle = new RegExp ('(\\s|^|>)('+singleQuotes.join('|')+')(\\S)','g');
+	html = html.replace(reOpeningSingle,'$1'+this.openingQuote+'$3');
+	
+	var reClosingDouble = new RegExp ('(\\S)('+doubleQuotes.join('|')+')','g');
+	html = html.replace(reClosingDouble,'$1'+this.closingQuotes);
+	
+	var reClosingSingle = new RegExp ('(\\S)('+singleQuotes.join('|')+')','g');
+	html = html.replace(reClosingSingle,'$1'+this.closingQuote);
+	
+	var reDash    = new RegExp ('( |&nbsp;)(-)( |&nbsp;)','g');
+	html = html.replace(reDash,' '+String.fromCharCode(8211)+' ');
+	
+	this.editor.setHTML(html);
+}
+SmartReplace.prototype.dialog = function()
+{
+	var self = this;
+	var action = function (param)
+	{
+		self.toggleActivity(param.enable); 
+		if (param.convert)
+		{
+			self.replaceAll();
+		}
+	}
+	var init = this;
+	Dialog(Xinha.getPluginDir('SmartReplace')+'/popups/dialog.html', action, init);
+}
+
+
+SmartReplace.prototype.buttonPress = function(opts, obj)
+{
+	var self = this;
+
+	if ( this._dialog.dialog.rootElem.style.display != 'none')
+	{
+		return this._dialog.hide();
+	}
+	var doOK = function()
+	{
+		var opts = self._dialog.hide();
+		self.toggleActivity((opts.enable) ? true : false); 
+		if (opts.convert)
+		{
+			self.replaceAll();
+			self._dialog.dialog.getElementById("convert").checked = false;
+		}
+	}
+	var inputs = 
+	{
+		enable : self.active ? "on" : '',
+		convert: ''
+	};
+	this._dialog.show(inputs, doOK);
+};
+
+SmartReplace.prototype.onGenerateOnce = function()
+{
+  if( !this._dialog)
+  {
+	this._dialog = new SmartReplace.Dialog(this);
+  }
+};
+
+SmartReplace.Dialog = function (mainPluginObject)
+{
+  this.Dialog_nxtid = 0;
+  this.mainPluginObject = mainPluginObject;
+  this.id = { }; // This will be filled below with a replace, nifty
+
+  this.ready = false;
+  this.files  = false;
+  this.html   = false;
+  this.dialog = false;
+
+  this._prepareDialog();
+
+};
+
+SmartReplace.Dialog.prototype._prepareDialog = function()
+{
+  var pluginDialogObject = this;
+  var editor = this.mainPluginObject.editor;
+
+  if(this.html == false)
+  {
+	Xinha._getback(Xinha.getPluginDir('SmartReplace') + '/dialog.html', function(getback) { pluginDialogObject.html = getback; pluginDialogObject._prepareDialog(); });
+	return;
+  }
+  
+  // Now we have everything we need, so we can build the dialog.
+  this.dialog = new Xinha.Dialog(editor, this.html, 'SmartReplace');
+
+  this.ready = true;
+};
+
+SmartReplace.Dialog.prototype._lc = SmartReplace.prototype._lc;
+
+SmartReplace.Dialog.prototype.show = function(inputs, ok, cancel)
+{
+  if(!this.ready)
+  {
+	var pluginDialogObject = this;
+	window.setTimeout(function() {pluginDialogObject.show(inputs,ok,cancel);},100);
+	return;
+  }
+
+  // Connect the OK and Cancel buttons
+  var dialog = this.dialog;
+  var pluginDialogObject = this;
+  if(ok)
+  {
+	this.dialog.getElementById('ok').onclick = ok;
+  }
+  else
+  {
+	this.dialog.getElementById('ok').onclick = function() {pluginDialogObject.hide();};
+  }
+
+  if(cancel)
+  {
+	this.dialog.getElementById('cancel').onclick = cancel;
+  }
+  else
+  {
+	this.dialog.getElementById('cancel').onclick = function() { pluginDialogObject.hide()};
+  }
+
+  // Show the dialog
+  this.mainPluginObject.editor.disableToolbar(['fullscreen','smartreplace']);
+
+  this.dialog.show(inputs);
+
+  // Init the sizes
+  this.dialog.onresize();
+};
+
+SmartReplace.Dialog.prototype.hide = function()
+{
+  this.mainPluginObject.editor.enableToolbar();
+  return this.dialog.hide();
+};
Index: /branches/new-dialogs-merge/plugins/SmartReplace/readme.txt
===================================================================
--- /branches/new-dialogs-merge/plugins/SmartReplace/readme.txt (revision 990)
+++ /branches/new-dialogs-merge/plugins/SmartReplace/readme.txt (revision 990)
@@ -0,0 +1,15 @@
+One irritating thing with text processing is the total absence of some typographic essentials on the keyboard -- "real" (typographic) quotes and the dash, typically miss-typed as inch or second sign (") and the hyphon(-).
+
+This plugin lends the good old Word behaviour to Xinha, as ",', and - get converted to their respective typographic correct relatives while typing.
+It also replaces ... with the ellipsis sign (which is three dots combined in one glyph that is considered typographically better).
+
+ Configuration (to change the quote style from default English):
+  * through language file (see lang/de.js)
+  * through a config variable (an array that holds four values: opening single quote, closing single quote, opening double quote, closing double quote)
+  
+ Additional config option:
+  * disable automatic replacement by default
+  
+ Additional features:
+  * can be switched on/off
+  * convert all quotes/dashes in a document that still has the boring  "/- stuff
Index: /branches/new-dialogs-merge/plugins/InsertWords/insert-words.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertWords/insert-words.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertWords/insert-words.js (revision 677)
@@ -0,0 +1,70 @@
+// Plugin for htmlArea to insert keywords, when a type of
+// keyword is selected from a dropdown list
+// By Adam Wright, for The University of Western Australia
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function InsertWords(editor, params) {
+	this.editor = editor;
+	var cfg = editor.config;
+	var self = this;
+
+    if(params[0] && params[0].combos) {
+      //if arguments where passed with registerPlugin use these
+	  var combos = params[0].combos;
+    } else if (cfg.InsertWords && cfg.InsertWords.combos) {
+      //if combos is found in config use these
+      var combos = cfg.InsertWords.combos;
+    } else {
+      //no combos found
+      var combos = [];
+    }
+
+	// register the toolbar with the keywords dropdown
+    var first = true;
+    var toolbar = [];
+
+	for (var i = combos.length; --i >= 0;) {
+		var combo = combos[i];
+		var id = "IW-id" + i;
+		var iw_class = {
+			id	: id,
+			options	: combo.options,
+			action	: function (editor) { self.onSelect(editor, this, combo.context); },
+			refresh	: function (editor) { },
+			context : combo.context
+		};
+        cfg.registerDropdown(iw_class);
+
+        if (combo.label)
+            toolbar.push("T[" + combo.label + "]");
+        toolbar.push(id);
+        toolbar.push(first ? "separator" : "space");
+	}
+
+    cfg.addToolbarElement(toolbar, "linebreak", 1);
+
+}
+
+InsertWords._pluginInfo = {
+	name          : "InsertWords",
+	version       : "1.0",
+	developer     : "Adam Wright",
+	developer_url : "http://blog.hipikat.org/",
+	sponsor       : "The University of Western Australia",
+	sponsor_url   : "http://www.uwa.edu.au/",
+	license       : "htmlArea"
+};
+
+InsertWords.prototype.onSelect = function(editor, obj, context) {
+
+	// Get the toolbar object element
+	var elem = editor._toolbarObjects[obj.id].element;
+
+	// Insert the keyword value blindly at the selection
+	editor.insertHTML(elem.value);
+
+	// Reset the dropdown to it's label
+	elem.selectedIndex = 0;
+};
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/lang/pt_br.js (revision 901)
@@ -0,0 +1,37 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Alternate": "Alternativo",
+  "Background-Color:": "Côr de Fundo:",
+  "Behavior:": "Comportamento:",
+  "Cancel": "Cancelar",
+  "Continuous": "Contínuo",
+  "Direction:": "Direção:",
+  "Height:": "Altura:",
+  "Insert scrolling marquee": "Inserir faixa rolante",
+  "Left": "Esquerda",
+  "Marquee Editor": "Editor de Faixas",
+  "Name": "Nome",
+  "Name/ID:": "Nome/ID:",
+  "OK": "OK",
+  "Right": "Direita",
+  "Scroll Amount:": "Quantidade de Rolagem:",
+  "Scroll Delay:": "Atrazo de Rolagem:",
+  "Slide": "Corrediço",
+  "Speed Control": "Controle de Velocidade",
+  "Text:": "Texto:",
+  "Width:": "Largura:"
+}
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/lang/fr.js (revision 677)
@@ -0,0 +1,17 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Name/ID:": "Nom/ID",
+  "Insert scrolling marquee": "InsÃ©rer marquee dÃ©filant",
+  "Insert marquee": "InsÃ©rer marquee",
+  "Direction:": "Direction",
+  "Behavior:": "Comportement",
+  "Text:": "Texte",
+  "Background-Color:": "Couleur de fond",
+  "Width:": "Largeur",
+  "Height:": "Hauteur",
+  "Speed Control": "Controle de vitesse",
+  "Scroll Amount:": "QuantitÃ© de dÃ©filement",
+  "Scroll Delay:": "DÃ©lai du dÃ©filement",
+  "Cancel": "Annuler"
+};
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/lang/de.js (revision 677)
@@ -0,0 +1,15 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "Insert scrolling marquee": "Marquee einfÃŒgen",
+  "Insert marquee": "Marquee einfÃŒgen",
+  "Direction:": "Ausrichtung:",
+  "Behavior:": "Bewegung:",
+  "Text:": "Text:",
+  "Background-Color:": "Hintergrundfarbe:",
+  "Width:": "Breite:",
+  "Height:": "HÃ¶he:",
+  "Speed Control": "Geschwindigkeitseinstellungen",
+  "Cancel": "Abbrechen"
+};
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/lang/nl.js (revision 872)
@@ -0,0 +1,18 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{ 
+  "Name/ID:": "Naam/ID:",
+  "Insert scrolling marquee": "Scrollende tekst invoegen",
+  "Insert marquee": "Tekst invoegen",	
+  "Direction:": "Richting:",
+  "Behavior:": "Gedrag:",
+  "Text:": "Tekst:",
+  "Background-Color:": "Achtergrondkleur:",
+  "Width:": "Breedte:",
+  "Height:": "Hoogte:",
+  "Speed Control": "Snelheidscontrole",
+  "Scroll Amount:": "Snelheid:",
+  "Scroll Delay:": "Vertraging:",
+  "Cancel": "Annuleren"
+};
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/lang/ja.js (revision 715)
@@ -0,0 +1,28 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Marquee Editor": "ããŒã­ãŒãšãã£ã¿",
+  "Name/ID:": "åå/ID",
+  "Insert scrolling marquee": "ã¹ã¯ã­ãŒã«ããŒã­ãŒã®æ¿å
+¥",
+  "Insert marquee": "ããŒã­ãŒã®æ¿å
+¥",
+  "Direction:": "æ¹å:",
+  "Behavior:": "åäœ:",
+  "Text:": "ãã­ã¹ã:",
+  "Background-Color:": "èæ¯è²:",
+  "Width:": "å¹
+:",
+  "Height:": "é«ã:",
+  "Speed Control": "éåºŠèª¿æŽ",
+  "Scroll Amount:": "ã¹ã¯ã­ãŒã«é:",
+  "Scroll Delay:": "ã¹ã¯ã­ãŒã«é
+å»¶:",
+  "Cancel": "äž­æ­¢",
+  "Continuous": "å·Šå³é£ç¶",
+  "Slide": "ã¹ã©ã€ã",
+  "Alternate": "æãè¿ã",
+  "You must enter the form name": "ååã®å
+¥åãå¿
+èŠã§ã"
+};
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/lang/it.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/lang/it.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/lang/it.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+	"Insert scrolling marquee": "Inserisca marquee",
+	"Cancel": "Annullamento"
+};
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/lang/nb.js (revision 677)
@@ -0,0 +1,18 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{ 
+  "Name/ID:": "Navn/ID:",
+  "Insert scrolling marquee": "Sett inn rulletekst",
+  "Insert marquee": "Sett inn rulletekst",	
+  "Direction:": "Rettning:",
+  "Behavior:": "OppfÃžrsel:",
+  "Text:": "Tekst:",
+  "Background-Color:": "Bakgrunnsfarge:",
+  "Width:": "Bredde:",
+  "Height:": "HÃžyde:",
+  "Speed Control": "Egenskaper for hastigheten til rulleteksten",
+  "Scroll Amount:": "Hastighet:",
+  "Scroll Delay:": "Forsinkelse:",
+  "Cancel": "Avbryt"
+};
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/popups/insert_marquee.html
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/popups/insert_marquee.html (revision 858)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/popups/insert_marquee.html (revision 858)
@@ -0,0 +1,99 @@
+<html>
+<head>
+  <title>Marquee Editor</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+
+var fields = ["f_name", "f_text", "f_direction", "f_behavior", "f_bgcolor", "f_width", "f_height", "f_scrollamount", "f_scrolldelay"];
+
+function Init() {
+  window.resizeTo(350, 380);
+  __dlg_translate('InsertMarquee');
+	__dlg_init();
+  var param = window.dialogArguments;
+  for (var i in fields) {
+    document.getElementById(fields[i]).value = param[fields[i]];
+  }
+ 	document.getElementById("f_name").focus();
+}
+
+function onOK() {
+  var required = {
+    "f_name": "You must enter the form name"
+  };
+  for (var i in required) {
+	  var el = document.getElementById(i);
+	  if (!el.value) {
+		alert(HTMLArea._lc(required[i], 'InsertMarquee'));
+		el.focus();
+		return false;
+	  }
+  }
+  // pass data back to the calling window
+  var param = new Object();
+  for (var i in fields) {
+    param[fields[i]] = document.getElementById(fields[i]).value;
+  }
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+</script>
+<style type="text/css">
+.fr { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+</style>
+</head>
+<body class="dialog" onload="Init()">
+<div class="title">Marquee Editor</div>
+<form>
+  <div class="fr">Name/ID:</div>
+  <input type="text" name="name" id="f_name" size="20" title="Name" value="" />
+  <p />
+  <div class="fr">Direction:</div>
+  <select id="f_direction" name="direction">
+	  <option value="">Left</option>
+	  <option value="right">Right</option>
+  </select>
+  <p />
+  <div class="fr">Behavior:</div>
+  <select id="f_behavior" name="behavior">
+   	<option value="">Continuous</option>
+   	<option value="slide">Slide</option>
+   	<option value="alternate">Alternate</option>
+  </select>
+  <p />
+  <div class="fr">Text:</div>
+  <input type="text" id="f_text" name="text" value="" size="30" />
+  <p />
+  <div class="fr">Background-Color:</div>
+  <input type="text" id="f_bgcolor" name="bgcolor" value="" size="30" />
+  <p />
+  <div class="fr">Width:</div>
+  <input type="text" id="f_width" name="width" value="100" size="5" maxlength="4" />
+  <p />
+  <div class="fr">Height:</div>
+  <input type="text" id="f_height" name="height" value="100" size="5" maxlength="4" />
+  <p />
+  <fieldset>
+  <legend>Speed Control</legend>
+    <div class="fr">Scroll Amount:</div>
+    <input type="text" id="f_scrollamount" name="scrollamount" value="100" maxlength="4" />
+    <p />
+    <div class="fr">Scroll Delay:</div>
+    <input type="text" id="f_scrolldelay" name="scrolldelay" value="100" maxlength="4" />
+    <p />
+  </fieldset>  
+<div id="buttons">
+   <button type="submit" name="ok" onclick="return onOK();">OK</button>
+   <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/InsertMarquee/insert-marquee.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertMarquee/insert-marquee.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/InsertMarquee/insert-marquee.js (revision 856)
@@ -0,0 +1,107 @@
+// Marquee plugin for HTMLArea/Xinha
+// Implementation by Udo Schmal based on HTMLArea 3.0
+// Original Author - Udo Schmal, Schaffrath-NeueMedien
+//
+// (c) Udo Schmal.2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function InsertMarquee(editor) {
+	this.editor = editor;
+
+	var cfg = editor.config;
+	var self = this;
+
+	// register the toolbar buttons provided by this plugin
+	cfg.registerButton({
+	id       : "insertmarquee",
+	tooltip  : this._lc("Insert scrolling marquee"),
+	image    : editor.imgURL("ed_marquee.gif", "InsertMarquee"),
+	textMode : false,
+	action   : function(editor) {
+			self.buttonPress(editor);
+		}
+	})
+	cfg.addToolbarElement("insertmarquee", "inserthorizontalrule", -1);
+}
+
+InsertMarquee._pluginInfo = {
+	name          : "InsertMarquee",
+	version       : "1.0",
+	developer     : "Udo Schmal",
+	developer_url : "http://www.schaffrath-NeueMedien.de/",
+	c_owner       : "Udo Schmal & Schaffrath NeueMedien",
+	license       : "htmlArea"
+};
+
+InsertMarquee.prototype._lc = function(string) {
+    return Xinha._lc(string, "InsertMarquee");
+};
+
+InsertMarquee.prototype.buttonPress = function(editor, node) {
+  function setAttr(el, attr, value) {
+    if (value != "")
+      el.setAttribute(attr, value);
+    else
+      el.removeAttribute(attr);
+  }
+  var outparam = new Object();
+	if (typeof node == "undefined") {
+	  node = editor.getParentElement();
+	}
+  if ( node.tagName.toLowerCase() == "marquee") {
+    outparam.f_name         = node.name;
+		outparam.f_behavior     = node.behavior;
+		outparam.f_direction    = node.direction;
+		outparam.f_text         = node.innerHTML;
+		outparam.f_width	      = node.width;
+		outparam.f_height	      = node.height;
+		outparam.f_bgcolor      = node.bgColor;
+		outparam.f_scrollamount = node.scrollAmount;
+		outparam.f_scrolldelay  = node.scrollDelay;
+	} else {
+	outparam = {
+    f_name    : '',
+		f_behavior	: '',
+		f_direction	: '',
+		f_text		: '',
+		f_width		: '',
+		f_height	: '',
+		f_bgcolor	: '',
+		f_scrollamount	: '',
+		f_scrolldelay	: ''
+		};
+	}
+	editor._popupDialog( "plugin://InsertMarquee/insert_marquee", function( param )
+	{
+		if ( !param )
+		{ //user must have pressed Cancel
+			return false;
+		} else if ( node.tagName.toLowerCase() == "marquee") {
+        setAttr(node, "name", param["f_name"]);
+        setAttr(node, "id", param["f_name"]);
+				setAttr(node, "behavior",	param["f_behavior"]);
+				setAttr(node, "direction", param["f_direction"]);
+				setAttr(node, "width", param["f_width"]);
+				setAttr(node, "height", param["f_height"]);
+				setAttr(node, "bgColor", param["f_bgcolor"]);
+				setAttr(node, "scrollAmount", param["f_scrollamount"]);
+				setAttr(node, "scrollDelay", param["f_scrolldelay"]);
+        node.innerHTML = param["f_text"];
+		} else {
+			var text = '<marquee name="' + param["f_name"] + '" ' +
+          'id="' + param["f_name"] + '" ' + 
+          'behavior="' + param["f_behavior"] + '" ' +
+					'direction="' + param["f_direction"] + '" ' +
+					'width="' + param["f_width"] + '" ' +
+					'height="' + param["f_height"] + '" ' +
+					'bgcolor="' + param["f_bgcolor"] + '" ' +
+					'scrollamount="' + param["f_scrollamount"] + '" ' +
+					'scrolldelay="' + param["f_scrolldelay"] + '">\n';
+          alert(text);
+			text = text + param["f_text"];
+			text = text + '</marquee>';
+			editor.insertHTML( text );
+		}
+	}, outparam);
+};
Index: /branches/new-dialogs-merge/plugins/Linker/linker.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/linker.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/Linker/linker.js (revision 999)
@@ -0,0 +1,574 @@
+/** htmlArea - James' Fork - Linker Plugin **/
+Linker._pluginInfo =
+{
+  name     : "Linker",
+  version  : "1.0",
+  developer: "James Sleeman",
+  developer_url: "http://www.gogo.co.nz/",
+  c_owner      : "Gogo Internet Services",
+  license      : "htmlArea",
+  sponsor      : "Gogo Internet Services",
+  sponsor_url  : "http://www.gogo.co.nz/"
+};
+
+Xinha.loadStyle('dTree/dtree.css', 'Linker');
+
+Xinha.Config.prototype.Linker =
+{
+  'treeCaption' : document.location.host,
+  'backend' : Xinha.getPluginDir("Linker") + '/scan.php',
+  'backend_data' : null,
+  'files' : null
+};
+
+
+function Linker(editor, args)
+{
+  this.editor  = editor;
+  this.lConfig = editor.config.Linker;
+
+  var linker = this;
+  if(editor.config.btnList.createlink)
+  {
+    editor.config.btnList.createlink[3]
+      =  function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); };
+  }
+  else
+  {
+    editor.config.registerButton(
+                                 'createlink', 'Insert/Modify Hyperlink', [_editor_url + "images/ed_buttons_main.gif",6,1], false,
+                                 function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); }
+                                 );
+  }
+
+  // See if we can find 'createlink'
+ editor.config.addToolbarElement("createlink", "createlink", 0);
+}
+
+Linker.prototype._lc = function(string)
+{
+  return Xinha._lc(string, 'Linker');
+};
+
+Linker.prototype._createLink = function(a)
+{
+  if(!a && this.editor.selectionEmpty(this.editor.getSelection()))
+  {       
+    alert(this._lc("You must select some text before making a new link."));
+    return false;
+  }
+
+  var inputs =
+  {
+    type:     'url',
+    href:     'http://www.example.com/',
+    target:   '',
+    p_width:  '',
+    p_height: '',
+    p_options: ['menubar=no','toolbar=yes','location=no','status=no','scrollbars=yes','resizeable=yes'],
+    to:       'alice@example.com',
+    subject:  '',
+    body:     '',
+    anchor:   ''
+  };
+
+  if(a && a.tagName.toLowerCase() == 'a')
+  {
+    var href =this.editor.fixRelativeLinks(a.getAttribute('href'));
+    var m = href.match(/^mailto:(.*@[^?&]*)(\?(.*))?$/);
+    var anchor = href.match(/^#(.*)$/);
+
+    if(m)
+    {
+      // Mailto
+      inputs.type = 'mailto';
+      inputs.to = m[1];
+      if(m[3])
+      {
+        var args  = m[3].split('&');
+        for(var x = 0; x<args.length; x++)
+        {
+          var j = args[x].match(/(subject|body)=(.*)/);
+          if(j)
+          {
+            inputs[j[1]] = decodeURIComponent(j[2]);
+          }
+        }
+      }
+    }
+    else if (anchor)
+    {
+      //Anchor-Link
+      inputs.type = 'anchor';
+      inputs.anchor = anchor[1];
+      
+    }
+    else
+    {
+
+
+      if(a.getAttribute('onclick'))
+      {
+        var m = a.getAttribute('onclick').match(/window\.open\(\s*this\.href\s*,\s*'([a-z0-9_]*)'\s*,\s*'([a-z0-9_=,]*)'\s*\)/i);
+
+        // Popup Window
+        inputs.href   = href ? href : '';
+        inputs.target = 'popup';
+        inputs.p_name = m[1];
+        inputs.p_options = [ ];
+
+
+        var args = m[2].split(',');
+        for(var x = 0; x < args.length; x++)
+        {
+          var i = args[x].match(/(width|height)=([0-9]+)/);
+          if(i)
+          {
+            inputs['p_' + i[1]] = parseInt(i[2]);
+          }
+          else
+          {
+            inputs.p_options.push(args[x]);
+          }
+        }
+      }
+      else
+      {
+        // Normal
+        inputs.href   = href;
+        inputs.target = a.target;
+      }
+    }
+  }
+
+  var linker = this;
+
+  // If we are not editing a link, then we need to insert links now using execCommand
+  // because for some reason IE is losing the selection between now and when doOK is
+  // complete.  I guess because we are defocusing the iframe when we click stuff in the
+  // linker dialog.
+
+  this.a = a; // Why doesn't a get into the closure below, but if I set it as a property then it's fine?
+
+  var doOK = function()
+  {
+    //if(linker.a) alert(linker.a.tagName);
+    var a = linker.a;
+
+    var values = linker._dialog.hide();
+    var atr =
+    {
+      href: '',
+      target:'',
+      title:'',
+      onclick:''
+    };
+
+    if(values.type == 'url')
+    {
+     if(values.href)
+     {
+       atr.href = values.href;
+       atr.target = values.target;
+       if(values.target == 'popup')
+       {
+
+         if(values.p_width)
+         {
+           values.p_options.push('width=' + values.p_width);
+         }
+         if(values.p_height)
+         {
+           values.p_options.push('height=' + values.p_height);
+         }
+         atr.onclick = 'if(window.top && window.top.Xinha){return false}window.open(this.href, \'' + (values.p_name.replace(/[^a-z0-9_]/i, '_')) + '\', \'' + values.p_options.join(',') + '\');return false;';
+       }
+     }
+    }
+    else if(values.type == 'anchor')
+    {
+      if(values.anchor)
+      {
+        atr.href = values.anchor.value;
+      }
+    }
+    else
+    {
+      if(values.to)
+      {
+        atr.href = 'mailto:' + values.to;
+        if(values.subject) atr.href += '?subject=' + encodeURIComponent(values.subject);
+        if(values.body)    atr.href += (values.subject ? '&' : '?') + 'body=' + encodeURIComponent(values.body);
+      }
+    }
+
+    if(a && a.tagName.toLowerCase() == 'a')
+    {
+      if(!atr.href)
+      {
+        if(confirm(linker._dialog._lc('Are you sure you wish to remove this link?')))
+        {
+          var p = a.parentNode;
+          while(a.hasChildNodes())
+          {
+            p.insertBefore(a.removeChild(a.childNodes[0]), a);
+          }
+          p.removeChild(a);
+          linker.editor.updateToolbar();
+          return;
+        }
+      }
+      else
+      {
+        // Update the link
+        for(var i in atr)
+        {
+          a.setAttribute(i, atr[i]);
+        }
+        
+        // If we change a mailto link in IE for some hitherto unknown
+        // reason it sets the innerHTML of the link to be the 
+        // href of the link.  Stupid IE.
+        if(Xinha.is_ie)
+        {
+          if(/mailto:([^?<>]*)(\?[^<]*)?$/i.test(a.innerHTML))
+          {
+            a.innerHTML = RegExp.$1;
+          }
+        }
+      }
+    }
+    else
+    {
+      if(!atr.href) return true;
+
+      // Insert a link, we let the browser do this, we figure it knows best
+      var tmp = Xinha.uniq('http://www.example.com/Link');
+      linker.editor._doc.execCommand('createlink', false, tmp);
+
+      // Fix them up
+      var anchors = linker.editor._doc.getElementsByTagName('a');
+      for(var i = 0; i < anchors.length; i++)
+      {
+        var anchor = anchors[i];
+        if(anchor.href == tmp)
+        {
+          // Found one.
+          if (!a) a = anchor;
+          for(var j in atr)
+          {
+            anchor.setAttribute(j, atr[j]);
+          }
+        }
+      }
+    }
+    linker.editor.selectNodeContents(a);
+    linker.editor.updateToolbar();
+  };
+
+  this._dialog.show(inputs, doOK);
+
+};
+
+Linker.prototype._getSelectedAnchor = function()
+{
+  var sel  = this.editor.getSelection();
+  var rng  = this.editor.createRange(sel);
+  var a    = this.editor.activeElement(sel);
+  if(a != null && a.tagName.toLowerCase() == 'a')
+  {
+    return a;
+  }
+  else
+  {
+    a = this.editor._getFirstAncestor(sel, 'a');
+    if(a != null)
+    {
+      return a;
+    }
+  }
+  return null;
+};
+
+Linker.prototype.onGenerateOnce = function()
+{
+  this._dialog = new Linker.Dialog(this);
+};
+// Inline Dialog for Linker
+
+Linker.Dialog_dTrees = [ ];
+
+
+Linker.Dialog = function (linker)
+{
+  var  lDialog = this;
+  this.Dialog_nxtid = 0;
+  this.linker = linker;
+  this.id = { }; // This will be filled below with a replace, nifty
+
+  this.ready = false;
+  this.files  = false;
+  this.html   = false;
+  this.dialog = false;
+
+  // load the dTree script
+  this._prepareDialog();
+
+};
+
+Linker.Dialog.prototype._prepareDialog = function()
+{
+  var lDialog = this;
+  var linker = this.linker;
+
+  // We load some stuff up int he background, recalling this function
+  // when they have loaded.  This is to keep the editor responsive while
+  // we prepare the dialog.
+  if(typeof dTree == 'undefined')
+  {
+    Xinha._loadback(Xinha.getPluginDir("Linker") + '/dTree/dtree.js',
+                       function() {lDialog._prepareDialog(); }
+                      );
+    return;
+  }
+
+  if(this.files === false)
+  {
+    if(linker.lConfig.backend)
+    {
+      //get files from backend
+      Xinha._postback(linker.lConfig.backend,
+                      linker.lConfig.backend_data, 
+                          function(txt) {
+                            try {
+                                lDialog.files = eval(txt);
+                            } catch(Error) {
+                                lDialog.files = [ {url:'',title:Error.toString()} ];
+                            }
+                            lDialog._prepareDialog(); });
+    }
+    else if(linker.lConfig.files != null)
+    {
+        //get files from plugin-config
+        lDialog.files = linker.lConfig.files;
+        lDialog._prepareDialog();
+    }
+    return;
+  }
+  var files = this.files;
+
+  if(this.html == false)
+  {
+    Xinha._getback(Xinha.getPluginDir("Linker") + '/dialog.html', function(txt) { lDialog.html = txt; lDialog._prepareDialog(); });
+    return;
+  }
+  var html = this.html;
+
+  // Now we have everything we need, so we can build the dialog.
+  var dialog = this.dialog = new Xinha.Dialog(linker.editor, this.html, 'Linker');
+  var dTreeName = Xinha.uniq('dTree_');
+
+  this.dTree = new dTree(dTreeName, Xinha.getPluginDir("Linker") + '/dTree/');
+  eval(dTreeName + ' = this.dTree');
+
+  this.dTree.add(this.Dialog_nxtid++, -1, linker.lConfig.treeCaption , null, linker.lConfig.treeCaption);
+  this.makeNodes(files, 0);
+
+  // Put it in
+  var ddTree = this.dialog.getElementById('dTree');
+  //ddTree.innerHTML = this.dTree.toString();
+  ddTree.innerHTML = '';
+  ddTree.style.position = 'absolute';
+  ddTree.style.left = 1 + 'px';
+  ddTree.style.top =  0 + 'px';
+  ddTree.style.overflow = 'auto';
+  ddTree.style.backgroundColor = 'white';
+  this.ddTree = ddTree;
+  this.dTree._linker_premade = this.dTree.toString();
+
+  var options = this.dialog.getElementById('options');
+  options.style.position = 'absolute';
+  options.style.top      = 0   + 'px';
+  options.style.right    = 0   + 'px';
+  options.style.width    = 320 + 'px';
+  options.style.overflow = 'auto';
+
+  // Hookup the resizer
+  this.dialog.onresize = function()
+    {
+      var h = parseInt(dialog.height) - dialog.getElementById('h1').offsetHeight;
+      var w = parseInt(dialog.width)  - 322 ;
+      // An error is thrown with IE when trying to set a negative width or a negative height
+      // But perhaps a width / height of 0 is not the minimum required we need to set
+      if (w<0) w = 0;
+      if (h<0) h = 0;
+      options.style.height = ddTree.style.height = h + 'px';
+      ddTree.style.width  = w + 'px';
+    }
+
+  this.ready = true;
+};
+
+Linker.Dialog.prototype.makeNodes = function(files, parent)
+{
+  for(var i = 0; i < files.length; i++)
+  {
+    if(typeof files[i] == 'string')
+    {
+      this.dTree.add(Linker.nxtid++, parent,
+                     files[i].replace(/^.*\//, ''),
+                     'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);',
+                     files[i]);
+    }
+    else if(typeof files[i]=="object" && files[i] && typeof files[i].length==="number") // there seems to be a strange bug in IE that requires this complicated check, see #1197
+    {
+      var id = this.Dialog_nxtid++;
+      this.dTree.add(id, parent, files[i][0].replace(/^.*\//, ''), null, files[i][0]);
+      this.makeNodes(files[i][1], id);
+    }
+    else if(typeof files[i] == 'object')
+    {
+      if(files[i].children) {
+        var id = this.Dialog_nxtid++;
+      } else {
+        var id = Linker.nxtid++;
+      }
+
+      if(files[i].title) var title = files[i].title;
+      else if(files[i].url) var title = files[i].url.replace(/^.*\//, '');
+      else var title = "no title defined";
+      if(files[i].url) var link = 'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i].url) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);';
+      else var link = '';
+      
+      this.dTree.add(id, parent, title, link, title);
+      if(files[i].children) {
+        this.makeNodes(files[i].children, id);
+      }
+    }
+  }
+};
+
+Linker.Dialog.prototype._lc = Linker.prototype._lc;
+
+Linker.Dialog.prototype.show = function(inputs, ok, cancel)
+{
+  if(!this.ready)
+  {
+    var lDialog = this;
+    window.setTimeout(function() {lDialog.show(inputs,ok,cancel);},100);
+    return;
+  }
+
+  if(this.ddTree.innerHTML == '')
+  {
+    this.ddTree.innerHTML = this.dTree._linker_premade;
+  }
+
+  if(inputs.type=='url')
+  {
+    this.dialog.getElementById('urltable').style.display = '';
+    this.dialog.getElementById('mailtable').style.display = 'none';
+    this.dialog.getElementById('anchortable').style.display = 'none';
+  }
+  else if(inputs.type=='anchor')
+  {
+    this.dialog.getElementById('urltable').style.display = 'none';
+    this.dialog.getElementById('mailtable').style.display = 'none';
+    this.dialog.getElementById('anchortable').style.display = '';
+  }
+  else
+  {
+    this.dialog.getElementById('urltable').style.display = 'none';
+    this.dialog.getElementById('mailtable').style.display = '';
+    this.dialog.getElementById('anchortable').style.display = 'none';
+  }
+
+  if(inputs.target=='popup')
+  {
+    this.dialog.getElementById('popuptable').style.display = '';
+  }
+  else
+  {
+    this.dialog.getElementById('popuptable').style.display = 'none';
+  }
+  
+  var anchor = this.dialog.getElementById('anchor');
+  for(var i=anchor.length;i>=0;i--) {
+    anchor[i] = null;
+  }
+
+  var html = this.linker.editor.getHTML();  
+  var anchors = new Array();
+
+  var m = html.match(/<a[^>]+name="([^"]+)"/gi);
+  if(m)
+  {
+    for(i=0;i<m.length;i++)
+    {
+        var n = m[i].match(/name="([^"]+)"/i);
+        if(!anchors.contains(n[1])) anchors.push(n[1]);
+    }
+  }
+  m = html.match(/id="([^"]+)"/gi);
+  if(m)
+  {
+    for(i=0;i<m.length;i++)
+    {
+        n = m[i].match(/id="([^"]+)"/i);
+        if(!anchors.contains(n[1])) anchors.push(n[1]);
+    }
+  }
+  
+  for(i=0;i<anchors.length;i++)
+  {
+    var opt = new Option(anchors[i],'#'+anchors[i],false,(inputs.anchor == anchors[i]));
+    anchor[anchor.length] = opt;
+  }
+
+  //if no anchors found completely hide Anchor-Link
+  if(anchor.length==0) {
+    this.dialog.getElementById('anchorfieldset').style.display = "none";
+  }
+  
+  // if we're not editing an existing link, hide the remove link button
+  if (inputs.href == 'http://www.example.com/' && inputs.to == 'alice@example.com') { 
+    this.dialog.getElementById('clear').style.display = "none";
+  }
+  else {
+    this.dialog.getElementById('clear').style.display = "";
+  }
+  // Connect the OK and Cancel buttons
+  var dialog = this.dialog;
+  var lDialog = this;
+  if(ok)
+  {
+    this.dialog.getElementById('ok').onclick = ok;
+  }
+  else
+  {
+    this.dialog.getElementById('ok').onclick = function() {lDialog.hide();};
+  }
+
+  if(cancel)
+  {
+    this.dialog.getElementById('cancel').onclick = cancel;
+  }
+  else
+  {
+    this.dialog.getElementById('cancel').onclick = function() { lDialog.hide()};
+  }
+
+  // Show the dialog
+  this.linker.editor.disableToolbar(['fullscreen','linker']);
+
+  this.dialog.show(inputs);
+
+  // Init the sizes
+  this.dialog.onresize();
+};
+
+Linker.Dialog.prototype.hide = function()
+{
+  this.linker.editor.enableToolbar();
+  return this.dialog.hide();
+};
Index: /branches/new-dialogs-merge/plugins/Linker/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/Linker/lang/pt_br.js (revision 901)
@@ -0,0 +1,43 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt
+{
+  "Anchor-Link": "Link-Âncora",
+  "Anchor:": "Âncora:",
+  "Are you sure you wish to remove this link?": "Você tem certeza que deseja remover este link?",
+  "Cancel": "Cancelar",
+  "Email Address:": "Endereço de E-mail:",
+  "Email Link": "Link de E-mail",
+  "Insert/Modify Link": "Inserir/Modificar Link",
+  "Location Bar:": "Barra de Localização:",
+  "Menu Bar:": "Barra de Menu:",
+  "Message Template:": "Modelo de Mensagem:",
+  "Name:": "Nome:",
+  "New Window": "Nova Janela",
+  "OK": "OK",
+  "Ordinary Link": "Link Comum",
+  "Popup Window": "Janela Pop-up",
+  "Remove Link": "Remover Link",
+  "Resizeable:": "Redimensionável",
+  "Same Window (jump out of frames)": "Mesma Janela (Sair fora dos frames)",
+  "Scrollbars:": "Barra de Rolagem:",
+  "Size:": "Tamanho:",
+  "Status Bar:": "Barra de Informações:",
+  "Subject:": "Assunto:",
+  "Target:": "Destino:",
+  "Toolbar:": "Barra de Ferramentas:",
+  "URL Link": "URL do Link",
+  "You must select some text before making a new link.": "Você precisa selecionar algum texto antes de criar um novo link."
+}
Index: /branches/new-dialogs-merge/plugins/Linker/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/lang/fr.js (revision 728)
+++ /branches/new-dialogs-merge/plugins/Linker/lang/fr.js (revision 728)
@@ -0,0 +1,18 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "You must select some text before making a new link.": "Vous devez sÃ©lectionner un texte avant de crÃ©er un nouveau lien",
+  "Are you sure you wish to remove this link?": "Confirmez-vous la suppression de ce lien ?",
+  "Remove Link": "Supprimer",
+  "URL Link": "Lien URL",
+  "Ordinary Link": "Lien standard",
+  "Same Window (jump out of frames)": "MÃªme fenÃªtre (sort des frames)",
+  "New Window": "Nouvelle fenÃªtre",
+  "Popup Window": "FenÃªtre popup",
+  "Email Link": "Lien email",
+  "Email Address:": "Adresse email",
+  "Subject:": "Sujet",
+  "Message Template:": "Message",
+  "Size:": "Taille",
+  "Name:": "Nom"
+};
Index: /branches/new-dialogs-merge/plugins/Linker/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/lang/de.js (revision 728)
+++ /branches/new-dialogs-merge/plugins/Linker/lang/de.js (revision 728)
@@ -0,0 +1,19 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "You must select some text before making a new link.": "Sie mÃŒssen einen Text markieren um einen Link zu erstellen",
+  "Are you sure you wish to remove this link?": "Wollen Sie diesen Link wirklich entfernen?",
+  "Remove Link": "Link entfernen",
+  "URL Link": "URL Adresse",
+  "Ordinary Link": "Standard Link",
+  "Same Window (jump out of frames)": "Selbes Fenster (ganzer Bereich)",
+  "New Window": "Neues Fenster",
+  "Popup Window": "Pop-Up Fenster",
+  "Email Link": "Email Link",
+  "Email Address:": "Email Adresse",
+  "Subject:": "Betreff:",
+  "Message Template:": "Nachrichten Vorlage:",
+  "Size:": "GrÃ¶Ãe:",
+  "Name:": "Name:"
+};
Index: /branches/new-dialogs-merge/plugins/Linker/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/Linker/lang/nl.js (revision 872)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "You must select some text before making a new link.": "Selecteer de tekst welke gelinkt moet worden.",
+  "Are you sure you wish to remove this link?": "Wilt u deze link werkelijk verwijderen?"
+};
Index: /branches/new-dialogs-merge/plugins/Linker/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/lang/ja.js (revision 729)
+++ /branches/new-dialogs-merge/plugins/Linker/lang/ja.js (revision 729)
@@ -0,0 +1,25 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "You must select some text before making a new link.": "ãªã³ã¯ãäœæããã«ã¯ãã­ã¹ããéžæããå¿
+èŠããããŸã",
+  "Are you sure you wish to remove this link?": "æ¬åœã«ãã®ãªã³ã¯ãåé€ããŸãã?",
+  "Remove Link": "ãªã³ã¯åé€",
+  "URL Link": "URLãªã³ã¯",
+  "Ordinary Link": "æšæºãªã³ã¯",
+  "Same Window (jump out of frames)": "åäžãŠã£ã³ããŠ (ãã¬ãŒã æäžäœ)",
+  "New Window": "æ°ãããŠã£ã³ããŠ",
+  "Popup Window": "ãããã¢ãããŠã£ã³ããŠ",
+  "Email Link": "Eã¡ãŒã«ãªã³ã¯",
+  "Email Address:": "ã¢ãã¬ã¹:",
+  "Subject:": "ä»¶å:",
+  "Message Template:": "æ¬æéåœ¢:",
+  "Size:": "ãµã€ãº:",
+  "Name:": "åå:",
+  "Menu Bar:": "ã¡ãã¥ãŒ",
+  "Toolbar:": "ããŒã«ããŒ",
+  "Location Bar:": "ã¢ãã¬ã¹ããŒ",
+  "Status Bar:": "ã¹ããŒã¿ã¹ããŒ",
+  "Scrollbars:": "ã¹ã¯ã­ãŒã«",
+  "Resizeable:": "ãªãµã€ãº"
+};
Index: /branches/new-dialogs-merge/plugins/Linker/lang/pl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/lang/pl.js (revision 728)
+++ /branches/new-dialogs-merge/plugins/Linker/lang/pl.js (revision 728)
@@ -0,0 +1,20 @@
+// I18N constants
+// LANG: "pl", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl
+{
+  "You must select some text before making a new link.": "Zaznacz tekst przed dodaniem odnoÅnika.",
+  "Are you sure you wish to remove this link?": "Na pewno chcesz usunÄ
+Ä odnoÅnik?",
+  "Remove Link": "USUÅ ODNOÅNIK",
+  "URL Link": "Adres URL",
+  "Ordinary Link": "ZwykÅy odnoÅnik",
+  "Same Window (jump out of frames)": "To samo okno (wyskocz z ramek)",
+  "New Window": "Nowe okno",
+  "Popup Window": "Okienko pop-up",
+  "Email Link": "Link do e-maila",
+  "Email Address:": "Adres e-mail",
+  "Subject:": "Temat:",
+  "Message Template:": "Szablon wiadmoÅci:",
+  "Size:": "Rozmiar:",
+  "Name:": "Nazwa:"
+};
Index: /branches/new-dialogs-merge/plugins/Linker/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Linker/lang/nb.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "You must select some text before making a new link.": "Du mÃ¥ markere tekst eller et bilde fÃžr du kan lage en lenke.",
+  "Are you sure you wish to remove this link?": "Er du sikker pÃ¥ at du vil fjerne lenken?"
+};
Index: /branches/new-dialogs-merge/plugins/Linker/dialog.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/dialog.html (revision 987)
+++ /branches/new-dialogs-merge/plugins/Linker/dialog.html (revision 987)
@@ -0,0 +1,107 @@
+<h1 id="[h1]"><l10n>Insert/Modify Link</l10n></h1>
+<div style="position:relative">
+<div id="[dTree]">(the dTree goes in here)</div>
+<div id="[options]" >
+  <fieldset>
+    <legend><label><input type="radio" name="[type]" value="url" checked="checked" onclick="
+      document.getElementById('[urltable]').style.display=this.checked?'':'none';
+      document.getElementById('[mailtable]').style.display=this.checked?'none':'';
+      document.getElementById('[anchortable]').style.display=this.checked?'none':'';
+    " /> <l10n>URL Link</l10n></label></legend>
+    <table id="[urltable]" width="100%">
+      <tr>
+        <th><label for="[href]"><l10n>URL:</l10n> </label></th>
+        <td><input type="text" name="[href]" style="width:100%" value="http://www.example.com/" onfocus="if (this.value == 'http://www.example.com/') this.value = '';" /></td>
+      </tr>
+      <tr style="vertical-align: top;">
+        <th><l10n>Target:</l10n></th>
+        <td>
+          <div><label><input type="radio" name="[target]" value="" onclick="document.getElementById('[popuptable]').style.display='none';"  checked="checked" /> <l10n>Ordinary Link</l10n></label></div>
+          <div><label><input type="radio" name="[target]" value="_top" onclick="document.getElementById('[popuptable]').style.display='none';"   /> <l10n>Same Window (jump out of frames)</l10n></label></div>
+          <div><label><input type="radio" name="[target]" value="_blank" onclick="document.getElementById('[popuptable]').style.display='none';"/> <l10n>New Window</l10n> </label></div>
+          <div>
+            <label><input type="radio" name="[target]" value="popup"    onclick="document.getElementById('[popuptable]').style.display='';" /> <l10n>Popup Window</l10n> </label>
+             <div style="padding-left:10px">
+              <table id="[popuptable]">
+                <tr>
+                  <th style="text-align: left;"><l10n>Size:</l10n></th>
+                  <td colspan="3"><input type="text" name="[p_width]" size="4" />x<input type="text" name="[p_height]" size="4" /> <l10n>(px)</l10n></td>
+                </tr>
+                <tr>
+                  <th style="text-align: left;"><l10n>Name:</l10n></th>
+                  <td colspan="3"><input type="text" name="[p_name]" style="width:100%" value="_(PopupWindow)" /></td>
+                </tr>
+                <tr>
+                  <th style="text-align: left;"><l10n>Menu Bar:</l10n></th>
+                  <td><input type="checkbox" name="[p_options]" value="menubar=yes" /></td>
+
+                  <th style="text-align: left;"><l10n>Toolbar:</l10n></th>
+                  <td><input type="checkbox" name="[p_options]" value="toolbar=yes" checked="checked" /></td>
+                </tr>
+                <tr>
+                  <th style="text-align: left;"><l10n>Location Bar:</l10n></th>
+                  <td><input type="checkbox" name="[p_options]" value="location=yes" /></td>
+
+                  <th style="text-align: left;"><l10n>Status Bar:</l10n></th>
+                  <td><input type="checkbox" name="[p_options]" value="status=yes"   /></td>
+                </tr>
+                <tr>
+                  <th style="text-align: left;"><l10n>Scrollbars:</l10n></th>
+                  <td><input type="checkbox" name="[p_options]" value="scrollbars=yes" checked="checked" /></td>
+
+                  <th style="text-align: left;"><l10n>Resizeable:</l10n></th>
+                  <td><input type="checkbox" name="[p_options]" value="resizeable=yes" checked="checked" /></td>
+                </tr>
+              </table>
+            </div>
+          </div>
+        </td>
+      </tr>
+    </table>
+  </fieldset>
+  <fieldset>
+    <legend><label><input type="radio" name="[type]" value="mailto" onclick="
+      document.getElementById('[mailtable]').style.display=this.checked?'':'none';
+      document.getElementById('[urltable]').style.display=this.checked?'none':'';
+      document.getElementById('[anchortable]').style.display=this.checked?'none':'';
+    "/> <l10n>Email Link</l10n></label></legend>
+    <table id="[mailtable]" width="100%">
+      <tr>
+        <th><label for="[to]"><l10n>Email Address:</l10n> </label></th>
+        <td><input type="text" name="[to]" style="width:100%" value="alice@example.com" onfocus="if (this.value == 'alice@example.com') this.value = '';" /></td>
+      </tr>
+      <tr>
+        <th><label for="[subject]"><l10n>Subject:</l10n> </label></th>
+        <td><input type="text" name="[subject]" style="width:100%" value="" /></td>
+      </tr>
+      <tr>
+        <th><label for="[body]"><l10n>Message Template:</l10n> </label></th>
+        <td><textarea name="[body]" style="width:100%" rows="5"></textarea></td>
+      </tr>
+    </table>
+  </fieldset>
+
+  <fieldset id="[anchorfieldset]">
+    <legend><label><input type="radio" name="[type]" value="anchor" onclick="
+      document.getElementById('[urltable]').style.display=this.checked?'none':'';
+      document.getElementById('[mailtable]').style.display=this.checked?'none':'';
+      document.getElementById('[anchortable]').style.display=this.checked?'':'none';
+    "/> <l10n>Anchor-Link</l10n></label></legend>
+    <table id="[anchortable]" width="100%">
+      <tr>
+        <th><label for="[anchor]"><l10n>Anchor:</l10n> </label></th>
+        <td>
+            <select name="[anchor]" id="[anchor]">
+            </select>
+        </td>
+      </tr>
+    </table>
+  </fieldset>
+
+  <div style="text-align:right">
+    <input type="button" id="[ok]"     value="_(OK)"     />
+    <input type="button" id="[clear]"  value="_(Remove Link)" onclick="this.form['[href]'].value='';this.form['[to]'].value='';document.getElementById('[ok]').click();" />
+    <input type="button" id="[cancel]" value="_(Cancel)" />
+  </div>
+</div>
+</div>
Index: /branches/new-dialogs-merge/plugins/Linker/dTree/example01.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/dTree/example01.html (revision 20)
+++ /branches/new-dialogs-merge/plugins/Linker/dTree/example01.html (revision 20)
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html>
+
+<head>
+	<title>Destroydrop &raquo; Javascripts &raquo; Tree</title>
+
+	<link rel="StyleSheet" href="dtree.css" type="text/css" />
+	<script type="text/javascript" src="dtree.js"></script>
+
+</head>
+
+<body>
+
+<h1><a href="/">Destroydrop</a> &raquo; <a href="/javascripts/">Javascripts</a> &raquo; <a href="/javascripts/tree/">Tree</a></h1>
+
+<h2>Example</h2>
+
+<div class="dtree">
+
+	<p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>
+
+	<script type="text/javascript">
+		<!--
+
+		d = new dTree('d');
+
+		d.add(0,-1,'My example tree');
+		d.add(1,0,'Node 1','example01.html');
+		d.add(2,0,'Node 2','example01.html');
+		d.add(3,1,'Node 1.1','example01.html');
+		d.add(4,0,'Node 3','example01.html');
+		d.add(5,3,'Node 1.1.1','example01.html');
+		d.add(6,5,'Node 1.1.1.1','example01.html');
+		d.add(7,0,'Node 4','example01.html');
+		d.add(8,1,'Node 1.2','example01.html');
+		d.add(9,0,'My Pictures','example01.html','Pictures I\'ve taken over the years','','','img/imgfolder.gif');
+		d.add(10,9,'The trip to Iceland','example01.html','Pictures of Gullfoss and Geysir');
+		d.add(11,9,'Mom\'s birthday','example01.html');
+		d.add(12,0,'Recycle Bin','example01.html','','','img/trash.gif');
+
+		document.write(d);
+
+		//-->
+	</script>
+
+</div>
+
+<p><a href="mailto&#58;drop&#64;destroydrop&#46;com">&copy;2002-2003 Geir Landr&ouml;</a></p>
+
+</body>
+
+</html>
Index: /branches/new-dialogs-merge/plugins/Linker/dTree/dtree.css
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/dTree/dtree.css (revision 582)
+++ /branches/new-dialogs-merge/plugins/Linker/dTree/dtree.css (revision 582)
@@ -0,0 +1,39 @@
+/*--------------------------------------------------|
+| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
+|---------------------------------------------------|
+| Copyright (c) 2002-2003 Geir Landr?               |
+|--------------------------------------------------*/
+
+.dtree {
+  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  color: #666;
+  white-space: nowrap;
+}
+.dtree img {
+  border: 0px;
+  vertical-align: middle;
+}
+.dtree a,.dtree a:visited {
+  color: #333;
+  text-decoration: none;
+}
+.dtree a.node, .dtree a.nodeSel {
+  white-space: nowrap;
+  padding: 1px 2px 1px 2px;
+  /*padding: 0px 1px 0px 1px;*/
+}
+.dtree a.node:hover, .dtree a.nodeSel:hover {
+  color: #333;
+  text-decoration: underline;
+}
+.dtree a.nodeSel {
+  background-color: #c0d2ec;
+  /*
+  -moz-border-radius : 4px;
+  border:1px dotted #333;
+  */
+}
+.dtree .clip {
+  overflow: hidden;
+}
Index: /branches/new-dialogs-merge/plugins/Linker/dTree/api.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/dTree/api.html (revision 20)
+++ /branches/new-dialogs-merge/plugins/Linker/dTree/api.html (revision 20)
@@ -0,0 +1,252 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html>
+
+<head>
+	<title>Destroydrop &raquo; Javascripts &raquo; Tree &raquo; Api</title>
+
+	<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
+	<link rel="stylesheet" href="/dd.css" type="text/css" />
+	<link rel="shortcut icon" href="/favicon.ico" />
+</head>
+
+<body>
+
+<div id="shadow">
+
+	<div id="content">
+
+		<div id="location">
+			<h1><a href="/">Destroydrop</a> &raquo; <a href="/javascripts/">Javascripts</a> &raquo; <a href="/javascripts/tree/">Tree</a> &raquo; <a href="/javascripts/tree/api/">Api</a></h1>
+		</div>
+
+
+		<div class="line"></div>
+
+		<div id="files">
+
+
+<h3>Overview</h3>
+<div class="line"></div>
+<div class="item">
+
+	<ul class="arrow">
+		<li><a href="#functions">Functions</a>
+			<ul class="arrow">
+				<li><a href="#add">add</a></li>
+				<li><a href="#openall">openAll</a></li>
+				<li><a href="#closeall">closeAll</a></li>
+				<li><a href="#opento">openTo</a></li>
+			</ul>
+		</li>
+		<li><a href="#configuration">Configuration</a></li>
+	</ul>
+
+</div>
+
+<a name="functions"></a>
+<h3>Functions</h3>
+<div class="line"></div>
+<div class="item">
+
+	<a name="add"></a>
+	<h4 class="func">add()</h4>
+	<p>Adds a node to the tree.<br />Can only be called before the tree is drawn.</p>
+	<p>id, pid and name are required.</p>
+
+	<h4>Parameters</h4>
+	<table class="files">
+	<tr>
+		<th>Name</th>
+		<th>Type</th>
+		<th>Description</th>
+	</tr>
+	<tr>
+		<td>id</td>
+		<td>Number</td>
+		<td>Unique identity number.</td>
+	</tr>
+	<tr>
+		<td>pid</td>
+		<td>Number</td>
+		<td>Number refering to the parent node. The value for the root node has to be -1.</td>
+	</tr>
+	<tr>
+		<td>name</td>
+		<td>String</td>
+		<td>Text label for the node.</td>
+	</tr>
+	<tr>
+		<td>url</td>
+		<td>String</td>
+		<td>Url for the node.</td>
+	</tr>
+	<tr>
+		<td>title</td>
+		<td>String</td>
+		<td>Title for the node.</td>
+	</tr>
+	<tr>
+		<td>target</td>
+		<td>String</td>
+		<td>Target for the node.</td>
+	</tr>
+	<tr>
+		<td>icon</td>
+		<td>String</td>
+		<td>Image file to use as the icon. Uses default if not specified.</td>
+	</tr>
+	<tr>
+		<td>iconOpen</td>
+		<td>String</td>
+		<td>Image file to use as the open icon. Uses default if not specified.</td>
+	</tr>
+	<tr>
+		<td>open</td>
+		<td>Boolean</td>
+		<td>Is the node open.</td>
+	</tr>
+	</table>
+	<br />
+
+
+	<h4>Example</h4>
+	<p><code>mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');</code></p>
+	<br />
+
+	<a name="openall"></a>
+	<h4 class="func">openAll()</h4>
+	<p>Opens all the nodes.<br />Can be called before and after the tree is drawn.</p>
+	<h4>Example</h4>
+	<p><code>mytree.openAll();</code></p>
+	<br />
+
+
+	<a name="closeall"></a>
+	<h4 class="func">closeAll()</h4>
+	<p>Closes all the nodes.<br />Can be called before and after the tree is drawn.</p>
+	<h4>Example</h4>
+	<p><code>mytree.closeAll();</code></p>
+	<br />
+
+
+	<a name="opento"></a>
+	<h4 class="func">openTo()</h4>
+	<p>Opens the tree to a certain node and can also select the node.<br />
+	Can only be called after the tree is drawn.</p>
+
+	<h4>Parameters</h4>
+	<table class="files">
+	<tr>
+		<th>Name</th>
+		<th>Type</th>
+		<th>Description</th>
+	</tr>
+	<tr>
+		<td>id</td>
+		<td>Number</td>
+		<td>Identity number for the node.</td>
+	</tr>
+	<tr>
+		<td>select</td>
+		<td>Boolean</td>
+		<td>Should the node be selected.</td>
+	</tr>
+	</table>
+
+	<h4>Example</h4>
+	<p><code>mytree.openTo(4, true);</code></p>
+
+</div>
+
+<a name="configuration"></a>
+<h3>Configuration</h3>
+<div class="line"></div>
+<div class="item">
+
+	<table class="files">
+	<tr>
+		<th>Variable</th>
+		<th>Type</th>
+		<th>Default</th>
+		<th>Description</th>
+	</tr>
+	<tr>
+		<td>target</td>
+		<td>String</td>
+		<td>true</td>
+		<td>Target for all the nodes.</td>
+	</tr>
+	<tr>
+		<td>folderLinks</td>
+		<td>Boolean</td>
+		<td>true</td>
+		<td>Should folders be links.</td>
+	</tr>
+	<tr>
+		<td>useSelection</td>
+		<td>Boolean</td>
+		<td>true</td>
+		<td>Nodes can be selected(highlighted).</td>
+	</tr>
+	<tr>
+		<td>useCookies</td>
+		<td>Boolean</td>
+		<td>true</td>
+		<td>The tree uses cookies to rember it's state.</td>
+	</tr>
+	<tr>
+		<td>useLines</td>
+		<td>Boolean</td>
+		<td>true</td>
+		<td>Tree is drawn with lines.</td>
+	</tr>
+	<tr>
+		<td>useIcons</td>
+		<td>Boolean</td>
+		<td>true</td>
+		<td>Tree is drawn with icons.</td>
+	</tr>
+	<tr>
+		<td>useStatusText</td>
+		<td>Boolean</td>
+		<td>false</td>
+		<td>Displays node names in the statusbar instead of the url.</td>
+	</tr>
+	<tr>
+		<td>closeSameLevel</td>
+		<td>Boolean</td>
+		<td>false</td>
+		<td>Only one node within a parent can be expanded at the same time.  openAll() and closeAll() functions do not work when this is enabled.</td>
+	</tr>
+	<tr>
+		<td>inOrder</td>
+		<td>Boolean</td>
+		<td>false</td>
+		<td>If parent nodes are always added before children, setting this to true speeds up the tree.</td>
+	</tr>
+	</table>
+
+	<h4>Example</h4>
+	<p><code>mytree.config.target = "mytarget";</code></p>
+
+</div>
+
+		</div>
+
+		<div class="line"></div>
+
+
+		<div id="copy">
+			<p class="right"><a href="http://validator.w3.org/check/referer">XHTML</a>, <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></p>
+			<p><a href="mailto&#58;drop&#64;destroydrop&#46;com">&copy;2002-2003 Geir Landr&ouml;</a></p>
+		</div>
+
+	</div>
+
+</div>
+
+
+</body>
+
+</html>
Index: /branches/new-dialogs-merge/plugins/Linker/dTree/dtree.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/dTree/dtree.js (revision 419)
+++ /branches/new-dialogs-merge/plugins/Linker/dTree/dtree.js (revision 419)
@@ -0,0 +1,722 @@
+/*--------------------------------------------------|
+
+| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
+
+|---------------------------------------------------|
+
+| Copyright (c) 2002-2003 Geir Landr?               |
+
+|                                                   |
+
+| This script can be used freely as long as all     |
+
+| copyright messages are intact.                    |
+
+|                                                   |
+
+| Updated: 17.04.2003                               |
+
+|--------------------------------------------------*/
+
+
+
+// Node object
+
+function Node(id, pid, name, url, title, target, icon, iconOpen, open) {
+
+  this.id = id;
+
+  this.pid = pid;
+
+  this.name = name;
+
+  this.url = url;
+
+  this.title = title;
+
+  this.target = target;
+
+  this.icon = icon;
+
+  this.iconOpen = iconOpen;
+
+  this._io = open || false;
+
+  this._is = false;
+
+  this._ls = false;
+
+  this._hc = false;
+
+  this._ai = 0;
+
+  this._p;
+
+}
+
+
+
+// Tree object
+
+function dTree(objName, baseDir) {
+
+  this.config = {
+
+    target					: null,
+
+    folderLinks			: true,
+
+    useSelection		: true,
+
+    useCookies			: true,
+
+    useLines				: true,
+
+    useIcons				: true,
+
+    useStatusText		: false,
+
+    closeSameLevel	: false,
+
+    inOrder					: false
+
+  };
+
+  this.icon = {
+
+    root				: baseDir + 'img/base.gif',
+
+    folder			: baseDir + 'img/folder.gif',
+
+    folderOpen	: baseDir + 'img/folderopen.gif',
+
+    node				: baseDir + 'img/page.gif',
+
+    empty				: baseDir + 'img/empty.gif',
+
+    line				: baseDir + 'img/line.gif',
+
+    join				: baseDir + 'img/join.gif',
+
+    joinBottom	: baseDir + 'img/joinbottom.gif',
+
+    plus				: baseDir + 'img/plus.gif',
+
+    plusBottom	: baseDir + 'img/plusbottom.gif',
+
+    minus				: baseDir + 'img/minus.gif',
+
+    minusBottom	: baseDir + 'img/minusbottom.gif',
+
+    nlPlus			: baseDir + 'img/nolines_plus.gif',
+
+    nlMinus			: baseDir + 'img/nolines_minus.gif'
+
+  };
+
+  this.obj = objName;
+
+  this.aNodes = [];
+
+  this.aIndent = [];
+
+  this.root = new Node(-1);
+
+  this.selectedNode = null;
+
+  this.selectedFound = false;
+
+  this.completed = false;
+
+}
+
+
+
+// Adds a new node to the node array
+
+dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {
+
+  this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);
+
+};
+
+
+
+// Open/close all nodes
+
+dTree.prototype.openAll = function() {
+
+  this.oAll(true);
+
+};
+
+dTree.prototype.closeAll = function() {
+
+  this.oAll(false);
+
+};
+
+
+
+// Outputs the tree to the page
+
+dTree.prototype.toString = function() {
+  this.setCS_All();
+  var str = '<div class="dtree">\n';
+
+  if (document.getElementById) {
+
+    if (this.config.useCookies) this.selectedNode = this.getSelected();
+
+    str += this.addNode(this.root);
+
+  } else str += 'Browser not supported.';
+
+  str += '</div>';
+
+  if (!this.selectedFound) this.selectedNode = null;
+
+  this.completed = true;
+
+  return str;
+
+};
+
+
+
+// Creates the tree structure
+
+dTree.prototype.addNode = function(pNode) {
+
+  var str = '';
+
+  var n=0;
+
+  if (this.config.inOrder) n = pNode._ai;
+
+  for (n; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n].pid == pNode.id) {
+
+      var cn = this.aNodes[n];
+
+      cn._p = pNode;
+
+      cn._ai = n;
+
+      // this.setCS(cn);
+
+      if (!cn.target && this.config.target) cn.target = this.config.target;
+
+      if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
+
+      if (!this.config.folderLinks && cn._hc) cn.url = null;
+
+      if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
+
+          cn._is = true;
+
+          this.selectedNode = n;
+
+          this.selectedFound = true;
+
+      }
+
+      str += this.node(cn, n);
+
+      if (cn._ls) break;
+
+    }
+
+  }
+
+  return str;
+
+};
+
+
+
+// Creates the node icon, url and text
+
+dTree.prototype.node = function(node, nodeId) {
+
+  var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
+
+  if (this.config.useIcons) {
+
+    if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
+
+    if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
+
+    if (this.root.id == node.pid) {
+
+      node.icon = this.icon.root;
+
+      node.iconOpen = this.icon.root;
+
+    }
+
+    str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
+
+  }
+
+  if (node.url) {
+
+    str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"';
+
+    if (node.title) str += ' title="' + node.title + '"';
+
+    if (node.target) str += ' target="' + node.target + '"';
+
+    if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';
+
+    if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
+
+      str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
+
+    str += '>';
+
+  }
+
+  else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
+
+    str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
+
+  str += node.name;
+
+  if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
+
+  str += '</div>';
+
+  if (node._hc) {
+
+    str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
+
+    str += this.addNode(node);
+
+    str += '</div>';
+
+  }
+
+  this.aIndent.pop();
+
+  return str;
+
+};
+
+
+
+// Adds the empty and line icons
+
+dTree.prototype.indent = function(node, nodeId) {
+
+  var str = '';
+
+  if (this.root.id != node.pid) {
+
+    for (var n=0; n<this.aIndent.length; n++)
+
+      str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
+
+    (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
+
+    if (node._hc) {
+
+      str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
+
+      if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
+
+      else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
+
+      str += '" alt="" /></a>';
+
+    } else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
+
+  }
+
+  return str;
+
+};
+
+
+
+// Checks if a node has any children and if it is the last sibling
+
+dTree.prototype.setCS = function(node) {
+
+  var lastId;
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n].pid == node.id) node._hc = true;
+
+    if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
+
+  }
+
+  if (lastId==node.id) node._ls = true;
+
+};
+
+dTree.prototype.setCS_All = function()
+{
+  var ids = { }; // ID => { _hc: haschildren, _ls_is: lastsibling}
+
+  for(var n = 0; n < this.aNodes.length; n++)
+  {
+    var node = this.aNodes[n];
+    if(!ids[node.pid])
+    {
+      ids[node.pid] = { _hc: true, _ls_is: node.id };
+    }
+    else
+    {
+      ids[node.pid]._hc    = true;
+      ids[node.pid]._ls_is = node.id;
+    }
+
+    if(!ids[node.id])
+    {
+      ids[node.id] = { _hc: false, _ls_is: null }
+    }
+  }
+
+  for(var n = 0; n < this.aNodes.length; n++)
+  {
+    var node = this.aNodes[n];
+    node._ls = ids[node.pid]._ls_is == node.id ? true : false;
+    node._hc = ids[node.id]._hc;
+  }
+};
+
+// Returns the selected node
+
+dTree.prototype.getSelected = function() {
+
+  var sn = this.getCookie('cs' + this.obj);
+
+  return (sn) ? sn : null;
+
+};
+
+
+
+// Highlights the selected node
+
+dTree.prototype.s = function(id) {
+
+  if (!this.config.useSelection) return;
+
+  var cn = this.aNodes[id];
+
+  if (cn._hc && !this.config.folderLinks) return;
+
+  if (this.selectedNode != id) {
+
+    if (this.selectedNode || this.selectedNode==0) {
+
+      eOld = document.getElementById("s" + this.obj + this.selectedNode);
+
+      eOld.className = "node";
+
+    }
+
+    eNew = document.getElementById("s" + this.obj + id);
+
+    eNew.className = "nodeSel";
+
+    this.selectedNode = id;
+
+    if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
+
+  }
+
+};
+
+
+
+// Toggle Open or close
+
+dTree.prototype.o = function(id) {
+
+  var cn = this.aNodes[id];
+
+  this.nodeStatus(!cn._io, id, cn._ls);
+
+  cn._io = !cn._io;
+
+  if (this.config.closeSameLevel) this.closeLevel(cn);
+
+  if (this.config.useCookies) this.updateCookie();
+
+};
+
+
+
+// Open or close all nodes
+
+dTree.prototype.oAll = function(status) {
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
+
+      this.nodeStatus(status, n, this.aNodes[n]._ls)
+
+      this.aNodes[n]._io = status;
+
+    }
+
+  }
+
+  if (this.config.useCookies) this.updateCookie();
+
+};
+
+
+
+// Opens the tree to a specific node
+
+dTree.prototype.openTo = function(nId, bSelect, bFirst) {
+
+  if (!bFirst) {
+
+    for (var n=0; n<this.aNodes.length; n++) {
+
+      if (this.aNodes[n].id == nId) {
+
+        nId=n;
+
+        break;
+
+      }
+
+    }
+
+  }
+
+  var cn=this.aNodes[nId];
+
+  if (cn.pid==this.root.id || !cn._p) return;
+
+  cn._io = true;
+
+  cn._is = bSelect;
+
+  if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
+
+  if (this.completed && bSelect) this.s(cn._ai);
+
+  else if (bSelect) this._sn=cn._ai;
+
+  this.openTo(cn._p._ai, false, true);
+
+};
+
+
+
+// Closes all nodes on the same level as certain node
+
+dTree.prototype.closeLevel = function(node) {
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
+
+      this.nodeStatus(false, n, this.aNodes[n]._ls);
+
+      this.aNodes[n]._io = false;
+
+      this.closeAllChildren(this.aNodes[n]);
+
+    }
+
+  }
+
+}
+
+
+
+// Closes all children of a node
+
+dTree.prototype.closeAllChildren = function(node) {
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
+
+      if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
+
+      this.aNodes[n]._io = false;
+
+      this.closeAllChildren(this.aNodes[n]);
+
+    }
+
+  }
+
+}
+
+
+
+// Change the status of a node(open or closed)
+
+dTree.prototype.nodeStatus = function(status, id, bottom) {
+
+  eDiv	= document.getElementById('d' + this.obj + id);
+
+  eJoin	= document.getElementById('j' + this.obj + id);
+
+  if (this.config.useIcons) {
+
+    eIcon	= document.getElementById('i' + this.obj + id);
+
+    eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
+
+  }
+
+  eJoin.src = (this.config.useLines)?
+
+  ((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
+
+  ((status)?this.icon.nlMinus:this.icon.nlPlus);
+
+  eDiv.style.display = (status) ? 'block': 'none';
+
+};
+
+
+
+
+
+// [Cookie] Clears a cookie
+
+dTree.prototype.clearCookie = function() {
+
+  var now = new Date();
+
+  var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
+
+  this.setCookie('co'+this.obj, 'cookieValue', yesterday);
+
+  this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
+
+};
+
+
+
+// [Cookie] Sets value in a cookie
+
+dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
+
+  document.cookie =
+
+    escape(cookieName) + '=' + escape(cookieValue)
+
+    + (expires ? '; expires=' + expires.toGMTString() : '')
+
+    + (path ? '; path=' + path : '')
+
+    + (domain ? '; domain=' + domain : '')
+
+    + (secure ? '; secure' : '');
+
+};
+
+
+
+// [Cookie] Gets a value from a cookie
+
+dTree.prototype.getCookie = function(cookieName) {
+
+  var cookieValue = '';
+
+  var posName = document.cookie.indexOf(escape(cookieName) + '=');
+
+  if (posName != -1) {
+
+    var posValue = posName + (escape(cookieName) + '=').length;
+
+    var endPos = document.cookie.indexOf(';', posValue);
+
+    if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
+
+    else cookieValue = unescape(document.cookie.substring(posValue));
+
+  }
+
+  return (cookieValue);
+
+};
+
+
+
+// [Cookie] Returns ids of open nodes as a string
+
+dTree.prototype.updateCookie = function() {
+
+  var str = '';
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
+
+      if (str) str += '.';
+
+      str += this.aNodes[n].id;
+
+    }
+
+  }
+
+  this.setCookie('co' + this.obj, str);
+
+};
+
+
+
+// [Cookie] Checks if a node id is in a cookie
+
+dTree.prototype.isOpen = function(id) {
+
+  var aOpen = this.getCookie('co' + this.obj).split('.');
+
+  for (var n=0; n<aOpen.length; n++)
+
+    if (aOpen[n] == id) return true;
+
+  return false;
+
+};
+
+
+
+// If Push and pop is not implemented by the browser
+
+if (!Array.prototype.push) {
+
+  Array.prototype.push = function array_push() {
+
+    for(var i=0;i<arguments.length;i++)
+
+      this[this.length]=arguments[i];
+
+    return this.length;
+
+  };
+
+}
+
+if (!Array.prototype.pop) {
+
+  Array.prototype.pop = function array_pop() {
+
+    lastElement = this[this.length-1];
+
+    this.length = Math.max(this.length-1,0);
+
+    return lastElement;
+
+  };
+
+}
Index: /branches/new-dialogs-merge/plugins/Linker/scan.php
===================================================================
--- /branches/new-dialogs-merge/plugins/Linker/scan.php (revision 926)
+++ /branches/new-dialogs-merge/plugins/Linker/scan.php (revision 926)
@@ -0,0 +1,114 @@
+<?php
+    // /home/username/foo/public_html/bar
+    $dir          = dirname(__FILE__)."/../..";
+    
+    // http://example.com/bar (or relative url, or semi absolute)
+    $url       = '';
+    
+    $include      = '/\.(php|shtml|html|htm|shtm|cgi|txt|doc|pdf|rtf|xls|csv)$/';
+    $exclude      = '';
+    $dirinclude   = '';
+    $direxclude   = '/(^|\/)[._]|htmlarea/'; // Exclude the htmlarea tree by default
+
+    // New backend config data passing
+    //  if data was passed using xinha_pass_to_backend() we extract and use it
+    //  as the items above    
+    require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php'));
+    if($passed_data = xinha_read_passed_data())
+    {
+      extract($passed_data);      
+    }
+
+    // Old deprecated backend config data passing
+    //  not described because you shouldn't use it.
+    //------------------------------------------------------------------------    
+    $hash = '';
+    foreach(explode(',', 'dir,include,exclude,dirinclude,direxclude') as $k)
+    {
+      if(isset($_REQUEST[$k]))
+      {
+        if(get_magic_quotes_gpc())
+        {
+          $_REQUEST[$k] = stripslashes($_REQUEST[$k]);
+        }
+        $hash .= $k . '=' . $_REQUEST[$k];
+        $$k = $_REQUEST[$k];
+      }
+    }
+
+    if($hash)
+    {
+      session_start();
+      if(!isset($_SESSION[sha1($hash)]))
+      {
+        ?>
+        [ ];
+        <?php
+        exit;
+      }
+    }
+    //------------------------------------------------------------------------
+
+    // Neither dir nor url should have trailing slash
+    $dir = preg_replace('/\/$/', '', $dir);
+    $url = preg_replace('/\/$/', '', $url);
+    
+    function scan($dir, $durl = '')
+    {
+      global $include, $exclude, $dirinclude, $direxclude;
+      static $seen = array();
+
+      $files = array();
+
+      $dir = realpath($dir);
+      if(isset($seen[$dir]))
+      {
+        return $files;
+      }
+      $seen[$dir] = TRUE;
+      $dh = @opendir($dir);
+
+
+      while($dh && ($file = readdir($dh)))
+      {
+        if($file !== '.' && $file !== '..')
+        {
+          $path = realpath($dir . '/' . $file);
+          $url  = $durl . '/' . $file;
+
+          if(($dirinclude && !preg_match($dirinclude, $url)) || ($direxclude && preg_match($direxclude, $url))) continue;
+          if(is_dir($path))
+          {
+            if($subdir = scan($path, $url))
+            {
+              $files[] = array('url'=>$url, 'children'=>$subdir);
+            }
+          }
+          elseif(is_file($path))
+          {
+            if(($include && !preg_match($include, $url)) || ($exclude && preg_match($exclude, $url))) continue;
+            $files[] = array('url'=>$url);
+          }
+
+        }
+      }
+      @closedir($dh);
+      return dirsort($files);
+    }
+
+    function dirsort($files)
+    {
+      usort($files, 'dircomp');
+      return $files;
+    }
+
+    function dircomp($a, $b)
+    {
+      if(isset($a['children']) && !isset($b['children'])) return -1;
+      if(isset($b['children']) && !isset($a['children'])) return 1;
+      
+      return strcmp(strtolower($a['url']), strtolower($b['url']));
+    }
+   
+    echo xinha_to_js(scan($dir,$url));
+?>
Index: /branches/new-dialogs-merge/plugins/Filter/filter.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Filter/filter.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/Filter/filter.js (revision 999)
@@ -0,0 +1,68 @@
+// Filter plugin for Xinha
+// Implementation by Udo Schmal & Schaffrath NeueMedien
+// Original Author - Udo Schmal
+//
+// (c) Udo Schmal & Schaffrath NeueMedien 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+function Filter(editor) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+  // register the toolbar buttons provided by this plugin
+  cfg.registerButton({
+    id: "filter",
+    tooltip  : this._lc("Filter"),
+    image    : editor.imgURL("ed_filter.gif", "Filter"),
+    textMode : false,
+    action   : function(editor) {
+                 self.buttonPress(editor);
+               }
+  });
+  if (!cfg.Filters)
+    cfg.Filters = ["Paragraph","Word"];
+  for (var i = 0; i < editor.config.Filters.length; i++) {
+    self.add(editor.config.Filters[i]);
+  }
+  cfg.addToolbarElement("filter", "removeformat", 1);
+}
+
+Filter._pluginInfo =
+{
+  name          : "Filter",
+  version       : "1.0",
+  developer     : "Udo Schmal (gocher)",
+  developer_url : "",
+  sponsor       : "L.N.Schaffrath NeueMedien",
+  sponsor_url   : "http://www.schaffrath-neuemedien.de/",
+  c_owner       : "Udo Schmal & Schaffrath-NeueMedien",
+  license       : "htmlArea"
+};
+
+Filter.prototype.add = function(filterName) {
+  if(eval('typeof ' + filterName) == 'undefined') {
+    var filter = Xinha.getPluginDir('Filter') + "/filters/" + filterName + ".js";
+    var head = document.getElementsByTagName("head")[0];
+    var evt = Xinha.is_ie ? "onreadystatechange" : "onload";
+    var script = document.createElement("script");
+    script.type = "text/javascript";
+    script.src = filter;
+    script[evt] = function() {
+      if(Xinha.is_ie && !/loaded|complete/.test(window.event.srcElement.readyState))  return;
+    }
+    head.appendChild(script);
+    //document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
+  }
+};
+
+Filter.prototype._lc = function(string) {
+    return Xinha._lc(string, 'Filter');
+};
+
+Filter.prototype.buttonPress = function(editor) {
+  var html = editor.getInnerHTML();
+  for (var i = 0; i < editor.config.Filters.length; i++) {
+    html = eval(editor.config.Filters[i])(html);
+  }
+  editor.setHTML(html);
+};
Index: /branches/new-dialogs-merge/plugins/Filter/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Filter/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/Filter/lang/pt_br.js (revision 901)
@@ -0,0 +1,18 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Filter": "Filtro"
+};
Index: /branches/new-dialogs-merge/plugins/Filter/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Filter/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/Filter/lang/nl.js (revision 872)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Filter": "Filter"
+};
Index: /branches/new-dialogs-merge/plugins/Filter/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Filter/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/Filter/lang/ja.js (revision 715)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Filter": "ãã£ã«ã¿ãŒ"
+};
Index: /branches/new-dialogs-merge/plugins/Filter/filters/paragraph.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Filter/filters/paragraph.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Filter/filters/paragraph.js (revision 677)
@@ -0,0 +1,6 @@
+Paragraph = function(html) {
+  html = html.replace(/<\s*p[^>]*>/gi, '');
+  html = html.replace(/<\/\s*p\s*>/gi, '');
+  html = html.trim();
+  return html;
+};
Index: /branches/new-dialogs-merge/plugins/Filter/filters/word.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Filter/filters/word.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Filter/filters/word.js (revision 677)
@@ -0,0 +1,53 @@
+Word = function(html) {
+    // Remove HTML comments
+	html = html.replace(/<!--[\w\s\d@{}:.;,'"%!#_=&|?~()[*+\/\-\]]*-->/gi, "" );
+	html = html.replace(/<!--[^\0]*-->/gi, '');
+    // Remove all HTML tags
+	html = html.replace(/<\/?\s*HTML[^>]*>/gi, "" );
+    // Remove all BODY tags
+    html = html.replace(/<\/?\s*BODY[^>]*>/gi, "" );
+    // Remove all META tags
+	html = html.replace(/<\/?\s*META[^>]*>/gi, "" );
+    // Remove all SPAN tags
+	html = html.replace(/<\/?\s*SPAN[^>]*>/gi, "" );
+	// Remove all FONT tags
+    html = html.replace(/<\/?\s*FONT[^>]*>/gi, "");
+    // Remove all IFRAME tags.
+    html = html.replace(/<\/?\s*IFRAME[^>]*>/gi, "");
+    // Remove all STYLE tags & content
+	html = html.replace(/<\/?\s*STYLE[^>]*>(.|[\n\r\t])*<\/\s*STYLE\s*>/gi, "" );
+    // Remove all TITLE tags & content
+	html = html.replace(/<\s*TITLE[^>]*>(.|[\n\r\t])*<\/\s*TITLE\s*>/gi, "" );
+	// Remove javascript
+    html = html.replace(/<\s*SCRIPT[^>]*>[^\0]*<\/\s*SCRIPT\s*>/gi, "");
+    // Remove all HEAD tags & content
+	html = html.replace(/<\s*HEAD[^>]*>(.|[\n\r\t])*<\/\s*HEAD\s*>/gi, "" );
+	// Remove Class attributes
+	html = html.replace(/<\s*(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
+	// Remove Style attributes
+	html = html.replace(/<\s*(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
+	// Remove Lang attributes
+	html = html.replace(/<\s*(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
+	// 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, "") ;
+	// Replace the &nbsp;
+	html = html.replace(/&nbsp;/, " " );
+
+	// Transform <p><br /></p> to <br>
+	//html = html.replace(/<\s*p[^>]*>\s*<\s*br\s*\/>\s*<\/\s*p[^>]*>/gi, "<br>");
+	html = html.replace(/<\s*p[^>]*><\s*br\s*\/?>\s*<\/\s*p[^>]*>/gi, "<br>");
+	
+	// Remove <P> 
+	html = html.replace(/<\s*p[^>]*>/gi, "");
+	
+	// Replace </p> with <br>
+	html = html.replace(/<\/\s*p[^>]*>/gi, "<br>");
+	
+	// Remove any <br> at the end
+	html = html.replace(/(\s*<br>\s*)*$/, "");
+	
+	html = html.trim();
+	return html;
+};
Index: /branches/new-dialogs-merge/plugins/Forms/forms.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/forms.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/Forms/forms.js (revision 999)
@@ -0,0 +1,353 @@
+// Form plugin for Xinha
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+
+function Forms(editor) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var bl = Forms.btnList;
+  var self = this;
+  // register the toolbar buttons provided by this plugin
+  var toolbar = ["linebreak"];
+  for (var i = 0; i < bl.length; ++i) {
+    var btn = bl[i];
+    if (!btn) {
+      toolbar.push("separator");
+    } else {
+      var id = btn[0];
+      if (i<3)
+        cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "Forms"), false,
+             function(editor, id) {
+               // dispatch button press event
+               self.buttonPress(editor, id);
+             });
+      else
+        cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "Forms"), false,
+             function(editor, id) {
+               // dispatch button press event
+               self.buttonPress(editor, id);
+             },"form");
+      toolbar.push(id);
+    }
+  }
+  // add a new line in the toolbar
+  cfg.toolbar.push(toolbar);
+}
+
+Forms._pluginInfo = {
+  name          : "Forms",
+  origin        : "version: 1.0, by Nelson Bright, BrightWork, Inc., http://www.brightworkweb.com",
+  version       : "2.0",
+  developer     : "Udo Schmal",
+  developer_url : "",
+  sponsor       : "L.N.Schaffrath NeueMedien",
+  sponsor_url   : "http://www.schaffrath-neuemedien.de/",
+  c_owner       : "Udo Schmal & Schaffrath-NeueMedien",
+  license       : "htmlArea"
+};
+
+// the list of buttons added by this plugin
+Forms.btnList = [
+  // form properties button
+  null, // separator
+  ["form",        "Form"],
+  null, // separator
+  // form elements
+  ["textarea",    "Textarea"],
+  ["select",      "Selection Field"],
+  ["checkbox",    "Checkbox"],
+  ["radio",       "Radio Button"],
+  ["text",        "Text Field"],
+  ["password",    "Password Field"],
+  ["file",        "File Field"],
+  ["button",      "Button"],
+  ["submit",      "Submit Button"],
+  ["reset",       "Reset Button"],
+  ["image",       "Image Button"],
+  ["hidden",      "Hidden Field"],
+  ["label",       "Label"],
+  ["fieldset",    "Field Set"]
+  ];
+
+Forms.prototype._lc = function(string) {
+    return Xinha._lc(string, 'Forms');
+};
+
+Forms.prototype.onGenerate = function() {
+  this.editor.addEditorStylesheet(Xinha.getPluginDir("Forms") + '/forms.css');
+};
+
+Forms.prototype.buttonPress = function(editor,button_id, node) {
+  function optionValues(text,value) {
+    this.text = text;
+    this.value = value;
+  }
+  var outparam = new Object();
+  var type = button_id;
+  var sel = editor._getSelection();
+  var range = editor._createRange(sel);
+  if (button_id=="form") { //Form
+    // see if selection is inside an existing 'form' tag
+    var pe = editor.getParentElement();
+    var frm = null;
+    while (pe && (pe.nodeType == 1) && (pe.tagName.toLowerCase() != 'body')) {
+      if(pe.tagName.toLowerCase() == "form") {
+        frm = pe;
+        break;
+      } else
+        pe = pe.parentNode;
+    }
+    if (frm) {
+      outparam.f_name = frm.name;
+      outparam.f_action = frm.action;
+      outparam.f_method = frm.method;
+      outparam.f_enctype = frm.enctype;
+      outparam.f_target = frm.target;
+    } else {;
+      outparam.f_name = "";
+      outparam.f_action = "";
+      outparam.f_method = "";
+      outparam.f_enctype = "";
+      outparam.f_target = "";
+    }
+    editor._popupDialog("plugin://Forms/form", function(param) {
+      if (param) {
+        if(frm) {
+          frm.name = param["f_name"];
+          frm.setAttribute("action", param["f_action"]);
+          frm.setAttribute("method", param["f_method"]);
+          frm.setAttribute("enctype",param["f_enctype"]);
+          frm.setAttribute("target", param["f_target"]);
+        } else {
+          frm = '<form name="' + param["f_name"] + '"';
+          if (param["f_action"] != "") frm += ' action="' + param["f_action"] + '"';
+          if (param["f_method"] != "") frm += ' method="' + param["f_method"] + '"';
+          if (param["f_enctype"] != "") frm += ' enctype="' + param["f_enctype"] + '"';
+          if (param["f_target"] != "") frm += ' target="' + param["f_target"] + '"';
+          frm += '>';
+          editor.surroundHTML(frm, '&nbsp;</form>');
+        }
+      }
+    }, outparam);
+
+  } else { // form element (checkbox, radio, text, password, textarea, select, button, submit, reset, image, hidden)
+    var tagName = "";
+    // see if selection is an form element
+    if (typeof node == "undefined") {
+      node = editor.getParentElement();
+      var tag = node.tagName.toLowerCase()
+      if (node && (tag == "legend")) {
+        node = node.parentElement;
+        tag = node.tagName.toLowerCase();
+      }
+      if (node && !(tag == "textarea" || tag == "select" || tag == "input" || tag == "label" || tag == "fieldset"))
+        node = null;
+    }
+
+    if(node) {
+      type = node.tagName.toLowerCase();
+      outparam.f_name = node.name;
+      tagName = node.tagName;
+      if (type == "input") {
+        outparam.f_type = node.type;
+        type = node.type;
+      }
+      switch (type) {
+        case "textarea":
+          outparam.f_cols = node.cols;
+          outparam.f_rows = node.rows;
+          outparam.f_text = node.innerHTML;
+          outparam.f_wrap = node.getAttribute("wrap");
+          outparam.f_readOnly = node.getAttribute("readOnly");
+          outparam.f_disabled = node.getAttribute("disabled");
+          outparam.f_tabindex = node.getAttribute("tabindex");
+          outparam.f_accesskey = node.getAttribute("accesskey");
+          break;
+        case "select":
+          outparam.f_size = parseInt(node.size);
+          outparam.f_multiple = node.getAttribute("multiple");
+          outparam.f_disabled = node.getAttribute("disabled");
+          outparam.f_tabindex = node.getAttribute("tabindex");
+          var a_options = new Array();
+          for (var i=0; i<=node.options.length-1; i++) {
+            a_options[i] = new optionValues(node.options[i].text, node.options[i].value);
+          }
+          outparam.f_options = a_options;
+          break;
+        case "text":
+        case "password":
+          outparam.f_value = node.value;
+          outparam.f_size = node.size;
+          outparam.f_maxLength = node.maxLength;
+          outparam.f_readOnly = node.getAttribute("readOnly");
+          outparam.f_disabled = node.getAttribute("disabled");
+          outparam.f_tabindex = node.getAttribute("tabindex");
+          outparam.f_accesskey = node.getAttribute("accesskey");
+          break;
+        case "hidden":
+          outparam.f_value = node.value;
+          break;
+        case "submit":
+        case "reset":
+          outparam.f_value = node.value;
+          outparam.f_disabled = node.getAttribute("disabled");
+          outparam.f_tabindex = node.getAttribute("tabindex");
+          outparam.f_accesskey = node.getAttribute("accesskey");
+          break;
+        case "checkbox":
+        case "radio":
+          outparam.f_value = node.value;
+          outparam.f_checked = node.checked;
+          outparam.f_disabled = node.getAttribute("disabled");
+          outparam.f_tabindex = node.getAttribute("tabindex");
+          outparam.f_accesskey = node.getAttribute("accesskey");
+          break;
+        case "button":
+          outparam.f_value = node.value;
+          outparam.f_onclick = node.getAttribute("onclick");
+          outparam.f_disabled = node.getAttribute("disabled");
+          outparam.f_tabindex = node.getAttribute("tabindex");
+          outparam.f_accesskey = node.getAttribute("accesskey");
+          break;
+        case "image":
+          outparam.f_value = node.value;
+          outparam.f_src = node.src;
+          outparam.f_disabled = node.getAttribute("disabled");
+          outparam.f_tabindex = node.getAttribute("tabindex");
+          outparam.f_accesskey = node.getAttribute("accesskey");
+          break;
+        case "file":
+          outparam.f_disabled = node.getAttribute("disabled");
+          outparam.f_tabindex = node.getAttribute("tabindex");
+          outparam.f_accesskey = node.getAttribute("accesskey");
+          break;
+        case "label":
+          outparam.f_text = node.innerHTML;
+          outparam.f_for = node.getAttribute("for");
+          outparam.f_accesskey = node.getAttribute("accesskey");
+          break;
+        case "fieldset":
+          if(node.firstChild.tagName.toLowerCase()=="legend")
+            outparam.f_text = node.firstChild.innerHTML;
+          else
+            outparam.f_text = "";
+          break;
+      }
+    } else {
+      outparam.f_name = "";
+      switch (button_id) {
+        case "textarea":
+        case "select":
+        case "label":
+        case "fieldset":
+          tagName = button_id;
+          break;
+        default:
+          tagName = "input";
+          outparam.f_type = button_id;
+          break;
+      }
+      outparam.f_options = "";
+      outparam.f_cols = "20";
+      outparam.f_rows = "4";
+      outparam.f_multiple = "false";
+      outparam.f_value = "";
+      outparam.f_size = "";
+      outparam.f_maxLength = "";
+      outparam.f_checked = "";
+      outparam.f_src = "";
+      outparam.f_onclick = "";
+      outparam.f_wrap = "";
+      outparam.f_readOnly = "false";
+      outparam.f_disabled = "false";
+      outparam.f_tabindex = "";
+      outparam.f_accesskey = "";
+      outparam.f_for = "";
+      outparam.f_text = "";
+      outparam.f_legend = "";
+    }
+    editor._popupDialog("plugin://Forms/" + tagName + ".html", function(param) {
+      if (param) {
+        if(param["f_cols"])
+          if (isNaN(parseInt(param["f_cols"],10)) || parseInt(param["f_cols"],10) <= 0)
+            param["f_cols"] = "";
+        if(param["f_rows"])
+          if(isNaN(parseInt(param["f_rows"],10)) || parseInt(param["f_rows"],10) <= 0)
+            param["f_rows"] = "";
+        if(param["f_size"])
+          if(isNaN(parseInt(param["f_size"],10)) || parseInt(param["f_size"],10) <= 0)
+            param["f_size"] = "";
+        if(param["f_maxlength"])
+          if(isNaN(parseInt(param["f_maxLength"],10)) || parseInt(param["f_maxLength"],10) <= 0)
+            param["f_maxLength"] = "";
+        if(node) {
+          //prepare existing Element
+          for (field in param) {
+            //alert(field.substring(2,20) + '=' + param[field]);  //to be silent! by htanaka
+            if ((field=="f_text") || (field=="f_options") || (field=="f_onclick") || (field=="f_checked"))continue;
+            if (param[field] != "")
+              node.setAttribute(field.substring(2,20), param[field]);
+            else
+              node.removeAttribute(field.substring(2,20));
+          }
+          if (type == "textarea") {
+            node.innerHTML = param["f_text"];
+          } else if(type == "select") {
+            node.options.length = 0;
+            var optionsList =  param["f_options"];
+            for (i=0; i<= optionsList.length-1; i++) {
+              node.options[i] = new Option(optionsList[i].text, optionsList[i].value)
+            }
+          } else if(type == "label") {
+            node.innerHTML = param["f_text"];
+          } else if(type == "fieldset") {
+            if(outparam.f_text != "") {
+              if(node.firstChild.tagName.toLowerCase()=="legend")
+                node.firstChild.innerHTML = param["f_text"];
+            } else {}// not implemented jet
+          } else if((type == "checkbox") || (type == "radio")) { //input
+              if(param["f_checked"]!="")
+                node.checked = true;
+              else
+                node.checked = false;
+          } else {
+            if(param["f_onclick"]){
+              node.onclick = "";
+              if(param["f_onclick"]!="")
+                node.onclick = param["f_onclick"];
+            }
+          }
+        } else {
+          //create Element
+          var text = "";
+          for (field in param) {
+            if (!param[field]) continue;
+            if ((param[field]=="") || (field=="f_text")|| (field=="f_options"))continue;
+            text += " " + field.substring(2,20) + '="' + param[field] + '"';
+          }
+
+          if(type == "textarea") {
+            text = '<textarea' + text + '>' + param["f_text"] + '</textarea>';
+          } else if(type == "select") {
+            text = '<select' + text + '>';
+            var optionsList =  param["f_options"];
+            for (i=0; i<= optionsList.length-1; i++) {
+              text += '<option value="'+optionsList[i].value+'">'+optionsList[i].text+'</option>';
+            }
+            text += '</select>';
+          } else if(type == "label") {
+            text = '<label' + text + '>' + param["f_text"] + '</label>';
+          } else if(type == "fieldset") {
+            text = '<fieldset' + text + '>';
+            if (param["f_legend"] != "") text += '<legend>' + param["f_text"] + '</legend>';
+            text += '</fieldset>';
+          } else {
+            text = '<input type="'+type+'"' + text + '>';
+          }
+          editor.insertHTML(text);
+        }
+      }
+    }, outparam);
+  }
+};
Index: /branches/new-dialogs-merge/plugins/Forms/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/Forms/lang/pt_br.js (revision 901)
@@ -0,0 +1,83 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Access Key:": "Tecla de Acesso:",
+  "Action URL:": "Ação - URL:",
+  "Button Script": "Script de Botão",
+  "Cancel": "Cancelar",
+  "Checked": "Definido",
+  "Columns:": "Colunas:",
+  "Default text (optional)": "Texto padrão (opcional)",
+  "Dimensions": "Dimensões",
+  "Disabled": "Desativado",
+  "Encoding:": "Codificação:",
+  "For Control:": "Para Controle:",
+  "Form": "Formulário",
+  "Form Element: FIELDSET": "Elemento do formulário: FIELDSET",
+  "Form Element: INPUT": "Elemento do formulário: INPUT",
+  "Form Element: LABEL": "Elemento do formulário: LABEL",
+  "Form Element: SELECT": "Elemento do formulário: SELECT",
+	"Form Element: TEXTAREA": "Elemento do formulário: TEXTAREA",
+  "Form Name:": "Nome do Formulário:",
+  "Form handler script": "Script do Formulário",
+  "HTML-Form to CGI (default)": "Formulário para CGI (padrão)",
+  "Hard": "Difícil",
+  "Height in number of rows": "Altura em número de linhas",
+  "Image URL:": "URL da imagem:",
+  "Image source": "Imagem de Origem",
+  "Initial Text:": "Texto Inicial:",
+  "Insert/Edit Form": "Inserir/Editar Formulário",
+  "Insert/Edit Form Element FIELDSET": "Inserir/Editar Elemento FIELDSET",
+  "Insert/Edit Form Element INPUT": "Inserir/Editar Elemento INPUT",
+  "Insert/Edit Form Element LABEL": "Inserir/Editar Elemento LABEL",
+  "Insert/Edit Form Element SELECT": "Inserir/Editar Elemento SELECT",
+  "Insert/Edit Form Element TEXTAREA": "Inserir/Editar Elemento TEXTAREA",
+  "Javascript for button click": "Javascript para botão de clicar",
+  "Label:": "Etiqueta:",
+  "Legend:": "Legenda:",
+  "Max length:": "Comprimento Máx.:",
+  "Maximum number of characters accepted": "Máximo número de caracteres aceitos",
+  "Method:": "Método:",
+  "Name": "Nome",
+  "Name of the form input": "Nome do formulário de entrada",
+  "Name of the form select": "Nome do formulário de seleção",
+  "Name/ID:": "Nome/ID:",
+  "OK": "OK",
+  "Off": "Desligado",
+  "Options": "Opções",
+  "Physical": "Físico",
+  "Please enter a Label": "Por favor, entre uma Etiqueta",
+  "Post": "Post",
+  "Read Only": "Somente Leitura",
+  "Rows:": "Linhas:",
+  "Size of text box in characters": "Tamanho da caixa de texto em caracteres",
+  "Size:": "Tamanho:",
+  "Soft": "Fácil",
+  "Tab Index:": "Ordem de Tabulação:",
+  "Target Frame:": "Frame de destino:",
+  "Text:": "Texto:",
+  "URL of image": "URL da imagem",
+  "Value of the form input": "Valor do formulário de entrada",
+  "Value:": "Valor:",
+  "Virtual": "Virtual",
+  "Width in number of characters": "Largura em número de caracteres",
+  "Wrap Mode:": "Modo de quebras:",
+  "You must enter a Name": "Você precisa entrar com um Nome",
+  "multipart Form Data (File-Upload)": "Formulário de dados multipart (Enviar arquivo)",
+  "name of the textarea": "nome da área de texto",
+  "normal": "normal",
+  "nowrap": "sem quebras"
+}
Index: /branches/new-dialogs-merge/plugins/Forms/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/Forms/lang/nl.js (revision 872)
@@ -0,0 +1,87 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Form": "Formulier",
+  "Textarea": "Tekstgebied",
+  "Selection Field": "Selectielijst",
+  "Checkbox": "Checkbox",
+  "Radio Button": "Radio knop",
+  "Text Field": "Tekstveld",
+  "Password Field": "Wachtwoordveld",
+  "File Field": "Bestandsveld",
+  "Submit Button": "Verzend knop",
+  "Reset Button": "Wis knop",
+  "Image Button": "Afbeelding knop",
+  "Button": "Knop",
+  "Hidden Field": "Verborgen veld",
+  "Label": "Label",
+  "Field Set": "Veldset",
+  "Form Element: INPUT": "Formulier element: INPUT",
+  "Form Element: SELECT": "Formulier element: SELECT",
+  "Form Element: TEXTAREA": "Formulier element: TEXTAREA",
+  "Form Element: LABEL": "Formulier element: LABEL",
+  "Form Element: FIELDSET": "Formulier element: FIELDSET",
+  "Form Name:": "Formulier naame:",
+  "Form handler script": "Formulier script",
+  "Action URL:": "Actie URL:",
+  "Method:": "Methode:",
+  "Post": "POST",
+  "Get": "GET",
+  "Encoding:": "Encodering:",
+  "HTML-Form to CGI (default)": "HTML formulier naar CGI (standaard)",
+  "multipart Form Data (File-Upload)": "Multipart formulier data(Bestands upload)",
+  "Target Frame:": "Doel venster:",
+  "Name/ID:": "Naam/ID:",
+  "Value:": "Waarde:",
+  "Disabled": "Uitgeschakeld",
+  "Checked": "Checked",
+  "Tab Index:": "Tab volgorde:",
+  "Access Key:": "Toegangs toets:",
+  "Read Only": "Alleen lezen",
+  "Dimensions": "Dimenties",
+  "Size:": "Grootte:",
+  "Max length:": "Maximale lengte:",
+  "Button Script": "Knop script",
+  "'onClick'=": "'onClick'=",
+  "Image source": "Afbeelding bron",
+  "Image URL:": "Afbeelding URL:",
+  "Multiple Select": "Meerdere selectie mogelijkheden",
+  "Options": "Opties",
+  "Lable:": "Label:",
+  "Move Up": "Omhoog",
+  "Move Down": "Omlaag",
+  "Delete": "Verwijderen",
+  "Add": "Toevoegen",
+  "Columns:": "Kolommen:",
+  "Rows:": "Rijen:",
+  "Wrap Mode:": "Terugloop:",
+  "Off": "Uit",
+  "Soft": "Zacht",
+  "Hard": "Hard",
+  "Physical": "Fysiek",
+  "Virtual": "Virtueel",
+  "normal": "normaal",
+  "nowrap": "geen terugloop",
+  "pre": "pre",
+  "Initial Text:": "Start tekst:",
+  "Text:": "Tekst:",
+  "For Control:": "Voor controle:",
+  "Legend:": "Legend:",
+  "Cancel": "Annuleren",
+  "Name": "Naame",
+  "Name of the form input": "Naam van formulier invoer",
+  "Value of the form input": "Waarde van formulier invoer",
+  "Size of text box in characters": "Grootte van tekstveld in tekens",
+  "Maximum number of characters accepted": "Maximaal aantal tekens toegestaan",
+  "Javascript for button click": "Knop klik met JavaScript",
+  "URL of image": "Afbeelding URL",
+  "Name of the form select": "Naam van formulier select",
+  "name of the textarea": "Naam van tekst gebied",
+  "Width in number of characters": "Breedte in aantal tekens",
+  "Height in number of rows": "Hoogte in aantal tekens",
+  "Default text (optional)": "Standaard tekst (optioneel)",
+  "You must enter the form name": "Voer een formulier Naam in",
+  "You must enter a Name": "Voer een Naam in",
+  "Please enter a Label": "Voer een Label in"
+};
Index: /branches/new-dialogs-merge/plugins/Forms/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/Forms/lang/ja.js (revision 715)
@@ -0,0 +1,93 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Form": "ãã©ãŒã ",
+  "Textarea": "ãã­ã¹ããšãªã¢",
+  "Selection Field": "éžæè¢ãã£ãŒã«ã",
+  "Checkbox": "ãã§ãã¯ããã¯ã¹",
+  "Radio Button": "ã©ãžãªãã¿ã³",
+  "Text Field": "ãã­ã¹ããã£ãŒã«ã",
+  "Password Field": "ãã¹ã¯ãŒããã£ãŒã«ã",
+  "File Field": "ãã¡ã€ã«ãã£ãŒã«ã",
+  "Submit Button": "éä¿¡ãã¿ã³",
+  "Reset Button": "ãªã»ãããã¿ã³",
+  "Image Button": "ç»åãã¿ã³",
+  "Button": "ãã¿ã³",
+  "Hidden Field": "éè¡šç€ºãã£ãŒã«ã",
+  "Label": "ã©ãã«",
+  "Field Set": "ãã£ãŒã«ãã»ãã",
+  "Form Element: INPUT": "ãã©ãŒã èŠçŽ : INPUT",
+  "Form Element: SELECT": "ãã©ãŒã èŠçŽ : SELECT",
+  "Form Element: TEXTAREA": "ãã©ãŒã èŠçŽ : TEXTAREA",
+  "Form Element: LABEL": "ãã©ãŒã èŠçŽ : LABEL",
+  "Form Element: FIELDSET": "ãã©ãŒã èŠçŽ : FIELDSET",
+  "Form Name:": "ãã©ãŒã å:",
+  "Form handler script": "ãã©ãŒã åŠçã¹ã¯ãªãã",
+  "Action URL:": "ã¢ã¯ã·ã§ã³URL:",
+  "Method:": "ã¡ãœãã:",
+  "Post": "POST",
+  "Get": "GET",
+  "Encoding:": "ãšã³ã³ãŒã:",
+  "HTML-Form to CGI (default)": "HTMLãã©ãŒã ããCGIãž(ããã©ã«ã)",
+  "multipart Form Data (File-Upload)": "ãã«ãããŒã(ãã¡ã€ã«ã¢ããã­ãŒãçš)",
+  "Target Frame:": "ã¿ãŒã²ãã:",
+  "Name/ID:": "åå/ID:",
+  "Value:": "å€:",
+  "Disabled": "ç¡å¹",
+  "Checked": "ãã§ãã¯æžã¿",
+  "Tab Index:": "ã¿ãé åº:",
+  "Access Key:": "ã¢ã¯ã»ã¹ã­ãŒ:",
+  "Read Only": "èª­ã¿åãå°çš",
+  "Dimensions": "å€§ãã",
+  "Size:": "ãµã€ãº:",
+  "Max length:": "æå€§é·:",
+  "Button Script": "ãã¿ã³ã¹ã¯ãªãã",
+  "'onClick'=": "'onClick'=",
+  "Image source": "ç»åãœãŒã¹",
+  "Image URL:": "ç»åURL:",
+  "Multiple Select": "è€æ°éžæ",
+  "Options": "éžæè¢",
+  "Lable:": "ã©ãã«:",
+  "Move Up": "äžãž",
+  "Move Down": "äžãž",
+  "Delete": "åé€",
+  "Add": "è¿œå ",
+  "Columns:": "åæ°:",
+  "Rows:": "è¡æ°:",
+  "Wrap Mode:": "æãè¿ã:",
+  "Off": "ãªã",
+  "Soft": "ãœãã",
+  "Hard": "ããŒã",
+  "Physical": "ç©çç",
+  "Virtual": "ä»®æ³",
+  "normal": "æšæº",
+  "nowrap": "æãè¿ããªã",
+  "pre": "ãã©ãŒãããæžã¿",
+  "Initial Text:": "åæãã­ã¹ã:",
+  "Text:": "ãã­ã¹ã:",
+  "For Control:": "å¶åŸ¡å¯Ÿè±¡:",
+  "Legend:": "ã°ã«ãŒãå:",
+  "Cancel": "äž­æ­¢",
+  "Name": "åå",
+  "Name of the form input": "ãã©ãŒã å
+¥åã®åå",
+  "Value of the form input": "ãã©ãŒã å
+¥åã®å€",
+  "Size of text box in characters": "æå­æ°ã«ãããã­ã¹ãããã¯ã¹ã®å€§ãã",
+  "Maximum number of characters accepted": "å
+¥åå¯èœãªæå€§æå­æ°",
+  "Javascript for button click": "ãã¿ã³ã¯ãªãã¯æã®JavaScritp",
+  "URL of image": "ç»åã®URL",
+  "Name of the form select": "",
+  "name of the textarea": "ãã­ã¹ããšãªã¢ã®åå",
+  "Width in number of characters": "æå­æ°ã«ããå¹
+",
+  "Height in number of rows": "è¡æ°ã«ããé«ã",
+  "Default text (optional)": "ãã­ã¹ãåæå€(ãªãã·ã§ã³)",
+  "You must enter the form name": "ãã©ãŒã åãå¿
+èŠã§ã",
+  "You must enter a Name": "ååãå¿
+èŠã§ã",
+  "Please enter a Label": "ã©ãã«ãå
+¥åããŠãã ãã"
+};
Index: /branches/new-dialogs-merge/plugins/Forms/popups/textarea.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/popups/textarea.html (revision 854)
+++ /branches/new-dialogs-merge/plugins/Forms/popups/textarea.html (revision 854)
@@ -0,0 +1,112 @@
+<html>
+
+<head>
+  <title>Insert/Edit Form Element TEXTAREA</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+
+var fields = ["f_name", "f_text", "f_cols", "f_rows", "f_wrap", "f_tabindex", "f_accesskey", "f_readOnly", "f_disabled"];
+
+function Init() {
+  __dlg_translate("Forms");
+  __dlg_init(null,{width:260, height:380});
+  var param = window.dialogArguments;
+  for (var i in fields) {
+    switch (fields[i]) {
+    case "f_readOnly":
+    case "f_disabled":
+      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true);  break;
+    default:
+      document.getElementById(fields[i]).value = param[fields[i]]; break;
+    }
+  }
+  document.getElementById("f_name").focus();
+}
+
+function onOK() {
+  var el = document.getElementById("f_name");
+  if (!el.value) {
+    alert(Xinha._lc("You must enter a Name","Forms"));
+    el.focus();
+    return false;
+  }
+  // pass data back to the calling window
+  var param = new Object();
+  for (var i in fields) {
+    switch (fields[i]) {
+    case "f_readOnly":
+    case "f_disabled":
+      if(Xinha.is_ie)
+        param[fields[i]] = (document.getElementById(fields[i]).checked)?true:"";
+      else
+        param[fields[i]] = (document.getElementById(fields[i]).checked)?fields[i].substring(2,20):"";
+      break;
+    default:
+      param[fields[i]] = document.getElementById(fields[i]).value; break;
+    }
+  }
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+</script>
+</head>
+
+<body class="dialog" onload="Init()">
+<div id="f_type" class="title">Form Element: TEXTAREA</div>
+<form action="" method="get">
+  <div class="fr">Name/ID:</div>
+  <input type="text" name="name" id="f_name" title="name of the textarea" />
+  <p />
+  <fieldset>
+  <legend>Dimensions</legend>
+    <div class="fr">Columns:</div>
+    <input type="text" name="cols" id="f_cols" size="5" title="Width in number of characters" />
+    <p />
+    <div class="fr">Rows:</div>
+    <input type="text" name="rows" id="f_rows" size="5" title="Height in number of rows" />
+    <p />
+  </fieldset>
+  <div class="space"></div>
+  <div class="fr">Wrap Mode:</div>
+  <select name="wrap" id="f_wrap">
+    <option value=""></option>
+    <option value="off">Off</option>
+    <option value="soft">Soft</option>
+    <option value="hard">Hard</option>
+    <option value="physical">Physical</option>
+    <option value="virtual">Virtual</option>
+    <option value="normal">normal</option>
+    <option value="nowrap">nowrap</option>
+    <option value="pre">pre</option>
+  </select>
+  <p />
+  <div class="fr">Read Only</div>
+  <input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" />
+  <p />
+  <div class="fr">Disabled</div>
+  <input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
+  <p />
+  <div class="fr">Tab Index:</div>
+  <input type="text" name="tabindex" id="f_tabindex" />
+  <p />
+  <div class="fr">Access Key:</div>
+  <input type="text" name="accesskey" id="f_accesskey" />
+  <p />
+
+  <div class="fr">Initial Text:</div>
+  <input type="text" name="text" id="f_text" title="Default text (optional)" />
+  <div id="buttons">
+    <button type="button" name="ok" onclick="return onOK();">OK</button>
+    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+  </div>
+</form>
+
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Forms/popups/fieldset.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/popups/fieldset.html (revision 854)
+++ /branches/new-dialogs-merge/plugins/Forms/popups/fieldset.html (revision 854)
@@ -0,0 +1,45 @@
+<html>
+
+<head>
+  <title>Insert/Edit Form Element FIELDSET</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+function Init() {
+  __dlg_translate("Forms");
+  __dlg_init(null,{width:260, height:150});
+  var param = window.dialogArguments;
+  document.getElementById("f_text").value = param["f_text"];
+  document.getElementById("f_text").focus();
+}
+
+function onOK() {
+  // pass data back to the calling window
+  var param = new Object();
+  param["f_text"] = document.getElementById("f_text").value;
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+</script>
+</head>
+
+<body class="dialog" onload="Init()">
+  <div id="f_type" class="title">Form Element: FIELDSET</div>
+  <form action="" method="get">
+    <div class="fr">Legend:</div>
+    <input type="text" name="text" id="f_text" />
+    <p />
+    <div id="buttons">
+      <button type="button" name="ok" onclick="return onOK();">OK</button>
+      <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+    </div>
+  </form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Forms/popups/input.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/popups/input.html (revision 854)
+++ /branches/new-dialogs-merge/plugins/Forms/popups/input.html (revision 854)
@@ -0,0 +1,179 @@
+<html>
+
+<head>
+  <title>Insert/Edit Form Element INPUT</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+var fields = null;
+var type;
+function Init() {
+  __dlg_translate("Forms");
+  __dlg_init();
+  var param = window.dialogArguments;
+  type = param.f_type;
+  document.getElementById("f_type").innerHTML = Xinha._lc('Form Element: INPUT', "Forms") + '(' + type + ')';
+  document.getElementById("txt").style.display = "none";
+  document.getElementById("chk").style.display = "none";
+  document.getElementById("btn").style.display = "none";
+  document.getElementById("img").style.display = "none";
+  switch (type) {
+    case "text":
+    case "password":
+      fields = ["f_name", "f_value", "f_readOnly", "f_disabled", "f_tabindex", "f_accesskey", "f_size", "f_maxLength"];
+      height = 350;
+      document.getElementById("txt").style.display = "block";
+      break;
+    case "checkbox":
+    case "radio":
+      fields = ["f_name", "f_value", "f_checked", "f_disabled", "f_tabindex", "f_accesskey"];
+      document.getElementById("chk").style.display = "block";
+      height = 280;
+      break;
+    case "button":
+      fields = ["f_name", "f_value", "f_disabled", "f_onclick", "f_tabindex", "f_accesskey"];
+      document.getElementById("btn").style.display = "block";
+      height = 300;
+      break;
+    case "file":
+      fields = ["f_name", "f_disabled", "f_tabindex", "f_accesskey"];
+      document.getElementById("f_value").disabled = true;
+      height = 280;
+      break;
+    case "image":
+      fields = ["f_name", "f_disabled", "f_tabindex", "f_accesskey", "f_src"];
+      document.getElementById("img").style.display = "block";
+      document.getElementById("f_value").disabled = true;
+      height = 300;
+      break;
+    case "reset":
+    case "submit":
+      fields = ["f_name", "f_value", "f_disabled", "f_tabindex", "f_accesskey"];
+      height =260;
+      break;
+    case "hidden":
+      fields = ["f_name", "f_value"];
+      document.getElementById("f_disabled").disabled = true;
+      document.getElementById("f_tabindex").disabled = true;
+      document.getElementById("f_accesskey").disabled = true;
+      height =260;
+      break;
+  }
+  for (var i in fields) {
+    switch (fields[i]) {
+    case "f_readOnly":
+    case "f_disabled":
+    case "f_checked":
+      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break;
+    default:
+      document.getElementById(fields[i]).value = param[fields[i]]; break;
+    }
+  }
+  window.resizeTo(320,height);
+  document.getElementById("f_name").focus();
+}
+
+function onOK() {
+  var el = document.getElementById("f_name");
+  if (!el.value) {
+    alert(Xinha._lc("You must enter a Name","Forms"));
+    el.focus();
+    return false;
+  }
+  // pass data back to the calling window
+  var param = new Object();
+  for (var i in fields) {
+    switch (fields[i]) {
+    case "f_readOnly":
+    case "f_disabled":
+    case "f_checked":
+      if(Xinha.is_ie)
+        param[fields[i]] = (document.getElementById(fields[i]).checked)?true:"";
+      else
+        param[fields[i]] = (document.getElementById(fields[i]).checked)?fields[i].substring(2,20):"";
+      break;
+    default:
+      param[fields[i]] = document.getElementById(fields[i]).value; break;
+    }
+  }
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+</script>
+
+</head>
+
+<body class="dialog" onload="Init()">
+  <div id="f_type" class="title"></div>
+  <form action="" method="get">
+    <div class="fr">Name/ID:</div>
+    <input type="text" name="name" id="f_name" title="Name of the form input" />
+    <p />
+    <div class="fr">Value:</div>
+    <input type="text" name="value" id="f_value" title="Value of the form input" />
+    <p />
+    <div class="fr">Disabled</div>
+    <input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
+    <p />
+
+  <div id="chk">
+    <div class="fr">Checked</div>
+      <input name="checked" id="f_checked" type="checkbox" />
+    <p />
+  </div>
+
+    <div class="fr">Tab Index:</div>
+    <input type="text" name="tabindex" id="f_tabindex" />
+    <p />
+    <div class="fr">Access Key:</div>
+    <input type="text" name="accesskey" id="f_accesskey" />
+    <p />
+
+  <div id="txt">
+    <div class="fr">Read Only</div>
+    <input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" />
+    <p />
+
+    <fieldset>
+    <legend>Dimensions</legend>
+      <div class="space"></div>
+      <div class="fr">Size:</div>
+      <input type="text" name="size" id="f_size" size="5" title="Size of text box in characters" />
+      <div class="space"></div>
+      <div class="fr">Max length:</div>
+      <input type="text" name="maxLength" id="f_maxLength" size="5"	title="Maximum number of characters accepted" />
+      <div class="space"></div>
+    </fieldset>
+  </div>
+  <div id="btn">
+    <fieldset>
+    <legend> Button Script</legend>
+      <div class="space"></div>
+      <div class="fr">'onClick'=</div>
+      <input type="text" name="onClick" id="f_onclick" title="Javascript for button click" />
+      <div class="space"></div>
+    </fieldset>
+  </div>
+  <div id="img">
+    <fieldset>
+    <legend>Image source</legend>
+      <div class="space"></div>
+      <div class="fr">Image URL:</div>
+      <input type="text" name="src" id="f_src" title="URL of image" />
+      <div class="space"></div>
+    </fieldset>
+  </div>
+  <div id="buttons">
+    <button type="button" name="ok" onclick="return onOK();">OK</button>
+    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+  </div>
+</form>
+
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Forms/popups/label.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/popups/label.html (revision 854)
+++ /branches/new-dialogs-merge/plugins/Forms/popups/label.html (revision 854)
@@ -0,0 +1,58 @@
+<html>
+
+<head>
+  <title>Insert/Edit Form Element LABEL</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+var fields = ["f_text","f_for","f_accesskey"];
+
+function Init() {
+  __dlg_translate("Forms");
+  __dlg_init(null,{width:260, height:220});
+  var param = window.dialogArguments;
+  for (var i in fields) {
+    document.getElementById(fields[i]).value = param[fields[i]];
+  }
+  document.getElementById("f_text").focus();
+}
+
+function onOK() {
+  // pass data back to the calling window
+    // pass data back to the calling window
+  var param = new Object();
+  for (var i in fields) {
+    param[fields[i]] = document.getElementById(fields[i]).value;
+  }
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+</script>
+</head>
+
+<body class="dialog" onload="Init()">
+  <div id="f_type" class="title">Form Element: LABEL</div>
+  <form action="" method="get">
+    <div class="fr">Text:</div>
+    <input type="text" name="text" id="f_text" />
+    <p />
+    <div class="fr">For Control:</div>
+    <input type="text" name="for" id="f_for" />
+    <p />
+    <div class="fr">Access Key:</div>
+    <input type="text" name="accesskey" id="f_accesskey" />
+    <p />
+    <div id="buttons">
+      <button type="button" name="ok" onclick="return onOK();">OK</button>
+      <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+    </div>
+  </form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Forms/popups/select.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/popups/select.html (revision 987)
+++ /branches/new-dialogs-merge/plugins/Forms/popups/select.html (revision 987)
@@ -0,0 +1,208 @@
+<html>
+
+<head>
+  <title>Insert/Edit Form Element SELECT</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+var fields = ["f_name", "f_size", "f_tabindex", "f_multiple", "f_disabled"];
+
+function Init() {
+  __dlg_translate("Forms");
+  __dlg_init(null,{width:360, height:400});
+  var param = window.dialogArguments;
+  for (var i in fields) {
+    switch (fields[i]) {
+    case "f_multiple":
+    case "f_disabled":
+      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break;
+    case "f_size":
+      document.getElementById(fields[i]).value = (param[fields[i]]<=0)?"":param[fields[i]]; break;
+    default:
+      document.getElementById(fields[i]).value = param[fields[i]]; break;
+    }
+  }
+  for (var i=0; i<=param.f_options.length-1; i++) {
+    document.getElementById("f_select").options[i] = new Option(param.f_options[i].text, param.f_options[i].value);
+  }
+  document.getElementById("f_name").focus();
+}
+
+function onOK() {
+  var el = document.getElementById("f_name");
+  if (!el.value) {
+    alert(Xinha._lc("You must enter a Name","Forms"));
+    el.focus();
+    return false;
+  }
+  // pass data back to the calling window
+  var param = new Object();
+  for (var i in fields) {
+    switch (fields[i]) {
+    case "f_multiple":
+      if (document.getElementById("f_size").value=="1")
+        param["f_multiple"] = "";
+      else
+        param["f_multiple"] = (document.getElementById(fields[i]).checked)?"multiple":"";
+      break;
+    case "f_disabled":
+      param[fields[i]] = (document.getElementById(fields[i]).checked)?"disabled":""; break;
+    default:
+      param[fields[i]] = document.getElementById(fields[i]).value; break;
+    }
+  }
+  function optionValues(text,value) {
+    this.text = text;
+    this.value = value;
+  }
+  optionNodes = new Array(); // for option text/value pairs
+  for (var i=0; i<= document.getElementById("f_select").options.length-1; i++) {
+    optionNodes[i] = new optionValues(document.getElementById("f_select").options[i].text, document.getElementById("f_select").options[i].value);
+  }
+  param["f_options"] = optionNodes;
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+
+//functions to build select options list
+//Populates Label and Value fields with selected option values
+function getValues(){
+  var d = document;
+  d.getElementById("f_optionvalue").value = d.getElementById("f_select").options[d.getElementById("f_select").selectedIndex].value;
+  d.getElementById("f_optiontext").value = d.getElementById("f_select").options[d.getElementById("f_select").selectedIndex].text;
+  d.getElementById("f_update").value ="Update Option";
+}
+
+//Add or update options to the select box
+function addItem(item) {
+  var d = document;
+  if (item.f_optiontext.value =="") {alert(Xinha._lc("Please enter a Label","Forms"));}
+  else {
+    if (d.getElementById("f_select").options.selectedIndex != -1) { //update item
+      var indx = d.getElementById("f_select").options.selectedIndex;
+      d.getElementById("f_select").options[indx].text=d.getElementById("f_optiontext").value;
+      d.getElementById("f_select").options[indx].value=d.getElementById("f_optionvalue").value;
+    } else { //add new item
+      var newItem = d.getElementById("f_select").options.length++;
+      d.getElementById("f_select").options[newItem].text=d.getElementById("f_optiontext").value;
+      d.getElementById("f_select").options[newItem].value=d.getElementById("f_optionvalue").value;
+    }
+    d.getElementById("f_select").selectedIndex = -1; //deselect
+    d.getElementById("f_optiontext").value="";//clean up
+    d.getElementById("f_optionvalue").value="";
+    d.getElementById("f_update").value ="Add Option";
+    d.getElementById("f_optiontext").focus();
+  }
+}
+//Clears selected option
+function deleteItem() {
+  var d = document;
+  for (var i = d.getElementById("f_select").options.length - 1; i>=0; i--) {
+    var opt = d.getElementById("f_select").options[i];
+    if (opt.selected) {
+      d.getElementById("f_select").options[i] = null;
+    }
+  }
+  d.getElementById("f_select").selectedIndex = -1;
+  d.getElementById("f_optiontext").value="";
+  d.getElementById("f_optionvalue").value="";
+  d.getElementById("f_optiontext").focus();
+}
+//Moves selected option up
+function moveOptionUp() {
+  var d = document;
+  for (i=0; i<d.getElementById("f_select").options.length; i++) {
+    if (d.getElementById("f_select").options[i].selected) {
+      if (i != 0 && !d.getElementById("f_select").options[i-1].selected) {
+        swapOptions(d.getElementById("f_select"),i,i-1);
+        d.getElementById("f_select").options[i-1].selected = true;
+      }
+    }
+  }
+}
+//Moves selected option down
+function moveOptionDown() {
+  var d = document;
+  for (i=d.getElementById("f_select").options.length-1; i>=0; i--) {
+    if (d.getElementById("f_select").options[i].selected) {
+      if (i != (d.getElementById("f_select").options.length-1) && ! d.getElementById("f_select").options[i+1].selected) {
+        swapOptions(d.getElementById("f_select"),i,i+1);
+        d.getElementById("f_select").options[i+1].selected = true;
+      }
+    }
+  }
+}
+
+function swapOptions(obj,i,j) {
+  var o = obj.options;
+  var i_selected = o[i].selected;
+  var j_selected = o[j].selected;
+  var temp = new Option(o[i].text, o[i].value);
+  var temp2= new Option(o[j].text, o[j].value);
+  o[i] = temp2;
+  o[j] = temp;
+  o[i].selected = j_selected;
+  o[j].selected = i_selected;
+}
+</script>
+</head>
+
+<body class="dialog" onload="Init()">
+  <div id="f_type" class="title">Form Element: SELECT</div>
+  <form action="" method="get">
+    <div class="fr">Name/ID:</div>
+    <input type="text" name="name" id="f_name" title="Name of the form select" />
+    <p />
+    <div class="fr">Size:</div>
+    <input name="size" id="f_size" type="text" value="" size="15" />
+    <p />
+    <div class="fr"><nobr>Multiple Select</nobr></div>
+    <input name="multiple" id="f_multiple" type="checkbox" value="multiple" />
+    <p />
+    <div class="fr">Disabled</div>
+    <input type="checkbox" name="disabled" id="f_disabled" value="disabled" />
+    <p />
+    <div class="fr">Tab Index:</div>
+    <input type="text" name="tabindex" id="f_tabindex" />
+    <p />
+    <div class="space"></div>
+    <fieldset id="fldLayout">
+    <legend>Options</legend>
+      <table border="0" cellspacing="0">
+      <tr>
+      <td style="text-align: right;">
+        <select name="select" id="f_select" Size="6" onchange="getValues();"  style="width:16em">
+        </select>
+      </td>
+      <td style="text-align: center;">
+        <input type="button" name="up" value="Move Up" style="width:6em" onClick="moveOptionUp()"><br />
+        <input type="button" name="down" value="Move Down" style="width:6em" onClick="moveOptionDown()"><br />
+        <input type="button" name="delete" value="Delete" style="width:6em" onClick="deleteItem();">
+      </td>
+      </tr>
+      </table>
+      <div class="space"></div>
+      <table border="0" cellspacing="0">
+      <tr>
+        <td style="text-align: right;">Label:</td>
+        <td><input type="text" id="f_optiontext" name="optionText" value="" size="15"></td>
+        <td style="text-align: right;">Value:</td>
+        <td><input name="optionValue" id="f_optionvalue" type="text" value="" size="15"></td>
+        <td><input type="button" name="update" id="f_update" value="Add" onclick="addItem(document.forms[0])"></td>
+      </tr>
+      </table>
+    </fieldset>
+    <div id="buttons">
+      <button type="button" name="ok" onclick="return onOK();">OK</button>
+      <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+    </div>
+  </form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Forms/popups/form.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/popups/form.html (revision 854)
+++ /branches/new-dialogs-merge/plugins/Forms/popups/form.html (revision 854)
@@ -0,0 +1,89 @@
+<html>
+
+<head>
+  <title>Insert/Edit Form</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+
+var fields = ["f_name", "f_action", "f_method", "f_enctype", "f_target"];
+
+function Init() {
+  __dlg_translate("Forms");
+  __dlg_init(null,{width:360, height:280});
+  var param = window.dialogArguments;
+  for (var i in fields) {
+    document.getElementById(fields[i]).value = param[fields[i]];
+  }
+  document.getElementById("f_name").focus();
+}
+
+function onOK() {
+  var required = {
+    "f_name": "You must enter the form name"
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(Xinha._lc(required[i],"Forms"));
+      el.focus();
+      return false;
+    }
+  }
+  // pass data back to the calling window
+  var param = new Object();
+  for (var i in fields) {
+    param[fields[i]] = document.getElementById(fields[i]).value;
+  }
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+</script>
+</head>
+
+<body class="dialog" onload="Init()">
+<div class="title">Form</div>
+<form action="" method="get">
+  <div class="fr">Form Name:</div>
+  <input type="text" name="name" id="f_name" size="20" title="Name" />
+  <p />
+
+  <fieldset>
+  <legend>Form handler script</legend>
+  <div class="space"></div>
+  <div class="fr">Action URL:</div>
+  <input name="action" id="f_action" type="text" size="30">
+  <p />
+  <div class="fr">Method:</div>
+  <select name="f_method" id="f_method">
+    <option value=""></option>
+    <option value="post">Post</option>
+    <option value="get">Get</option>
+  </select>
+  <div class="space"></div>
+  <div class="fr">Encoding:</div>
+  <select name="enctype" id="f_enctype">
+    <option value=""></option>
+    <option value="application/x-www-form-urlencoded">HTML-Form to CGI (default)</option>
+    <option value="multipart/form-data">multipart Form Data (File-Upload)</option>
+  </select>
+  <p />
+  <div class="fr">Target Frame:</div>
+  <input name="target" id="f_target" type="text" size="30">
+  <p />
+  </fieldset>
+
+<div id="buttons">
+  <button type="button" name="ok" onclick="return onOK();">OK</button>
+  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Forms/forms.css
===================================================================
--- /branches/new-dialogs-merge/plugins/Forms/forms.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/Forms/forms.css (revision 677)
@@ -0,0 +1,3 @@
+form {
+  border: 1px dotted red;
+}
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/insert-smiley.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/insert-smiley.js (revision 904)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/insert-smiley.js (revision 904)
@@ -0,0 +1,52 @@
+/*---------------------------------------*\
+ Insert Smiley Plugin for Xinha
+ -----------------------------------------
+ author: Ki Master George
+ e-mail: kimastergeorge@gmail.com
+\*---------------------------------------*/
+
+function InsertSmiley(editor) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+
+  // register the toolbar buttons provided by this plugin
+  cfg.registerButton({
+    id       : "insertsmiley",
+    tooltip  : this._lc("Insert Smiley"),
+    image    : editor.imgURL("ed_smiley.gif", "InsertSmiley"),
+    textMode : false,
+    action   : function(editor) {
+                 self.buttonPress(editor);
+               }
+  });
+  cfg.addToolbarElement("insertsmiley", "inserthorizontalrule", 1);
+}
+
+InsertSmiley._pluginInfo = {
+  name          : "InsertSmiley",
+  version       : "1.0",
+  developer     : "Ki Master George",
+  developer_url : "http://kimastergeorge.i4host.com/",
+  c_owner       : "Ki Master George",
+  sponsor       : "Ki Master George",
+  sponsor_url   : "http://kimastergeorge.i4host.com/",
+  license       : "htmlArea"
+};
+
+InsertSmiley.prototype._lc = function(string) {
+  return Xinha._lc(string, 'InsertSmiley');
+};
+Xinha.Config.prototype.InsertSmiley=  {
+  smileyURL : "http://www.x-webservice.net/storage/xinha/plugins/InsertSmiley/"
+};
+
+InsertSmiley.prototype.buttonPress = function(editor) {
+  var self = this;
+  var sel = editor.getSelectedHTML().replace(/(<[^>]*>|&nbsp;|\n|\r)/g,"");
+  var param = {};
+  param.editor = editor;
+  editor._popupDialog("plugin://InsertSmiley/insertsmiley", function(param) {
+    editor.insertHTML("<img src=\"" + editor.config.InsertSmiley.smileyURL + param.smileyfile + "\" alt=\"Smiley\" />");
+  }, param);
+};
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/lang/pt_br.js (revision 901)
@@ -0,0 +1,19 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Cancel": "Cancelar",
+  "Insert Smiley": "Inserir Smiley"
+}
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/lang/fr.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{ 
+	"Insert Smiley": "InsÃ©rer un smiley",
+	"Smiley": "Smiley",
+	"Cancel": "Annuler"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/lang/de.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+{ 
+	"Insert Smiley": "Smiley einfÃŒgen",
+	"Smiley": "Smiley",
+	"Cancel": "Abbrechen"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/lang/nl.js (revision 872)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{ 
+  "Insert Smiley": "Smiley invoegen",
+  "Smiley": "Smiley",
+  "Cancel": "Annuleren"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/lang/ja.js (revision 715)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+	"Insert Smiley": "ã¹ãã€ãªãŒã®æ¿å
+¥",
+	"Smiley": "ã¹ãã€ãªãŒ",
+	"Cancel": "äž­æ­¢"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/lang/nb.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{ 
+  "Insert Smiley": "Sett inn smiley",
+  "Smiley": "Smiley",
+  "Cancel": "Avbryt"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/smileys.txt
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/smileys.txt (revision 904)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/smileys.txt (revision 904)
@@ -0,0 +1,580 @@
+0001.gif
+0002.gif
+0003.gif
+0004.gif
+0005.gif
+0006.gif
+0007.gif
+0008.gif
+0009.gif
+0010.gif
+0011.gif
+0012.gif
+0013.gif
+0014.gif
+0015.gif
+0016.gif
+0017.gif
+0018.gif
+0019.gif
+0020.gif
+0021.gif
+0022.gif
+0023.gif
+0024.gif
+0025.gif
+0026.gif
+0027.gif
+0028.gif
+0029.gif
+0030.gif
+0031.gif
+0032.gif
+0033.gif
+0034.gif
+0035.gif
+0036.gif
+0037.gif
+0038.gif
+0039.gif
+0040.gif
+0041.gif
+0042.gif
+0043.gif
+0044.gif
+0045.gif
+0046.gif
+0047.gif
+0048.gif
+0049.gif
+0050.gif
+0051.gif
+0052.gif
+0053.gif
+0054.gif
+0055.gif
+0056.gif
+0057.gif
+0058.gif
+0059.gif
+0060.gif
+0061.gif
+0062.gif
+0063.gif
+0064.gif
+0065.gif
+0066.gif
+0067.gif
+0068.gif
+0069.gif
+0070.gif
+0071.gif
+0072.gif
+0073.gif
+0074.gif
+0075.gif
+0076.gif
+0077.gif
+0078.gif
+0079.gif
+0080.gif
+0081.gif
+0082.gif
+0083.gif
+0084.gif
+0085.gif
+0086.gif
+0087.gif
+0088.gif
+0089.gif
+0090.gif
+0091.gif
+0092.gif
+0093.gif
+0094.gif
+0095.gif
+0096.gif
+0097.gif
+0098.gif
+0099.gif
+0100.gif
+0101.gif
+0102.gif
+0103.gif
+0104.gif
+0105.gif
+0106.gif
+0107.gif
+0108.gif
+0109.gif
+0110.gif
+0111.gif
+0112.gif
+0113.gif
+0114.gif
+0115.gif
+0116.gif
+0117.gif
+0118.gif
+0119.gif
+0120.gif
+0121.gif
+0122.gif
+0123.gif
+0124.gif
+0125.gif
+0126.gif
+0127.gif
+0128.gif
+0129.gif
+0130.gif
+0131.gif
+0132.gif
+0133.gif
+0134.gif
+0135.gif
+0136.gif
+0137.gif
+0138.gif
+0139.gif
+0140.gif
+0141.gif
+0142.gif
+0143.gif
+0144.gif
+0145.gif
+0146.gif
+0147.gif
+0148.gif
+0149.gif
+0150.gif
+0151.gif
+0152.gif
+0153.gif
+0154.gif
+0155.gif
+0156.gif
+0157.gif
+0158.gif
+0159.gif
+0160.gif
+0161.gif
+0162.gif
+0163.gif
+0164.gif
+0165.gif
+0166.gif
+0167.gif
+0168.gif
+0169.gif
+0170.gif
+0171.gif
+0172.gif
+0173.gif
+0174.gif
+0175.gif
+0176.gif
+0177.gif
+0178.gif
+0179.gif
+0180.gif
+0181.gif
+0182.gif
+0183.gif
+0184.gif
+0185.gif
+0186.gif
+0187.gif
+0188.gif
+0189.gif
+0190.gif
+0191.gif
+0192.gif
+0193.gif
+0194.gif
+0195.gif
+0196.gif
+0197.gif
+0198.gif
+0199.gif
+0200.gif
+0201.gif
+0202.gif
+0203.gif
+0204.gif
+0205.gif
+0206.gif
+0207.gif
+0208.gif
+0209.gif
+0210.gif
+0211.gif
+0212.gif
+0213.gif
+0214.gif
+0215.gif
+0216.gif
+0217.gif
+0218.gif
+0219.gif
+0220.gif
+0221.gif
+0222.gif
+0223.gif
+0224.gif
+0225.gif
+0226.gif
+0227.gif
+0228.gif
+0229.gif
+0230.gif
+0231.gif
+0232.gif
+0233.gif
+0234.gif
+0235.gif
+0236.gif
+0237.gif
+0238.gif
+0239.gif
+0240.gif
+0241.gif
+0242.gif
+0243.gif
+0244.gif
+0245.gif
+0246.gif
+0247.gif
+0248.gif
+0249.gif
+0250.gif
+0251.gif
+0252.gif
+0253.gif
+0254.gif
+0255.gif
+0256.gif
+0257.gif
+0258.gif
+0259.gif
+0260.gif
+0261.gif
+0262.gif
+0263.gif
+0264.gif
+0265.gif
+0266.gif
+0267.gif
+0268.gif
+0269.gif
+0270.gif
+0271.gif
+0272.gif
+0273.gif
+0274.gif
+0275.gif
+0276.gif
+0277.gif
+0278.gif
+0279.gif
+0280.gif
+0281.gif
+0282.gif
+0283.gif
+0284.gif
+0285.gif
+0286.gif
+0287.gif
+0288.gif
+0289.gif
+0290.gif
+0291.gif
+0292.gif
+0293.gif
+0294.gif
+0295.gif
+0296.gif
+0297.gif
+0298.gif
+0299.gif
+0300.gif
+0301.gif
+0302.gif
+0303.gif
+0304.gif
+0305.gif
+0306.gif
+0307.gif
+0308.gif
+0309.gif
+0310.gif
+0311.gif
+0312.gif
+0313.gif
+0314.gif
+0315.gif
+0316.gif
+0317.gif
+0318.gif
+0319.gif
+0320.gif
+0321.gif
+0322.gif
+0323.gif
+0324.gif
+0325.gif
+0326.gif
+0327.gif
+0328.gif
+0329.gif
+0330.gif
+0331.gif
+0332.gif
+0333.gif
+0334.gif
+0335.gif
+0336.gif
+0337.gif
+0338.gif
+0339.gif
+0340.gif
+0341.gif
+0342.gif
+0343.gif
+0344.gif
+0345.gif
+0346.gif
+0347.gif
+0348.gif
+0349.gif
+0350.gif
+0351.gif
+0352.gif
+0353.gif
+0354.gif
+0355.gif
+0356.gif
+0357.gif
+0358.gif
+0359.gif
+0360.gif
+0361.gif
+0362.gif
+0363.gif
+0364.gif
+0365.gif
+0366.gif
+0367.gif
+0368.gif
+0369.gif
+0370.gif
+0371.gif
+0372.gif
+0373.gif
+0374.gif
+0375.gif
+0376.gif
+0377.gif
+0378.gif
+0379.gif
+0380.gif
+0381.gif
+0382.gif
+0383.gif
+0384.gif
+0385.gif
+0386.gif
+0387.gif
+0388.gif
+0389.gif
+0390.gif
+0391.gif
+0392.gif
+0393.gif
+0394.gif
+0395.gif
+0396.gif
+0397.gif
+0398.gif
+0399.gif
+0400.gif
+0401.gif
+0402.gif
+0403.gif
+0404.gif
+0405.gif
+0406.gif
+0407.gif
+0408.gif
+0409.gif
+0410.gif
+0411.gif
+0412.gif
+0413.gif
+0414.gif
+0415.gif
+0416.gif
+0417.gif
+0418.gif
+0419.gif
+0420.gif
+0421.gif
+0422.gif
+0423.gif
+0424.gif
+0425.gif
+0426.gif
+0427.gif
+0428.gif
+0429.gif
+0430.gif
+0431.gif
+0432.gif
+0433.gif
+0434.gif
+0435.gif
+0436.gif
+0437.gif
+0438.gif
+0439.gif
+0440.gif
+0441.gif
+0442.gif
+0443.gif
+0444.gif
+0445.gif
+0446.gif
+0447.gif
+0448.gif
+0449.gif
+0450.gif
+0451.gif
+0452.gif
+0453.gif
+0454.gif
+0455.gif
+0456.gif
+0457.gif
+0458.gif
+0459.gif
+0460.gif
+0461.gif
+0462.gif
+0463.gif
+0464.gif
+0465.gif
+0466.gif
+0467.gif
+0468.gif
+0469.gif
+0470.gif
+0471.gif
+0472.gif
+0473.gif
+0474.gif
+0475.gif
+0476.gif
+0477.gif
+0478.gif
+0479.gif
+0480.gif
+0481.gif
+0482.gif
+0483.gif
+0484.gif
+0485.gif
+0486.gif
+0487.gif
+0488.gif
+0489.gif
+0490.gif
+0491.gif
+0492.gif
+0493.gif
+0494.gif
+0495.gif
+0496.gif
+0497.gif
+0498.gif
+0499.gif
+0500.gif
+0501.gif
+0502.gif
+0503.gif
+0504.gif
+0505.gif
+0506.gif
+0507.gif
+0508.gif
+0509.gif
+0510.gif
+0511.gif
+0512.gif
+0513.gif
+0514.gif
+0515.gif
+0516.gif
+0517.gif
+0518.gif
+0519.gif
+0520.gif
+0521.gif
+0522.gif
+0523.gif
+0524.gif
+0525.gif
+0526.gif
+0527.gif
+0528.gif
+0529.gif
+0530.gif
+0531.gif
+0532.gif
+0533.gif
+0534.gif
+0535.gif
+0536.gif
+0537.gif
+0538.gif
+0539.gif
+0540.gif
+0541.gif
+0542.gif
+0543.gif
+0544.gif
+0545.gif
+0546.gif
+0547.gif
+0548.gif
+0549.gif
+0550.gif
+0551.gif
+0552.gif
+0553.gif
+0554.gif
+0555.gif
+0556.gif
+0557.gif
+0558.gif
+0559.gif
+0560.gif
+0561.gif
+0562.gif
+0563.gif
+0564.gif
+0565.gif
+0566.gif
+0567.gif
+0568.gif
+0569.gif
+0570.gif
+0571.gif
+0572.gif
+0573.gif
+0574.gif
+0575.gif
+0576.gif
+0577.gif
+0578.gif
+0579.gif
+0580.gif
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/popups/insertsmiley.html
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/popups/insertsmiley.html (revision 999)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/popups/insertsmiley.html (revision 999)
@@ -0,0 +1,64 @@
+<html>
+<head>
+<title>Insert Smiley</title>
+<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+<script type="text/javascript">
+  window.resizeTo(400, 300);
+var InsertSmiley = window.opener.InsertSmiley;
+var editor = null;
+var _editor_url = opener._editor_url;
+var param;
+var smileys = null;
+function Init() {
+  __dlg_translate("InsertSmiley");
+  __dlg_init();
+  param = window.dialogArguments;
+  editor = param['editor'];
+  var smileyList = Xinha._geturlcontent(Xinha.getPluginDir("InsertSmiley") + '/smileys.txt');
+  smileyList = smileyList.match(/^.+$/mg);
+  var smileyURL = editor.config.InsertSmiley.smileyURL;
+  var tbody = document.getElementById("smileytable");
+  var inum;
+  var trow;
+  for(var i = 0; i < smileyList.length; i++) {
+    if((i) % 4 == 0) {
+      trow = tbody.insertRow((i ) / 4);
+    }
+   trow.insertCell((i) % 4).innerHTML = '<a onclick="onOK(\'' + encodeURIComponent( smileyList[i] ) + '\')" href="javascript:void(0);"><img style="border: 0px;" alt="Smiley ' + (i +1) + '" src="'+ smileyURL + encodeURIComponent(smileyList[i]) + '" />';
+  }
+}
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+function onOK(smileyfile) {
+  var params = {};
+  params.smileyfile = smileyfile;
+  __dlg_close(params);
+  return false;
+}
+
+</script>
+
+<style type="text/css">
+.buttons {border-top: 1px solid #999; padding: 5px; text-align: right; height: 20px; }
+</style>
+</head>
+  <body class="dialog" onload="Init()">
+<form action="" method="get">
+  <div class="title" style="width: 360px;">Insert Smiley</div>
+  <div style="height: 175px; overflow:auto; text-align: center;">
+  <table style="border: 0; width: 370px;" id="smileytable">
+  </table>
+  </div>
+<div class="space"></div>
+<div class="buttons">
+<button type="button" onclick="return onCancel();">Cancel</button>
+</div>
+<div id="showselect" style="position:absolute; left:7px; top:75px; width:150px; z-index:100; visibility: visible; height: 13px; color: red;">
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/InsertSmiley/README.txt
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSmiley/README.txt (revision 904)
+++ /branches/new-dialogs-merge/plugins/InsertSmiley/README.txt (revision 904)
@@ -0,0 +1,9 @@
+By default the smileys are hosted on an external server. If you would like to put them on your own server, you can download a zip file from here:
+http://www.x-webservice.net/storage/xinha/plugins/InsertSmiley/smileys.zip
+
+1. Extract the file to your server
+2. Change xinha_config.InsertSmiley.smileyURL to the appropriate path (with trailing slash), e.g.
+   
+   xinha_config.InsertSmiley.smileyURL = "/smileys/";
+   
+ You can also reduce/expand/replace the list of smileys with your own files by editing the file smileys.txt in the plugins's folder.
Index: /branches/new-dialogs-merge/plugins/CSS/css.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CSS/css.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/CSS/css.js (revision 999)
@@ -0,0 +1,149 @@
+// Simple CSS (className) plugin for the editor
+// Sponsored by http://www.miro.com.au
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo.
+//
+// (c) dynarch.com 2003
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id:css.js 856 2007-06-13 18:34:34Z wymsy $
+// @TODO This is the default and won't be very useful to others.
+// We should make this better.
+Xinha.Config.prototype.cssPluginConfig =
+  {
+    combos : [
+      { label: "Syntax",
+                   // menu text       // CSS class
+        options: { "None"           : "",
+                   "Code" : "code",
+                   "String" : "string",
+                   "Comment" : "comment",
+                   "Variable name" : "variable-name",
+                   "Type" : "type",
+                   "Reference" : "reference",
+                   "Preprocessor" : "preprocessor",
+                   "Keyword" : "keyword",
+                   "Function name" : "function-name",
+                   "Html tag" : "html-tag",
+                   "Html italic" : "html-helper-italic",
+                   "Warning" : "warning",
+                   "Html bold" : "html-helper-bold"
+                 },
+        context: "pre"
+      },
+      { label: "Info",
+        options: { "None"           : "",
+                   "Quote"          : "quote",
+                   "Highlight"      : "highlight",
+                   "Deprecated"     : "deprecated"
+                 }
+      }
+    ]
+  };
+
+function CSS(editor, params) {
+	this.editor = editor;
+	var cfg = editor.config;
+	var self = this;
+	var plugin_config;
+  if(params && params.length)
+  {
+    plugin_config = params[0];
+  }
+  else
+  {
+    plugin_config = editor.config.cssPluginConfig;
+  }
+
+  var combos = plugin_config.combos;
+
+	for (var i = 0; i < combos.length; i++) {
+		var combo = combos[i];
+		var id = "CSS-class" + i;
+		var css_class = {
+			id         : id,
+			options    : combo.options,
+			action     : function(editor) { self.onSelect(editor, this, combo.context, combo.updatecontextclass); },
+			refresh    : function(editor) { self.updateValue(editor, this); },
+			context    : combo.context
+		};
+		cfg.registerDropdown(css_class);
+    cfg.addToolbarElement(["T[" + combo.label + "]", id, "separator"] , "formatblock", -1);
+ 	}
+}
+
+CSS._pluginInfo = {
+	name          : "CSS",
+	version       : "1.0",
+	developer     : "Mihai Bazon",
+	developer_url : "http://dynarch.com/mishoo/",
+	c_owner       : "Mihai Bazon",
+	sponsor       : "Miro International",
+	sponsor_url   : "http://www.miro.com.au",
+	license       : "htmlArea"
+};
+
+CSS.prototype.onSelect = function(editor, obj, context, updatecontextclass) {
+	var tbobj = editor._toolbarObjects[obj.id];
+	var index = tbobj.element.selectedIndex;
+	var className = tbobj.element.value;
+
+	// retrieve parent element of the selection
+	var parent = editor.getParentElement();
+	var surround = true;
+
+	var is_span = (parent && parent.tagName.toLowerCase() == "span");
+	var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context);
+
+	if (update_parent) {
+		parent.className = className;
+		editor.updateToolbar();
+		return;
+	}
+
+	if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) {
+		while (parent.firstChild) {
+			parent.parentNode.insertBefore(parent.firstChild, parent);
+		}
+		parent.parentNode.removeChild(parent);
+		editor.updateToolbar();
+		return;
+	}
+
+	if (is_span) {
+		// maybe we could simply change the class of the parent node?
+		if (parent.childNodes.length == 1) {
+			parent.className = className;
+			surround = false;
+			// in this case we should handle the toolbar updation
+			// ourselves.
+			editor.updateToolbar();
+		}
+	}
+
+	// Other possibilities could be checked but require a lot of code.  We
+	// can't afford to do that now.
+	if (surround) {
+		// shit happens ;-) most of the time.  this method works, but
+		// it's dangerous when selection spans multiple block-level
+		// elements.
+		editor.surroundHTML("<span class='" + className + "'>", "</span>");
+	}
+};
+
+CSS.prototype.updateValue = function(editor, obj) {
+	var select = editor._toolbarObjects[obj.id].element;
+	var parent = editor.getParentElement();
+	if (typeof parent.className != "undefined" && /\S/.test(parent.className)) {
+		var options = select.options;
+		var value = parent.className;
+		for (var i = options.length; --i >= 0;) {
+			var option = options[i];
+			if (value == option.value) {
+				select.selectedIndex = i;
+				return;
+			}
+		}
+	}
+	select.selectedIndex = 0;
+};
Index: /branches/new-dialogs-merge/plugins/GenericPlugin/generic-plugin.js
===================================================================
--- /branches/new-dialogs-merge/plugins/GenericPlugin/generic-plugin.js (revision 963)
+++ /branches/new-dialogs-merge/plugins/GenericPlugin/generic-plugin.js (revision 963)
@@ -0,0 +1,100 @@
+/*------------------------------------------*\
+ GenericPlugin for Xinha
+ _______________________
+     
+ Democase for plugin event handlers
+\*------------------------------------------*/
+
+GenericPlugin._pluginInfo = {
+  name          : "GenericPlugin",
+  version       : "1.0",
+  developer     : "Xinha Developer Team",
+  developer_url : "http://xinha.org",
+  sponsor       : "",
+  sponsor_url   : "",
+  license       : "htmlArea"
+}
+function GenericPlugin(editor)
+{
+	this.editor = editor;
+}
+
+GenericPlugin.prototype.onGenerate = function ()
+{
+
+}
+GenericPlugin.prototype.onGenerateOnce = function ()
+{
+
+}
+GenericPlugin.prototype.inwardHtml = function(html)
+{
+	return html;
+}
+GenericPlugin.prototype.outwardHtml = function(html)
+{
+	return html;
+}
+GenericPlugin.prototype.onUpdateToolbar = function ()
+{
+	return false;
+}
+
+GenericPlugin.prototype.onExecCommand = function ( cmdID, UI, param )
+{
+	return false;
+}
+
+GenericPlugin.prototype.onKeyPress = function ( event )
+{
+	return false;
+}
+
+GenericPlugin.prototype.onMouseDown = function ( event )
+{
+	return false;
+}
+
+GenericPlugin.prototype.onBeforeSubmit = function ()
+{
+	return false;
+}
+
+GenericPlugin.prototype.onBeforeUnload = function ()
+{
+	return false;
+}
+
+GenericPlugin.prototype.onBeforeResize = function (width, height)
+{
+	return false;
+}
+GenericPlugin.prototype.onResize = function (width, height)
+{
+	return false;
+}
+/**
+ * 
+ * @param {String} action one of 'add', 'remove', 'hide', 'show', 'multi_hide', 'multi_show'
+ * @param {DOMNode|Array} panel either the panel itself or an array like ['left','right','top','bottom']
+ */
+GenericPlugin.prototype.onPanelChange = function (action, panel)
+{
+	return false;
+}
+/**
+ * 
+ * @param {String} mode either 'textmode' or 'wysiwyg'
+ */
+GenericPlugin.prototype.onMode = function (mode)
+{
+	return false;
+}
+/**
+ * 
+ * @param {String} mode either 'textmode' or 'wysiwyg'
+ */
+GenericPlugin.prototype.onBeforeMode = function (mode)
+{
+	return false;
+}
Index: /branches/new-dialogs-merge/plugins/NoteServer/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/NoteServer/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/NoteServer/lang/pt_br.js (revision 901)
@@ -0,0 +1,37 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt)
+{
+  "Add GUIDO Code in a textbox on the page": "Adicionar código GUIDO em uma caixa de texto na página",
+  "Add MIDI link to allow students to hear the music": "Adicionar um link MIDI para permitir que os estudantes escutem a música",  
+  "Cancel": "Cancelar",
+  "Format": "Formato",
+  "GUIDO Code": "Código GUIDO",
+  "Guido code": "Código Guido",
+  "Image Preview": "Visualização da Imagem",
+  "Image in applet": "Imagem em Applet",
+  "Insert GUIDO Music Notation": "Inserir Notação GUIDO de Música",
+  "MIDI File": "Arquivo MIDI",
+  "OK": "OK",
+  "Options": "Opções",
+  "Preview": "Visualização",
+  "Preview the image in a new window": "Visualizar imagem em uma nova janela",
+  "Source Code": "Codigo Fonte",
+  "With Mozilla, the applet will not be visible in editor, but only in Web page after submitting.": "Com Mozilla, o applet não estará visível no editor, somente na Página Web depois do envio.",
+  "Zoom": "Ampliação",
+  "Zoom :": "Ampliação :"
+}
+
+
Index: /branches/new-dialogs-merge/plugins/NoteServer/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/NoteServer/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/NoteServer/lang/fr.js (revision 677)
@@ -0,0 +1,16 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Insert GUIDO Music Notation": "InsÃ©rer une partition musicale GUIDO",
+  "Guido code": "Code Guido",
+  "Options": "Options",
+  "Format": "Format",
+  "Image in applet": "Image dans une applet",
+  "Zoom": "Zoom",
+  "MIDI File": "Fichier MIDI",
+  "Image Preview": "AperÃ§u de l'image",
+  "Source Code": "Code source",
+  "Preview": "AperÃ§u ",
+  "Add MIDI link to allow students to hear the music": "Ajouter un lien MIDI pour permettre aux Ã©tudiants d'Ã©couter la partition",
+  "Add GUIDO Code in a textbox on the page": "Ajouter le code source GUIDO dans un cadre"
+};
Index: /branches/new-dialogs-merge/plugins/NoteServer/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/NoteServer/lang/de.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/NoteServer/lang/de.js (revision 901)
@@ -0,0 +1,21 @@
+﻿// I18N constants
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Insert GUIDO Music Notation": "Einfügung einer GUIDO Musik-Tonfolge",
+  "Guido code": "Guido code",
+  "Options": "Einstellungen",
+  "Format": "Format",
+  "Image in applet": "Bild im Applet",
+  "Zoom": "Zoom",
+  "MIDI File": "MIDI Datei",
+  "Image Preview": "Bild Voransicht",
+  "Source Code": "Quell-Code",
+  "Preview": "Voransicht",
+  "Add MIDI link to allow students to hear the music": "MIDI-Link hinzufügen um Studenten das hören der Musik zu ermöglichen",
+  "Add GUIDO Code in a textbox on the page": "GUIDO Code in einer Textbox auf der Seite anzeigen"
+};
Index: /branches/new-dialogs-merge/plugins/NoteServer/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/NoteServer/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/NoteServer/lang/nl.js (revision 872)
@@ -0,0 +1,17 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Insert GUIDO Music Notation": "GUIDO muziek notatie invoegen",
+  "Guido code": "GUIDO-code",
+  "Options": "Opties",
+  "Format": "Indeling",
+  "Image in applet": "Afbeelding in applet",
+  "Zoom": "Vergroot/verklein",
+  "MIDI File": "MIDI bestand",
+  "Image Preview": "Afbeeldingsvoorbeeld",
+  "Source Code": "Broncode",
+  "Preview": "Voorbeeld",
+  "Add MIDI link to allow students to hear the music": "MIDI link invoegen om de muziek te beluisteren",
+  "Add GUIDO Code in a textbox on the page": "GUIDO code in een tekstgebied op de pagina invoegen"
+};
Index: /branches/new-dialogs-merge/plugins/NoteServer/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/NoteServer/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/NoteServer/lang/ja.js (revision 715)
@@ -0,0 +1,22 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+// This string is for auto detection of multi-encoding editor : åœéåæå­æ€åºçšæå­å
+{
+  "Insert GUIDO Music Notation": "GUIDO Music Notationã®æ¿å
+¥",
+  "Guido code": "GUIDOã³ãŒã",
+  "Options": "ãªãã·ã§ã³",
+  "Format": "ãã©ãŒããã",
+  "Image in applet": "ã¢ãã¬ããç»å",
+  "Zoom": "æ¡å€§ç:",
+  "MIDI File": "MIDIãã¡ã€ã«",
+  "Image Preview": "ç»åãã¬ãã¥ãŒ",
+  "Source Code": "ãœãŒã¹ã³ãŒã",
+  "Preview": "è¡šç€º",
+  "Add MIDI link to allow students to hear the music": "MIDIãžã®ãªã³ã¯ãè¿œå ããæ¥œæ²ãèŽãããŠããã",
+  "Add GUIDO Code in a textbox on the page": "ããŒãžå
+ã®ãã­ã¹ãããã¯ã¹ã«GUIDOã³ãŒããè¿œå ",
+  "With Mozilla, the applet will not be visible in editor, but only in Web page after submitting.": "Mozillaã§ã¯ãšãã£ã¿å
+ã«ã¢ãã¬ããã¯è¡šç€ºãããŸããããéä¿¡åŸã®WebããŒãžå
+ã§ã¯æå¹ã§ãã"
+};
Index: /branches/new-dialogs-merge/plugins/NoteServer/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/NoteServer/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/NoteServer/lang/nb.js (revision 677)
@@ -0,0 +1,17 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Insert GUIDO Music Notation": "Sett inn GUIDO-noter",
+  "Guido code": "GUIDO-kode",
+  "Options": "Muligheter",
+  "Format": "Format",
+  "Image in applet": "Bilde i applet",
+  "Zoom": "ForstÃžrr",
+  "MIDI File": "MIDIfil",
+  "Image Preview": "Bilde forhÃ¥ndsvisning",
+  "Source Code": "Kildekode",
+  "Preview": "Preview",
+  "Add MIDI link to allow students to hear the music": "Legg til MIDI-link for at studenter kan hÃžre musikken",
+  "Add GUIDO Code in a textbox on the page": "Sett inn GUIDO-kode i et tekstfelt pÃ¥ siden"
+};
Index: /branches/new-dialogs-merge/plugins/NoteServer/note-server.js
===================================================================
--- /branches/new-dialogs-merge/plugins/NoteServer/note-server.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/NoteServer/note-server.js (revision 856)
@@ -0,0 +1,208 @@
+// GUIDO Music Notation plugin for Xinha
+// Implementation by Richard Christophe
+// Original Author - Richard Christophe cvrichard@infonie.fr
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+// this is a collection of JavaScript routines that
+// facilitate accessing the GUIDO NoteServer.
+//
+// These Functions can be used within WEB-Pages
+// examples can be found at
+// www.noteserver.org/javascript/index.html
+//
+
+function NoteServer(editor) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+
+  cfg.registerButton({
+                id       : "insertscore",
+                tooltip  : this._lc("Insert GUIDO Music Notation"),
+                image    : editor.imgURL("note.gif", "NoteServer"),
+                textMode : false,
+                action   : function(editor) {
+                                self.buttonPress(editor);
+                           }
+            });
+	cfg.addToolbarElement("insertscore", "insertimage", 1);
+}
+
+NoteServer._pluginInfo = {
+  name          : "NoteServer",
+  version       : "1.1",
+  developer     : "Richard Christophe",
+  developer_url : "http://piano-go.chez.tiscali.fr/guido.html",
+  c_owner       : "Richard Christophe",
+  sponsor       : "",
+  sponsor_url   : "",
+  license       : "htmlArea"
+};
+
+NoteServer.prototype._lc = function(string) {
+  return Xinha._lc(string, 'NoteServer');
+};
+
+NoteServer.prototype.buttonPress = function(editor) {
+  editor._popupDialog( "plugin://NoteServer/codenote", function(param) {
+    if (!param) {	// user must have pressed Cancel
+      return false;
+    } else IncludeGuido(editor,param);
+  }, null);
+};
+
+// this variable is the address of the noteserver
+// can be set to another address (local address if availalble) 
+
+// var noteserveraddress = "www.noteserver.org";
+// var htmlbase = "";
+
+// alternative: specify server-adress directly:
+var noteserveraddress = "clef.cs.ubc.ca"; //"www.noteserver.org"
+var htmlbase = "/salieri/nview";
+
+
+// this is the version of the NoteServer used.
+// one of "0_4", "0_5", "0_6", or "0_7", or ""
+// "" means: take the current version
+// var versionstring = "0_7";
+var versionstring = "";
+
+// this functions takes a GMN-string and returns the URL
+// that converts it into a GIF-file
+function GetGIFURL(gmnstring,zoom,pagenum) {
+  gmnstring = escape(gmnstring);
+  gmnstring = gmnstring.replace(/\//g,"%2F");
+
+  if (!zoom) {
+    zoom = "1.0";
+  }
+  if (!pagenum) {
+    pagenum = "1";
+  }
+
+  var string = "http://" + noteserveraddress +
+               "/scripts/salieri" + versionstring +
+               "/gifserv.pl?" +
+               "pagewidth=21" +
+               "&pageheight=29.7" +
+               "&zoomfactor=" + zoom +
+               "&pagesizeadjust=yes" +
+               "&outputformat=gif87" +
+               "&pagenum=" + pagenum +
+               "&gmndata=" + gmnstring;
+
+  //	document.write(string);
+  return string;
+}
+
+// this functions takes a GMN-string and returns the URL
+// that converts it into a MIDI-file
+function GetMIDIURL(gmnstring) {
+  gmnstring = escape(gmnstring);
+  gmnstring = gmnstring.replace(/\//g,"%2F");
+
+  var string = "http://" + noteserveraddress +
+               "/scripts/salieri" + versionstring + 
+               "/midserv.pl?" +
+               "gmndata=" + gmnstring;
+
+  return string;
+}
+
+// this functions takes a GMN-string and returns the URL
+// that insert Applet
+function GetAPPLETURL(gmnstring,zoom) {
+  gmnstring = escape(gmnstring);
+  gmnstring = gmnstring.replace(/\//g,"%2F");
+
+  var string = '<applet ' +
+               'code="NoteServerApplet" ' +
+               'codebase="http://' +
+               noteserveraddress + htmlbase + '/java" ' +
+               ' width=700 height=300>' +
+               '<param name=server value="' +
+               noteserveraddress + '">' +
+               '<param name=serverVersion value="' +
+               versionstring + '">' +
+               '<param name=zoomFactor value="' +
+               zoom + '">' +
+               '<param name=pageWidth value="21">' +
+               '<param name=pageHeight value="29.7">' +
+               '<param name=gmn value="' +
+               gmnstring + '">' +
+               '</applet>';
+
+  return string;
+}
+
+// This function takes a GUIDO string, accesses the
+// NoteServer (address specified as a constant above)
+// and then embeds the GIF-Image in the document.
+
+
+function IncludeGuido(editor,param) {
+  // this  holds the URL for retrieving the picture ...
+
+  if (!param["f_zoom"])
+    zoom = "";
+  //if (!pagenum)
+   // pagenum = "";
+
+  var string = GetGIFURL(param["f_code"],param["f_zoom"],"");
+  var stringmidi = GetMIDIURL(param["f_code"]);
+  var string2 = "<br>";
+
+if (param["f_applet"] == false ){
+  if (((navigator.userAgent.toLowerCase().indexOf("msie") != -1)
+    && (navigator.userAgent.toLowerCase().indexOf("opera") == -1))) {
+    editor.focusEditor();
+    editor.insertHTML("<img src=" + string + ">");
+  }	else {
+    img = new Image();
+    img.src = string;
+
+    var doc = editor._doc;
+    var sel = editor._getSelection();
+    var range = editor._createRange(sel);
+    editor._doc.execCommand("insertimage", false, img.src);
+  }
+} else {
+  var stringapplet = GetAPPLETURL(param["f_code"],param["f_zoom"]);
+  string2 = string2 + stringapplet + "<br>";
+}
+
+// To test code source in textarea
+//if (param["f_affcode"]) string2 = string2 + Xinha._lc("Source Code","NoteServer") + " :" + '<br> <textarea  cols=60 rows=10 style = "background: #FFFFE6">' +  param["f_code"] + '</textarea> <br>';
+
+if (param["f_affcode"]) string2 = string2 + Xinha._lc("GUIDO Code","NoteServer") + " : "  + param["f_code"] + "<br>";
+if (param["f_midi"]) string2 = string2 + "<a href=" + stringmidi + ">" + Xinha._lc("MIDI File","NoteServer") + "</a> <br>";
+
+  editor.focusEditor();
+  editor.insertHTML(string2);
+
+    //var html = linktext.link(stringmidi);
+    //editor.insertHTML(html);
+}
+
+// this routine includes the applet-definition 
+function IncludeGuidoStringAsApplet(editor, gmnstring, zoom) {
+  gmnstring = escape(gmnstring);
+  gmnstring = gmnstring.replace(/\//g,"%2F");
+
+  var string = '<applet ' + 
+               'codebase="http://' + noteserveraddress + htmlbase + '/java"\n' +
+               'code="NoteServerApplet" width=480 height=230>' +
+               "<PARAM NAME=server VALUE='" + noteserveraddress + "'>" +
+               "<PARAM NAME=serverVersion VALUE='" + versionstring + "'>" +
+               "<PARAM NAME=zoomFactor VALUE='"	+ zoom + "'>" +
+               '<param name=pageWidth value="21">' +
+               '<param name=pageHeight value="29.7">' +
+               "<PARAM NAME=gmn VALUE='" + gmnstring + "'>" +
+               "</applet>";
+  alert(string);
+  editor.focusEditor();
+  editor.insertHTML(string);
+}
Index: /branches/new-dialogs-merge/plugins/NoteServer/popups/codenote.html
===================================================================
--- /branches/new-dialogs-merge/plugins/NoteServer/popups/codenote.html (revision 987)
+++ /branches/new-dialogs-merge/plugins/NoteServer/popups/codenote.html (revision 987)
@@ -0,0 +1,162 @@
+<html>
+
+<head>
+
+<title>Insert GUIDO Music Notation</title>
+<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+<script type="text/javascript"  src="../note-server.js"></script>
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(500, 200);
+
+NoteServer = window.opener.NoteServer;
+
+var editor = null;
+function Init() {
+  __dlg_translate('NoteServer');
+  __dlg_init();
+
+//   var param = window.dialogArguments;
+//  if (param) {
+//    document.getElementById("f_midi").value = param["f_midi"];
+//    document.getElementById("f_code").value = param["f_code"];
+//    document.getElementById("f_zoom").value = param["f_zoom"];
+//    document.getElementById("f_affcode").value = param["f_affcode"];
+//    document.getElementById("f_applet").value = param["f_applet"];
+//  }
+//  editor = param.editor;
+  document.getElementById("f_code").focus();
+//  document.getElementById("f_code").select();
+}
+
+function onOK() {
+  var f_code = document.getElementById("f_code");
+  if (!f_code.value) {
+    alert("You have to enter GUIDO code");
+    f_code.focus();
+    return false;
+}
+
+  // pass data back to the calling window
+
+  var param = {};
+  param["f_code"] = f_code.value;
+  var f_zoom = document.getElementById("f_zoom");
+  var z = "1.0";
+  if (f_zoom.value == "1.0" || f_zoom.value == "100%") z = 1.0;
+  else if (f_zoom.value == "0.8" || f_zoom.value == "80%") z = 0.8;
+  else if (f_zoom.value == "1.2" || f_zoom.value == "120%") z = 1.2;
+  else if (f_zoom.value == "1.5" || f_zoom.value == "150%") z = 1.5;
+
+  param["f_zoom"] = z;
+
+  param["f_midi"] = document.getElementById("f_midi").checked;
+
+  param["f_affcode"] = document.getElementById("f_affcode").checked;
+  param["f_applet"] = document.getElementById("f_applet").checked;
+
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+
+}
+
+
+function message(){
+if (document.getElementById("f_applet").checked)
+  if (!((navigator.userAgent.toLowerCase().indexOf("msie") != -1)
+    && (navigator.userAgent.toLowerCase().indexOf("opera") == -1))) {
+    alert(HTMLArea._lc("With Mozilla, the applet will not be visible in editor, but only in Web page after submitting.", 'NoteServer'));
+  }
+}
+
+function onPreview() {
+
+  var f_code = document.getElementById("f_code");
+  var f_zoom = document.getElementById("f_zoom");
+
+var z = "1.0";
+if (f_zoom.value == "1.0" || f_zoom.value == "100%") z = 1.0;
+else if (f_zoom.value == "0.8" || f_zoom.value == "80%") z = 0.8;
+else if (f_zoom.value == "1.2" || f_zoom.value == "120%") z = 1.2;
+else if (f_zoom.value == "1.5" || f_zoom.value == "150%") z = 1.5;
+
+  var url = GetGIFURL(f_code.value,z,"");
+  if (!f_code.value) {
+    alert("You have to enter GUIDO code");
+    f_code.focus();
+    return false;
+ }
+
+
+  window.ipreview.location.replace(url);
+
+  return false;
+}
+
+</script>
+</head>
+
+<body class="Dialog" onload="Init()">
+<div class="title">Insert GUIDO Music Notation</div>
+
+<span>Guido code</span> :
+  <br><textarea rows="7" id="f_code" cols="55"></textarea><br>
+
+<div class="space"></div>
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Options</legend>
+  <input type="checkbox" id="f_midi" value="ON"> <span>Add MIDI link to allow students to hear the music</span>
+  <div class="space"></div>
+  <input type="checkbox" id="f_affcode" value="ON"> <span>Add GUIDO Code in a textbox on the page</span>
+  <div class="space"></div>
+</fieldset>
+
+<fieldset style="float: right; margin-left: 5px;">
+<legend>Format</legend>
+  <input type="checkbox" id="f_applet" value="ON" onclick="message();" > <span>Image in applet</span>
+  <div class="space"></div>
+  <span>Zoom</span> :
+  <select size="1" id="f_zoom" title="Zoom :">
+    <option value="0.8">80%</option>
+    <option selected="selected">100%</option>
+    <option value="1.2">120%</option>
+    <option value="1.5">150%</option>
+  </select>
+  <div class="space"></div>
+</fieldset>
+
+<br clear="all" />
+
+<table width="100%" style="margin-bottom: 0.2em">
+ <tr>
+  <td style="vertical-align: bottom;">
+    <span>Image Preview</span>:<br />
+    <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="350" src=""></iframe>
+  </td>
+
+  <td style="vertical-align: bottom;" style="text-align: right">
+    <button type="button" name="preview" onclick="return onPreview();"
+      title="Preview the image in a new window">Preview</button><br>
+    <button type="button" name="ok" onclick="return onOK();"><span>OK</span></button><br>
+    <button type="button" name="cancel" onclick="return onCancel();"><span>Cancel</span></button>
+  </td>
+ </tr>
+ <tr>
+  <td colspan="2">
+   <p>Sample Guido Codes:</p>
+   <p><a href="http://piano-go.chez.tiscali.fr/rachmaninoff.gmn" onclick="window.open(this.href,'_blank');return false;">Code Sample 1</a> or type [ do re mi fa sol la si ] | <a href="http://www.informatik.tu-darmstadt.de/AFS/SALIERI/guido/demos.html" onclick="window.open(this.href,'_blank');return false;">Code Sample 2</a></p>
+   <p>Resources: </p>
+   <p>The Guido Specification (<a href="http://piano-go.chez.tiscali.fr/GUIDO-Music%20Notation%20Format.pdf" onclick="window.open(this.href,'_blank');return false;">PDF)</a> | <a href="http://www.salieri.org/guido/doc.html" onclick="window.open(this.href,'_blank');return false;">(HTML)</a></p>
+   <p><a href="http://www.salieri.org/guido/" onclick="window.open(this.href,'_blank');return false;">GUIDO Music Notation Format Site</a> | <a href="http://www.noteserver.org/" onclick="window.open(this.href,'_blank');return false;">Guido Note Server</a> | <a href="http://sourceforge.net/projects/guidolib/" onclick="window.open(this.href,'_blank');return false;">SourceForge Homepage</a></p>
+  </td>
+ </tr>
+</table>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/DynamicCSS/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DynamicCSS/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/DynamicCSS/lang/pt_br.js (revision 901)
@@ -0,0 +1,21 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+{
+  "Choose stylesheet": "Escolher estilo",
+  "Default": "Padrão",
+  "Undefined": "Indefinido"
+}
Index: /branches/new-dialogs-merge/plugins/DynamicCSS/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DynamicCSS/lang/fr.js (revision 375)
+++ /branches/new-dialogs-merge/plugins/DynamicCSS/lang/fr.js (revision 375)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Default": "DÃ©faut",
+  "Undefined": "Non dÃ©fini",
+  "Choose stylesheet": "Choisir feuille de style"
+};
Index: /branches/new-dialogs-merge/plugins/DynamicCSS/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DynamicCSS/lang/de.js (revision 383)
+++ /branches/new-dialogs-merge/plugins/DynamicCSS/lang/de.js (revision 383)
@@ -0,0 +1,12 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Default": "Standard",
+  "Undefined": "Nicht definiert",
+  "Choose stylesheet": "WÃ€hlen Sie einen StyleSheet aus"
+};
Index: /branches/new-dialogs-merge/plugins/DynamicCSS/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DynamicCSS/lang/nl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/DynamicCSS/lang/nl.js (revision 677)
@@ -0,0 +1,12 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Default": "Default",
+  "Undefined": "Ungedefinieerd",
+  "Choose stylesheet": "Kies stylesheet"
+};
Index: /branches/new-dialogs-merge/plugins/DynamicCSS/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DynamicCSS/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/DynamicCSS/lang/ja.js (revision 715)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Default": "ãªã",
+  "Undefined": "æªå®çŸ©",
+  "Choose stylesheet": "ã¹ã¿ã€ã«ã·ãŒãã®éžæ"
+};
Index: /branches/new-dialogs-merge/plugins/DynamicCSS/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DynamicCSS/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/DynamicCSS/lang/nb.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Default": "Standard",
+  "Undefined": "Udefinert",
+  "Choose stylesheet": "Velg stilsett"
+};
Index: /branches/new-dialogs-merge/plugins/DynamicCSS/dynamiccss.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DynamicCSS/dynamiccss.js (revision 893)
+++ /branches/new-dialogs-merge/plugins/DynamicCSS/dynamiccss.js (revision 893)
@@ -0,0 +1,237 @@
+// Dynamic CSS (className) plugin for HTMLArea
+// Sponsored by http://www.systemconcept.de
+// Implementation by Holger Hees
+//
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function DynamicCSS(editor, args) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+
+/*var cssArray=null;
+  var cssLength=0;*/
+  var lastTag=null;
+  var lastClass=null;
+
+  var css_class = {
+    id         : "DynamicCSS-class",
+    tooltip       : this._lc("Choose stylesheet"),
+    options    : {"":""},
+    action     : function(editor) { self.onSelect(editor, this); },
+    refresh    : function(editor) { self.updateValue(editor, this); }
+  };
+  cfg.registerDropdown(css_class);
+  cfg.addToolbarElement(["T[CSS]", "DynamicCSS-class", "separator"] , "formatblock", -1);
+}
+
+DynamicCSS.parseStyleSheet=function(editor){
+        iframe = editor._iframe.contentWindow.document;
+
+        cssArray=DynamicCSS.cssArray;
+        if(!cssArray) cssArray=new Array();
+
+        for(i=0;i<iframe.styleSheets.length;i++)
+        {
+            if(iframe.styleSheets[i].title == "XinhaInternalCSS") continue;
+            
+            // Mozilla
+            if(Xinha.is_gecko){
+                try{
+                    cssArray=DynamicCSS.applyCSSRule(iframe.styleSheets[i].cssRules,cssArray);
+                }
+                catch(e){
+                    //alert(e);
+                }
+            }
+            // IE
+            else {
+                try{
+                    if(iframe.styleSheets[i].rules){
+                        cssArray=DynamicCSS.applyCSSRule(iframe.styleSheets[i].rules,cssArray);
+                    }
+                    // @import StyleSheets (IE)
+                    if(iframe.styleSheets[i].imports){
+                        for(j=0;j<iframe.styleSheets[i].imports.length;j++){
+                            cssArray=DynamicCSS.applyCSSRule(iframe.styleSheets[i].imports[j].rules,cssArray);
+                        }
+                    }
+                }
+                catch(e){
+                    //alert(e);
+                }
+            }
+        }
+        DynamicCSS.cssArray=cssArray;
+};
+
+DynamicCSS.applyCSSRule=function(cssRules,cssArray){
+    for(rule in cssRules){
+        if(typeof cssRules[rule] == 'function') continue;
+        // StyleRule
+        if(cssRules[rule].selectorText){
+            if(cssRules[rule].selectorText.search(/:+/)==-1){
+
+                // split equal Styles (Mozilla-specific) e.q. head, body {border:0px}
+                // for ie not relevant. returns allways one element
+                cssElements = cssRules[rule].selectorText.split(",");
+                for(k=0;k<cssElements.length;k++){
+                    cssElement = cssElements[k].split(".");
+
+                    tagName=cssElement[0].toLowerCase().trim();
+                    className=cssElement[1];
+
+                    if(!tagName) tagName='all';
+                    if(!cssArray[tagName]) cssArray[tagName]=new Array();
+
+                    if(className){
+                        if(tagName=='all') cssName=className;
+                        else cssName='<'+className+'>';
+                    }
+                    else{
+                        className='none';
+                        if(tagName=='all') cssName=Xinha._lc("Default", 'DynamicCSS');
+                        else cssName='<'+Xinha._lc("Default", 'DynamicCSS')+'>';
+                    }
+                    cssArray[tagName][className]=cssName;
+                    DynamicCSS.cssLength++;
+                }
+            }
+        }
+        // ImportRule (Mozilla)
+        else if(cssRules[rule].styleSheet){
+            cssArray=DynamicCSS.applyCSSRule(cssRules[rule].styleSheet.cssRules,cssArray);
+        }
+    }
+    return cssArray;
+};
+
+DynamicCSS._pluginInfo = {
+  name          : "DynamicCSS",
+  version       : "1.5.2",
+  developer     : "Holger Hees",
+  developer_url : "http://www.systemconcept.de/",
+  c_owner       : "Holger Hees",
+  sponsor       : "System Concept GmbH",
+  sponsor_url   : "http://www.systemconcept.de/",
+  license       : "htmlArea"
+};
+
+DynamicCSS.prototype._lc = function(string) {
+    return Xinha._lc(string, 'DynamicCSS');
+};
+
+DynamicCSS.prototype.onSelect = function(editor, obj) {
+    var tbobj = editor._toolbarObjects[obj.id];
+    var index = tbobj.element.selectedIndex;
+    var className = tbobj.element.value;
+
+    var parent = editor.getParentElement();
+
+    if(className!='none'){
+        parent.className=className;
+        DynamicCSS.lastClass=className;
+    }
+    else{
+        if(Xinha.is_gecko) parent.removeAttribute('class');
+        else parent.removeAttribute('className');
+    }
+    editor.updateToolbar();
+};
+
+/*DynamicCSS.prototype.onMode = function(mode) {
+    if(mode=='wysiwyg'){
+        // reparse possible changed css files
+        DynamicCSS.cssArray=null;
+        this.updateValue(this.editor,this.editor.config.customSelects["DynamicCSS-class"]);
+    }
+}*/
+
+DynamicCSS.prototype.reparseTimer = function(editor, obj, instance) {
+    // new attempt of rescan stylesheets in 1,2,4 and 8 second (e.g. for external css-files with longer initialisation)
+    if(DynamicCSS.parseCount<9){
+        setTimeout(function () {
+            DynamicCSS.cssLength=0;
+            DynamicCSS.parseStyleSheet(editor);
+            if(DynamicCSS.cssOldLength!=DynamicCSS.cssLength){
+                DynamicCSS.cssOldLength=DynamicCSS.cssLength;
+                DynamicCSS.lastClass=null;
+                instance.updateValue(editor, obj);
+            }
+            instance.reparseTimer(editor, obj, instance);
+        },DynamicCSS.parseCount*1000);
+        DynamicCSS.parseCount=DynamicCSS.parseCount*2;
+    }
+};
+
+DynamicCSS.prototype.updateValue = function(editor, obj) {
+        cssArray=DynamicCSS.cssArray;
+        // initial style init
+        if(!cssArray){
+            DynamicCSS.cssLength=0;
+            DynamicCSS.parseStyleSheet(editor);
+            cssArray=DynamicCSS.cssArray;
+            DynamicCSS.cssOldLength=DynamicCSS.cssLength;
+            DynamicCSS.parseCount=1;
+            this.reparseTimer(editor,obj,this);
+        }
+
+        var parent = editor.getParentElement();
+        var tagName = parent.tagName.toLowerCase();
+        var className = parent.className;
+
+        if(this.lastTag!=tagName || this.lastClass!=className){
+            this.lastTag=tagName;
+            this.lastClass=className;
+
+            var select = editor._toolbarObjects[obj.id].element;
+
+            while(select.length>0){
+                select.options[select.length-1] = null;
+            }
+
+            select.options[0]=new Option(this._lc("Default"),'none');
+            if(cssArray){
+                // style class only allowed if parent tag is not body or editor is in fullpage mode
+                if(tagName!='body' || editor.config.fullPage){
+                    if(cssArray[tagName]){
+                        for(cssClass in cssArray[tagName]){
+                            if(typeof cssArray[tagName][cssClass] != 'string') continue;
+                            if(cssClass=='none') select.options[0]=new Option(cssArray[tagName][cssClass],cssClass);
+                            else select.options[select.length]=new Option(cssArray[tagName][cssClass],cssClass);
+                        }
+                    }
+
+                    if(cssArray['all']){
+                        for(cssClass in cssArray['all']){
+                            if(typeof cssArray['all'][cssClass] != 'string') continue;
+                            select.options[select.length]=new Option(cssArray['all'][cssClass],cssClass);
+                        }
+                    }
+                }
+                else if(cssArray[tagName] && cssArray[tagName]['none']) select.options[0]=new Option(cssArray[tagName]['none'],'none');
+            }
+
+            select.selectedIndex = 0;
+
+            if (typeof className != "undefined" && /\S/.test(className)) {
+                var options = select.options;
+                for (var i = options.length; --i >= 0;) {
+                    var option = options[i];
+                    if (className == option.value) {
+                            select.selectedIndex = i;
+                            break;
+                    }
+                }
+                if(select.selectedIndex == 0){
+                    select.options[select.length]=new Option(this._lc("Undefined"),className);
+                    select.selectedIndex=select.length-1;
+                }
+            }
+
+            if(select.length>1) select.disabled=false;
+            else select.disabled=true;
+        }
+};
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/lang/pt_br.js (revision 901)
@@ -0,0 +1,21 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Auto-Tidy": "Auto-Tidy",
+  "Don't Tidy": "Sem Tidy",
+  "HTML Tidy": "HTML Tidy",
+  "Tidy failed.  Check your HTML for syntax errors.": "Tidy falhou. Verifique erros de sintaxe em seu HTML."
+}
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/lang/fr.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "HTML Tidy": "HTML Tidy",
+  "Auto-Tidy": "Tidy automatique",
+  "Don't Tidy": "Tidy non utilisÃ©",
+  "Tidy failed.  Check your HTML for syntax errors.": "Tidy a Ã©chouÃ©. VÃ©rifiez votre HTML for des erreurs de syntaxe"
+};
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/lang/de.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Author: Raimund Meyer ray@ray-of-light.org
+{
+  "HTML Tidy": "HTML Tidy",
+	"Tidy failed.  Check your HTML for syntax errors.": "Tidy fehlgeschlagen. PrÃŒfen Sie den HTML Code nach Syntax-Fehlern."  
+};
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/lang/nl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/lang/nl.js (revision 677)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+{
+  "HT-html-tidy": "HTML opschonen"
+};
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/lang/ja.js (revision 715)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "HTML Tidy": "HTML Tidy",
+  "Auto-Tidy": "èªåé©æ­£å",
+  "Don't Tidy": "é©æ­£åããªã",
+  "Tidy failed.  Check your HTML for syntax errors.":"é©æ­£åã«å€±æããŸãããHTMLã®ææ³ãšã©ãŒãç¢ºèªããŠãã ããã"
+};
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/lang/nb.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "HTML Tidy": "HTML Tidy",
+  "Tidy failed.  Check your HTML for syntax errors.": "Tidy feilet. Sjekk HTML koden for syntaksfeil."
+};
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy.js (revision 999)
@@ -0,0 +1,105 @@
+// Plugin for htmlArea to run code through the server's HTML Tidy
+// By Adam Wright, for The University of Western Australia
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function HtmlTidy(editor) {
+	this.editor = editor;
+
+	var cfg = editor.config;
+	var bl = HtmlTidy.btnList;
+	var self = this;
+
+	this.onMode = this.__onMode;
+
+	// register the toolbar buttons provided by this plugin
+	var toolbar = [];
+	for (var i = 0; i < bl.length; ++i) {
+		var btn = bl[i];
+		if (btn == "html-tidy") {
+			var id = "HT-html-tidy";
+			cfg.registerButton(id, this._lc("HTML Tidy"), editor.imgURL(btn[0] + ".gif", "HtmlTidy"), true,
+					   function(editor, id) {
+						   // dispatch button press event
+						   self.buttonPress(editor, id);
+					   }, btn[1]);
+			toolbar.push(id);
+		} else if (btn == "html-auto-tidy") {
+            var btnTxt = [this._lc("Auto-Tidy"), this._lc("Don't Tidy")];
+            var optionItems = new Object();
+            optionItems[btnTxt[0]] = "auto";
+            optionItems[btnTxt[1]] = "noauto";
+			var ht_class = {
+				id	: "HT-auto-tidy",
+				options	: optionItems,
+				action	: function (editor) { self.__onSelect(editor, this); },
+				refresh	: function (editor) { },
+				context	: "body"
+			};
+			cfg.registerDropdown(ht_class);
+		}
+	}
+
+	for (var i in toolbar) {
+		cfg.toolbar[0].push(toolbar[i]);
+	}
+}
+
+HtmlTidy._pluginInfo = {
+	name          : "HtmlTidy",
+	version       : "1.0",
+	developer     : "Adam Wright",
+	developer_url : "http://blog.hipikat.org/",
+	sponsor       : "The University of Western Australia",
+	sponsor_url   : "http://www.uwa.edu.au/",
+	license       : "htmlArea"
+};
+
+HtmlTidy.prototype._lc = function(string) {
+    return Xinha._lc(string, 'HtmlTidy');
+};
+
+HtmlTidy.prototype.__onSelect = function(editor, obj) {
+	// Get the toolbar element object
+	var elem = editor._toolbarObjects[obj.id].element;
+
+	// Set our onMode event appropriately
+	if (elem.value == "auto")
+		this.onMode = this.__onMode;
+	else
+		this.onMode = null;
+};
+
+HtmlTidy.prototype.__onMode = function(mode) {
+	if ( mode == "textmode" ) {
+		this.buttonPress(this.editor, "HT-html-tidy");
+	}
+};
+
+HtmlTidy.btnList = [
+		    null, // separator
+		    ["html-tidy"],
+		    ["html-auto-tidy"]
+];
+
+HtmlTidy.prototype.buttonPress = function(editor, id) {
+
+	switch (id)
+  {
+    case "HT-html-tidy":
+    {
+      var oldhtml = editor.getHTML();
+      if(oldhtml=="") break; //don't clean empty text
+      // Ask the server for some nice new html, based on the old...
+      Xinha._postback(Xinha.getPluginDir("HtmlTidy") + '/html-tidy-logic.php', {'htisource_name' : oldhtml},
+                            function(javascriptResponse) { eval(javascriptResponse) });
+    }
+		break;
+	}
+};
+
+HtmlTidy.prototype.processTidied = function(newSrc) {
+	editor = this.editor;
+	editor.setHTML(newSrc);
+};
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy-config.cfg
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy-config.cfg (revision 677)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy-config.cfg (revision 677)
@@ -0,0 +1,29 @@
+// Default configuration file for the htmlArea, HtmlTidy plugin
+// By Adam Wright, for The University of Western Australia
+//
+// Evertything you always wanted to know about HTML Tidy *
+// can be found at http://tidy.sourceforge.net/, and a
+// quick reference to the configuration options exists at
+// http://tidy.sourceforge.net/docs/quickref.html
+//
+// * But were afraid to ask
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+word-2000: yes
+clean: yes
+drop-font-tags: no
+doctype: auto
+drop-empty-paras: yes
+drop-proprietary-attributes: yes
+enclose-block-text: yes
+enclose-text: yes
+escape-cdata: yes
+logical-emphasis: yes
+indent: auto
+indent-spaces: 2
+break-before-br: yes
+output-xhtml: yes
+
+force-output: yes
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy-logic.php
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy-logic.php (revision 410)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/html-tidy-logic.php (revision 410)
@@ -0,0 +1,79 @@
+<?php 
+##
+##  Plugin for htmlArea, to run code through the server's HTML Tidy
+##   By Adam Wright, for The University of Western Australia
+##    This is the server-side script, which dirty code is run through.
+##
+##  Distributed under the same terms as HTMLArea itself.
+##  This notice MUST stay intact for use (see license.txt).
+##
+
+	// Get the original source
+	$source = $_POST['htisource_name'];
+	$source = stripslashes($source);
+  $cwd = str_replace("\\","/",getcwd())."/";
+  
+	// Open a tidy process - I hope it's installed!
+	$descriptorspec = array(
+		0 => array("pipe", "r"),
+		1 => array("pipe", "w")
+	);
+	$process = @proc_open("tidy -utf8 -config {$cwd}html-tidy-config.cfg", $descriptorspec, $pipes);
+
+
+	// Make sure the program started and we got the hooks...
+	// Either way, get some source code into $source
+	if (is_resource($process)) {
+
+		// Feed untidy source into the stdin
+		fwrite($pipes[0], $source);
+		fclose($pipes[0]);
+
+		// Read clean source out to the browser
+		while (!feof($pipes[1])) {
+			//echo fgets($pipes[1], 1024);
+			$newsrc .= fgets($pipes[1], 1024);
+		}
+		fclose($pipes[1]);
+
+		// Clean up after ourselves
+		proc_close($process);
+
+	} else {
+    /* Use tidy if it's available from PECL */
+    if( function_exists('tidy_parse_string') )
+    {
+      $tempsrc = tidy_parse_string($source);
+      tidy_clean_repair();
+      $newsrc = tidy_get_output();
+    }
+    else
+    {
+      // Better give them back what they came with, so they don't lose it all...
+      $newsrc = "<body>\n" .$source. "\n</body>";
+    }
+	}
+
+	// Split our source into an array by lines
+	$srcLines = preg_split("/\n/",$newsrc,-1,PREG_SPLIT_NO_EMPTY);
+
+	// Get only the lines between the body tags
+	$startLn = 0;
+	while ( strpos( $srcLines[$startLn++], '<body' ) === false && $startLn < sizeof($srcLines) );
+	$endLn = $startLn;
+	while ( strpos( $srcLines[$endLn++], '</body' ) === false && $endLn < sizeof($srcLines) );
+
+	$srcLines = array_slice( $srcLines, $startLn, ($endLn - $startLn - 1) );
+
+	// Create a set of javascript code to compile a new source string
+	foreach ($srcLines as $line) {
+		$jsMakeSrc .= "\tns += '" . str_replace("'","\'",$line) . "\\n';\n";
+	}
+if(!sizeof($srcLines)) {
+    echo "alert(HTMLArea._lc('Tidy failed.  Check your HTML for syntax errors.', 'HtmlTidy'));\n";
+} else {
+?>
+var ns="";
+<?php echo $jsMakeSrc; ?>
+editor.setHTML(ns);
+<? } ?>
Index: /branches/new-dialogs-merge/plugins/HtmlTidy/README
===================================================================
--- /branches/new-dialogs-merge/plugins/HtmlTidy/README (revision 677)
+++ /branches/new-dialogs-merge/plugins/HtmlTidy/README (revision 677)
@@ -0,0 +1,104 @@
+// Plugin for htmlArea to run code through the server's HTML Tidy
+// By Adam Wright, for The University of Western Australia
+//
+//   Email:      zeno@ucc.gu.uwa.edu.au
+//   Homepage:   http://blog.hipikat.org/
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// Version: 0.5
+// Released to the outside world: 04/03/04
+
+
+HtmlTidy is a plugin for the popular cross-browser TTY WYSIWYG editor,
+htmlArea (http://www.interactivetools.com/products/htmlarea/). HtmlTidy
+basically queries HTML Tidy (http://tidy.sourceforge.net/) on the
+server side, getting it to make-html-nice, instead of relying on masses
+of javascript, which the client would have to download.
+
+Hi, this is a quick explanation of how to install HtmlTidy. Much better
+documentation is probably required, and you're welcome to write it :)
+
+
+* The HtmlTidy directory you should have found this file in should
+  include the following:
+
+  - README
+        This file, providing help installing the plugin.
+
+  - html-tidy-config.cfg
+        This file contains the configuration options HTML Tidy uses to
+        clean html, and can be modified to suit your organizations
+        requirements.
+
+  - html-tidy-logic.php
+        This is the php script, which is queried with dirty html and is
+        responsible for invoking HTML Tidy, getting nice new html and
+        returning it to the client.
+
+  - html-tidy.js
+        The main htmlArea plugin, providing functionality to tidy html
+        through the htmlArea interface.
+
+  - htmlarea.js.onmode_event.diff
+        At the time of publishing, an extra event handler was required
+        inside the main htmlarea.js file. htmlarea.js may be patched
+        against this file to make the changes reuquired, but be aware
+        that the event handler may either now be in the core or
+        htmlarea.js may have changed enough to invalidate the patch.
+	
+	UPDATE: now it exists in the official htmlarea.js; applying
+	this patch is thus no longer necessary.
+
+  - img/html-tidy.gif
+        The HtmlTidy icon, for the htmlArea toolbar. Created by Dan
+        Petty for The University of Western Australia.
+
+  - lang/en.js
+        English language file. Add your own language files here and
+        please contribute back into the htmlArea community!
+
+  The HtmlArea directory should be extracted to your htmlarea/plugins/
+  directory.
+
+
+* Make sure the onMode event handler mentioned above, regarding
+  htmlarea.js.onmode_event.diff, exists in your htmlarea.js
+
+
+* html-tidy-logic.php should be executable, and your web server should
+  be configured to execute php scripts in the directory
+  html-tidy-logic.php exists in.
+
+
+* HTML Tidy needs to be installed on your server, and 'tidy' should be
+  an alias to it, lying in the PATH known to the user executing such
+  web scripts.
+
+
+* In your htmlArea configuration, do something like this:
+
+    HTMLArea.loadPlugin("HtmlTidy");
+
+    editor = new HTMLArea("doc");
+    editor.registerPlugin("HtmlTidy");
+
+
+* Then, in your htmlArea toolbar configuration, use:
+
+    - "HT-html-tidy"
+        This will create the 'tidy broom' icon on the toolbar, which
+        will attempt to tidy html source when clicked, and;
+
+    - "HT-auto-tidy"
+        This will create an "Auto Tidy" / "Don't Tidy" dropdown, to
+        select whether the source should be tidied automatically when
+        entering source view. On by default, if you'd like it otherwise
+        you can do so programatically after generating the toolbar :)
+        (Or just hack it to be otherwise...)
+    
+
+Thank you.
+
+Any bugs you find can be emailed to zeno@ucc.gu.uwa.edu.au
Index: /branches/new-dialogs-merge/plugins/InsertPicture/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/lang/pt_br.js (revision 901)
@@ -0,0 +1,61 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  " Open file in new window": " Abrir arquivo em um nova janela",
+  "Absbottom": "Inferior Absoluto",
+  "Absmiddle": "Meio Absoluto",
+  "Alignment:": "Alinhamento:",
+  "Alternate text:": "Texto Alternativo:",
+  "Baseline": "Linha de Base",
+  "Border thickness:": "Espessura da Borda",
+  "Bottom": "Inferior",
+  "Cancel": "Cancelar",
+  "Enter the image URL here": "Entre aqui com a URL da imagem",
+  "For browsers that don't support images": "Para navegadores que não suportam imagens",
+  "Height:": "Altura:",
+  "Horizontal padding": "Espaço horizontal",
+  "Horizontal:": "Horizontal:",
+  "Image Preview:": "Visualização da Imagem:",
+  "Image URL:": "URL da Imagem:",
+  "Insert Image": "Inserir Imagem",
+  "Layout": "Esquema",
+  "Leave empty for no border": "Deixe em branco para sem bordas",
+  "Leave empty for not defined": "Deixe em branco para não definido",
+  "Left": "Esquerda",
+  "Middle": "Meio",
+  "Not set": "Não definido",
+  "OK": "OK",
+  "Open file in new window": "Abrir arquivo em uma nova janela",
+  "Positioning of this image": "Posicionamento desta imagem",
+  "Preview": "Visualização",
+  "Preview the image in a new window": "Visualizar imagem em uma nova janela",
+  "Right": "Direita",
+  "Size": "Tamanho",
+  "Spacing": "Espaço",
+  "Texttop": "Texto no topo",
+  "Top": "Topo",
+  "Upload file": "Enviar arquivo",
+  "Vertical padding": "Espaço vertical",
+  "Vertical:": "Vertical:",
+  "Width:": "Largura:",
+  
+  // not find with lc_parse_strings.php  
+  "The file you are uploading doesn't have the correct extension.": "O arquivo que você está enviando não possuia a extensão correta.",
+  "The file you are uploading already exists.": "Já existe o arquivo que você está enviando.",
+  "The file you are uploading is to big. The max Filesize is": "O arquivo que você está enviando é muito grande. O tamanho máximo é",
+  "Images on the Server:": "Imagens no Servidor:",
+  "Please select a file to upload.": "Por favor, selecione um arquivo para enviar."
+}
Index: /branches/new-dialogs-merge/plugins/InsertPicture/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/lang/fr.js (revision 677)
@@ -0,0 +1,22 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Insert Image": "InsÃ©rer une image",
+  "Image Preview:": "PrÃ©visualisation",
+  "Image URL:": "URL",
+  "Preview": "PrÃ©visualisation",
+  "Alternate text:": "Texte alternatif",
+  "Layout": "Layout",
+  "Alignment:": "Alignement",
+  "Border thickness:": "Epaisseur bordure",
+  "Spacing": "Espacement",
+  "Horizontal:": "Horizontal",
+  "Vertical:": "Vertical",
+  "The file you are uploading doesn't have the correct extension.": "Le fichier que vous tÃ©lÃ©chargez ne possÃšde pas la bonne extension.",
+  "The file you are uploading already exists.": "Le fichier que vous tÃ©lÃ©chargez existe dÃ©jÃ .",
+  "The file you are uploading is to big. The max Filesize is": "Le fichier que vous uploadez est trop gros. La taille maximum est",
+  "Images on the Server:": "Images sur le serveur",
+  "Please select a file to upload.": "Veuillez sÃ©lectionner un fichier a tÃ©lÃ©charger",
+  "Upload file": "TÃ©lÃ©charger",
+  "Open file in new window": "Ouvrir le fichier dans une nouvelle fenÃªtre"
+};
Index: /branches/new-dialogs-merge/plugins/InsertPicture/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/lang/de.js (revision 686)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/lang/de.js (revision 686)
@@ -0,0 +1,15 @@
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Sponsored by http://www.schaffrath-neuemedien.de
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "The file you are uploading doesn't have the correct extension.": "Die hochgeladene Datei ist im falschen Format.",
+  "The file you are uploading already exists.": "Eine Datei mit diesem Namen existiert schon.",
+  "The file you are uploading is to big. The max Filesize is": "Die hochgeladene Datei ist zu groÃ. Die maximakle DateigrÃ¶Ãe betrÃ€gt",
+  "Images on the Server:": "Bilder auf dem Server:",
+  "Please select a file to upload.": "WÃ€hlen Sie eine Datei zum hochladen aus.",
+  "Upload file": "Datei hochladen",
+  "Open file in new window": "Datei in neuen Fenster anzeigen",
+  "Size": "GrÃ¶Ãe",
+  "Width:": "Breite",
+  "Height:": "HÃ¶he"
+};
Index: /branches/new-dialogs-merge/plugins/InsertPicture/lang/sv.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/lang/sv.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/lang/sv.js (revision 677)
@@ -0,0 +1,35 @@
+// I18N constants
+// LANG: "sv", ENCODING: UTF-8
+// Swedish version for rev. 477 (Mar 2006) by Thomas Loo <tloo@saltstorm.net>
+
+{
+  "Insert Image": "Infoga bild",
+  "Image Preview:": "FÃ¶rhandsgranskning:",
+  "Image URL:": "Bildens URL:",
+  "Preview": "FÃ¶rhandsgranska",
+  "Alternate text:": "Alternativ text:",
+  "Layout": "Layout",
+  "Alignment:": "Placering:",
+  "Border thickness:": "Ramtjocklek:",
+  "Spacing": "Marginal",
+  "Horizontal:": "Horisontell:",
+  "Vertical:": "Vertikal:",
+  "The file you are uploading doesn't have the correct extension.": "Uppladdat bild har en ogiltig filÃ€ndelse, uppladdning avbruten",
+  "The file you are uploading already exists.": "En fil med detta namn finns redan",
+  "The file you are uploading is to big. The max Filesize is": "Filen Ã€r fÃ¶r stor, maximal filstorlek Ã€r",
+  "Images on the Server:": "Bilder pÃ¥ servern:",
+  "Please select a file to upload.": "VÃ€lj bild att ladda upp",
+  "Upload file": "Ladda upp bild",
+  "Size": "Storlek",
+  "Width:": "Bredd:",
+  "Height:": "HÃ¶jd:",
+  // tooltips
+  "Enter the image URL here":"Bildens sÃ¶kvÃ€g (URL)",
+  "Preview the image in a new window": "Ãppna bild i nytt fÃ¶nster",
+  "For browsers that don't support images":"Beskrivande text fÃ¶r weblÃ€sare som inte stÃ¶djer inbÃ€ddade bilder",
+  "Positioning of this image": "Bildens positionering",
+  "Leave empty for no border": "LÃ€mna tomt fÃ¶r att undvika ram",
+  "Leave empty for not defined": "LÃ€mna tomt fÃ¶r att lÃ¥ta weblÃ€saren bestÃ€mma",
+  "Horizontal padding": "Horizontellt indrag pÃ¥ bild",
+  "Vertical padding": "Vertikalt indrag pÃ¥ bild"
+};
Index: /branches/new-dialogs-merge/plugins/InsertPicture/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/lang/nl.js (revision 872)
@@ -0,0 +1,35 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+
+{
+  "Insert Image": "Afbeelding invoegen",
+  "Image Preview:": "Afbeeldingsvoorbeeld:",
+  "Image URL:": "Afbeelding URL:",
+  "Preview": "Voorbeeld",
+  "Alternate text:": "Alternatieve tekst:",
+  "Layout": "Weergave",
+  "Alignment:": "Positie:",
+  "Border thickness:": "Rand dikte:",
+  "Spacing": "Marge",
+  "Horizontal:": "Horizontaal:",
+  "Vertical:": "Verticaal:",
+  "The file you are uploading doesn't have the correct extension.": "Het bestand dat is geupload heeft niet de juiste extentie.",
+  "The file you are uploading already exists.": "Het bestand dat is geupload bestaat al.",
+  "The file you are uploading is to big. The max Filesize is": "Het bestand dat is geupload is te groot. De maximaal toegestane grootte is:",
+  "Images on the Server:": "Afbeeldingen op de server:",
+  "Please select a file to upload.": "Selecteer een bestand om te uploaden",
+  "Upload file": "Upload bestand",
+  "Size": "Grootte",
+  "Width:": "Breedte:",
+  "Height:": "Hoogte:",
+  // tooltips
+  "Enter the image URL here":"Afbeeldingslocatie (URL)",
+  "Preview the image in a new window": "Afbeelding bekijken in nieuw venster",
+  "For browsers that don't support images":"Voor browsers welke geen afbeeldingen ondersteunen",
+  "Positioning of this image": "Positie van de afbeelding",
+  "Leave empty for no border": "Leeg voor geen rand",
+  "Leave empty for not defined": "Leeg voor niet gedefinieerd",
+  "Horizontal padding": "Horizontale ruimte",
+  "Vertical padding": "Verticale ruimte"
+};
Index: /branches/new-dialogs-merge/plugins/InsertPicture/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/lang/ja.js (revision 715)
@@ -0,0 +1,28 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Insert Image": "ç»åã®æ¿å
+¥",
+  "Image Preview:": "ç»åãã¬ãã¥ãŒ:",
+  "Image URL:": "ç»åURL:",
+  "Preview": "è¡šç€º",
+  "Alternate text:": "ä»£æ¿ãã­ã¹ã:",
+  "Layout": "ã¬ã€ã¢ãŠã",
+  "Alignment:": "è¡æã:",
+  "Border thickness:": "å¢çç·ã®å¹
+:",
+  "Spacing": "éé",
+  "Horizontal:": "æ°Žå¹³:",
+  "Vertical:": "åçŽ:",
+  "The file you are uploading doesn't have the correct extension.": "ã¢ããã­ãŒãå¯Ÿè±¡ãã¡ã€ã«ã«æ­£ããæ¡åŒµå­ããããŸããã",
+  "The file you are uploading already exists.": "ã¢ããã­ãŒãå¯Ÿè±¡ãã¡ã€ã«ã¯ãã§ã«å­åšããŸãã",
+  "The file you are uploading is to big. The max Filesize is": "ã¢ããã­ãŒãå¯Ÿè±¡ãã¡ã€ã«ã¯å€§ããããŸãããã¡ã€ã«ãµã€ãºã®äžé:",
+  "Images on the Server:": "ãµãŒãäžã®ç»å:",
+  "Please select a file to upload.": "ã¢ããã­ãŒããããã¡ã€ã«ãéžæããŠãã ããã",
+  "Upload file": "UPLOAD FILE",
+  "Open file in new window": "æ°ãããŠã£ã³ããŠã§ãã¡ã€ã«ãéã",
+  "Size": "ãµã€ãº",
+  "Width:": "å¹
+:",
+  "Height:": "é«ã:"
+};
Index: /branches/new-dialogs-merge/plugins/InsertPicture/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/lang/nb.js (revision 677)
@@ -0,0 +1,23 @@
+// LANG: "nb", ENCODING: UTF-8 | ISO-8859-1
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Insert Image": "Sett inn bilde",
+  "Image Preview:": "ForhÃ¥ndsvisning:",
+  "Image URL:": "Bildets URL:",
+  "Preview": "ForhÃ¥ndsvisning",
+  "Alternate text:": "Alternativ tekst",  
+  "Layout": "Oppsett",
+  "Alignment:": "Plassering",
+  "Border thickness:": "Rammetykkelse:",
+  "Spacing": "Luft rundt bildet",
+  "Horizontal:": "Horisontal:",
+  "Vertical:": "Vertikal:",
+  "The file you are uploading doesn't have the correct extension.": "Bildet du laster opp har et ugyldig format, opplastning avbrutt",
+  "The file you are uploading already exists.": "Bildet du prÃžver Ã¥ laste opp eksisterer allerede pÃ¥ serveren",
+  "The file you are uploading is to big. The max Filesize is": "Bildet du laster opp er for stort, maks tillatt stÃžrrelse er",
+  "Images on the Server:": "Bilder pÃ¥ serveren:",
+  "Please select a file to upload.": "Velg bilde du skal laste opp",
+  "Upload file": "Last opp bilde",
+  "Open file in new window": "Ã
+pne bilde i nytt vindu"
+};
Index: /branches/new-dialogs-merge/plugins/InsertPicture/InsertPicture.php
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/InsertPicture.php (revision 987)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/InsertPicture.php (revision 987)
@@ -0,0 +1,301 @@
+<?PHP
+  //this plugin only use the relativ webpath to the picturefolder
+  //default ~  /Xinha/plugins/InsertPicture/demo_pictures/
+  strstr( PHP_OS, "WIN") ? $strPathSeparator = "\\" : $strPathSeparator = "/";
+  if (isset($_REQUEST['picturepath'])) {
+    $PicturePath = $_REQUEST['picturepath'];
+
+    $AInsertPicturePath = explode ('/', dirname($_SERVER['PHP_SELF']));
+    $ALocalInsertPicturePath = explode($strPathSeparator, dirname(__FILE__));
+    $AtheRootPath = array_values (array_diff ($ALocalInsertPicturePath, $AInsertPicturePath));
+    $RootPath = implode($strPathSeparator, $AtheRootPath);
+
+    $LocalPicturePath = str_replace('http://'.$_SERVER['HTTP_HOST'], "", $PicturePath);
+    $LocalPicturePath = str_replace('/', $strPathSeparator, $LocalPicturePath);
+    $LocalPicturePath = $RootPath.$LocalPicturePath;
+
+    $LocalPicturePath = dirname(__FILE__).$strPathSeparator.'demo_pictures'.$strPathSeparator;
+    //$LocalPicturePath = realpath('../../../../images/content/').$strPathSeparator;
+  }
+  $limitedext = array(".gif",".jpg",".png",".jpeg"); //Extensions you want files uploaded limited to.
+  $limitedsize = "1000000"; //size limit in bytes
+  $message = "";
+
+  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';
+  }
+  $DestFileName = "";
+  if (isset($_FILES['file'])) {
+    $file = $_FILES['file'];
+    $ext = strrchr($file['name'],'.');
+    if (!in_array($ext,$limitedext))
+      $message = "The file you are uploading doesn't have the correct extension.";
+    else if (file_exists($LocalPicturePath.$file['name']))
+      $message = "The file you are uploading already exists.";
+    else if ($file['size'] > $limitedsize)
+      $message = "The file you are uploading is to big. The max Filesize is</span><span> ".formatSize($limitedsize).".";
+    else
+      copy($file['tmp_name'], $LocalPicturePath.$file['name']);
+    $DestFileName = $file['name'];
+  }
+?>
+<html>
+<head>
+  <title>Insert Image</title>
+<link rel="stylesheet" type="text/css" href="../../popups/popup.css" />
+<script type="text/javascript" src="../../popups/popup.js"></script>
+
+<script type="text/javascript">
+  window.resizeTo(500, 490);
+var Xinha = window.opener.Xinha;
+function i18n(str) {
+  return (Xinha._lc(str, 'Xinha'));
+}
+
+function Init() {
+  __dlg_translate("InsertPicture");
+  __dlg_init();
+
+  // Make sure the translated string appears in the drop down. (for gecko)
+  document.getElementById("f_align").selectedIndex = 0;
+  document.getElementById("f_align").selectedIndex = document.getElementById("f_align").selectedIndex;
+  var param = window.dialogArguments;
+  if (param) {
+      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_align").value = param["f_align"];
+      document.getElementById("f_vert").value = (param["f_vert"]!="-1") ? param["f_vert"] : "";
+      document.getElementById("f_horiz").value = (param["f_horiz"]!="-1") ? param["f_horiz"] : "";
+      document.getElementById("f_height").value = param["f_height"];
+      document.getElementById("f_width").value = param["f_width"];
+      window.ipreview.location.replace(param.f_url);
+  }
+  document.getElementById("f_url").focus();
+  document.getElementById("filelist").selectedIndex = document.getElementById("filelist").selectedIndex;
+<?php If ($DestFileName<>"")
+  echo "CopyToURL(\"".$PicturePath.$DestFileName."\");"
+?>
+}
+
+function onOK() {
+  var required = {
+    "f_url": i18n("You must enter the URL")
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(required[i]);
+      el.focus();
+      return false;
+    }
+  }
+  // pass data back to the calling window
+  var fields = ["f_url", "f_alt", "f_align", "f_border", "f_horiz", "f_vert", "f_width", "f_height"];
+  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 onUpload() {
+  var required = {
+    "file": i18n("Please select a file to upload.")
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(required[i]);
+      el.focus();
+      return false;
+    }
+  }
+  return true;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+function onPreview() {
+  var f_url = document.getElementById("f_url");
+  var url = f_url.value;
+  if (!url) {
+    alert(i18n("You must enter the URL"));
+    f_url.focus();
+    return false;
+  }
+  if (document.all) {
+    window.ipreview.location.replace('viewpicture.html?'+url);
+  } else {
+    window.ipreview.location.replace(url);
+  }
+  return false;
+}
+
+var img = new Image();
+function imgWait() {
+  waiting = window.setInterval("imgIsLoaded()", 1000)
+}
+function imgIsLoaded() {
+  if(img.width > 0) {
+    window.clearInterval(waiting)
+    document.getElementById("f_width").value = img.width;
+    document.getElementById("f_height").value = img.height;
+  }
+}
+
+function CopyToURL(imgName) {
+  document.getElementById("f_url").value = imgName;
+  onPreview();
+  img.src = imgName;
+  img.onLoad = imgWait()
+}
+
+function openFile() {
+  window.open(document.getElementById("f_url").value,'','');
+}
+</script>
+</head>
+<body class="dialog" onload="Init()">
+<div class="title">Insert Image</div>
+<table border="0" width="100%" style="padding: 0px; margin: 0px">
+  <tbody>
+  <tr>
+    <td>Images on the Server:<?php /*echo $LocalPicturePath*/ ?><br>
+    <select id="filelist" name="filelist" style="width:200" size="10" onClick="CopyToURL(this[this.selectedIndex].value);">
+<?php
+  $d = @dir($LocalPicturePath);
+  while (false !== ($entry = $d->read())) {
+    if(substr($entry,0,1) != '.') {  //not a dot file or directory
+      if ($entry == $DestFileName)
+        echo '<OPTION value="' . $PicturePath.$entry. '" selected="selected">' . $entry . '(' . formatSize(filesize($LocalPicturePath.'\\'.$entry)) .')</OPTION>';
+      else
+        echo '<OPTION value="' . $PicturePath.$entry. '">' . $entry . '(' . formatSize(filesize($LocalPicturePath.'\\'.$entry)) .')</OPTION>';
+    }
+  }
+  $d->close();
+?>
+    </select>
+
+      <form method="post" action="" enctype="multipart/form-data">
+        <input type="hidden" name="localpicturepath" value="<?php echo $LocalPicturePath ?>">
+        <input type="hidden" name="picturepath" value="<?php echo $PicturePath ?>">
+        <input type="file" name="file" id="file" size="30"><br>
+        <button type="submit" name="ok" onclick="onUpload();">Upload file</button><br>
+        <span><?php echo $message ?></span>
+      </form>
+
+    </td>
+    <td style="vertical-align: middle;" width="200" height="230">
+    <span>Image Preview:</span>
+    <a href="#" onClick="javascript:openFile();"title=" Open file in new window"><img src="img/btn_open.gif"  width="18" height="18" border="0" title="Open file in new window" /></a><br />
+    <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="200" src=""></iframe>
+    </td>
+  </tr>
+  </tbody>
+</table>
+
+<form action="" method="get">
+  <input type="hidden" name="localpicturepath" value="<?php echo $LocalPicturePath ?>">
+  <input type="hidden" name="picturepath" value="<?php echo $PicturePath ?>">
+<table border="0" width="100%" style="padding: 0px; margin: 0px">
+  <tbody>
+
+  <tr>
+    <td style="width: 7em; text-align: right">Image URL:</td>
+    <td><input type="text" name="url" id="f_url" style="width:75%"
+      title="Enter the image URL here"  value="<?php echo $PicturePath.$DestFileName ?>"/>
+      <button name="preview" onclick="return onPreview();"
+      title="Preview the image in a new window">Preview</button>
+    </td>
+  </tr>
+  <tr>
+    <td style="width: 7em; text-align: right">Alternate text:</td>
+    <td><input type="text" name="alt" id="f_alt" style="width:100%"
+      title="For browsers that don't support images" /></td>
+  </tr>
+
+  </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl" style="width: 6em;">Alignment:</div>
+<select size="1" name="align" id="f_align"
+  title="Positioning of this image">
+  <option value=""                             >Not set</option>
+  <option value="left"                         >Left</option>
+  <option value="right"                        >Right</option>
+  <option value="texttop"                      >Texttop</option>
+  <option value="absmiddle"                    >Absmiddle</option>
+  <option value="baseline"                     >Baseline</option>
+  <option value="absbottom"                    >Absbottom</option>
+  <option value="bottom"                       >Bottom</option>
+  <option value="middle"                       >Middle</option>
+  <option value="top"                          >Top</option>
+</select>
+
+<p />
+
+<div class="fl" style="width: 6em;">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5" title="Leave empty for no border" />
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Size</legend>
+
+<div class="space"></div>
+
+<div class="fl" style="width: 5em;">Width:</div>
+<input type="text" name="width" id="f_width" size="5" title="Leave empty for not defined" />
+<p />
+
+<div class="fl" style="width: 5em;">Height:</div>
+<input type="text" name="height" id="f_height" size="5" title="Leave empty for not defined" />
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr" style="width: 5em;">Horizontal:</div>
+<input type="text" name="horiz" id="f_horiz" size="5" title="Horizontal padding" />
+<p />
+
+<div class="fr" style="width: 5em;">Vertical:</div>
+<input type="text" name="vert" id="f_vert" size="5" title="Vertical padding" />
+
+<div class="space"></div>
+
+</fieldset>
+<br clear="all" />
+
+<div id="buttons">
+  <button type="submit" name="ok" onclick="return onOK();">OK</button>
+  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/InsertPicture/insert-picture.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/insert-picture.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/insert-picture.js (revision 999)
@@ -0,0 +1,25 @@
+// Insert Image plugin for Xinha
+// Original Author - Udo Schmal
+//
+// (c) www.Schaffrath-NeueMedien.de  2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function InsertPicture(editor) {
+  if ( typeof _editor_picturePath !== "string" )
+    _editor_picturePath = Xinha.getPluginDir("InsertPicture") + "/demo_pictures/";
+  InsertPicture.Scripting = "php"; //else "asp"
+  editor.config.URIs.insert_image =  '../plugins/InsertPicture/InsertPicture.' + InsertPicture.Scripting + '?picturepath=' + _editor_picturePath;
+}
+
+InsertPicture._pluginInfo = {
+  name          : "InsertPicture",
+  version       : "1.0.2",
+  developer     : "Udo Schmal",
+  developer_url : "http://www.Schaffrath-NeueMedien.de/",
+  sponsor       : "L.N.Schaffrath NeueMedien",
+  sponsor_url   : "http://www.schaffrath-neuemedien.de/",
+  c_owner       : "Udo Schmal",
+  license       : "htmlArea"
+};
+
Index: /branches/new-dialogs-merge/plugins/InsertPicture/viewpicture.html
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertPicture/viewpicture.html (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertPicture/viewpicture.html (revision 677)
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+	<title>Preview</title>
+<script language="JavaScript" type="text/javascript">
+<!--
+function imgWait() {
+	waiting = window.setInterval("imgIsLoaded()", 1000);
+}
+function imgIsLoaded() {
+	if(document.getElementById("myImg").width > 0) {
+	  window.clearInterval(waiting);
+	  imgShowWidth();
+	}
+}
+function imgShowWidth() {
+	var width    = document.getElementById("myImg").width;
+	var height   = document.getElementById("myImg").height;
+	if(width > 120) {
+	  var dx = (120 / width);
+	  var dy = (120 / height);
+	  ratio  = dx < dy ? dx : dy;
+	  // keep aspect ratio
+	  width  = width * ratio;
+	  height = height * ratio;
+	  document.getElementById("myImg").width  = width;
+	  document.getElementById("myImg").height = height;
+	}
+	document.getElementById("myImg").style.visibility = 'visible';
+}
+function showPreview() {
+	img = document.location.toString().split("?");
+    document.getElementById("myImg").src = img[1];
+	img.onLoad = imgWait();
+}
+//-->
+</script>
+</head>
+<body  marginwidth="5px" marginheight="5px" topmargin="5px" leftmargin="5px" rightmargin="5px">
+<img id="myImg" src="" Style="visibility:hidden">
+<script language="JavaScript" type="text/javascript">
+  showPreview();
+</script>
+
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Abbreviation/abbreviation.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/abbreviation.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/abbreviation.js (revision 999)
@@ -0,0 +1,91 @@
+// Abbreviation plugin for Xinha
+// Implementation by Udo Schmal & Schaffrath NeueMedien
+// Original Author - Udo Schmal
+//
+// (c) Udo Schmal & Schaffrath NeueMedien 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function Abbreviation(editor) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+
+  // register the toolbar buttons provided by this plugin
+  cfg.registerButton({
+    id       : "abbreviation",
+    tooltip  : this._lc("Abbreviation"),
+    image    : editor.imgURL("ed_abbreviation.gif", "Abbreviation"),
+    textMode : false,
+    action   : function(editor) {
+                 self.buttonPress(editor);
+               }
+  })
+  cfg.addToolbarElement("abbreviation", "inserthorizontalrule", 1);
+}
+
+Abbreviation._pluginInfo = {
+  name          : "Abbreviation",
+  version       : "1.0",
+  developer     : "Udo Schmal",
+  developer_url : "",
+  sponsor       : "L.N.Schaffrath NeueMedien",
+  sponsor_url   : "http://www.schaffrath-neuemedien.de/",
+  c_owner       : "Udo Schmal & Schaffrath-NeueMedien",
+  license       : "htmlArea"
+};
+
+Abbreviation.prototype._lc = function(string) {
+    return Xinha._lc(string, 'Abbreviation');
+};
+
+Abbreviation.prototype.onGenerate = function() {
+  this.editor.addEditorStylesheet(Xinha.getPluginDir('Abbreviation') + '/abbreviation.css');
+};
+
+Abbreviation.prototype.buttonPress = function(editor, context, updatecontextclass) {
+  var outparam = null;
+  var html = editor.getSelectedHTML();
+  var sel  = editor._getSelection();
+  var range  = editor._createRange(sel);
+  var abbr = editor._activeElement(sel);
+  if(!(abbr != null && abbr.tagName.toLowerCase() == "abbr")) {
+    abbr = editor._getFirstAncestor(sel, 'abbr');
+  }
+  if (abbr != null && abbr.tagName.toLowerCase() == "abbr")
+    outparam = { title : abbr.title,
+                 text : abbr.innerHTML};
+  else
+    outparam = { title : '',
+                 text : html};
+
+  editor._popupDialog( "plugin://Abbreviation/abbreviation", function( param ) {
+    if ( param ) {
+      var title = param["title"];
+      if (title == "" || title == null) {
+        if (abbr) {
+          var child = abbr.innerHTML;
+          abbr.parentNode.removeChild(abbr);
+          editor.insertHTML(child);
+        }
+        return;
+      }
+      try {
+        var doc = editor._doc;
+        if (!abbr) {
+          abbr = doc.createElement("abbr");
+          abbr.title = title;
+          abbr.innerHTML = html;
+          if (Xinha.is_ie) {
+            range.pasteHTML(abbr.outerHTML);
+          } else {
+            editor.insertNodeAtSelection(abbr);
+          }
+        } else {
+          abbr.title = title;
+        }
+      }
+      catch (e) { }
+    }
+  }, outparam);
+};
Index: /branches/new-dialogs-merge/plugins/Abbreviation/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/lang/pt_br.js (revision 901)
@@ -0,0 +1,22 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Abbreviation": "Abreviação",
+  "Cancel": "Cancelar",
+  "Delete": "Apagar",
+  "Expansion:": "Expandir:",
+  "OK": "OK"
+}
Index: /branches/new-dialogs-merge/plugins/Abbreviation/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/lang/fr.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Abbreviation": "AbrÃ©viation",
+  "Expansion:": "Explication",
+  "Delete": "Supprimer"
+};
Index: /branches/new-dialogs-merge/plugins/Abbreviation/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/lang/de.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "Abbreviation": "AbkÃŒrzung",
+  "Expansion:": "ErklÃ€rung:",
+  "Delete": "LÃ¶schen"
+};
Index: /branches/new-dialogs-merge/plugins/Abbreviation/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/lang/nl.js (revision 872)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Abbreviation": "Afkorting",
+  "Expansion:": "Uitbreiding:",
+  "Delete": "Verwijderen"
+};
Index: /branches/new-dialogs-merge/plugins/Abbreviation/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/lang/ja.js (revision 715)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Abbreviation": "ç¥èª",
+  "Expansion:": "å±éãããèª:",
+  "Delete": "åé€"
+};
Index: /branches/new-dialogs-merge/plugins/Abbreviation/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/lang/nb.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Abbreviation": "Beskrive forkortelse",
+  "Expansion:": "Betydning:",
+  "Delete": "Fjerne"
+};
Index: /branches/new-dialogs-merge/plugins/Abbreviation/abbr/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/abbr/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/abbr/de.js (revision 677)
@@ -0,0 +1,40 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Author: Udo Schmal, <schmal@schaffrath-neuemedien.de>
+//
+// (c) Udo Schmal & Schaffrath NeueMedien 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+{
+  "Abs.": "Absatz",
+  "bspw.": "Beispielsweise",
+  "bzw.": "beziehungsweise",
+  "c/o": "care of / bei, zu HÃ€nden von",
+  "ca.": "circa",
+  "d.h.": "das heiÃt",
+  "d.J.": "des Jahres",
+  "Dr.": "Doktor",
+  "e.V.": "Eingetragener Verein",
+  "eG.": "Eingetragene Genossenschaft",
+  "ehem.": "ehemals",
+  "einschl.": "einschlieÃlich",
+  "etc.": "et cetera / und so weiter",
+  "evtl.": "eventuell",
+  "ff.": "(fort) folgende",
+  "gem.": "gemÃ€Ã",
+  "inkl.": "inklusive",
+  "max.": "maximal / maximum",
+  "min.": "mindestens / minimum / minimal",
+  "o.g.": "oben genannt",
+  "rd.": "rund",
+  "S.": "Seite",
+  "u.a.": "unter anderem",
+  "u.Ã€.": "und Ã€hnlich",
+  "usw.": "und so weiter",
+  "vgl.": "vergleiche",
+  "z.B.": "zum Beispiel",
+  "z.T.": "zum Teil",
+  "z.Z.": "zur Zeit",
+  "zzgl.": "zuzÃŒglich"
+};
Index: /branches/new-dialogs-merge/plugins/Abbreviation/abbr/en.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/abbr/en.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/abbr/en.js (revision 677)
@@ -0,0 +1,16 @@
+// I18N constants
+// LANG: "en", ENCODING: UTF-8
+// Author: Udo Schmal, <schmal@schaffrath-neuemedien.de>
+//
+// (c) Udo Schmal & Schaffrath NeueMedien 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+{
+  "ANSI": "American National Standards Institute",  
+  "ASA": "American Standards Association",
+  "ISO": "International Organisation for Standardization",
+  "mime": "Multipurpose Internet Mail Extensions",
+  "UTF": "Unicode Transformation Format",
+  "W3C": "World Wide Web Consortium"
+};
Index: /branches/new-dialogs-merge/plugins/Abbreviation/popups/abbreviation.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/popups/abbreviation.html (revision 858)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/popups/abbreviation.html (revision 858)
@@ -0,0 +1,92 @@
+<html>
+<head>
+  <title>Abbreviation</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+var Abbreviation = window.opener.Abbreviation; // load the Abbreviation plugin and lang file ;-)
+
+function fillSelect(text) {
+  var abbr = window.location.href;
+  abbr = abbr.replace(/popups\/abbreviation.html/g, "abbr\/" + window.opener._editor_lang + ".js");
+  var abbrData = Xinha._geturlcontent(abbr);
+  if (abbrData) {
+    eval('abbrObj = ' + abbrData);
+    if (abbrObj != "") {
+      dest = document.getElementById("select");
+      for (var i in abbrObj) {
+        same = (i==text);
+        dest.options[dest.options.length] = new Option(i + "=" + abbrObj[i], abbrObj[i], false, same);
+        if (same)
+        document.getElementById("title").value = abbrObj[i];
+      }
+    }
+  }
+}
+
+function Init() {
+  __dlg_translate("Abbreviation");
+  __dlg_init(null,{width: 260, height: 160});
+  var param = window.dialogArguments;
+  var text = null;
+  if (param) {
+    text = param["text"];
+    document.getElementById("title").value = param["title"];
+  }
+  fillSelect(text);
+  document.getElementById("title").focus();
+};
+
+function onOK() {
+  var param = new Object();
+  param["title"] = document.getElementById("title").value;
+  __dlg_close(param);
+  return false;
+}
+
+
+function onDelete() {
+  // pass data back to the calling window
+  var param = new Object();
+  param["title"] = "";
+  __dlg_close(param);
+  return false;
+};
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+};
+</script>
+
+</head>
+<body class="dialog" onload="Init()">
+<div class="title">Abbreviation</div>
+<form name="form" action="">
+<table border="0" style="width: 100%;">
+  <tr>
+    <td class="lable">Expansion:</td>
+    <td>
+    <select id="select" name="select"
+            onChange="document.form.title.value=document.form.select.options[document.form.select.selectedIndex].value"
+            style="position:absolute; top:35px; left:100px; width:118px; clip:rect(0 120 22 100)">
+      <option value=""></option>
+
+    </select>
+    <input type="text" id="title" name="title"
+           onChange="document.form.select.selectedIndex=-1"
+           style="position:absolute; top:35px; left:100px; width:100px; border-right:0">
+    <!--<input type="text" id="title" name="title" value="" size="30">-->
+    </td>
+  </tr>
+</table>
+
+<div id="buttons">
+   <button type="submit" name="ok" onclick="return onOK();">OK</button>
+   <button type="button" name="delete" onclick="return onDelete();">Delete</button>
+   <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Abbreviation/abbreviation.css
===================================================================
--- /branches/new-dialogs-merge/plugins/Abbreviation/abbreviation.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/Abbreviation/abbreviation.css (revision 677)
@@ -0,0 +1,11 @@
+abbr, acronym, span.abbr {
+  width: 18px;
+  height: 18px;
+	background-image: url(img/ed_abbreviation.gif);	
+	background-repeat: no-repeat;
+	background-position: left top;
+	white-space : nowrap;	
+	cursor: help;
+	border-bottom: 1px dashed #000;
+	padding-left: 19px;
+}
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/insert-snippet.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/insert-snippet.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/insert-snippet.js (revision 999)
@@ -0,0 +1,92 @@
+/*------------------------------------------*\
+ InsertSnippet for Xinha
+ _______________________
+ 
+ Insert HTML fragments or template variables
+ 
+\*------------------------------------------*/
+
+function InsertSnippet(editor) {
+	this.editor = editor;
+
+	var cfg = editor.config;
+	var self = this;
+	
+
+	cfg.registerButton({
+	id       : "insertsnippet",
+	tooltip  : this._lc("Insert Snippet"),
+	image    : editor.imgURL("ed_snippet.gif", "InsertSnippet"),
+	textMode : false,
+	action   : function(editor) {
+			self.buttonPress(editor);
+		}
+	});
+	cfg.addToolbarElement("insertsnippet", "insertimage", -1);
+	this.snippets = null;
+	var backend = cfg.InsertSnippet.snippets + '?';
+	
+	if(cfg.InsertSnippet.backend_data != null)
+    {
+    	for ( var i in cfg.InsertSnippet.backend_data )
+        {
+            backend += '&' + i + '=' + encodeURIComponent(cfg.InsertSnippet.backend_data[i]);
+        }
+    }
+    Xinha._getback(backend,function (getback) {eval(getback); self.snippets = snippets;});
+}
+
+InsertSnippet.prototype.onUpdateToolbar = function() {
+	if (!this.snippets){
+		this.editor._toolbarObjects.insertsnippet.state("enabled", false);
+	}
+	else InsertSnippet.prototype.onUpdateToolbar = null;
+}
+
+InsertSnippet._pluginInfo = {
+  name          : "InsertSnippet",
+  version       : "1.2",
+  developer     : "Raimund Meyer",
+  developer_url : "http://rheinauf.de",
+  c_owner       : "Raimund Meyer",
+  sponsor       : "",
+  sponsor_url   : "",
+  license       : "htmlArea"
+};
+
+InsertSnippet.prototype._lc = function(string) {
+    return Xinha._lc(string, 'InsertSnippet');
+};
+
+InsertSnippet.prototype.onGenerate = function() {
+  this.editor.addEditorStylesheet(Xinha.getPluginDir("InsertSnippet") + '/InsertSnippet.css');
+};
+
+Xinha.Config.prototype.InsertSnippet =
+{
+  'snippets' : Xinha.getPluginDir("InsertSnippet")+"/demosnippets.js", // purely demo purposes, you should change this
+  'css' : ['../InsertSnippet.css'], //deprecated, CSS is now pulled from xinha_config
+  'showInsertVariable': false,
+  'backend_data' : null
+};
+	
+InsertSnippet.prototype.buttonPress = function(editor) {
+		var args = editor.config;
+			args.snippets = this.snippets;
+		var self = this;
+		editor._popupDialog( "plugin://InsertSnippet/insertsnippet", function( param ) {
+	
+		if ( !param ) { 
+	      return false;
+	    }
+				   	   
+		
+		editor.focusEditor();
+		if (param['how'] == 'variable') {
+			editor.insertHTML('{'+self.snippets[param["snippetnum"]].id+'}');
+		} else {
+			editor.insertHTML(self.snippets[param["snippetnum"]].HTML);
+	   	}
+  
+    }, args);
+  };
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/readme.html
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/readme.html (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/readme.html (revision 677)
@@ -0,0 +1,57 @@
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>InsertSnippet for Xinha</title>
+  
+<style type="text/css">
+  body { font-family: sans-serif; }
+  pre {border: dotted grey thin; background-color:LightYellow;padding:10px }
+  p { width:500px }
+  </style>
+</head>
+
+<body >
+<h1>InsertSnippet for Xinha</h1>
+<p>Insert HTML fragments in your document.
+
+</p>
+<h2>Usage</h2>
+<p>
+In order to use your own snippets you have to al least one parameter to your xinha_config:
+</p>
+<pre>
+xinha_config.InsertSnippet.snippets = _editor_url+"plugins/InsertSnippet/snippets.php";
+</pre>
+<p>
+The path above indicates the use of the provided backend. This parses a file that contains the snippets and 
+should have the following format:
+</p>
+<pre>
+&lt;!--Snippet ID--&gt;
+Snippet content
+&lt;!--/Snippet ID--&gt;
+...and so on
+</pre>
+<p>
+You can use the snippets.html in the plugin folder or tell the backend where to find the file like this
+</p>
+<pre>
+with (xinha_config.InsertSnippet)
+{
+	&lt;?php
+
+	// define backend configuration for the plugin
+	$backend_data['snippets_file'] = '/file/containing/snippets.html';
+	require_once '../contrib/php-xinha.php';
+	xinha_pass_to_php_backend($backend_data);
+    
+	?&gt;
+}
+</pre>
+
+<p style="font-size:80%">Raimund Meyer (xinha@raimundmeyer.de)</p>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/lang/pt_br.js (revision 901)
@@ -0,0 +1,25 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Cancel": "Cancelar",
+  "Hide preview": "Esconder Visualização",
+  "Insert Snippet": "Inserir Fragmento de Código",
+  "Insert as": "Inserir como",
+  "InsertSnippet for Xinha": "Fragmento de Códigos para o Xinha",
+  "Show preview": "Mostrar Visualização",
+  "This is an information about something": "Isto é uma informação sobre alguma coisa",
+  "Variable": "Variável"
+}
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/lang/de.js (revision 677)
@@ -0,0 +1,10 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+{ 
+	"Insert Snippet": "Snippet einfÃŒgen",
+	"Cancel": "Abbrechen",
+	"Variable":"Variable",
+	"Insert as":"EinfÃŒgen als",
+	"Show preview":"Vorschau zeigen",
+	"Hide preview":"Vorschau verbergen"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/lang/nl.js (revision 872)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{ 
+"Insert Snippet": "Snippet invoegen",
+"Cancel": "Annuleren",
+"Variable":"Variabele",
+"Insert as":"Invoegen als",
+"Show preview":"Laat voorbeeld zien",
+"Hide preview":"Verberg voorbeeld"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/lang/ja.js (revision 715)
@@ -0,0 +1,12 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+	"Insert Snippet": "ã¹ããããã®æ¿å
+¥",
+	"Cancel": "äž­æ­¢",
+	"Variable":"å€æ°",
+	"Insert as":"åœ¢åŒãéžãã§æ¿å
+¥",
+	"Show preview":"ãã¬ãã¥ãŒè¡šç€º",
+	"Hide preview":"ãã¬ãã¥ãŒéè¡šç€º"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/lang/nb.js (revision 677)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{ 
+"Insert Snippet": "Sett inn snutt",
+"Cancel": "Avbryt",
+"Variable":"Variabel",
+"Insert as":"Sett inn som",
+"Show preview":"Vis forhÃ¥ndsvisning",
+"Hide preview":"Skjul forhÃ¥ndsvisning"
+};
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/demosnippets.js
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/demosnippets.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/demosnippets.js (revision 677)
@@ -0,0 +1,15 @@
+var snippets = [];
+var i = 0;
+snippets[i] = {};
+snippets[i]['id'] = 'Box 1';
+snippets[i]['HTML'] = '<div class="message_box red">\n  Visit the <a href="http://xinha.org">Xinha website</a></div>';
+
+i++;
+snippets[i] = {};
+snippets[i]['id'] = 'INFORMATION ABOUT SOMETHING';
+snippets[i]['HTML'] = '<div class="message_box green">\n  This is an information about something\n</div>';
+
+i++;
+snippets[i] = {};
+snippets[i]['id'] = 'Menu';
+snippets[i]['HTML'] = '<ul class="navi_links">\n	<li class="navi">\n		<a href="Link1" class="Link1" tabindex="1"><span class="span_class">Link1</span></a>\n    </li>\n	\n	<li class="navi">\n		<a href="Link2" class="Link2" tabindex="2"><span class="span_class">Link2</span></a>\n    </li>\n\n	\n	<li class="navi">\n		<a href="Link3" class="Link3" tabindex="3"><span class="span_class">Link3</span></a>\n    </li>\n	\n	<li class="navi">\n		<a href="Link4" class="Link4" tabindex="4"><span class="span_class">Link4</span></a>\n    </li>\n	\n	<li class="navi">\n		<a href="Link5" class="Link5" tabindex="5"><span class="span_class">Link5</span></a>\n\n    </li>\n\n</ul>';
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/popups/insertsnippet.html
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/popups/insertsnippet.html (revision 858)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/popups/insertsnippet.html (revision 858)
@@ -0,0 +1,133 @@
+<!DOCTYPE html
+		 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>Insert Snippet</title>
+<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+<link rel="stylesheet" type="text/css" href="../InsertSnippet.css" />
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+<script type="text/javascript">
+
+var InsertSnippet = window.opener.InsertSnippet;
+var editor = null;
+
+
+function Init() {
+	__dlg_translate("InsertSnippet");
+	__dlg_init(null, {width:800,height:600});
+
+	var config = window.dialogArguments;
+ 
+	var snippets = config.snippets;
+	
+	if ( config.pageStyle && !Xinha.is_ie)
+    {
+		var style = document.createElement("style");
+		style.type = "text/css";
+		style.innerHTML = config.pageStyle;
+		document.getElementsByTagName("HEAD")[0].appendChild(style);
+    }
+    
+	if ( typeof config.pageStyleSheets !== 'undefined' )
+	{
+		for ( var i = 0; i < config.pageStyleSheets.length; i++ )
+		{
+			var style = document.createElement("link");
+			style.type = "text/css";
+			style.rel = 'stylesheet';
+			style.href =	config.pageStyleSheets[i];
+			document.getElementsByTagName("HEAD")[0].appendChild(style);
+		}
+	}
+		
+	var tbody = document.getElementById("snippettable");
+	var snippet_html;
+	var snippet_name;
+	var trow;
+	for(var i = 0; i < snippets.length; i++) 
+	{
+		trow = tbody.insertRow(i);
+		snippet_html = snippets[i]['HTML'];
+		snippet_name = snippets[i]['id'];
+	 
+		var insertAsVariable = '';
+		if (config.InsertSnippet.showInsertVariable)
+		{
+			insertAsVariable = ' | <a href="javascript:onOK('+i+','+'\'variable\''+')">'+Xinha._lc("Variable","InsertSnippet")+'</a>';
+		}
+		var new_cell = trow.insertCell(0);
+		new_cell.innerHTML = snippet_name +': '+Xinha._lc("Insert as","InsertSnippet")+' <a href="javascript:onOK('+i+','+'\'html\''+')">HTML</a>'+insertAsVariable + ' (<a id="show_preview'+i+'" href="javascript:preview(\'show\','+i+')">'+Xinha._lc("Show preview","InsertSnippet")+'</a>)<div id="preview'+i+'" style="display:none">'+snippets[i]['HTML']+'</div>'; 
+		new_cell.id = 'cell' + i;
+			
+	}
+
+	document.body.onkeypress = __dlg_key_press;
+}
+
+function preview(action,i) {
+	var show_preview_link = document.getElementById('show_preview'+i); 
+	switch(action)
+	{
+		case 'show':
+			document.getElementById('preview'+i).style.display = 'block';
+			show_preview_link.innerHTML = Xinha._lc("Hide preview","InsertSnippet");
+			show_preview_link.href = "javascript:preview('hide','"+i+"');";
+			
+		break;
+		case 'hide':
+			document.getElementById('preview'+i).style.display = 'none';
+			show_preview_link.innerHTML = Xinha._lc("Show preview","InsertSnippet");
+			show_preview_link.href = "javascript:preview('show','"+i+"');";
+		break;
+	}
+}
+function onCancel() {
+	__dlg_close(null);
+	return false;
+}
+
+function onOK(snippetnum,how) {
+	var params = new Object();
+	params["snippetnum"] = snippetnum;
+	params["how"] = how;
+	__dlg_close(params);
+	return false;
+}
+
+function __dlg_key_press(ev) {
+	ev || (ev = window.event);
+	switch(ev.keyCode) {
+		case 13:
+		document.getElementById('bt_ok').click();
+			break;
+		case 27:
+		__dlg_close();
+		return false;
+	}
+return true;
+}
+</script>
+
+<style type="text/css">
+body {margin:0 !IMPORTANT;padding:0 !IMPORTANT;}
+.buttons {border-top: 1px solid #999; padding: 5px; text-align: right; height: 20px; }
+td {background:white;padding:5px;border:1px solid;border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;}
+.preview {}
+</style>
+</head>
+<body class="dialog" onload="Init()">
+<form action="" method="get">
+  <div class="title" >Insert Snippet</div>
+  <div style="height:470px;overflow:auto;">
+  <table style="border: 0; width: 100%;" id="snippettable">
+  </table>
+  </div>
+<div class="space"></div>
+<div class="buttons">
+<button type="button" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/snippets.html
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/snippets.html (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/snippets.html (revision 677)
@@ -0,0 +1,29 @@
+<!--Box 1-->
+<div class="message_box red">
+   Visit the <a href="http://xinha.org">Xinha website</a>
+</div>
+<!--/Box 1-->
+<!--INFORMATION ABOUT SOMETHING-->
+<div class="message_box green">
+   This is an information about something
+</div>
+<!--/INFORMATION ABOUT SOMETHING-->
+<!--Menu-->
+<ul class="navi_links">
+   <li class="navi">
+        <a href="Link1" class="Link1" tabindex="1"><span class="span_class"> Link1 </span></a>
+   </li>
+   <li class="navi">
+        <a href="Link2" class="Link2" tabindex="2"><span class="span_class"> Link2 </span></a>
+   </li>
+   <li class="navi">
+        <a href="Link3" class="Link3" tabindex="3"><span class="span_class"> Link3 </span></a>
+   </li>
+   <li class="navi">
+        <a href="Link4" class="Link4" tabindex="4"><span class="span_class"> Link4 </span></a>
+   </li>
+   <li class="navi">
+        <a href="Link5" class="Link5" tabindex="5"><span class="span_class"> Link5 </span></a>
+   </li>
+</ul>
+<!--/Menu-->
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/snippets.php
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/snippets.php (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/snippets.php (revision 677)
@@ -0,0 +1,22 @@
+<?php
+$snippets_file = 'snippets.html';
+
+include_once('../../contrib/php-xinha.php');
+
+if($passed_data = xinha_read_passed_data())
+{
+	extract($passed_data);      
+}
+$snippets = file_get_contents($snippets_file);
+preg_match_all('/<!--(.*?)-->(.*?)<!--\/.*?-->/s',$snippets,$matches);
+	
+$array=array();
+for ($i=0;$i<count($matches[1]);$i++)
+{
+	$id = $matches[1][$i];
+	$html = $matches[2][$i];
+	$array[] = array('id'=>$id,'HTML'=>$html);
+}
+print "var snippets = " . xinha_to_js($array);
+
+?>
Index: /branches/new-dialogs-merge/plugins/InsertSnippet/InsertSnippet.css
===================================================================
--- /branches/new-dialogs-merge/plugins/InsertSnippet/InsertSnippet.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/InsertSnippet/InsertSnippet.css (revision 677)
@@ -0,0 +1,93 @@
+.navi_links {
+	width: 177px;
+	margin: 0;
+	padding: 0px;
+	list-style:none;
+	border: none;
+}
+
+.navi_links li {
+	margin:0 0 3px 0;
+}
+
+.navi_links li a {
+	font-size: 13px;
+	line-height: 16px;
+	height: 16px;
+	display:block;
+	color:#000;
+	text-decoration: none;
+	font-weight: bold;
+	background-color: #fff;
+	cursor: pointer;
+	border: 2px solid white;
+	
+}
+
+.Link1 {
+background-color: #DF1D1F !important;
+
+}
+
+.Link2 {
+background-color: #F9A413 !important;
+
+}
+
+.Link3 {
+background-color: #167730 !important;
+}
+
+.Link4 {
+background-color: #233350 !important;
+}
+
+.Link5 {
+background-color: #70685B !important;
+}
+
+a.Link1:hover span{
+background-color: #DF1D1F !important;
+}
+
+a.Link2:hover span {
+background-color: #F9A413 !important;
+
+}
+
+.Link3:hover span {
+background-color: #167730 !important;
+color:white;
+}
+
+.Link4:hover span {
+background-color: #233350 !important;
+color:white;
+}
+
+.Link5:hover span {
+background-color: #70685B !important;
+color:white;
+}
+
+.navi_links li a span {
+	height: 16px;
+	text-indent: 4px;
+	display:block;
+	margin-left: 15px;
+	background-color: #FFF;
+}
+
+div.message_box {
+border: dotted 1px black;
+margin: 1em;
+padding:1em;
+}
+
+.red {
+color:red;
+}
+
+.green {
+color:green;
+}
Index: /branches/new-dialogs-merge/plugins/SetId/set-id.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SetId/set-id.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/SetId/set-id.js (revision 999)
@@ -0,0 +1,88 @@
+function SetId(editor) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+
+  // register the toolbar buttons provided by this plugin
+  cfg.registerButton({
+    id       : "setid",
+    tooltip  : this._lc("Set Id and Name"),
+    image    : editor.imgURL("set-id.gif", "SetId"),
+    textMode : false,
+    action   : function(editor) {
+                 self.buttonPress(editor);
+               }
+  });
+  cfg.addToolbarElement("setid", "createlink", 1);
+}
+
+SetId._pluginInfo = {
+  name          : "SetId",
+  version       : "2.0",
+  developer     : "Udo Schmal",
+  developer_url : "http://www.schaffrath-neuemedien.de",
+  c_owner       : "Udo Schmal",
+  sponsor       : "L.N.Schaffrath NeueMedien",
+  sponsor_url   : "http://www.schaffrath-neuemedien.de",
+  license       : "htmlArea"
+};
+
+SetId.prototype._lc = function(string) {
+  return Xinha._lc(string, 'SetId');
+};
+
+
+SetId.prototype.onGenerate = function() {
+  this.editor.addEditorStylesheet(Xinha.getPluginDir("SetId") + '/set-id.css');
+};
+
+SetId.prototype.buttonPress = function(editor) {
+  var outparam = null;
+  var html = editor.getSelectedHTML();
+  var sel  = editor._getSelection();
+  var range  = editor._createRange(sel);
+  var node = editor._activeElement(sel);
+  if (node)
+    outparam = { name : node.id };
+  else
+    outparam = { name : '' };
+
+  editor._popupDialog( "plugin://SetId/set_id", function( param ) {
+    if ( param ) {
+      var name = param["name"];
+      if (name == "" || name == null) {
+        if (node) {
+          node.removeAttribute("name");
+          node.removeAttribute("id");
+          node.removeAttribute("title");
+          if (node.className == "hasid") {
+            node.removeAttribute("class");
+          }
+        }
+        return;
+      }
+      try {
+        var doc = editor._doc;
+        if (!node) {
+          node = doc.createElement("span");
+          node.id = name;
+          node.name = name;
+          node.title = name;
+          node.className = "hasid";
+          node.innerHTML = html;
+          if (Xinha.is_ie) {
+            range.pasteHTML(node.outerHTML);
+          } else {
+            editor.insertNodeAtSelection(node);
+          }
+        } else {
+          node.id = name;
+          node.name = name;
+          node.title = name;
+          node.className = "hasid";
+        }
+      }
+      catch (e) { }
+    }
+  }, outparam);
+};
Index: /branches/new-dialogs-merge/plugins/SetId/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SetId/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/SetId/lang/pt_br.js (revision 901)
@@ -0,0 +1,25 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Cancel": "Cancelar",
+  "Delete": "Apagar",
+  "ID/Name:": "ID/Nome:",
+  "OK": "OK",
+  "Set ID/Name": "Definir ID/Nome",
+  "Set Id and Name": "Definir Id e Nome",
+  "Set Id/Name": "Definir Id/Nome",
+  "Name/Id": "Nome/Id"
+};
Index: /branches/new-dialogs-merge/plugins/SetId/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SetId/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/SetId/lang/de.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Raimund Meyer xinha@ray-of-light.org
+{
+  "Set Id and Name": "Objekt ID und Name einfÃŒgen",
+  "Name/Id": "Name (ID)",
+  "Delete": "LÃ¶schen"
+};
Index: /branches/new-dialogs-merge/plugins/SetId/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SetId/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/SetId/lang/nl.js (revision 872)
@@ -0,0 +1,10 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Set Id and Name": "ID en Naam instellen",
+  "Name/Id": "Naam/ID",
+  "Delete": "Verwijderen",
+  "Set ID/Name": "ID/Naam instellen",
+  "ID/Name:": "ID/Naam:"
+};
Index: /branches/new-dialogs-merge/plugins/SetId/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SetId/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/SetId/lang/ja.js (revision 715)
@@ -0,0 +1,9 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Set Id and Name": "IDãšååã®èš­å®",
+  "Name/Id": "åå/ID",
+  "Delete": "åé€",
+  "Set ID/Name": "IDãšååã®èš­å®",
+  "ID/Name:": "ID/åå:"
+};
Index: /branches/new-dialogs-merge/plugins/SetId/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SetId/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/SetId/lang/nb.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Set Id and Name": "Sett ID og navn",
+  "Name/Id": "Navn (ID)",
+  "Delete": "Slett"
+};
Index: /branches/new-dialogs-merge/plugins/SetId/popups/set_id.html
===================================================================
--- /branches/new-dialogs-merge/plugins/SetId/popups/set_id.html (revision 740)
+++ /branches/new-dialogs-merge/plugins/SetId/popups/set_id.html (revision 740)
@@ -0,0 +1,58 @@
+<html>
+<head>
+  <title>Set Id/Name</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+  <script type="text/javascript">
+window.resizeTo(350, 100);
+function Init() {
+  __dlg_translate("SetId");
+  __dlg_init();
+  var param = window.dialogArguments;
+  if (param) {
+    document.getElementById("name").value = param["name"];
+  }
+  document.getElementById("name").focus();
+}
+
+function onOK() {
+  // pass data back to the calling window
+  var param = new Object();
+  param["name"] = document.getElementById("name").value;
+  __dlg_close(param);
+  return false;
+}
+
+function onDelete() {
+  // pass data back to the calling window
+  var param = new Object();
+  param["name"] = "";
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+</script>
+</head>
+
+<body class="dialog" onload="Init()">
+<div class="title">Set ID/Name</div>
+<form>
+<table border="0" style="width: 300px;">
+  <tr>
+    <td class="label">ID/Name:</td>
+    <td><input type="text" id="name" style="width: 200px" /></td>
+  </tr>
+</table>
+
+<div id="buttons">
+  <button type="submit" name="ok" onclick="return onOK();">OK</button>
+  <button type="button" name="delete" onclick="return onDelete();">Delete</button>
+  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/SetId/set-id.css
===================================================================
--- /branches/new-dialogs-merge/plugins/SetId/set-id.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/SetId/set-id.css (revision 677)
@@ -0,0 +1,7 @@
+.hasid {
+  background-image: url(img/set-id.gif);
+  background-repeat: no-repeat;
+  background-position: left top;
+  padding-left: 19px;
+  border: 1px dotted blue;
+}
Index: /branches/new-dialogs-merge/plugins/QuickTag/quick-tag.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/quick-tag.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/QuickTag/quick-tag.js (revision 856)
@@ -0,0 +1,53 @@
+/*---------------------------------------*\
+ Quick Tag Editor Plugin for HTMLArea-3.0
+ -----------------------------------------
+ author: Cau guanabara 
+ e-mail: caugb@ibest.com.br
+\*---------------------------------------*/
+
+function QuickTag(editor) {
+  var cfg = editor.config;
+  var self = this;
+
+  cfg.registerButton({
+	id       : "quickeditor",
+	tooltip  : this._lc("Quick Tag Editor"),
+	image    : editor.imgURL("ed_quicktag.gif", "QuickTag"), 
+	textMode : false,
+  action   : function(editor) { 
+               self.buttonPress(editor); 
+             }
+  });
+  cfg.addToolbarElement("quickeditor", "htmlmode", 1);  
+}
+
+QuickTag.prototype.buttonPress = function(editor) { 
+var self = this;
+var sel = editor.getSelectedHTML().replace(/(<[^>]*>|&nbsp;|\n|\r)/g,""); 
+var param = new Object();
+param.editor = editor;
+
+  if(/\w/.test(sel))
+    editor._popupDialog("plugin://QuickTag/quicktag", function(p) { self.setTag(editor, p); }, param);
+  else
+    alert(this._lc('You have to select some text'));
+};
+
+QuickTag.prototype.setTag = function(editor, param) {
+editor.surroundHTML(param.tagopen,param.tagclose);
+};
+
+QuickTag._pluginInfo = {
+name          : "QuickTag",
+version       : "1.0 - beta",
+developer     : "Cau Guanabara",
+developer_url : "mailto:caugb@ibest.com.br",
+c_owner       : "Cau Guanabara",
+sponsor       : "Independent production",
+sponsor_url   : "http://www.netflash.com.br/gb/HA3-rc1/examples/quick-tag.html",
+license       : "htmlArea"
+};
+
+QuickTag.prototype._lc = function(string) {
+    return Xinha._lc(string, 'QuickTag');
+};
Index: /branches/new-dialogs-merge/plugins/QuickTag/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/QuickTag/lang/pt_br.js (revision 901)
@@ -0,0 +1,30 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt)
+
+{
+  "Quick Tag Editor": "Editor Rápido",
+  "Enter the TAG you want to insert": "Entre com a TAG que deseja inserir",
+  "You have to select some text": "É preciso selecionar algum texto",
+  "No CSS class avaiable": "Não há classes CSS disponível",
+  "There are some unclosed quote": "Há uma ou mais aspas sem fechamento",
+  "This attribute already exists in the TAG": "Esse atributo já existe na TAG",
+  "OPTIONS": "OPÇÕES",
+  "ATTRIBUTES": "ATRIBUTOS",
+  "TAGs": "TAGs",
+  "Colors": "Cores",
+  "Ok": "Ok",
+  "Cancel": "Cancelar"
+}
Index: /branches/new-dialogs-merge/plugins/QuickTag/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/QuickTag/lang/fr.js (revision 677)
@@ -0,0 +1,16 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{ 
+  "Quick Tag Editor": "Editeur rapide de balise",
+  "Enter the TAG you want to insert": "Entrez la balise que vous voulez insÃ©rer",
+  "You have to select some text": "Vous devez sÃ©lectionner du texte",
+  "There are some unclosed quote": "Il y a des apostrophes mal fermÃ©es",
+  "This attribute already exists in the TAG": "Cet attribute existe dÃ©jÃ  sur cette balise",
+  "No CSS class avaiable": "Pas de classe CSS accessible",
+  "OPTIONS": "OPTIONS",
+  "ATTRIBUTES": "ATTRIBUTS",
+  "TAGs": "Balises",
+  "Colors": "Couleurs",
+  "Ok": "OK",
+  "Cancel": "Annuler"
+};
Index: /branches/new-dialogs-merge/plugins/QuickTag/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/QuickTag/lang/de.js (revision 677)
@@ -0,0 +1,16 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+{ 
+  "Quick Tag Editor": "Quick TAG Editor",
+  "Enter the TAG you want to insert": "Enter the TAG you want to insert",
+  "You have to select some text": "You have to select some text",
+  "There are some unclosed quote": "There are some unclosed quote",
+  "This attribute already exists in the TAG": "This attribute already exists in the TAG",
+  "No CSS class avaiable": "No CSS classes avaiable",
+  "OPTIONS": "OPTIONS",
+  "ATTRIBUTES": "ATTRIBUTES",
+  "TAGs": "TAGs",
+  "Colors": "Colors",
+  "Ok": "Ok",
+  "Cancel": "Cancel"
+};
Index: /branches/new-dialogs-merge/plugins/QuickTag/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/QuickTag/lang/nl.js (revision 872)
@@ -0,0 +1,17 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{ 
+  "Quick Tag Editor": "Quick Tag Editor",
+  "Enter the TAG you want to insert": "Voer de Tag naam in",
+  "You have to select some text": "Selecteer tekst",
+  "There are some unclosed quote": "Er zijn niet gesloten quotes",
+  "This attribute already exists in the TAG": "Dit attribuut bestaat al in de tag",
+  "No CSS class avaiable": "Geen CSS class beschikbaar",
+  "OPTIONS": "OPTIES",
+  "ATTRIBUTES": "ATTRIBUTEN",
+  "TAGs": "TAGs",
+  "Colors": "Kleuren",
+  "Ok": "Ok",
+  "Cancel": "Annuleren"
+};
Index: /branches/new-dialogs-merge/plugins/QuickTag/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/QuickTag/lang/ja.js (revision 715)
@@ -0,0 +1,18 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Quick Tag Editor": "ã¯ã€ãã¯ã¿ã°ãšãã£ã¿",
+  "Enter the TAG you want to insert": "æ¿å
+¥ãããã¿ã°ãå
+¥å",
+  "You have to select some text": "ãã­ã¹ããéžæããªããã°ãªããŸãã",
+  "There are some unclosed quote": "éããŠããªãåŒçšç¬ŠããããŸã",
+  "This attribute already exists in the TAG": "ã¿ã°ã«ã¯ãã§ã«åãå±æ§ããããŸã",
+  "No CSS class avaiable": "CSSã¯ã©ã¹ããããŸãã",
+  "OPTIONS": "éžæè¢",
+  "ATTRIBUTES": "å±æ§",
+  "TAGs": "ã¿ã°",
+  "Colors": "è²",
+  "Ok": "OK",
+  "Cancel": "äž­æ­¢"
+};
Index: /branches/new-dialogs-merge/plugins/QuickTag/lang/pl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/lang/pl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/QuickTag/lang/pl.js (revision 677)
@@ -0,0 +1,18 @@
+// I18N constants
+// LANG: "pl", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl
+{ 
+  "Quick Tag Editor": "Edytor Quick Tag",
+  "Enter the TAG you want to insert": "Podaj TAG, ktÃ³ry chcesz wstawiÄ",
+  "You have to select some text": "Musisz zaznaczyÄ tekst.",
+  "There are some unclosed quote": "SÄ
+ jakieÅ niezamkniÄte cudzysÅowia",
+  "This attribute already exists in the TAG": "TAG posiada juÅŒ ten atrybut",
+  "No CSS class avaiable": "Brak dostÄpnych klas CSS",
+  "OPTIONS": "OPCJE",
+  "ATTRIBUTES": "ATRYBUTY",
+  "TAGs": "TAGi",
+  "Colors": "Kolory",
+  "Ok": "Ok",
+  "Cancel": "Anuluj"
+};
Index: /branches/new-dialogs-merge/plugins/QuickTag/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/QuickTag/lang/nb.js (revision 677)
@@ -0,0 +1,17 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{ 
+  "Quick Tag Editor": "Kjapp TAGG-Editor",
+  "Enter the TAG you want to insert": "Skriv inn taggen du vil Ãžnsker Ã¥ sette inn",
+  "You have to select some text": "Du mÃ¥ velge noe tekst",
+  "There are some unclosed quote": "Det mangler et hermetegn",
+  "This attribute already exists in the TAG": "Denne attributten eksisterer allerede i taggen",
+  "No CSS class avaiable": "Ingen CSS klasse tilgjengelig",
+  "OPTIONS": "EGENSKAPER",
+  "ATTRIBUTES": "ATTRIBUTTER",
+  "TAGs": "TAGGer",
+  "Colors": "Farger",
+  "Ok": "OK",
+  "Cancel": "Avbryt"
+};
Index: /branches/new-dialogs-merge/plugins/QuickTag/popups/quicktag.html
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/popups/quicktag.html (revision 987)
+++ /branches/new-dialogs-merge/plugins/QuickTag/popups/quicktag.html (revision 987)
@@ -0,0 +1,354 @@
+<html>
+<head>
+<title>Quick Tag Editor</title>
+<script type="text/javascript" src="../tag-lib.js"></script>
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+<script type="text/javascript">
+
+window.resizeTo(400, 180);
+var QuickTag = window.opener.QuickTag;
+var curTag = 'none';
+var curTagOpt = false;
+var CSSEdit = false;
+var editor = null;
+
+function Init() {
+  __dlg_translate("QuickTag");
+  __dlg_init();
+
+  var param = window.dialogArguments;
+  editor = param['editor'];
+  var selectext = param['selectedText']; // sem uso...
+
+  createDropdown("tags");
+
+  var to = document.getElementById('tagopen');
+  if (document.all) 
+    to.attachEvent("onkeypress", function(e) { choice_dropdown(e) });
+  else 
+    to.addEventListener("keypress", function(e) { choice_dropdown(e) }, true);
+  to.focus();
+
+  document.getElementById('bt_colors').style.display = 'none';
+  document.body.onkeypress = __dlg_key_press;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+function quoteTest(val) {
+  var er = /^\w+\s*(\w+=\"[^\"]*\"\s*|\w+=\'[^\']*\'\s*)*$/;
+  return er.test(val);
+}
+
+function onOK() {
+  var el = document.getElementById('tagopen');
+  if(!el.value) {
+  alert(HTMLArea._lc("Enter the TAG you want to insert", "QuickTag"));
+  el.focus();
+  return false;
+  }
+  if(!quoteTest(el.value)) {
+    alert(HTMLArea._lc("There are some unclosed quote", "QuickTag"));
+    el.focus();
+    el.select();
+    return false;
+  }
+  var param = {};
+  var cleanTO = document.getElementById('tagopen').value.replace(/(<|>)/g,"");
+  param.tagopen = "<"+cleanTO+">";
+  param.tagclose = param.tagopen.replace(/^<(\w+) ?.*>/,"</$1>");
+
+  var subtag = subTagLib[curTag];
+  if(typeof subtag == 'object') {
+    param.tagopen = param.tagopen+subtag.op;
+    param.tagclose = subtag.cl+param.tagclose;
+  }
+
+  __dlg_close(param);
+  return false;
+}
+
+function __dlg_key_press(ev) {
+  ev || (ev = window.event);
+  switch(ev.keyCode) {
+    case 13:
+    document.getElementById('bt_ok').click();
+      break;
+    case 27:
+    __dlg_close();
+    return false;
+  }
+  return true;
+}
+
+function selchange() {
+  var toadd = document.getElementById('selectag').value;
+  var oldval = document.getElementById('tagopen').value;
+  var text = (oldval+toadd).replace(/^\s*(.+)\s*$/,"$1");
+  var atrib = /(\w+)=\"$/.test(toadd) ? toadd.replace(/(\w+)=\"$/, "$1") : null;
+  var showcolors = (/color\: ?$/.test(toadd)) ? true : false;
+  var noCSSclasses = false;
+  var obj = null;
+  curTag = text.replace(/(^\w+) ?.*$/, "$1");
+  curTagOpt = (tagLib[curTag] == true);
+
+  if(atrib) {
+    var atrer = eval('/'+atrib+'=/ig');
+    if(atrer.test(oldval) && !(/[^=]\"$/.test(toadd))) {
+      alert(HTMLArea._lc("This attribute already exists in the TAG", "QuickTag"));
+      return false;
+    }
+
+    switch(atrib) {
+    case 'style':
+      CSSEdit = true;
+      break;
+    case 'class':
+      if(captureClasses() == 0) noCSSclasses = true;
+      break;
+    case 'color': case 'bgcolor': case 'bordercolor':
+    case 'bordercolorlight': case 'bordercolordark':
+      showcolors = true;
+      break;
+    }
+
+    if(curTagOpt == true)
+      obj = eval('opAtt_'+curTag+'["'+atrib+'"]');
+    else
+      obj = opAtt_all[atrib];
+  }
+  else if(!CSSEdit && (/(^\w+$|\"$)/.test(toadd))) {
+    obj = 'all';
+    if(curTagOpt == true) obj = curTag;
+    toadd += ' ';
+  }
+
+  if(CSSEdit && quoteTest(text))
+    CSSEdit = false;
+
+  if(showcolors)
+    document.getElementById('bt_colors').style.display = '';
+
+  if(obj)
+    createDropdown(obj);
+  else if(!CSSEdit)
+    document.getElementById('showselect').style.visibility = 'hidden';
+
+  if(noCSSclasses) {
+    document.getElementById('showselect').innerHTML = HTMLArea._lc("No CSS class avaiable", "QuickTag");
+    document.getElementById('showselect').style.visibility = 'visible';
+  }
+
+  addchanges();
+
+  function addchanges() {
+    document.getElementById('tagopen').focus();
+    document.getElementById('tagopen').value += toadd;
+  }
+}
+
+function captureClasses() {
+  var cont = 0;
+  // If there is no '<HTML>' in the HTMLArea content, when using
+  // styleSheets[..].rule, IE generates an error.
+  // In this case, we lost the classes in external CSS files.
+  // If FullPage is loaded, there is no problem.
+  if(!(/<\s*html\s*>/i.test(editor.getHTML())) && document.all) {
+    var styles = editor._doc.getElementsByTagName("style");
+    for(var i in styles) {
+      var cont = styles[i].innerHTML;
+      if(typeof cont != 'undefined') {
+        var cls = cont.match(/\.\w+/ig,"");
+        for(j in cls) if(/^\.\w+$/.test(cls[j])) {
+          var classname = cls[j].replace(/\./,"")+'"';
+          opAtt_all['class'][cls[j]] = classname;
+          cont++;
+        }
+      }
+    }
+    return cont;
+  }
+
+  var styleSheet = null;
+  var styles = editor._doc.styleSheets;
+
+  for (var i = 0; i < styles.length; i++) {
+    styleSheet = styles[i];
+    if(document.all)
+      var _rules = styleSheet.rules;
+    else
+      var _rules = styleSheet.cssRules;
+    for (var j = 0; j < _rules.length; j++) {
+      rule = _rules[j];
+      if(/^\.\w+$/.test(rule.selectorText)) {
+        var classname = rule.selectorText.replace(/\./,"")+'"';
+        opAtt_all['class'][rule.selectorText] = classname;
+        cont++;
+      }
+    }
+  }
+  return cont;
+}
+
+function choice_dropdown(e) {
+  if (document.all) Key = e.keyCode;
+  else Key = e.charCode;
+
+  if(Key != 32) return;
+
+  var text = document.getElementById('tagopen').value.replace(/^\s*([^\s]+)\s*$/,"$1");
+
+  if(CSSEdit && quoteTest(text)) CSSEdit = false;
+  if(CSSEdit) return;
+
+  if(curTag == 'none') {
+    curTag = text.replace(/(^\w+) ?.*$/, "$1");
+    curTagOpt = tagLib[curTag];
+  }
+
+  if(!/\w/.test(text)) {
+    document.getElementById('tagopen').value = '';
+    createDropdown("tags");
+    return;
+  }
+
+  var att = 'all';
+  if(curTagOpt == true)
+    att = curTag;
+
+  createDropdown(att);
+}
+
+function createDropdown(type) {
+  var _div = document.getElementById('showselect');
+  while(_div.hasChildNodes())
+    _div.removeChild(_div.firstChild);
+  _div.style.visibility = 'visible';
+
+  var _sel = document.createElement("select");
+  _sel.id = "selectag";
+  _sel.onchange = function() { selchange(); };
+
+  if(typeof type == 'object') {
+    var obj = type;
+    forObj(HTMLArea._lc("OPTIONS", "QuickTag"));
+    _div.appendChild(_sel);
+    return;
+  }
+
+  if(type == 'tags') {
+    var obj = allTags;
+    forObj(HTMLArea._lc("TAGs", "QuickTag"));
+    _div.appendChild(_sel);
+    return;
+  }
+
+  type = type.replace(/^h[1-6]$/,"h");
+  var topt = eval('opTag_'+type);
+  if(typeof topt == 'object') 
+    var obj = topt;
+  else 
+    return;
+
+  forObj(HTMLArea._lc("ATTRIBUTES", "QuickTag"));
+  _div.appendChild(_sel);
+
+  function forObj(first) {
+    if(first) {
+      var _op = document.createElement("option");
+      _op.appendChild(document.createTextNode(first));
+      _sel.appendChild(_op);
+    }
+    for(i in obj) {
+      var opt = document.createElement("option");
+      opt.appendChild(document.createTextNode(i));
+      opt.value = obj[i];
+      _sel.appendChild(opt);
+    }
+  }
+}
+
+function colors() {
+  var colloc = window.location.toString().replace(/plugins.+$/,"") +
+               "popups/select_color.html";
+  window.open(colloc, 'colors', "toolbar=no,location=no,directories=no," +
+              "status=no,menubar=no,scrollbars=no,resizable=no,width=240,height=182");
+}
+
+// simulation of Dialog._return - select_color.html needs it.
+var Dialog = new Object();
+Dialog._return = function (val) {
+  if(val != null) {
+    if(CSSEdit)
+      val += '; ';
+    else
+      val += '"';
+    document.getElementById('tagopen').focus();
+    document.getElementById('tagopen').value += "#"+val;
+    document.getElementById('bt_colors').style.display = 'none';
+  }
+};
+</script>
+<style type="text/css">
+html, body {
+background: ButtonFace;
+color: ButtonText;
+font: 11px Tahoma,Verdana,sans-serif;
+margin: 0px;
+padding: 0px;
+border-width: 0px;
+}
+body { padding: 5px; }
+table { font: 11px Tahoma,Verdana,sans-serif; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+.title {
+background: #ddf;
+color: #000;
+font-weight: bold;
+font-size: 120%;
+padding: 3px 10px;
+margin-bottom: 10px;
+border-bottom: 1px solid black;
+letter-spacing: 2px;
+}
+.buttons {
+border-top: 1px solid #999;
+padding: 5px;
+text-align: right;
+height: 20px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+</head>
+  <body class="dialog" onload="Init()">
+<form action="" method="get">
+  <div class="title" style="width: 360px">Quick Tag Editor</div>
+  <div style="text-align: center;">
+  <table border="0" width="370">
+    <tbody>
+      <tr>
+        <td colspan="2" style="text-align: center;" style="padding: 3px; background-color: #e9e9e9;">
+        <strong style="font-size: 14px">&lt;</strong>
+        <input id="tagopen" type="text" style="background-color: #e9e9e9; width: 327px; border-width: 0px;">
+        <strong style="font-size: 14px">&gt;</strong>
+        </td>
+      </tr>
+    </tbody>
+  </table>
+  </div>
+<div class="space"></div>
+<div class="buttons">
+<button type="button" id="bt_colors" onclick="colors();">Colors</button>
+<button type="button" id="bt_ok" onclick="return onOK();">Ok</button>
+<button type="button" onclick="return onCancel();">Cancel</button>
+</div>
+<div id="showselect" style="position:absolute; left:7px; top:75px; width:150px; z-index:100; visibility: visible; height: 13px; color: red;">
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/QuickTag/tag-lib.js
===================================================================
--- /branches/new-dialogs-merge/plugins/QuickTag/tag-lib.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/QuickTag/tag-lib.js (revision 677)
@@ -0,0 +1,356 @@
+/*
+  TAG Library for QuickTag Plugin  
+  -------------------------------
+  
+  allTags = All tags that appears in the first dropdown ('TAGS') {'caption': 'value'}  
+  tagLib = The tags with options (just to check if current TAG have options) {'[TAG]': true}
+  subTagLib = Complements for some tags that needs it (TABLE) 
+    {'[TAG]': {'op': 'after tag open', 'cl': 'before tag close'}}
+  opTag_all = Common attributes to all TAGS {'caption': 'value'}  
+  opAtt_all = Options for the common attributes {'attribute': {'caption': 'value'}}
+  opTag_[TAG] = Attributes for [TAG] {'caption': 'value'}
+  opAtt_[TAG] = Options for the [TAG] attributes {'attribute': {'caption': 'value'}}
+  
+*/
+
+var allTags = {
+'a': 'a',
+'a (full)': 'a href="" target=""',
+'address': 'address',
+'b': 'b',
+'big': 'big',
+'blockquote': 'blockquote',
+'code': 'code',
+'div': 'div',
+'em': 'em',
+'fieldset': 'fieldset',
+'font': 'font',
+'font (full)': 'font face="" size="" color=""',
+'h1': 'h1',
+'h2': 'h2',
+'h3': 'h3',
+'h4': 'h4',
+'h5': 'h5',
+'h6': 'h6',
+'i': 'i',
+'legend': 'legend',
+'li': 'li',
+'ol': 'ol',
+'ul': 'ul',
+'p': 'p',
+'pre': 'pre',
+'small': 'small',
+'span': 'span',
+'strong': 'strong',
+'sub': 'sub',
+'sup': 'sup',
+'table': 'table'
+};
+
+// tags with options
+var tagLib =  {
+'a': true, 
+'div': true, 
+'font': true, 
+'h1': true,
+'h2': true,
+'h3': true,
+'h4': true,
+'h5': true,
+'h6': true,
+'p': true,
+'table': true
+};
+// tags that needs some complement
+var subTagLib = {'table': {'op': '<tbody><tr><td>',
+                           'cl': '</td></tr></tbody>'}
+};
+
+var opTag_a = {
+'href': 'href="',
+'name': 'name="',
+'target': 'target="'
+};
+var opAtt_a = {
+'href': {'http://': 'http://',
+         'https://': 'https://',
+         'ftp://': 'ftp://',
+         'mailto:': 'mailto:',
+         '#': '#"'},
+'target': {'_top': '_top"',
+           '_self': '_self"',
+           '_parent': '_parent"',
+           '_blank': '_blank"'}
+};
+
+var opTag_font = {
+'face': 'face="',
+'size': 'size="',
+'color': 'color="'
+};
+var opAtt_font = {
+'face': {'Verdana': 'Verdana"',
+         'Arial': 'Arial"',
+         'Tahoma': 'Tahoma"',
+         'Courier New': 'Courier New"',
+         'Times New Roman': 'Times New Roman"'},
+'size': {'1': '1"','2': '2"','3': '3"','4': '4"','5': '5"','6': '6"',
+         '+1': '+1"','+2': '+2"','+3': '+3"','+4': '+4"','+5': '+5"','+6': '+6"',
+         '-1': '-1"','-2': '-2"','-3': '-3"','-4': '-4"','-5': '-5"','-6': '-6"'}
+};
+
+var opTag_div = {
+'align': 'align="'
+};
+var opAtt_div = {
+'align': {'center': 'center"',
+          'left': 'left"',
+          'right': 'right"',
+          'justify': 'justify"'}
+};
+
+var opTag_h = {
+'align': 'align="'
+};
+var opAtt_h = {
+'align': {'center': 'center"',
+          'left': 'left"',
+          'right': 'right"',
+          'justify': 'justify"'}
+};
+
+var opTag_p = {
+'align': 'align="'
+};
+var opAtt_p = {
+'align': {'center': 'center"',
+          'left': 'left"',
+          'right': 'right"',
+          'justify': 'justify"'}
+};
+
+var opTag_table = {
+'align': 'align="',
+'width': 'width="',
+'height': 'height="',
+'cellpadding': 'cellpadding="',
+'cellspacing': 'cellspacing="',
+'background': 'background="',
+'bgcolor': 'bgcolor="',
+'border': 'border="',
+'bordercolor': 'bordercolor="',
+'bordercolorlight': 'bordercolorlight="',
+'bordercolordark': 'bordercolordark="'
+};
+var opAtt_table = {
+'align': {'center': 'center"',
+          'left': 'left"',
+          'right': 'right"'}
+};
+
+// for all tags 
+var opTag_all = {
+'class': 'class="',
+'dir': 'dir="',
+'id': 'id="',
+'lang': 'lang="',
+'onFocus': 'onFocus="',
+'onBlur': 'onBlur="',
+'onClick': 'onClick="',
+'onDblClick': 'onDblClick="',
+'onMouseDown': 'onMouseDown="',
+'onMouseUp': 'onMouseUp="',
+'onMouseOver': 'onMouseOver="',
+'onMouseMove': 'onMouseMove="',
+'onMouseOut': 'onMouseOut="',
+'onKeyPress': 'onKeyPress="',
+'onKeyDown': 'onKeyDown="',
+'onKeyUp': 'onKeyUp="',
+'style': 'style="',
+'title': 'title="'
+};
+var opAtt_all = {
+'class': {},
+'dir': {'rtl': 'rtl"','ltr': 'ltr"'},
+'lang': {'Afrikaans ': 'af"',
+         'Albanian ': 'sq"',
+         'Arabic ': 'ar"',
+         'Basque ': 'eu"',
+         'Breton ': 'br"',
+         'Bulgarian ': 'bg"',
+         'Belarusian ': 'be"',
+         'Catalan ': 'ca"',
+         'Chinese ': 'zh"',
+         'Croatian ': 'hr"',
+         'Czech ': 'cs"',
+         'Danish ': 'da"',
+         'Dutch ': 'nl"',
+         'English ': 'en"',
+         'Estonian ': 'et"',
+         'Faeroese ': 'fo"',
+         'Farsi ': 'fa"',
+         'Finnish ': 'fi"',
+         'French ': 'fr"',
+         'Gaelic ': 'gd"',
+         'German ': 'de"',
+         'Greek ': 'el"',
+         'Hebrew ': 'he"',
+         'Hindi ': 'hi"',
+         'Hungarian ': 'hu"',
+         'Icelandic ': 'is"',
+         'Indonesian ': 'id"',
+         'Italian ': 'it"',
+         'Japanese ': 'ja"',
+         'Korean ': 'ko"',
+         'Latvian ': 'lv"',
+         'Lithuanian ': 'lt"',
+         'Macedonian ': 'mk"',
+         'Malaysian ': 'ms"',
+         'Maltese ': 'mt"',
+         'Norwegian ': 'no"',
+         'Polish ': 'pl"',
+         'Portuguese ': 'pt"',
+         'Rhaeto-Romanic ': 'rm"',
+         'Romanian ': 'ro"',
+         'Russian ': 'ru"',
+         'Sami ': 'sz"',
+         'Serbian ': 'sr"',
+         'Setswana ': 'tn"',
+         'Slovak ': 'sk"',
+         'Slovenian ': 'sl"',
+         'Spanish ': 'es"',
+         'Sutu ': 'sx"',
+         'Swedish ': 'sv"',
+         'Thai ': 'th"',
+         'Tsonga ': 'ts"',
+         'Turkish ': 'tr"',
+         'Ukrainian ': 'uk"',
+         'Urdu ': 'ur"',
+         'Vietnamese ': 'vi"',
+         'Xhosa ': 'xh"',
+         'Yiddish ': 'yi"',
+         'Zulu': 'zu"'},
+'style': {'azimuth': 'azimuth: ',
+          'background': 'background: ',
+          'background-attachment': 'background-attachment: ',
+          'background-color': 'background-color: ',
+          'background-image': 'background-image: ',
+          'background-position': 'background-position: ',
+          'background-repeat': 'background-repeat: ',
+          'border': 'border: ',
+          'border-bottom': 'border-bottom: ',
+          'border-left': 'border-left: ',
+          'border-right': 'border-right: ',
+          'border-top': 'border-top: ',
+          'border-bottom-color': 'border-bottom-color: ',
+          'border-left-color': 'border-left-color: ',
+          'border-right-color': 'border-right-color: ',
+          'border-top-color': 'border-top-color: ',
+          'border-bottom-style': 'border-bottom-style: ',
+          'border-left-style': 'border-left-style: ',
+          'border-right-style': 'border-right-style: ',
+          'border-top-style': 'border-top-style: ',
+          'border-bottom-width': 'border-bottom-width: ',
+          'border-left-width': 'border-left-width: ',
+          'border-right-width': 'border-right-width: ',
+          'border-top-width': 'border-top-width: ',
+          'border-collapse': 'border-collapse: ',
+          'border-color': 'border-color: ',
+          'border-style': 'border-style: ',
+          'border-width': 'border-width: ',
+          'bottom': 'bottom: ',
+          'caption-side': 'caption-side: ',
+          'cell-spacing': 'cell-spacing: ',
+          'clear': 'clear: ',
+          'clip': 'clip: ',
+          'color': 'color: ',
+          'column-span': 'column-span: ',
+          'content': 'content: ',
+          'cue': 'cue: ',
+          'cue-after': 'cue-after: ',
+          'cue-before': 'cue-before: ',
+          'cursor': 'cursor: ',
+          'direction': 'direction: ',
+          'display': 'display: ',
+          'elevation': 'elevation: ',
+          'filter': 'filter: ',
+          'float': 'float: ',
+          'font-family': 'font-family: ',
+          'font-size': 'font-size: ',
+          'font-size-adjust': 'font-size-adjust: ',
+          'font-style': 'font-style: ',
+          'font-variant': 'font-variant: ',
+          'font-weight': 'font-weight: ',
+          'height': 'height: ',
+          '!important': '!important: ',
+          'left': 'left: ',
+          'letter-spacing': 'letter-spacing: ',
+          'line-height': 'line-height: ',
+          'list-style': 'list-style: ',
+          'list-style-image': 'list-style-image: ',
+          'list-style-position': 'list-style-position: ',
+          'list-style-type': 'list-style-type: ',
+          'margin': 'margin: ',
+          'margin-bottom': 'margin-bottom: ',
+          'margin-left': 'margin-left: ',
+          'margin-right': 'margin-right: ',
+          'margin-top': 'margin-top: ',
+          'marks': 'marks: ',
+          'max-height': 'max-height: ',
+          'min-height': 'min-height: ',
+          'max-width': 'max-width: ',
+          'min-width': 'min-width: ',
+          'orphans': 'orphans: ',
+          'overflow': 'overflow: ',
+          'padding': 'padding: ',
+          'padding-bottom': 'padding-bottom: ',
+          'padding-left': 'padding-left: ',
+          'padding-right': 'padding-right: ',
+          'padding-top': 'padding-top: ',
+          'page-break-after': 'page-break-after: ',
+          'page-break-before': 'page-break-before: ',
+          'pause': 'pause: ',
+          'pause-after': 'pause-after: ',
+          'pause-before': 'pause-before: ',
+          'pitch': 'pitch: ',
+          'pitch-range': 'pitch-range: ',
+          'play-during': 'play-during: ',
+          'position': 'position: ',
+          'richness': 'richness: ',
+          'right': 'right: ',
+          'row-span': 'row-span: ',
+          'size': 'size: ',
+          'speak': 'speak: ',
+          'speak-date': 'speak-date: ',
+          'speak-header': 'speak-header: ',
+          'speak-numeral': 'speak-numeral: ',
+          'speak-punctuation': 'speak-punctuation: ',
+          'speak-time': 'speak-time: ',
+          'speech-rate': 'speech-rate: ',
+          'stress': 'stress: ',
+          'table-layout': 'table-layout: ',
+          'text-align': 'text-align: ',
+          'text-decoration': 'text-decoration: ',
+          'text-indent': 'text-indent: ',
+          'text-shadow': 'text-shadow: ',
+          'text-transform': 'text-transform: ',
+          'top': 'top: ',
+          'vertical-align': 'vertical-align: ',
+          'visibility': 'visibility: ',
+          'voice-family': 'voice-family: ',
+          'volume': 'volume: ',
+          'white-space': 'white-space: ',
+          'widows': 'widows: ',
+          'width': 'width: ',
+          'word-spacing': 'word-spacing: ',
+          'z-index': 'z-index: ' }
+};
+
+// add the common items to all objects
+for(var i in tagLib) {
+i = i.replace(/^h[1-6]$/,"h"); // h1 .. h6
+  for(var j in opTag_all)
+    eval('opTag_'+i+'["'+j+'"] = opTag_all["'+j+'"];');
+  for(var j in opAtt_all)
+    eval('opAtt_'+i+'["'+j+'"] = opAtt_all["'+j+'"];');
+}
Index: /branches/new-dialogs-merge/plugins/Template/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/Template/lang/pt_br.js (revision 901)
@@ -0,0 +1,19 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+	"Insert template"          : "Inserir modelo",
+	"Cancel"                   : "Cancelar"
+};
Index: /branches/new-dialogs-merge/plugins/Template/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Template/lang/fr.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Insert template": "InsÃ©rer un template",
+  "Cancel": "Annulation"
+};
Index: /branches/new-dialogs-merge/plugins/Template/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/lang/de.js (revision 852)
+++ /branches/new-dialogs-merge/plugins/Template/lang/de.js (revision 852)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "Insert template": "Template einfÃŒgen",
+  "Cancel": "Abbrechen"
+};
Index: /branches/new-dialogs-merge/plugins/Template/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/Template/lang/nl.js (revision 872)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Insert template": "Template invoegen",
+  "Cancel": "Annuleren"
+};
Index: /branches/new-dialogs-merge/plugins/Template/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/Template/lang/ja.js (revision 715)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+	"Insert template"          : "ãã³ãã¬ãŒãã®æ¿å
+¥",
+	"Cancel"                   : "äž­æ­¢"
+};
Index: /branches/new-dialogs-merge/plugins/Template/lang/it.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/lang/it.js (revision 852)
+++ /branches/new-dialogs-merge/plugins/Template/lang/it.js (revision 852)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+{
+  "Insert template": "Inserisca il template",
+  "Cancel": "Annullamento"
+};
Index: /branches/new-dialogs-merge/plugins/Template/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Template/lang/nb.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Insert template": "Sett inn template",
+  "Cancel": "Avbryt"
+};
Index: /branches/new-dialogs-merge/plugins/Template/template.css
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/template.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/Template/template.css (revision 677)
@@ -0,0 +1,3 @@
+div {
+	border: 1px dotted ActiveBorder;
+}
Index: /branches/new-dialogs-merge/plugins/Template/popups/template.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/popups/template.html (revision 987)
+++ /branches/new-dialogs-merge/plugins/Template/popups/template.html (revision 987)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<title>Insert template</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+function Init() {
+  __dlg_translate("Template");
+  __dlg_init();
+  window.resizeTo(400, 200);
+  document.getElementById("cancel").focus();
+}
+
+function onOK(sel) {
+  // pass data back to the calling window
+  var param = new Object();
+  param["templ"] = sel;
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+</script>
+</head>
+
+<body class="dialog" onload="Init()">
+<div class="title">Insert template</div>
+<form>
+  <table border="0" cellspacing="0" cellpadding="5">
+	<tr>
+      <td style="text-align: center; vertical-align: top;"><a href="javascript:;" onClick="onOK('1');">
+        <img src="../img/layout_01.gif" alt="" width="106" height="68" border="0" /></a>
+      </td>
+      <td style="text-align: center; vertical-align: top;"><a href="javascript:;" onClick="onOK('2');">
+        <img src="../img/layout_02.gif" alt="" width="106" height="68" border="0" /></a>
+      </td>  
+	  <td style="text-align: center; vertical-align: top;"><a href="javascript:;" onClick="onOK('3');">
+	    <img src="../img/layout_03.gif" alt="" width="106" height="68" border="0" /></a><br/>
+      </td>
+ 	</tr>
+  </table>
+
+  <div id="buttons">
+    <button type="button" name="cancel" id="cancel" onclick="return onCancel();">Cancel</button>
+  </div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Template/template.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Template/template.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/Template/template.js (revision 999)
@@ -0,0 +1,107 @@
+// Template plugin for Xinha
+// Implementation by Udo Schmal based on HTMLArea 3.0
+// Original Author - Udo Schmal www.Schaffrath-NeueMedien.de
+//
+// (c) Udo Schmal & Schaffrath NeueMedien 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function Template(editor) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+
+  // register the toolbar buttons provided by this plugin
+  cfg.registerButton({
+    id       : "template",
+    tooltip  : Xinha._lc("Insert template","Template"),
+    image    : editor.imgURL("ed_template.gif", "Template"),
+    textMode : false,
+    action   : function(editor) {
+                 self.buttonPress(editor);
+               }
+  });
+  cfg.addToolbarElement("template", "inserthorizontalrule", 1);
+}
+
+Template._pluginInfo = {
+  name          : "Template",
+  version       : "1.0",
+  developer     : "Udo Schmal",
+  developer_url : "http://www.schaffrath-neuemedien.de/",
+  c_owner       : "Udo Schmal & Schaffrath NeueMedien",
+  license       : "htmlArea"
+};
+
+Template.prototype.onGenerate = function() {
+  this.editor.addEditorStylesheet(Xinha.getPluginDir("Template") + '/template.css');
+};
+
+Template.prototype.buttonPress = function(editor) {
+  editor._popupDialog( "plugin://Template/template", function( obj ) {
+    if ( !obj ) {//user must have pressed Cancel
+      return false;
+    }
+
+    var bodys = editor._doc.getElementsByTagName("body");
+    var body = bodys[0];
+
+  function getElement(x) {
+    var result = editor._doc.getElementById(x);
+    if (!result) {
+      result = editor._doc.createElement("div");
+      result.id = x;
+      result.innerHTML = x;
+      body.appendChild(result);
+    }
+    if (result.style)
+      result.removeAttribute("style");
+    return result;
+  }
+
+    var content = getElement("content");
+    var menu1 = getElement("menu1");
+    var menu2 = getElement("menu2");
+    var menu3 = getElement("menu3");
+    switch (obj["templ"]) {
+      case "1": menu1.style.position = "absolute";
+                menu1.style.right = "0px";
+                menu1.style.width = "28%";
+                menu1.style.backgroundColor = "#e1ddd9";
+                menu1.style.padding = "2px 20px";
+                content.style.position = "absolute";
+                content.style.left = "0px";
+                content.style.width = "70%";
+                content.style.backgroundColor = "#fff";
+                menu2.style.visibility = "hidden";
+                menu3.style.visibility = "hidden";
+                break;
+      case "2": menu1.style.position = "absolute";
+                menu1.style.left = "0px";
+                menu1.style.width = "28%";
+                menu1.style.height = "100%";
+                menu1.style.backgroundColor = "#e1ddd9";
+                content.style.position = "absolute";
+                content.style.right = "0px";
+                content.style.width = "70%";
+                content.style.backgroundColor = "#fff";
+                menu2.style.visibility = "hidden";
+                menu3.style.visibility = "hidden";
+                break
+      case "3": menu1.style.position = "absolute";
+                menu1.style.left = "0px";
+                menu1.style.width = "28%";
+                menu1.style.backgroundColor = "#e1ddd9";
+                menu2.style.position = "absolute";
+                menu2.style.right = "0px";
+                menu2.style.width = "28%";
+                menu2.style.backgroundColor = "#e1ddd9";
+                content.style.position = "absolute";
+                content.style.right = "30%";
+                content.style.width = "60%";
+                content.style.backgroundColor = "#fff";
+                menu3.style.visibility = "hidden";
+                break
+    }
+  }, null);
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/Stylist/lang/pt_br.js (revision 901)
@@ -0,0 +1,18 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Styles": "Estilos"
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/lang/ru.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/lang/ru.js (revision 989)
+++ /branches/new-dialogs-merge/plugins/Stylist/lang/ru.js (revision 989)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "ru", ENCODING: UTF-8
+{
+  "Styles": "Ð¡ÑÐžÐ»Ðž"
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Stylist/lang/fr.js (revision 677)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Styles": "Styles"
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Stylist/lang/de.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+{
+  "Styles": "Stile"
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/Stylist/lang/nl.js (revision 872)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Styles": "Style"
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/Stylist/lang/ja.js (revision 715)
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Styles": "ã¹ã¿ã€ã«"
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/lang/pl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/lang/pl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Stylist/lang/pl.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "pl", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz koto@webworkers.pl
+{
+  "Styles": "Style"
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/Stylist/lang/nb.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Styles": "Stiler"
+};
Index: /branches/new-dialogs-merge/plugins/Stylist/stylist.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Stylist/stylist.js (revision 1000)
+++ /branches/new-dialogs-merge/plugins/Stylist/stylist.js (revision 1000)
@@ -0,0 +1,607 @@
+/**
+ * Add an empty css_style to Config object's prototype
+ *  the format is { '.className' : 'Description' }
+ */
+
+Xinha.Config.prototype.css_style = { };
+
+/**
+ * This method loads an external stylesheet and uses it in the stylist
+ */
+Xinha.Config.prototype.stylistLoadStylesheet = function(url, altnames)
+{
+  if(!altnames) altnames = { };
+  var newStyles = Xinha.ripStylesFromCSSFile(url);
+  for(var i in newStyles)
+  {
+    if(altnames[i])
+    {
+      this.css_style[i] = altnames[i];
+    }
+    else
+    {
+      this.css_style[i] = newStyles[i];
+    }
+  }
+  this.pageStyleSheets[this.pageStyleSheets.length] = url;
+};
+
+/**
+ * This method takes raw style definitions and uses them in the stylist
+ */
+Xinha.Config.prototype.stylistLoadStyles = function(styles, altnames)
+{
+  if(!altnames) altnames = { };
+  var newStyles = Xinha.ripStylesFromCSSString(styles);
+  for(var i in newStyles)
+  {
+    if(altnames[i])
+    {
+      this.css_style[i] = altnames[i];
+    }
+    else
+    {
+      this.css_style[i] = newStyles[i];
+    }
+  }
+  this.pageStyle += styles;
+};
+
+
+
+/**
+ * Fill the stylist panel with styles that may be applied to the current selection.  Styles
+ * are supplied in the css_style property of the Xinha.Config object, which is in the format
+ * { '.className' : 'Description' }
+ * classes that are defined on a specific tag (eg 'a.email_link') are only shown in the panel
+ *    when an element of that type is selected.
+ * classes that are defined with selectors/psuedoclasses (eg 'a.email_link:hover') are never
+ *    shown (if you have an 'a.email_link' without the pseudoclass it will be shown of course)
+ * multiple classes (eg 'a.email_link.staff_member') are shown as a single class, and applied
+ *    to the element as multiple classes (class="email_link staff_member")
+ * you may click a class name in the stylist panel to add it, and click again to remove it
+ * you may add multiple classes to any element
+ * spans will be added where no single _and_entire_ element is selected
+ */
+Xinha.prototype._fillStylist = function()
+{
+  if(!this._stylist) return false;
+  this.plugins.Stylist.instance.main.innerHTML = '';
+
+  var may_apply = true;
+  var sel       = this._getSelection();
+
+  // What is applied
+  // var applied = this._getAncestorsClassNames(this._getSelection());
+
+  // Get an active element
+  var active_elem = this._activeElement(sel);
+
+  for(var x in this.config.css_style)
+  {
+    var tag   = null;
+    var className = x.trim();
+    var applicable = true;
+    var apply_to   = active_elem;
+
+    if(applicable && /[^a-zA-Z0-9_.-]/.test(className))
+    {
+      applicable = false; // Only basic classes are accepted, no selectors, etc.. presumed
+                          // that if you have a.foo:visited you'll also have a.foo
+      // alert('complex');
+    }
+
+    if(className.indexOf('.') < 0)
+    {
+      // No class name, just redefines a tag
+      applicable = false;
+    }
+
+    if(applicable && (className.indexOf('.') > 0))
+    {
+      // requires specific html tag
+      tag = className.substring(0, className.indexOf('.')).toLowerCase();
+      className = className.substring(className.indexOf('.'), className.length);
+
+      // To apply we must have an ancestor tag that is the right type
+      if(active_elem != null && active_elem.tagName.toLowerCase() == tag)
+      {
+        applicable = true;
+        apply_to = active_elem;
+      }
+      else
+      {
+        if(this._getFirstAncestor(this._getSelection(), [tag]) != null)
+        {
+          applicable = true;
+          apply_to = this._getFirstAncestor(this._getSelection(), [tag]);
+        }
+        else
+        {
+          // alert (this._getFirstAncestor(this._getSelection(), tag));
+          // If we don't have an ancestor, but it's a div/span/p/hx stle, we can make one
+          if(( tag == 'div' || tag == 'span' || tag == 'p'
+              || (tag.substr(0,1) == 'h' && tag.length == 2 && tag != 'hr')))
+          {
+            if(!this._selectionEmpty(this._getSelection()))
+            {
+              applicable = true;
+              apply_to = 'new';
+            }
+            else
+            {
+              // See if we can get a paragraph or header that can be converted
+              apply_to = this._getFirstAncestor(sel, ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7']);
+              if(apply_to != null)
+              {
+                applicable = true;
+              }
+              else
+              {
+                applicable = false;
+              }
+            }
+          }
+          else
+          {
+            applicable = false;
+          }
+        }
+      }
+    }
+
+    if(applicable)
+    {
+      // Remove the first .
+      className = className.substring(className.indexOf('.'), className.length);
+
+      // Replace any futher ones with spaces (for multiple class definitions)
+      className = className.replace('.', ' ');
+
+      if(apply_to == null)
+      {
+        if(this._selectionEmpty(this._getSelection()))
+        {
+          // Get the previous element and apply to that
+          apply_to = this._getFirstAncestor(this._getSelection(), null);
+        }
+        else
+        {
+          apply_to = 'new';
+          tag      = 'span';
+        }
+      }
+    }
+
+    var applied    = (this._ancestorsWithClasses(sel, tag, className).length > 0 ? true : false);
+    var applied_to = this._ancestorsWithClasses(sel, tag, className);
+
+    if(applicable)
+    {
+      var anch = document.createElement('a');
+      if ( Xinha.is_real_gecko ) anch.onfocus = function () { this.blur() } // prevent dotted line around link that causes horizontal scrollbar in Mozilla
+      anch._stylist_className = className.trim();
+      anch._stylist_applied   = applied;
+      anch._stylist_appliedTo = applied_to;
+      anch._stylist_applyTo = apply_to;
+      anch._stylist_applyTag = tag;
+
+      anch.innerHTML = this.config.css_style[x];
+      anch.href = 'javascript:void(0)';
+      var editor = this;
+      anch.onclick = function()
+      {
+        if(this._stylist_applied == true)
+        {
+          editor._stylistRemoveClasses(this._stylist_className, this._stylist_appliedTo);
+        }
+        else
+        {
+          editor._stylistAddClasses(this._stylist_applyTo, this._stylist_applyTag, this._stylist_className);
+        }
+        return false;
+      }
+
+      anch.style.display = 'block';
+      anch.style.paddingLeft = '3px';
+      anch.style.paddingTop = '1px';
+      anch.style.paddingBottom = '1px';
+      anch.style.textDecoration = 'none';
+
+      if(applied)
+      {
+        anch.style.background = 'Highlight';
+        anch.style.color = 'HighlightText';
+      }
+
+      this.plugins.Stylist.instance.main.appendChild(anch);
+    }
+  }
+};
+
+
+/**
+ * Add the given classes (space seperated list) to the currently selected element
+ * (will add a span if none selected)
+ */
+Xinha.prototype._stylistAddClasses = function(el, tag, classes)
+  {
+    if(el == 'new')
+    {
+      this.insertHTML('<' + tag + ' class="' + classes + '">' + this.getSelectedHTML() + '</' + tag + '>');
+    }
+    else
+    {
+      if(tag != null && el.tagName.toLowerCase() != tag)
+      {
+        // Have to change the tag!
+        var new_el = this.switchElementTag(el, tag);
+
+        if(typeof el._stylist_usedToBe != 'undefined')
+        {
+          new_el._stylist_usedToBe = el._stylist_usedToBe;
+          new_el._stylist_usedToBe[new_el._stylist_usedToBe.length] = {'tagName' : el.tagName, 'className' : el.getAttribute('class')};
+        }
+        else
+        {
+          new_el._stylist_usedToBe = [{'tagName' : el.tagName, 'className' : el.getAttribute('class')}];
+        }
+
+        Xinha.addClasses(new_el, classes);
+      }
+      else
+      {
+        Xinha._addClasses(el, classes);
+      }
+    }
+    this.focusEditor();
+    this.updateToolbar();
+  };
+
+/**
+ * Remove the given classes (space seperated list) from the given elements (array of elements)
+ */
+Xinha.prototype._stylistRemoveClasses = function(classes, from)
+  {
+    for(var x = 0; x < from.length; x++)
+    {
+      this._stylistRemoveClassesFull(from[x], classes);
+    }
+    this.focusEditor();
+    this.updateToolbar();
+  };
+
+Xinha.prototype._stylistRemoveClassesFull = function(el, classes)
+{
+  if(el != null)
+  {
+    var thiers = el.className.trim().split(' ');
+    var new_thiers = [ ];
+    var ours   = classes.split(' ');
+    for(var x = 0; x < thiers.length; x++)
+    {
+      var exists = false;
+      for(var i = 0; exists == false && i < ours.length; i++)
+      {
+        if(ours[i] == thiers[x])
+        {
+          exists = true;
+        }
+      }
+      if(exists == false)
+      {
+        new_thiers[new_thiers.length] = thiers[x];
+      }
+    }
+
+    if(new_thiers.length == 0 && el._stylist_usedToBe && el._stylist_usedToBe.length > 0 && el._stylist_usedToBe[el._stylist_usedToBe.length - 1].className != null)
+    {
+      // Revert back to what we were IF the classes are identical
+      var last_el = el._stylist_usedToBe[el._stylist_usedToBe.length - 1];
+      var last_classes = Xinha.arrayFilter(last_el.className.trim().split(' '), function(c) { if (c == null || c.trim() == '') { return false;} return true; });
+
+      if(
+        (new_thiers.length == 0)
+        ||
+        (
+        Xinha.arrayContainsArray(new_thiers, last_classes)
+        && Xinha.arrayContainsArray(last_classes, new_thiers)
+        )
+      )
+      {
+        el = this.switchElementTag(el, last_el.tagName);
+        new_thiers = last_classes;
+      }
+      else
+      {
+        // We can't rely on the remembered tags any more
+        el._stylist_usedToBe = [ ];
+      }
+    }
+
+    if(     new_thiers.length > 0
+        ||  el.tagName.toLowerCase() != 'span'
+        || (el.id && el.id != '')
+      )
+    {
+      el.className = new_thiers.join(' ').trim();
+    }
+    else
+    {
+      // Must be a span with no classes and no id, so we can splice it out
+      var prnt = el.parentNode;
+      var childs = el.childNodes;
+      for(var x = 0; x < childs.length; x++)
+      {
+        prnt.insertBefore(childs[x], el);
+      }
+      prnt.removeChild(el);
+    }
+  }
+};
+
+/**
+ * Change the tag of an element
+ */
+Xinha.prototype.switchElementTag = function(el, tag)
+{
+  var prnt = el.parentNode;
+  var new_el = this._doc.createElement(tag);
+
+  if(Xinha.is_ie || el.hasAttribute('id'))    new_el.setAttribute('id', el.getAttribute('id'));
+  if(Xinha.is_ie || el.hasAttribute('style')) new_el.setAttribute('style', el.getAttribute('style'));
+
+  var childs = el.childNodes;
+  for(var x = 0; x < childs.length; x++)
+  {
+    new_el.appendChild(childs[x].cloneNode(true));
+  }
+
+  prnt.insertBefore(new_el, el);
+  new_el._stylist_usedToBe = [el.tagName];
+  prnt.removeChild(el);
+  this.selectNodeContents(new_el);
+  return new_el;
+};
+
+Xinha.prototype._getAncestorsClassNames = function(sel)
+{
+  // Scan upwards to find a block level element that we can change or apply to
+  var prnt = this._activeElement(sel);
+  if(prnt == null)
+  {
+    prnt = (Xinha.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer);
+  }
+
+  var classNames = [ ];
+  while(prnt)
+  {
+    if(prnt.nodeType == 1)
+    {
+      var classes = prnt.className.trim().split(' ');
+      for(var x = 0; x < classes.length; x++)
+      {
+        classNames[classNames.length] = classes[x];
+      }
+
+      if(prnt.tagName.toLowerCase() == 'body') break;
+      if(prnt.tagName.toLowerCase() == 'table'  ) break;
+    }
+      prnt = prnt.parentNode;
+  }
+
+  return classNames;
+};
+
+Xinha.prototype._ancestorsWithClasses = function(sel, tag, classes)
+{
+  var ancestors = [ ];
+  var prnt = this._activeElement(sel);
+  if(prnt == null)
+  {
+    try
+    {
+      prnt = (Xinha.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer);
+    }
+    catch(e)
+    {
+      return ancestors;
+    }
+  }
+  var search_classes = classes.trim().split(' ');
+
+  while(prnt)
+  {
+    if(prnt.nodeType == 1 && prnt.className)
+    {
+      if(tag == null || prnt.tagName.toLowerCase() == tag)
+      {
+        var classes = prnt.className.trim().split(' ');
+        var found_all = true;
+        for(var i = 0; i < search_classes.length; i++)
+        {
+          var found_class = false;
+          for(var x = 0; x < classes.length; x++)
+          {
+            if(search_classes[i] == classes[x])
+            {
+              found_class = true;
+              break;
+            }
+          }
+
+          if(!found_class)
+          {
+            found_all = false;
+            break;
+          }
+        }
+
+        if(found_all) ancestors[ancestors.length] = prnt;
+      }
+      if(prnt.tagName.toLowerCase() == 'body')    break;
+      if(prnt.tagName.toLowerCase() == 'table'  ) break;
+    }
+    prnt = prnt.parentNode;
+  }
+
+  return ancestors;
+};
+
+
+Xinha.ripStylesFromCSSFile = function(URL)
+{
+  var css = Xinha._geturlcontent(URL);
+  return Xinha.ripStylesFromCSSString(css);
+};
+
+Xinha.ripStylesFromCSSString = function(css)
+{
+  // We are only interested in the selectors, the rules are not important
+  //  so we'll drop out all coments and rules
+  RE_comment = /\/\*(.|\r|\n)*?\*\//g;
+  RE_rule    = /\{(.|\r|\n)*?\}/g;
+  css = css.replace(RE_comment, '');
+  css = css.replace(RE_rule, ',');
+
+  // And split on commas
+  css = css.split(',');
+
+  // And add those into our structure
+  var selectors = { };
+  for(var x = 0; x < css.length; x++)
+  {
+    if(css[x].trim())
+    {
+      selectors[css[x].trim()] = css[x].trim();
+    }
+  }
+
+
+  return selectors;
+};
+
+// Make our right side panel and insert appropriatly
+function Stylist(editor, args)
+{
+  this.editor = editor;
+ 
+  var stylist = this;
+
+}
+
+Stylist._pluginInfo =
+{
+  name     : "Stylist",
+  version  : "1.0",
+  developer: "James Sleeman",
+  developer_url: "http://www.gogo.co.nz/",
+  c_owner      : "Gogo Internet Services",
+  license      : "HTMLArea",
+  sponsor      : "Gogo Internet Services",
+  sponsor_url  : "http://www.gogo.co.nz/"
+};
+
+Stylist.prototype.onGenerateOnce = function()
+{
+  var editor = this.editor;
+  var stylist = this;
+  if(typeof editor.config.css_style != 'undefined' && Xinha.objectProperties(editor.config.css_style).length != 0)
+  {
+    editor._stylist = null; // This needs to be changes to be Stylist::_stylist sometime
+    editor._stylist = editor.addPanel('right');
+    Xinha.addClass(editor._stylist, 'stylist');
+
+    this.caption = document.createElement("h1");
+    this.caption.innerHTML = Xinha._lc('Styles', 'Stylist');
+    editor._stylist.appendChild(this.caption);
+    this.main = document.createElement("div");
+    this.main.style.overflow = "auto";
+    this.main.style.height = this.editor._framework.ed_cell.offsetHeight - this.caption.offsetHeight + 'px';
+
+    editor._stylist.appendChild(this.main);
+
+    Xinha.freeLater(this,"caption");
+    Xinha.freeLater(this,"main");
+
+    editor.notifyOn('modechange',
+      function(e,args)
+      {
+        switch(args.mode)
+        {
+          case 'text':
+          {
+            editor.hidePanel(editor._stylist);
+            break;
+          }
+          case 'wysiwyg':
+          {
+            editor.showPanel(editor._stylist);
+            break;
+          }
+        }
+      }
+    );
+    editor.notifyOn('panel_change',
+      function(e,args)
+      {
+        switch (args.action)
+        {
+          case 'show':
+          var newHeight = stylist.main.offsetHeight - args.panel.offsetHeight;
+          stylist.main.style.height = ((newHeight > 0) ?  stylist.main.offsetHeight - args.panel.offsetHeight : 0) + 'px';
+          editor._stylist.style.height = stylist.caption.offsetHeight + "px";
+          editor.sizeEditor();
+          break;
+          case 'hide':
+            stylist.resize();
+          break;
+        }
+      }
+    );
+    editor.notifyOn('before_resize',
+    function()
+      {
+        editor._stylist.style.height = stylist.caption.offsetHeight + "px";
+      }
+    );
+    editor.notifyOn('resize',
+      function()
+      {
+        stylist.resize();
+      }
+    );
+  }
+
+};
+Stylist.prototype.resize = function()
+{
+  var editor = this.editor;
+  var panelContainer = editor._stylist.parentNode;
+
+  var newSize = panelContainer.offsetHeight;
+  for (var i=0; i < panelContainer.childNodes.length;++i)
+  {
+    if (panelContainer.childNodes[i]==editor._stylist || !panelContainer.childNodes[i].offsetHeight)
+    {
+      continue;
+    }
+    newSize -= panelContainer.childNodes[i].offsetHeight;
+  }
+  editor._stylist.style.height = newSize + 'px';
+  this.main.style.height = newSize - this.caption.offsetHeight + 'px';
+}
+
+Stylist.prototype.onUpdateToolbar = function()
+{
+  if(this.editor._stylist)
+  {
+    if(this._timeoutID)
+    {
+      window.clearTimeout(this._timeoutID);
+    }
+
+    var e = this.editor;
+    this._timeoutID = window.setTimeout(function() { e._fillStylist(); }, 250);
+  }
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/pt_br.js (revision 901)
@@ -0,0 +1,41 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Initial basic translation
+// Author: Cau guanabara (independent developer), caugb@ibest.com.br
+//
+// Final translation
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Case sensitive search": "Procura diferenciada Maiúsculas/Minúsculas",
+  "Clear": "Limpar",
+  "Done": "Executado",
+  "Enter the text you want to find": "Forneça o texto que deseja procurar",
+  "Find and Replace": "Procurar e Substituir",
+  "Highlight": "Marcar",
+  "Inform a replacement word": "Informe uma palavra para substituir",
+  "Next": "Próxima",
+  "Options": "Opções",
+  "Replace with:": "Substituir por:",
+  "Search for:": "Procurar por:",
+  "Substitute all occurrences": "Substituir todas as ocorrências",
+  "Substitute this occurrence?": "Substituir todas as ocorrências?",
+  "Undo": "Desfazer",
+  "Whole words only": "Apenas palavras inteiras",
+  "found item": "Item encontrado",
+  "found items": "Itens encontrados",
+  "not found": "nada encontrado",
+  "replaced item": "substituir item",
+  "replaced items": "substituir itens"
+}
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/ru.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/ru.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/ru.js (revision 901)
@@ -0,0 +1,28 @@
+﻿// I18N constants
+// LANG: "ru", ENCODING: UTF-8
+// Author: Andrei Blagorazumov, a@fnr.ru
+
+{
+  // messages
+  "Substitute this occurrence?": "Заменить это вхождение?",
+  "Enter the text you want to find": "Введите текст, который вы хотите найти",
+  "Inform a replacement word": "Показать замещающее слово",
+  "found items": "найти",
+  "replaced items": "замененные",
+  "found item": "найти",
+  "replaced item": "замененная",
+  "not found": "не найдено",
+  // window
+  "Find and Replace": "Найти и заменить",
+  "Search for:": "Найти",
+  "Replace with:": "Заменить с",
+  "Options": "Опции",
+  "Whole words only": "Только слова целиком",
+  "Case sensitive search": "Поиск с учетом регистра",
+  "Substitute all occurrences": "Заменить все вхождения",
+  "Clear": "Очистить",
+  "Highlight": "Выделить",
+  "Undo": "Отменить",
+  "Next": "След.",
+  "Done": "OK"
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/fr.js (revision 677)
@@ -0,0 +1,26 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  // messages
+  "Substitute this occurrence?": "Remplacer cette occurrence ?",
+  "Enter the text you want to find": "Texte Ã  trouver",
+  "Inform a replacement word": "Indiquez un mot de remplacement",
+  "found items": "Ã©lÃ©ments trouvÃ©s",
+  "replaced items": "Ã©lÃ©ments remplacÃ©s",
+  "found item": "Ã©lÃ©ment trouvÃ©",
+  "replaced item": "Ã©lÃ©ment remplacÃ©",
+  "not found": "non trouvÃ©",
+  // window
+  "Find and Replace": "Chercher et Remplacer",
+  "Search for:": "Chercher",
+  "Replace with:": "Remplacer par",
+  "Options": "Options",
+  "Whole words only": "Mots entiers seulement",
+  "Case sensitive search": "Recherche sensible Ã  la casse",
+  "Substitute all occurrences": "Remplacer toutes les occurences",
+  "Clear": "Effacer",
+  "Highlight": "Surligner",
+  "Undo": "Annuler",
+  "Next": "Suivant",
+  "Done": "Fin"
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/de.js (revision 677)
@@ -0,0 +1,27 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  // messages
+  "Substitute this occurrence?": "Treffer ersetzen?",
+  "Enter the text you want to find": "Geben Sie einen Text ein den Sie finden mÃ¶chten",
+  "Inform a replacement word": "Geben sie einen Text zum ersetzen ein",
+  "found items": "alle Treffer",
+  "replaced items": "ersetzte Treffer",
+  "found item": "Treffer",
+  "replaced item": "ersetzter Treffer",
+  "not found": "kein Teffer",
+  // window
+  "Find and Replace": "Suchen und ersetzen",
+  "Search for:": "Suchen nach:",
+  "Replace with:": "Ersetzen durch:",
+  "Options": "Optionen",
+  "Whole words only": "Ganze WÃ¶rter",
+  "Case sensitive search": "GroÃ-/Kleinschreibung",
+  "Substitute all occurrences": "alle Treffer ersetzen",
+  "Clear": "NÃ€chstes ersetzen",
+  "Highlight": "Hervorheben",
+  "Undo": "RÃŒckgÃ€ngig",
+  "Next": "NÃ€chster",
+  "Done": "Fertig"
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/sv.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/sv.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/sv.js (revision 677)
@@ -0,0 +1,27 @@
+// I18N constants
+// LANG: "sv" (Swedish), ENCODING: UTF-8
+// translated: Erik DalÃ©n, <dalen@jpl.se>
+{
+  // messages
+  "Substitute this occurrence?": "ErsÃ€tt denna?",
+  "Enter the text you want to find": "Skriv in text du vill sÃ¶ka",
+  "Inform a replacement word": "Skriv in ett ersÃ€ttningsord",
+  "found items": "fÃ¶rekomster funna i sÃ¶kningen",
+  "replaced items": "fÃ¶rekomster erstatta",
+  "found item": "TrÃ€ff",
+  "replaced item": "erstatt trÃ€ff",
+  "not found": "inte funnet",
+  // window
+  "Find and Replace": "SÃ¶k och ersÃ€tt",
+  "Search for:": "SÃ¶k efter:",
+  "Replace with:": "ErsÃ€tt med:",
+  "Options": "VÃ€lj", 
+  "Whole words only": "Bara hela ord",
+  "Case sensitive search": "Skilj mellan stora och smÃ¥ bokstÃ€ver",
+  "Substitute all occurrences": "Erstatt alla trÃ€ffar",
+  "Clear": "TÃ¶m",
+  "Highlight": "Markera",
+  "Undo": "Tillbaka",
+  "Next": "NÃ€sta",
+  "Done": "FÃ€rdig"
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/nl.js (revision 872)
@@ -0,0 +1,27 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  // messages
+  "Substitute this occurrence?": "Deze overeenkomst vervangen?",
+  "Enter the text you want to find": "Voer tekst in waar je op wilt zoeken",
+  "Inform a replacement word": "Voer een vervang woord of zin in",
+  "found items": "gevonden overeenkomsten",
+  "replaced items": "vervangen items",
+  "found item": "gevonden overeenkomst",
+  "replaced item": "vervangen item",
+  "not found": "niet gevonden",
+  // window
+  "Find and Replace": "Zoek en vervang",
+  "Search for:": "Zoek naar:",
+  "Replace with:": "Vervang met:",
+  "Options": "Opties", 
+  "Whole words only": "Alleen hele woorden",
+  "Case sensitive search": "Exact zoeken",
+  "Substitute all occurrences": "Vervang alle overeenkomsten",
+  "Clear": "Leeg",
+  "Highlight": "Markeren",
+  "Undo": "Ongedaan maken",
+  "Next": "Volgende",
+  "Done": "Voltooien"
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/ja.js (revision 715)
@@ -0,0 +1,29 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  // messages
+  "Substitute this occurrence?": "çœ®æããŸãã?",
+  "Enter the text you want to find": "æ€çŽ¢ããããã­ã¹ããå
+¥åããŸã",
+  "Inform a replacement word": "åèªã®çœ®æãç¥ããã",
+  "found items": "ä»¶ãæ€çŽ¢ãããŸãã",
+  "replaced items": "ä»¶ãçœ®æãããŸãã",
+  "found item": "ä»¶ãæ€çŽ¢ãããŸãã",
+  "replaced item": "ä»¶ãçœ®æãããŸãã",
+  "not found": "ã¯ãããŸãã",
+  // window
+  "Find and Replace": "æ€çŽ¢/çœ®æ",
+  "Search for:": "æ€çŽ¢:",
+  "Replace with:": "çœ®æ:",
+  "Options": "èš­å®",
+  "Whole words only": "å®å
+šäžèŽã®ã¿",
+  "Case sensitive search": "å€§æå­/å°æå­åºå¥",
+  "Substitute all occurrences": "ãã¹ãŠçœ®æ",
+  "Clear": "éåžžè¡šç€º",
+  "Highlight": "åŒ·èª¿è¡šç€º",
+  "Undo": "å
+ã«æ»ã",
+  "Next": "æ¬¡ãæ€çŽ¢",
+  "Done": "çµäº"
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/pl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/pl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/pl.js (revision 677)
@@ -0,0 +1,29 @@
+// I18N constants
+// LANG: "pl", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz, koto1sa@o2.pl, http://www.eskot.krakow.pl/portfolio
+{
+  // messages
+  "Substitute this occurrence?": "ZamieniÄ to wystÄ
+pienie?",
+  "Enter the text you want to find": "Podaj tekst, jaki chcesz wyszukaÄ",
+  "Inform a replacement word": "Podaj tekst do zamiany",
+  "found items": "znalezionych",
+  "replaced items": "zamienionych",
+  "found item": "znaleziony",
+  "replaced item": "zamieniony",
+  "not found": "nie znaleziony",
+  // window
+  "Find and Replace": "ZnajdÅº i zamieÅ",
+  "Search for:": "Szukaj:",
+  "Replace with:": "ZamieÅ na:",
+  "Options": "Opcje",
+  "Whole words only": "CaÅe sÅowa",
+  "Case sensitive search": "Wg wielkoÅci liter",
+  "Substitute all occurrences": "ZamieÅ wszystkie wystÄ
+pienia",
+  "Clear": "WyczyÅÄ",
+  "Highlight": "PodÅwietl",
+  "Undo": "Cofnij",
+  "Next": "NastÄpny",
+  "Done": "Gotowe"
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/FindReplace/lang/nb.js (revision 677)
@@ -0,0 +1,27 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  // messages
+  "Substitute this occurrence?": "Vennligst bekreft at du vil erstatte?",
+  "Enter the text you want to find": "Skriv inn teksten du Ãžnsker Ã¥ finne",
+  "Inform a replacement word": "Vennligst skriv inn et erstatningsord / setning",
+  "found items": "forekomster funnet i sÃžket",
+  "replaced items": "forekomster erstattet",
+  "found item": "Treff",
+  "replaced item": "erstattet treff",
+  "not found": "ikke funnet",
+  // window
+  "Find and Replace": "SÃžk og erstatt",
+  "Search for:": "SÃžk etter:",
+  "Replace with:": "Erstatt med:",
+  "Options": "Valg", 
+  "Whole words only": "Bare hele ord",
+  "Case sensitive search": "Skille mellom store og smÃ¥ bokstaver",
+  "Substitute all occurrences": "Erstatt alle treff",
+  "Clear": "TÃžm",
+  "Highlight": "Uthev",
+  "Undo": "Tilbake",
+  "Next": "Neste",
+  "Done": "Ferdig"
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/find-replace.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/find-replace.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/FindReplace/find-replace.js (revision 856)
@@ -0,0 +1,42 @@
+/*---------------------------------------*\
+ Find and Replace Plugin for HTMLArea-3.0
+ -----------------------------------------
+ author: Cau guanabara 
+ e-mail: caugb@ibest.com.br
+\*---------------------------------------*/
+
+function FindReplace(editor) {
+this.editor = editor;
+var cfg = editor.config;
+var self = this;
+cfg.registerButton("FR-findreplace", this._lc("Find and Replace"),
+                   editor.imgURL("ed_find.gif", "FindReplace"), false,
+                   function(editor) { self.buttonPress(editor); });
+cfg.addToolbarElement(["FR-findreplace","separator"], ["formatblock","fontsize","fontname"], -1);
+}
+
+FindReplace.prototype.buttonPress = function(editor) { 
+FindReplace.editor = editor;
+var sel = editor.getSelectedHTML();
+  if(/\w/.test(sel)) {
+  sel = sel.replace(/<[^>]*>/g,"");
+  sel = sel.replace(/&nbsp;/g,"");
+  }
+var param = /\w/.test(sel) ? {fr_pattern: sel} : null;
+editor._popupDialog("plugin://FindReplace/find_replace", null, param);
+};
+
+FindReplace._pluginInfo = {
+  name          : "FindReplace",
+  version       : "1.0 - beta",
+  developer     : "Cau Guanabara",
+  developer_url : "mailto:caugb@ibest.com.br",
+  c_owner       : "Cau Guanabara",
+  sponsor       : "Independent production",
+  sponsor_url   : "http://www.netflash.com.br/gb/HA3-rc1/examples/find-replace.html",
+  license       : "htmlArea"
+};
+
+FindReplace.prototype._lc = function(string) {
+    return Xinha._lc(string, 'FindReplace');
+};
Index: /branches/new-dialogs-merge/plugins/FindReplace/popups/find_replace.html
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/popups/find_replace.html (revision 987)
+++ /branches/new-dialogs-merge/plugins/FindReplace/popups/find_replace.html (revision 987)
@@ -0,0 +1,162 @@
+<html>
+<head>
+  <title>Find and Replace</title>
+<!--
+/*---------------------------------------*\
+ Find and Replace Plugin for HTMLArea-3.0
+ -----------------------------------------
+ author: Cau guanabara 
+ e-mail: caugb@ibest.com.br
+\*---------------------------------------*/
+-->
+<script type="text/javascript" src="../fr_engine.js"></script>
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+
+<script type="text/javascript">
+
+window.resizeTo(335, 250);
+
+var accepted = {
+                'fr_pattern'       : true,
+                'fr_replacement'   : true,
+                'fr_words'         : true,
+                'fr_matchcase'     : true,
+                'fr_replaceall'    : true
+               };
+
+function Init() {
+__dlg_translate('FindReplace');
+__dlg_init();
+
+disab("fr_undo,fr_clear,fr_hiliteall",true);
+
+var params = window.dialogArguments;
+  if(params) {
+  document.getElementById('fr_pattern').value = params["fr_pattern"];
+  document.getElementById('fr_replacement').focus();
+  } else {
+  document.getElementById('fr_pattern').focus();
+  }
+  
+document.body.onkeypress = __dlg_key_press;
+}
+
+function onCancel() {
+  clearDoc();
+  __dlg_close(null);
+  return false;
+}
+
+function onOK() {
+  var required = {'fr_pattern' : _lc("Enter the text you want to find")};
+  for (var i in required) {
+    var el = document.getElementById(i);
+      if (!el.value) {
+        alert(required[i]);
+        el.focus();
+        return false;
+      }
+  }
+
+  var param = {};
+  for (var i in accepted) {
+  var el = document.getElementById(i);
+  param[i] = el.type == 'checkbox' ? el.checked : el.value;
+  }
+  execSearch(param);
+  return false;
+}
+
+function __dlg_key_press(ev) {
+ev || (ev = window.event);
+  switch(ev.keyCode) {
+    case 13:
+    document.getElementById('fr_go').click();
+    document.getElementById('fr_pattern').focus();
+      break;
+    case 27:
+    clearDoc();
+    window.close();
+    return false;
+  }
+return true;
+}
+
+</script>
+
+<style type="text/css">
+table .label { text-align: right; width: 12em; }
+.title {
+background: #ddf;
+color: #000;
+font-weight: bold;
+font-size: 120%;
+padding: 3px 10px;
+margin-bottom: 10px;
+border-bottom: 1px solid black;
+letter-spacing: 2px;
+}
+.buttons { border-top: 1px solid #999; padding: 2px; text-align: right; }
+.hrstyle { border-width: 1px; border-color: #666; width: 95%; padding: 2px; }
+</style>
+  </head>
+  <body class="dialog" onload="Init()">
+  <div class="title">Find and Replace</div>
+  <form action="" method="get">
+  <table border="0" style="width: 100%; padding: 2px;"><!---->
+    <tbody>
+      <tr> 
+        <td width="29%" style="text-align: right; vertical-align: bottom;">Search for:</td>
+        <td width="71%" colspan="2" style="vertical-align: bottom;"> 
+        <input id="fr_pattern" type="text" style="width: 200px" onFocus="this.select();"> 
+        </td>
+      </tr>
+      <tr> 
+        <td style="text-align: right;">Replace with:</td>
+        <td colspan="2"> 
+        <input id="fr_replacement" type="text" style="width: 200px" onFocus="this.select();"> 
+        </td>
+      </tr>
+      <tr> 
+        <td colspan="3"><table width="100%" border="0" cellpadding="1" cellspacing="0">
+            <tr> 
+              <td width="78%" style="padding: 2px">
+              <FIELDSET style="width:90%; padding: 5px">
+                <LEGEND><span>Options</span></LEGEND>
+                  <input id="fr_words" type="checkbox" checked onClick="clearDoc();">
+                <span onClick="e = document.getElementById('fr_words'); 
+                e.click(); e.focus();" style="cursor:default"> 
+                  <span>Whole words only</span></span><br />
+                  <input id="fr_matchcase" type="checkbox" onClick="clearDoc();">
+                <span onClick="e = document.getElementById('fr_matchcase'); 
+                e.click(); e.focus();" style="cursor:default"> 
+                  <span>Case sensitive search</span></span><br />
+                  <input id="fr_replaceall" type="checkbox" onClick="
+                  if(document.getElementById('fr_replacement').value == '') {
+                  alert(_lc('Inform a replacement word'));
+                  return false;
+                  }
+                  clearDoc();">
+                <span onClick="e = document.getElementById('fr_replaceall'); 
+                e.click(); e.focus();" style="cursor:default"> 
+                  <span>Substitute all occurrences</span></span>
+                </FIELDSET></td>
+<td width="22%" style="vertical-align: bottom; text-align: right; padding: 4px"> 
+<button type="button" id="fr_clear" onClick="clearMarks()">Clear</button>
+<div class="space"></div>
+<button type="button" id="fr_hiliteall" onClick="hiliteAll()">Highlight</button>
+<div class="space"></div>
+<button type="button" id="fr_undo" onClick="resetContents();">Undo</button>
+</td>
+            </tr>
+          </table></td>
+      </tr>
+    </tbody>
+  </table>
+<div style="border-top: 1px solid #999; padding: 2px; padding: 5px; text-align: right; height: 20px"><button type="button" id="fr_go" onclick="return onOK();">Next</button>
+<button type="button" name="cancel" onclick="return onCancel();">Done</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/FindReplace/fr_engine.js
===================================================================
--- /branches/new-dialogs-merge/plugins/FindReplace/fr_engine.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/FindReplace/fr_engine.js (revision 856)
@@ -0,0 +1,149 @@
+/*---------------------------------------*\
+ Find and Replace Plugin for HTMLArea-3.0
+ -----------------------------------------
+ author: Cau guanabara 
+ e-mail: caugb@ibest.com.br
+\*---------------------------------------*/
+
+var FindReplace = window.opener.FindReplace;
+var editor = FindReplace.editor;
+var is_mo = window.opener.Xinha.is_gecko;
+var tosearch = '';
+var pater = null;
+var buffer = null;
+var matches = 0;
+var replaces = 0;
+var fr_spans = new Array();
+function _lc(string) {
+    return(window.opener.Xinha._lc(string, 'FindReplace'));
+}
+function execSearch(params) {
+var ihtml = editor._doc.body.innerHTML;
+  if(buffer == null) 
+    buffer = ihtml;
+    
+  if(params['fr_pattern'] != tosearch) {
+    if(tosearch != '')
+      clearDoc();
+  tosearch = params['fr_pattern'];
+  }
+  
+  if(matches == 0) {
+  er = params['fr_words'] ? "/(?!<[^>]*)(\\b"+params['fr_pattern']+"\\b)(?![^<]*>)/g" :
+                            "/(?!<[^>]*)("+params['fr_pattern']+")(?![^<]*>)/g";
+    if(!params['fr_matchcase'])
+      er += "i"; 
+
+  pater = eval(er);
+  
+  var tago = '<span id=frmark>';
+  var tagc = '</span>';
+  var newHtml = ihtml.replace(pater,tago+"$1"+tagc);
+  
+  editor.setHTML(newHtml);
+  
+  var getallspans = editor._doc.body.getElementsByTagName("span"); 
+    for (var i = 0; i < getallspans.length; i++) 
+      if(/^frmark/.test(getallspans[i].id))
+        fr_spans.push(getallspans[i]);
+  }
+
+spanWalker(params['fr_pattern'],params['fr_replacement'],params['fr_replaceall']);
+}
+
+function spanWalker(pattern,replacement,replaceall) {
+var foundtrue = false;
+clearMarks();
+
+  for (var i = matches; i < fr_spans.length; i++) {
+  var elm = fr_spans[i];
+  foundtrue = true;
+    if(!(/[0-9]$/.test(elm.id))) { 
+    matches++;
+    disab('fr_clear',false);
+    elm.id = 'frmark_'+matches;
+    elm.style.color = 'white';
+    elm.style.backgroundColor = 'highlight';
+    elm.style.fontWeight = 'bold';
+    elm.scrollIntoView(false);
+      if(/\w/.test(replacement)) {
+        if(replaceall || confirm(_lc("Substitute this occurrence?"))) {
+        elm.firstChild.replaceData(0,elm.firstChild.data.length,replacement);
+        replaces++;
+        disab('fr_undo',false);
+        }
+        if(replaceall) {
+        clearMarks();
+        continue;
+        }
+      }
+    break;
+    }
+  }
+  var last = (i >= fr_spans.length - 1);
+  if(last || !foundtrue) { // EOF
+  var message = _lc("Done")+':\n\n';
+    if(matches > 0) {
+      if(matches == 1) message += matches+' '+_lc("found item");
+      else             message += matches+' '+_lc("found items");
+      if(replaces > 0) {
+        if(replaces == 1) message += ',\n'+replaces+' '+_lc("replaced item");
+        else              message += ',\n'+replaces+' '+_lc("replaced items");
+      }
+    hiliteAll();
+    disab('fr_hiliteall',false);
+    } else { message += '"'+pattern+'" '+_lc("not found"); }
+  alert(message+'.');
+  }
+}
+
+function clearDoc() {
+var doc = editor._doc.body.innerHTML; 
+var er = /(<span\s+[^>]*id=.?frmark[^>]*>)([^<>]*)(<\/span>)/gi;
+editor._doc.body.innerHTML = doc.replace(er,"$2");
+pater = null;
+tosearch = '';
+fr_spans = new Array();
+matches = 0;
+replaces = 0;
+disab("fr_hiliteall,fr_clear",true);
+}
+
+function clearMarks() {
+var getall = editor._doc.body.getElementsByTagName("span"); 
+  for (var i = 0; i < getall.length; i++) {
+  var elm = getall[i];
+    if(/^frmark/.test(elm.id)) {
+    var objStyle = editor._doc.getElementById(elm.id).style;
+    objStyle.backgroundColor = "";
+    objStyle.color = "";
+    objStyle.fontWeight = "";
+    }
+  }
+}
+
+function hiliteAll() { 
+var getall = editor._doc.body.getElementsByTagName("span"); 
+  for (var i = 0; i < getall.length; i++) {
+  var elm = getall[i];
+    if(/^frmark/.test(elm.id)) { 
+    var objStyle = editor._doc.getElementById(elm.id).style;
+    objStyle.backgroundColor = "highlight";
+    objStyle.color = "white";
+    objStyle.fontWeight = "bold";
+    }
+  }
+}
+
+function resetContents() { 
+  if(buffer == null) return;
+var transp = editor._doc.body.innerHTML;
+editor._doc.body.innerHTML = buffer;
+buffer = transp;
+}
+
+function disab(elms,toset) { 
+var names = elms.split(/[,; ]+/);
+  for(var i = 0; i < names.length; i++) 
+    document.getElementById(names[i]).disabled = toset;
+}
Index: /branches/new-dialogs-merge/plugins/ListType/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/pt_br.js (revision 901)
@@ -0,0 +1,24 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Decimal numbers": "Números decimais",
+  "Lower roman numbers": "Números romanos inferiores",
+  "Upper roman numbers": "Números romanos superiores",
+  "Lower latin letters": "Letras latinas inferiores",
+  "Upper latin letters": "Letras latinas superiores",
+  "Lower greek letters": "Letras gregas inferiores",
+  "Choose list style type (for ordered lists)": "Escolha um tipo de lista (para lista ordenada)"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/lang/ru.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/ru.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/ru.js (revision 901)
@@ -0,0 +1,12 @@
+﻿// I18N constants
+// LANG: "ru", ENCODING: UTF-8
+// Author: Andrei Blagorazumov, a@fnr.ru
+{
+  "Decimal numbers": "Десятичные числа",
+  "Lower roman numbers": "Строчные романские числа",
+  "Upper roman numbers": "Заглавные романские числа",
+  "Lower latin letters": "Строчные латинские символы",
+  "Upper latin letters": "Заглавные латинские символы",
+  "Lower greek letters": "Строчные греческие символы",
+  "Choose list style type (for ordered lists)": "Выберите стиль списков (для упорядоченных списков)"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/fr.js (revision 677)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Decimal numbers": "Nombres dÃ©cimaux",
+  "Lower roman numbers": "Nombres romains minuscule",
+  "Upper roman numbers": "Nombres romains majuscule",
+  "Lower latin letters": "Lettres latines minuscule",
+  "Upper latin letters": "Lettres latines majuscule",
+  "Lower greek letters": "Lettres grecques minuscule",
+  "Choose list style type (for ordered lists)": "Choisissez le style de liste (pour les listes ordonnÃ©es)"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/de.js (revision 383)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/de.js (revision 383)
@@ -0,0 +1,12 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Raimund Meyer xinha@ray-of-light.org
+{
+  "Decimal numbers": "Zahlen",
+  "Lower roman numbers": "RÃ¶misch klein",
+  "Upper roman numbers": "RÃ¶misch groÃ",
+  "Lower latin letters": "Zeichen klein",
+  "Upper latin letters": "Zeichen groÃ",
+  "Lower greek letters": "Griechisch",
+  "Choose list style type (for ordered lists)": "WÃ€hlen Sie einen Typ fÃŒr die Nummerierung aus"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/lang/sv.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/sv.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/sv.js (revision 901)
@@ -0,0 +1,12 @@
+﻿// I18N constants
+// LANG: "sv" (Swedish), ENCODING: UTF-8
+// translated: Erik Dalén, <dalen@jpl.se>
+{
+  "Decimal numbers": "Desimaltal",
+  "Lower roman numbers": "Små romerska siffror",
+  "Upper roman numbers": "Stora romerska siffror",
+  "Lower latin letters": "Små latinska bokstäver",
+  "Upper latin letters": "Stora latinska bokstäver",
+  "Lower greek letters": "Små grekiska bokstäver",
+  "Choose list style type (for ordered lists)": "Välj listtyp (för numrerade listor)"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/nl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/nl.js (revision 677)
@@ -0,0 +1,12 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+{
+  "Decimal numbers": "Decimale nummers",
+  "Lower roman numbers": "Romeinse nummers klein",
+  "Upper roman numbers": "Romeinse nummers groot",
+  "Lower latin letters": "Latijnse letters klein",
+  "Upper latin letters": "Latijnse letters groot",
+  "Lower greek letters": "Griekse letters",
+  "Choose list style type (for ordered lists)": "Kies stijl type (voor ordered lists)"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/ja.js (revision 715)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Decimal numbers": "10é²æ°",
+  "Lower roman numbers": "ã­ãŒãæ°å­(å°æå­)",
+  "Upper roman numbers": "ã­ãŒãæ°å­(å€§æå­)",
+  "Lower latin letters": "ã¢ã«ãã¡ããã(å°æå­)",
+  "Upper latin letters": "ã¢ã«ãã¡ããã(å€§æå­)",
+  "Lower greek letters": "ã®ãªã·ã£æå­(å°æå­)",
+  "Choose list style type (for ordered lists)": "ãªã¹ãåœ¢åŒã®éžæ(é åºä»ããªã¹ãçš)"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/lang/pl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/pl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/pl.js (revision 677)
@@ -0,0 +1,12 @@
+// I18N constants
+// LANG: "pl", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz, koto1sa@o2.pl, http://www.eskot.krakow.pl/portfolio
+{
+  "Decimal numbers": "Cyfry arabskie",
+  "Lower roman numbers": "MaÅe rzymskie",
+  "Upper roman numbers": "DuÅŒe rzymskie",
+  "Lower latin letters": "MaÅe litery",
+  "Upper latin letters": "DuÅŒe litery",
+  "Lower greek letters": "MaÅe litery greckie",
+  "Choose list style type (for ordered lists)": "Wybierz typ listy numerowanej"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ListType/lang/nb.js (revision 677)
@@ -0,0 +1,12 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Decimal numbers": "Desimaltall",
+  "Lower roman numbers": "Lower roman numbers",
+  "Upper roman numbers": "Upper roman numbers",
+  "Lower latin letters": "Lower latin letters",
+  "Upper latin letters": "Upper latin letters",
+  "Lower greek letters": "Lower greek letters",
+  "Choose list style type (for ordered lists)": "Velg listetype (for nummererte lister)"
+};
Index: /branches/new-dialogs-merge/plugins/ListType/ListType.css
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/ListType.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/ListType/ListType.css (revision 677)
@@ -0,0 +1,43 @@
+.ListType { }
+.ListType a {
+  display:block;
+  float:left;
+  margin:2px 0 0 5px;
+  padding:0;
+  width:50px;
+  height:40px;
+  border:1px solid #9c96a5;
+}
+.ListType a:hover {
+  border:1px solid #ffd760;
+}
+.ListType a.active {
+  border:1px solid #000084;
+}
+.ListType a.circle {
+  background:url(img/circle.png);
+}
+.ListType a.disc {
+  background:url(img/disc.png);
+}
+.ListType a.square {
+  background:url(img/square.png);
+}
+.ListType a.decimal {
+  background:url(img/decimal.png);
+}
+.ListType a.lower-alpha {
+  background:url(img/lower-alpha.png);
+}
+.ListType a.upper-alpha {
+  background:url(img/upper-alpha.png);
+}
+.ListType a.lower-roman {
+  background:url(img/lower-roman.png);
+}
+.ListType a.upper-roman {
+  background:url(img/upper-roman.png);
+}
+.ListType a.none {
+  background:url(img/none.png);
+}
Index: /branches/new-dialogs-merge/plugins/ListType/list-type.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ListType/list-type.js (revision 876)
+++ /branches/new-dialogs-merge/plugins/ListType/list-type.js (revision 876)
@@ -0,0 +1,191 @@
+// ListType Plugin for Xinha
+// Toolbar Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+Xinha.loadStyle( 'ListType.css', 'ListType' );
+
+function ListType( editor )
+{
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+
+  if ( cfg.ListType.mode == 'toolbar' )
+  {
+  var options = {};
+    options[Xinha._lc( "Decimal numbers", "ListType" )] = "decimal";
+    options[Xinha._lc( "Lower roman numbers", "ListType" )] = "lower-roman";
+    options[Xinha._lc( "Upper roman numbers", "ListType" )] = "upper-roman";
+    options[Xinha._lc( "Lower latin letters", "ListType" )] = "lower-alpha";
+    options[Xinha._lc( "Upper latin letters", "ListType" )] = "upper-alpha";
+    if (!Xinha.is_ie)
+      // IE doesn't support this property; even worse, it complains
+      // with a gross error message when we tried to select it,
+      // therefore let's hide it from the damn "browser".
+      options[Xinha._lc( "Lower greek letters", "ListType" )] = "lower-greek";
+    var obj =
+    {
+      id            : "listtype",
+      tooltip       : Xinha._lc( "Choose list style type (for ordered lists)", "ListType" ),
+      options       : options,
+      action        : function( editor ) { self.onSelect( editor, this ); },
+      refresh       : function( editor ) { self.updateValue( editor, this ); },
+      context       : "ol"
+    };
+    cfg.registerDropdown( obj );
+    cfg.addToolbarElement( "listtype", ["insertorderedlist","orderedlist"], 1 );
+  }
+  else
+  {
+    editor._ListType = editor.addPanel( 'right' );
+    Xinha.freeLater( editor, '_ListType' );
+    Xinha.addClass( editor._ListType, 'ListType' );
+    // hurm, ok it's pretty to use the background color for the whole panel,
+    // but should not it be set by default when creating the panel ?
+    Xinha.addClass( editor._ListType.parentNode, 'dialog' );
+
+    editor.notifyOn( 'modechange',
+      function(e,args)
+      {
+        if ( args.mode == 'text' ) editor.hidePanel( editor._ListType );
+      }
+    );
+
+    var elts_ul = ['disc', 'circle', 'square', 'none'];
+    var elts_ol = ['decimal', 'lower-alpha', 'upper-alpha', 'lower-roman', 'upper-roman', 'none'];
+    var divglobal = document.createElement( 'div' );
+    divglobal.style.height = '90px';
+    var div = document.createElement( 'div' );
+    this.divUL = div;
+    div.style.display = 'none';
+    for ( var i=0; i<elts_ul.length; i++ )
+    {
+      div.appendChild( this.createImage( elts_ul[i] ) );
+    }
+    divglobal.appendChild( div );
+    var div = document.createElement( 'div' );
+    this.divOL = div;
+    div.style.display = 'none';
+    for ( var i=0; i<elts_ol.length; i++ )
+    {
+      div.appendChild( this.createImage( elts_ol[i] ) );
+    }
+    divglobal.appendChild( div );
+
+    editor._ListType.appendChild( divglobal );
+
+    editor.hidePanel( editor._ListType );
+  }
+}
+
+Xinha.Config.prototype.ListType =
+{
+  'mode': 'toolbar' // configuration mode : toolbar or panel
+};
+
+ListType._pluginInfo =
+{
+  name          : "ListType",
+  version       : "2.1",
+  developer     : "Laurent Vilday",
+  developer_url : "http://www.mokhet.com/",
+  c_owner       : "Xinha community",
+  sponsor       : "",
+  sponsor_url   : "",
+  license       : "Creative Commons Attribution-ShareAlike License"
+};
+
+ListType.prototype.onSelect = function( editor, combo )
+{
+  var tbobj = editor._toolbarObjects[ combo.id ].element;
+  var parent = editor.getParentElement();
+  while (!/^ol$/i.test( parent.tagName ))
+    parent = parent.parentNode;
+  parent.style.listStyleType = tbobj.value;
+};
+
+ListType.prototype.updateValue = function( editor, combo )
+{
+  var tbobj = editor._toolbarObjects[ combo.id ].element;
+  var parent = editor.getParentElement();
+  while ( parent && !/^ol$/i.test( parent.tagName ) )
+    parent = parent.parentNode;
+  if (!parent)
+  {
+    tbobj.selectedIndex = 0;
+    return;
+  }
+  var type = parent.style.listStyleType;
+  if (!type)
+  {
+    tbobj.selectedIndex = 0;
+  }
+  else
+  {
+    for ( var i = tbobj.firstChild; i; i = i.nextSibling )
+    {
+      i.selected = (type.indexOf(i.value) != -1);
+    }
+  }
+};
+
+ListType.prototype.onUpdateToolbar = function()
+{
+  if ( this.editor.config.ListType.mode == 'toolbar' ) return ;
+  var parent = this.editor.getParentElement();
+  while ( parent && !/^[o|u]l$/i.test( parent.tagName ) )
+    parent = parent.parentNode;
+  if (parent && /^[o|u]l$/i.test( parent.tagName ) )
+  {
+    this.showPanel( parent );
+  }
+  else if (this.editor._ListType.style.display != 'none')
+  {
+    this.editor.hidePanel( this.editor._ListType );
+  }
+};
+
+ListType.prototype.createImage = function( listStyleType )
+{
+  var self = this;
+  var editor = this.editor;
+  var a = document.createElement( 'a' );
+  a.href = 'javascript:void(0)';
+  Xinha._addClass( a, listStyleType );
+  Xinha._addEvent( a, "click", function ()
+    {
+      var parent = editor._ListType.currentListTypeParent;
+      parent.style.listStyleType = listStyleType;
+      self.showActive( parent );
+      return false;
+    }
+  );
+  return a;
+};
+
+ListType.prototype.showActive = function( parent )
+{
+  var activeDiv = ( parent.tagName.toLowerCase() == 'ul' ) ? this.divUL : this.divOL;
+  this.divUL.style.display = 'none';
+  this.divOL.style.display = 'none';
+  activeDiv.style.display = 'block';
+  var defaultType = parent.style.listStyleType;
+  if ( '' == defaultType ) defaultType = ( parent.tagName.toLowerCase() == 'ul' )? 'disc':'decimal';
+  for ( var i=0; i<activeDiv.childNodes.length; i++ )
+  {
+    var elt = activeDiv.childNodes[i];
+    if ( Xinha._hasClass( elt, defaultType ) )
+    {
+      Xinha._addClass( elt, 'active' );
+    }
+    else
+    {
+      Xinha._removeClass( elt, 'active' );
+    }
+  }
+};
+
+ListType.prototype.showPanel = function( parent )
+{
+  this.editor._ListType.currentListTypeParent = parent;
+  this.showActive(parent);
+  this.editor.showPanel( this.editor._ListType );
+};
Index: /branches/new-dialogs-merge/plugins/CharCounter/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharCounter/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/CharCounter/lang/pt_br.js (revision 901)
@@ -0,0 +1,21 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "... in progress": "... em processo",
+  "Chars": "Caracteres",
+  "HTML": "HTML",
+  "Words": "Palavras"
+}
Index: /branches/new-dialogs-merge/plugins/CharCounter/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharCounter/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/CharCounter/lang/fr.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Chars": "CaractÃšres",
+  "Words": "Mots"
+};
Index: /branches/new-dialogs-merge/plugins/CharCounter/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharCounter/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/CharCounter/lang/de.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "Chars": "Zeichen",
+  "Words": "Worte",
+  "... in progress": "... in Bearbeitung"
+};
Index: /branches/new-dialogs-merge/plugins/CharCounter/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharCounter/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/CharCounter/lang/nl.js (revision 872)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Chars": "Tekens",
+  "Words": "Woorden",
+  "... in progress": "... wordt verwerkt"
+};
Index: /branches/new-dialogs-merge/plugins/CharCounter/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharCounter/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/CharCounter/lang/ja.js (revision 715)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Chars": "æå­æ°",
+  "Words": "åèªæ°",
+  "... in progress": "... åŠçäž­"
+};
Index: /branches/new-dialogs-merge/plugins/CharCounter/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharCounter/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/CharCounter/lang/nb.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Chars": "Tegn"
+};
Index: /branches/new-dialogs-merge/plugins/CharCounter/char-counter.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharCounter/char-counter.js (revision 847)
+++ /branches/new-dialogs-merge/plugins/CharCounter/char-counter.js (revision 847)
@@ -0,0 +1,136 @@
+// Charcounter for Xinha
+// (c) Udo Schmal & L.N.Schaffrath NeueMedien
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function CharCounter(editor) {
+  this.editor = editor;
+  this._Chars = 0;
+  this._Words = 0;
+  this._HTML = 0;
+  this.onKeyPress = this.__onKeyPress;
+}
+
+Xinha.Config.prototype.CharCounter =
+{
+  'showChar': true, // show the characters count,
+  'showWord': true, // show the words count,
+  'showHtml': true, // show the exact html count
+  'separator': ' | ', // separator used to join informations
+  'maxHTML' : -1 // -1 for unlimited length, other number for limiting the length of the edited HTML
+};
+
+CharCounter._pluginInfo = {
+  name          : "CharCounter",
+  version       : "1.31",
+  developer     : "Udo Schmal",
+  developer_url : "http://www.schaffrath-neuemedien.de",
+  sponsor       : "L.N.Schaffrath NeueMedien",
+  sponsor_url   : "http://www.schaffrath-neuemedien.de",
+  c_owner       : "Udo Schmal & L.N.Schaffrath NeueMedien",
+  license       : "htmlArea"
+};
+
+CharCounter.prototype._lc = function(string) {
+  return Xinha._lc(string, "CharCounter");
+};
+
+
+CharCounter.prototype.onGenerateOnce = function() {
+  var self = this;
+  if (this.charCount==null) {
+    var charCount = document.createElement("span");
+    charCount.style.padding = "2px 5px";
+    if(Xinha.is_ie) {
+      charCount.style.styleFloat = "right";
+    } else {
+      charCount.style.cssFloat = "right";
+    }
+    var brk = document.createElement('div');
+    brk.style.height =
+    brk.style.width =
+    brk.style.lineHeight =
+    brk.style.fontSize = '1px';
+    brk.style.clear = 'both';
+    if(Xinha.is_ie) {
+      this.editor._statusBarTree.style.styleFloat = "left";
+    } else {
+      this.editor._statusBarTree.style.cssFloat = "left";
+    }
+    this.editor._statusBar.appendChild(charCount);
+    this.editor._statusBar.appendChild(brk);
+    this.charCount = charCount;
+  }
+};
+
+CharCounter.prototype.__onKeyPress= function(ev) {
+  if ((ev.keyCode != 8) && (ev.keyCode !=46)) { // not backspace & delete
+    if (this.editor.config.CharCounter.maxHTML!=-1) {
+      var contents = this.editor.getHTML();
+      if (contents.length >= this.editor.config.CharCounter.maxHTML) {
+        Xinha._stopEvent(ev);
+        return true;
+      }
+    }
+  }
+}
+
+CharCounter.prototype._updateCharCount= function() {
+  var editor = this.editor;
+  var cfg = editor.config;
+  var contents = editor.getHTML();
+  var string = new Array();
+  if (cfg.CharCounter.showHtml) {
+    string[string.length] = this._lc("HTML") + ": " + contents.length;
+  }
+  this._HTML = contents.length;
+  if (cfg.CharCounter.showWord || cfg.CharCounter.showChar) {
+    contents = contents.replace(/<\/?\s*!--[^-->]*-->/gi, "" );
+    contents = contents.replace(/<(.+?)>/g, '');//Don't count HTML tags
+    contents = contents.replace(/&nbsp;/gi, ' ');
+    contents = contents.replace(/([\n\r\t])/g, ' ');//convert newlines and tabs into space
+    contents = contents.replace(/(  +)/g, ' ');//count spaces only once
+    contents = contents.replace(/&(.*);/g, ' ');//Count htmlentities as one keystroke
+    contents = contents.replace(/^\s*|\s*$/g, '');//trim
+  }
+  if (cfg.CharCounter.showWord) {
+    this._Words = 0;
+    for (var x=0;x<contents.length;x++)
+    {
+      if (contents.charAt(x) == " " ) {this._Words++;}
+    }
+    if (this._Words >=1) { this._Words++; }
+    string[string.length] = this._lc("Words") + ": " + this._Words ;
+  }
+  if (cfg.CharCounter.showChar) {
+    string[string.length] = this._lc("Chars") + ": " + contents.length;
+    this._Chars = contents.length;
+  }
+  this.charCount.innerHTML = string.join(cfg.CharCounter.separator);
+};
+
+CharCounter.prototype.onUpdateToolbar = function() {
+  this.charCount.innerHTML = this._lc("... in progress");
+  if(this._timeoutID) {
+    window.clearTimeout(this._timeoutID);
+  }
+  var e = this;
+  this._timeoutID = window.setTimeout(function() {e._updateCharCount();}, 1000);
+};
+
+CharCounter.prototype.onMode = function (mode)
+{
+  //Hide Chars in statusbar when switching into textmode
+  switch (mode)
+  {
+    case "textmode":
+      this.charCount.style.display = "none";
+      break;
+    case "wysiwyg":
+      this.charCount.style.display = "";
+      break;
+    default:
+      alert("Mode <" + mode + "> not defined!");
+      return false;
+  }
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/pt_br.js (revision 901)
@@ -0,0 +1,108 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "A:": "A:",
+  "Absbottom": "Inferior absoluto",
+  "Absmiddle": "Meio absoluto",
+  "Angle:": "Ângulo:",
+  "Baseline": "Linha de base",
+  "Bottom": "Base",
+  "Cancel": "Cancelar",
+  "Clear": "Limpar",
+  "Constrain Proportions": "Manter proporções",
+  "Crop": "Recortar",
+  "D:": "G:",
+  "Directory": "Diretório",
+  "Directory Up": "Diretório Acima",
+  "Edit": "Editar",
+  "Filename:": "Nome do arquivo:",
+  "Flip Horizontal": "Espelhar Horizontalmente",
+  "Flip Image": "Espelhar Imagem",
+  "Flip Vertical": "Espelhar Verticalmente",
+  "Folder Name:": "Nome da Pasta:",
+  "GIF": "GIF",
+  "GIF format is not supported, image editing not supported.": "Formato GIF não é suportado, edição de imagem não é suportada.",
+  "H:": "A:",
+  "Height:": "Altura:",
+  "Image Editor": "Editor de Imagem",
+  "Image Format": "Formato da Imagem",
+  "Image List": "Lista de Imagens",
+  "Image Manager": "Gerenciador de Imagens",
+  "Image Selection": "Seleção de Imagem",
+  "Insert Image": "Inserir Imagem",
+  "Invalid base directory:": "Diretório base inválido:",
+  "JPEG High": "JPEG Alto",
+  "JPEG Low": "JPEG Baixo",
+  "JPEG Medium": "JPEG Médio",
+  "Left": "Esquerda",
+  "Lock": "Travar",
+  "Marker": "Marcar",
+  "Measure": "Medida",
+  "Middle": "Meio",
+  "New Folder": "Nova Pasta",
+  "No Image Available": "Sem Imagem Disponível",
+  "No Images Found": "Nenhuma Imagem Encontrada",
+  "Not set": "Não definido",
+  "OK": "OK",
+  "PNG": "PNG",
+  "Positioning of this image": "Posicionamento desta imagem",
+  "Quality:": "Qualidade:",
+  "Refresh": "Atualização",
+  "Resize": "Redimencionar",
+  "Right": "Direita",
+  "Rotate": "Rotacionar",
+  "Rotate 180 &deg;": "Rotacionar 180 &deg;",
+  "Rotate 90 &deg; CCW": "Rotacionar 90 &deg; anti-horário",
+  "Rotate 90 &deg; CW": "Rotacionar 90 &deg; horário",
+  "Rotate Image": "Rotacionar Imagem",
+  "Save": "Gravar",
+  "Start X:": "Início X:",
+  "Start Y:": "Início Y:",
+  "Texttop": "Texto no topo",
+  "Top": "Topo",
+  "Trash": "Lixo",
+  "W:": "C:",
+  "Width:": "Largura:",
+  "X:": "X:",
+  "Y:": "Y:",
+  
+  // not find with lc_parse_strings.php  
+  "Image File": "Arquivo Imagem", 
+  "Upload": "Enviar",
+  "Upload:": "Enviar imagem:",
+  "Width": "Largura",
+  "Height": "Altura",  
+  "Border": "Borda",
+  "V Space": "Espaço vert.",
+  "H Space": "Espaço horiz.",
+  "Uploading...": "Enviando...",
+  "File saved.": "Arquivo gravado.",
+  "File was not saved.": "Arquivo não foi salvo.",
+  "Loading": "Lendo",
+	"Delete file?": "Apagar arquivo?",
+  "Please delete all files/folders inside the folder you wish to delete first.": "Por favor, primeiro apague todos os arquivos/pastas dentro da pasta que deseja apagar.",
+  "Delete folder?": "Apagar pasta?",
+  "Folder Name:": "Nome da Pasta:",
+  "No Files Found": "Nenhum arquivo encontrado",
+  "Invalid folder name, please choose another folder name.": "Nome inválido para pasta, escolha outro nome.",
+  "No Image selected.": "Nenhuma imagem selecionada.",
+  "Description:": "Descrição:",
+  "Align:": "Alinhamento:",
+  "Margin:": "Margem:",
+  "Padding:": "Espaçamento:",
+  "Border:": "Borda:",
+  "Color:": "Côr:"
+}
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/ru.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/ru.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/ru.js (revision 901)
@@ -0,0 +1,67 @@
+﻿// I18N constants
+// LANG: "ru", ENCODING: UTF-8
+// Author: Andrei Blagorazumov, a@fnr.ru
+{
+  "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:": "Ш:",
+  "Clear": "Очистить",
+  "Loading": "Загрузка",
+  "Invalid base directory:": "Неверная базовая папка:",
+  "Delete file?": "Удалить файл?",
+  "Please delete all files/folders inside the folder you wish to delete first.": "Пожалуйста удалите все файлы/папки в папке, которую вы хотите удалить.",
+  "Delete folder?": "Удалить папку?",
+  "Folder Name:": "Название папки:",
+  "No Images Found": "Картинок не найдено",
+  "Invalid folder name, please choose another folder name.": "Неправильное имя папки, пожалуйста выберите другое.",
+  "GIF format is not supported, image editing not supported.": "Формат GIF не поддерживается, редактирование картинки не поддерживается.",
+  "No Image Available": "Нет доступных картинок",
+  "No Image selected.": "Картинки не выбраны.",
+  "Color:": "Цвет",
+  "Align:": "Выравнивание",
+  "Margin:": "Отступ",
+  "Padding:": "Поля",
+  "Border:": "Рамка"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/es.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/es.js (revision 943)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/es.js (revision 943)
@@ -0,0 +1,70 @@
+// I18N constants
+// LANG: "es", ENCODING: UTF-8
+// translated: michael Hauptmnn (mhauptma73) , http://www.azahost.com/, miguel@azalorea.com
+{
+  "Image Manager": "Editor de imÃ¡genes",
+  "Insert Image": "insertar imagen",
+  "Directory": "Directorio",
+  "Directory Up": "Directorio superior",
+  "New Folder": "Crear directorio",
+  "Trash": "Basura",
+  "Edit": "editar",
+  "Image File": "Fichero",
+  "Upload": "Subir",
+  "Width": "Ancho",
+  "Height": "Alto",
+  "Width:": "Ancho:",
+  "Height:": "Alto:",
+  "Constrain Proportions": "Proporcional",
+  "Border": "Borde",
+  "V Space": "espacio vertical",
+  "H Space": "espacio horizontal",
+  "Refresh": "Actualizar",
+  "Uploading...": "Subir...",
+  "Crop": "Recortar",
+  "Resize": "Cambiar tamaÃ±o",
+  "Rotate": "Girar",
+  "Measure": "Dimensiones",
+  "Marker": "Marcador",
+  "Save": "Guardar",
+  "Filename:": "Nombre del fichero:",
+  "Image Format": "Formato:",
+  "Quality:": "Calidad",
+  "JPEG High": "JPEG alto",
+  "JPEG Medium": "JPEG medio",
+  "JPEG Low": "JPEG bajo",
+  "File saved.": "Fichero guardado.",
+  "File was not saved.": "el fichero no ha sido guardado.",
+  "Start X:": "Inicio X",
+  "Start Y:": "Inicio Y",
+  "Lock": "Bloquear",
+  "Flip Image": "invertir imagen",
+  "Flip Horizontal": "invertir horizontalmente",
+  "Flip Vertical": "invertir verticalmente",
+  "Rotate Image": "Girar imagen",
+  "Rotate 180 Â°": "Girar 180Âº",
+  "Rotate 90 Â° CW": "Girar 90Âº sentido reloj",
+  "Rotate 90 Â° CCW": "Girar 90Âº sentido contrareloj",
+  "Angle:": "Ãngulo:",
+  "W:": "B:",
+  "Clear": "Eliminar",
+  "Loading": "Cargar",
+  "Invalid base directory:": "Directorio de inicio invÃ¡lido:",
+  "Delete file?": "Â¿Borrar fichero?",
+  "Please delete all files/folders inside the folder you wish to delete first.": "Primero tiene que borrar todoas los ficheros de este directorio.",
+  "Delete folder?": "Â¿Borrar directorio?",
+  "Folder Name:": "Nombre del directorio:",
+  "No Images Found": "No se ha encontrado imagen",
+  "Invalid folder name, please choose another folder name.": "Nombre de directorio invÃ¡lido... por favor elija otro nombre.",
+  "GIF format is not supported, image editing not supported.": "No hay soporte para imÃ¡genes en formato GIF.",
+  "No Image Available": "No hay imagen",
+  "No Image selected.": "No ha seleccionado imagen.",
+  "Description:": "DescripciÃ³n:",
+  "Align:": "Alineado:",
+  "Description:": "DescripciÃ³n:",
+  "Margin:": "Margen exterior:",
+  "Padding:": "Margen interior:",
+  "Border:": "Borde:",
+  "Color:": "Color:",
+  "Upload:": "Subir:"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/fr.js (revision 677)
@@ -0,0 +1,66 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "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:",
+  "Clear": "Effacer",
+  "Loading": "Chargement en cours",
+  "Invalid base directory:": "RÃ©pertoire de base invalide:",
+  "Delete file?": "Suppression du fichier ?",
+  "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",
+  "Delete folder?": "Suppression du rÃ©pertoire ?",
+  "Folder Name:": "Nom du rÃ©pertoire",
+  "No Images Found": "Aucune image trouvÃ©e",
+  "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",
+  "No Image Available": "Aucune image disponible",
+  "No Image selected.": "Aucune image sÃ©lectionnÃ©e.",
+  "Color:": "Couleur",
+  "Align:": "Alignement",
+  "Margin:": "Marge",
+  "Padding:": "Espacement",
+  "Border:": "Bordure"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/de.js (revision 677)
@@ -0,0 +1,65 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "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",
+  "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:",
+  "Clear": "Entfernen",
+  "Loading": "Laden",
+  "Invalid base directory:": "UngÃŒltiges Startverzeichnis:",
+  "Delete file?": "Datei lÃ¶schen?",
+  "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.",
+  "Delete folder?": "Ordner lÃ¶schen?",
+  "Folder Name:": "Ordnername:",
+  "No Images Found": "Kein Bild gefunden",
+  "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.",
+  "No Image Available": "Kein Bild verfÃŒgbar",
+  "No Image selected.": "Kein Bild ausgewÃ€hlt.",
+  "Description:": "Beschreibung:",
+  "Align:": "Ausrichtung:",
+  "Margin:": "AuÃenabstand:",
+  "Padding:": "Innenabstand:",
+  "Color:": "Farbe:"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/sv.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/sv.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/sv.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "sv" (Swedish), ENCODING: UTF-8
+// translated: Erik DalÃ©n, <dalen@jpl.se>
+{
+  "Image Manager": "Bildbehandlare",
+  "Crop": "BeskjÃ€r"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/nl.js (revision 872)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Image Manager": "Afbeeldingen Beheer",
+  "Crop": "Passend maken"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/ja.js (revision 1000)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/ja.js (revision 1000)
@@ -0,0 +1,75 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Image Manager": "ç»åãããŒãžã£",
+  "Insert Image": "ç»åã®æ¿å
+¥",
+  "Directory": "ãã£ã¬ã¯ããª",
+  "Directory Up": "èŠªãã£ã¬ã¯ããªãž",
+  "New Folder": "æ°èŠãã©ã«ã",
+  "Trash": "åé€",
+  "Edit": "ç·šé",
+  "Image File": "ç»åãã¡ã€ã«",
+  "Upload": "ã¢ããã­ãŒã",
+  "Width": "å¹
+",
+  "Height": "é«ã",
+  "Width:": "å¹
+:",
+  "Height:": "é«ã:",
+  "Constrain Proportions": "çžŠæšªæ¯ãåºå®",
+  "Border": "ããŒããŒ",
+  "V Space": "åçŽäœçœ",
+  "H Space": "æ°Žå¹³äœçœ",
+  "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:": "W:",
+  "Clear": "ã¯ãªã¢",
+  "Loading": "ã­ãŒãäž­",
+  "Invalid base directory:": "ç¡å¹ãªãã£ã¬ã¯ããª:",
+  'Delete file "$file"?': 'ãã¡ã€ã« "$file" ãåé€ããŸãã?',
+  "Please delete all files/folders inside the folder you wish to delete first.": "åé€ããããã©ã«ãå
+ã®ãã¡ã€ã«ãšãã©ã«ããå
+šãŠåé€ããŠãããŠãã ããã",
+  'Delete folder "$dir"?': 'ãã©ã«ã "$dir" ãåé€ããŸãã?',
+  "Folder Name:": "ãã©ã«ãå:",
+  "No Files Found": "ãã¡ã€ã«ããããŸãã",
+  "Invalid folder name, please choose another folder name.": "ç¡å¹ãªãã©ã«ãåã§ããå¥ã®ãã©ã«ãåãéžãã§ãã ããã",
+  "GIF format is not supported, image editing not supported.": "GIFåœ¢åŒã¯ãµããŒããããŠããªããããç»åç·šéã§ããŸããã",
+  "No Image Available": "ç»åããããŸãã",
+  "No Image selected.": "ç»åãéžæãããŠããŸããã",
+  "Color:": "è²:",
+  "Align:": "è¡æã",
+  "Margin:": "éé:",
+  "Padding:": "äœçœ:",
+  "Border:": "å¢çç·:",
+  
+  "Upload": "ã¢ããã­ãŒã",
+  "Upload:": "ã¢ããã­ãŒã:",
+  "Description:": "èª¬æ:"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/pl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/pl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/pl.js (revision 677)
@@ -0,0 +1,76 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl
+{
+  "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:": "L:",
+  "Clear": "WyczyÅÄ",
+  "Loading": "Åadowanie",
+  "Invalid base directory:": "NieprawidÅowy katalog bazowy:",
+  "Delete file?": "UsunÄ
+Ä plik?",
+  "Please delete all files/folders inside the folder you wish to delete first.": "Najpierw usuÅ wszystkie pliki i podkatalogi katalogu.",
+  "Delete folder?": "UsunÄ
+Ä katalog ?",
+  "Folder Name:": "Nazwa katalogu",
+  "No Images Found": "Nie znaleziono obrazkÃ³w",
+  "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.",
+  "No Image Available": "Obrazek niedostÄpny",
+  "No Image selected.": "Nie zaznaczono obrazka.",
+  "Description:": "Opis:",
+  "Align:": "WyrÃ³wnanie:",
+  "Description:": "Opis:",
+  "Margin:": "Margines:",
+  "Padding:": "WciÄcie:",
+  "Border:": "Ramka:",
+  "Color:": "Kolor:",
+  "Upload:": "Wgraj:"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/lang/nb.js (revision 677)
@@ -0,0 +1,65 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Image Manager": "Bildebehandler",
+  "Insert Image": "Sett inn bilde",
+  "Directory": "Mappe",
+  "Directory Up": "Opp en mappe",
+  "New Folder": "Ny mappe",
+  "Trash": "SÃžppelkurv",
+  "Edit": "Rediger",
+  "Image File": "Bildefil",
+  "Upload": "Last opp",
+  "Width": "Bredde",
+  "Height": "HÃžyde",
+  "Constrain Proportions": "Behold proposjoner",
+  "Border": "Ramme",
+  "V Space": "vertikal marg",
+  "H Space": "horisontal marg",
+  "Refresh": "Oppfrisk",
+  "Uploading...": "Laster opp...",
+  "Crop": "BeskjÃŠr",
+  "Resize": "Endre stÃžrrelse",
+  "Rotate": "Roter",
+  "Measure": "MÃ¥l",
+  "Marker": "Marker",
+  "Save": "Lagre",
+  "Filename:": "Filnavn:",
+  "Image Format": "Bildeformat:",
+  "Quality:": "Kvalitet",
+  "JPEG High": "JPEG hÃžy",
+  "JPEG Medium": "JPEG middelse",
+  "JPEG Low": "JPEG lav",
+  "File saved.": "Fil lagret.",
+  "File was not saved.": "Fil ble ikke lagret.",
+  "Start X:": "Start X",
+  "Start Y:": "Start Y",
+  "Lock": "Sperre",
+  "Flip Image": "Vend bilde",
+  "Flip Horizontal": "Vend horisontal",
+  "Flip Vertical": "Vend vertikal",
+  "Rotate Image": "Roter bilde",
+  "Rotate 180 Â°": "Roter 180Â°",
+  "Rotate 90 Â° CW": "Roter 90Â° med klokka",
+  "Rotate 90 Â° CCW": "Roter 90Â° mot klokka",
+  "Angle:": "Vinkel:",
+  "W:": "B:",
+  "Clear": "Fjern",
+  "Loading": "Laster",
+  "Invalid base directory:": "Feil rot-mappe:",
+  "Delete file?": "Slette fil?",
+  "Please delete all files/folders inside the folder you wish to delete first.": "Vennligst slett alle filer og mapper i mappen du Ãžnsker Ã¥ slette og prÃžv igjen.",
+  "Delete folder?": "Slett mappe?",
+  "Folder Name:": "Mappenavn:",
+  "No Images Found": "Ingen bilder funnet",
+  "Invalid folder name, please choose another folder name.": "Ugyldig mappenavn, vennligst velg et annet navn pÃ¥ mappen.",
+  "GIF format is not supported, image editing not supported.": "Bildeformatet GIF er ikke stÃžttet.",
+  "No Image Available": "Inget bilde er tilgjengelig",
+  "No Image selected.": "Inget bilde er valgt.",
+  "Description:": "Beskrivelse:",
+  "Align:": "Justering:",
+  "Margin:": "Marg:",
+  "Padding:": "Innsidemarg:",
+  "Color:": "Farge:"
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/editorFrame.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/editorFrame.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/editorFrame.php (revision 999)
@@ -0,0 +1,79 @@
+<?php 
+/**
+ * The frame that contains the image to be edited.
+ * @author $Author:ray $
+ * @version $Id:editorFrame.php 677 2007-01-19 22:24:36Z ray $
+ * @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);
+$imageInfo = $editor->processImage();
+
+?>
+
+<html>
+<head>
+	<title></title>
+<script type="text/javascript">
+_backend_url = "<?php print $IMConfig['backend_url']; ?>";
+</script>
+
+<link href="<?php print $IMConfig['base_url'];?>assets/editorFrame.css" rel="stylesheet" type="text/css" />	
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/wz_jsgraphics.js"></script>
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/EditorContent.js"></script>
+<script type="text/javascript">
+
+if(window.top)
+	HTMLArea = window.top.HTMLArea;
+
+function i18n(str) {
+    return HTMLArea._lc(str, 'ImageManager');
+}
+	
+	var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure
+
+var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
+
+<?php if ($editor->isFileSaved() == 1) { ?>
+	alert(i18n('File saved.'));
+  window.parent.opener.selectImage
+    (
+      '<?php echo $imageInfo['savedFile'] ?>',
+      '<?php echo $imageInfo['savedFile'] ?>'.replace(/^.*\/?([^\/]*)$/, '$1'),
+      <?php echo $imageInfo['width'] ?>,
+      <?php echo $imageInfo['height'] ?>
+    );
+  window.parent.opener.parent.refresh();
+  window.parent.close();
+<?php } else if ($editor->isFileSaved() == -1) { ?>
+	alert(i18n('File was not saved.'));
+<?php } ?>
+
+</script>
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editorFrame.js"></script>
+</head>
+
+<body>
+<div id="status"></div>
+<div id="ant" class="selection" style="visibility:hidden"><img src="<?php print $IMConfig['base_url'];?>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'])) { ?>
+	<span id="imgCanvas" class="crop"><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>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/ImageManager/thumbs.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/thumbs.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/thumbs.php (revision 999)
@@ -0,0 +1,90 @@
+<?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:ray $
+ * @version $Id:thumbs.php 677 2007-01-19 22:24:36Z ray $
+ * @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->getImagesDir(),$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);
+}
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/newFolder.html
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/newFolder.html (revision 799)
+++ /branches/new-dialogs-merge/plugins/ImageManager/newFolder.html (revision 799)
@@ -0,0 +1,79 @@
+<!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>
+ <script type="text/javascript" src="../../popups/popup.js"></script>
+ <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, 160);
+
+    if(window.opener)
+        HTMLArea = window.opener.HTMLArea;
+
+	init = function ()
+	{
+		__dlg_init();
+		__dlg_translate('ImageManager');
+		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>
Index: /branches/new-dialogs-merge/plugins/ImageManager/images.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/images.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/images.php (revision 999)
@@ -0,0 +1,290 @@
+<?php 
+/**
+ * Show a list of images in a long horizontal table.
+ * @author $Author:ray $
+ * @version $Id:images.php 987 2008-04-12 12:39:04Z ray $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('ddt.php');
+require_once('Classes/ImageManager.php');
+
+// uncomment for debugging
+
+// _ddtOn();
+
+//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;
+
+    switch($IMConfig['ViewMode'])
+    {
+      case 'details':
+      {
+        ?>
+        <script language="Javascript">
+          <!--
+            function showPreview(f_url)
+            {
+              
+              window.parent.document.getElementById('f_preview').src = 
+                window.parent._backend_url + '__function=thumbs&img=' + f_url;
+            }
+          //-->
+        </script>
+        <table class="listview">
+        <thead>
+        <tr><th>Name</th><th>Filesize</th><th>Dimensions</th></tr></thead>
+        <tbody>
+          <?php
+          foreach($list as $entry => $file)
+          {
+            ?>
+            <tr>
+              <th><a href="#" class="thumb" style="cursor: pointer;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" onmouseover="showPreview('<?php echo $file['relative'];?>')" onmouseout="showPreview(window.parent.document.getElementById('f_url').value)" ><?php echo $entry ?></a></th>
+              <td><?php echo Files::formatSize($file['stat']['size']); ?></td>
+              <td><?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } ?></td>
+              <td class="actions">
+                <a href="<?php print $IMConfig['backend_url']; ?>__function=images&dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" border="0"  /></a>
+        
+                <a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit" border="0" /></a>
+              </td>
+            </tr>
+            <?php        
+          }
+          ?>
+        </tbody>
+        </table>
+        <?php
+      }      
+      break;
+      
+      case 'thumbs':
+      default      :
+      {
+	foreach($list as $entry => $file)
+	{
+		?>
+    <div class="thumb_holder" id="holder_<?php echo asc2hex($entry) ?>">
+      <a href="#" class="thumb" style="cursor: pointer;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>">
+        <img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/>
+      </a>
+      <div class="edit">
+        <a href="<?php print $IMConfig['backend_url']; ?>__function=images&dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash"  /></a>
+
+        <a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="<?php print $IMConfig['base_url'];?>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;?>
+      </div>
+    </div>
+	  <?php
+        }
+      }
+    }	
+}//function drawFiles
+
+
+/**
+ * Draw the directory.
+ */
+function drawDirs($list, &$manager) 
+{
+	global $relative;
+   global $IMConfig;
+
+  switch($IMConfig['ViewMode'])
+  {
+    case 'details':
+    {
+        
+    }
+    break; 
+    
+    case 'thumbs':
+    default      :
+    {
+	foreach($list as $path => $dir) 
+	{ ?>
+    <div class="dir_holder">
+      <a class="dir" href="<?php print $IMConfig['backend_url'];?>__function=images&dir=<?php echo rawurlencode($path); ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="<?php print $IMConfig['base_url'];?>img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a>
+
+      <div class="edit">
+        <a href="<?php print $IMConfig['backend_url'];?>__function=images&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="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+        <?php echo $dir['entry']; ?>
+      </div>
+    </div>
+	  <?php 
+	} //foreach
+    }
+  }
+  
+	
+}//function drawDirs
+
+
+/**
+ * No directories and no files.
+ */
+function drawNoResults() 
+{
+?>
+<div class="noResult">No Images Found</div>
+<?php 
+}
+
+/**
+ * No directories and no files.
+ */
+function drawErrorBase(&$manager) 
+{
+?>
+<div class="error"><span>Invalid base directory:</span> <?php echo $manager->config['images_dir']; ?></div>
+<?php 
+}
+
+/**
+ * Utility to convert ascii string to hex
+ */
+function asc2hex ($temp)
+{
+  $len = strlen($temp);
+  $data = "";
+  for ($i=0; $i<$len; $i++) $data.=sprintf("%02x",ord(substr($temp,$i,1)));
+  return $data;
+}
+
+?>
+<!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="<?php print $IMConfig['base_url'];?>assets/imagelist.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript">
+_backend_url = "<?php print $IMConfig['backend_url']; ?>";
+</script>
+
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+
+	if(window.top)
+    HTMLArea = Xinha    = window.top.Xinha;
+
+	function hideMessage()
+	{
+		var topDoc = window.top.document;
+		var messages = topDoc.getElementById('messages');
+		if(messages)
+			messages.style.display = "none";
+	}
+
+	init = function()
+	{
+	  __dlg_translate('ImageManager');
+		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 } ?>
+    update_selected();
+	}	
+
+	function editImage(image) 
+	{
+		var url = "<?php print $IMConfig['backend_url']; ?>__function=editor&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="<?php print $IMConfig['base_url'];?>assets/images.js"></script>
+<script type="text/javascript" src="../../popups/popup.js"></script>
+<script type="text/javascript" src="assets/popup.js"></script>
+</head>
+
+<body>
+<?php if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
+	elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>
+
+	<?php drawDirs($list[0], $manager); ?>
+	<?php drawFiles($list[1], $manager); ?>
+
+<?php } else { drawNoResults(); } ?>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/ImageManager/Classes/ImageEditor.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/Classes/ImageEditor.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/Classes/ImageEditor.php (revision 999)
@@ -0,0 +1,495 @@
+<?php
+/**
+ * Image Editor. Editing tools, crop, rotate, scale and save.
+ * @author $Author:ray $
+ * @version $Id:ImageEditor.php 938 2008-01-22 20:13:47Z ray $
+ * @package ImageManager
+ */
+
+require_once('../ImageManager/Classes/Transform.php');
+
+/**
+ * Handles the basic image editing capbabilities.
+ * @author $Author:ray $
+ * @version $Id:ImageEditor.php 938 2008-01-22 20:13:47Z ray $
+ * @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() 
+	{
+		if(isset($_GET['img']))
+			$relative = rawurldecode($_GET['img']);
+		else
+			Return array();
+		
+		//$relative = '/Series2004NoteFront.jpg';
+
+		$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['file'] = $relative;
+			$image['fullpath'] = $fullpath;
+			$image['filesize'] = @filesize($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);
+		$saveFile = $this->getSaveFileName($values[0]);
+
+		$img = Image_Transform::factory(IMAGE_CLASS);
+		$img->load($fullpath);
+		
+		if ( is_callable( array($img,'paletteToTrueColorWithTransparency')) && !imageistruecolor($img->imageHandle))
+		{
+			$img->paletteToTrueColorWithTransparency();
+		}
+		switch ($action) 
+		{
+			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);
+					$newSaveFile = $this->getUniqueFilename($newSaveFile);
+					
+					//get unique filename just returns the filename, so
+					//we need to make the relative path once more.
+					$newSaveFile = $this->makeRelative($relative, $newSaveFile);
+          			$image['saveFile'] = $newSaveFile;
+					$newSaveFullpath = $this->manager->getFullPath($newSaveFile);
+					if ( $values[0] == 'gif' && is_callable(array($img, 'preserveTransparencyForPalette')))
+					{
+						$img->preserveTransparencyForPalette();
+					}
+					$img->save($newSaveFullpath, $values[0], $quality);
+					if(is_file($newSaveFullpath))
+						$this->filesaved = 1;
+					else
+						$this->filesaved = -1;
+				}
+				break;
+				case 'preview':
+					$quality = intval($values[1]);
+					
+					
+					$image['file'] = $relative;
+					$image['fullpath'] = $fullpath;
+					
+					//create the tmp image file
+					$filename = $this->createUnique($fullpath);
+					$newRelative = $this->makeRelative($relative, $filename);
+					$newFullpath = $this->manager->getFullPath($newRelative);
+					$newURL = $this->manager->getFileURL($newRelative);
+					
+					
+					if ( $values[0] == 'gif' && is_callable(array($img, 'preserveTransparencyForPalette')))
+					{
+						$img->preserveTransparencyForPalette();
+					}
+					$img->save($newFullpath, $values[0] );
+					$img->free();
+			
+					//get the image information
+					$imgInfo = @getimagesize($newFullpath);
+				
+					$image['src'] = $newURL;
+			    	$image['width'] = $imgInfo[0];
+			   		$image['height'] = $imgInfo[1];
+					$image['dimensions'] = $imgInfo[3];
+					$image['file'] = $relative;
+					$image['fullpath'] = $fullpath;
+					$image['filesize'] = @filesize($newFullpath);
+
+					Return $image;
+	
+				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);
+
+		//save the file.
+		$img->save($newFullpath, 'png' );
+		$img->free();
+
+		//get the image information
+		$imgInfo = @getimagesize($newFullpath);
+
+		$image['src'] = $newURL;
+    	$image['width'] = $imgInfo[0];
+   		$image['height'] = $imgInfo[1];
+		$image['dimensions'] = $imgInfo[3];
+		$image['file'] = $newRelative;
+		$image['fullpath'] = $newFullpath;
+		$image['filesize'] = @filesize($newFullpath);
+		$image['type'] = image_type_to_mime_type($imgInfo[2]);
+		
+		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;
+	}
+}
+
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/Classes/GD.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/Classes/GD.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/Classes/GD.php (revision 999)
@@ -0,0 +1,597 @@
+<?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 938 2008-01-22 20:13:47Z ray $
+//
+// Image Transformation interface using the GD library
+//
+
+require_once "../ImageManager/Classes/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);
+			if ( $this->type == 'png')
+			{
+				imageAlphaBlending($this->imageHandle, false);
+				imageSaveAlpha($this->imageHandle, true);
+			}
+		}
+    } // 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')) {
+            $white = imagecolorallocatealpha ($this->imageHandle, 255, 255, 255, 127);
+			$this->imageHandle = imagerotate($this->imageHandle, $angle, $white);
+            return true;
+        }
+
+        if ( $options==null ){
+            $autoresize = true;
+            $color_mask = array(105,255,255);
+        } 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;
+        }
+
+        $img2   = @$this->newImgPreserveAlpha( imagecreateTrueColor($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 = imagecolorallocatealpha ($img2,$color_mask[0],$color_mask[1],$color_mask[2],127);
+        // 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 int  $new_x new width
+    * @param int  $new_y 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 = $this->newImgPreserveAlpha( 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 =  $this->newImgPreserveAlpha(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);
+    }
+	function paletteToTrueColorWithTransparency()
+	{
+		$oldImg = $this->imageHandle;
+		$newImg = $this->newImgPreserveAlpha( imagecreatetruecolor($this->img_x,$this->img_y) );
+		imagecopy($newImg,$oldImg,0,0,0,0,$this->img_x,$this->img_y);
+
+		$this->imageHandle = $newImg;
+	}
+	
+	function newImgPreserveAlpha($newImg)
+	{
+		if ( $this->type == 'jpeg') return $newImg;
+		
+		// Turn off transparency blending (temporarily)
+		imagealphablending($newImg, false);
+		
+		// Create a new transparent color for image
+		if ( $transparent = imagecolortransparent($this->imageHandle) >= 0 )
+		{
+			if (imageistruecolor($this->imageHandle))
+			{
+				$red = ($transparent & 0xFF0000) >> 16;
+				$green = ($transparent & 0x00FF00) >> 8;
+				$blue = ($transparent & 0x0000FF);
+				$color_values = array('red' => $red, 'green' => $green, 'blue' => $blue);
+			}
+			else
+			{
+				$color_values = imagecolorsforindex($this->imageHandle,$transparent);
+
+			}
+			$color_values = imagecolorsforindex($this->imageHandle,$transparent);
+			$color = imagecolorallocatealpha($newImg, $color_values['red'],$color_values['green'],$color_values['blue'], 127);
+			$colort = imagecolorallocate($newImg, $color_values['red'],$color_values['green'],$color_values['blue']);
+		}
+		else
+		{
+			$color = imagecolorallocatealpha($newImg, 252, 2, 252, 127);
+			$colort = imagecolorallocate($newImg, 252, 2, 252);
+		}
+		imagecolortransparent($newImg,$colort);
+		
+		// Completely fill the background of the new image with allocated color.
+		imagefill($newImg, 0, 0, $color);
+		
+		// Restore transparency blending
+		imagesavealpha($newImg, true);
+		
+		return $newImg;
+	}
+	
+	function preserveTransparencyForPalette()
+	{
+		$new_img = imagecreatetruecolor($this->img_x,$this->img_y);
+		$truecolor = imageistruecolor($this->imageHandle);
+		$transparent = imagecolorallocate($new_img, 252,2,252); // nasty pinkish purple that hopefully doesn't exist in the image
+
+		imagecolortransparent($new_img, $transparent);
+		for ($i=0;$i<$this->img_y;$i++)
+		{
+			for ($j=0;$j<$this->img_x;$j++)
+			{
+				$c = imagecolorat($this->imageHandle,$j, $i);
+				if ($truecolor)
+				{
+					$a = ($c >> 24) & 0xFF;
+					$r = ($c >> 16) & 0xFF;
+					$g = ($c >> 8) & 0xFF;
+					$b = $c & 0xFF;
+					$color_values = array('red' => $r, 'green' => $g, 'blue' => $b, 'alpha' => $a);
+				}
+				else
+				{
+					$color_values = imagecolorsforindex($this->imageHandle,$c);
+				}
+				if ($color_values['alpha'] >= 126)
+				{
+					imagesetpixel($new_img, $j, $i, $transparent);
+				}
+				else
+				{
+					imagesetpixel($new_img, $j, $i, $c);
+				}
+			}
+		}
+		$this->imageHandle = $new_img;
+	}
+
+    /**
+     * Save the image file
+     *
+     * @param string  $filename the name of the file to write to
+     * @param int     $quality  output DPI, default is 85
+     * @param string  $types    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
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/Classes/Transform.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/Classes/Transform.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/Classes/Transform.php (revision 999)
@@ -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 709 2007-01-30 23:22:04Z ray $
+//
+// 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 "../ImageManager/Classes/$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);
+    }
+}
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/Classes/ImageManager.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/Classes/ImageManager.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/Classes/ImageManager.php (revision 999)
@@ -0,0 +1,664 @@
+<?php
+/**
+ * ImageManager, list images, directories, and thumbnails.
+ * @author $Author:ray $
+ * @version $Id:ImageManager.php 709 2007-01-30 23:22:04Z ray $
+ * @package ImageManager
+ */
+
+require_once('../ImageManager/Classes/Files.php');
+
+// uncomment to turn on debugging
+
+// _ddtOn();
+
+/**
+ * ImageManager Class.
+ * @author $Author:ray $
+ * @version $Id:ImageManager.php 709 2007-01-30 23:22:04Z ray $
+ */
+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 images base directory.
+	 * @return string base dir, see config.inc.php
+	 */
+	function getImagesDir() 
+	{
+		Return $this->config['images_dir'];
+	}
+
+	/**
+	 * Get the images base URL.
+	 * @return string base url, see config.inc.php
+	 */
+	function getImagesURL() 
+	{
+		Return $this->config['images_url'];
+	}
+
+	function isValidBase()
+	{
+		return is_dir($this->getImagesDir());
+	}
+
+	/**
+	 * 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->getImagesDir(),'/');
+			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->getImagesDir());
+		$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( strlen(trim($this->config['thumbnail_dir'])) == 0 || $this->config['safe_mode'] == true)
+		{
+			Return Files::makeFile($path_parts['dirname'],$thumbnail);
+		}
+		else
+		{
+				$path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
+				if(!is_dir($path))
+					Files::createFolder($path);
+				Return Files::makeFile($path,$thumbnail);
+		}
+	}
+	
+	/**
+	 * 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) 
+	{
+
+		_ddt( __FILE__, __LINE__, "getThumbURL(): relative is '$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->getImagesURL(),$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->getImagesURL(), $path);
+
+				_ddt( __FILE__, __LINE__, "getThumbURL(): url_path is '$url_path'" );
+
+				Return Files::makeFile($url_path,$thumbnail);
+			}
+			else //should this ever happen?
+			{
+				//error_log('ImageManager: Error in creating thumbnail url');
+			}
+
+		}
+	}
+
+
+	/**
+	 * For a given image file, get the respective resized filename
+	 * no file existence check is done.
+	 * @param string $fullpathfile the full path to the image file
+	 * @param integer $width the intended width
+	 * @param integer $height the intended height
+	 * @param boolean $mkDir whether to attempt to make the resized_dir if it doesn't exist
+	 * @return string of the resized filename
+	 */
+	function getResizedName($fullpathfile, $width, $height, $mkDir = TRUE)
+	{
+		$path_parts = pathinfo($fullpathfile);
+
+		$thumbnail = $this->config['resized_prefix']."_{$width}x{$height}_{$path_parts['basename']}";
+
+		if( strlen(trim($this->config['resized_dir'])) == 0 || $this->config['safe_mode'] == true )
+		{
+			Return Files::makeFile($path_parts['dirname'],$thumbnail);
+		}
+		else
+		{
+			$path = Files::makePath($path_parts['dirname'],$this->config['resized_dir']);
+			if($mkDir && !is_dir($path))
+				Files::createFolder($path);
+			Return Files::makeFile($path,$thumbnail);
+		}
+	}
+
+	/**
+	 * 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 == '/')
+			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))
+		{
+			$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->getImagesDir(),$relative);
+		$result = Files::copyFile($file['tmp_name'], $path, $file['name']);
+
+		//no copy error
+		if(!is_int($result))
+		{
+			Files::delFile($file['tmp_name']);
+			Return true;
+		}
+
+		//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->getImagesURL(),$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->getImagesDir(),$relative);;
+	}
+
+	/**
+	 * Get the default thumbnail.
+	 * @return string default thumbnail, empty string if 
+	 * the thumbnail doesn't exist.
+	 */
+	function getDefaultThumb() 
+	{
+
+		// FIXME: hack
+
+		Return $this->config['default_thumbnail'];
+
+		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) 
+	{
+
+		global $IMConfig;
+
+		_ddt( __FILE__, __LINE__, "getThumbnail(): top with '$relative'" );
+
+		$fullpath = Files::makeFile($this->getImagesDir(),$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))
+				{
+				_ddt( __FILE__, __LINE__, "getThumbnail(): returning url '" . $this->getThumbURL($relative) . "'" );
+
+				Return $this->getThumbURL($relative);
+				}
+		}
+
+		//well, no thumbnail was found, so ask the thumbs.php
+		//to generate the thumbnail on the fly.
+		Return $IMConfig['backend_url'] . '__function=thumbs&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->getImagesDir(),$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->getImagesDir(),$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->getImagesDir(),$dir);
+			$fullpath = Files::makePath($path, Files::escape($newDir));
+			if(is_dir($fullpath))
+				Return false;
+
+			Return Files::createFolder($fullpath);
+		}
+	}
+}
+
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/Classes/Files.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/Classes/Files.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/Classes/Files.php (revision 999)
@@ -0,0 +1,333 @@
+<?php
+/**
+ * File Utilities.
+ * @author $Author:koto $
+ * @version $Id:Files.php 841 2007-05-27 13:31:51Z koto $
+ * @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_DST_DIR_EXIST', 104);
+
+/**
+ * File Utilities
+ * @author $Author:koto $
+ * @version $Id:Files.php 841 2007-05-27 13:31:51Z koto $
+ * @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';
+	}
+
+	/**
+	 * Returns size of a directory, with all file & subdirectory
+	 * sizes added up
+	 * @param string dir path
+	 * @return int
+	 */
+	function dirSize($dirName = '.')
+	{
+		$dir  = dir($dirName);
+		$size = 0;
+
+		while ($file = $dir->read()) {
+			if ($file != '.' && $file != '..')
+			{
+				if (is_dir("$dirName$file"))
+				{
+					$size += Files::dirSize($dirName . '/' . $file);
+				}
+				else
+				{
+					$size += filesize($dirName . '/' . $file);
+				}
+			}
+		}
+		$dir->close();
+		return $size;
+	}
+	
+	/**
+	 * Renames file, preserving its directory and extension
+	 * @param string $oldPath path to the old existing file
+	 * @param string new filename (just the name, without path or extension)
+	 * @author Krzysztof Kotowicz <koto@webworkers.pl>
+	 */
+	function renameFile($oldPath, $newName) {
+
+		if(!(file_exists($oldPath) && is_file($oldPath)))
+			return FILE_ERROR_NO_SOURCE;
+
+		$oldFileParts = pathinfo($oldPath);
+
+		$newPath = $oldFileParts['dirname'] . '/'
+				   . $newName
+				   . (!empty($oldFileParts['extension']) ? '.' . $oldFileParts['extension'] : '');
+
+		if (file_exists($newPath))
+			return false;
+
+		if (!rename($oldPath, $newPath))
+			return FILE_ERROR_COPY_FAILED;
+
+	}
+	
+	function rename ($oldPath,$newPath)
+	{
+		if(!(is_dir($oldPath) || is_file($oldPath)))
+			return FILE_ERROR_NO_SOURCE;
+		
+		if (file_exists($newPath))
+			return FILE_ERROR_DST_DIR_EXIST;
+
+		$ret = rename($oldPath, $newPath);
+		if (!$ret)
+			return FILE_ERROR_COPY_FAILED;
+		else return FILE_COPY_OK;
+	}
+	
+	/**
+	 * copy a directory and all subdirectories and files (recursive)
+	 * @author SBoisvert at Don'tSpamMe dot Bryxal dot ca (adapted from php.net)
+	 * @author Raimund Meyer
+	 * @param string base path
+	 * @param string source directory
+	 * @param string destination directory
+	 * @param bool   overwrite existing files
+	 *  
+	 * @return mixed bool true on pass, number on fail
+	 */
+  	function copyDir($basePath, $source, $dest, $overwrite = false)
+	{
+		if(!is_dir($basePath . $dest))
+		{
+			if (!@mkdir($basePath . $dest)) return FILE_ERROR_DST_DIR_FAILED;	
+		}
+		if($handle = opendir($basePath . $source))
+		{        // if the folder exploration is sucsessful, continue
+			while( ($file = readdir($handle)) !== false)
+			{ // as long as storing the next file to $file is successful, continue
+				if($file != '.' && $file != '..')
+				{
+					$path = $source . '/' . $file;
+					if(is_file($basePath . $path))
+					{
+						/*if(!is_file($basePath . $dest . '/' . $file) || $overwrite)
+						{
+							if(!@copy($basePath . $path, $basePath . $dest . '/' . $file))
+							{
+							  return FILE_ERROR_COPY_FAILED;
+							}
+						}*/
+						Files::copyFile($basePath . $path, $basePath . $dest . '/', $file, true);
+					} 
+					elseif(is_dir($basePath . $path))
+					{
+						if(!is_dir($basePath . $dest . '/' . $file))
+						{
+							mkdir($basePath . $dest . '/' . $file); // make subdirectory before subdirectory is copied
+							Files::copyDir($basePath, $path, $dest . '/' . $file, $overwrite); //recurse!
+						}
+					}
+				}
+			}
+			closedir($handle);
+		}
+		return true;
+	}
+}
+
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/Classes/Thumbnail.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/Classes/Thumbnail.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/Classes/Thumbnail.php (revision 999)
@@ -0,0 +1,125 @@
+<?php
+/**
+ * Create thumbnails.
+ * @author $Author:ray $
+ * @version $Id:Thumbnail.php 709 2007-01-30 23:22:04Z ray $
+ * @package ImageManager
+ */
+
+
+require_once('../ImageManager/Classes/Transform.php');
+
+/**
+ * Thumbnail creation
+ * @author $Author:ray $
+ * @version $Id:Thumbnail.php 709 2007-01-30 23:22:04Z ray $
+ * @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();
+	}
+}
+
+
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/Classes/IM.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/Classes/IM.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/Classes/IM.php (revision 999)
@@ -0,0 +1,239 @@
+<?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 937 2008-01-20 23:13:25Z ray $
+//
+// Image Transformation interface using command line ImageMagick
+//
+
+require_once "../ImageManager/Classes/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)
+    {
+        /*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) 
+    {
+        $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 ('-' == $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';
+         }
+         $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) {
+        $this->command['gamma'] = "-gamma $outputgamma";
+    }
+	
+	function reduce_colors($number = 256)
+	{
+		 $this->command['colors'] = "-colors $number";
+	}
+    /**
+     * Save the image file
+     *
+     * @param string  $filename the name of the file to write to
+     * @param quality $quality  image dpi, default=75
+     * @param string  $type     (JPG,PNG...)
+     *
+     * @return none
+     */
+    function save($filename, $type='', $quality = 85)
+    {
+        $type == '' ? $this->type : $type;
+        $cmd = '' . IMAGE_TRANSFORM_LIB_PATH . 'convert ';
+		$cmd .= implode(' ', $this->command) . " -quality $quality ";
+		$cmd .= '"'.($this->image) . '" "' . ($filename) . '"';
+        
+        //$cmd = str_replace('/', '\\', $cmd);
+		//echo($cmd.'<br>');
+        exec($cmd,$retval);
+		//error_log('IM '.print_r($retval,true));
+    } // 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 == '') {
+            header('Content-type: image/' . $this->type);
+            passthru(IMAGE_TRANSFORM_LIB_PATH . '  ' . 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
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/Classes/NetPBM.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/Classes/NetPBM.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/Classes/NetPBM.php (revision 999)
@@ -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 709 2007-01-30 23:22:04Z ray $
+//
+// Image Transformation interface using command line NetPBM
+
+require_once "../ImageManager/Classes/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 string $filename 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
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/manager.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/manager.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/manager.php (revision 999)
@@ -0,0 +1,204 @@
+<?php
+/**
+ * The main GUI for the ImageManager.
+ * @author $Author:ray $
+ * @version $Id:manager.php 987 2008-04-12 12:39:04Z ray $
+ * @package ImageManager
+ */
+
+	require_once('config.inc.php');
+	require_once('ddt.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>
+  <script type="text/javascript">
+    // temporary. An ImageManager rewrite will take care of this kludge.
+    _backend_url = "<?php print $IMConfig['backend_url']; ?>";
+    _resized_prefix = "<?php echo $IMConfig['resized_prefix']; ?>";
+    _resized_dir = "<?php echo $IMConfig['resized_dir']; ?>";
+  </script>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link href="<?php print $IMConfig['base_url'];?>assets/manager.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="../../popups/popup.js"></script>
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript" src="../../modules/ColorPicker/ColorPicker.js"></script>
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+	if(window.opener)
+		Xinha = HTMLArea = window.opener.Xinha;
+
+	var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
+	var base_url = "<?php echo $manager->getImagesURL(); ?>";
+/*]]>*/
+</script>
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/manager.js"></script>
+<?php
+  if(!$IMConfig['show_full_options'])
+  {
+    ?>
+    <style type="text/css">
+      .fullOptions { visibility:hidden; }
+    </style>
+    <?php
+  }
+?>
+</head>
+<body>
+
+<form action="<?php print $IMConfig['backend_url'] ?>" id="uploadForm" method="post" enctype="multipart/form-data">
+
+<input type="hidden" name="__plugin" value="ImageManager" />
+<input type="hidden" name="__function" value="images" />
+
+<fieldset>
+  <legend>Image Manager</legend>
+  <table width="100%">
+    <tr>
+      <th><label for="dirPath">Directory</label></th>
+      <td>
+        <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>
+      </td>
+      <td>
+        <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="<?php print $IMConfig['base_url']; ?>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="<?php print $IMConfig['base_url']; ?>img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
+            <?php
+          }
+          ?>
+      </td>
+    </tr>
+    <?php
+      if($IMConfig['allow_upload'] == TRUE)
+      {
+        ?>
+        <tr>
+          <th style="text-align: left;">Upload:</th>
+          <td colspan="2">
+            <input type="file" name="upload" id="upload" />
+            <input name="Upload" type="submit" id="Upload" value="Upload" onclick="doUpload();" />
+          </td>
+        </tr>
+        <?php
+      }
+    ?>
+
+  </table>
+
+  <div id="messages" style="display: none;"><span id="message"></span><img src="<?php print $IMConfig['base_url']; ?>img/dots.gif" width="22" height="12" alt="..." /></div>
+
+  <iframe src="<?php print $IMConfig['backend_url']; ?>__function=images" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
+
+</fieldset>
+
+<!-- image properties -->
+
+<table  border="0" cellspacing="0" cellpadding="0" width="100%">
+  <tr>
+    <th style="text-align: left;">Description:</th>
+    <td colspan="6">
+      <input type="text" id="f_alt" style="width:95%"/>
+    </td>
+    <td rowspan="4" width="100" height="100" style="vertical-align: middle;" style="padding:4px;background-color:#CCC;border:1px inset;">
+      <img src="" id="f_preview" />
+    </td>
+  </tr>
+
+  <tr>
+    <th style="text-align: left;">Width:</th>
+    <td >
+      <input id="f_width" type="text" name="f_width" size="4" onchange="javascript:checkConstrains('width');" />
+    </td>
+    <td rowspan="2">
+      <div  style="position:relative">
+        <img src="<?php print $IMConfig['base_url']; ?>img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" style="vertical-align: middle;" /><input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" style="position:absolute;top:8px;left:0px;" />
+      </div>
+    </td>
+    <th style="text-align: left;" class="fullOptions">Margin:</th>
+    <td colspan="3" class="fullOptions">
+      <input name="f_margin" type="text" id="f_margin" size="3" />
+      px </td>
+  </tr>
+
+  <tr>
+    <th style="text-align: left;">Height:</th>
+    <td>
+      <input name="f_height" type="text" id="f_height" size="4" />
+    </td>
+    <th style="text-align: left;" class="fullOptions">Padding:</th>
+    <td  class="fullOptions">
+      <input name="f_padding" type="text" id="f_padding" size="3" />
+      px </td>
+    <th style="text-align: left;" class="fullOptions">Color:</th>
+    <td  class="fullOptions">
+      <input name="f_backgroundColor" type="text" id="f_backgroundColor" size="7" />
+     
+    </td>
+  </tr>
+
+
+  <tr class="fullOptions">
+    <th style="text-align: left;">Alignment:</th>
+    <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>
+        <option value="texttop"                      >Texttop</option>
+        <option value="absmiddle"                    >Absmiddle</option>
+        <option value="baseline" selected="selected" >Baseline</option>
+        <option value="absbottom"                    >Absbottom</option>
+        <option value="bottom"                       >Bottom</option>
+        <option value="middle"                       >Middle</option>
+        <option value="top"                          >Top</option>
+      </select>
+    </td>
+    <th style="text-align: left;">Border:</th>
+    <td>
+      <input name="f_border" type="text" id="f_border" size="3" />
+      px </td>
+    <th style="text-align: left;">Color:</th>
+    <td>
+      <input name="f_borderColor" type="text" id="f_borderColor" size="7" />
+      
+    </td>
+  </tr>
+
+</table>
+
+<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>
+
+<!--// image properties -->
+<input type="hidden" id="orginal_width" />
+<input type="hidden" id="orginal_height" />
+<input type="hidden" id="f_url" class="largelWidth" value="" />
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/ImageManager/ddt.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/ddt.php (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/ddt.php (revision 677)
@@ -0,0 +1,288 @@
+<?php 
+/*
+This ddt library is released under the terms of the HTMLArea license. 
+See license.txt that is shipped with Xinha.
+*/
+
+// must be included after the configuration has been loaded.
+
+if ( ! defined( "IM_CONFIG_LOADED" ) )
+	die( "sorry" );
+
+/**
+* Debug and Error Message functions.
+*
+* These functions implement a procedural version of the formVista DDT debug
+* message system.
+*
+* @package formVista
+* @subpackage lib
+* @copyright DTLink, LLC 2005
+* @author Yermo Lamers
+* @see http://www.formvista.com/contact.html
+*/
+
+// REVISION HISTORY:
+//
+// 26 Jan 2001 YmL:
+//		. initial revision
+//
+// 2002-06-19 YmL:
+//		. added	logging	debug and error	messages to a file.
+//
+// 2004-02-06 YmL:
+//	.	added a newline to generated messages.
+//
+// 2005-01-09 YmL:
+//	.	now checks global $fvDEBUG[ "logfile" ] setting for 
+//		logfile to output to. 
+//	.	dumping to file has not been combined into a dumpmsg 
+//		method.
+//
+// 2005-02-25 YmL:
+//	.	added _error() support for cmdLine programs.
+//
+// 2005-03-20 YmL:
+//	.	changed license for this file to HTMLArea from RPL.
+//	.	quick hack to repurpose for Xinha.
+//
+// -------------------------------------------------------
+
+/**
+* dumps message to stdout or log file depending upon global.
+*
+* checks $fvDEBUG["logfile"] global for name of file to dump
+* messages to. Opens the file once.
+*/
+
+function dumpmsg( $msgline )
+{
+
+global $fvDEBUG;
+
+if ( @$fvDEBUG[ "logfile" ] != NULL )
+	{
+
+	// only open the file once and store the handle in the global
+	// fvDEBUG array .. for now.
+
+	if ( @$fvDEBUG[ "logfile_fp" ] == NULL )
+		{
+
+		// we clear out the debug file on each run.
+
+		if (( $fvDEBUG[ "logfile_fp" ] = fopen( $fvDEBUG[ "logfile" ], "a" )) == NULL )
+			{
+			die( "ddt(): unable to open debug log" );
+			return  false ;
+			}
+		}
+
+	fputs( $fvDEBUG[ "logfile_fp" ], "$msgline" );
+	fflush( $fvDEBUG[ "logfile_fp" ] );
+
+	}
+else
+	{
+	echo $msgline;
+	}
+
+}	// end of dumpmsg.
+
+/**
+* displays a formatted debugging message.
+*
+* If ddtOn() was called, outputs a formatted debugging message.
+*
+* @param string $file filename, usually __FILE__
+* @param string $line line number in file, usually __LINE__
+* @param string $msg debugging message to display
+*/
+
+function _ddt( $file, $line, $msg )
+{
+
+global $_DDT;
+global $_DDT_DEBUG_LOG;
+global $_DDT_CMDLINE;
+
+$basename = basename( $file );
+
+if ( @$_DDT == "yes" )
+	{
+
+	if ( @$_DDT_CMDLINE == "yes" )
+		{
+		dumpmsg( basename( $file ) . ":$line: $msg \n" );
+		flush();
+
+		}
+	else
+		{
+		dumpmsg( "<p>$basename:$line: $msg</p>\n" );
+		}
+	}
+
+}	// end of _ddt
+
+/**
+* displays a formatted dump of an associative array.
+*
+* If ddtOn() was called, outputs a formatted debugging message showing 
+* contents of array.
+*
+* @param string $file filename, usually __FILE__
+* @param string $line line number in file, usually __LINE__
+* @param string $msg debugging message to display
+* @param array $array_var array to dump.
+*/
+
+function _ddtArray( $file, $line, $msg,	$array_var )
+{
+
+global $_DDT;
+
+if ( $_DDT == "yes" )
+	{
+
+	dumpmsg( "<h2>$file:$line: $msg</h2>" );
+	
+	foreach	( $array_var as	$name => $value	)
+		{
+		dumpmsg( "<p><b>$name</b> => <b>$value</b>\n" );
+		}
+	}
+
+}	// end of _ddtArray
+
+// -----------------------------------------------------------------
+
+/**
+* Central Error Function.
+*
+* Displays a formatted error message to the user.
+* If the global _DDT_ERROR_LOG is set the error message is dumped 
+* to that file	instead	of being displayed to the user.
+*/
+
+function _error( $file,	$line, $msg )
+{
+
+global $_DDT_ERROR_LOG;
+global $_DDT_CMDLINE;
+
+if ( @$_DDT_ERROR_LOG == NULL )
+	{
+
+	if ( @$_DDT_CMDLINE == "yes" )
+		{
+		echo basename($file) . ":$line: $msg\n";
+		}
+	else
+		{
+		echo "<h2>$file:$line: $msg</h2>";
+		}
+	}
+else
+	{
+	 
+	if (( $fp = fopen( $_DDT_ERROR_LOG, "a"	)) != NULL )
+		{
+		fputs( $fp, date("D M j	G:i:s T	Y") . "	- $file:$line: $msg\n" );
+		fclose(	$fp );
+		}
+		
+	}
+	
+}	// end of _error
+
+// ----------------------------------------------------------------------
+
+function errorEcho( $title, $field )
+{
+
+global $error_msg;
+
+if ( $error_msg[ $field	] != ""	)
+	{
+	
+	echo "<FONT SIZE=\"+2\"	COLOR=\"RED\">$title</FONT>";
+	
+	}
+else
+	{
+	
+	echo $title;
+	
+	}
+	
+}	// end of errorEcho
+
+/**
+* turns on procedural debugging.
+*
+* Causes _ddt() calls to display debugging messages.
+*/
+
+function _ddtOn()
+{
+
+global $_DDT;
+
+$_DDT =	"yes";
+
+}
+
+/**
+* set error message destination.
+*
+* sets the destination for error messages.
+*
+* @param string $file full path to errorlog.
+*/
+
+function _setErrorLog( $errorLog )
+{
+
+global $_DDT_ERROR_LOG;
+
+$_DDT_ERROR_LOG	= $errorLog;
+
+}
+
+/**
+* set output file for debugging messages.
+*
+* sets the destination file for debugging messages.
+*
+* @param string $file full path to debuglog.
+*/
+
+function _setDebugLog( $debugLog )
+{
+
+global $fvDEBUG;
+
+$fvDEBUG[ "logfile" ] = $debugLog;
+
+}
+
+/**
+* set debugging output style to command line.
+*
+* tells ddt to format debugging messages for a 
+* command line program.
+*/
+
+function _ddtSetCmdLine()
+{
+
+global $_DDT_CMDLINE;
+
+$_DDT_CMDLINE = "yes";
+
+}
+
+// END
+
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/ImageEditor.css
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/ImageEditor.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/ImageEditor.css (revision 677)
@@ -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; }
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/hover.htc
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/hover.htc (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/hover.htc (revision 677)
@@ -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>
+
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/images.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/images.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/images.js (revision 999)
@@ -0,0 +1,148 @@
+/**
+ * Functions for the image listing, used by images.php only	
+ * @author $Author:gogo $
+ * @version $Id:images.js 927 2008-01-08 03:40:02Z gogo $
+ * @package ImageManager
+ */
+
+	function i18n(str) {
+        return Xinha._lc(str, 'ImageManager');
+	}
+
+	function changeDir(newDir) 
+	{
+		showMessage('Loading');
+
+		// backend_url is defined in the calling page. For now we 
+		// assume it has a trailing &
+
+		location.href = _backend_url + "__function=images&dir="+encodeURIComponent(newDir);
+	}
+
+
+	function newFolder(dir, newDir) 
+	{
+		location.href = _backend_url + "__function=images&dir="+encodeURIComponent(dir)+"&newDir="+encodeURIComponent(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_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;		
+    // Set preview for the selected
+    topDoc.getElementById('f_preview').src = window.parent._backend_url + '__function=thumbs&img=' + filename;
+    
+    update_selected();
+	}
+
+  var _current_selected = null;
+  function update_selected()
+  {
+    var topDoc = window.top.document;
+    if(_current_selected)
+    {
+      _current_selected.className = _current_selected.className.replace(/(^| )active( |$)/, '$1$2');
+      _current_selected = null;
+    }
+    // Grab the current file, and highlight it if we have it
+    var c_file = topDoc.getElementById('f_url').value;
+    var selection = topDoc.getElementById('dirPath');
+		var currentDir = selection.options[selection.selectedIndex].text;
+    var dRe = new RegExp('^(' + currentDir.replace(/([\/\^$*+?.()|{}[\]])/g, '\\$1') + ')([^/]*)$');
+    if(dRe.test(c_file))
+    {
+      var holder = document.getElementById('holder_' + asc2hex(RegExp.$2));
+      if(holder)
+      {
+        _current_selected = holder;
+        holder.className += ' active';
+      }
+    }
+  }
+
+  function asc2hex(str)
+  {
+    var hexstr = '';
+    for(var i = 0; i < str.length; i++)
+    {
+      var hex = (str.charCodeAt(i)).toString(16);
+      if(hex.length == 1) hex = '0' + hex;
+      hexstr += hex;
+    }
+    return hexstr;
+  }
+
+	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);
+  Xinha = window.parent.Xinha;
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/editor.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/editor.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/editor.js (revision 999)
@@ -0,0 +1,172 @@
+/**
+ * Functions for the ImageEditor interface, used by editor.php only	
+ * @author $Author:ray $
+ * @version $Id:editor.js 677 2007-01-19 22:24:36Z ray $
+ * @package ImageManager
+ */
+
+	var current_action = null;
+	var actions = ['crop', 'scale', 'rotate', 'measure', 'save'];
+	var orginal_width = null, orginal_height=null;
+	function toggle(action) 
+	{
+		if(current_action != action)
+		{
+
+			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);
+
+			//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();
+		}
+	}
+
+	//Togggle constraints, by Frédéric Klee <fklee@isuisse.com>
+	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, by Frédéric Klee <fklee@isuisse.com>
+	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 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('ImageManager');
+		}
+	}
+
+	addEvent(window, 'load', init);
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/manager.css
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/manager.css (revision 770)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/manager.css (revision 770)
@@ -0,0 +1,46 @@
+html, body, .dialog {  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;}
+
+a { padding: 5px; border: 1px solid ButtonFace;	}	
+a img	{ border: 0; }	
+a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; }
+.dirs {	padding: 1em; 	}
+.imageFrame { width: 100%; 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; }
+iframe { border:1px inset; border-right:none; border-left:none; border-bottom:none; }
+
+table { margin-top:10px; }
+th, td { padding-right:3px; text-align:left; font-family:small-caption,helvetica,sans-serif; }
+
+.buttonColor {
+  width :1em;
+  margin-left: 2px;
+  cursor: default;
+}
+
+.buttonColor .chooser, .buttonColor .nocolor {
+  height: 0.6em;
+  border: 1px solid;
+  padding: 0px 1em;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.buttonColor .buttonClick {
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+.buttonColor .buttonColor-hilite {
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+
+.buttonColor .nocolor { padding: 0px; }
+.buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/imagelist.css
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/imagelist.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/imagelist.css (revision 677)
@@ -0,0 +1,46 @@
+body { margin: 0; padding: 0; }
+.edit   { font-size: small; font-family: small-caption, sans-serif; padding-top: 3px;}
+.edit a { border: none; padding: 3px; text-decoration:none; }
+.edit a:hover { background-color: ButtonHighlight; }
+.edit a img { border: 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;}
+
+.dir_holder, .thumb_holder
+{
+  width:110px; height:132px;
+  float:left;
+  margin:6px;
+  background-color:ButtonFace;
+  border: 1px outset;
+}
+
+.thumb_holder.active
+{
+  background:Highlight;
+  color:HighlightText;
+  border:1px dashed Highlight;
+}
+
+.dir_holder a.dir, .thumb_holder a.thumb
+{
+  height:100px;
+  display:block;
+  text-align:center;
+  padding:5px;
+  text-decoration:none;
+}
+
+.thumb_holder a.thumb img
+{
+  border:1px solid black;
+}
+
+.dir_holder a.dir img
+{
+  border:none;
+}
+.listview { width:100% }
+.listview td, .listview th { text-align:left; font-size:small; }
+.listview td.actions { text-align:right; }
+.listview td.actions img { border:0px; }
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/manager.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/manager.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/manager.js (revision 999)
@@ -0,0 +1,341 @@
+/**
+ * Functions for the ImageManager, used by manager.php only	
+ * @author $Author:gogo $
+ * @version $Id:manager.js 877 2007-08-12 15:50:03Z gogo $
+ * @package ImageManager
+ */
+	
+	//Translation
+	function i18n(str) {
+        return Xinha._lc(str, 'ImageManager');
+	}
+
+
+	//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
+  doneinit = 0; // Seems that in Opera the load event of the iframe re-fires this one also.
+	init = function () 
+	{
+    if(doneinit++) return;
+    
+		__dlg_init(null, {width:600,height:460});
+
+		__dlg_translate('ImageManager');
+        
+        // This is so the translated string shows up in the drop down.
+        document.getElementById("f_align").selectedIndex = 1;
+        document.getElementById("f_align").selectedIndex = 0;
+        
+
+		var uploadForm = document.getElementById('uploadForm');
+		if(uploadForm) uploadForm.target = 'imgManager';
+
+		var param = window.dialogArguments;
+		if (param) 
+		{
+      var image_regex = new RegExp( '(https?://[^/]*)?' + base_url.replace(/\/$/, '') );
+      param.f_url = param.f_url.replace( image_regex, "" );
+
+      // The image URL may reference one of the automatically resized images 
+      // (when the user alters the dimensions in the picker), clean that up
+      // so it looks right and we get back to a normal f_url
+      var rd = (_resized_dir) ? _resized_dir.replace(Xinha.RE_Specials, '\\$1') + '/' : '';
+      var rp = _resized_prefix.replace(Xinha.RE_Specials, '\\$1');
+      var dreg = new RegExp('^(.*/)' + rd + rp + '_([0-9]+)x([0-9]+)_([^/]+)$');
+  
+      if(dreg.test(param.f_url))
+      {
+        param.f_url    = RegExp.$1 + RegExp.$4;
+        param.f_width  = RegExp.$2;
+        param.f_height = RegExp.$3;
+      }
+      
+      for (var id in param)
+      {
+        if(id == 'f_align') continue;
+        if(document.getElementById(id))
+        {
+          document.getElementById(id).value = param[id];
+        }
+      }
+
+
+
+      document.getElementById("orginal_width").value = param["f_width"];
+			document.getElementById("orginal_height").value = param["f_height"];
+			setAlign(param["f_align"]);
+
+      // Locate to the correct directory
+      var dreg = new RegExp('^(.*/)([^/]+)$');
+      if(dreg.test(param['f_url']) && !(new RegExp('^https?://','i')).test(param['f_url']))
+      {
+        changeDir(RegExp.$1);
+        var dirPath = document.getElementById('dirPath');
+        for(var i = 0; i < dirPath.options.length; i++)
+        {
+          if(dirPath.options[i].value == encodeURIComponent(RegExp.$1))
+          {
+            dirPath.options[i].selected = true;
+            break;
+          }
+        }
+      }
+      document.getElementById('f_preview').src = _backend_url + '__function=thumbs&img=' + param.f_url;      
+		}
+		
+		 // Hookup color pickers
+    new Xinha.colorPicker.InputBinding(document.getElementById('f_backgroundColor'));
+    new Xinha.colorPicker.InputBinding(document.getElementById('f_borderColor'));
+
+		document.getElementById("f_alt").focus();
+	};
+
+
+	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_width", "f_height", "f_padding", "f_margin", "f_border", "f_borderColor", "f_backgroundColor"];
+		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 )
+				{
+
+				if ( el.value == "" )
+					{
+					alert( i18n("No Image selected.") );
+					return( false );
+					}
+
+				param[id] = makeURL(base_url,el.value);
+				}
+			else if (el)
+				param[id] = el.value;
+      else alert("Missing " + fields[i]);
+
+		}
+
+    // See if we need to resize the image
+    var origsize =
+    {
+      w:document.getElementById('orginal_width').value,
+      h:document.getElementById('orginal_height').value
+    }
+
+    if(  (origsize.w != param.f_width)
+      || (origsize.h != param.f_height) )
+    {
+      // Yup, need to resize
+      var resized = Xinha._geturlcontent(_backend_url + '&__function=resizer&img=' + encodeURIComponent(document.getElementById('f_url').value) + '&width=' + param.f_width + '&height=' + param.f_height);
+      // alert(resized);
+      resized = eval(resized);
+      if(resized)
+      {
+        param.f_url = makeURL(base_url, resized);
+      }
+    }
+
+
+		__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 = '';
+	}
+
+	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()
+	{
+		function createFolder(folder)
+		{
+			var selection = document.getElementById('dirPath');
+			var dir = selection.options[selection.selectedIndex].value;
+
+			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));
+			}
+		}
+		// IE7 has crippled the prompt()
+		if (Xinha.ie_version > 6)
+		{
+			Dialog("newFolder.html", function(param)
+			{
+				if (!param) // user must have pressed Cancel
+				{
+					return false;
+				}
+				else
+				{
+					var folder = param['f_foldername'];
+					createFolder(folder);
+				}
+			}, null);
+		}
+		else
+		{
+			var folder = prompt(i18n('Please enter name for new folder...'), i18n('Untitled'));
+			createFolder(folder);
+		}
+	}
+  
+	addEvent(window, 'load', init);
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/editorFrame.css
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/editorFrame.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/editorFrame.css (revision 677)
@@ -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; } 
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/wz_jsgraphics.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/wz_jsgraphics.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/wz_jsgraphics.js (revision 677)
@@ -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;
+    }
+}
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/dialog.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/dialog.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/dialog.js (revision 999)
@@ -0,0 +1,119 @@
+// 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 929 2008-01-09 21:10:59Z ray $
+
+// 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
+	}
+	if (typeof window.showModalDialog == 'function')
+	{
+		Dialog._return = action;
+		var r = window.showModalDialog(url, init, "dialogheight=10;dialogwidth=10;resizable=yes");
+	}
+	else
+	{
+		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);
+	// capture other frames
+	for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+	// make up a function to be called when the Dialog ends.
+	Dialog._return = function (val) {
+		if (val && action) {
+			action(val);
+		}
+		relwin(window);
+		// capture other frames
+		for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+		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));
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/EditorContent.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/EditorContent.js (revision 795)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/EditorContent.js (revision 795)
@@ -0,0 +1,749 @@
+/***********************************************************************
+** 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 (event == null) x=document.body.scrollLeft + bx;
+		else x=document.body.scrollLeft + event.clientX + bx;
+	  if (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 (isNaN(nx)) nx = 0;
+    if (isNaN(ny)) ny = 0;
+    if (isNaN(nw)) nw = 0;
+    if (isNaN(nh)) nh = 0;
+  
+    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;
+
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/editorFrame.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/editorFrame.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/editorFrame.js (revision 999)
@@ -0,0 +1,98 @@
+/**
+ * Javascript used by the editorFrame.php, it basically initializes the frame.
+ * @author $Author:ray $
+ * @version $Id:editorFrame.js 677 2007-01-19 22:24:36Z ray $
+ * @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)
+{
+    if (action == 'crop')
+    {
+        // backend_url is set by the calling page. For now we assume it contains
+		  // a trailing &
+
+        var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=crop&params="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value);
+
+        //alert(url);
+        location.href = url;
+
+        //location.reload();
+    }   
+    else if (action == 'scale')
+    {
+        var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=scale&params="+parseInt(s_sw.value)+','+parseInt(s_sh.value);
+        //alert(url);
+        location.href = url;
+        
+    }
+    else if (action == 'rotate')
+    {
+        var flip = topDoc.getElementById('flip');
+
+        if(flip.value == 'hoz' || flip.value == 'ver') 
+            location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=flip&params="+flip.value;
+        else if (isNaN(parseFloat(r_ra.value))==false)
+            location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=rotate&params="+parseFloat(r_ra.value);
+    }
+    else if(action == 'save') {
+        var s_file = topDoc.getElementById('save_filename');
+        var s_format = topDoc.getElementById('save_format');
+        var s_quality = topDoc.getElementById('quality');
+
+        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 = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=save&params="+format[0]+","+quality+"&file="+filename;
+            //alert(url);
+            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
+
+init = function()
+{
+	jg_doc = new jsGraphics("imgCanvas"); // draw directly into document
+	jg_doc.setColor("#000000"); // black
+
+	initEditor();
+};
+
+addEvent(window, 'load', init);
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/editor.css
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/editor.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/editor.css (revision 677)
@@ -0,0 +1,194 @@
+		body
+		{
+			margin: 0; padding: 0;
+			font: 11px Tahoma,Verdana,sans-serif;
+		}
+		select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+
+		#indicator
+		{
+			width: 25px;
+			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: 63px;
+			border-left: 1px solid white;
+			border-bottom: 1px solid white;
+		}
+		#toolbar
+		{
+			width: 53px;
+			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: 64px; top: 51px;
+		}
+		
+		#editor
+		{
+			width: 600px;
+			height: 445px;
+		}
+
+		#toolbar a 
+		{
+			padding: 5px;
+			width: 40px;
+			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;
+		}
+		#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;
+}
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/slider.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/slider.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/slider.js (revision 677)
@@ -0,0 +1,105 @@
+/***********************************************************************
+** 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) {
+
+    //alert('hello');
+    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);
+    }
+    return false;
+
+}
+
+function initSlider()
+{
+    if (currentSlider == null)
+        currentSlider = document.getElementById('sliderbar');
+   
+    if (sliderField == null)
+        sliderField = document.getElementById('quality');
+
+    if (rangeMin == null)
+        rangeMin = 3
+    if (rangeMax == null)
+    {
+        var track = document.getElementById('slidertrack');
+        rangeMax = parseInt(track.style.width);
+    }
+
+}
+
+function updateSlider(value)
+{
+    initSlider();
+
+    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);
+}
+
+function captureStart()
+{
+    
+    initSlider();
+
+    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;
+}
Index: /branches/new-dialogs-merge/plugins/ImageManager/assets/popup.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/assets/popup.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/assets/popup.js (revision 999)
@@ -0,0 +1,40 @@
+// 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 856 2007-06-13 18:34:34Z wymsy $
+
+// Override the ordinary popup.js translation to add translation for a few other HTML elements.
+
+function __dlg_translate(context) {
+    var types = ["span", "option", "td", "th", "button", "div", "label", "a","img", "legend"];
+    for (var type = 0; type < types.length; ++type) {
+        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 = Xinha._lc(span.firstChild.data, context);
+                if (txt)
+                    span.firstChild.data = txt;
+            }
+            if (span.title) {
+                var txt = Xinha._lc(span.title, context);
+                if (txt)
+                    span.title = txt;
+            }
+            if (span.alt) {
+                var txt = Xinha._lc(span.alt, context);
+                if (txt)
+                    span.alt = txt;
+            }
+        }
+    }
+    document.title = Xinha._lc(document.title, context);
+}
Index: /branches/new-dialogs-merge/plugins/ImageManager/config.inc.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/config.inc.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/config.inc.php (revision 999)
@@ -0,0 +1,346 @@
+<?php
+/**
+ * Image Manager configuration file.
+ * @author $Author:gogo $
+ * @version $Id:config.inc.php 830 2007-05-09 13:27:34Z gogo $
+ * @package ImageManager
+ *
+ * @todo change all these config values to defines()
+ */
+
+// REVISION HISTORY:
+//
+// 2005-03-20 Yermo Lamers (www.formvista.com):
+//	. unified backend.
+// . created a set of defaults that make sense for bundling with Xinha.
+
+// -------------------------------------------------------------------------
+
+/**
+* Default backend URL
+*
+* URL to use for unified backend.
+*
+* The ?__plugin=ImageManager& is required. 
+*/
+
+$IMConfig['backend_url'] = "backend.php?__plugin=ImageManager&";
+
+/**
+* Backend Installation Directory
+*
+* location of backend install; these are used to link to css and js
+* assets because we may have the front end installed in a different
+* directory than the backend. (i.e. nothing assumes that the frontend
+* and the backend are in the same directory)
+*/
+
+$IMConfig['base_dir'] = getcwd();
+$IMConfig['base_url'] = '';
+
+// ------------------------------------------------------------
+
+/**
+* Path to directory containing images.
+*
+* 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.
+*
+* CHANGE THIS: for out-of-the-box demo purposes we're setting this to ./demo_images
+* which has some graphics in it.
+*/
+
+// $IMConfig['images_dir'] = "/some/path/to/images/directory;
+
+$IMConfig['images_dir'] = "demo_images";
+
+// -------------------------------------------------------------------------
+
+/**
+* URL of directory containing 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.
+*
+* CHANGE THIS: You need to change this to match the url where you have Xinha
+* installed. If the images show up blank chances are this is not set correctly.
+*/
+
+// $IMConfig['images_url'] = "/url/to/above";
+
+// try to figure out the URL of the sample images directory. For your installation
+// you will probably want to keep images in another directory.
+
+$IMConfig['images_url'] = str_replace( "backend.php", "", $_SERVER["PHP_SELF"] ) . "demo_images";
+
+// -------------------------------------------------------------------------
+
+/**
+* PHP Safe Mode?
+*
+* 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;
+
+// -------------------------------------------------------------------------
+
+/**
+* Image Library to use.
+*
+* 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.
+*
+* DEFAULT: GD is probably the most likely to be available. 
+*/
+
+$IMConfig['IMAGE_CLASS'] = 'GD';
+
+
+// -------------------------------------------------------------------------
+
+/**
+* NetPBM or IM binary path.
+*
+* 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.
+*/
+
+$IMConfig['IMAGE_TRANSFORM_LIB_PATH'] ='/usr/bin/';
+
+// For windows, something like
+// C:/"Program Files"/ImageMagick-5.5.7-Q16/
+
+// -------------------------------------------------------------------------
+//                OPTIONAL SETTINGS 
+// -------------------------------------------------------------------------
+
+/**
+* Thumbnail prefix
+*
+* 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 Directory
+*
+* 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';
+
+// -------------------------------------------------------------------------
+
+/**
+* Resized prefix
+*
+* The prefix for resized files, something like .resized will do.  The
+* resized files will be named <prefix>_<width>x<height>_<original>
+* resized files are created when one changes the dimensions of an image
+* in the image manager selection dialog - the image is scaled when the
+* user clicks the ok button.
+*/
+
+$IMConfig['resized_prefix'] = '.resized';
+
+// -------------------------------------------------------------------------
+
+/**
+* Resized Directory
+*
+* Resized images may also be stored in a directory, except in safe mode.
+*/
+
+$IMConfig['resized_dir'] = '.resized';
+
+/**
+ * Full options
+ *
+ * Determines whether the user is given options for padding, 
+ * background/padding colour, margin, border and border colour. 
+ */
+
+$IMConfig['show_full_options'] = true;
+ 
+// -------------------------------------------------------------------------
+
+/**
+* Allow New Directories
+*
+*
+* 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
+*
+* DEFAULT: for demo purposes we turn this off.
+*/
+
+$IMConfig['allow_new_dir'] = true;
+
+// -------------------------------------------------------------------------
+
+/**
+* Allow Uploads
+*
+*  Possible values: true, false
+*
+*  TRUE - Allow the user to upload files.
+*
+*  FALSE - No uploading allowed.
+*
+* DEFAULT: for demo purposes we turn this off.
+*/
+
+$IMConfig['allow_upload'] = true;
+
+// -------------------------------------------------------------------------
+
+/**
+* Validate Images
+*
+* 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;
+
+// -------------------------------------------------------------------------
+
+/**
+* Default Thumnail.
+*
+* 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;
+
+// -------------------------------------------------------------------------
+
+/**
+* Editor Temporary File Prefix.
+*
+* Image Editor temporary filename prefix.
+*/
+
+$IMConfig['tmp_prefix'] = '.editor_';
+
+
+$IMConfig['ViewMode'] = 'thumbs';
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//       ================== END OF CONFIGURATION =======================      //
+////////////////////////////////////////////////////////////////////////////////
+
+
+// Standard PHP Backend Data Passing
+//  if data was passed using xinha_pass_to_php_backend() we merge the items
+//  provided into the Config
+require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php'));
+if($passed_data = xinha_read_passed_data())
+{
+  $IMConfig = array_merge($IMConfig, $passed_data);
+  $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&';
+}
+// Deprecated config passing, don't use this way any more!
+elseif(isset($_REQUEST['backend_config']))
+{
+  if(get_magic_quotes_gpc()) {
+    $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']);
+  }
+  
+  // Config specified from front end, check that it's valid
+  session_start();
+  $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']];
+
+  if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret))
+  {
+    die("Backend security error.");
+  }
+
+  $to_merge = unserialize($_REQUEST['backend_config']);
+  if(!is_array($to_merge))
+  {
+    die("Backend config syntax error.");
+  }
+
+  $IMConfig = array_merge($IMConfig, $to_merge);
+  $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&';
+  $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&';
+  $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&';
+
+}
+
+define('IMAGE_CLASS', $IMConfig['IMAGE_CLASS']);
+define('IMAGE_TRANSFORM_LIB_PATH', $IMConfig['IMAGE_TRANSFORM_LIB_PATH']);
+define( "IM_CONFIG_LOADED", "yes" );
+
+// bring in the debugging library
+
+include_once( "ddt.php" );
+
+// uncomment to send debug messages to a local file
+// _setDebugLog( "/tmp/debug_log.txt" );
+
+// turn debugging on everywhere.
+// _ddtOn();
+
+// END
+
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/image-manager.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/image-manager.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/image-manager.js (revision 999)
@@ -0,0 +1,277 @@
+/**
+ * The ImageManager plugin javascript.
+ * @author $Author:(local) $
+ * @version $Id:image-manager.js 856M 2007-06-13 18:34:34Z (local) $
+ * @package ImageManager
+ */
+
+/**
+ * To Enable the plug-in add the following line before Xinha is initialised.
+ *
+ * Xinha.loadPlugin("ImageManager");
+ *
+ * Then configure the config.inc.php file, that is all.
+ * For up-to-date documentation, please visit http://www.zhuo.org/htmlarea/
+ */
+
+/**
+ * It is pretty simple, this file over rides the Xinha.prototype._insertImage
+ * function with our own, only difference is the popupDialog url
+ * point that to the php script.
+ */
+
+function ImageManager(editor)
+{
+
+}
+
+ImageManager._pluginInfo = {
+	name          : "ImageManager",
+	version       : "1.0",
+	developer     : "Xiang Wei Zhuo",
+	developer_url : "http://www.zhuo.org/htmlarea/",
+	license       : "htmlArea"
+};
+
+
+// CONFIGURATION README:
+//
+//  It's useful to pass the configuration to the backend through javascript
+//  (this saves editing the backend config itself), this needs to be done
+//  in a trusted/secure manner... here is how to do it..
+//
+//  1. You need to be able to put PHP in your xinha_config setup
+//  2. In step 3 write something like
+//  --------------------------------------------------------------
+//  with (xinha_config.ImageManager)
+//  { 
+//    <?php 
+//      require_once('/path/to/xinha/contrib/php-xinha.php');
+//      xinha_pass_to_php_backend
+//      (       
+//        array
+//        (
+//         'images_dir' => '/home/your/directory',
+//         'images_url' => '/directory'
+//        )
+//      )
+//    ?>
+//  }
+//  --------------------------------------------------------------
+//
+//  this will work provided you are using normal file-based PHP sessions
+//  (most likely), if not, you may need to modify the php-xinha.php
+//  file to suit your setup.
+
+Xinha.Config.prototype.ImageManager =
+{
+  'backend'    : Xinha.getPluginDir("ImageManager") + '/backend.php?__plugin=ImageManager&',
+  'backend_data' : null,
+  
+  // Deprecated method for passing config, use above instead!
+  //---------------------------------------------------------
+  'backend_config'     : null,
+  'backend_config_hash': null,
+  'backend_config_secret_key_location': 'Xinha:ImageManager'
+  //---------------------------------------------------------
+};
+
+// Over ride the _insertImage function in htmlarea.js.
+// Open up the ImageManger script instead.
+
+Xinha.prototype._insertImage = function(image) {
+
+	var editor = this;	// for nested functions
+	var outparam = null;
+	if (typeof image == "undefined") {
+		image = this.getParentElement();
+		if (image && !/^img$/i.test(image.tagName))
+			image = null;
+	}
+
+	// the selection will have the absolute url to the image. 
+	// coerce it to be relative to the images directory.
+	//
+	// FIXME: we have the correct URL, but how to get it to select?
+	// FIXME: need to do the same for MSIE.
+
+	if ( image )
+		{
+
+		outparam =
+			{
+			f_url    : Xinha.is_ie ? image.src : image.src,
+			f_alt    : image.alt,
+			f_border : image.style.borderWidth ? image.style.borderWidth : image.border,
+			f_align  : image.align,
+			f_padding: image.style.padding,
+			f_margin : image.style.margin,
+			f_width  : image.width,
+			f_height  : image.height,
+      f_backgroundColor: image.style.backgroundColor,
+      f_borderColor: image.style.borderColor
+			};
+
+    function shortSize(cssSize)
+    {
+      if(/ /.test(cssSize))
+      {
+        var sizes = cssSize.split(' ');
+        var useFirstSize = true;
+        for(var i = 1; i < sizes.length; i++)
+        {
+          if(sizes[0] != sizes[i])
+          {
+            useFirstSize = false;
+            break;
+          }
+        }
+        if(useFirstSize) cssSize = sizes[0];
+      }
+      return cssSize;
+    }
+    outparam.f_border = shortSize(outparam.f_border);
+    outparam.f_padding = shortSize(outparam.f_padding);
+    outparam.f_margin = shortSize(outparam.f_margin);
+    
+    function convertToHex(color) {
+
+      if (typeof color == "string" && /, /.test.color)
+      color = color.replace(/, /, ','); // rgb(a, b) => rgb(a,b)
+
+      if (typeof color == "string" && / /.test.color) { // multiple values
+        var colors = color.split(' ');
+        var colorstring = '';
+        for (var i = 0; i < colors.length; i++) {
+          colorstring += Xinha._colorToRgb(colors[i]);
+          if (i + 1 < colors.length)
+          colorstring += " ";
+        }
+        return colorstring;
+      }
+
+      return Xinha._colorToRgb(color);
+    }
+    
+    outparam.f_backgroundColor = convertToHex(outparam.f_backgroundColor);
+    outparam.f_borderColor = convertToHex(outparam.f_borderColor);
+
+		} // end of if we selected an image before raising the dialog.
+
+	// the "manager" var is legacy code. Should probably reference the
+	// actual config variable in each place .. for now this is good enough.
+
+	// alert( "backend is '" + editor.config.ImageManager.backend + "'" );
+
+	var manager = editor.config.ImageManager.backend + '__function=manager';
+  if(editor.config.ImageManager.backend_config != null)
+  {
+    manager += '&backend_config='
+      + encodeURIComponent(editor.config.ImageManager.backend_config);
+    manager += '&backend_config_hash='
+      + encodeURIComponent(editor.config.ImageManager.backend_config_hash);
+    manager += '&backend_config_secret_key_location='
+      + encodeURIComponent(editor.config.ImageManager.backend_config_secret_key_location);
+  }
+  
+  if(editor.config.ImageManager.backend_data != null)
+  {
+    for ( var i in editor.config.ImageManager.backend_data )
+    {
+      manager += '&' + i + '=' + encodeURIComponent(editor.config.ImageManager.backend_data[i]);
+    }
+  }
+  
+	Dialog(manager, function(param) {
+		if (!param) {	// user must have pressed Cancel
+			return false;
+		}
+		var img = image;
+		if (!img) {
+			if (Xinha.is_ie) {
+        var sel = editor._getSelection();
+        var range = editor._createRange(sel);
+        editor._doc.execCommand("insertimage", false, param.f_url);
+				img = range.parentElement();
+				// wonder if this works...
+				if (img.tagName.toLowerCase() != "img") {
+					img = img.previousSibling;
+				}
+			} else {
+				img = document.createElement('img');
+        img.src = param.f_url;
+        editor.insertNodeAtSelection(img);
+			}
+		} else {			
+			img.src = param.f_url;
+		}
+		
+		for (field in param) {
+			var value = param[field];
+			switch (field) {
+			    case "f_alt"    : img.alt	 = value; break;
+			    case "f_border" :
+          if(value.length)
+          {           
+            img.style.borderWidth = /[^0-9]/.test(value) ? value :  (parseInt(value) + 'px');
+            if(img.style.borderWidth && !img.style.borderStyle)
+            {
+              img.style.borderStyle = 'solid';
+            }
+          }
+          else
+          {
+            img.style.borderWidth = '';
+            img.style.borderStyle = '';
+          }
+          break;
+          
+          case "f_borderColor": img.style.borderColor = value; break;
+          case "f_backgroundColor": img.style.backgroundColor = value; break;
+            
+          case "f_padding": 
+          {
+            if(value.length)
+            {
+              img.style.padding = /[^0-9]/.test(value) ? value :  (parseInt(value) + 'px'); 
+            }
+            else
+            {
+              img.style.padding = '';
+            }
+          }
+          break;
+          
+          case "f_margin": 
+          {
+            if(value.length)
+            {
+              img.style.margin = /[^0-9]/.test(value) ? value :  (parseInt(value) + 'px'); 
+            }
+            else
+            {
+              img.style.margin = '';
+            }
+          }
+          break;
+          
+			    case "f_align"  : img.align	 = value; break;
+            
+          case "f_width" : 
+          {
+            if(!isNaN(parseInt(value))) { img.width  = parseInt(value); } else { img.width = ''; }
+          }
+          break;
+          
+				  case "f_height":
+          {
+            if(!isNaN(parseInt(value))) { img.height = parseInt(value); } else { img.height = ''; }
+          }
+          break;
+			}
+
+		}
+		
+		
+	}, outparam);
+};
Index: /branches/new-dialogs-merge/plugins/ImageManager/image-picker.js
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/image-picker.js (revision 832)
+++ /branches/new-dialogs-merge/plugins/ImageManager/image-picker.js (revision 832)
@@ -0,0 +1,169 @@
+/**
+ * An input field Image Picker utilising the Xinha ImageManager.
+ *
+ * Hijack the Xinha ImageManager plugin to provide an image URL picker
+ * for any form input field in the form of a "Browse" button to the
+ * right of the field, in the same manner as a file type input field
+ * except it opens the familiar ImageManager dialog to upload/select/edit
+ * an image and returns the URL of the image to the field's value.
+ *
+ * Example Usage:
+ *
+ *  <script type="text/javascript">_editor_url = '/url/to/xinha';</script>
+ *  <script type="text/javascript" src="image-picker.js" />
+ *  <script type="text/javascript">
+ *   <?php require_once('/path/to/xinha/contrib/php-xinha.php'); ?>
+ *   with(ImagePicker.prototype)
+ *   {
+ *     <?php 
+ *      $Conf = array
+ *       (
+ *         'images_dir' => '/path/to/images', 
+ *         'images_url' => '/url/to/images', 
+ *         'show_full_options' => false, // Full options are not useful as a URL picker
+ *         // See ImageManager for more configuration options !           
+ *       );
+ *      xinha_pass_to_php_backend($Conf);
+ *     ?>
+ *   }
+ *
+ *   window.onload = function() { new ImagePicker(document.getElementById('idOfTheInputField')); }
+ *  </script>
+ *
+ *
+ * @author $Author$
+ * @version $Id$
+ * @package ImageManager
+ */
+
+
+function ImagePicker(field)
+{
+  this.field = field;
+  var picker = this;
+  
+  var but = document.createElement('input');   
+  but.type = 'button';
+  but.value = 'Browse'; 
+  but.onclick = function() { picker.popup_picker(); }
+     
+  field.parentNode.insertBefore(but,field.nextSibling);
+  field.size = '20';
+  field.style.textAlign = 'right';
+};
+
+ImagePicker.prototype.backend             = _editor_url + 'plugins/ImageManager/backend.php?__plugin=ImageManager&';
+ImagePicker.prototype.backend_data        = null;
+
+ImagePicker.prototype.popup_picker = function()
+{
+  var picker = this; // closure for later  
+  var outparam = null;
+  if(picker.field.value)
+  {
+    outparam =
+		{      
+			f_url    : picker.field.value,			
+			f_width  : null,
+			f_height  : null,
+     
+      // None of this stuff is useful to us, we return only a URL.
+      f_alt    : picker.field.value,
+			f_border : null,
+			f_align  : null,
+			f_padding: null,
+			f_margin : null,
+      f_backgroundColor: null,
+      f_borderColor: null,
+      f_border : null,
+      f_padding: null,
+      f_margin: null
+    };
+  }
+
+  var manager = this.backend + '__function=manager';
+  if(this.backend_config != null)
+  {
+    manager += '&backend_config='
+      + encodeURIComponent(this.backend_config);
+    manager += '&backend_config_hash='
+      + encodeURIComponent(this.backend_config_hash);
+    manager += '&backend_config_secret_key_location='
+      + encodeURIComponent(this.backend_config_secret_key_location);
+  }
+  
+  if(this.backend_data != null)
+  {
+    for ( var i in this.backend_data )
+    {
+      manager += '&' + i + '=' + encodeURIComponent(this.backend_data[i]);
+    }
+  }
+
+  Dialog(manager, function(param) {
+		if (!param) {	// user must have pressed Cancel
+			return false;
+		}
+    picker.field.value = param.f_url;
+		}, outparam);
+}
+
+// Dialog is part of Xinha, but we'll provide it here incase Xinha's not being
+// loaded.
+if(typeof Dialog == 'undefined')
+{
+  // htmlArea 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 183 2005-05-20 06:11:44Z gogo $
+  
+  // 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
+    }
+    var dlg = window.open(url, "hadialog",
+              "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+              "scrollbars=yes,resizable=yes,modal=yes,dependable=yes");
+    Dialog._modal = dlg;
+    Dialog._arguments = init;
+
+    // make up a function to be called when the Dialog ends.
+    Dialog._return = function (val) 
+    {
+      if (val && action) {
+        action(val);
+      }
+
+      Dialog._modal = null;
+    };
+    Dialog._modal.focus();
+  };
+     
+  // 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;
+ 
+}
+
+// Deprecated method for passing config, use above instead!
+//---------------------------------------------------------
+ImagePicker.prototype.backend_config      = null;
+ImagePicker.prototype.backend_config_hash = null;
+ImagePicker.prototype.backend_config_secret_key_location = 'Xinha:ImageManager';
+//---------------------------------------------------------
Index: /branches/new-dialogs-merge/plugins/ImageManager/resizer.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/resizer.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/resizer.php (revision 999)
@@ -0,0 +1,83 @@
+<?php
+header('Content-Type: text/javascript; charset=UTF-8');
+
+/**
+ * Resize images to a given size, and saving in a new file.
+ * resize.php?img=/relative/path/to/image.jpg&width=<pixels>&height=<pixels>[&to=/relative/path/to/newimage.jpg]
+ * relative to the base_dir given in config.inc.php
+ * This is pretty much just thumbs.php with some mods, I'm too lazy to do it properly
+ * @author $Author:ray $
+ * @version $Id:resizer.php 922 2007-12-30 14:35:46Z ray $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/Thumbnail.php');
+
+function js_fail($message)    { echo 'alert(\'' . $message . '\'); false'; exit;   }
+function js_success($resultFile)    { echo '\'' . $resultFile . '\''; exit;   }
+
+//check for img parameter in the url
+if(!isset($_GET['img']) || !isset($_GET['width']) || !isset($_GET['height']))
+{
+  js_fail('Missing parameter.');
+}
+
+$manager = new ImageManager($IMConfig);
+
+//get the image and the full path to the image
+$image = $_GET['img'];
+$fullpath = Files::makeFile($manager->getImagesDir(),$image);
+
+//not a file, so exit
+if(!is_file($fullpath))
+{
+  js_fail("File {$fullpath} does not exist.");
+}
+
+$imgInfo = @getImageSize($fullpath);
+
+//Not an image, bail out.
+if(!is_array($imgInfo))
+{
+	js_fail("File {$fullpath} is not an image.");
+}
+
+if(!isset($_GET['to']))
+{
+  $resized    = $manager->getResizedName($fullpath,$_GET['width'],$_GET['height']);
+  $_GET['to'] = $manager->getResizedName($image,$_GET['width'],$_GET['height'], FALSE);
+}
+else
+{
+  $resized = Files::makeFile($manager->getImagesDir(),$_GET['to']);
+}
+
+// Check to see if it already exists
+if(is_file($resized))
+{
+	// And is newer
+	if(filemtime($resized) >= filemtime($fullpath))
+	{
+		js_success($_GET['to']);
+	}
+}
+
+
+
+// resize (thumbnailer will do this for us just fine)
+$thumbnailer = new Thumbnail($_GET['width'],$_GET['height']);
+$thumbnailer->proportional = FALSE;
+$thumbnailer->createThumbnail($fullpath, $resized);
+
+// did it work?
+if(is_file($resized))
+{
+	js_success($_GET['to']);
+}
+else
+{
+	js_fail("Resize Failed.");
+}
+?>
Index: /branches/new-dialogs-merge/plugins/ImageManager/README.txt
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/README.txt (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/README.txt (revision 677)
@@ -0,0 +1,150 @@
+Originally Developed by: http://www.zhuo.org/htmlarea/
+
+> This is a plug-in for HTMLArea 3.0
+> 
+> The PHP ImageManager + Editor provides an interface to 
+> browser for image files on your web server. The Editor
+> allows some basic image manipulations such as, cropping,
+> rotation, flip, and scaling.
+> 
+> Further and up-to-date documentation can be found at
+> http://www.zhuo.org/htmlarea/docs/index.html
+> 
+> Cheer,
+> Wei
+
+2005-03-20 
+  by Yermo Lamers of DTLink, LLC (http://www.formvista.com/contact.html)
+
+Please post questions/comments/flames about this plugin in the Xinha forums
+at 
+
+   http://xinha.gogo.co.nz/punbb/viewforum.php?id=1
+
+------------------------------------------------------------------------------
+If you have GD installed and configured in PHP this should work out of the 
+box. 
+
+For production use see config.inc.php for configuration values. You will 
+want to adjust images_dir and images_url for your application.
+
+For demo purposes ImageManager is set up to view images in the
+
+   /xinha/plugins/ImageManager/demo_images
+
+directory. This is governed by the images_dir and images_url config options.
+
+The permissions on the demo_images directory may not be correct. The directory
+should be owned by the user your webserver runs as and should have 755 
+permissions.
+
+--------------------------------------------------------------------------------
+
+By  default this ImageManager is set up to browse some graphics
+in plugins/ImageManager/demo_images.
+
+For  security reasons image uploading is turned off by default.
+You can enable it by editing config.inc.php.
+
+---------------------------------
+For Developers
+---------------------------------
+
+CHANGES FROM Wei's Original Code:
+
+Single Backend:								 
+---------------
+
+All  requests  from  the javascript code back to the server now
+are  routed  through  a  single  configurable  backend  script,
+backend.php.
+
+Request URLs are of the form:
+
+ <config backend URL>(?|&)__plugin=ImageManager&__function=<function>&arg=value&arg=value
+
+The default URL is plugins/xinha/backend.php.
+
+This  approach  makes  it  possible  to  completely replace the
+backend  with  a  perl  or ASP implementation without having to
+change any of the client side code.
+
+You  can  override  the  location  and  name of the backend.php
+script by setting the config.ImageManager.backend property from
+the  calling  page. Make sure the URL ends in an "&". The code,
+for now, assumes it can just tack on variables.
+
+For  the moment the javascript files in the assets directory do
+not  have access to the main editor object and as a result have
+not  access to the config. For the moment we use a _backend_url
+variable  output  from  PHP  to communicate the location of the
+backend  to  these  assets.  It's  a  kludge. Ideally all these
+config  values  should  be  set  from  the  calling page and be
+available through the editor.config.ImageManager object.
+
+Debug Messages
+---------------
+
+The  php files include a simple debugging library, ddt.php. See
+config.inc.php  for  how  to  turn  it on. It can display trace
+messages to the browser or dump them to a log file.
+
+I'll  try  to  package  up  the client-side tracing-to-textarea
+_ddt()  functions  I've  put  together.  Having a trace message
+infrastructure has always served me well.
+
+-------------
+Flakey Editor
+-------------
+
+The  editor  I  use  is  flakey  (but  very  very fast). It has
+problems with tab to space conversion so if the indenting looks
+weird that's why.
+
+----
+TODO
+----
+
+ImageManager really needs a complete rewrite. 
+
+. ImageManager should appear in a pane instead of a popup
+  window using Sleeman's windowpane support.
+
+.  html  and  php code are intermixed. It would be very nice to
+use  some  kind  of templating for the dialogs; this templating
+should be done long hand so it can be re-used regardless of the
+backend implementation language.
+
+.  the  config  should  probably  be  some format that would be
+easily  read  by  multiple  implementations of the back end. It
+would  be nice to have a single configuration system regardless
+of whether the backend is PHP, Perl or ASP.
+
+.  javascript assets are not objects. Passing config options to
+the  assets  functions requires intermediate variables which is
+really  ugly.  Everything should be cleanly integrated into the
+object heirarchy akin to the way Linker is done.
+
+.  if  an  image is selected from the document editor window it
+should  be  focused  and  highlighted  in  the  image selection
+window.
+
+. fix fully-qualified url in image selection box under MSIE.
+
+. per-image permissions. We should include some kind of backend
+permissions      management      so      users     can     only
+delete/edit/move/rename images that they have uploaded.
+
+. add a CANCEL button and a SAVE AS button to the editor.
+
+.  add  a  list view akin to EFM. (and include image properties
+width/height/depth/etc.)
+
+.  figure  out  a way for ImageManager to work "out of the box"
+regardless of install.
+
+. client-side tracing.
+
+. fancy stuff like adding a UI to define rollovers, animations,
+etc.
+
Index: /branches/new-dialogs-merge/plugins/ImageManager/editor.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/editor.php (revision 999)
+++ /branches/new-dialogs-merge/plugins/ImageManager/editor.php (revision 999)
@@ -0,0 +1,149 @@
+<?php 
+/**
+ * The PHP Image Editor user interface.
+ * @author $Author:ray $
+ * @version $Id:editor.php 987 2008-04-12 12:39:04Z ray $
+ * @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);
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+	<title></title>
+<script type="text/javascript">
+_backend_url = "<?php print $IMConfig['backend_url']; ?>";
+</script>
+	<link href="<?php print $IMConfig['base_url'];?>assets/editor.css" rel="stylesheet" type="text/css" />	
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/slider.js"></script>
+<script type="text/javascript" src="../../popups/popup.js"></script>
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+	window.resizeTo(673, 531);
+
+	if(window.opener)
+		HTMLArea = window.opener.HTMLArea;
+/*]]>*/
+</script>
+<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editor.js"></script>
+</head>
+
+<body>
+<div id="indicator">
+<img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" id="indicator_image" height="20" width="20" alt="" />
+</div>
+<div id="tools">
+	<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="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
+		</div>	
+		<a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+		<a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>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="<?php print $IMConfig['base_url'];?>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="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
+		</div>	
+		<a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+		<a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>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="selected">Flip Image</option>
+              <option>-----------------</option>
+              <option value="hoz">Flip Horizontal</option>
+              <option value="ver">Flip Vertical</option>
+         </select>
+			<select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;">
+              <option selected="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" />
+			<img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
+		</div>	
+		<a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+		<a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>		
+	</div>		
+	<div id="tools_measure" style="display:none;">
+		<div id="tool_inputs">
+			<label>X:</label><input type="text" class="measureStats" id="sx" />
+			<label>Y:</label><input type="text" class="measureStats" id="sy" />
+			<img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
+			<label>W:</label><input type="text" class="measureStats" id="mw" />
+			<label>H:</label><input type="text" class="measureStats" id="mh" />
+			<img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
+			<label>A:</label><input type="text" class="measureStats" id="ma" />		
+			<label>D:</label><input type="text" class="measureStats" id="md" />		
+			<img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
+			<button type="button" onclick="editor.reset();" >Clear</button>
+		</div>	
+	</div>
+	<div id="tools_save" style="display:none;">
+		<div id="tool_inputs">
+			<label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php echo $editor->getDefaultSaveFile();?>"/>
+			<select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)">
+            <option value="" selected="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>
+            <option value="png">PNG</option>
+			<?php if($editor->isGDGIFAble() != -1) { ?>
+            <option value="gif">GIF</option>
+			<?php } ?>
+         </select>
+			<label>Quality:</label>
+			<table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
+				<tr>
+				<td>
+					<div id="slidercasing"> 
+				<div id="slidertrack" style="width:100px"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track" /></div>
+            <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track" /></div>
+			</div>	
+				</td>
+				</tr>
+			</table>				
+			<input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/>
+			<img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" />
+		</div>	
+		<a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+		<a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>		
+	</div>	
+</div>
+<div id="toolbar">
+<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="<?php print $IMConfig['base_url'];?>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="<?php print $IMConfig['base_url'];?>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="<?php print $IMConfig['base_url'];?>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="<?php print $IMConfig['base_url'];?>img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a>
+<a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="<?php print $IMConfig['base_url'];?>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="<?php print $IMConfig['base_url'];?>img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a>
+</div>
+<div id="contents">
+<iframe src="<?php print $IMConfig['backend_url']; ?>__function=editorFrame&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>
Index: /branches/new-dialogs-merge/plugins/ImageManager/backend.php
===================================================================
--- /branches/new-dialogs-merge/plugins/ImageManager/backend.php (revision 677)
+++ /branches/new-dialogs-merge/plugins/ImageManager/backend.php (revision 677)
@@ -0,0 +1,155 @@
+<?php 
+/**
+* Unified backend for ImageManager 
+*
+* Image Manager was originally developed by:
+*   Xiang Wei Zhuo, email: xiangweizhuo(at)hotmail.com Wei Shou.
+*
+* Unified backend sponsored by DTLink Software, http://www.dtlink.com
+* Implementation by Yermo Lamers, http://www.formvista.com
+*
+* (c) DTLink, LLC 2005.
+* Distributed under the same terms as HTMLArea itself.
+* This notice MUST stay intact for use (see license.txt).
+*
+* DESCRIPTION:
+*
+* Instead of using separate URL's for each function, ImageManager now
+* routes all requests to the server through this single, replaceable,
+* entry point. backend.php expects at least two URL variable parameters: 
+*
+* __plugin=ImageManager   for future expansion; identify the plugin being requested.
+* __function=thumbs|images|editorFrame|editor|manager  function being called.
+*
+* Having a single entry point that strictly adheres to a defined interface will 
+* make the backend code much easier to maintain and expand. It will make it easier
+* on integrators, not to mention it'll make it easier to have separate 
+* implementations of the backend in different languages (Perl, Python, ASP, etc.) 
+*
+* @see config.inc.php
+*/
+
+// Strip slashes if MQGPC is on
+set_magic_quotes_runtime(0);
+if(get_magic_quotes_gpc())
+{
+  $to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);
+  while(count($to_clean))
+  {
+    $cleaning =& $to_clean[array_pop($junk = array_keys($to_clean))];
+    unset($to_clean[array_pop($junk = array_keys($to_clean))]);
+    foreach(array_keys($cleaning) as $k)
+    {
+      if(is_array($cleaning[$k]))
+      {
+        $to_clean[] =& $cleaning[$k];
+      }
+      else
+      {
+        $cleaning[$k] = stripslashes($cleaning[$k]);
+      }
+    }
+  }
+}
+
+/**
+* ImageManager configuration
+*/
+
+require_once('config.inc.php');
+
+/**
+* debug message library
+*/
+
+include_once( "ddt.php" );
+
+// uncomment to turn on debugging
+// _ddtOn();
+
+_ddt( __FILE__, __LINE__, "backend.php: top with query '" . $_SERVER["PHP_SELF"] . "' string '" . $_SERVER["QUERY_STRING"] . "'" );
+
+$formVars = empty($_POST) ? $_GET : $_POST;
+
+// make sure the request is for us (this gives us the ability to eventually organize
+// a backend event handler system) For an include file the return doesn't make alot of
+// sense but eventually we'll want to turn all of this into at least functions 
+// separating out all the presentation HTML from the logic. (Right now all the HTML
+// used by ImageManager is in the same files as the PHP code ...)
+
+if ( @$formVars[ "__plugin" ] != "ImageManager" )
+	{
+	// not for us.
+
+	_ddt( __FILE__, __LINE__, "request was not for us" );
+
+	return true;
+	}
+
+// so we don't have to re-engineer the entire thing right now, since it's probably
+// going to get rewritten anyway, we just include the correct file based on the 
+// function request.
+
+_ddt( __FILE__, __LINE__, "backend.php(): handling function '" . $formVars[ "__function" ] . "' base_dir is '" . $IMConfig["base_dir"] . "'" );
+
+switch ( @$formVars[ "__function" ] )
+	{
+
+	case "editor": 
+
+		include_once( $IMConfig['base_dir'] . "/editor.php" );
+		exit();
+		
+		break;
+
+	case "editorFrame":
+
+		include_once( $IMConfig['base_dir'] . "/editorFrame.php" );
+		exit();
+
+		break;
+
+	case "manager":
+
+		_ddt( __FILE__, __LINE__, "including '" . $IMConfig['base_dir'] . "/manager.php" );
+
+		include_once( $IMConfig['base_dir'] . "/manager.php" );
+		exit();
+
+		break;
+
+	case "images":
+
+		include_once( $IMConfig['base_dir'] . "/images.php" );
+		exit();
+
+		break;
+
+	case "thumbs":
+
+		include_once( $IMConfig['base_dir'] . "/thumbs.php" );
+		exit();
+
+		break;
+
+	case "resizer":
+
+		include_once( $IMConfig['base_dir'] . "/resizer.php" );
+		exit();
+
+		break;
+
+	default:
+
+		_ddt( __FILE__, __LINE__, "function request not supported" );
+		_error( __FILE__, __LINE__, "function request not supported" );
+
+		break;
+
+	}	// end of switch.
+
+return false ;
+
+// END
+
+?>
Index: /branches/new-dialogs-merge/plugins/DoubleClick/double-click.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DoubleClick/double-click.js (revision 848)
+++ /branches/new-dialogs-merge/plugins/DoubleClick/double-click.js (revision 848)
@@ -0,0 +1,66 @@
+// Double Click Plugin for Xinha
+// Implementation by Marijn Kampf http://www.marijn.org
+// Sponsored by http://www.smiling-faces.com
+//
+// (c) Marijn Kampf 2004.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// Cut-n-paste version of double click plugin.
+// Almost no original code used. Based on
+// Luis HTMLarea and Mihai Bazon Context Menu
+//
+//
+//
+
+DoubleClick._pluginInfo = {
+  name          : "DoubleClick",
+  version       : "1.0",
+  developer     : "Marijn Kampf",
+  developer_url : "http://www.marijn.org",
+  c_owner       : "Marijn Kampf",
+  sponsor       : "smiling-faces.com",
+  sponsor_url   : "http://www.smiling-faces.com",
+  license       : "htmlArea"
+};
+
+function DoubleClick(editor) {
+  this.editor = editor;
+
+  // ADDING CUSTOM DOUBLE CLICK ACTIONS
+  // format of the dblClickList elements is "TAGNAME: [ ACTION ]"
+  //    - TAGNAME: tagname of the tag that is double clicked
+  //    - ACTION: function that gets called when the button is clicked.
+  //              it has the following prototype:
+  //                 function(editor, event)
+  //              - editor is the Xinha object that triggered the call
+  //              - target is the selected object
+  this.editor.dblClickList = {
+    // Edit Link dialog
+    a: [ function(e) {e.config.btnList['createlink'][3](e); } ],
+    // Follow link
+    //a: [ function(editor, target) { window.location = target.href; properties(target); } ],
+
+    img: [ function(e) {e.execCommand("insertimage");} ],
+    td: [ function(e) {e.execCommand("inserttable");} ]
+  };
+}
+
+DoubleClick.prototype.onGenerate = function() {
+  var self = this;
+  var doc = this.editordoc = this.editor._iframe.contentWindow.document;
+  Xinha._addEvents(doc, ["dblclick"],
+          function (event) {
+          return self.onDoubleClick(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event);
+          });
+  this.currentClick = null;
+};
+
+DoubleClick.prototype.onDoubleClick = function(ev) {
+  var target = Xinha.is_ie ? ev.srcElement : ev.target;
+  var tagName = target.tagName.toLowerCase();
+
+  if (this.editor.dblClickList[tagName] != undefined) {
+    this.editor.dblClickList[tagName][0](this.editor, target);
+  }
+};
Index: /branches/new-dialogs-merge/plugins/HorizontalRule/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HorizontalRule/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/HorizontalRule/lang/pt_br.js (revision 901)
@@ -0,0 +1,34 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Alignment:": "Alinhamento:",
+  "Cancel": "Cancelar",
+  "Center": "Centralizar",
+  "Color:": "Côr:",
+  "Height:": "Alturar:",
+  "Horizontal Rule": "Linha Horizontal",
+  "Insert/Edit Horizontal Rule": "Inserir/Editar Linha Horizontal",
+  "Insert/edit horizontal rule": "Inserir/editar linha horizontal",
+  "Layout": "Esquema",
+  "Left": "Esquerda",
+  "No shading": "Sem sombra",
+  "OK": "OK",
+  "Right": "Direita",
+  "Style": "Estilo",
+  "Width:": "Largura:",
+  "percent": "porcentagem",
+  "pixels": "pixels"
+}
Index: /branches/new-dialogs-merge/plugins/HorizontalRule/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HorizontalRule/lang/fr.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/HorizontalRule/lang/fr.js (revision 677)
@@ -0,0 +1,20 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Insert/edit horizontal rule": "InsÃ©rer une rÃšgle horizontale",
+  "Horizontal Rule": "RÃšgle horizontale",
+  "Layout": "Layout",
+  "Width:": "Largeur",
+  "percent": "pourcent",
+  "pixels": "pixels",
+  "Height:": "Hauteur",
+  "Alignment:": "Alignement",
+  "Left": "Gauche",
+  "Center": "Centre",
+  "Right": "Droite",
+  "Style": "Style",
+  "Color:": "Couleur",
+  "No shading": "Pas d'ombre",
+  "Note:": "Note",
+  "To select an existing horizontal rule, a double-click may be needed.": "Pour sÃ©lectionner une rÃšgle horizontale, un double-clic peut Ãªtre nÃ©cessaire."
+};
Index: /branches/new-dialogs-merge/plugins/HorizontalRule/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HorizontalRule/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/HorizontalRule/lang/de.js (revision 677)
@@ -0,0 +1,21 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de
+{
+  "Insert/edit horizontal rule": "horizontale Linie einfÃŒgen/bearbeiten",
+  "Horizontal Rule": "Horizontale Linie",
+  "Layout": "Gestaltung",
+  "Width:": "Breite:",
+  "percent": "Prozent",
+  "pixels": "Pixel",
+  "Height:": "HÃ¶he:",
+  "Alignment:": "Ausrichtung:",
+  "Left": "links",
+  "Center": "zentriert",
+  "Right": "rechts",
+  "Style": "Stil",
+  "Color:": "Farbe",
+  "No shading": "keine Schattierung",
+  "Note:": "Anmerkung",
+  "To select an existing horizontal rule, a double-click may be needed.": "Um eine horizontale Linie auszuwÃ€hlen kann ein Doppelklick erforderlich sein."
+};
Index: /branches/new-dialogs-merge/plugins/HorizontalRule/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HorizontalRule/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/HorizontalRule/lang/nl.js (revision 872)
@@ -0,0 +1,21 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "Insert/edit horizontal rule": "Horizontale lijn invoegen/bewerken",
+  "Horizontal Rule": "Horizontale lijn",
+  "Layout": "Weergave",
+  "Width:": "Breedte:",
+  "percent": "procent",
+  "pixels": "pixels",
+  "Height:": "Hoogte:",
+  "Alignment:": "Uitvulling:",
+  "Left": "Links",
+  "Center": "Midden",
+  "Right": "Rechts",
+  "Style": "Style",
+  "Color:": "kleur",
+  "No shading": "Geen schaduw",
+  "Note:": "Notitie",
+  "To select an existing horizontal rule, a double-click may be needed.": "Om een bestaande horizontale lijn te selecteren moet je mogelijk dubbel klikken."
+};
Index: /branches/new-dialogs-merge/plugins/HorizontalRule/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HorizontalRule/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/HorizontalRule/lang/ja.js (revision 715)
@@ -0,0 +1,24 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+// This string is for auto detection of multi-encoding editor : åœéåæå­æ€åºçšæå­å
+{
+  "Insert/edit horizontal rule": "æ°Žå¹³ç·ã®æ¿å
+¥/ä¿®æ­£",
+  "Horizontal Rule": "æ°Žå¹³ç·",
+  "Layout": "ã¬ã€ã¢ãŠã",
+  "Width:": "å¹
+:",
+  "percent": "ããŒã»ã³ã",
+  "pixels": "ãã¯ã»ã«",
+  "Height:": "é«ã:",
+  "Alignment:": "è¡æã:",
+  "Left": "å·Š",
+  "Center": "äž­å€®",
+  "Right": "å³",
+  "Style": "ã¹ã¿ã€ã«",
+  "Color:": "è²:",
+  "No shading": "åœ±ä»ããªã",
+  "Note:": "åè",
+  "To select an existing horizontal rule, a double-click may be needed.":"æ¢å­ã®æ°Žå¹³ç·ãéžæããã«ã¯DoubleClickãå¿
+èŠã"
+};
Index: /branches/new-dialogs-merge/plugins/HorizontalRule/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HorizontalRule/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/HorizontalRule/lang/nb.js (revision 677)
@@ -0,0 +1,21 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Insert/edit horizontal rule": "Sett inn/ rediger horisontal linje",
+  "Horizontal Rule": "Horisontal linje",
+  "Layout": "Oppsett",
+  "Width:": "Bredde:",
+  "percent": "prosent",
+  "pixels": "Piksel",
+  "Height:": "HÃžyde:",
+  "Alignment:": "Justering:",
+  "Left": "Venstre",
+  "Center": "Sentrert",
+  "Right": "HÃžyre",
+  "Style": "Stil",
+  "Color:": "Farge",
+  "No shading": "Ingen skygge",
+  "Note:": "Notat",
+  "To select an existing horizontal rule, a double-click may be needed.": "For Ã¥ velge en horisontal linje kan det hende du mÃ¥ dobbeltklikke."
+};
Index: /branches/new-dialogs-merge/plugins/HorizontalRule/popups/edit_horizontal_rule.html
===================================================================
--- /branches/new-dialogs-merge/plugins/HorizontalRule/popups/edit_horizontal_rule.html (revision 726)
+++ /branches/new-dialogs-merge/plugins/HorizontalRule/popups/edit_horizontal_rule.html (revision 726)
@@ -0,0 +1,141 @@
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Insert/Edit Horizontal Rule</title>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+  <script type="text/javascript" src="../../../modules/ColorPicker/ColorPicker.js"></script>
+<script type="text/javascript">
+editor = window.opener.editor;
+
+function Init() {
+	__dlg_translate("HorizontalRule");
+	__dlg_init(null,{width:320,height:290});
+	var params = window.dialogArguments;
+	if(params) {
+		document.getElementById("f_size").value = params.f_size;
+		document.getElementById("f_width").value = params.f_width;
+		document.getElementById("f_widthUnit").value = params.f_widthUnit;
+		document.getElementById("f_align").value = params.f_align;
+		document.getElementById("f_color").value = params.f_color;
+		document.getElementById("hrpv").style.backgroundColor = params.f_color;
+		document.getElementById("f_noshade").checked = params.f_noshade;
+	}
+	
+	var colpick = document.getElementById('hrpv');
+	var f_color = document.getElementById('f_color');
+	var colPicker = new Xinha.colorPicker({cellsize:'5px',callback:selectColor});
+	colpick.onclick = function() { colPicker.open('top,left',colpick, f_color.value ); }
+	
+	document.getElementById("f_width").focus();
+}
+
+function onOK() {
+  var fields = ["f_size", "f_width", "f_widthUnit", "f_align", "f_color", "f_noshade"];
+  var param = {};
+  for (var i in fields) {
+    var id = fields[i];
+	var el = document.getElementById(id);
+    param[id] = (el.type == "checkbox") ? el.checked : el.value;
+  }
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+function selectColor(color) {
+	document.getElementById('hrpv').style.backgroundColor = color;
+	document.getElementById('f_color').value = color;
+}
+window.onload = Init;
+</script>
+
+<style type="text/css">
+.buttonColor {
+  padding: 1px;
+  cursor: default;
+  border: 1px solid;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.buttonColor-hilite {
+  border-color: #000;
+}
+
+.buttonColor .chooser {
+  height: 0.6em;
+  border: 1px solid;
+  padding: 0px 1em;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+
+.buttonColor .nocolor {
+  padding: 0px;
+  height: 0.6em;
+  border: 1px solid;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+.buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
+</style>
+
+</head>
+
+<body class="dialog">
+<div class="title">Horizontal Rule</div>
+<form action="" method="get">
+  <fieldset>
+  <legend>Layout</legend>
+    <div class="fr">Width:</div>
+    <input style="margin-right: 0.5em;" name="f_width" id="f_width" size="5" type="text" />
+    <select style="margin-right: 0.5em;" name="f_widthUnit" id="f_widthUnit">
+      <option value="%">percent</option>
+      <option value="px">pixels</option>
+    </select>
+	<br />
+    <div class="fr">Height:</div>
+    <input style="margin-right: 0.5em;" name="f_size" id="f_size" size="5" type="text" /> <span>pixels</span>
+	<br />
+    <div class="fr">Alignment:</div>
+    <select name="f_align" id="f_align">
+      <option value="left">Left</option>
+      <option value="center">Center</option>
+      <option value="right">Right</option>
+    </select>
+
+  </fieldset>
+  <fieldset>
+  <legend>Style</legend>
+    <div class="fr">Color:</div>
+    <table cellpadding="2" cellspacing="0" id="hrbtn" class="buttonColor">
+    <tr>
+      <td class="chooser" id="hrpv"
+          onmouseover="document.getElementById('hrbtn').style.borderColor='black'"
+          onmouseout="document.getElementById('hrbtn').style.borderColor='ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight'"
+          >&nbsp;</td>
+      <td class="nocolor" id="hrclr"
+          onmouseover="document.getElementById('hrclr').style.color='#f00'"
+          onmouseout="document.getElementById('hrclr').style.color='#000'"
+          onclick="document.getElementById('f_color').value='';	document.getElementById('hrpv').style.backgroundColor=''">&#x00d7;</td>
+    </tr>
+    </table>
+    <br />
+    <div class="fr"> </div>
+    <input type="hidden" name="f_color" id="f_color" />
+    <input type="checkbox" name="f_noshade" id="f_noshade" value="noshade" />
+    <span>No shading</span>
+    <br />
+  </fieldset>
+<div id="buttons">
+  <button type="submit" name="ok" onclick="return onOK();">OK</button>
+  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/HorizontalRule/horizontal-rule.js
===================================================================
--- /branches/new-dialogs-merge/plugins/HorizontalRule/horizontal-rule.js (revision 726)
+++ /branches/new-dialogs-merge/plugins/HorizontalRule/horizontal-rule.js (revision 726)
@@ -0,0 +1,163 @@
+
+HorizontalRule._pluginInfo = {
+	name          : "HorizontalRule",
+	version       : "1.0",
+	developer     : "Nelson Bright",
+	developer_url : "http://www.brightworkweb.com/",
+	c_owner       : "Nelson Bright",
+	sponsor       : "BrightWork, Inc.",
+	sponsor_url   : "http://www.brightworkweb.com/",
+	license       : "htmlArea"
+};
+
+function HorizontalRule(editor) {
+    this.editor = editor;
+
+    var cfg = editor.config;
+	var toolbar = cfg.toolbar;
+	var self = this;
+        
+	cfg.registerButton({
+		id       : "edithorizontalrule",
+		tooltip  : this._lc("Insert/edit horizontal rule"),
+	//	image    : editor.imgURL("ed_hr.gif", "HorizontalRule"),
+		image    : [_editor_url + "images/ed_buttons_main.gif",6,0],
+		textMode : false,
+		action   : function(editor) {
+						self.buttonPress(editor);
+				   }
+	});
+
+	cfg.addToolbarElement("edithorizontalrule","inserthorizontalrule",0);
+}
+
+HorizontalRule.prototype._lc = function(string) {
+    return  Xinha._lc(string, 'HorizontalRule');
+};
+
+HorizontalRule.prototype.buttonPress = function(editor) {
+	this.editor = editor;
+	this._editHorizontalRule();
+};
+
+HorizontalRule.prototype._editHorizontalRule = function(rule) {
+	editor = this.editor;
+	var sel = editor._getSelection();
+	var range = editor._createRange(sel);
+	var outparam = null;
+	if (typeof rule == "undefined") {
+		rule = editor.getParentElement();
+		if (rule && !/^hr$/i.test(rule.tagName))
+			rule = null;
+	}
+	if (rule) {
+		var f_widthValue    = rule.style.width || rule.width;
+		outparam = {
+			f_size      : parseInt(rule.style.height,10) || rule.size,
+			f_widthUnit : (/(%|px)$/.test(f_widthValue)) ? RegExp.$1 : 'px',
+			f_width     : parseInt (f_widthValue,10),
+			f_color     : Xinha._colorToRgb(rule.style.backgroundColor) || rule.color,
+			f_align     : rule.style.textAlign || rule.align,
+			f_noshade   : (parseInt(rule.style.borderWidth,10) == 0) || rule.noShade
+		};
+	}
+	editor._popupDialog("plugin://HorizontalRule/edit_horizontal_rule.html", function(param) {
+		if (!param) {	// user pressed Cancel
+			return false;
+		}
+		var hr = rule;
+		if (!hr) {
+			var hrule = editor._doc.createElement("hr");
+			for (var field in param) {
+				var value = param[field];
+				if(value == "") continue;
+				switch (field) { 
+				case "f_width" :
+					if(param["f_widthUnit"]=="%")
+					{
+						hrule.style.width = value + "%";
+					}
+					else
+					{
+						hrule.style.width = value + "px";
+					}
+				break;
+				case "f_size" :
+					hrule.style.height = value + "px"; 
+				break;
+				case "f_align" : // Gecko needs the margins for alignment
+					hrule.style.textAlign = value;
+					switch (value) {
+						case 'left':
+							hrule.style.marginLeft = "0";
+						break;
+						case 'right':
+							hrule.style.marginRight = "0";
+						break;
+						case 'center':
+							hrule.style.marginLeft = "auto";
+							hrule.style.marginRight = "auto";
+						break;
+					}
+				break;
+				case "f_color" :
+					hrule.style.backgroundColor = value; 
+				break;
+				case "f_noshade" :
+					hrule.style.border = "0"; 
+				break;
+				}
+			}
+			if ( Xinha.is_gecko )
+			{   // If I use editor.insertNodeAtSelection(hrule) here I get get a </hr> closing tag
+				editor.execCommand("inserthtml",false,Xinha.getOuterHTML(hrule));
+			}
+			else editor.insertNodeAtSelection(hrule);
+			
+		} else {
+			for (var field in param) {
+			  var value = param[field];
+			  switch (field) {
+				case "f_width" :
+					if(param["f_widthUnit"]=="%")
+					{
+						hr.style.width = value + "%";
+					}
+					else
+					{
+						hr.style.width = value + "px";
+					}
+				break;
+				case "f_size" :
+					hr.style.height = value + "px"; 
+				break;
+				case "f_align" :
+					hr.style.textAlign = value;
+					switch (value) {
+						case 'left':
+							hr.style.marginLeft = "0";
+							hr.style.marginRight = null;
+						break;
+						case 'right':
+							hr.style.marginRight = "0";
+							hr.style.marginLeft = null;
+						break;
+						case 'center':
+							hr.style.marginLeft = "auto";
+							hr.style.marginRight = "auto";
+						break;
+					}
+				break;
+				case "f_color" :
+					hr.style.backgroundColor = value; 
+				break;
+				case "f_noshade" :
+					
+				break;
+			  }
+			  hr.style.border = (param["f_noshade"]) ? "0" : null; 
+			}
+		}
+	}, outparam);
+};
+	
Index: /branches/new-dialogs-merge/plugins/SaveSubmit/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SaveSubmit/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/SaveSubmit/lang/pt_br.js (revision 901)
@@ -0,0 +1,21 @@
+﻿// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt)
+{ 
+	"Save": "Salvar",
+	"Saving...": "Gravando...",
+	"in progress": "em processo",
+	"Ready": "Pronto"
+};
Index: /branches/new-dialogs-merge/plugins/SaveSubmit/lang/ru.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SaveSubmit/lang/ru.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/SaveSubmit/lang/ru.js (revision 677)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "ru", ENCODING: UTF-8
+// Simple job done by Alexey Kirpichnikov <alexkir at kiwistudio dot ru>
+{ 
+	"Save": "Ð¡ÐŸÑ
+ÑÐ°ÐœÐžÑÑ",
+	"Saving...": "Ð¡ÐŸÑ
+ÑÐ°ÐœÐµÐœÐžÐµ...",
+	"in progress": "Ð¿ÐŸÐ¶Ð°Ð»ÑÐ¹ÑÑÐ°, Ð¶ÐŽÐžÑÐµ",
+	"Ready": "ÐÐŸÑÐŸÐ²ÐŸ"
+};
Index: /branches/new-dialogs-merge/plugins/SaveSubmit/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SaveSubmit/lang/fr.js (revision 769)
+++ /branches/new-dialogs-merge/plugins/SaveSubmit/lang/fr.js (revision 769)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{ 
+	"Save": "Enregistrer",
+	"Saving...": "Enregistrement...",
+	"in progress": "en cours",
+	"Ready": "PrÃªt"
+};
Index: /branches/new-dialogs-merge/plugins/SaveSubmit/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SaveSubmit/lang/de.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/SaveSubmit/lang/de.js (revision 677)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+{ 
+	"Save": "Speichern",
+	"Saving...": "Speichern...",
+	"in progress": "in Arbeit",
+	"Ready": "Fertig"
+};
Index: /branches/new-dialogs-merge/plugins/SaveSubmit/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SaveSubmit/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/SaveSubmit/lang/nl.js (revision 872)
@@ -0,0 +1,9 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{ 
+	"Save": "Opslaan",
+	"Saving...": "Bezig met opslaan...",
+	"in progress": "bezig met opslaan...",
+	"Ready": "Klaar"
+};
Index: /branches/new-dialogs-merge/plugins/SaveSubmit/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SaveSubmit/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/SaveSubmit/lang/ja.js (revision 715)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+	"Save": "ä¿å­",
+	"Saving...": "ä¿å­äž­...",
+	"in progress": "åŠçäž­",
+	"Ready": "ã¬ãã£"
+};
Index: /branches/new-dialogs-merge/plugins/SaveSubmit/save-submit.js
===================================================================
--- /branches/new-dialogs-merge/plugins/SaveSubmit/save-submit.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/SaveSubmit/save-submit.js (revision 999)
@@ -0,0 +1,161 @@
+/*------------------------------------------*\
+SaveSubmit for Xinha
+____________________
+
+See README.txt for information
+
+\*------------------------------------------*/
+
+function SaveSubmit(editor) {
+	this.editor = editor;
+	this.changed = false;
+	var self = this;
+	var cfg = editor.config;
+	this.textarea = this.editor._textArea;
+
+	this.image_changed = Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_red.gif";
+	this.image_unchanged = Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_green.gif";
+	cfg.registerButton({
+	id       : "savesubmit",
+	tooltip  : self._lc("Save"),
+	image    : this.image_unchanged,
+	textMode : false,
+	action   :  function() {
+			self.save();
+		}
+	});
+	cfg.addToolbarElement("savesubmit", "popupeditor", -1);
+}
+
+SaveSubmit.prototype._lc = function(string) {
+    return Xinha._lc(string, 'SaveSubmit');
+}
+
+SaveSubmit._pluginInfo = {
+  name          : "SaveSubmit",
+  version       : "1.0",
+  developer     : "Raimund Meyer",
+  developer_url : "http://rheinauf.de",
+  c_owner       : "Raimund Meyer",
+  sponsor       : "",
+  sponsor_url   : "",
+  license       : "htmlArea"
+}
+
+SaveSubmit.prototype.onGenerateOnce = function() {
+	this.initial_html = this.editor.getInnerHTML();
+}
+
+SaveSubmit.prototype.onKeyPress = function(ev) {
+	if ( ev.ctrlKey && this.editor.getKey(ev) == 's') {
+			this.save(this.editor);
+			Xinha._stopEvent(ev);
+			return true;
+	}
+	else {
+		if (!this.changed) {
+			if (this.getChanged()) this.setChanged();
+			return false;
+		}
+	}
+}
+SaveSubmit.prototype.onExecCommand = function (cmd) {
+	if (this.changed && cmd == 'undo') { 
+		if (this.initial_html == this.editor.getInnerHTML()) this.setUnChanged();
+		return false;
+	}
+}
+SaveSubmit.prototype.onUpdateToolbar = function () {
+	if (!this.changed) {
+		if (this.getChanged()) this.setChanged();
+		return false;
+	}	
+}
+SaveSubmit.prototype.getChanged = function() {
+	if (this.initial_html === null) this.initial_html = this.editor.getInnerHTML();
+	if (this.initial_html != this.editor.getInnerHTML() && this.changed == false) {
+		this.changed = true;
+		return true;
+	}
+	else return false;
+}
+SaveSubmit.prototype.setChanged = function() {
+	this.editor._toolbarObjects.savesubmit.swapImage(this.image_changed);
+	this.editor.updateToolbar();
+}
+SaveSubmit.prototype.setUnChanged = function() {
+	this.changed = false;
+	this.editor._toolbarObjects.savesubmit.swapImage(this.image_unchanged);
+}
+SaveSubmit.prototype.changedReset = function() {
+	this.initial_html = null;
+	this.setUnChanged();
+}
+
+SaveSubmit.prototype.save =  function() {
+	this.buildMessage();
+	var editor = this.editor;
+	var self =this;
+	var form = editor._textArea.form;
+	form.onsubmit();
+
+	var name, value, content ='';
+	
+	for (var i=0;i<form.elements.length;i++)
+	{
+		if (( form.elements[i].type == 'checkbox' || form.elements[i].type == 'radio' ) && !form.elements[i].checked ) continue;
+
+		content += ((i>0) ? '&' : '') + form.elements[i].name + '=' + encodeURIComponent(form.elements[i].value);
+	}
+
+	Xinha._postback(editor._textArea.form.action, content, function(getback) {
+
+		if (getback) {
+			self.setMessage(getback);
+			//self.setMessage(self._lc("Ready"));
+			self.changedReset();
+		}
+		removeMessage = function() { self.removeMessage()} ;
+		window.setTimeout("removeMessage()",1000);
+	});
+}
+
+SaveSubmit.prototype.setMessage = function(string) {
+  var textarea = this.textarea;
+  if ( !document.getElementById("message_sub_" + textarea.id)) { return ; }
+  var elt = document.getElementById("message_sub_" + textarea.id);
+  elt.innerHTML = Xinha._lc(string, 'SaveSubmit');
+}
+
+SaveSubmit.prototype.removeMessage = function() {
+  var textarea = this.textarea;
+  if (!document.getElementById("message_" + textarea.id)) { return ; }
+  document.body.removeChild(document.getElementById("message_" + textarea.id));
+}
+
+//ripped mokhet's loading message function
+SaveSubmit.prototype.buildMessage   = function() {
+
+	var textarea = this.textarea;
+	var htmlarea = this.editor._htmlArea;
+	var loading_message = document.createElement("div");
+	loading_message.id = "message_" + textarea.id;
+	loading_message.className = "loading";
+	loading_message.style.width    = htmlarea.offsetWidth +'px' ;//(this.editor._iframe.offsetWidth != 0) ? this.editor._iframe.offsetWidth +'px' : this.editor._initial_ta_size.w;
+
+	loading_message.style.left     = Xinha.findPosX(htmlarea) +  'px';
+	loading_message.style.top      = (Xinha.findPosY(htmlarea) + parseInt(htmlarea.offsetHeight) / 2) - 50 +  'px';
+
+	var loading_main = document.createElement("div");
+	loading_main.className = "loading_main";
+	loading_main.id = "loading_main_" + textarea.id;
+	loading_main.appendChild(document.createTextNode(this._lc("Saving...")));
+
+	var loading_sub = document.createElement("div");
+	loading_sub.className = "loading_sub";
+	loading_sub.id = "message_sub_" + textarea.id;
+	loading_sub.appendChild(document.createTextNode(this._lc("in progress")));
+	loading_message.appendChild(loading_main);
+	loading_message.appendChild(loading_sub);
+	document.body.appendChild(loading_message);
+}
Index: /branches/new-dialogs-merge/plugins/SaveSubmit/README.txt
===================================================================
--- /branches/new-dialogs-merge/plugins/SaveSubmit/README.txt (revision 677)
+++ /branches/new-dialogs-merge/plugins/SaveSubmit/README.txt (revision 677)
@@ -0,0 +1,15 @@
+SaveSubmit for Xinha
+
+developed by Raimund Meyer (ray) xinha @ raimundmeyer.de
+
+Registers a button for submiting the Xinha form using asynchronous
+postback for sending the data to the server
+
+Usage: This should be a drop-in replacement for a normal submit button.
+While saving a message is displayed to inform the user what's going on.
+On successful transmission the output of the target script is shown, so it should print some information
+about the success of saving.
+
+ATTENTION: The data sent by this method is always UTF-8 encoded, regardless of the actual charset used. So, if you 
+are using a different encoding you have to convert on the server side.
+
Index: /branches/new-dialogs-merge/plugins/DefinitionList/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DefinitionList/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/DefinitionList/lang/pt_br.js (revision 901)
@@ -0,0 +1,20 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "definition list": "Lista de definição",
+  "definition term": "Termo de definição",
+  "definition description": "Descrição de definição"
+}
Index: /branches/new-dialogs-merge/plugins/DefinitionList/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DefinitionList/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/DefinitionList/lang/nl.js (revision 872)
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+{
+  "definition list": "definitie lijst",
+  "definition term": "definitie term",
+  "definition description": "definitie omschrijving
+}
Index: /branches/new-dialogs-merge/plugins/DefinitionList/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DefinitionList/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/DefinitionList/lang/ja.js (revision 715)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "definition list": "å®çŸ©ãªã¹ã",
+  "definition term": "å®çŸ©èª",
+  "definition description": "å®çŸ©ã®èª¬æ"
+}
Index: /branches/new-dialogs-merge/plugins/DefinitionList/definition-list.css
===================================================================
--- /branches/new-dialogs-merge/plugins/DefinitionList/definition-list.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/DefinitionList/definition-list.css (revision 677)
@@ -0,0 +1,21 @@
+dl { border: 1px dotted #800000; }
+dt {
+  width: 18px;
+  height: 18px;
+  background-image: url(img/ed_dt.gif);
+  background-repeat: no-repeat;
+  background-position: left top;
+  padding-left: 19px;
+  display: block;
+  color: #800000;
+}
+dd {
+  width: 18px;
+  height: 18px;
+  background-image: url(img/ed_dd.gif);
+  background-repeat: no-repeat;
+  background-position: left top;
+  padding-left: 19px;
+  display: block;
+  color: #800000;
+}
Index: /branches/new-dialogs-merge/plugins/DefinitionList/definition-list.js
===================================================================
--- /branches/new-dialogs-merge/plugins/DefinitionList/definition-list.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/DefinitionList/definition-list.js (revision 999)
@@ -0,0 +1,91 @@
+// DefinitionList plugin for Xinha
+// Distributed under the same terms as Xinha itself.
+// This notice MUST stay intact for use (see license.txt).
+
+
+function DefinitionList(editor) {
+  this.editor = editor;
+  var cfg = editor.config;
+  var bl = DefinitionList.btnList;
+  var self = this;
+  // register the toolbar buttons provided by this plugin
+  var toolbar = ["linebreak"];
+  for (var i = 0; i < bl.length; ++i) {
+    var btn = bl[i];
+    if (!btn) {
+      toolbar.push("separator");
+    } else {
+      var id = btn[0];
+      cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "DefinitionList"), false,
+             function(editor, id) {
+               // dispatch button press event
+               self.buttonPress(editor, id);
+             });
+      toolbar.push(id);
+    }
+  }
+  // add a new line in the toolbar
+  cfg.toolbar.push(toolbar);
+}
+
+DefinitionList._pluginInfo = {
+  name          : "DefinitionList",
+  version       : "1.0",
+  developer     : "Udo Schmal",
+  developer_url : "",
+  c_owner       : "Udo Schmal",
+  license       : "htmlArea"
+};
+
+// the list of buttons added by this plugin
+DefinitionList.btnList = [
+  ["dl", "definition list"],
+  ["dt", "definition term"],
+  ["dd", "definition description"]
+  ];
+
+DefinitionList.prototype._lc = function(string) {
+  return Xinha._lc(string, 'DefinitionList');
+};
+
+DefinitionList.prototype.onGenerate = function() {
+  this.editor.addEditorStylesheet(Xinha.getPluginDir('DefinitionList') + '/definition-list.css');
+};
+
+DefinitionList.prototype.buttonPress = function(editor,button_id) {
+  if (button_id=='dl') { //definition list
+    var pe = editor.getParentElement();
+    while (pe.parentNode.tagName.toLowerCase() != 'body') {
+      pe = pe.parentNode;
+    }
+    var dx = editor._doc.createElement(button_id);
+    dx.innerHTML = '&nbsp;';
+    if(pe.parentNode.lastChild==pe) {
+      pe.parentNode.appendChild(dx);
+    }else{
+      pe.parentNode.insertBefore(dx,pe.nextSibling);
+    }
+  } else if ((button_id=='dt')||(button_id=='dd')) { //definition term or description
+    var pe = editor.getParentElement();
+    while (pe && (pe.nodeType == 1) && (pe.tagName.toLowerCase() != 'body')) {
+      if(pe.tagName.toLowerCase() == 'dl') {
+        var dx = editor._doc.createElement(button_id);
+        dx.innerHTML = '&nbsp;';
+        pe.appendChild(dx);
+        break;
+      }else if((pe.tagName.toLowerCase() == 'dt')||(pe.tagName.toLowerCase() == 'dd')){
+        var dx = editor._doc.createElement(button_id)
+        dx.innerHTML = '&nbsp;';
+        if(pe.parentNode.lastChild==pe) {
+        pe.parentNode.appendChild(dx);
+        }else{
+          pe.parentNode.insertBefore(dx,pe.nextSibling);
+        }
+        break;
+      }
+      pe = pe.parentNode;
+    }
+    if(pe.tagName.toLowerCase() == 'body')
+  alert('You can insert a definition term or description only in a definition list!');
+  }
+};
Index: /branches/new-dialogs-merge/plugins/Equation/equation.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/equation.js (revision 999)
+++ /branches/new-dialogs-merge/plugins/Equation/equation.js (revision 999)
@@ -0,0 +1,230 @@
+/*------------------------------------------*\
+ AsciiMathML Formula Editor for Xinha
+ _______________________
+ 
+ Based on AsciiMathML by Peter Jipsen http://www.chapman.edu/~jipsen
+ 
+ Including a table with math symbols for easy input modified from CharacterMap for ASCIIMathML by Peter Jipsen
+ HTMLSource based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) modified by Holger Hees
+ Original Author - Bernhard Pfeifer novocaine@gmx.net
+ 
+ See readme.txt
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This 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
+ Lesser General Public License (at http://www.gnu.org/licenses/lgpl.html) 
+ for more details.
+
+ Raimund Meyer  11/23/2006
+     
+\*------------------------------------------*/
+function Equation(editor) {
+	this.editor = editor;
+
+	var cfg = editor.config;
+	var self = this;
+	
+
+	// register the toolbar buttons provided by this plugin
+	cfg.registerButton({
+	id       : "equation",
+	tooltip  : this._lc("Formula Editor"),
+	image    : editor.imgURL("equation.gif", "Equation"),
+	textMode : false,
+	action   : function(editor, id) {
+			self.buttonPress(editor, id);
+		}
+	});
+	cfg.addToolbarElement("equation", "inserthorizontalrule", -1);
+	
+	mathcolor = cfg.Equation.mathcolor;       // change it to "" (to inherit) or any other color
+	mathfontfamily = cfg.Equation.mathfontfamily;
+	
+	this.enabled = !Xinha.is_ie;
+	
+	if (this.enabled)
+	{	
+		this.onBeforeSubmit = this.onBeforeUnload = function () {self.unParse();};
+	}
+	
+	if (typeof  AMprocessNode != "function")
+	{
+		Xinha._loadback(Xinha.getPluginDir('Equation') + "/ASCIIMathML.js", function () { translate(); });
+	}
+}
+
+Xinha.Config.prototype.Equation =
+{
+	"mathcolor" : "black",       // change it to "" (to inherit) or any other color
+	"mathfontfamily" : "serif" // change to "" to inherit (works in IE) 
+                               // or another family (e.g. "arial")
+}
+
+Equation._pluginInfo = {
+	name          : "ASCIIMathML Formula Editor",
+	version       : "2.3 (2008-01-26)",
+	developer     : "Raimund Meyer",
+	developer_url : "http://xinha.raimundmeyer.de",
+	c_owner       : "",
+	sponsor       : "",
+	sponsor_url   : "",
+	license       : "GNU/LGPL"
+};
+
+Equation.prototype._lc = function(string) 
+{
+    return Xinha._lc(string, 'Equation');
+};
+Equation.prototype.onGenerate = function() 
+{
+	this.parse();
+};
+
+// avoid changing the formula in the editor
+Equation.prototype.onKeyPress = function(ev)
+{
+	if (this.enabled)
+	{
+		e = this.editor;
+		var span = e._getFirstAncestor(e.getSelection(),['span']);
+		if ( span && span.className == "AM" )
+		{
+			if (
+				ev.keyCode == 8 || // delete
+				ev.keyCode == 46 ||// backspace
+				ev.charCode	       // all character keys
+			) 
+			{ // stop event
+				Xinha._stopEvent(ev);
+				return true; 
+			}
+		}
+	}
+	return false;
+}
+Equation.prototype.onBeforeMode = function( mode )
+{
+	if (this.enabled && mode == 'textmode')
+	{
+		this.unParse();
+	}
+}
+Equation.prototype.onMode = function( mode )
+{
+	if (this.enabled && mode == 'wysiwyg')
+	{
+		this.parse();
+	}
+}
+
+Equation.prototype.parse = function ()
+{
+	if (this.enabled)
+	{
+		var doc = this.editor._doc;
+		var spans = doc.getElementsByTagName("span");
+		for (var i = 0;i<spans.length;i++)
+		{
+			var node = spans[i];
+			if (node.className != 'AM') continue;
+			if (node.innerHTML.indexOf(this.editor.cc) != -1) // avoid problems with source code position auxiliary character
+			{
+				node.innerHTML = node.innerHTML.replace(this.editor.cc,'');
+				node.parentNode.insertBefore(doc.createTextNode(this.editor.cc), node);
+			}
+			node.title = node.innerHTML;
+			// FF3 strict source document policy: 
+			// the span is taken from the editor document, processed in the plugin document, and put back in the editor
+			var clone = node.cloneNode(true);
+			try {
+				document.adoptNode(clone);
+			} catch (e) {}
+			AMprocessNode(clone, false);
+			try {
+				doc.adoptNode(clone);
+			} catch (e) {}
+			node.parentNode.replaceChild(clone, node);
+			// insert space before and after the protected node, otherwide one could get stuck
+			clone.parentNode.insertBefore(doc.createTextNode(String.fromCharCode(32)),clone);
+			clone.parentNode.insertBefore(doc.createTextNode(String.fromCharCode(32)),clone.nextSibling);
+		}
+	}
+}
+
+Equation.prototype.unParse = function ()
+{
+	var doc = this.editor._doc;
+	var spans = doc.getElementsByTagName("span");
+	for (var i = 0;i<spans.length;i++)
+	{
+		var node = spans[i];
+		if (node.className.indexOf ("AM") == -1 || node.getElementsByTagName("math").length == 0) continue;
+		var formula = node.getAttribute("title");
+		node.innerHTML = formula;
+		node.setAttribute("title", null);
+	}
+}
+
+Equation.prototype.buttonPress = function() 
+{
+	var self = this;
+	var editor = this.editor;
+	var args = {};
+	
+	args['editor'] = editor;
+	
+	var parent = editor._getFirstAncestor(editor.getSelection(),['span']);
+	if (parent)
+	{
+		args["editedNode"] = parent;
+	}
+	Dialog(Xinha.getPluginDir('Equation') + "/popups/dialog.html", function(params) {
+				self.insert(params);
+			}, args);
+};
+
+Equation.prototype.insert = function (param)
+{
+	if (typeof param["formula"] != "undefined")
+	{
+		var formula = (param["formula"] != '') ? param["formula"].replace(/^`?(.*)`?$/m,"`$1`") : '';
+
+		if (param["editedNode"] && (param["editedNode"].tagName.toLowerCase() == 'span')) 
+		{
+			var span = param["editedNode"]; 
+			if (formula != '')
+			{
+				span.innerHTML = formula;
+				if (this.enabled) span.title = formula;
+			}
+			else
+			{
+				span.parentNode.removeChild(span);
+			}
+			
+		}
+		else if (!param["editedNode"] && formula != '')
+		{
+			if (this.enabled)
+			{			
+				var span = document.createElement('span');
+				span.className = 'AM';
+				this.editor.insertNodeAtSelection(span);
+				span.innerHTML = formula;
+				span.title = formula;
+			}
+			else
+			{
+				this.editor.insertHTML('<span class="AM">'+formula+'</span>');
+			}
+		}
+
+		if (this.enabled) this.parse();//AMprocessNode(this.editor._doc.body, false);
+	}
+}
Index: /branches/new-dialogs-merge/plugins/Equation/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/Equation/lang/pt_br.js (revision 901)
@@ -0,0 +1,36 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "&quot;text&quot;": "&quot;text&quot;",
+  "AsciiMath Formula Input": "Inserir Fórmula AsciiMath",
+  "AsciiMathML Example": "Exemplo AsciiMathML",
+  "Based on ASCIIMathML by": "Baseado no ASCIIMathML por",
+  "Cancel": "Cancelar",
+  "Equation": "Equação",
+  "For more information on AsciiMathML visit this page:": "Para maiores informações do AsciiMathML visite este site:",
+  "Formula Editor": "Editor de Fórmula",
+  "Input": "Entrada",
+  "Insert": "Inserir",
+  "Preview": "Visualizar",
+  "Select operation": "Selecionar operação",
+  "`&quot;text&quot;`": "`&quot;texto&quot;`",
+
+  // new messages - see: http://xinha.webfactional.com/wiki/TranslationChanges
+  "Attention Internet Explorer users: Please note that there is no WYSIWYG representation of the formula in the editor! You might wish to use Mozilla Firefox instead.": "Atenção usuários do Internet Explorer: Observe que não é possível representar fórmulas no editor no modo de visualização! É preferivelmente que você utilize o Mozilla Firefox.",
+  "Show MathML": "Mostrar MathML", 
+  // removed old messages - see: http://xinha.webfactional.com/wiki/TranslationChanges
+  "Attention: Editing the formula in the editor is not possible, please use this dialog!": "Atenção: Não é possível editar a fórmula no editor. Ppor favor, utilize este caixa de diálogo!"
+}
Index: /branches/new-dialogs-merge/plugins/Equation/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/lang/de.js (revision 987)
+++ /branches/new-dialogs-merge/plugins/Equation/lang/de.js (revision 987)
@@ -0,0 +1,23 @@
+// I18N constants
+//
+//LANG: "base", ENCODING: UTF-8
+//Author: Translator-Name, <email@example.com>
+// 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.)
+
+{
+  "AsciiMath Formula Input": "AsciiMath Formeleditor",
+  "Formula Editor": "Formeleditor",
+  "Input":"Eingabe",
+  "Preview":"Vorschau",
+  "Based on ASCIIMathML by ": "Basiert auf ASCIIMathML von ",
+  "For more information on AsciiMathML visit this page: ":"FÃŒr weitere Informationen besuchen Sie bitte diese Seite: ",
+  'Attention Internet Explorer users: Please note that there is no WYSIWYG representation of the formula in the editor!<br />You might wish to use <a href="http://www.mozilla.com" onclick="window.open(this.href,\'_blank\');return false;">Mozilla Firefox</a> instead.' : 'Achtung Internet Explorer-Benutzer: Die Formel wird im Editor nicht als WYSIWYG dargestellt.<br />Benutzen Sie <a href="http://www.mozilla.com" target="_blank">Mozilla Firefox</a> als Alternative.',
+  "Show MathML" : "Zeige MathML"
+}
Index: /branches/new-dialogs-merge/plugins/Equation/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/lang/nl.js (revision 872)
+++ /branches/new-dialogs-merge/plugins/Equation/lang/nl.js (revision 872)
@@ -0,0 +1,13 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Author: Maarten Molenschot, maarten@nrgmm.nl
+
+{
+  "AsciiMath Formula Input": "AsciiMath Formule Invoeren",
+  "Formula Editor": "Formule Invoeren",
+  "Input":"Invoer",
+  "Preview":"Voorbeeld",
+  "Based on ASCIIMathML by ": "Gebasseerd op  ASCIIMathML van ",
+  "For more information on AsciiMathML visit this page: ":"Voor meer informatie over AsciiMathML ga je naar: ",
+  "Attention: Editing the formula in the editor is not possible, please use this dialog!" : "Let op! het bewerken van de formule in de editor is niet mogelijk, gebruik dit dialoog!"
+}
Index: /branches/new-dialogs-merge/plugins/Equation/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/Equation/lang/ja.js (revision 715)
@@ -0,0 +1,14 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "AsciiMath Formula Input": "AsciiMath æ°åŒå
+¥å",
+  "Formula Editor": "æ°åŒãšãã£ã¿",
+  "Input":"å
+¥å",
+  "Preview":"è¡šç€º",
+  "Based on ASCIIMathML by ": "Based on ASCIIMathML by ",
+  "For more information on AsciiMathML visit this page: ":"AsciiMathã®è©³çŽ°ã¯ãã®ããŒãžã«ãããŸã: ",
+  "Attention: Editing the formula in the editor is not possible, please use this dialog!" : "æ³šæ: ãšãã£ã¿ã§æ°åŒãç·šéããããšã¯ã§ããŸãããå¿
+ãããã®ãã€ã¢ã­ã°ãäœ¿çšããŠãã ãã"
+};
Index: /branches/new-dialogs-merge/plugins/Equation/ASCIIMathML.js
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/ASCIIMathML.js (revision 874)
+++ /branches/new-dialogs-merge/plugins/Equation/ASCIIMathML.js (revision 874)
@@ -0,0 +1,949 @@
+/*
+ASCIIMathML.js
+==============
+This file contains JavaScript functions to convert ASCII math notation
+to Presentation MathML. The conversion is done while the (X)HTML page 
+loads, and should work with Firefox/Mozilla/Netscape 7+ and Internet 
+Explorer 6+MathPlayer (http://www.dessci.com/en/products/mathplayer/).
+Just add the next line to your (X)HTML page with this file in the same folder:
+<script type="text/javascript" src="ASCIIMathML.js"></script>
+This is a convenient and inexpensive solution for authoring MathML.
+
+Version 1.4.7 Dec 15, 2005, (c) Peter Jipsen http://www.chapman.edu/~jipsen
+Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js
+For changes see http://www.chapman.edu/~jipsen/mathml/asciimathchanges.txt
+If you use it on a webpage, please send the URL to jipsen@chapman.edu
+
+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 checkForMathML = true;   // check if browser can display MathML
+var notifyIfNoMathML = true; // put note at top of page if no MathML capability
+var alertIfNoMathML = false;  // show alert box if no MathML capability
+if ( typeof mathcolor == "undefined" )
+{
+	var mathcolor = "red";      // change it to "" (to inherit) or any other color
+}
+if ( typeof mathfontfamily == "undefined" ) 
+{
+	var mathfontfamily = "serif"; // change to "" to inherit (works in IE) or another family (e.g. "arial")
+}
+var displaystyle = true;      // puts limits above and below large operators
+
+if ( typeof showasciiformulaonhover == "undefined" ) 
+{
+	var showasciiformulaonhover = true; // helps students learn ASCIIMath
+}
+
+var decimalsign = ".";        // change to "," if you like, beware of `(1,2)`!
+var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters
+var AMdelimiter2 = "$", AMescape2 = "\\\\\\$", AMdelimiter2regexp = "\\$";
+var doubleblankmathdelimiter = false; // if true,  x+1  is equal to `x+1`
+                                      // for IE this works only in <!--   -->
+//var separatetokens;// has been removed (email me if this is a problem)
+var isIE = document.createElementNS==null;
+
+if (document.getElementById==null) 
+  alert("This webpage requires a recent browser such as\
+\nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")
+
+// all further global variables start with "AM"
+
+function AMcreateElementXHTML(t) {
+  if (isIE) return document.createElement(t);
+  else return document.createElementNS("http://www.w3.org/1999/xhtml",t);
+}
+
+function AMnoMathMLNote() {
+  var nd = AMcreateElementXHTML("h3");
+  nd.setAttribute("align","center")
+  nd.appendChild(AMcreateElementXHTML("p"));
+  nd.appendChild(document.createTextNode("To view the "));
+  var an = AMcreateElementXHTML("a");
+  an.appendChild(document.createTextNode("ASCIIMathML"));
+  an.setAttribute("href","http://www.chapman.edu/~jipsen/asciimath.html");
+  nd.appendChild(an);
+  nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));  
+  an = AMcreateElementXHTML("a");
+  an.appendChild(document.createTextNode("MathPlayer"));
+  an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
+  nd.appendChild(an);
+  nd.appendChild(document.createTextNode(" or Netscape/Mozilla/Firefox"));
+  nd.appendChild(AMcreateElementXHTML("p"));
+  return nd;
+}
+
+function AMisMathMLavailable() {
+  if (navigator.appName.slice(0,8)=="Netscape") 
+    if (navigator.appVersion.slice(0,1)>="5") return null;
+    else return AMnoMathMLNote();
+  else if (navigator.appName.slice(0,9)=="Microsoft")
+    try {
+        var ActiveX = new ActiveXObject("MathPlayer.Factory.1");
+        return null;
+    } catch (e) {
+        return AMnoMathMLNote();
+    }
+  else return AMnoMathMLNote();
+}
+
+// character lists for Mozilla/Netscape fonts
+var AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46];
+var AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];
+var AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
+
+var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4, 
+    RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8,
+    LEFTRIGHT = 9, TEXT = 10; // token types
+
+var AMsqrt = {input:"sqrt", tag:"msqrt", output:"sqrt", tex:null, ttype:UNARY},
+  AMroot  = {input:"root", tag:"mroot", output:"root", tex:null, ttype:BINARY},
+  AMfrac  = {input:"frac", tag:"mfrac", output:"/",    tex:null, ttype:BINARY},
+  AMdiv   = {input:"/",    tag:"mfrac", output:"/",    tex:null, ttype:INFIX},
+  AMover  = {input:"stackrel", tag:"mover", output:"stackrel", tex:null, ttype:BINARY},
+  AMsub   = {input:"_",    tag:"msub",  output:"_",    tex:null, ttype:INFIX},
+  AMsup   = {input:"^",    tag:"msup",  output:"^",    tex:null, ttype:INFIX},
+  AMtext  = {input:"text", tag:"mtext", output:"text", tex:null, ttype:TEXT},
+  AMmbox  = {input:"mbox", tag:"mtext", output:"mbox", tex:null, ttype:TEXT},
+  AMquote = {input:"\"",   tag:"mtext", output:"mbox", tex:null, ttype:TEXT};
+
+var AMsymbols = [
+//some greek symbols
+{input:"alpha",  tag:"mi", output:"\u03B1", tex:null, ttype:CONST},
+{input:"beta",   tag:"mi", output:"\u03B2", tex:null, ttype:CONST},
+{input:"chi",    tag:"mi", output:"\u03C7", tex:null, ttype:CONST},
+{input:"delta",  tag:"mi", output:"\u03B4", tex:null, ttype:CONST},
+{input:"Delta",  tag:"mo", output:"\u0394", tex:null, ttype:CONST},
+{input:"epsi",   tag:"mi", output:"\u03B5", tex:"epsilon", ttype:CONST},
+{input:"varepsilon", tag:"mi", output:"\u025B", tex:null, ttype:CONST},
+{input:"eta",    tag:"mi", output:"\u03B7", tex:null, ttype:CONST},
+{input:"gamma",  tag:"mi", output:"\u03B3", tex:null, ttype:CONST},
+{input:"Gamma",  tag:"mo", output:"\u0393", tex:null, ttype:CONST},
+{input:"iota",   tag:"mi", output:"\u03B9", tex:null, ttype:CONST},
+{input:"kappa",  tag:"mi", output:"\u03BA", tex:null, ttype:CONST},
+{input:"lambda", tag:"mi", output:"\u03BB", tex:null, ttype:CONST},
+{input:"Lambda", tag:"mo", output:"\u039B", tex:null, ttype:CONST},
+{input:"mu",     tag:"mi", output:"\u03BC", tex:null, ttype:CONST},
+{input:"nu",     tag:"mi", output:"\u03BD", tex:null, ttype:CONST},
+{input:"omega",  tag:"mi", output:"\u03C9", tex:null, ttype:CONST},
+{input:"Omega",  tag:"mo", output:"\u03A9", tex:null, ttype:CONST},
+{input:"phi",    tag:"mi", output:"\u03C6", tex:null, ttype:CONST},
+{input:"varphi", tag:"mi", output:"\u03D5", tex:null, ttype:CONST},
+{input:"Phi",    tag:"mo", output:"\u03A6", tex:null, ttype:CONST},
+{input:"pi",     tag:"mi", output:"\u03C0", tex:null, ttype:CONST},
+{input:"Pi",     tag:"mo", output:"\u03A0", tex:null, ttype:CONST},
+{input:"psi",    tag:"mi", output:"\u03C8", tex:null, ttype:CONST},
+{input:"Psi",    tag:"mi", output:"\u03A8", tex:null, ttype:CONST},
+{input:"rho",    tag:"mi", output:"\u03C1", tex:null, ttype:CONST},
+{input:"sigma",  tag:"mi", output:"\u03C3", tex:null, ttype:CONST},
+{input:"Sigma",  tag:"mo", output:"\u03A3", tex:null, ttype:CONST},
+{input:"tau",    tag:"mi", output:"\u03C4", tex:null, ttype:CONST},
+{input:"theta",  tag:"mi", output:"\u03B8", tex:null, ttype:CONST},
+{input:"vartheta", tag:"mi", output:"\u03D1", tex:null, ttype:CONST},
+{input:"Theta",  tag:"mo", output:"\u0398", tex:null, ttype:CONST},
+{input:"upsilon", tag:"mi", output:"\u03C5", tex:null, ttype:CONST},
+{input:"xi",     tag:"mi", output:"\u03BE", tex:null, ttype:CONST},
+{input:"Xi",     tag:"mo", output:"\u039E", tex:null, ttype:CONST},
+{input:"zeta",   tag:"mi", output:"\u03B6", tex:null, ttype:CONST},
+
+//binary operation symbols
+{input:"*",  tag:"mo", output:"\u22C5", tex:"cdot", ttype:CONST},
+{input:"**", tag:"mo", output:"\u22C6", tex:"star", ttype:CONST},
+{input:"//", tag:"mo", output:"/",      tex:null, ttype:CONST},
+{input:"\\\\", tag:"mo", output:"\\",   tex:"backslash", ttype:CONST},
+{input:"setminus", tag:"mo", output:"\\", tex:null, ttype:CONST},
+{input:"xx", tag:"mo", output:"\u00D7", tex:"times", ttype:CONST},
+{input:"-:", tag:"mo", output:"\u00F7", tex:"divide", ttype:CONST},
+{input:"@",  tag:"mo", output:"\u2218", tex:"circ", ttype:CONST},
+{input:"o+", tag:"mo", output:"\u2295", tex:"oplus", ttype:CONST},
+{input:"ox", tag:"mo", output:"\u2297", tex:"otimes", ttype:CONST},
+{input:"o.", tag:"mo", output:"\u2299", tex:"odot", ttype:CONST},
+{input:"sum", tag:"mo", output:"\u2211", tex:null, ttype:UNDEROVER},
+{input:"prod", tag:"mo", output:"\u220F", tex:null, ttype:UNDEROVER},
+{input:"^^",  tag:"mo", output:"\u2227", tex:"wedge", ttype:CONST},
+{input:"^^^", tag:"mo", output:"\u22C0", tex:"bigwedge", ttype:UNDEROVER},
+{input:"vv",  tag:"mo", output:"\u2228", tex:"vee", ttype:CONST},
+{input:"vvv", tag:"mo", output:"\u22C1", tex:"bigvee", ttype:UNDEROVER},
+{input:"nn",  tag:"mo", output:"\u2229", tex:"cap", ttype:CONST},
+{input:"nnn", tag:"mo", output:"\u22C2", tex:"bigcap", ttype:UNDEROVER},
+{input:"uu",  tag:"mo", output:"\u222A", tex:"cup", ttype:CONST},
+{input:"uuu", tag:"mo", output:"\u22C3", tex:"bigcup", ttype:UNDEROVER},
+
+//binary relation symbols
+{input:"!=",  tag:"mo", output:"\u2260", tex:"ne", ttype:CONST},
+{input:":=",  tag:"mo", output:":=",     tex:null, ttype:CONST},
+{input:"lt",  tag:"mo", output:"<",      tex:null, ttype:CONST},
+{input:"<=",  tag:"mo", output:"\u2264", tex:"le", ttype:CONST},
+{input:"lt=", tag:"mo", output:"\u2264", tex:"leq", ttype:CONST},
+{input:">=",  tag:"mo", output:"\u2265", tex:"ge", ttype:CONST},
+{input:"geq", tag:"mo", output:"\u2265", tex:null, ttype:CONST},
+{input:"-<",  tag:"mo", output:"\u227A", tex:"prec", ttype:CONST},
+{input:"-lt", tag:"mo", output:"\u227A", tex:null, ttype:CONST},
+{input:">-",  tag:"mo", output:"\u227B", tex:"succ", ttype:CONST},
+{input:"-<=", tag:"mo", output:"\u2AAF", tex:"preceq", ttype:CONST},
+{input:">-=", tag:"mo", output:"\u2AB0", tex:"succeq", ttype:CONST},
+{input:"in",  tag:"mo", output:"\u2208", tex:null, ttype:CONST},
+{input:"!in", tag:"mo", output:"\u2209", tex:"notin", ttype:CONST},
+{input:"sub", tag:"mo", output:"\u2282", tex:"subset", ttype:CONST},
+{input:"sup", tag:"mo", output:"\u2283", tex:"supset", ttype:CONST},
+{input:"sube", tag:"mo", output:"\u2286", tex:"subseteq", ttype:CONST},
+{input:"supe", tag:"mo", output:"\u2287", tex:"supseteq", ttype:CONST},
+{input:"-=",  tag:"mo", output:"\u2261", tex:"equiv", ttype:CONST},
+{input:"~=",  tag:"mo", output:"\u2245", tex:"cong", ttype:CONST},
+{input:"~~",  tag:"mo", output:"\u2248", tex:"approx", ttype:CONST},
+{input:"prop", tag:"mo", output:"\u221D", tex:"propto", ttype:CONST},
+
+//logical symbols
+{input:"and", tag:"mtext", output:"and", tex:null, ttype:SPACE},
+{input:"or",  tag:"mtext", output:"or",  tex:null, ttype:SPACE},
+{input:"not", tag:"mo", output:"\u00AC", tex:"neg", ttype:CONST},
+{input:"=>",  tag:"mo", output:"\u21D2", tex:"implies", ttype:CONST},
+{input:"if",  tag:"mo", output:"if",     tex:null, ttype:SPACE},
+{input:"<=>", tag:"mo", output:"\u21D4", tex:"iff", ttype:CONST},
+{input:"AA",  tag:"mo", output:"\u2200", tex:"forall", ttype:CONST},
+{input:"EE",  tag:"mo", output:"\u2203", tex:"exists", ttype:CONST},
+{input:"_|_", tag:"mo", output:"\u22A5", tex:"bot", ttype:CONST},
+{input:"TT",  tag:"mo", output:"\u22A4", tex:"top", ttype:CONST},
+{input:"|--",  tag:"mo", output:"\u22A2", tex:"vdash", ttype:CONST},
+{input:"|==",  tag:"mo", output:"\u22A8", tex:"models", ttype:CONST},
+
+//grouping brackets
+{input:"(", tag:"mo", output:"(", tex:null, ttype:LEFTBRACKET},
+{input:")", tag:"mo", output:")", tex:null, ttype:RIGHTBRACKET},
+{input:"[", tag:"mo", output:"[", tex:null, ttype:LEFTBRACKET},
+{input:"]", tag:"mo", output:"]", tex:null, ttype:RIGHTBRACKET},
+{input:"{", tag:"mo", output:"{", tex:null, ttype:LEFTBRACKET},
+{input:"}", tag:"mo", output:"}", tex:null, ttype:RIGHTBRACKET},
+{input:"|", tag:"mo", output:"|", tex:null, ttype:LEFTRIGHT},
+//{input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT},
+{input:"(:", tag:"mo", output:"\u2329", tex:"langle", ttype:LEFTBRACKET},
+{input:":)", tag:"mo", output:"\u232A", tex:"rangle", ttype:RIGHTBRACKET},
+{input:"<<", tag:"mo", output:"\u2329", tex:null, ttype:LEFTBRACKET},
+{input:">>", tag:"mo", output:"\u232A", tex:null, ttype:RIGHTBRACKET},
+{input:"{:", tag:"mo", output:"{:", tex:null, ttype:LEFTBRACKET, invisible:true},
+{input:":}", tag:"mo", output:":}", tex:null, ttype:RIGHTBRACKET, invisible:true},
+
+//miscellaneous symbols
+{input:"int",  tag:"mo", output:"\u222B", tex:null, ttype:CONST},
+{input:"dx",   tag:"mi", output:"{:d x:}", tex:null, ttype:DEFINITION},
+{input:"dy",   tag:"mi", output:"{:d y:}", tex:null, ttype:DEFINITION},
+{input:"dz",   tag:"mi", output:"{:d z:}", tex:null, ttype:DEFINITION},
+{input:"dt",   tag:"mi", output:"{:d t:}", tex:null, ttype:DEFINITION},
+{input:"oint", tag:"mo", output:"\u222E", tex:null, ttype:CONST},
+{input:"del",  tag:"mo", output:"\u2202", tex:"partial", ttype:CONST},
+{input:"grad", tag:"mo", output:"\u2207", tex:"nabla", ttype:CONST},
+{input:"+-",   tag:"mo", output:"\u00B1", tex:"pm", ttype:CONST},
+{input:"O/",   tag:"mo", output:"\u2205", tex:"emptyset", ttype:CONST},
+{input:"oo",   tag:"mo", output:"\u221E", tex:"infty", ttype:CONST},
+{input:"aleph", tag:"mo", output:"\u2135", tex:null, ttype:CONST},
+{input:"...",  tag:"mo", output:"...",    tex:"ldots", ttype:CONST},
+{input:":.",  tag:"mo", output:"\u2234",  tex:"therefore", ttype:CONST},
+{input:"/_",  tag:"mo", output:"\u2220",  tex:"angle", ttype:CONST},
+{input:"\\ ",  tag:"mo", output:"\u00A0", tex:null, ttype:CONST},
+{input:"quad", tag:"mo", output:"\u00A0\u00A0", tex:null, ttype:CONST},
+{input:"qquad", tag:"mo", output:"\u00A0\u00A0\u00A0\u00A0", tex:null, ttype:CONST},
+{input:"cdots", tag:"mo", output:"\u22EF", tex:null, ttype:CONST},
+{input:"vdots", tag:"mo", output:"\u22EE", tex:null, ttype:CONST},
+{input:"ddots", tag:"mo", output:"\u22F1", tex:null, ttype:CONST},
+{input:"diamond", tag:"mo", output:"\u22C4", tex:null, ttype:CONST},
+{input:"square", tag:"mo", output:"\u25A1", tex:null, ttype:CONST},
+{input:"|__", tag:"mo", output:"\u230A",  tex:"lfloor", ttype:CONST},
+{input:"__|", tag:"mo", output:"\u230B",  tex:"rfloor", ttype:CONST},
+{input:"|~", tag:"mo", output:"\u2308",  tex:"lceiling", ttype:CONST},
+{input:"~|", tag:"mo", output:"\u2309",  tex:"rceiling", ttype:CONST},
+{input:"CC",  tag:"mo", output:"\u2102", tex:null, ttype:CONST},
+{input:"NN",  tag:"mo", output:"\u2115", tex:null, ttype:CONST},
+{input:"QQ",  tag:"mo", output:"\u211A", tex:null, ttype:CONST},
+{input:"RR",  tag:"mo", output:"\u211D", tex:null, ttype:CONST},
+{input:"ZZ",  tag:"mo", output:"\u2124", tex:null, ttype:CONST},
+{input:"f",   tag:"mi", output:"f",      tex:null, ttype:UNARY, func:true},
+{input:"g",   tag:"mi", output:"g",      tex:null, ttype:UNARY, func:true},
+
+//standard functions
+{input:"lim",  tag:"mo", output:"lim", tex:null, ttype:UNDEROVER},
+{input:"Lim",  tag:"mo", output:"Lim", tex:null, ttype:UNDEROVER},
+{input:"sin",  tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true},
+{input:"cos",  tag:"mo", output:"cos", tex:null, ttype:UNARY, func:true},
+{input:"tan",  tag:"mo", output:"tan", tex:null, ttype:UNARY, func:true},
+{input:"sinh", tag:"mo", output:"sinh", tex:null, ttype:UNARY, func:true},
+{input:"cosh", tag:"mo", output:"cosh", tex:null, ttype:UNARY, func:true},
+{input:"tanh", tag:"mo", output:"tanh", tex:null, ttype:UNARY, func:true},
+{input:"cot",  tag:"mo", output:"cot", tex:null, ttype:UNARY, func:true},
+{input:"sec",  tag:"mo", output:"sec", tex:null, ttype:UNARY, func:true},
+{input:"csc",  tag:"mo", output:"csc", tex:null, ttype:UNARY, func:true},
+{input:"log",  tag:"mo", output:"log", tex:null, ttype:UNARY, func:true},
+{input:"ln",   tag:"mo", output:"ln",  tex:null, ttype:UNARY, func:true},
+{input:"det",  tag:"mo", output:"det", tex:null, ttype:UNARY, func:true},
+{input:"dim",  tag:"mo", output:"dim", tex:null, ttype:CONST},
+{input:"mod",  tag:"mo", output:"mod", tex:null, ttype:CONST},
+{input:"gcd",  tag:"mo", output:"gcd", tex:null, ttype:UNARY, func:true},
+{input:"lcm",  tag:"mo", output:"lcm", tex:null, ttype:UNARY, func:true},
+{input:"lub",  tag:"mo", output:"lub", tex:null, ttype:CONST},
+{input:"glb",  tag:"mo", output:"glb", tex:null, ttype:CONST},
+{input:"min",  tag:"mo", output:"min", tex:null, ttype:UNDEROVER},
+{input:"max",  tag:"mo", output:"max", tex:null, ttype:UNDEROVER},
+
+//arrows
+{input:"uarr", tag:"mo", output:"\u2191", tex:"uparrow", ttype:CONST},
+{input:"darr", tag:"mo", output:"\u2193", tex:"downarrow", ttype:CONST},
+{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST},
+{input:"->",   tag:"mo", output:"\u2192", tex:"to", ttype:CONST},
+{input:"|->",  tag:"mo", output:"\u21A6", tex:"mapsto", ttype:CONST},
+{input:"larr", tag:"mo", output:"\u2190", tex:"leftarrow", ttype:CONST},
+{input:"harr", tag:"mo", output:"\u2194", tex:"leftrightarrow", ttype:CONST},
+{input:"rArr", tag:"mo", output:"\u21D2", tex:"Rightarrow", ttype:CONST},
+{input:"lArr", tag:"mo", output:"\u21D0", tex:"Leftarrow", ttype:CONST},
+{input:"hArr", tag:"mo", output:"\u21D4", tex:"Leftrightarrow", ttype:CONST},
+
+//commands with argument
+AMsqrt, AMroot, AMfrac, AMdiv, AMover, AMsub, AMsup,
+{input:"hat", tag:"mover", output:"\u005E", tex:null, ttype:UNARY, acc:true},
+{input:"bar", tag:"mover", output:"\u00AF", tex:"overline", ttype:UNARY, acc:true},
+{input:"vec", tag:"mover", output:"\u2192", tex:null, ttype:UNARY, acc:true},
+{input:"dot", tag:"mover", output:".",      tex:null, ttype:UNARY, acc:true},
+{input:"ddot", tag:"mover", output:"..",    tex:null, ttype:UNARY, acc:true},
+{input:"ul", tag:"munder", output:"\u0332", tex:"underline", ttype:UNARY, acc:true},
+AMtext, AMmbox, AMquote,
+{input:"bb", tag:"mstyle", atname:"fontweight", atval:"bold", output:"bb", tex:null, ttype:UNARY},
+{input:"mathbf", tag:"mstyle", atname:"fontweight", atval:"bold", output:"mathbf", tex:null, ttype:UNARY},
+{input:"sf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"sf", tex:null, ttype:UNARY},
+{input:"mathsf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"mathsf", tex:null, ttype:UNARY},
+{input:"bbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"bbb", tex:null, ttype:UNARY, codes:AMbbb},
+{input:"mathbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"mathbb", tex:null, ttype:UNARY, codes:AMbbb},
+{input:"cc",  tag:"mstyle", atname:"mathvariant", atval:"script", output:"cc", tex:null, ttype:UNARY, codes:AMcal},
+{input:"mathcal", tag:"mstyle", atname:"mathvariant", atval:"script", output:"mathcal", tex:null, ttype:UNARY, codes:AMcal},
+{input:"tt",  tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"tt", tex:null, ttype:UNARY},
+{input:"mathtt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"mathtt", tex:null, ttype:UNARY},
+{input:"fr",  tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"fr", tex:null, ttype:UNARY, codes:AMfrk},
+{input:"mathfrak",  tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"mathfrak", tex:null, ttype:UNARY, codes:AMfrk}
+];
+
+function compareNames(s1,s2) {
+  if (s1.input > s2.input) return 1
+  else return -1;
+}
+
+var AMnames = []; //list of input symbols
+
+function AMinitSymbols() {
+  var texsymbols = [], i;
+  for (i=0; i<AMsymbols.length; i++)
+    if (AMsymbols[i].tex) 
+      texsymbols[texsymbols.length] = {input:AMsymbols[i].tex, 
+        tag:AMsymbols[i].tag, output:AMsymbols[i].output, ttype:AMsymbols[i].ttype};
+  AMsymbols = AMsymbols.concat(texsymbols);
+  AMsymbols.sort(compareNames);
+  for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
+}
+
+var AMmathml = "http://www.w3.org/1998/Math/MathML";
+
+function AMcreateElementMathML(t) {
+  if (isIE) return document.createElement("m:"+t);
+  else return document.createElementNS(AMmathml,t);
+}
+
+function AMcreateMmlNode(t,frag) {
+//  var node = AMcreateElementMathML(name);
+  if (isIE) var node = document.createElement("m:"+t);
+  else var node = document.createElementNS(AMmathml,t);
+  node.appendChild(frag);
+  return node;
+}
+
+function newcommand(oldstr,newstr) {
+  AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr, 
+                                 tex:null, ttype:DEFINITION}]);
+}
+
+function AMremoveCharsAndBlanks(str,n) {
+//remove n characters and any following blanks
+  var st;
+  if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ") 
+    st = str.slice(n+1);
+  else st = str.slice(n);
+  for (var i=0; i<st.length && st.charCodeAt(i)<=32; i=i+1);
+  return st.slice(i);
+}
+
+function AMposition(arr, str, n) { 
+// return position >=n where str appears or would be inserted
+// assumes arr is sorted
+  if (n==0) {
+    var h,m;
+    n = -1;
+    h = arr.length;
+    while (n+1<h) {
+      m = (n+h) >> 1;
+      if (arr[m]<str) n = m; else h = m;
+    }
+    return h;
+  } else
+    for (var i=n; i<arr.length && arr[i]<str; i++);
+  return i; // i=arr.length || arr[i]>=str
+}
+
+function AMgetSymbol(str) {
+//return maximal initial substring of str that appears in names
+//return null if there is none
+  var k = 0; //new pos
+  var j = 0; //old pos
+  var mk; //match pos
+  var st;
+  var tagst;
+  var match = "";
+  var more = true;
+  for (var i=1; i<=str.length && more; i++) {
+    st = str.slice(0,i); //initial substring of length i
+    j = k;
+    k = AMposition(AMnames, st, j);
+    if (k<AMnames.length && str.slice(0,AMnames[k].length)==AMnames[k]){
+      match = AMnames[k];
+      mk = k;
+      i = match.length;
+    }
+    more = k<AMnames.length && str.slice(0,AMnames[k].length)>=AMnames[k];
+  }
+  AMpreviousSymbol=AMcurrentSymbol;
+  if (match!=""){
+    AMcurrentSymbol=AMsymbols[mk].ttype;
+    return AMsymbols[mk]; 
+  }
+// if str[0] is a digit or - return maxsubstring of digits.digits
+  AMcurrentSymbol=CONST;
+  k = 1;
+  st = str.slice(0,1);
+  var integ = true;
+  while ("0"<=st && st<="9" && k<=str.length) {
+    st = str.slice(k,k+1);
+    k++;
+  }
+  if (st == decimalsign) {
+    st = str.slice(k,k+1);
+    if ("0"<=st && st<="9") {
+      integ = false;
+      k++;
+      while ("0"<=st && st<="9" && k<=str.length) {
+        st = str.slice(k,k+1);
+        k++;
+      }
+    }
+  }
+  if ((integ && k>1) || k>2) {
+    st = str.slice(0,k-1);
+    tagst = "mn";
+  } else {
+    k = 2;
+    st = str.slice(0,1); //take 1 character
+    tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi");
+  }
+  if (st=="-" && AMpreviousSymbol==INFIX) {
+    AMcurrentSymbol = INFIX;  //trick "/" into recognizing "-" on second parse
+    return {input:st, tag:tagst, output:st, ttype:UNARY, func:true};
+  }
+  return {input:st, tag:tagst, output:st, ttype:CONST};
+}
+
+function AMremoveBrackets(node) {
+  var st;
+  if (node.nodeName=="mrow") {
+    st = node.firstChild.firstChild.nodeValue;
+    if (st=="(" || st=="[" || st=="{") node.removeChild(node.firstChild);
+  }
+  if (node.nodeName=="mrow") {
+    st = node.lastChild.firstChild.nodeValue;
+    if (st==")" || st=="]" || st=="}") node.removeChild(node.lastChild);
+  }
+}
+
+/*Parsing ASCII math expressions with the following grammar
+v ::= [A-Za-z] | greek letters | numbers | other constant symbols
+u ::= sqrt | text | bb | other unary symbols for font commands
+b ::= frac | root | stackrel         binary symbols
+l ::= ( | [ | { | (: | {:            left brackets
+r ::= ) | ] | } | :) | :}            right brackets
+S ::= v | lEr | uS | bSS             Simple expression
+I ::= S_S | S^S | S_S^S | S          Intermediate expression
+E ::= IE | I/I                       Expression
+Each terminal symbol is translated into a corresponding mathml node.*/
+
+var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol;
+
+function AMparseSexpr(str) { //parses str and returns [node,tailstr]
+  var symbol, node, result, i, st,// rightvert = false,
+    newFrag = document.createDocumentFragment();
+  str = AMremoveCharsAndBlanks(str,0);
+  symbol = AMgetSymbol(str);             //either a token or a bracket or empty
+  if (symbol == null || symbol.ttype == RIGHTBRACKET && AMnestingDepth > 0) {
+    return [null,str];
+  }
+  if (symbol.ttype == DEFINITION) {
+    str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length); 
+    symbol = AMgetSymbol(str);
+  }
+  switch (symbol.ttype) {
+  case UNDEROVER:
+  case CONST:
+    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    return [AMcreateMmlNode(symbol.tag,        //its a constant
+                             document.createTextNode(symbol.output)),str];
+  case LEFTBRACKET:   //read (expr+)
+    AMnestingDepth++;
+    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    result = AMparseExpr(str,true);
+    AMnestingDepth--;
+    if (typeof symbol.invisible == "boolean" && symbol.invisible) 
+      node = AMcreateMmlNode("mrow",result[0]);
+    else {
+      node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
+      node = AMcreateMmlNode("mrow",node);
+      node.appendChild(result[0]);
+    }
+    return [node,result[1]];
+  case TEXT:
+      if (symbol!=AMquote) str = AMremoveCharsAndBlanks(str,symbol.input.length);
+      if (str.charAt(0)=="{") i=str.indexOf("}");
+      else if (str.charAt(0)=="(") i=str.indexOf(")");
+      else if (str.charAt(0)=="[") i=str.indexOf("]");
+      else if (symbol==AMquote) i=str.slice(1).indexOf("\"")+1;
+      else i = 0;
+      if (i==-1) i = str.length;
+      st = str.slice(1,i);
+      if (st.charAt(0) == " ") {
+        node = AMcreateElementMathML("mspace");
+        node.setAttribute("width","1ex");
+        newFrag.appendChild(node);
+      }
+      newFrag.appendChild(
+        AMcreateMmlNode(symbol.tag,document.createTextNode(st)));
+      if (st.charAt(st.length-1) == " ") {
+        node = AMcreateElementMathML("mspace");
+        node.setAttribute("width","1ex");
+        newFrag.appendChild(node);
+      }
+      str = AMremoveCharsAndBlanks(str,i+1);
+      return [AMcreateMmlNode("mrow",newFrag),str];
+  case UNARY:
+      str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+      result = AMparseSexpr(str);
+      if (result[0]==null) return [AMcreateMmlNode(symbol.tag,
+                             document.createTextNode(symbol.output)),str];
+      if (typeof symbol.func == "boolean" && symbol.func) { // functions hack
+        st = str.charAt(0);
+        if (st=="^" || st=="_" || st=="/" || st=="|" || st==",") {
+          return [AMcreateMmlNode(symbol.tag,
+                    document.createTextNode(symbol.output)),str];
+        } else {
+          node = AMcreateMmlNode("mrow",
+           AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
+          node.appendChild(result[0]);
+          return [node,result[1]];
+        }
+      }
+      AMremoveBrackets(result[0]);
+      if (symbol.input == "sqrt") {           // sqrt
+        return [AMcreateMmlNode(symbol.tag,result[0]),result[1]];
+      } else if (typeof symbol.acc == "boolean" && symbol.acc) {   // accent
+        node = AMcreateMmlNode(symbol.tag,result[0]);
+        node.appendChild(AMcreateMmlNode("mo",document.createTextNode(symbol.output)));
+        return [node,result[1]];
+      } else {                        // font change command
+        if (!isIE && typeof symbol.codes != "undefined") {
+          for (i=0; i<result[0].childNodes.length; i++)
+            if (result[0].childNodes[i].nodeName=="mi" || result[0].nodeName=="mi") {
+              st = (result[0].nodeName=="mi"?result[0].firstChild.nodeValue:
+                              result[0].childNodes[i].firstChild.nodeValue);
+              var newst = [];
+              for (var j=0; j<st.length; j++)
+                if (st.charCodeAt(j)>64 && st.charCodeAt(j)<91) newst = newst +
+                  String.fromCharCode(symbol.codes[st.charCodeAt(j)-65]);
+                else newst = newst + st.charAt(j);
+              if (result[0].nodeName=="mi")
+                result[0]=AMcreateElementMathML("mo").
+                          appendChild(document.createTextNode(newst));
+              else result[0].replaceChild(AMcreateElementMathML("mo").
+          appendChild(document.createTextNode(newst)),result[0].childNodes[i]);
+            }
+        }
+        node = AMcreateMmlNode(symbol.tag,result[0]);
+        node.setAttribute(symbol.atname,symbol.atval);
+        return [node,result[1]];
+      }
+  case BINARY:
+    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    result = AMparseSexpr(str);
+    if (result[0]==null) return [AMcreateMmlNode("mo",
+                           document.createTextNode(symbol.input)),str];
+    AMremoveBrackets(result[0]);
+    var result2 = AMparseSexpr(result[1]);
+    if (result2[0]==null) return [AMcreateMmlNode("mo",
+                           document.createTextNode(symbol.input)),str];
+    AMremoveBrackets(result2[0]);
+    if (symbol.input=="root" || symbol.input=="stackrel") 
+      newFrag.appendChild(result2[0]);
+    newFrag.appendChild(result[0]);
+    if (symbol.input=="frac") newFrag.appendChild(result2[0]);
+    return [AMcreateMmlNode(symbol.tag,newFrag),result2[1]];
+  case INFIX:
+    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    return [AMcreateMmlNode("mo",document.createTextNode(symbol.output)),str];
+  case SPACE:
+    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    node = AMcreateElementMathML("mspace");
+    node.setAttribute("width","1ex");
+    newFrag.appendChild(node);
+    newFrag.appendChild(
+      AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
+    node = AMcreateElementMathML("mspace");
+    node.setAttribute("width","1ex");
+    newFrag.appendChild(node);
+    return [AMcreateMmlNode("mrow",newFrag),str];
+  case LEFTRIGHT:
+//    if (rightvert) return [null,str]; else rightvert = true;
+    AMnestingDepth++;
+    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    result = AMparseExpr(str,false);
+    AMnestingDepth--;
+    var st = "";
+    if (result[0].lastChild!=null)
+      st = result[0].lastChild.firstChild.nodeValue;
+    if (st == "|") { // its an absolute value subterm
+      node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
+      node = AMcreateMmlNode("mrow",node);
+      node.appendChild(result[0]);
+      return [node,result[1]];
+    } else { // the "|" is a \mid
+      node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
+      node = AMcreateMmlNode("mrow",node);
+      return [node,str];
+    }
+  default:
+//alert("default");
+    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    return [AMcreateMmlNode(symbol.tag,        //its a constant
+                             document.createTextNode(symbol.output)),str];
+  }
+}
+
+function AMparseIexpr(str) {
+  var symbol, sym1, sym2, node, result, underover;
+  str = AMremoveCharsAndBlanks(str,0);
+  sym1 = AMgetSymbol(str);
+  result = AMparseSexpr(str);
+  node = result[0];
+  str = result[1];
+  symbol = AMgetSymbol(str);
+  if (symbol.ttype == INFIX && symbol.input != "/") {
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
+//    if (symbol.input == "/") result = AMparseIexpr(str); else ...
+    result = AMparseSexpr(str);
+    if (result[0] == null) // show box in place of missing argument
+      result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));
+    else AMremoveBrackets(result[0]);
+    str = result[1];
+//    if (symbol.input == "/") AMremoveBrackets(node);
+    if (symbol.input == "_") {
+      sym2 = AMgetSymbol(str);
+      underover = (sym1.ttype == UNDEROVER);
+      if (sym2.input == "^") {
+        str = AMremoveCharsAndBlanks(str,sym2.input.length);
+        var res2 = AMparseSexpr(str);
+        AMremoveBrackets(res2[0]);
+        str = res2[1];
+        node = AMcreateMmlNode((underover?"munderover":"msubsup"),node);
+        node.appendChild(result[0]);
+        node.appendChild(res2[0]);
+        node = AMcreateMmlNode("mrow",node); // so sum does not stretch
+      } else {
+        node = AMcreateMmlNode((underover?"munder":"msub"),node);
+        node.appendChild(result[0]);
+      }
+    } else {
+      node = AMcreateMmlNode(symbol.tag,node);
+      node.appendChild(result[0]);
+    }
+  }
+  return [node,str];
+}
+
+function AMparseExpr(str,rightbracket) {
+  var symbol, node, result, i, nodeList = [],
+  newFrag = document.createDocumentFragment();
+  do {
+    str = AMremoveCharsAndBlanks(str,0);
+    result = AMparseIexpr(str);
+    node = result[0];
+    str = result[1];
+    symbol = AMgetSymbol(str);
+    if (symbol.ttype == INFIX && symbol.input == "/") {
+      str = AMremoveCharsAndBlanks(str,symbol.input.length);
+      result = AMparseIexpr(str);
+      if (result[0] == null) // show box in place of missing argument
+        result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));
+      else AMremoveBrackets(result[0]);
+      str = result[1];
+      AMremoveBrackets(node);
+      node = AMcreateMmlNode(symbol.tag,node);
+      node.appendChild(result[0]);
+      newFrag.appendChild(node);
+      symbol = AMgetSymbol(str);
+    } 
+    else if (node!=undefined) newFrag.appendChild(node);
+  } while ((symbol.ttype != RIGHTBRACKET && 
+           (symbol.ttype != LEFTRIGHT || rightbracket)
+           || AMnestingDepth == 0) && symbol!=null && symbol.output!="");
+  if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {
+//    if (AMnestingDepth > 0) AMnestingDepth--;
+    var len = newFrag.childNodes.length;
+    if (len>0 && newFrag.childNodes[len-1].nodeName == "mrow" && len>1 &&
+      newFrag.childNodes[len-2].nodeName == "mo" &&
+      newFrag.childNodes[len-2].firstChild.nodeValue == ",") { //matrix
+      var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue;
+      if (right==")" || right=="]") {
+        var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue;
+        if (left=="(" && right==")" && symbol.output != "}" || 
+            left=="[" && right=="]") {
+        var pos = []; // positions of commas
+        var matrix = true;
+        var m = newFrag.childNodes.length;
+        for (i=0; matrix && i<m; i=i+2) {
+          pos[i] = [];
+          node = newFrag.childNodes[i];
+          if (matrix) matrix = node.nodeName=="mrow" && 
+            (i==m-1 || node.nextSibling.nodeName=="mo" && 
+            node.nextSibling.firstChild.nodeValue==",")&&
+            node.firstChild.firstChild.nodeValue==left &&
+            node.lastChild.firstChild.nodeValue==right;
+          if (matrix) 
+            for (var j=0; j<node.childNodes.length; j++)
+              if (node.childNodes[j].firstChild.nodeValue==",")
+                pos[i][pos[i].length]=j;
+          if (matrix && i>1) matrix = pos[i].length == pos[i-2].length;
+        }
+        if (matrix) {
+          var row, frag, n, k, table = document.createDocumentFragment();
+          for (i=0; i<m; i=i+2) {
+            row = document.createDocumentFragment();
+            frag = document.createDocumentFragment();
+            node = newFrag.firstChild; // <mrow>(-,-,...,-,-)</mrow>
+            n = node.childNodes.length;
+            k = 0;
+            node.removeChild(node.firstChild); //remove (
+            for (j=1; j<n-1; j++) {
+              if (typeof pos[i][k] != "undefined" && j==pos[i][k]){
+                node.removeChild(node.firstChild); //remove ,
+                row.appendChild(AMcreateMmlNode("mtd",frag));
+                k++;
+              } else frag.appendChild(node.firstChild);
+            }
+            row.appendChild(AMcreateMmlNode("mtd",frag));
+            if (newFrag.childNodes.length>2) {
+              newFrag.removeChild(newFrag.firstChild); //remove <mrow>)</mrow>
+              newFrag.removeChild(newFrag.firstChild); //remove <mo>,</mo>
+            }
+            table.appendChild(AMcreateMmlNode("mtr",row));
+          }
+          node = AMcreateMmlNode("mtable",table);
+          if (typeof symbol.invisible == "boolean" && symbol.invisible) node.setAttribute("columnalign","left");
+          newFrag.replaceChild(node,newFrag.firstChild);
+        }
+       }
+      }
+    }
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
+    if (typeof symbol.invisible != "boolean" || !symbol.invisible) {
+      node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
+      newFrag.appendChild(node);
+    }
+  }
+  return [newFrag,str];
+}
+
+function AMparseMath(str) {
+  var result, node = AMcreateElementMathML("mstyle");
+  if (mathcolor != "") node.setAttribute("mathcolor",mathcolor);
+  if (displaystyle) node.setAttribute("displaystyle","true");
+  if (mathfontfamily != "") node.setAttribute("fontfamily",mathfontfamily);
+  AMnestingDepth = 0;
+  node.appendChild(AMparseExpr(str.replace(/^\s+/g,""),false)[0]);
+  node = AMcreateMmlNode("math",node);
+  if (showasciiformulaonhover)                      //fixed by djhsu so newline
+    node.setAttribute("title",str.replace(/\s+/g," "));//does not show in Gecko
+  if (mathfontfamily != "" && (isIE || mathfontfamily != "serif")) {
+    var fnode = AMcreateElementXHTML("font");
+    fnode.setAttribute("face",mathfontfamily);
+    fnode.appendChild(node);
+    return fnode;
+  }
+  return node;
+}
+
+function AMstrarr2docFrag(arr, linebreaks) {
+  var newFrag=document.createDocumentFragment();
+  var expr = false;
+  for (var i=0; i<arr.length; i++) {
+    if (expr) newFrag.appendChild(AMparseMath(arr[i]));
+    else {
+      var arri = (linebreaks ? arr[i].split("\n\n") : [arr[i]]);
+      newFrag.appendChild(AMcreateElementXHTML("span").
+      appendChild(document.createTextNode(arri[0])));
+      for (var j=1; j<arri.length; j++) {
+        newFrag.appendChild(AMcreateElementXHTML("p"));
+        newFrag.appendChild(AMcreateElementXHTML("span").
+        appendChild(document.createTextNode(arri[j])));
+      }
+    }
+    expr = !expr;
+  }
+  return newFrag;
+}
+
+function AMprocessNodeR(n, linebreaks) {
+  var mtch, str, arr, frg, i;
+  if (n.childNodes.length == 0) {
+   if ((n.nodeType!=8 || linebreaks) &&
+    n.parentNode.nodeName!="form" && n.parentNode.nodeName!="FORM" &&
+    n.parentNode.nodeName!="textarea" && n.parentNode.nodeName!="TEXTAREA" &&
+    n.parentNode.nodeName!="pre" && n.parentNode.nodeName!="PRE") {
+    str = n.nodeValue;
+    if (!(str == null)) {
+      str = str.replace(/\r\n\r\n/g,"\n\n");
+      if (doubleblankmathdelimiter) {
+        str = str.replace(/\x20\x20\./g," "+AMdelimiter1+".");
+        str = str.replace(/\x20\x20,/g," "+AMdelimiter1+",");
+        str = str.replace(/\x20\x20/g," "+AMdelimiter1+" ");
+      }
+      str = str.replace(/\x20+/g," ");
+      str = str.replace(/\s*\r\n/g," ");
+      mtch = false;
+      str = str.replace(new RegExp(AMescape2, "g"),
+              function(st){mtch=true;return "AMescape2"});
+      str = str.replace(new RegExp(AMescape1, "g"),
+              function(st){mtch=true;return "AMescape1"});
+      str = str.replace(new RegExp(AMdelimiter2regexp, "g"),AMdelimiter1);
+      arr = str.split(AMdelimiter1);
+      for (i=0; i<arr.length; i++)
+        arr[i]=arr[i].replace(/AMescape2/g,AMdelimiter2).
+                      replace(/AMescape1/g,AMdelimiter1);
+      if (arr.length>1 || mtch) {
+        if (checkForMathML) {
+          checkForMathML = false;
+          var nd = AMisMathMLavailable();
+          AMnoMathML = nd != null;
+          if (AMnoMathML && notifyIfNoMathML) 
+            if (alertIfNoMathML)
+              alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n\
+                or Firefox/Mozilla/Netscape");
+            else AMbody.insertBefore(nd,AMbody.childNodes[0]);
+        }
+        if (!AMnoMathML) {
+          frg = AMstrarr2docFrag(arr,n.nodeType==8);
+          var len = frg.childNodes.length;
+          n.parentNode.replaceChild(frg,n);
+          return len-1;
+        } else return 0;
+      }
+    }
+   } else return 0;
+  } else if (n.nodeName!="math") {
+    for (i=0; i<n.childNodes.length; i++)
+      i += AMprocessNodeR(n.childNodes[i], linebreaks);
+  }
+  return 0;
+}
+
+function AMprocessNode(n, linebreaks, spanclassAM) {
+  var frag,st;
+  if (spanclassAM!=null) {
+    frag = document.getElementsByTagName("span")
+    for (var i=0;i<frag.length;i++)
+      if (frag[i].className == "AM")
+        AMprocessNodeR(frag[i],linebreaks);
+  } else {
+    try {
+      st = n.innerHTML;
+    } catch(err) {}
+    if (st==null || 
+        st.indexOf(AMdelimiter1)!=-1 || st.indexOf(AMdelimiter2)!=-1) 
+      AMprocessNodeR(n,linebreaks);
+  }
+  if (isIE) { //needed to match size and font of formula to surrounding text
+    frag = document.getElementsByTagName('math');
+    for (var i=0;i<frag.length;i++) frag[i].update()
+  }
+}
+
+var AMbody;
+var AMnoMathML = false, AMtranslated = false;
+
+function translate(spanclassAM) {
+  if (!AMtranslated) { // run this only once
+    AMtranslated = true;
+    AMinitSymbols();
+    AMbody = document.getElementsByTagName("body")[0];
+    AMprocessNode(AMbody, false, spanclassAM);
+  }
+}
+
+if (isIE) { // avoid adding MathPlayer info explicitly to each webpage
+  document.write("<object id=\"mathplayer\"\
+  classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");
+  document.write("<"+"?import namespace=\"m\" implementation=\"#mathplayer\"?>");
+}
+
+// GO1.1 Generic onload by Brothercake 
+// http://www.brothercake.com/
+//onload function (replaces the onload="translate()" in the <body> tag)
+function generic()
+{
+  translate();
+};
+//setup onload function
+if(typeof window.addEventListener != 'undefined')
+{
+  //.. gecko, safari, konqueror and standard
+  window.addEventListener('load', generic, false);
+}
+else if(typeof document.addEventListener != 'undefined')
+{
+  //.. opera 7
+  document.addEventListener('load', generic, false);
+}
+else if(typeof window.attachEvent != 'undefined')
+{
+  //.. win/ie
+  window.attachEvent('onload', generic);
+}
+//** remove this condition to degrade older browsers
+else
+{
+  //.. mac/ie5 and anything else that gets this far
+  //if there's an existing onload function
+  if(typeof window.onload == 'function')
+  {
+    //store it
+    var existing = onload;
+    //add new onload handler
+    window.onload = function()
+    {
+      //call existing onload function
+      existing();
+      //call generic onload function
+      generic();
+    };
+  }
+  else
+  {
+    //setup onload function
+    window.onload = generic;
+  }
+}
Index: /branches/new-dialogs-merge/plugins/Equation/popups/dialog.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/popups/dialog.html (revision 987)
+++ /branches/new-dialogs-merge/plugins/Equation/popups/dialog.html (revision 987)
@@ -0,0 +1,358 @@
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>AsciiMath Formula Input</title>
+  <script type="text/javascript" src="../../../popups/popup.js"></script>
+  <script type="text/javascript" src="../ASCIIMathML.js"></script>
+  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+
+  <style type="text/css">
+	/* <![CDATA[ */
+	#outputNode,#inputText,#mathml {
+		padding:5px;
+		background-color:white;
+		width:98%;
+		height:200px;
+		font-size:1.3em;
+		border: 1px solid darkgrey;
+		overflow:auto;
+	}
+	#clickInput {
+		width:100%;
+		border-collapse:collapse;
+		background-color: white;
+		text-align:center;
+	}
+	#clickInput td {
+		border: thin solid gray;
+		cursor:pointer;
+		font-size:1.1em;
+		
+	}
+	h3 {
+		font-size:1.6em;
+	}
+	/* ]]> */
+  </style>
+  <script type="text/javascript">
+ // <![CDATA[
+   window.resizeTo(500, 300);
+var showasciiformulaonhover = false;
+if (typeof Xinha == "undefined")
+	Xinha = window.opener.Xinha;
+
+function i18n(str) {
+  return (Xinha._lc(str, 'Equation'));
+}
+function set (string)
+{
+	var inputField = document.getElementById("inputText");
+	inputField.value += string;
+	preview();
+	inputField.focus();
+	return false;
+}
+function preview() {
+  if (document.getElementById("inputText") != '') {
+      var str = document.getElementById("inputText").value;
+      var outnode = document.getElementById("outputNode");
+      var newnode = AMcreateElementXHTML("div");
+      newnode.setAttribute("id","outputNode");
+      outnode.parentNode.replaceChild(newnode,outnode);
+      outnode = document.getElementById("outputNode");
+      var n = outnode.childNodes.length;
+      for (var i = 0; i < n; i++)
+        outnode.removeChild(outnode.firstChild);
+      outnode.appendChild(document.createComment("`"+str+"`"));
+      AMprocessNode(outnode,true);
+  }
+}
+function Init() {
+	__dlg_translate('Equation');
+	__dlg_init();
+	var param = window.dialogArguments;
+	var cfg = param["editor"].config;
+	
+	mathcolor = cfg.Equation.mathcolor;
+	mathfontfamily = cfg.Equation.mathfontfamily;
+	
+	translate();
+	var inputField = document.getElementById("inputText"); 
+	
+	if (param["editedNode"] && param["editedNode"].tagName.toLowerCase() == 'span')
+	{
+		var formula = param["editedNode"].getAttribute("title").replace(/^`*(.*?)`*$/m,"$1");
+		if (!formula) formula = param["editedNode"].innerHTML.replace(/^`*(.*?)`*$/m,"$1"); 
+		inputField.value = formula;
+		preview();
+	}
+	else inputField.value = '';
+	inputField.focus();
+}
+  
+function onOK() {
+ 	
+ var param = {
+ 	"editedNode":window.dialogArguments.editedNode,
+ 	"formula" : document.getElementById("inputText").value
+ };
+ 
+ __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+function translate() {
+  if (!AMtranslated) { // run this only once
+    AMtranslated = true;
+    AMinitSymbols();
+    AMprocessNode(document.getElementById("clickInput"),true);
+    preview();
+  }
+}
+window.onload = Init;
+
+function AMnode2string(inNode,indent) {
+// thanks to James Frazer for contributing an initial version of this function
+   var i, str = "";
+   if(inNode.nodeType == 1) {
+       var name = inNode.nodeName.toLowerCase(); // (IE fix)
+       str = "\r" + indent + "<" + name;
+       for(i=0; i < inNode.attributes.length; i++)
+           if (inNode.attributes[i].nodeValue!="italic" &&
+               inNode.attributes[i].nodeValue!="" &&  //stop junk attributes
+               inNode.attributes[i].nodeValue!="inherit" && // (mostly IE)
+               inNode.attributes[i].nodeValue!=undefined &&
+               inNode.attributes[i].nodeName[0] != '-'
+               )
+               str += " "+inNode.attributes[i].nodeName+"="+
+                     "\""+inNode.attributes[i].nodeValue+"\"";
+       if (name == "math") 
+           str += " xmlns=\"http://www.w3.org/1998/Math/MathML\"";
+       str += ">";
+       for(i=0; i<inNode.childNodes.length; i++)
+           str += AMnode2string(inNode.childNodes[i], indent+"  ");
+       if (name != "mo" && name != "mi" && name != "mn") str += "\r"+indent;
+       str += "</" + name + ">";
+   }
+   else if(inNode.nodeType == 3) {
+       var st = inNode.nodeValue;
+       for (i=0; i<st.length; i++)
+           if (st.charCodeAt(i)<32 || st.charCodeAt(i)>126)
+               str += "&#"+st.charCodeAt(i)+";";
+           else if (st.charAt(i)=="<" && indent != "  ") str += "&lt;";
+           else if (st.charAt(i)==">" && indent != "  ") str += "&gt;";
+           else if (st.charAt(i)=="&" && indent != "  ") str += "&amp;";
+           else str += st.charAt(i);
+   }
+   return str;
+} 
+function showMathML()
+{
+	var math = document.getElementById("outputNode").getElementsByTagName("math")[0];
+	if (math)
+		math.parentNode.innerHTML = '<pre>'+Xinha.htmlEncode(AMnode2string(math,''))+'</pre>';
+}
+// ]]>
+</script>
+
+</head>
+
+<body class="dialog">
+<div class="title">AsciiMath Formula Input</div>
+<!--
+Table modified from CharacterMap for ASCIIMathML by Peter Jipsen
+HTMLSource based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) modified by Holger Hees
+Original Author - Bernhard Pfeifer novocaine@gmx.net
+-->
+<table  id="clickInput">
+<tr>
+<td colspan="3" class="character" title="(x+1)/(x-1)" onclick="set('(x+1)/(x-1)')">`(x+1)/(x-1)`</td>
+<td colspan="2" class="character" title="x^(m+n)" onclick="set('x^(m+n)')">`x^(m+n)`</td>
+<td colspan="2" class="character" title="x_(mn)" onclick="set('x_(mn)')">`x_(mn)`</td>
+<td colspan="2" class="character" title="sqrt(x)" onclick="set('sqrt(x)')">`sqrt(x)`</td>
+<td colspan="3" class="character" title="root(n)(x)" onclick="set('root(n)(x)')">`root(n)(x)`</td>
+<td colspan="2" class="character" title="&quot;text&quot;" onclick="set('&quot;text&quot;')">`&quot;text&quot;`</td>
+<td colspan="2" class="character" style="cursor:default"></td>
+</tr><tr>
+<td colspan="2" class="character" title="dy/dx" onclick="set('dy/dx')">`dy/dx`</td>
+<td colspan="3" class="character" title="lim_(x-&gt;oo)" onclick="set('lim_(x-&gt;oo)')">`lim_(x-&gt;oo)`</td>
+<td colspan="3" class="character" title="sum_(n=1)^oo" onclick="set('sum_(n=1)^oo')">`sum_(n=1)^oo`</td>
+<td colspan="3" class="character" title="int_a^bf(x)dx" onclick="set('int_a^bf(x)dx')">`int_a^bf(x)dx`</td>
+<td colspan="3" class="character" title="[[a,b],[c,d]]" onclick="set('[[a,b],[c,d]]')">`[[a,b],[c,d]]`</td>
+<td colspan="2" class="character" title="((n),(k))" onclick="set('((n),(k))')">`((n),(k))`</td>
+</tr><tr>
+<td class="character" title="*" onclick="set('*')">`*`</td>
+<td class="character" title="**" onclick="set('**')">`**`</td>
+<td class="character" title="//" onclick="set('//')">`//`</td>
+<td class="character" title="\\" onclick="set('\\\\')">`\\`</td>
+<td class="character" title="xx" onclick="set('xx')">`xx`</td>
+<td class="character" title="-:" onclick="set('-:')">`-:`</td>
+<td class="character" title="@" onclick="set('@')">`@`</td>
+<td class="character" title="o+" onclick="set('o+')">`o+`</td>
+<td class="character" title="ox" onclick="set('ox')">`ox`</td>
+<td class="character" title="o." onclick="set('o.')">`o.`</td>
+<td class="character" title="sum" onclick="set('sum')">`sum`</td>
+<td class="character" title="prod" onclick="set('prod')">`prod`</td>
+<td class="character" title="^^" onclick="set('^^')">`^^`</td>
+<td class="character" title="^^^" onclick="set('^^^')"><span style="font-size:larger">`&and;`</span></td>
+<td class="character" title="vv" onclick="set('vv')">`vv`</td>
+<td class="character" title="vvv" onclick="set('vvv')"><span style="font-size:larger">`&or;`</span></td>
+</tr><tr>
+<td class="character" title="!=" onclick="set('!=')">`!=`</td>
+<td class="character" title="&lt;=" onclick="set('&lt;=')">`&lt;=`</td>
+<td class="character" title="&gt;=" onclick="set('&gt;=')">`&gt;=`</td>
+<td class="character" title="-&lt;" onclick="set('-&lt;')">`-&lt;`</td>
+<td class="character" title="&gt;-" onclick="set('&gt;-')">`&gt;-`</td>
+<td class="character" title="in" onclick="set('in')">`in`</td>
+<td class="character" title="!in" onclick="set('!in')">`!in`</td>
+<td class="character" title="sub" onclick="set('sub')">`sub`</td>
+<td class="character" title="sup" onclick="set('sup')">`sup`</td>
+<td class="character" title="sube" onclick="set('sube')">`sube`</td>
+<td class="character" title="supe" onclick="set('supe')">`supe`</td>
+<td class="character" title="O/" onclick="set('O/')">`O/`</td>
+<td class="character" title="nn" onclick="set('nn')">`nn`</td>
+<td class="character" title="nnn" onclick="set('nnn')"><span style="font-size:larger">`&cap;`</span></td>
+<td class="character" title="uu" onclick="set('uu')">`uu`</td>
+<td class="character" title="uuu" onclick="set('uuu')"><span style="font-size:larger">`&cup;`</span></td>
+</tr><tr>
+<td class="character" title="and" onclick="set('and')">`and`</td>
+<td class="character" title="or" onclick="set('or')">`or`</td>
+<td class="character" title="not" onclick="set('not')">`not`</td>
+<td class="character" title="=&gt;" onclick="set('==&gt;')">`=&gt;`</td>
+<td class="character" title="if" onclick="set('if')">`if`</td>
+<td class="character" title="&lt;=&gt;" onclick="set('&lt;=&gt;')">`&lt;=&gt;`</td>
+<td class="character" title="AA" onclick="set('AA')">`AA`</td>
+<td class="character" title="EE" onclick="set('EE')">`EE`</td>
+<td class="character" title="_|_" onclick="set('_|_')">`_|_`</td>
+<td class="character" title="TT" onclick="set('TT')">`TT`</td>
+<td class="character" title="|--" onclick="set('|--')">`|--`</td>
+<td class="character" title="|==" onclick="set('|==')">`|==`</td>
+<td class="character" title="-=" onclick="set('-=')">`-=`</td>
+<td class="character" title="~=" onclick="set('~=')">`~=`</td>
+<td class="character" title="~~" onclick="set('~~')">`~~`</td>
+<td class="character" title="prop" onclick="set('prop')">`prop`</td>
+</tr><tr>
+<td class="character" title="int" onclick="set('int')">`int`</td>
+<td class="character" title="oint" onclick="set('oint')">`oint`</td>
+<td class="character" title="del" onclick="set('del')">`del`</td>
+<td class="character" title="grad" onclick="set('grad')">`grad`</td>
+<td class="character" title="+-" onclick="set('+-')">`+-`</td>
+<td class="character" title="oo" onclick="set('oo')">`oo`</td>
+<td class="character" title="aleph" onclick="set('aleph')">`aleph`</td>
+<td class="character" title="quad" onclick="set('quad')">`quad`</td>
+<td class="character" title="diamond" onclick="set('diamond')">`diamond`</td>
+<td class="character" title="square" onclick="set('square')">`square`</td>
+<td class="character" title="|__" onclick="set('|__')">`|__`</td>
+<td class="character" title="__|" onclick="set('__|')">`__|`</td>
+<td class="character" title="|~" onclick="set('|~')">`|~`</td>
+<td class="character" title="~|" onclick="set('~|')">`~|`</td>
+<td class="character" title="&lt;x&gt;" onclick="set('&lt;x&gt;')">`&lt;x&gt;`</td>
+<td class="character" title="/_" onclick="set('/_')">`/_`</td>
+</tr><tr>
+<td class="character" title="uarr" onclick="set('uarr')">`uarr`</td>
+<td class="character" title="darr" onclick="set('darr')">`darr`</td>
+<td class="character" title="larr" onclick="set('larr')">`larr`</td>
+<td class="character" title="-&gt;" onclick="set('-&gt;')">`-&gt;`</td>
+<td class="character" title="|-&gt;" onclick="set('|-&gt;')">`|-&gt;`</td>
+<td class="character" title="harr" onclick="set('harr')">`harr`</td>
+<td class="character" title="lArr" onclick="set('lArr')">`lArr`</td>
+<td class="character" title="rArr" onclick="set('rArr')">`rArr`</td>
+<td class="character" title="hArr" onclick="set('hArr')">`hArr`</td>
+<td class="character" title="hata" onclick="set('hat')">`hata`</td>
+<td class="character" title="ula" onclick="set('ul')">`ula`</td>
+<td class="character" title="dota" onclick="set('dot')">`dota`</td>
+<td class="character" title="ddota" onclick="set('ddot')">`ddota`</td>
+<td class="character" title="veca" onclick="set('vec')">`veca`</td>
+<td class="character" title="bara" onclick="set('bar')">`bara`</td>
+<td class="character" title=":." onclick="set(':.')">`:.`</td>
+</tr><tr>
+<td class="character" title="NN" onclick="set('NN')">`NN`</td>
+<td class="character" title="ZZ" onclick="set('ZZ')">`ZZ`</td>
+<td class="character" title="QQ" onclick="set('QQ')">`QQ`</td>
+<td class="character" title="RR" onclick="set('RR')">`RR`</td>
+<td class="character" title="CC" onclick="set('CC')">`CC`</td>
+<td class="character" title="bba" onclick="set('bb')">`bba`</td>
+<td class="character" title="bbba" onclick="set('bbb')">`bbba`</td>
+<td class="character" title="cca" onclick="set('cc')">`cca`</td>
+<td class="character" title="fra" onclick="set('fr')">`fra`</td>
+<td class="character" title="sfa" onclick="set('sf')">`sfa`</td>
+<td class="character" title="tta" onclick="set('tt')">`tta`</td>
+<td colspan="4" class="character" title="stackrel(-&gt;)(+)" onclick="set('stackrel(-&gt;)(+)')">`stackrel(-&gt;)(+)`</td>
+<td class="character" title="upsilon" onclick="set('upsilon')">`upsilon`</td>
+</tr><tr>
+<td class="character" title="alpha" onclick="set('alpha')">`alpha`</td>
+<td class="character" title="beta" onclick="set('beta')">`beta`</td>
+<td class="character" title="gamma" onclick="set('gamma')">`gamma`</td>
+<td class="character" title="Gamma" onclick="set('Gamma')">`Gamma`</td>
+<td class="character" title="delta" onclick="set('delta')">`delta`</td>
+<td class="character" title="Delta" onclick="set('Delta')">`Delta`</td>
+<td class="character" title="epsi" onclick="set('epsi')">`epsi`</td>
+<td class="character" title="zeta" onclick="set('zeta')">`zeta`</td>
+<td class="character" title="eta" onclick="set('eta')">`eta`</td>
+<td class="character" title="theta" onclick="set('theta')">`theta`</td>
+<td class="character" title="Theta" onclick="set('Theta')">`Theta`</td>
+<td class="character" title="iota" onclick="set('iota')">`iota`</td>
+<td class="character" title="kappa" onclick="set('kappa')">`kappa`</td>
+<td class="character" title="lambda" onclick="set('lambda')">`lambda`</td>
+<td class="character" title="Lambda" onclick="set('Lambda')">`Lambda`</td>
+<td class="character" title="mu" onclick="set('mu')">`mu`</td>
+</tr><tr>
+<td class="character" title="nu" onclick="set('nu')">`nu`</td>
+<td class="character" title="pi" onclick="set('pi')">`pi`</td>
+<td class="character" title="Pi" onclick="set('Pi')">`Pi`</td>
+<td class="character" title="rho" onclick="set('rho')">`rho`</td>
+<td class="character" title="sigma" onclick="set('sigma')">`sigma`</td>
+<td class="character" title="Sigma" onclick="set('Sigma')">`Sigma`</td>
+<td class="character" title="tau" onclick="set('tau')">`tau`</td>
+<td class="character" title="xi" onclick="set('xi')">`xi`</td>
+<td class="character" title="Xi" onclick="set('Xi')">`Xi`</td>
+<td class="character" title="phi" onclick="set('phi')">`phi`</td>
+<td class="character" title="Phi" onclick="set('Phi')">`Phi`</td>
+<td class="character" title="chi" onclick="set('chi')">`chi`</td>
+<td class="character" title="psi" onclick="set('psi')">`psi`</td>
+<td class="character" title="Psi" onclick="set('Psi')">`Psi`</td>
+<td class="character" title="omega" onclick="set('omega')">`omega`</td>
+<td class="character" title="Omega" onclick="set('Omega')">`Omega`</td>
+</tr>
+</table>
+<form action="javascript:void(0);">
+<table style="width: 100%;border:none">
+  <tr>
+    <td style="width:50%">Input</td><td style="width:50%"><input type="button" onclick="showMathML()" style="float:right;font-size:10px" value="Show MathML" /><span>Preview</span></td>
+  </tr>
+  <tr>
+    <td>
+    <textarea id="inputText" onkeyup="preview()"></textarea>
+    </td>
+    <td>
+    <div id="outputNode"></div>
+    <textarea id="mathml" style="display:none"></textarea>
+    </td>
+  </tr>
+  <tr><td colspan="2">
+  <span>Based on ASCIIMathML by </span><a href="http://www.chapman.edu/~jipsen" onclick="window.open(this.href,'_blank','');return false;">Peter Jipsen</a>, 
+<a href="http://www.chapman.edu" onclick="window.open(this.href,'_blank','');return false;">Chapman University</a><br />
+  <span>For more information on AsciiMathML visit this page: </span><a href="http://www1.chapman.edu/~jipsen/mathml/asciimath.html" onclick="window.open(this.href,'_blank','');return false;">http://www1.chapman.edu/~jipsen/mathml/asciimath.html</a></td></tr>
+</table>
+
+<div id="buttons">
+<script type="text/javascript">
+// <![CDATA[
+if (Xinha.is_ie)
+ document.write('<span style="color:red;float:left">'+i18n('Attention Internet Explorer users: Please note that there is no WYSIWYG representation of the formula in the editor!<br />You might wish to use <a href="http://www.mozilla.com" onclick="window.open(this.href,\'_blank\');return false;">Mozilla Firefox</a> instead.')+'</span>');
+// ]]>
+</script>
+  <button type="submit" name="ok" onclick="return onOK();">OK</button>
+  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/Equation/readme.txt
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/readme.txt (revision 942)
+++ /branches/new-dialogs-merge/plugins/Equation/readme.txt (revision 942)
@@ -0,0 +1,38 @@
+AsciiMathML Formula Editor for Xinha
+ _______________________
+ 
+Based on AsciiMathML by Peter Jipsen (http://www.chapman.edu/~jipsen).
+Plugin by Raimund Meyer (ray) xinha@raimundmeyer.de
+
+AsciiMathML is a JavaScript library for translating ASCII math notation to Presentation MathML.
+
+Usage
+ The formmulae are stored in their ASCII representation, so you have to include the 
+ ASCIIMathML library which can be found in the plugin folder in order to render the MathML output in your pages. 
+ 
+ Example (also see example.html):
+  var mathcolor = "black"; //  You may change the color of the formulae (default: red)
+  var mathfontfamily = "Arial"; //and the font (default: serif, which is good I think)
+  var showasciiformulaonhover = false; // if true helps students learn ASCIIMath (default:true)
+  <script type="text/javascript" src="/xinha/plugins/AsciiMath/ASCIIMathML.js"></script>
+
+ The recommended browser for using this plugin is Mozilla/Firefox. At the moment showing the MathML output
+ inside the editor is not supported in Internet Explorer.
+ 
+ 
+License information
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This 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
+ Lesser General Public License (at http://www.gnu.org/licenses/lgpl.html) 
+ for more details.
+ 
+ NOTE: I have changed the license of AsciiMathML from GPL to LGPL according to a permission 
+ from the author (see http://xinha.gogo.co.nz/punbb/viewtopic.php?pid=4150#p4150)
+ Raimund Meyer 11-29-2006
Index: /branches/new-dialogs-merge/plugins/Equation/example.html
===================================================================
--- /branches/new-dialogs-merge/plugins/Equation/example.html (revision 987)
+++ /branches/new-dialogs-merge/plugins/Equation/example.html (revision 987)
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>AsciiMathML Example</title>
+  <script type="text/javascript">
+    var mathcolor = "black"; 
+  </script>
+  <script type="text/javascript" src="ASCIIMathML.js"></script>
+<style type="text/css">
+  body { font-family: sans-serif }
+  pre {border: dotted grey thin; background-color:LightYellow; }
+  
+  </style>
+</head>
+
+<body >
+<h1>AsciiMathML Example</h1>
+<p>This shows how to set up your page to display MathML using AsciiMathML</p>
+<p>Add this to the head section of your document:</p>
+<pre>
+
+  &lt;!-- This block is optional configuration --&gt;
+  &lt;script type="text/javascript"&gt;
+    var mathcolor = "black"; // You may change the color of the formulae (default: red)
+    var showasciiformulaonhover = false; // helps students learn ASCIIMath, set to false if you like  (default:true)
+    var mathfontfamily = "Arial"; //and the font (default: serif, which is good I think)
+  &lt;/script&gt;
+  &lt;!-- THIS LOADS THE ACTUAL SCRIPT, PLEASE ADJUST THE URL --&lt;
+  &lt;script type="text/javascript" src="/xinha/plugins/Equation/ASCIIMathML.js"&gt;&lt;/script&gt;
+
+
+</pre>
+<p><span class="AM">`int_a^bf(x)dx`</span></p>
+<p><span class="AM">`[[a,b],[c,d]]`</span><br /></p>
+<p>
+ ASCIIMathML by <a href="http://www.chapman.edu/~jipsen" onclick="window.open(this.href,'_blank');return false;">Peter Jipsen</a>, 
+<a href="http://www.chapman.edu" onclick="window.open(this.href,'_blank');return false;">Chapman University</a><br />
+  For more information on AsciiMathML visit this page: <a href="http://www1.chapman.edu/~jipsen/mathml/asciimath.html" onclick="window.open(this.href,'_blank','');return false;">http://www1.chapman.edu/~jipsen/mathml/asciimath.html</a>
+
+</p>
+</body>
+</html>
Index: /branches/new-dialogs-merge/plugins/CharacterMap/CharacterMap.css
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/CharacterMap.css (revision 677)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/CharacterMap.css (revision 677)
@@ -0,0 +1,41 @@
+.CharacterMap { }
+.CharacterMap a.entity {
+  font-size:12px;
+  width:18px;
+  display:block;
+  float:left;
+  padding:2px;
+  text-decoration:none;
+  color:#000;
+  text-align:center;
+  
+}
+.CharacterMap a.light {
+  background-color:#ffffff;
+}
+.CharacterMap a.dark {
+  background-color:#f7f8fd;
+}
+.CharacterMap a.entity:hover {
+  background-color:#ffd760;
+  color:#000;
+}
+.popup td.character {
+  font-family:Verdana,Arial,Helvetica,sans-serif;
+  font-size:14px;
+  font-weight:bold;
+  text-align:center;
+  background:#fff;
+  padding:4px;
+}
+.popup td.character-hilite {
+  background:#ffd760;
+}
+.popup form {
+  text-align:center;
+}
+.popup table {
+  cursor:pointer;
+  background-color:#ADAD9C;
+  border:1px inset;
+}
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/pt_br.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/pt_br.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/pt_br.js (revision 901)
@@ -0,0 +1,19 @@
+﻿// I18N constants
+
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+
+// Author: Marcio Barbosa, <marcio@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+
+// Last revision: 05 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Cancel": "Cancelar",
+  "Insert special character": "Inserir caracter especial"
+}
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/ru.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/ru.js (revision 901)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/ru.js (revision 901)
@@ -0,0 +1,7 @@
+﻿// I18N constants
+// LANG: "ru", ENCODING: UTF-8
+// Author: Andrei Blagorazumov, a@fnr.ru
+{
+  "Insert special character": "Вставить специальный символ",
+  "Cancel": "Отменить"
+};
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/fr.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/fr.js (revision 822)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/fr.js (revision 822)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Insert special character": "InsÃ©rer un caractÃšre spÃ©cial",
+  "Cancel": "Annuler"
+};
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/de.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/de.js (revision 383)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/de.js (revision 383)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Insert special character": "Sonderzeichen einfÃŒgen",
+  "Cancel": "Abbrechen"
+}
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/sv.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/sv.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/sv.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "sv" (Swedish), ENCODING: UTF-8
+// translated: Erik DalÃ©n <dalen@jpl.se>
+{
+  "Insert special character": "Infoga tecken",
+  "Cancel": "Avbryt"
+};
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/nl.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/nl.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/nl.js (revision 677)
@@ -0,0 +1,11 @@
+// I18N constants
+// LANG: "nl", ENCODING: UTF-8
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Insert special character": "Speciaal character invoegen",
+  "Cancel": "Annuleer"
+};
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/ja.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/ja.js (revision 715)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/ja.js (revision 715)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Insert special character": "ç¹æ®æå­ãæ¿å
+¥",
+  "Cancel": "äž­æ­¢"
+};
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/it.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/it.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/it.js (revision 677)
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "it", ENCODING: UTF-8
+{
+  "Insert special character": "Inserisca il carattere speciale",
+  "Cancel": "Annullamento"
+};
Index: /branches/new-dialogs-merge/plugins/CharacterMap/lang/nb.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/lang/nb.js (revision 677)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/lang/nb.js (revision 677)
@@ -0,0 +1,7 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Insert special character": "Sett inn tegn",
+  "Cancel": "Avbryt"
+};
Index: /branches/new-dialogs-merge/plugins/CharacterMap/character-map.js
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/character-map.js (revision 856)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/character-map.js (revision 856)
@@ -0,0 +1,124 @@
+// Character Map plugin for Xinha
+// Original Author - Bernhard Pfeifer novocaine@gmx.net
+Xinha.loadStyle( 'CharacterMap.css', 'CharacterMap' );
+
+function CharacterMap( editor )
+{
+  this.editor = editor;
+  var cfg = editor.config;
+  var self = this;
+  cfg.registerButton(
+    {
+      id       : 'insertcharacter',
+      tooltip  : Xinha._lc( 'Insert special character', 'CharacterMap' ),
+      image    : editor.imgURL( 'ed_charmap.gif', 'CharacterMap' ),
+      textMode : false,
+      action   : function( editor ) { self.buttonPress( editor ); }
+    }
+  );
+  cfg.addToolbarElement('insertcharacter', 'createlink', -1);
+
+  if ( cfg.CharacterMap.mode == 'panel' )
+  {
+    editor._CharacterMap = editor.addPanel( 'right' );
+    Xinha._addClass( editor._CharacterMap, 'CharacterMap' );
+
+    editor.notifyOn( 'modechange',
+      function( e, args )
+      {
+        if ( args.mode == 'text' ) editor.hidePanel( editor._CharacterMap );
+      }
+    );
+
+    var entites =
+    [
+      '&Yuml;', '&scaron;', '&#064;', '&quot;', '&iexcl;', '&cent;', '&pound;', '&curren;', '&yen;', '&brvbar;',
+      '&sect;', '&uml;', '&copy;', '&ordf;', '&laquo;', '&not;', '&macr;', '&deg;', '&plusmn;', '&sup2;',
+      '&sup3;', '&acute;', '&micro;', '&para;', '&middot;', '&cedil;', '&sup1;', '&ordm;', '&raquo;', '&frac14;',
+      '&frac12;', '&frac34;', '&iquest;', '&times;', '&Oslash;', '&divide;', '&oslash;', '&fnof;', '&circ;',
+      '&tilde;', '&ndash;', '&mdash;', '&lsquo;', '&rsquo;', '&sbquo;', '&ldquo;', '&rdquo;', '&bdquo;',
+      '&dagger;', '&Dagger;', '&bull;', '&hellip;', '&permil;', '&lsaquo;', '&rsaquo;', '&euro;', '&trade;',
+      '&Agrave;', '&Aacute;', '&Acirc;', '&Atilde;', '&Auml;', '&Aring;', '&AElig;', '&Ccedil;', '&Egrave;',
+      '&Eacute;', '&Ecirc;', '&Euml;', '&Igrave;', '&Iacute;', '&Icirc;', '&Iuml;', '&ETH;', '&Ntilde;',
+      '&Ograve;', '&Oacute;', '&Ocirc;', '&Otilde;', '&Ouml;', '&reg;', '&times;', '&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;', '&yacute;', '&thorn;',
+      '&yuml;', '&OElig;', '&oelig;', '&Scaron;'
+    ];
+
+    for ( var i=0; i<entites.length; i++ )
+      this.addEntity( entites[i], i );
+
+    editor.hidePanel( editor._CharacterMap );
+  }
+}
+
+// configuration mode : panel or popup
+Xinha.Config.prototype.CharacterMap =
+{
+  'mode': 'popup' // configuration mode : panel or popup
+};
+
+CharacterMap._pluginInfo =
+{
+  name          : "CharacterMap",
+  version       : "2.0",
+  developer     : "Laurent Vilday",
+  developer_url : "http://www.mokhet.com/",
+  c_owner       : "Xinha community",
+  sponsor       : "",
+  sponsor_url   : "",
+  license       : "Creative Commons Attribution-ShareAlike License"
+};
+
+CharacterMap._isActive = false;
+
+CharacterMap.prototype.buttonPress = function( editor )
+{
+  var cfg = editor.config;
+  if ( cfg.CharacterMap.mode == 'panel' )
+  {
+    if ( this._isActive )
+    {
+      this._isActive = false;
+      editor.hidePanel( editor._CharacterMap );
+    }
+    else
+    {
+      this._isActive = true;
+      editor.showPanel( editor._CharacterMap );
+    }
+  }
+  else
+  {
+    editor._popupDialog( "plugin://CharacterMap/select_character", function( entity )
+    {
+      if ( !entity ) return false;
+      if ( Xinha.is_ie ) editor.focusEditor();
+      editor.insertHTML( entity );
+    }, null);
+  }
+};
+
+CharacterMap.prototype.addEntity = function ( entite, pos )
+{
+  var editor = this.editor;
+  var self = this;
+  var a = document.createElement( 'a' );
+  Xinha._addClass( a, 'entity' );
+  a.innerHTML = entite;
+  a.href = 'javascript:void(0)';
+  Xinha._addClass(a, (pos%2)? 'light':'dark');
+  a.onclick = function()
+  {
+    if (Xinha.is_ie) editor.focusEditor();
+    editor.insertHTML( entite );
+    //self._isActive = false;
+    //editor.hidePanel( editor._CharacterMap );
+    return false;
+  };
+  editor._CharacterMap.appendChild( a );
+  a = null;
+};
Index: /branches/new-dialogs-merge/plugins/CharacterMap/popups/select_character.html
===================================================================
--- /branches/new-dialogs-merge/plugins/CharacterMap/popups/select_character.html (revision 740)
+++ /branches/new-dialogs-merge/plugins/CharacterMap/popups/select_character.html (revision 740)
@@ -0,0 +1,184 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html>
+<head>
+<title>Insert special character</title>
+<link rel="stylesheet" type="text/css" href="../CharacterMap.css" />
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
+<script type="text/javascript">
+  window.resizeTo(480, 300);
+// HTMLSource based on HTMLArea XTD 1.5 modified by Holger Hees
+// Original Author - Bernhard Pfeifer novocaine@gmx.net
+HTMLArea = window.opener.HTMLArea;
+function Init() // run on page load
+{
+  __dlg_translate('CharacterMap');
+  __dlg_init();
+
+  var character = ''; // set default input to empty
+  View( null, character );
+  document.getElementById("cancel").focus();
+}
+var oldView = null;
+function View( td, character ) // preview character
+{
+  if (oldView)
+    HTMLArea._removeClass(oldView, 'character-hilite');
+  if (td) {
+    oldView = td;
+    HTMLArea._addClass(oldView, 'character-hilite');
+  }
+}
+function Set( string ) // return character
+{
+  var character = string;
+  __dlg_close( character );
+}
+function onCancel() // cancel selection
+{
+  __dlg_close( null );
+  return false;
+}
+
+</script>
+</head>
+<body class="dialog popup" onload="Init();">
+<table border="0" cellspacing="1" cellpadding="0" width="100%">
+<tr>
+<td class="character" onmouseover="View(this,'&amp;Yuml;')" onclick="Set('&Yuml;')">&Yuml;</td>
+<td class="character" onmouseover="View(this,'&amp;scaron;')" onclick="Set('&scaron;')">&scaron;</td>
+<td class="character" onmouseover="View(this,'&amp;#064;')" onclick="Set('&#064;')">@</td>
+<td class="character" onmouseover="View(this,'&amp;quot;')" onclick="Set('&quot;')">&quot;</td>
+<td class="character" onmouseover="View(this,'&amp;iexcl;')" onclick="Set('&iexcl;')">&iexcl;</td>
+<td class="character" onmouseover="View(this,'&amp;cent;')" onclick="Set('&cent;')">&cent;</td>
+<td class="character" onmouseover="View(this,'&amp;pound;')" onclick="Set('&pound;')">&pound;</td>
+<td class="character" onmouseover="View(this,'&amp;curren;')" onclick="Set('&curren;')">&curren;</td>
+<td class="character" onmouseover="View(this,'&amp;yen;')" onclick="Set('&yen;')">&yen;</td>
+<td class="character" onmouseover="View(this,'&amp;brvbar;')" onclick="Set('&brvbar;')">&brvbar;</td>
+<td class="character" onmouseover="View(this,'&amp;sect;')" onclick="Set('&sect;')">&sect;</td>
+<td class="character" onmouseover="View(this,'&amp;uml;')" onclick="Set('&uml;')">&uml;</td>
+<td class="character" onmouseover="View(this,'&amp;copy;')" onclick="Set('&copy;')">&copy;</td>
+<td class="character" onmouseover="View(this,'&amp;ordf;')" onclick="Set('&ordf;')">&ordf;</td>
+<td class="character" onmouseover="View(this,'&amp;laquo;')" onclick="Set('&laquo;')">&laquo;</td>
+<td class="character" onmouseover="View(this,'&amp;not;')" onclick="Set('&not;')">&not;</td>
+</tr><tr>
+<td class="character" onmouseover="View(this,'&amp;macr;')" onclick="Set('&macr;')">&macr;</td>
+<td class="character" onmouseover="View(this,'&amp;deg;')" onclick="Set('&deg;')">&deg;</td>
+<td class="character" onmouseover="View(this,'&amp;plusmn;')" onclick="Set('&plusmn;')">&plusmn;</td>
+<td class="character" onmouseover="View(this,'&amp;sup2;')" onclick="Set('&sup2;')">&sup2;</td>
+<td class="character" onmouseover="View(this,'&amp;sup3;')" onclick="Set('&sup3;')">&sup3;</td>
+<td class="character" onmouseover="View(this,'&amp;acute;')" onclick="Set('&acute;')">&acute;</td>
+<td class="character" onmouseover="View(this,'&amp;micro;')" onclick="Set('&micro;')">&micro;</td>
+<td class="character" onmouseover="View(this,'&amp;para;')" onclick="Set('&para;')">&para;</td>
+<td class="character" onmouseover="View(this,'&amp;middot;')" onclick="Set('&middot;')">&middot;</td>
+<td class="character" onmouseover="View(this,'&amp;cedil;')" onclick="Set('&cedil;')">&cedil;</td>
+<td class="character" onmouseover="View(this,'&amp;sup1;')" onclick="Set('&sup1;')">&sup1;</td>
+<td class="character" onmouseover="View(this,'&amp;ordm;')" onclick="Set('&ordm;')">&ordm;</td>
+<td class="character" onmouseover="View(this,'&amp;raquo;')" onclick="Set('&raquo;')">&raquo;</td>
+<td class="character" onmouseover="View(this,'&amp;frac14;')" onclick="Set('&frac14;')">&frac14;</td>
+<td class="character" onmouseover="View(this,'&amp;frac12;')" onclick="Set('&frac12;')">&frac12;</td>
+<td class="character" onmouseover="View(this,'&amp;frac34;')" onclick="Set('&frac34;')">&frac34;</td>
+</tr><tr>
+<td class="character" onmouseover="View(this,'&amp;iquest;')" onclick="Set('&iquest;')">&iquest;</td>
+<td class="character" onmouseover="View(this,'&amp;times;')" onclick="Set('&times;')">&times;</td>
+<td class="character" onmouseover="View(this,'&amp;Oslash;')" onclick="Set('&Oslash;')">&Oslash;</td>
+<td class="character" onmouseover="View(this,'&amp;divide;')" onclick="Set('&divide;')">&divide;</td>
+<td class="character" onmouseover="View(this,'&amp;oslash;')" onclick="Set('&oslash;')">&oslash;</td>
+<td class="character" onmouseover="View(this,'&amp;fnof;')" onclick="Set('&fnof;')">&fnof;</td>
+<td class="character" onmouseover="View(this,'&amp;circ;')" onclick="Set('&circ;')">&circ;</td>
+<td class="character" onmouseover="View(this,'&amp;tilde;')" onclick="Set('&tilde;')">&tilde;</td>
+<td class="character" onmouseover="View(this,'&amp;ndash;')" onclick="Set('&ndash;')">&ndash;</td>
+<td class="character" onmouseover="View(this,'&amp;mdash;')" onclick="Set('&mdash;')">&mdash;</td>
+<td class="character" onmouseover="View(this,'&amp;lsquo;')" onclick="Set('&lsquo;')">&lsquo;</td>
+<td class="character" onmouseover="View(this,'&amp;rsquo;')" onclick="Set('&rsquo;')">&rsquo;</td>
+<td class="character" onmouseover="View(this,'&amp;sbquo;')" onclick="Set('&sbquo;')">&sbquo;</td>
+<td class="character" onmouseover="View(this,'&amp;ldquo;')" onclick="Set('&ldquo;')">&ldquo;</td>
+<td class="character" onmouseover="View(this,'&amp;rdquo;')" onclick="Set('&rdquo;')">&rdquo;</td>
+<td class="character" onmouseover="View(this,'&amp;bdquo;')" onclick="Set('&bdquo;')">&bdquo;</td>
+</tr><tr>
+<td class="character" onmouseover="View(this,'&amp;dagger;')" onclick="Set('&dagger;')">&dagger;</td>
+<td class="character" onmouseover="View(this,'&amp;Dagger;')" onclick="Set('&Dagger;')">&Dagger;</td>
+<td class="character" onmouseover="View(this,'&amp;bull;')" onclick="Set('&bull;')">&bull;</td>
+<td class="character" onmouseover="View(this,'&amp;hellip;')" onclick="Set('&hellip;')">&hellip;</td>
+<td class="character" onmouseover="View(this,'&amp;permil;')" onclick="Set('&permil;')">&permil;</td>
+<td class="character" onmouseover="View(this,'&amp;lsaquo;')" onclick="Set('&lsaquo;')">&lsaquo;</td>
+<td class="character" onmouseover="View(this,'&amp;rsaquo;')" onclick="Set('&rsaquo;')">&rsaquo;</td>
+<td class="character" onmouseover="View(this,'&amp;euro;')" onclick="Set('&euro;')">&euro;</td>
+<td class="character" onmouseover="View(this,'&amp;trade;')" onclick="Set('&trade;')">&trade;</td>
+<td class="character" onmouseover="View(this,'&amp;Agrave;')" onclick="Set('&Agrave;')">&Agrave;</td>
+<td class="character" onmouseover="View(this,'&amp;Aacute;')" onclick="Set('&Aacute;')">&Aacute;</td>
+<td class="character" onmouseover="View(this,'&amp;Acirc;')" onclick="Set('&Acirc;')">&Acirc;</td>
+<td class="character" onmouseover="View(this,'&amp;Atilde;')" onclick="Set('&Atilde;')">&Atilde;</td>
+<td class="character" onmouseover="View(this,'&amp;Auml;')" onclick="Set('&Auml;')">&Auml;</td>
+<td class="character" onmouseover="View(this,'&amp;Aring;')" onclick="Set('&Aring;')">&Aring;</td>
+<td class="character" onmouseover="View(this,'&amp;AElig;')" onclick="Set('&AElig;')">&AElig;</td>
+</tr><tr>
+<td class="character" onmouseover="View(this,'&amp;Ccedil;')" onclick="Set('&Ccedil;')">&Ccedil;</td>
+<td class="character" onmouseover="View(this,'&amp;Egrave;')" onclick="Set('&Egrave;')">&Egrave;</td>
+<td class="character" onmouseover="View(this,'&amp;Eacute;')" onclick="Set('&Eacute;')">&Eacute;</td>
+<td class="character" onmouseover="View(this,'&amp;Ecirc;')" onclick="Set('&Ecirc;')">&Ecirc;</td>
+<td class="character" onmouseover="View(this,'&amp;Euml;')" onclick="Set('&Euml;')">&Euml;</td>
+<td class="character" onmouseover="View(this,'&amp;Igrave;')" onclick="Set('&Igrave;')">&Igrave;</td>
+<td class="character" onmouseover="View(this,'&amp;Iacute;')" onclick="Set('&Iacute;')">&Iacute;</td>
+<td class="character" onmouseover="View(this,'&amp;Icirc;')" onclick="Set('&Icirc;')">&Icirc;</td>
+<td class="character" onmouseover="View(this,'&amp;Iuml;')" onclick="Set('&Iuml;')">&Iuml;</td>
+<td class="character" onmouseover="View(this,'&amp;ETH;')" onclick="Set('&ETH;')">&ETH;</td>
+<td class="character" onmouseover="View(this,'&amp;Ntilde;')" onclick="Set('&Ntilde;')">&Ntilde;</td>
+<td class="character" onmouseover="View(this,'&amp;Ograve;')" onclick="Set('&Ograve;')">&Ograve;</td>
+<td class="character" onmouseover="View(this,'&amp;Oacute;')" onclick="Set('&Oacute;')">&Oacute;</td>
+<td class="character" onmouseover="View(this,'&amp;Ocirc;')" onclick="Set('&Ocirc;')">&Ocirc;</td>
+<td class="character" onmouseover="View(this,'&amp;Otilde;')" onclick="Set('&Otilde;')">&Otilde;</td>
+<td class="character" onmouseover="View(this,'&amp;Ouml;')" onclick="Set('&Ouml;')">&Ouml;</td>
+</tr><tr>
+<td class="character" onmouseover="View(this,'&amp;reg;')" onclick="Set('&reg;')">&reg;</td>
+<td class="character" onmouseover="View(this,'&amp;times;')" onclick="Set('&times;')">&times;</td>
+<td class="character" onmouseover="View(this,'&amp;Ugrave;')" onclick="Set('&Ugrave;')">&Ugrave;</td>
+<td class="character" onmouseover="View(this,'&amp;Uacute;')" onclick="Set('&Uacute;')">&Uacute;</td>
+<td class="character" onmouseover="View(this,'&amp;Ucirc;')" onclick="Set('&Ucirc;')">&Ucirc;</td>
+<td class="character" onmouseover="View(this,'&amp;Uuml;')" onclick="Set('&Uuml;')">&Uuml;</td>
+<td class="character" onmouseover="View(this,'&amp;Yacute;')" onclick="Set('&Yacute;')">&Yacute;</td>
+<td class="character" onmouseover="View(this,'&amp;THORN;')" onclick="Set('&THORN;')">&THORN;</td>
+<td class="character" onmouseover="View(this,'&amp;szlig;')" onclick="Set('&szlig;')">&szlig;</td>
+<td class="character" onmouseover="View(this,'&amp;agrave;')" onclick="Set('&agrave;')">&agrave;</td>
+<td class="character" onmouseover="View(this,'&amp;aacute;')" onclick="Set('&aacute;')">&aacute;</td>
+<td class="character" onmouseover="View(this,'&amp;acirc;')" onclick="Set('&acirc;')">&acirc;</td>
+<td class="character" onmouseover="View(this,'&amp;atilde;')" onclick="Set('&atilde;')">&atilde;</td>
+<td class="character" onmouseover="View(this,'&amp;auml;')" onclick="Set('&auml;')">&auml;</td>
+<td class="character" onmouseover="View(this,'&amp;aring;')" onclick="Set('&aring;')">&aring;</td>
+<td class="character" onmouseover="View(this,'&amp;aelig;')" onclick="Set('&aelig;')">&aelig;</td>
+</tr><tr>
+<td class="character" onmouseover="View(this,'&amp;ccedil;')" onclick="Set('&ccedil;')">&ccedil;</td>
+<td class="character" onmouseover="View(this,'&amp;egrave;')" onclick="Set('&egrave;')">&egrave;</td>
+<td class="character" onmouseover="View(this,'&amp;eacute;')" onclick="Set('&eacute;')">&eacute;</td>
+<td class="character" onmouseover="View(this,'&amp;ecirc;')" onclick="Set('&ecirc;')">&ecirc;</td>
+<td class="character" onmouseover="View(this,'&amp;euml;')" onclick="Set('&euml;')">&euml;</td>
+<td class="character" onmouseover="View(this,'&amp;igrave;')" onclick="Set('&igrave;')">&igrave;</td>
+<td class="character" onmouseover="View(this,'&amp;iacute;')" onclick="Set('&iacute;')">&iacute;</td>
+<td class="character" onmouseover="View(this,'&amp;icirc;')" onclick="Set('&icirc;')">&icirc;</td>
+<td class="character" onmouseover="View(this,'&amp;iuml;')" onclick="Set('&iuml;')">&iuml;</td>
+<td class="character" onmouseover="View(this,'&amp;eth;')" onclick="Set('&eth;')">&eth;</td>
+<td class="character" onmouseover="View(this,'&amp;ntilde;')" onclick="Set('&ntilde;')">&ntilde;</td>
+<td class="character" onmouseover="View(this,'&amp;ograve;')" onclick="Set('&ograve;')">&ograve;</td>
+<td class="character" onmouseover="View(this,'&amp;oacute;')" onclick="Set('&oacute;')">&oacute;</td>
+<td class="character" onmouseover="View(this,'&amp;ocirc;')" onclick="Set('&ocirc;')">&ocirc;</td>
+<td class="character" onmouseover="View(this,'&amp;otilde;')" onclick="Set('&otilde;')">&otilde;</td>
+<td class="character" onmouseover="View(this,'&amp;ouml;')" onclick="Set('&ouml;')">&ouml;</td>
+</tr><tr>
+<td class="character" onmouseover="View(this,'&amp;divide;')" onclick="Set('&divide;')">&divide;</td>
+<td class="character" onmouseover="View(this,'&amp;oslash;')" onclick="Set('&oslash;')">&oslash;</td>
+<td class="character" onmouseover="View(this,'&amp;ugrave;')" onclick="Set('&ugrave;')">&ugrave;</td>
+<td class="character" onmouseover="View(this,'&amp;uacute;')" onclick="Set('&uacute;')">&uacute;</td>
+<td class="character" onmouseover="View(this,'&amp;ucirc;')" onclick="Set('&ucirc;')">&ucirc;</td>
+<td class="character" onmouseover="View(this,'&amp;uuml;')" onclick="Set('&uuml;')">&uuml;</td>
+<td class="character" onmouseover="View(this,'&amp;yacute;')" onclick="Set('&yacute;')">&yacute;</td>
+<td class="character" onmouseover="View(this,'&amp;thorn;')" onclick="Set('&thorn;')">&thorn;</td>
+<td class="character" onmouseover="View(this,'&amp;yuml;')" onclick="Set('&yuml;')">&yuml;</td>
+<td class="character" onmouseover="View(this,'&amp;OElig;')" onclick="Set('&OElig;')">&OElig;</td>
+<td class="character" onmouseover="View(this,'&amp;oelig;')" onclick="Set('&oelig;')">&oelig;</td>
+<td class="character" onmouseover="View(this,'&amp;Scaron;')" onclick="Set('&Scaron;')">&Scaron;</td>
+<td class="character" colspan="4">&nbsp;</td>
+</tr>
+</table><br>
+<form action="#"><button type="button" id="cancel" name="cancel" onclick="return onCancel();">Cancel</button></form>
+</body>
+</html>
