function code(){}
imagesDir = "";userColors = null;userColorsOnly = false;/* T O O L B A R   P A L E T T E S */function ToolbarPalette (name){this.name = name;this.toolbar = null;this.action = null;this.args = null;this.button = null;this.hidden = true;this.editor = null;var tbs = document.createElement ("DIV");tbs.style.position = "absolute";tbs.style.display = "none";tbs.style.zIndex = 30000;this.container = tbs;document.body.appendChild (tbs);var ctrl = new FLBControler();ctrl.initFromDOMElement (this.container);this.setEditor = function (ed){this.editor = ed;};this.setToolbar = function (toolbar){this.toolbar = toolbar;if (this.container.parent != null) {this.container.parent.removeChild (this.container);}document.body.appendChild (this.container);};this.setButton = function (button){this.button = button;};this.setAction = function (func, args){this.action = func;this.args = args;};this.draw = function (){};this.setPosition = function (x, y) {this.container.style.left = x + "px";this.container.style.top = y + "px";};this.visible = function () {return !this.hidden;};this.show = function () {this.hidden = false;this.container.style.display="block";};this.hide = function () {this.hidden = true;this.container.style.display="none";};this.drawAndPosition = function (){this.draw ();this.show();var x = getOffsetLeft (this.button);var y = getOffsetTop (this.button) + this.button.offsetHeight;var w = this.container.offsetWidth;var t = document.getElementById (this.toolbar.name+"_toolbar_table");var tw = t.offsetWidth;var tx = getOffsetLeft (t);if (w > tw) {x = tx;} else if (x + w > tx + tw) {x -= (w - this.button.offsetWidth);}this.setPosition (x, y);};this.valid = function (param) {var args = (this.args == '') ? this.args : (this.args + ", ");eval (this.action+"("+args + "'" + param + "')");this.hide();};}function SlidingDialog (name){this.isa = ToolbarPalette;this.isa (name);this.scrollx = 0;this.scrolly = 0;this.scrolls = 0;this.scrollh = 0;this.scrollo = 0;this.container.style.display = "block";this.container.style.visibility = "hidden";this.drawAndPosition = function (){this.draw ();var x = (document.body.clientWidth / 2) - (this.container.offsetWidth / 2);var y = -this.scrollh;if (browser.isIE) {this.scrollo = document.documentElement.scrollTop + document.body.scrollTop;}if (browser.isNS) {this.scrollo = window.scrollY;}y += this.scrollo;this.scrollx = x;this.scrolly = y;this.setPosition (x, y);};this.scrollin = function (){this.scrolly += this.scrolls;this.scrolls *= 1.5;if (this.scrolly > this.scrollo) {this.scrolly = this.scrollo;this.setPosition (this.scrollx, this.scrolly);}else{this.setPosition (this.scrollx, this.scrolly);setTimeout (this.name+'.scrollin()', 35);}};this.scrollout = function (){this.scrolly -= this.scrolls;this.scrolls *= 1.5;if (this.scrolly < (-this.scrollh + this.scrollo)){this.scrolly = (-this.scrollh + this.scrollo);this.setPosition (this.scrollx, this.scrolly);this.hidden = true;this.container.style.visibility="hidden";this.container.innerHTML="";}else{this.setPosition (this.scrollx, this.scrolly);setTimeout (this.name+'.scrollout()', 35);}};this.show = function (){this.hidden = false;this.container.style.visibility="visible";this.scrolls = 5;this.scrollin();};this.hide = function (){this.scrolls = 5;this.scrollout();};this.drawDialog = function (){};this.draw = function (){var str = this.drawDialog();this.container.innerHTML = str;this.scrollh = this.container.firstChild.offsetHeight;};}function TableFormatSelector (name){this.isa = ToolbarPalette;this.isa (name);this.draw = function () {var str = '';var title = locStr110;var astyle = 'style="width:50px;background-color:#A2BCBB; border: 1px inset #dddddd; font-family:Verdana,Arial,sans; font-size:8pt;"';var bstyle = 'style="background-color:#ededed; border: 1px outset #dddddd; font-family:Verdana,Arial,sans; font-size:8pt;"';var str = '';str += '<form onsubmit="return false;">';str += '<table width="270" bgcolor="#e6e6e6" border="0" cellspacing="2" cellpadding="1" style="font-family:Verdana; font-size:8pt;">';str += '<tr><td colspan="2"><img src="'+imagesDir+'table-big.gif" align="left">'+locStr110+'</td></tr>';str += '<tr><td align="right" nowrap width="150"><b>'+locStr111+' :</b></td><td width="120"><input onclick="this.select();" '+astyle+' id="tableFormatSelectorRow" type="text" value="2"></td></tr>';str += '<tr><td align="right" nowrap width="150"><b>'+locStr112+' :</b></td><td width="120"><input onclick="this.select();" '+astyle+' id="tableFormatSelectorCol" type="text" value="3"></td></tr>';str += '<tr><td colspan="2" align="right"><hr style="border-color:#f1f1f1; height:1px">';str += '<input '+bstyle+' type="button" value="'+locStr099+'" onclick="'+this.name+'.hide();"> ';str += '<input '+bstyle+' type="button" value="'+locStr101+'" onclick="'+this.name+'.valid();"> ';str += '</td></tr></table>';str += '</form>';this.container.innerHTML = str;};this.valid = function (){var row = document.getElementById ('tableFormatSelectorRow').value;var col = document.getElementById ('tableFormatSelectorCol').value;var args = (this.args == '') ? this.args : (this.args + ", ");eval (this.action+"("+args + "'" + row + "','"+col+"')");this.hide();};}function ObjectPropertySelector (name){this.isa = ToolbarPalette;this.isa (name);this.selectedElement = null;this.inspectedElement = null;this.valid = function (){this.hide();};this.setElement = function (e){this.selectedElement = e;this.inspectedElement = e;};this.draw = function (){var str = '';str += '<table style="font-family:Verdana,Arial,Sans;font-size:8pt;background-color:#e6e6e6;width:200px">';str += '<tr height="32"><td><img src="'+imagesDir+'props-big.gif" align="left" width=40 height=40>'+locStr114+'</td></tr>';str += '<tr height="25"><td>'+this.drawPath()+'</td></tr>';str += '<tr><td align="right">'+this.drawContent()+'</td></tr>';str += '</table>';this.container.innerHTML = str;};this.drawContent = function (){var name = this.inspectedElement.nodeName;var str = '';str += '<table style="font-family:Verdana,Arial,Sans;font-size:8pt">';if (name == 'IMG') str += this.drawImageContent ();else if (name == 'TD') str += this.drawCellContent ();else if (name == 'TABLE') str += this.drawTableContent ();else str += this.drawNotInspectable ();str += '</table>';return str;};this.setProperty = function (wprop, value, suffix){eval (this.name+".inspectedElement."+wprop+"='"+value+suffix+"'");if (wprop == "rowSpan") {eval (this.name+".inspectedElement.height=''");}if (wprop == "colSpan") {eval (this.name+".inspectedElement.width=''");}};this.drawAction = function (icon, title, func){var str = '<img align="center" alt="';str += title;str += '" title="';str += title;str += '" onclick="';str += this.name;str +='.';str += func;str += '();" border=0 src="';str += imagesDir;str += icon;str += '">';return str;};this.drawProperty = function (name, size, rprop, wprop, suffix){var f1 = this.name + '.setProperty(\''+ wprop + '\', this.value, \'' + suffix + '\');';var f2 = this.name + '.setProperty(\''+ wprop + '\', this.previousSibling.previousSibling.value, \'' + suffix + '\');';var str = '<tr><td align="right"><b>';str += name;str += '</b></td><td><input onclick="this.select();this.focus();" onchange="';str += f1;str += '" type="text" size="';str += size;str += '" maxlength="';str += '" style="font-family:Verdana,Arial,sans;font-size:8pt;" value="';str += eval (this.name + '.inspectedElement.' + rprop);str += '">&nbsp;<img onclick="';str += f2;str += '" align="center" src="';str += imagesDir;str += 'table/set.gif" border="0"></td></tr>';return str;};this.drawNotInspectable = function (){var str = '';str += '<tr><td align="center"><b>'+locStr135+'<br><br></b></td></tr>';return str;};this.drawImageContent = function (){var str = '';str += this.drawProperty (locStr116, 3, "offsetWidth", "style.width", "px");str += this.drawProperty (locStr115, 3, "offsetHeight", "style.height", "px");str += this.drawProperty (locStr117, 3, "hspace", "hspace", "");str += this.drawProperty (locStr118, 3, "vspace", "vspace", "");str += this.drawProperty (locStr119, 3, "border", "border", "");return str;};this.deleteRow = function (){var doc = eval (this.editor+".element.contentWindow.document");var tr = this.inspectedElement.parentNode;var prev_tr = tr.previousSibling;var tb = tr.parentNode;tb.removeChild (tr);if (tb.firstChild == null){var table = tb.parentNode;table.removeChild (tb);table.parentNode.removeChild (table);}if (prev_tr.nextSibling != null){this.setElement (prev_tr.nextSibling.firstChild);this.draw();} else {this.hide();}};this.deleteCell = function (){var doc = eval (this.editor+".element.contentWindow.document");var tr = this.inspectedElement.parentNode;tr.removeChild (this.inspectedElement);if (tr.firstChild == null) {var tb = tr.parentNode;tb.removeChild (tr);if (tb.firstChild == null){var table = tb.parentNode;table.removeChild (tb);table.parentNode.removeChild (table);}}this.hide();};this.insertRowBefore = function (){var doc = eval (this.editor+".element.contentWindow.document");var tr = this.inspectedElement.parentNode;var new_tr = doc.createElement ("TR");tr.parentNode.insertBefore (new_tr, tr);var rnode = tr.firstChild;while (rnode != null){var new_td = doc.createElement ("TD");var text = doc.createTextNode (locStr113);new_td.appendChild (text);new_td.rowSpan = rnode.rowSpan;new_td.colSpan = rnode.colSpan;new_td.width = rnode.width;new_td.height = rnode.height;new_tr.appendChild (new_td);rnode = rnode.nextSibling;}};this.insertRowAfter = function (){var doc = eval (this.editor+".element.contentWindow.document");var tr = this.inspectedElement.parentNode;var next_tr = tr.nextSibling;var new_tr = doc.createElement ("TR");if (next_tr == null) {tr.parentNode.appendChild (new_tr);} else {tr.parentNode.insertBefore (new_tr, next_tr);}var rnode = tr.firstChild;while (rnode != null){var new_td = doc.createElement ("TD");var text = doc.createTextNode (locStr113);new_td.appendChild (text);new_td.rowSpan = rnode.rowSpan;new_td.colSpan = rnode.colSpan;new_td.width = rnode.width;new_td.height = rnode.height;new_tr.appendChild (new_td);rnode = rnode.nextSibling;}};this.insertCellRight = function (){var doc = eval (this.editor+".element.contentWindow.document");var td = doc.createElement ("TD");var text = doc.createTextNode (locStr113);td.appendChild (text);var tr = this.inspectedElement.parentNode;var next = this.inspectedElement.nextSibling;if (next != null) {tr.insertBefore (td, next);} else {tr.appendChild (td);}};this.insertCellLeft = function (){var doc = eval (this.editor+".element.contentWindow.document");var td = doc.createElement ("TD");var text = doc.createTextNode (locStr113);td.appendChild (text);var tr = this.inspectedElement.parentNode;tr.insertBefore (td, this.inspectedElement);};this.drawCellContent = function (){var str = '';str += this.drawProperty (locStr116, 3, "width", "width", "");str += this.drawProperty (locStr115, 3, "height", "height", "");str += this.drawProperty (locStr120, 3, "rowSpan", "rowSpan", "");str += this.drawProperty (locStr121, 3, "colSpan", "colSpan", "");str += '<tr><td align="right"><b>'+locStr122+'</b></td><td>';str += this.drawAction ('table/cell_insert_left.png', locStr123, 'insertCellLeft');str += this.drawAction ('table/cell_delete.png', locStr124, 'deleteCell');str += this.drawAction ('table/cell_insert_right.png', locStr125, 'insertCellRight');str += '</td></tr>';str += '<tr><td align="right"><b>'+locStr126+'</b></td><td>';str += this.drawAction ('table/row_insert_before.png', locStr127, 'insertRowBefore');str += this.drawAction ('table/row_delete.png', locStr128, 'deleteRow');str += this.drawAction ('table/row_insert_after.png', locStr129, 'insertRowAfter');str += '</td></tr>';return str;};this.drawTableContent = function (){var str = '';str += this.drawProperty (locStr119, 3, "border", "border", "");str += this.drawProperty (locStr130, 3, "cellPadding", "cellPadding", "");str += this.drawProperty (locStr131, 3, "cellSpacing", "cellSpacing", "");return str;};this.drawPath = function (){var str = '';var e = this.selectedElement;var n = 0;var ie = null;if (this.inspectableName (this.inspectedElement) != null) {ie = this.inspectedElement;}while (e != null){if (e.nodeName == "BODY") {break;}var name = this.inspectableName (e);if (name != null){if (ie == null) {ie = e;}var tmp = '';tmp = '<a href="" onclick="'+this.name+'.inspect('+n+');return false;" style="color:#000000';if (e != ie) {tmp += ';text-decoration:none';}tmp += '">' + name + '</a>';str = tmp + str;str = ' / ' + str;}e = e.parentNode;n++;if (e == null) {break;}}if (ie != null) {this.inspectedElement = ie;}return str;};this.inspect = function (n){this.findInspected (n);this.draw();};this.findInspected = function (n){var e = this.selectedElement;var i = 0;while (e != null){if (i == n) {this.inspectedElement = e;break;}e = e.parentNode;i++;}};this.inspectableName = function (e){if (e.nodeName == "TABLE") return locStr132;else if (e.nodeName == "TD") return locStr133;else if (e.nodeName == "IMG") return locStr134;else return null;	};}function LinkSelector (name){this.isa = ToolbarPalette;this.isa (name);this.findCurrentURL = function (){return eval (this.editor +'.findCurrentURL()');};this.draw = function () {var href = this.findCurrentURL();var url = href[0];var target = href[1];var flag = true;if (url.length == 0) {url = 'http://';flag = false;}var title = locStr095;var astyle = 'style="width:190px;background-color:#A2BCBB; border: 1px inset #dddddd; font-family:Verdana,Arial,sans; font-size:8pt;"';var bstyle = 'style="background-color:#ededed; border: 1px outset #dddddd; font-family:Verdana,Arial,sans; font-size:8pt;"';var str = '';str += '<form onsubmit="return false;">';str += '<table width="270" bgcolor="#e6e6e6" border="0" cellspacing="2" cellpadding="1" style="font-family:Verdana; font-size:8pt;">';str += '<tr><td colspan="2"><img src="'+imagesDir+'link-big.gif" align="left">'+title+'</td></tr>';str += '<tr><td align="right" nowrap width="75"><b>URL :</b></td><td width="195"><input '+astyle+' id="linkSelectorURL" type="text" value="'+url+'"></td></tr>';str += '<tr><td align="right" nowrap width="75"><b>'+locStr096+' :</b></td><td width="195"><select '+astyle+' id="linkSelectorTarget">';str += '<option value=""';if (target == '') {str += ' selected';}str += '>'+locStr097+'</option>';str += '<option value="_top"';if (target == '_top') {str += ' selected';}str += '>'+locStr103+'</option>';str += '<option value="_blank"';if (target == '_blank') {str += ' selected';}str += '>'+locStr098+'</option>';str += '</select></td></tr>';str += '<tr><td colspan="2" align="right"><hr style="border-color:#f1f1f1; height:1px">';if (flag) {str += '<input '+bstyle+' type="button" value="'+locStr100+'" onclick="'+this.name+'.clear();"> ';}str += '<input '+bstyle+' type="button" value="'+locStr102+'" onclick="'+this.name+'.localFile();"> ';str += '<input '+bstyle+' type="button" value="'+locStr099+'" onclick="'+this.name+'.hide();"> ';str += '<input '+bstyle+' type="button" value="'+locStr101+'" onclick="'+this.name+'.valid();"> ';str += '</td></tr></table>';str += '</form>';this.container.innerHTML = str;};this.localFile = function (){if (uploader == null) {uploader = new FileUploader();uploader.start();}var target = document.getElementById ('linkSelectorTarget');var tv = target[target.selectedIndex].value;var uv = '__LOCAL_FILE__';this.hide();var args = (this.args == '') ? this.args : (this.args + ", ");eval (this.action+"("+args + "'" + uv + "','"+tv+"')");};this.clear = function (){var args = (this.args == '') ? this.args : (this.args + ", ");eval (this.action+"("+args + "'','')");this.hide();};this.valid = function (){var url = document.getElementById ('linkSelectorURL');var target = document.getElementById ('linkSelectorTarget');var uv = url.value;var tv = target[target.selectedIndex].value;var args = (this.args == '') ? this.args : (this.args + ", ");eval (this.action+"("+args + "'" + uv + "','"+tv+"')");this.hide();};}function LockSelector (name){this.isa = SlidingDialog;this.isa (name);this.nbItem = 0;this.size = 240;this.stateChanged = function (flag){if (document.FLBControler.selectedBlocks.length == 0){var state = document.FLBControler.type.get (flag);if (state == 1) {document.FLBControler.type.unset (flag);}else if (state == 0) {document.FLBControler.type.set (flag);}}else{var state = document.FLBControler.getBlocksState (flag);if (state == 1) {document.FLBControler.unsetBlocksState (flag);}else if (state == 0) {document.FLBControler.setBlocksState (flag);}}};this.drawSection = function (title){var str = '';str += '<tr><td width="'+this.size+'" colspan="2"></td></tr>';str += '<tr><td width="'+this.size+'" colspan="2"><b>'+title+'</b></td></tr>';return str;};this.drawItem = function (title, flag){this.nbItem++;var state = (document.FLBControler.selectedBlocks.length == 0) ? document.FLBControler.type.get (flag) : document.FLBControler.getBlocksState (flag);var str = '<tr>';str += '<td width="20"><input onchange="'+this.name+'.stateChanged('+flag+');" type="checkbox" ';if (state == 1) {str += 'checked';}else if (state == -1) {str += 'disabled';}str += '></td><td width="80">'+title+'</td>';str += '</tr>';return str;};this.drawNone = function (){this.nbItem++;return '<tr><td></td><td></td></tr>';};this.startColumn1 = function (){return '<tr><td valign="top" align="left"><table width="'+(this.size / 2)+'" cellspacing="0" cellpadding="0" border="0" style="font-family:Verdana; font-size:8pt;">';};this.endColumn1 = function (){return '</table></td>';};this.startColumn2 = function (){return '<td valign="top" align="left"><table width="'+(this.size / 2)+'" cellspacing="0" cellpadding="0" border="0" style="font-family:Verdana; font-size:8pt;">';};this.endColumn2 = function (){return '</table></td></tr>';};this.drawDialog = function (){if (document.FLBControler.selectedBlocks.length == 0) {return  this.drawLocksDoc ();}else {return this.drawLocksBlocks ();}};this.drawLocksDoc = function (){var str = '';this.nbItem = 0;this.container.style.backgroundColor = '#aaaaaa';str += '<table bgcolor="#e6e6e6" border="0" cellspacing="2" cellpadding="1" style="font-family:Verdana; font-size:8pt;">';str += '<tr><td colspan="2"><table width="'+this.size+'" style="font-family:Verdana; font-size:8pt;"><tr><td>';str += '<img src="'+imagesDir+'block_locks_big.gif" align="left">';str += locStr002;str += '</td></tr></table></td></tr>';str += this.drawSection (locStr003);str += this.startColumn1();str += this.drawItem (locStr004, FLBDocType.CREATE_IMAGE);str += this.drawItem (locStr005, FLBDocType.CREATE_TEXT);str += this.drawItem (locStr006, FLBDocType.CREATE_TABLE);str += this.endColumn1();str += this.startColumn2();str += this.drawItem (locStr007, FLBDocType.CREATE_IMAGETEXT);str += this.drawItem (locStr008, FLBDocType.CREATE_IMAGETEXTTABLE);str += this.drawNone ();str += this.endColumn2();str += '</table>';return str;};this.drawLocksBlocks = function (){var str = '';var d = document.FLBControler;var ktable = d.getBlocksState (FLBBlockType.KIND_TABLE);var ktext = d.getBlocksState (FLBBlockType.KIND_TEXT);this.nbItem = 0;this.container.style.backgroundColor = '#aaaaaa';str += '<table bgcolor="#e6e6e6" border="0" cellspacing="2" cellpadding="1" style="font-family:Verdana; font-size:8pt;">';str += '<tr><td colspan="2"><table width="'+this.size+'" style="font-family:Verdana; font-size:8pt;"><tr><td>';str += '<img src="'+imagesDir+'block_locks_big.gif" align="left">';str += locStr002;str += '</td></tr></table></td></tr>';str += this.drawSection (locStr009);str += this.startColumn1();str += this.drawItem (locStr010, FLBBlockType.EDITABLE);str += this.endColumn1();str += this.startColumn2();str += this.drawItem (locStr011, FLBBlockType.DELETABLE);str += this.endColumn2();str += this.drawSection (locStr012);str += this.startColumn1();str += this.drawItem (locStr013, FLBBlockType.LAYOUT_VMOVE);str += this.endColumn1();str += this.startColumn2();str += this.drawItem (locStr014, FLBBlockType.LAYOUT_HMOVE);str += this.endColumn2();str += this.drawSection (locStr015);str += this.startColumn1();str += this.drawItem (locStr016, FLBBlockType.LAYOUT_VRESIZE);str += this.endColumn1();str += this.startColumn2();str += this.drawItem (locStr017, FLBBlockType.LAYOUT_HRESIZE);str += this.endColumn2();if (ktext != 0 || ktable != 0){str += this.drawSection (locStr018);str += this.startColumn1();str += this.drawItem ("Style", FLBBlockType.EDIT_STYLE);str += this.drawItem (locStr019, FLBBlockType.EDIT_FONTNAME);str += this.drawItem (locStr020, FLBBlockType.EDIT_FONTSIZE);str += this.drawItem (locStr021, FLBBlockType.EDIT_BOLD);str += this.drawItem (locStr022, FLBBlockType.EDIT_ITALIC);str += this.endColumn1();str += this.startColumn2();str += this.drawItem (locStr023, FLBBlockType.EDIT_UNDERLINE);str += this.drawItem (locStr024, FLBBlockType.EDIT_COLOR);str += this.drawItem (locStr025, FLBBlockType.EDIT_ALIGN);str += this.drawItem (locStr026, FLBBlockType.EDIT_INDENT);str += this.drawItem (locStr027, FLBBlockType.EDIT_BULLET);str += this.endColumn2();str += this.drawSection (locStr028);str += this.startColumn1();str += this.drawItem (locStr029, FLBBlockType.EDIT_LINK);str += this.drawItem (locStr030, FLBBlockType.INSERT_IMAGE);str += this.endColumn1();str += this.startColumn2();str += this.drawItem (locStr031, FLBBlockType.INSERT_TABLE);str += this.drawNone ();str += this.endColumn2();}str += '</table>';return str;};}function BorderStyleSelector (name){this.isa = ToolbarPalette;this.isa (name);this.styles = [ /*'none',*/ 'solid', 'dotted', 'dashed', 'double', 'groove', 'ridge', 'inset', 'outset' ];this.draw = function (){var str = '';str += '<table width="26" bgcolor="#aaaaaa" cellspacing="1" cellpadding="1" border="0" style="font-family:Verdana; font-size:10pt; cursor:default;">';var l = this.styles.length;for (var i = 0; i < l; i++){var c = (browser.isIE && i > 4) ? 'aaaaaa' : '000000';var style = this.styles[i];str += '<tr><td onclick="'+this.name+'.valid(\''+style+'\');" align="center" bgcolor="#e6e6e6" height="11">';str += '<div style="width:20px; padding:0px; margin:1px; font-size:4px; border-color:#'+c+'; border-style:'+style+'; border-width:3px;">&nbsp;</div>';str += '</td></tr>';}str += '</table>';this.container.innerHTML = str;};}function BorderThicknessSelector (name){this.isa = ToolbarPalette;this.isa (name);this.draw = function (){var str = '';str += '<table width="25" bgcolor="#aaaaaa" cellspacing="1" cellpadding="1" border="0" style="font-family:Verdana; font-size:10pt; cursor:default;">';for (var i = 0; i <= 10; i++){str += '<tr><td onclick="'+this.name+'.valid(\''+i+'\');" align="center" bgcolor="#e6e6e6" height="11">';str += '<div style="width:21px; padding:0px; margin:0px; font-size:1px; border-width:'+i+'px 0px 0px 0px; border-style:solid; border-color: #000000;">&nbsp;</div>';str += '</td></tr>';}str += '</table>';this.container.innerHTML = str;};}function CharacterSelector (name){this.isa = ToolbarPalette;this.isa (name);this.chars = [ '&#402;', '&#8222;', '&#8230;', '&#8224;', '&#8225;', '&#710;','&#8240;', '&#352;', '&#8249;', '&#338;', '&#8216;', '&#8217;', '&#8220;', '&#8221;','&#8226;', '&#8211;', '&#8212;', '&#732;', '&#8482;', '&#353;', '&#8250;', '&#339;','&#376;', '&iexcl;', '&cent;', '&pound;', '&euro;', '&curren;', '&yen;', '&brvbar;','&sect;', '&uml;', '&copy;', '&ordf;', '&laquo;', '&not;', '&reg;', '&macr;','&deg;', '&plusmn;', '&sup2;', '&sup3;', '&acute;', '&micro;', '&para;', '&middot;','&cedil;', '&sup1;', '&ordm;', '&raquo;', '&divide;','&times;', '&frac14;', '&frac12;','&frac34;', '&iquest;', '&Agrave;', '&Aacute;', '&Acirc;', '&Atilde;', '&Auml;', '&Aring;','&AElig;', '&Ccedil;', '&Egrave;', '&Eacute;', '&Ecirc;', '&Euml;', '&Igrave;', '&Iacute;','&Icirc;', '&Iuml;', '&ETH;', '&Ntilde;', '&Ograve;', '&Oacute;', '&Ocirc;', '&Otilde;','&Ouml;', '&Oslash;', '&Ugrave;', '&Uacute;', '&Ucirc;', '&Uuml;', '&Yacute;', '&THORN;','&szlig;', '&agrave;', '&aacute;', '&acirc;', '&atilde;', '&auml;', '&aring;', '&aelig;', '&ccedil;', '&egrave;', '&eacute;', '&ecirc;', '&euml;', '&igrave;', '&iacute;', '&icirc;','&iuml;', '&eth;', '&ntilde;', '&ograve;', '&oacute;', '&ocirc;', '&otilde;', '&ouml;','&oslash;', '&ugrave;', '&uacute;', '&ucirc;', '&uuml;', '&yacute;', '&thorn;', '&yuml;' ];this.draw = function (){var nbcols = 12;var nbrows = 10;var c = 0;var nbchars = this.chars.length;var str = '';str += '<table width="'+(18 * nbcols)+'" bgcolor="#aaaaaa" cellspacing="1" cellpadding="1" border="0" style="font-family:Verdana; font-size:10pt; cursor:default;">';for (var row = 0; row < nbrows; row++){str += '<tr>';for (var col = 0; col < nbcols; col++){if (c < nbchars){str += '<td width="18" align="center" bgcolor="#e6e6e6">';str += '<a href="" onclick="'+this.name+'.valid(\''+this.chars[c]+'\'); return false;" style="color:#000000; text-decoration:none;">'+this.chars[c]+'</a>';str += '</td>';}else{str += '<td width="18" bgcolor="#e6e6e6">&nbsp;</td>';}c++;}str += '</tr>';}str += '</table>';this.container.innerHTML = str;};}function UrlSelector (name){this.isa = ToolbarPalette;this.isa (name);this.url = null;this.dom = null;this.setUrl = function (url){if (this.url == url)return;this.url = url;var t = new Transmitter();t.get (this.url);var r = t.getResponseAsDOM();if (r != null){this.dom = r;this.drawAndPosition();}else alert (locStr032);};function dom_valueForSubNodeNamed (parent, name){var childs = parent.childNodes;for (var i = 0; i < childs.length; i++){var node = childs.item (i);if (node.nodeType != 1) continue;if (node.nodeName == name){return node.firstChild.nodeValue;}}return null;};function dom_subNodeNamed (parent, name){var childs = parent.childNodes;for (var i = 0; i < childs.length; i++){var node = childs.item (i);if (node.nodeType != 1) continue;if (node.nodeName == name) return node;}return null;};this.draw = function (){var root = this.dom.documentElement;if (root.nodeName != "items"){alert (locStr033);return;}/*if (!root.hasChildNodes()) return;*/var str = '';str += '<div id="urlSelectorContainer" style="cursor:default;border:1px; overflow: auto; background-color: #e6e6e6";>';str += '<table cellspacing=1 cellpadding=1 width=250 border=0 style="font-family:Verdana,Arial,sans;font-size:8pt;">';str += this.drawNode (root, 0);str += '</table></div>';this.container.innerHTML = str;var div = document.getElementById ('urlSelectorContainer'); if (div.offsetWidth > 250) {div.style.width = "250px";if (browser.isIE) {div.style.height = (div.offsetHeight + 20) + "px";}}};this.drawNode = function (parent, depth){var str = '';var childs = parent.childNodes;for (var i = 0; i < childs.length; i++){var item = childs.item (i);if (item.nodeType != 1) continue;if (item.nodeName == "item"){var label = dom_valueForSubNodeNamed (item, "label");var url = dom_valueForSubNodeNamed (item, "url");var sel = dom_valueForSubNodeNamed (item, "selectable");var sub = dom_subNodeNamed (item, "items");str += this.render (label, url, sub, sel, depth);if (sub != null) {str += this.drawNode (sub, depth + 1);}}}return str;};this.render = function (label, url, sub, sel, depth){var col = (sub != null) ? '#d5d5d5' : '#e6e6e6';var href = this.name + '.' + ((sub != null) ? 'setUrl' : 'valid') + '(\'' + url + '\');return false;';var str = '';str += '<tr bgcolor="'+col+'"><td align="left" nowrap>';str += '<img src="'+imagesDir+'blank.gif" width="'+(depth*10)+'" height=1>';str += '<a href="" onclick="'+href+'">';if (sub != null) {str += '<img src="'+imagesDir+'dir-mini.gif" width=10 height=10 border=0>'; } else {str += '<img src="'+imagesDir+'link-mini.gif" width=10 height=10 border=0>'; }str += '</a> ';if (sel != null) {var s = this.name + '.valid(\'' + sel + '\');return false;';str += '<a style="text-decoration:none;color:#000000" href="" onclick="'+s+'">';str += '<img src="'+imagesDir+'link-mini.gif" width=10 height=10 border=0> '; str += '<u>' + label + '</u></a>';} else if (sub == null) {str += '<a style="text-decoration:none;color:#000000" href="" onclick="'+href+'">';str += '<u>' + label + '</u></a>';} else {str += label;}return str;};}function ColorSelector (name){this.isa = ToolbarPalette;this.isa (name);this.color = "#000000";this.spacing = 1;/*this.cellSize = 9;*/this.nbCols = 18;this.nbRows = 1;this.colors = null;this.tbicons = null;this.setToolbarIcons = function (tbicons){this.tbicons = tbicons;};this.userTable = function (needsRender){this.colors = userColors;var l = this.colors.length;var pad = (l / this.nbCols);var ipad = parseInt (pad, 10);if (pad - ipad != 0){pad -= ipad;ipad++;pad = this.nbCols - (pad * this.nbCols);for (var i = 0; i < pad; i++) {this.colors[i+l] = "000000";}}this.nbRows = ipad;if (needsRender) this.render();};this.greyTable = function (needsRender) {this.nbRows = 5;this.colors = new Array();var a;var l = this.nbRows * this.nbCols;var s = 255 / (l - 1);for (var i = 0; i < l; i++) {a = i * s;v = h(a);this.colors[i] = "#"+v+v+v;}if (needsRender) this.render();};this.colorTable = function (mode, needsRender) {this.nbRows = 16;this.colors = new Array();var a, b;var i = 0;var sa = 255 / (this.nbRows - 1);var sb = 255 / (this.nbCols - 1);if (mode < 0 || mode > 2) throw locStr034;for (var y = 0; y < this.nbRows; y++) {a = y * sa;for (var x = 0; x < this.nbCols; x++) {b = x * sb;switch (mode) {case 0: this.colors[i++] = '#'+h(a)+h(b)+'00'; break;case 1: this.colors[i++] = '#00'+h(a)+h(b); break;case 2: this.colors[i++] = '#'+h(a)+'00'+h(b); break;}}}if (needsRender) this.render();};function h(i) {var l = (i >> 4) & 0xf;var h = i & 0xf;if (l > 9) {switch (l) {case 10: l='a'; break; case 11: l='b'; break; case 12: l='c'; break; case 13: l='d'; break; case 14: l='e'; break; case 15: l='f'; break; }}if (h > 9) {switch (h) {case 10: h='a'; break; case 11: h='b'; break; case 12: h='c'; break; case 13: h='d'; break; case 14: h='e'; break; case 15: h='f'; break; }}return ''+l+h;};this.draw = function (){if (this.editor != null) {eval (this.editor +'.preserveSelection()');}var nbPalette = 4;if (userColors != null){if (userColorsOnly) nbPalette = 1;else nbPalette = 5;}var w = ((this.nbCols * (9 + this.spacing )) / nbPalette) - 5;if (this.colors == null){if (userColors != null) {this.userTable (false);}else {this.colorTable (0, false);}}var str = '<table border="0" cellspacing="0" cellpadding="0" bgcolor="#e6e6e6">';str += '<tr><td>';if (userColors != null && !userColorsOnly) {str += '<img onclick="'+this.name+'.userTable(true);" src="'+imagesDir+this.tbicons+'_USER.png" border="0" width="25" height="25">';}if (!userColorsOnly){str += '<img onclick="'+this.name+'.colorTable(0,true);" src="'+imagesDir+this.tbicons+'_RG.png" border="0" width="25" height="25">';str += '<img onclick="'+this.name+'.colorTable(1,true);" src="'+imagesDir+this.tbicons+'_GB.png" border="0" width="25" height="25">';str += '<img onclick="'+this.name+'.colorTable(2,true);" src="'+imagesDir+this.tbicons+'_RB.png" border="0" width="25" height="25">';str += '<img onclick="'+this.name+'.greyTable(true);" src="'+imagesDir+this.tbicons+'_GREY.png" border="0" width="25" height="25">';}if (this.tbicons != 'TXTColor') {str += '&nbsp;&nbsp;&nbsp;&nbsp;';str += '<img onclick="'+this.name+'.valid(\'\');" src="'+imagesDir+this.tbicons+'_NONE.png" border="0" width="25" height="25">';str += '</td></tr>';}str += '</tr><tr><td align=center id="CTable_'+this.name+'">';str += this.renderCTable ();str += '</td>';str += '</tr>';str += '</table>';this.container.innerHTML=str;};this.renderCTable = function (){var str = '<table style="font-size:1px;" bgcolor="#aaaaaa" border="0" cellspacing="'+this.spacing+'" cellpadding="0">';var nr = this.nbRows;var nc = this.nbCols;var cl = this.colors;var i = 0;var str1 = '<td width=9 height=9 bgcolor="';var str2 = '" onclick="'+this.name+'.valid(\'';var str3 = '\');"></td>';var cell;var c;for (var y = 0; y < nr; y++){str += '<tr>';for (var x = 0; x < nc; x++){c = cl[i];cell = (str1+c+str2+c+str3);str += cell;i++;}str += '</tr>';}str += '</table>';return str;};this.render = function () {document.getElementById ("CTable_"+this.name).innerHTML = this.renderCTable();};}/* T O O L B A R   I T E M S  */function ToolbarItem (){this.toolbar = null;this.setToolbar = function (_tb) {this.toolbar = _tb;};this.draw = function () {return '';};this.target = function () {var t = this.toolbar.getTargetName();return (t == null) ? '' : (t+'.');};this.getArgs = function (a, from){var args = "";for (var i = from; i < a.length; i++){var t = typeof a[i];if (i > from) args += ",";if (t == "string")args += ("\'" + a[i] + "\'");else if (t == "number"){args += a[i];}else {throw locStr035;}}args = args.replace (/\'/g, '\\\'');return args;};}function ToolbarButton (title, icon, action){this.isa = ToolbarItem;this.isa();this.title = title;this.icon = icon;this.action = action;this.args = this.getArgs (arguments, 3);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".buttonClicked ('" + this.target() + this.action + "', '" + this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarFontFaceSelector (action){this.isa = ToolbarItem;this.isa();this.action = action;this.args = this.getArgs (arguments, 1);this.draw = function (){var texts = [locStr019, 'Arial', 'Courier', 'Times', 'Verdana' ];var values = ['Font', 'Arial, Helvetica, sans-serif', 'Courier New, Courier, mono', 'Times New Roman, Times, serif', 'Verdana, Arial, Helvetica, sans-serif' ];var astyle = 'style="margin:2px; background-color:#A2BCBB; border: 1px inset #dddddd; font-family:Verdana,Arial,sans; font-size:8pt;"';var str = '<select height="25" '+astyle+' id="fontface_'+this.toolbar.name+'"';str += ' onclick="'+this.toolbar.name+'.popupClicked();"';str += ' onchange="'+this.toolbar.name+'.fontfaceChanged(\''+this.target()+this.action+'\', \''+this.args+'\');">';for (var i = 0; i < texts.length; i++) {str += '<option value="'+values[i]+'">'+texts[i]+'</option>';}str += '</select>';return str;};}function ToolbarFontSizeSelector (action){this.isa = ToolbarItem;this.isa();this.action = action;this.args = this.getArgs (arguments, 1);this.draw = function (){var texts = [locStr020, '8', '10', '12', '14', '18', '24', '36' ];var values = ['Size', '1', '2', '3', '4', '5', '6', '7' ];var astyle = 'style="margin:2px; background-color:#A2BCBB; border: 1px inset #dddddd; font-family:Verdana,Arial,sans; font-size:8pt;"';var str = '<select height="25" '+astyle+' id="fontsize_'+this.toolbar.name+'"';str += ' onclick="'+this.toolbar.name+'.popupClicked();"';str += ' onchange="'+this.toolbar.name+'.fontsizeChanged(\''+this.target()+this.action+'\', \''+this.args+'\');">';for (var i = 0; i < texts.length; i++) {str += '<option value="'+values[i]+'">'+texts[i]+'</option>';}str += '</select>';return str;};}function ToolbarStyleSelector (action){this.isa = ToolbarItem;this.isa();this.action = action;this.args = this.getArgs (arguments, 1);this.draw = function (){var texts = ['Style', 'Normal', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'Address', 'Pre' ];var values = ['Style', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'address', 'pre' ];var titles = eval (this.target() + 'cssRules');if (titles) {for (var i = 1; i < values.length; i++){var t = titles[values[i]];if (t && t != null) {texts[i] = t;}}}var astyle = 'style="margin:2px; background-color:#A2BCBB; border: 1px inset #dddddd; font-family:Verdana,Arial,sans; font-size:8pt;"';var str = '<select height="25" '+astyle+' id="style_'+this.toolbar.name+'"';str += ' onclick="'+this.toolbar.name+'.popupClicked();"';str += ' onchange="'+this.toolbar.name+'.styleChanged(\''+this.target()+this.action+'\', \''+this.args+'\');">';for (var i = 0; i < texts.length; i++) {str += '<option value="<'+values[i]+'>">'+texts[i]+'</option>';}str += '</select>';return str;};}function ToolbarColorSelector (title, icon, tbicons, action, editor){this.isa = ToolbarItem;this.isa();this.title = title;this.icon = icon;this.action = action;this.editor = editor;this.args = this.getArgs (arguments, 5);this.draw = function (){   var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".colorSelectorInvoked (this, '" + tbicons + "', '" + this.target() + this.action + "', ";if (this.editor != 'null') {str += "'" + this.editor + "'";} else {str += "null";}str += ", '" + this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarUrlSelector (title, icon, startUrl, action){this.isa = ToolbarItem;this.isa();this.title = title;this.icon = icon;this.startUrl = startUrl;this.action = action;this.args = this.getArgs (arguments, 4);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".urlSelectorInvoked ('" + this.startUrl + "', this, '" + this.target() + this.action + "', '" + this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarLinkSelector (title, icon, action, editor){this.isa = ToolbarItem;this.isa();this.editor = editor;this.title = title;this.icon = icon;this.action = action;this.args = this.getArgs (arguments, 4);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".linkSelectorInvoked (this, '" + this.target() + this.action + "', '" +this.editor + "', '"+ this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarTableFormatSelector (title, icon, action, editor){this.isa = ToolbarItem;this.isa();this.editor = editor;this.title = title;this.icon = icon;this.action = action;this.args = this.getArgs (arguments, 4);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".tableFormatSelectorInvoked (this, '" + this.target() + this.action + "', '" +this.editor + "', '"+ this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarObjectPropertySelector (title, icon, action, editor){this.isa = ToolbarItem;this.isa();this.editor = editor;this.title = title;this.icon = icon;this.action = action;this.args = this.getArgs (arguments, 4);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".objectPropertySelectorInvoked (this, '" + this.target() + this.action + "', '" +this.editor + "', '"+ this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarCharacterSelector (title, icon, action){this.isa = ToolbarItem;this.isa();this.title = title;this.icon = icon;this.action = action;this.args = this.getArgs (arguments, 3);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".charSelectorInvoked (this, '" + this.target() + this.action + "', '" + this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarBorderThicknessSelector (title, icon, action){this.isa = ToolbarItem;this.isa();this.title = title;this.icon = icon;this.action = action;this.args = this.getArgs (arguments, 3);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".borderThicknessSelectorInvoked (this, '" + this.target() + this.action + "', '" + this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarBorderStyleSelector (title, icon, action){this.isa = ToolbarItem;this.isa();this.title = title;this.icon = icon;this.action = action;this.args = this.getArgs (arguments, 3);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".borderStyleSelectorInvoked (this, '" + this.target() + this.action + "', '" + this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}function ToolbarLockSelector (title, icon, action){this.isa = ToolbarItem;this.isa();this.title = title;this.icon = icon;this.action = action;this.args = this.getArgs (arguments, 3);this.draw = function (){var str = '<img width="25" height="25" border="0" onclick="';str += this.toolbar.name + ".lockSelectorInvoked (this, '" + this.target() + this.action + "', '" + this.args + "');";str += '" title="'+this.title+'" alt="'+this.title+'" src="'+imagesDir+this.icon+'" />';return str;};}/* T O O L B A R  */function Toolbar (name){this.name = name;this.targetName = null;this.items = new Array();this.colorSelector = null;this.linkSelector = null;this.tableFormatSelector = null;this.objectPropertySelector = null;this.urlSelector = null;this.charSelector = null;this.borderThicknessSelector = null;this.borderStyleSelector = null;this.lockSelector = null;this.drawn = false;this.nbColumns = 2;this.container = document.createElement ('DIV');this.container.id = this.name + '_toolbar';this.container.style.position = 'absolute';this.container.style.visibility = 'hidden';this.container.style.zIndex = 20000;document.body.appendChild (this.container);this.getArgs = function (a){var args = '';for (var i = 0; i < a.length; i++){if (i > 0) args += ',';args += ('\"' + a[i] + '\"');}return args;};this.setTargetName = function (_tn) {this.targetName = _tn;};this.getTargetName = function () {return this.targetName;};this.clear = function (){this.hideSelectors ();this.container.innerHTML = "";this.items = new Array();this.drawn = false;};this.addItem = function (item){this.items[this.items.length] = item;item.setToolbar (this);};this.addButton = function (title, icon, action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarButton ('+args+')'));};this.addStyleSelector = function (titles, action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarStyleSelector ('+args+')'));};this.addFontSizeSelector = function (action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarFontSizeSelector ('+args+')'));};this.addFontFaceSelector = function (action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarFontFaceSelector ('+args+')'));};this.addColorSelector = function (title, icon, tbicons, action, editor){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarColorSelector ('+args+')'));};this.addCharacterSelector = function (title, icon, action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarCharacterSelector ('+args+')'));};this.addBorderThicknessSelector = function (title, icon, action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarBorderThicknessSelector ('+args+')'));};this.addBorderStyleSelector = function (title, icon, action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarBorderStyleSelector ('+args+')'));};this.addLockSelector = function (title, icon, action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarLockSelector ('+args+')'));};this.addUrlSelector = function (title, icon, startUrl, action){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarUrlSelector ('+args+')'));};this.addLinkSelector = function (title, icon, action, editor){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarLinkSelector ('+args+')'));};this.addTableFormatSelector = function (title, icon, action, editor){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarTableFormatSelector ('+args+')'));};this.addObjectPropertySelector = function (title, icon, action, editor){var args = this.getArgs (arguments);this.addItem (eval ('new ToolbarObjectPropertySelector ('+args+')'));};this.draw = function (){var str = '';str += '<table id="'+this.name+'_toolbar_table" bgcolor="#e6e6e6" cellspacing="0" cellpadding="0" border="0"';if (typeof this.width != 'unefined') {str += ' width="'+this.width+'"';}str += '><tr>';if (this.container.style.position == 'absolute') {str += '<td width="10" style="width:10px; background-image:url('+imagesDir+'dragbar.gif)" rowspan="2" id="toolbar_drag_handle">';str += '<img id="toolbar_drag_handle" src="'+imagesDir+'blank.gif" width="10" />';str += '</td>';}str += '<td><div style="clear:both"></div>';for (var i = 0; i < this.items.length; i++){var item = this.items[i].draw();str += '<div style="float:left;padding:1px;margin-right:1px">';str += item;str += '</div>';}str += '<div style="clear:both"></div></td>';if (this.container.style.position == 'absolute') {str += '</tr><tr>';str += '<td valign="bottom" align="right">';str += '<img id="toolbar_resize_handle" src="'+imagesDir+'dragbar.gif" width="9">';str += '</td>';}str += '</tr></table>';this.container.innerHTML = str;this.drawn = true;};this.setRelative = function (flag){this.container.style.position = (flag) ?  'static' : 'absolute';};this.setParent = function (node){var parent = this.container.parentNode;if (parent != null) {parent.removeChild (this.container);}node.appendChild (this.container);};this.setWidth = function (w){this.width = w;this.container.style.width = w + "px";};this.setPosition = function (x, y){this.container.style.left = x + "px";this.container.style.top = y + "px";};this.show = function () {if (!this.drawn) this.draw();this.container.style.visibility = 'visible';};this.hide = function () {this.hideSelectors ();this.container.style.visibility = 'hidden';};this.visible = function () {return this.container.style.visibility != 'hidden';};this.buttonClicked = function (func, args){this.hideSelectors ();eval (func + "(" + args + ")");};this.styleChanged = function (func, args){this.popupChanged ('style_' + this.name, func, args);};this.fontsizeChanged = function (func, args){this.popupChanged ('fontsize_' + this.name, func, args);};this.fontfaceChanged = function (func, args){this.popupChanged ('fontface_' + this.name, func, args);};this.popupClicked = function (){this.hideSelectors ();};this.popupChanged = function (popupName, func, args){var popup = document.getElementById (popupName);var sel = popup.selectedIndex;if (sel != 0){var val = popup.options[sel].value;if (args != '') args += ', ';eval (func + "(" + args + "\'" + val + "\')");popup.selectedIndex = 0;}};this.hideSelectors = function () {if (this.colorSelector != null && this.colorSelector.visible())this.colorSelector.hide();if (this.tableFormatSelector != null && this.tableFormatSelector.visible())this.tableFormatSelector.hide();if (this.objectPropertySelector != null && this.objectPropertySelector.visible())this.objectPropertySelector.hide();if (this.linkSelector != null && this.linkSelector.visible())this.linkSelector.hide();if (this.urlSelector != null && this.urlSelector.visible())this.urlSelector.hide();if (this.charSelector != null && this.charSelector.visible())this.charSelector.hide();if (this.borderThicknessSelector != null && this.borderThicknessSelector.visible())this.borderThicknessSelector.hide();if (this.borderStyleSelector != null && this.borderStyleSelector.visible())this.borderStyleSelector.hide();if (this.lockSelector != null && this.lockSelector.visible())this.lockSelector.hide();};this.selectorInvoked = function (selClass, selInstance, button, func, args){var sel = eval (this.name + '.' + selInstance);var vis = (sel != null) ? sel.visible() : false;this.hideSelectors();if (sel != null && sel.button == button && vis) {return null;}if (sel == null){sel = eval ('new ' + selClass + '(\'' + this.name + '.' + selInstance + '\')');sel.setToolbar (this);eval (this.name + '.' + selInstance + ' = sel');}sel.setButton (button);sel.setAction (func, args);return sel;};this.tableFormatSelectorInvoked = function (button, func, editor, args){var sel = this.selectorInvoked ('TableFormatSelector', 'tableFormatSelector', button, func, args);if (sel != null){sel.setEditor (editor);sel.drawAndPosition ();sel.show();}};this.objectPropertySelectorInvoked = function (button, func, ed, args){var sel = this.selectorInvoked ('ObjectPropertySelector', 'objectPropertySelector', button, func, args);if (sel != null){sel.setEditor (ed);sel.setElement (eval (ed + ".selectedElement()"));sel.drawAndPosition ();sel.show();}};this.linkSelectorInvoked = function (button, func, editor, args){var sel = this.selectorInvoked ('LinkSelector', 'linkSelector', button, func, args);if (sel != null){sel.setEditor (editor);sel.drawAndPosition ();sel.show();}};this.urlSelectorInvoked = function (startUrl, button, func, args){var sel = this.selectorInvoked ('UrlSelector', 'urlSelector', button, func, args);if (sel != null){sel.setUrl (startUrl);sel.drawAndPosition ();sel.show();}};this.colorSelectorInvoked = function (button, tbicons, func, editor, args){var sel = this.selectorInvoked ('ColorSelector', 'colorSelector', button, func, args);if (sel != null){sel.setEditor (editor);sel.setToolbarIcons (tbicons);sel.drawAndPosition ();sel.show();}};this.lockSelectorInvoked = function (button, func, args){var sel = this.selectorInvoked ('LockSelector', 'lockSelector', button, func, args);if (sel != null){sel.drawAndPosition ();sel.show();}};this.charSelectorInvoked = function (button, func, args){var sel = this.selectorInvoked ('CharacterSelector', 'charSelector', button, func, args);if (sel != null){sel.drawAndPosition ();sel.show();}};this.borderThicknessSelectorInvoked = function (button, func, args){var sel = this.selectorInvoked ('BorderThicknessSelector', 'borderThicknessSelector', button, func, args);if (sel != null){sel.drawAndPosition ();sel.show();}};this.borderStyleSelectorInvoked = function (button, func, args){var sel = this.selectorInvoked ('BorderStyleSelector', 'borderStyleSelector', button, func, args);if (sel != null){sel.drawAndPosition ();sel.show();}};}function ltrim (str){var inside = false;var s = '';for (var i = 0; i < str.length; i++){var c = str.charAt(i);if (!inside && (c == ' ' || c == '\n' || c == '\r' || c == '\t')) {continue;}inside = true;s += c;}return s;}function rtrim (str){var inside = false;var s = '';for (var i = str.length - 1; i >= 0; i--){var c = str.charAt(i);if (!inside && (c == ' ' || c == '\n' || c == '\r' || c == '\t')) {continue;}inside = true;s = c + s;}return s;}function trim (str){str = ltrim (str);str = rtrim (str);return str;}/* A R R A Y  H A N D L I N G */function List(){this.arr = new Array();this.count = 0;this.last = function (){if (this.count == 0) {return null;}return this.get (this.count - 1);};this.getIndex = function (obj){if (obj == null) {return -1;}for (var i = 0; i < this.count; i++){if (this.arr[i] == obj) {return i;}}return -1;};this.get = function (index){if (index < 0 || index >= this.count) {return null;}return this.arr[index];};this.append = function (obj){this.arr[this.count] = obj;this.count++;};this.removeLast = function (){if (this.count == 0) {return null;}return this.remove (this.count - 1);};this.remove = function (index){var o = null;var j = 0;var arr = new Array();for (var i = 0; i < this.count; i++){if (i != index){arr[j] = this.arr[i];j++;}else{o = this.arr[i];}}this.count--;this.arr = arr;return o;};this.insert = function (index, obj){if (index < 0 || index >= this.count) {return;}var j = 0;var i = 0;var arr = new Array();while (i < this.count){if (j != index){arr[j] = this.arr[i];i++;}else{arr[j] = obj;}j++;}this.count++;this.arr = arr;};this.size = function (){return this.count;};}/* B R O W S E R  H A N D L I N G */function Browser(){var ua = navigator.userAgent;this.isIE = false;this.isNS = false;this.isWindows = false;if (ua.indexOf("MSIE") >= 0) {this.isIE = true;}if (ua.indexOf("Gecko") >= 0) {this.isNS = true;}if (ua.indexOf("Windows") >= 0) {this.isWindows = true;}}browser = new Browser();/* E V E N T S  H A N D L I N G */function stopEvent (event){if (browser.isIE) {window.event.cancelBubble = true;window.event.returnValue = false;} else if (browser.isNS) {event.preventDefault();event.stopPropagation();}}function removeEventListener (target, type, listener, capture){if (browser.isIE) target.detachEvent ("on"+type, listener);else if (browser.isNS) target.removeEventListener (type, listener, capture);}function addEventListener (target, type, listener, capture, timeout){if (typeof timeout == "undefined"){if (browser.isIE)target.attachEvent ("on"+type, listener);else if (browser.isNS)target.addEventListener (type, listener, capture);}else{if (browser.isIE)setTimeout (target+".attachEvent ('on"+type+"', "+listener+")", timeout);else if (browser.isNS)setTimeout (target+".addEventListener ('"+type+"', "+listener+", "+capture+")", timeout);}}function mouseX (event){if (browser.isIE)return /*window.*/event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;if (browser.isNS)return event.clientX + window.scrollX;}function mouseY (event){if (browser.isIE)return /*window.*/event.clientY + document.documentElement.scrollTop + document.body.scrollTop;if (browser.isNS)return event.clientY + window.scrollY;}function eventTarget (event){return (browser.isNS) ? event.target : /*window.*/event.srcElement;}/*  C O M M U N I C A T I O N   H A N D L I N G */function Transmitter (){var impl = ["Msxml4.XMLHTTP","Msxml3.XMLHTTP","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];this.http = null;for (var i = 0; i < impl.length; i++){try {this.http = new ActiveXObject(impl[i]);} catch (e) {}if (this.http != null)break;}if (this.http == null){try {this.http = new XMLHttpRequest();} catch (e) {}}this.validate = function (){if (this.http == null)throw locStr001;};/*this.header = function (name, value){try	{this.validate();this.http.setRequestHeader (name, value);} catch (e) { }};*/this.get = function (msg){try	{this.validate();this.http.open ("GET", msg, false);this.http.send (null);} catch (e) { }};this.post = function (msg, data){try	{this.validate();this.http.open ("POST", msg, false);var charset = (browser.isIE) ? '; charset=ISO-8859-1' : '';this.http.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded' + charset);this.http.send (data);} catch (e){ }};this.put = function (msg, data){try	{this.validate();this.http.open ("PUT", msg, false);this.http.send (data);} catch (e){ }};this.getStatus = function (){return this.http.status;};this.getResponse = function (){this.validate();var s = this.http.status;var r = this.http.responseText;return (s == 0 || s == 200) ? r : null;};this.getResponseAsDOM = function (){this.validate();var s = this.http.status;var r = this.http.responseXML;return (s == 0 || s == 200) ? r : null;};}/*  P L A C E M E N T */function getOffsetTop (e){var top = e.offsetTop;var parent = e.offsetParent;while (parent) {top += parent.offsetTop;parent = parent.offsetParent;}return top;};function getOffsetLeft (e){var left = e.offsetLeft;var parent = e.offsetParent;while (parent) {left += parent.offsetLeft;parent = parent.offsetParent;}return left;};/* D I S P A T C H E R  */function FLBDispatcher (){this.preemptible = true;this.ref = 0;this.docControler = new FLBDocument();this.docControler.initFromDOMElement (document);this.routeEvent = function (event){	if (!dispatcher.preemptible){stopEvent(event);return;}var target = eventTarget (event);var controler = null;if (browser.isNS){if (event.originalTarget instanceof XULElement) {return;}if (event.type == 'mousemove') {++dispatcher.ref;dispatcher.ref &= 0x03;if (dispatcher.ref != 0) {stopEvent (event);return;}}}else{if (event.type == 'dragstart') {stopEvent (event);return false;}else if (event.type == 'click' && target.nodeName == 'A') {stopEvent (event);return false;}else if (event.type == 'mousedown') {if (event.clientX >= document.body.clientWidth) {return;}if (event.clientY >= document.body.clientHeight) {return;}}}var realTarget = dispatcher.findParentControler (target);if (realTarget == null) return;var controler = realTarget.FLBControler;if (controler == null) return;var handled = controler.handleEvent (event);if (handled) {stopEvent (event);}};this.findParentControler = function (target){var element = target;while (element != null){if (element.FLBControler) {return element;}element = element.parentNode;}return null;};this.register = function (element){var block = new FLBBlock ();block.initFromDOMElement (element);dispatcher.docControler.blocks[dispatcher.docControler.blocks.length] = block;};this.registerBlock = function (id){var element = document.getElementById (id);if (element != null) {dispatcher.register (element);}};this.autoRegisterBlocks = function (){var root = document.FLBControler.root;seekAndRegisterFLB (root);};function seekAndRegisterFLB (parent){var children = parent.childNodes;for (var i = 0; i < children.length; i++){var child = children[i];if (child.nodeType != 1) {continue;}if (child.id.indexOf (blockHeader) == 0) {dispatcher.register (child);}seekAndRegisterFLB (child);}};}/* C O N T R O L E R S  */function FLBControler (){this.element = null;this.initFromDOMElement = function (el){this.element = el;el.FLBControler = this;};this.handleEvent = function (event){return false;};}/* FILE UPLOADER */function FileUploader (){this.target = null;this.container = null;this.queue = new Array();this.qLength = 0;this.chooseFile = function (event, used_editor){var target;if (browser.isIE){var win = eval (used_editor+'.element.contentWindow');target = win.event.srcElement;} else {target = event.target;}uploader.chooseFileForElement (target);};this.chooseFileForElement = function (elem){if (browser.isIE) {uploader.push (elem);}else{var filename = null;var title = locStr089;try {netscape.security.PrivilegeManager.enablePrivilege ("UniversalXPConnect");} catch (err) { alert (err + "\n" + locStr090 + "\n" + locStr091);return;}var nsIFilePicker = Components.interfaces.nsIFilePicker;var FilePickerClass = Components.classes["@mozilla.org/filepicker;1"];var fp = FilePickerClass.createInstance (nsIFilePicker);fp.init (window, title, nsIFilePicker.modeOpen);fp.appendFilters (nsIFilePicker.filterImages);if (fp.show () == nsIFilePicker.returnOK && fp.file) {filename = fp.file.path;}if (filename != null){var url = "file://"+filename;uploader.setURLForElement (url, elem, true);uploader.push (elem);}}};this.buildImageForElement = function (url, elem){var _this = this;var image = new Image();image.src = url;setTimeout (function () { _this.imageReady (image, elem); }, 100);};this.imageReady = function (image, elem){var _this = this;if (!image.complete) {setTimeout (function () { _this.imageReady (image, elem); }, 100);return;}var url = image.src;elem.src = url;var iw = image.width;var ih = image.height;var ir = iw / ih;var cw = elem.offsetWidth;var ch = elem.offsetHeight;var cr = cw / ch;var s = elem.style;var rw;var rh;var keep = confirm (locStr104); if (keep){rw = iw;rh = ih;}else{if (cr < ir) {rw = cw;rh = ((1 / ir) * cw);} else {rw = (ir * ch);rh = ch;}}var block = elem.parentNode.FLBControler;if (block != null){block.resizeTo (rw, rh);block.showSelection (true);}else{s.width = rw + 'px';s.height = rh + 'px';window.focus();}};this.setURLForElement = function (url, elem, resize){if (elem.nodeName == 'A') {elem.href = url;} else if (elem.nodeName == 'IMG') {if (resize) {elem.src = url;this.buildImageForElement (url, elem);} else {var start = location.protocol + "//" + location.host;if (location.port != "") {start += ":" + location.port;}if (url.indexOf (start) == 0) {url = url.substring (start.length, url.length);}elem.src = url;}}};this.getURLForElement = function (elem){if (elem.nodeName == 'A') {return elem.href;} else if (elem.nodeName == 'IMG') {return elem.src;}return null;};this.push = function (elem){uploader.queue[uploader.qLength] = elem;uploader.qLength++;};this.pop = function (){var last = uploader.qLength - 1;if (last < 0) {return null;}var elem = uploader.queue[last];uploader.queue[last] = null;uploader.qLength--;return elem;};this.sleeping = function (){return (uploader.qLength == 0 && uploader.target == null);};this.build = function (){	var f = document.createElement ("IFRAME");f.style.visibility = 'hidden';f.style.width="0px";f.style.height="0px";document.body.appendChild (f);this.container = f;};this.submitImage = function (){var doc = uploader.container.contentWindow.document;doc.open();doc.write ('<html><head>');doc.write ('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');doc.write ('<meta http-equiv="Pragma" content="no-cache">');doc.write ('<meta http-equiv="Cache-Control" content="no-cache">');doc.write ('</head><body>');doc.write ('<form id="fileUploaderForm" method="post" enctype="multipart/form-data" action="'+ saveURL +'">');doc.write ('<input id="fileUploaderField" type="file" name="');if (uploader.target.nodeName == 'IMG') {doc.write ('image');} else if (uploader.target.nodeName == 'A') {doc.write ('document');}doc.write ('"></form></body></html>');doc.close();var fo = doc.getElementById ('fileUploaderForm');var fld = doc.getElementById ('fileUploaderField');if (browser.isIE){fld.click();if (fld.value.length == 0) {uploader.target = null;} else {uploader.setURLForElement ('file://' + fld.value, uploader.target, true);}}else{var src = uploader.getURLForElement (uploader.target);var offset = (browser.isWindows) ? 8 : 7;src = src.substring (offset, src.length);src = unescape (src);try {netscape.security.PrivilegeManager.enablePrivilege ("UniversalFileRead");} catch (err) { alert (err + "\n" + locStr090 + "\n" + locStr092);return;}fld.value = src;fld.src = src;}fo.submit();};this.run = function (){uploader.check();setTimeout ('uploader.run()', 250);};this.start = function (){setTimeout ('uploader.run()', 500);};this.check = function (){if (uploader.target != null) {uploader.checkUploadCompleted();}if (uploader.target != null) {return;}uploader.nextUpload();};this.nextUpload = function (){if (uploader.qLength == 0) {return;}/* TODO : should handle a timeout !!!*/uploader.target = uploader.pop ();uploader.submitImage();};this.checkUploadCompleted = function (){var completed = false;var url = null;var doc;var str;var children;try{doc = uploader.container.contentWindow.document;children = doc.body.childNodes;} catch (e) {alert (e);return;}if (children.length > 0){var child = children[0];if (children[0].nodeType != 3) {return;}var str = child.nodeValue;str = trim (str);if (str.indexOf ('OK=') == 0){url = str.substring (3, str.length);completed = true;}else if (str.indexOf ('KO') == 0){	alert (locStr093 + "\n" + locStr094);completed = true;}}if (completed){if (url != null) {uploader.setURLForElement (url, uploader.target, false);}uploader.target = null;}};this.build();}uploader = null;staticDir = null;imagesDir = null;/* +------------------------+|      Editor Class      |+------------------------+ */function Editor (name, id, docid, pageid){this.widgets	= new Array();this.name		= name;this.id			= id;this.documentid = docid;this.pageid		= pageid;this.register = function register (widget) {widget.setId (this.id);widget.setPageId (this.pageid);widget.setDocumentId (this.documentid);this.widgets[this.widgets.length] = widget;};this.cancel = function cancel() {if (this.virgin == true)document.location.href='itemdel?documentid='+this.documentid+'&pageid='+this.pageid+'&itemid='+this.id;elsedocument.location.href='edit?documentid='+this.documentid+'&pageid='+this.pageid;};this.serialize = function serialize() {var str = "<form id=\"editor_data\" action=\"itemsave\" method=\"POST\">";str += "<input type=hidden name=\"editor.itemid:\" value=\""+this.id+"\">";str += "<input type=hidden name=\"editor.documentid:\" value=\""+this.documentid+"\">";str += "<input type=hidden name=\"editor.pageid:\" value=\""+this.pageid+"\">";var l = this.widgets.length;for (var i = 0; i < l; i++) {str += this.widgets[i].serialize();}str += "</form>";document.getElementById("editor").innerHTML = str;var form = document.getElementById("editor_data");form.submit();};this.start = function start() {document.writeln ('<a href="javascript:'+this.name+'.serialize();"><img src="/shell/img/document/valid.gif" border="0"></a>');document.writeln ('<a href="javascript:'+this.name+'.cancel();"><img src="/shell/img/document/cancel.gif" border="0"></a>');document.writeln ("<div style=\"position:absolute;visibility:hidden\" id=\"editor\"></div>");};}/* +------------------------+| Widgets Ancestor Class |+------------------------+ */function Widget (name, prefix){this.virgin		= true;this.name		= name;this.prefix		= (typeof prefix == "undefined") ? "" : ("."+prefix);imagesDir		= staticDir+'/icons/';this.container= document.createElement ("DIV");this.container.id = "widget_" + this.name;var b = document.getElementById (prefix);b.appendChild (this.container);this.setId = function (id) {this.id = id;};this.setPageId = function (id) {this.pageid = id;};this.setDocumentId = function (id) {this.documentid = id;};this.serializeData = function (path, val) {var name = (path.length == 0) ? ("editor.value"+this.prefix+":") : ("editor.value"+this.prefix+"."+path+":");var str = "<input type=hidden name=\""+name+"\" value=\""+val+"\">";return str;};this.deserialize = function (param1, param2, param3, param4, param5) {this.virgin = false;this.data = this.textDecode (param1);};this.textEncode = function (str) {str = str.replace (/&/g, "{A}");str = str.replace (/</g, "{L}");str = str.replace (/>/g, "{G}");str = str.replace (/\"/g, "{Q}");str = str.replace (/\'/g, "{q}");str = str.replace (/\r\n/g, "");str = str.replace (/\n/g, "");return str;};this.textDecode = function (str) {str = str.replace (/{q}/g, "\'");str = str.replace (/{Q}/g, "\"");str = str.replace (/{G}/g, ">");str = str.replace (/{L}/g, "<");str = str.replace (/{A}/g, "&");return str;};this.draw = function () { };this.serialize = function () { };this.init = function () { };}/* +--------------------------+|  Rich Text Class Editor  |+--------------------------+ */function RichText (name, prefix, noparagraph){this.isa = Widget;this.isa (name, prefix);this.asyncDelay = 150;this.element = null;this.data = "";this.css = null;this.cssRules = null;this.toolbar = null;this.borderWidth = 1;this.external_toolbar = null;this.noparagraph  = (typeof noparagraph == "undefined") ? false : noparagraph;this.pastePlainText = false;this.toolsRemoved = new Array();this.urlSelectors = new Array();this.setPastePlainText  = function (flag){this.pastePlainText = flag;};this.addUrlSelector = function (title, icon, url){var us = new Array();us[0] = title;us[1] = icon;us[2] = url;this.urlSelectors[this.urlSelectors.length] = us;};this.setStyleTitle = function (rule, title){if (this.cssRules == null) {this.cssRules = new Object();}this.cssRules[rule] = title;};this.addStyleSheet = function (ss){if (this.css == null) {this.css = new Array();}this.css[this.css.length] = ss;};this.setBorderWidth = function (bw){this.borderWidth = bw;};this.setExternalToolbar = function (_tb){this.external_toolbar = _tb;};this.removeTool = function (what){this.toolsRemoved[this.toolsRemoved.length] = what;};this.toolRemoved = function (what){for (var i = 0; i < this.toolsRemoved.length; i++){if (this.toolsRemoved[i] == what) return true;}return false;};this.setWidth = function (width) {	this.width = width;};this.setHeight = function (height) {	this.height = height;};this.format = function (command, option){var win = this.element.contentWindow;if (command == 'forecolor') {if (browser.isIE) {this.currSelRange.select();}}if (command.indexOf('justify') == 0){var e = this.selectedElement ();if (e && e.nodeName == 'IMG'){var a = command.substring (7, command.length);if (e.align == a) {a = '';}e.align = a;}else{win.focus();win.document.execCommand (command, false, option);}win.focus();return;}win.focus();win.document.execCommand(command, false, option);win.focus();};this.setGlobalFileChooser = function (){try {this.setFileChooser (this.element.contentWindow.document.body);} catch (e) {setTimeout (this.name + ".setGlobalFileChooser()", 50);}};this.setFileChooser = function (parent){if (parent.hasChildNodes()){var node = parent.firstChild;while (node != null){this.setFileChooser (node);if (node.nodeName == "IMG") {addEventListener (node, 'dblclick', new Function ("event", "return uploader.chooseFile(event, '"+this.name+"');"), true);}node = node.nextSibling;}}};this.preserveSelection = function (){var win = this.element.contentWindow;if (browser.isIE) {this.currSelRange = win.document.selection.createRange();}};this.findCurrentURL = function (){this.preserveSelection();var val = ['', ''];var e = this.selectedElementNamed ('A');if (e) {val[0] = e.href;val[1] = e.target;}return val;};this.insertLink = function (url, target){if (browser.isIE) {this.currSelRange.select();}var win = this.element.contentWindow;var e = this.selectedElementNamed ('A');if (url != '' && url != 'http://') {win.document.execCommand ('CreateLink', false, url);if (e == null) {e = this.selectedElementNamed ('A');}if (e != null) {e.target = target;if (url == '__LOCAL_FILE__' && e != null) {uploader.chooseFileForElement (e);}}} else {if (e && (url == '' || url == 'http://')){var t = win.document.createTextNode (' ');var p = e.parentNode;p.insertBefore (t, e);var c = e.innerHTML;this.selectElement (e);this.insertHTMLAtSelection (c);if (browser.isIE) {var sel = win.document.selection;var range = sel.createRange();range.moveStart ('character', -(c.length + 1));range.moveEnd ('character', -(c.length));range.select();range.pasteHTML ('');} else {p.removeChild (t);}}}win.focus();};this.insertSpecialChar = function (c){this.insertHTMLAtSelection (c);};this.insertImage = function (c){this.insertHTMLAtSelection ('<img src="'+imagesDir+'defaultImg.png" style="width:100px;height:100px;" border="0">');this.setGlobalFileChooser ();};this.insertTable = function (r, c){var str = '<table border="1" cellspacing="1" cellpadding="1">';for (var i = 0; i < r; i++) {str += '<tr>';for (var j = 0; j < c; j++) {str += '<td width="100" height="24">'+locStr113+'</td>';}str += '</tr>';}str += '</table>';this.insertHTMLAtSelection (str);};this.setDesignMode = function (){if (uploader == null) {uploader = new FileUploader();uploader.start();}var doc = this.element.contentWindow.document;try {if (browser.isNS) {doc.designMode = "on";}var charset = document.charset || document.characterSet;doc.open();doc.writeln ("<html><head>");doc.writeln ("<meta http-equiv=\"Content-Type\" content=\"text/html; charset="+charset+"\">");doc.writeln ("<meta http-equiv=\"Pragma\" content=\"no-cache\">");doc.writeln ("<meta http-equiv=\"Cache-Control\" content=\"no-cache\">");if (this.css != null) {for (var i = 0; i < this.css.length; i++) {doc.writeln ("<link rel=\"StyleSheet\" href=\""+this.css[i]+"\">");}}doc.writeln ("</head><body>");doc.writeln (this.data);doc.writeln ("</body></html>");doc.close();if (browser.isIE){ doc.body.contentEditable = true;doc.execCommand ('LiveResize', false, true);if (this.pastePlainText){doc.body.onpaste = new Function (this.name + '.iePasteText(); return false;');doc.body.onbeforepaste = new Function ('return false;');doc.body.onclick = new Function ('var ev='+this.name+'.element.contentWindow.event;ev.cancelBubble=true;ev.returnValue=false;return false;');}}this.setGlobalFileChooser ();this.element.contentWindow.focus();var _this = this;doc.rte = _this;addEventListener (doc, 'keypress', _this.handleKey, true);addEventListener (doc, 'keydown', _this.handleKey, true);addEventListener (doc, 'keyup', _this.handleKey, true);addEventListener (doc, 'click', _this.handleMouse, true);addEventListener (doc, 'mousedown', _this.handleMouse, true);}catch (e) {alert ("Cannot set design mode : " + e);}};this.handleMouse = function (event){var rte = (browser.isIE) ? event.srcElement.document.rte : this.rte;rte.toolbar.hideSelectors();return true;};this.handleKey = function (event){var rte = (browser.isIE) ? event.srcElement.document.rte : this.rte;rte.toolbar.hideSelectors();return true;};this.iePasteText = function (){var data = window.clipboardData.getData("Text");data = data.replace(/\r\n/g,"<br>");data = data.replace(/\n/g,"<br>");this.insertHTMLAtSelection (data);};this.selectElement = function (e){var win = this.element.contentWindow;win.focus();if (browser.isIE){var sel = win.document.selection;var range = win.document.body.createTextRange();range.moveToElementText (e);range.select();return;}var sel = win.getSelection ();var range = sel.getRangeAt (0);range.selectNode (e);};this.selectedElementNamed = function (n){var p = this.selectedElement();if (p.nodeName == n) {return p;}while (true){p = p.parentNode;if (p == null) {return null;}if (p.nodeName == n) {return p;}}return null;};this.selectedElement = function (){var win = this.element.contentWindow;win.focus();if (browser.isIE){var sel = win.document.selection;var range = sel.createRange();if (sel.type == 'Control') {return range(0);}else {return range.parentElement();}}var sel = win.getSelection ();var range = sel.getRangeAt (0);var container = range.startContainer;if (container.nodeType == 3) { /*text*/return container.parentNode;}else {var pos = range.startOffset;return container.childNodes[pos];}};this.insertHTMLAtSelection = function (html){var win = this.element.contentWindow;win.focus();if (browser.isIE){var sel = win.document.selection;if (sel.type == 'Control'){var range = sel.createRange();for (var i = 0; i < range.length; i++){var item = range(i);range.remove (item);item.parentNode.removeChild (item);}}var range = sel.createRange();range.pasteHTML (html);range.collapse ();win.focus();return;}var sel = win.getSelection ();var range = sel.getRangeAt (0);sel.removeAllRanges();range.deleteContents();var container = range.startContainer;var pos = range.startOffset;var fragment = range.createContextualFragment (html);var afterNode;range = document.createRange();if (container.nodeType == 3) /* inserting into a text node */{var textNode = container;container = textNode.parentNode;var text = textNode.nodeValue;var textBefore = text.substr (0, pos);var textAfter = text.substr (pos);var beforeNode = document.createTextNode (textBefore);afterNode = document.createTextNode (textAfter);container.insertBefore (afterNode, textNode);while (fragment.childNodes.length > 0){var insertNode = fragment.childNodes[0];container.insertBefore (insertNode, afterNode);}container.insertBefore (beforeNode, insertNode);container.removeChild(textNode);}else{afterNode = container.childNodes[pos];while (fragment.childNodes.length > 0){var insertNode = fragment.childNodes[0];container.insertBefore (insertNode, afterNode);}}if (afterNode) {	range.setEnd (afterNode, 0);range.setStart (afterNode, 0);sel.addRange(range);}win.focus();};this.draw = function (){if (this.virgin) this.init();if (!document.designMode) {this.renderDefault();} else {this.renderRTE();}};this.renderRTE = function (){this.isRichText = true;var table = document.createElement ("TABLE");table.bgColor = "#e6e6e6";table.cellSpacing = "0";table.cellPadding = "0";table.border = "0";var tbody = document.createElement ("TBODY");table.appendChild (tbody);var tr1 = document.createElement ("TR");tbody.appendChild (tr1);var td1 = document.createElement ("TD");if (typeof this.width != "undefined") {td1.width=this.width;}tr1.appendChild (td1);var tr2 = document.createElement ("TR");tr2.bgColor = "#A2BCBB";tbody.appendChild (tr2);var td2 = document.createElement ("TD");tr2.appendChild (td2);var iframe = document.createElement ("IFRAME");iframe.id = "text_"+this.name;iframe.name = "text_"+this.name;iframe.width = (typeof this.width != "undefined") ? this.width : "100%";iframe.height = (typeof this.height != "undefined") ? this.height : "200px";iframe.style.border = "inset 1px #666666";iframe.style.margin = '1px';iframe.style.padding = '0px';iframe.frameBorder = 0;iframe.leftMargin = 0;iframe.topMargin = 0;iframe.marginWidth = 0;iframe.marginHeight = 0;td2.appendChild (iframe);this.element = iframe;if (this.external_toolbar == null) {this.toolbar = new Toolbar (this.name+'.toolbar');} else {this.toolbar = this.external_toolbar;}this.toolbar.setTargetName (this.name);this.toolbar.clear();if (!this.toolRemoved ('styles') && this.css != null)this.toolbar.addStyleSelector ('format', 'formatblock');if (!this.toolRemoved ('fontface'))this.toolbar.addFontFaceSelector ('format', 'fontname');if (!this.toolRemoved ('fontsize'))this.toolbar.addFontSizeSelector ('format', 'fontsize');if (!this.toolRemoved ('bold'))this.toolbar.addButton (locStr021, 'bold.gif', 'format', 'bold', '');if (!this.toolRemoved ('italic'))this.toolbar.addButton (locStr022, 'italic.gif', 'format', 'italic', '');if (!this.toolRemoved ('underline'))this.toolbar.addButton (locStr023, 'underline.gif', 'format', 'underline', '');if (!this.toolRemoved ('color'))this.toolbar.addColorSelector (locStr024, 'color.gif', 'TXTColor', 'format', this.name, 'forecolor');if (!this.toolRemoved ('left'))this.toolbar.addButton (locStr073, 'left.gif', 'format', 'justifyleft', '');if (!this.toolRemoved ('center'))this.toolbar.addButton (locStr074, 'center.gif', 'format', 'justifycenter', '');if (!this.toolRemoved ('right'))this.toolbar.addButton (locStr075, 'right.gif', 'format', 'justifyright', '');if (!this.toolRemoved ('justify'))this.toolbar.addButton (locStr076, 'justify.gif', 'format', 'justifyfull', '');if (!this.toolRemoved ('orderedlist'))this.toolbar.addButton (locStr077, 'ordered.gif', 'format', 'insertorderedlist', '');if (!this.toolRemoved ('unorderedlist'))this.toolbar.addButton (locStr078, 'unordered.gif', 'format', 'insertunorderedlist', '');if (!this.toolRemoved ('indent'))this.toolbar.addButton (locStr079, 'indent.gif', 'format', 'indent', '');if (!this.toolRemoved ('outdent'))this.toolbar.addButton (locStr080, 'outdent.gif', 'format', 'outdent', '');if (!this.toolRemoved ('image'))this.toolbar.addButton (locStr083, 'image.gif', 'insertImage');if (!this.toolRemoved ('link'))this.toolbar.addLinkSelector (locStr082, 'link.gif', 'insertLink', this.name);for (var i = 0; i < this.urlSelectors.length; i++){var us = this.urlSelectors[i];this.toolbar.addUrlSelector (us[0], us[1], us[2], 'format', 'createlink');}if (!this.toolRemoved ('chars'))this.toolbar.addCharacterSelector (locStr081, 'charspec.jpg', 'insertSpecialChar');if (!this.toolRemoved ('table'))this.toolbar.addTableFormatSelector (locStr081, 'table.gif', 'insertTable', this.name);this.toolbar.addObjectPropertySelector (locStr136, 'props.gif', null, this.name);if (this.external_toolbar == null){this.toolbar.setRelative (true);this.toolbar.setParent (td1);}this.toolbar.show();this.container.appendChild (table);setTimeout (this.name+".setDesignMode()", this.asyncDelay);};this.renderDefault = function (){this.isRichText = false;var str = '<textarea id="text_'+this.name+'" style="width: 495px; height: 200px;">'+this.data+'</textarea>';this.container.innerHTML = str;};this.serialize = function (){var str;if (this.isRichText) {var body = document.getElementById ("text_"+this.name).contentWindow.document.body;this.fixURLs (body);str = body.innerHTML;} else {str = document.getElementById ("text_"+this.name).value;}if (noparagraph){return str;}else{str = this.textEncode (str);return this.serializeData ('', str);}};this.deserialize = function (param1, param2, param3, param4, param5){this.virgin = false;var str = param1;if (!noparagraph){str = this.textDecode (str);}this.data = str;};this.fixURLs = function (parent, start){if (!start) {start = location.protocol + "//" + location.host;if (location.port != "") {start += ":" + location.port;}}var children = parent.childNodes;for (var i = 0; i < children.length; i++){var child = children[i];if (child.nodeType != 1) {continue;}if (child.nodeName == 'A') {child.href = this.fixURL (child.href, start);}else if (child.nodeName == 'IMG') {child.src = this.fixURL (child.src, start);}this.fixURLs (child, start);}};this.fixURL = function (url, start){if (url.indexOf (start) != 0) {return url;}var tmp = url.substring (start.length, url.length);return tmp;};}