Epoz/epoz/epoz_core epoz_script_color.html.dtml,NONE,1.1 epoz_script_detect.js.dtml,NONE,1.1 vcXMLRPC.js.dtml,NONE,1.1 epoz_script_widget.js.dtml,NONE,1.1 epoz_script_table.html.dtml,NONE,1.1 epoz_script_main.js.dtml,NONE,1.1 epoz_blank_iframe.html.pt,NONE,1.1

Maik Jablonski <[email protected]>
Newsgroups gmane.comp.web.zope.epoz
Message-ID <[email protected]>
Update of /cvsroot/epoz/Epoz/epoz/epoz_core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2265/epoz/epoz_core

Added Files:
	epoz_script_color.html.dtml epoz_script_detect.js.dtml 
	vcXMLRPC.js.dtml epoz_script_widget.js.dtml 
	epoz_script_table.html.dtml epoz_script_main.js.dtml 
	epoz_blank_iframe.html.pt 
Log Message:
several fixes and directory-reorganizations

--- NEW FILE: epoz_script_main.js.dtml ---
//#####
//###  Epoz - a cross-browser-wysiwyg-editor for Zope
//##   Copyright (C) 2004 Maik Jablonski ([email protected])
//#

// Just to prevent typos when fetching the Epoz-IFrame...

var Epoz = "EpozEditor";

// Speed-Up-Storage for document.getElementById(Epoz);

var EpozElement;
var EpozTextArea;

// Global storages

var form_data;  // the document-data
var form_name;  // the name of the form-element
var form_path;  // path to buttons, font-selectors, ...
var form_toolbox; // path to optional toolbox
var form_area_style; // css-definition for wysiwyg-area
var form_button_style; // css-definition for buttons
var form_css; // css-style for iframe
var form_customcss; // customized css-style for iframe
var form_charset; // charset for iframe
var form_pageurl; // real url for the edited page

// Detect browser type and create Epoz- or Default-Textbox

function InitEpoz(name, data, path, toolbox, style, button, css, customcss, charset, pageurl) {

    form_name = name;
    form_data = data;
    form_path = path;
    form_toolbox = toolbox;
    form_area_style = style;
    form_button_style = button;
    form_css = css;
    form_customcss = customcss;
    form_charset = charset;
    form_pageurl = pageurl;

    if (browser.isIE55 || browser.isIE6up) {
        // Mac-IE doesn't support RichText-Edit at the moment
        if (browser.isMac) {
            CreateTextarea();
        } else {
            CreateEpoz();
        }
    }
    else if (browser.isGecko) {
        //check to see if midas is enabled
        try {
            // Just a few cleanups for Mozilla

            form_data = form_data.replace(/<strong>/ig,'<b>');
            form_data = form_data.replace(/<strong(\s[^>]*)>/ig,'<b$1>');
            form_data = form_data.replace(/<\/strong>/ig,'</b>');

            form_data = form_data.replace(/<em>/ig,'<i>');
            form_data = form_data.replace(/<em(\s[^>]*)>/ig,'<i$1>');
            form_data = form_data.replace(/<\/em>/ig,'</i>');

            document.getElementById('EpozIFrame').contentDocument.designMode = "on";
            document.getElementById('EpozIFrame').contentWindow.document.execCommand("undo", false, null);
            CreateEpoz();
        } catch (e) {
          CreateTextarea();
        }
    }
    else {
        CreateTextarea();
    }
}

// Needs to be called by timeout for Mozilla...

function EnableDesignMode() {

    if (browser.isIE5up) {
        frames[Epoz].document.designMode = "On";
    }
    else {
      // just a try-catch-poll to see
      // when Mozilla is ready to go...
      try {
        EpozElement.contentDocument.designMode = "on";
        EpozElement.contentWindow.document.addEventListener("keypress", HandleKeyboardEvent, true);
      } catch (e) {
        setTimeout(EnableDesignMode, 10);
        return;
      }
    }

    // Set all forms in sync with Epoz

    if (document.getElementsByTagName)
        var x = document.getElementsByTagName('FORM');
    else if (document.all)
        var x = document.all.tags('FORM');

    for (var i=0;i<x.length;i++) {
        x[i].onsubmit = SyncEpoz;
    }
}


// A submit-wrapper to pass the parameters into the form-element

function SyncEpoz() {
    var html = TidyHTML(GetHTML());
    
    // strip trailing whitespace    
    html = (html.replace(/^\s*/,'')).replace(/\s*$/,'')

    // remove single br left by Firefox / Mozilla
    if (html=="<br />" || html=="<br>" || html=="<p></p>") {
        html = "";
    }
        
    document.getElementById(form_name).value = html;
}

// Intialize the document

function InitDocument() {
    // Store the Editor-Element in a global variable
    EpozElement = document.getElementById(Epoz);
    EpozTextArea = document.getElementById(form_name);

    setTimeout(EnableDesignMode, 10);

    // Put data into Epoz-Editor
    EpozElement.contentWindow.document.body.innerHTML = form_data;
}

// Returns the current HTML.

function GetHTML(source_mode) {
    if (source_mode == null)
        source_mode = document.getElementById('EpozViewMode').checked;
    if (source_mode) {
        return EpozTextArea.value;
    }
    else {
        try {
            return EpozElement.contentWindow.document.body.innerHTML;
        } catch (e) {
            return EpozElement.value;
        }
    }
}

// Just a XMLRPC to a web-service to clean up the html

function TidyHTML(html) {
    window.status = EpozLang["TidyStart"];
    try {
      // Call EpozTidy one step above the given pageurl.
      // This should avoid some problems with VHM & PageTemplates etc.
      xmlrpchost = form_pageurl + "/..";
        result = XMLRPC.call(xmlrpchost, "EpozTidy", html, form_pageurl);

        errors = result[0];
        output = result[1];
        errordata = result[2];

        if (errors != 0) {
            window.status = EpozLang["TidyError"];
            alert(errordata);
        }
        else {
          window.status = EpozLang["TidyStop"];
        }
        return (output);
    } catch (e) {
        return (html);
    }
}

// -------------------------------------------------------------
// Here are the definitions for the control-and-format-functions

// Format text with RichText-Controls

function FormatText(command, option) {
    EpozElement.contentWindow.focus();

    // Mozilla inserts css-styles per default

  if (browser.isGecko) {
      EpozElement.contentWindow.document.execCommand('useCSS',false, true);
    }

    EpozElement.contentWindow.document.execCommand(command, false, option);
}


// Insert arbitrary HTML at current selection

function InsertHTML(html) {

    EpozElement.contentWindow.focus();

    if (browser.isIE5up) {
        selection = EpozElement.contentWindow.document.selection;
        range = selection.createRange();
        try {
            range.pasteHTML(html);
        } catch (e) {
            // catch error when range is evil for IE
        }
    } else {
        selection = EpozElement.contentWindow.window.getSelection();
        EpozElement.contentWindow.focus();
        if (selection) {
            range = selection.getRangeAt(0);
        } else {
            range = EpozElement.contentWindow.document.createRange();
        }

        var fragment = EpozElement.contentWindow.document.createDocumentFragment();
        var div = EpozElement.contentWindow.document.createElement("div");
        div.innerHTML = html;

        while (div.firstChild) {
            fragment.appendChild(div.firstChild);
        }

        selection.removeAllRanges();
        range.deleteContents();

        var node = range.startContainer;
        var pos = range.startOffset;

        switch (node.nodeType) {
            case 3:
                if (fragment.nodeType == 3) {
                    node.insertData(pos, fragment.data);
                    range.setEnd(node, pos + fragment.length);
                    range.setStart(node, pos + fragment.length);
                } else {
                    node = node.splitText(pos);
                    node.parentNode.insertBefore(fragment, node);
                    range.setEnd(node, pos + fragment.length);
                    range.setStart(node, pos + fragment.length);
                }
                break;

            case 1:
                node = node.childNodes[pos];
                node.parentNode.insertBefore(fragment, node);
                range.setEnd(node, pos + fragment.length);
                range.setStart(node, pos + fragment.length);
                break;
        }
        selection.addRange(range);
    }
}


// Create an anchor - no browser supports this directly

function CreateAnchor(name) {
  name = prompt(EpozLang["EnterAnchorName"], "");
  if (name) {
    anchorhtml = '<a name="' + name + '" title="' + name + '"></a>';
    InsertHTML(anchorhtml);
  }
}


// Create a Hyperlink - IE has its own implementation

function CreateLink(URL) {
    if (browser.isIE5up == false && ((URL == null) || (URL == ""))) {
        URL = prompt(EpozLang["EnterLinkURL"], "");

        if ((URL != null) && (URL != "")) {
            EpozElement.contentWindow.document.execCommand("CreateLink",false,URL)
        } else {
            EpozElement.contentWindow.document.execCommand("Unlink",false, "")
        }
    } else {
        EpozElement.contentWindow.document.execCommand("CreateLink",false,URL)
    }
}


// Insert image via a URL

function CreateImage(URL) {
    if ((URL == null) || (URL == "")) {
        URL = prompt(EpozLang["EnterImageURL"], "");
    }
    if ((URL != null) && (URL != "")) {
        EpozElement.contentWindow.focus()
        EpozElement.contentWindow.document.execCommand('InsertImage', false, URL);
    }
}


// Creates a simple table

function CreateTable(rows, cols, border, head) {
    rows = parseInt(rows);
    cols = parseInt(cols);

  if ((rows > 0) && (cols > 0)) {
      table = ' <table border="' + border + '">\n';

    for (var i=0; i < rows; i++) {
          table = table + " <tr>\n";
            for (var j=0; j < cols; j++) {
              if(i==0 && head=="1") {
                   table += "  <th>#</th>\n";
              } else {
                 table += "  <td>#</td>\n";
        }
      }
            table += " </tr>\n";
    }
    table += " </table>\n";
    InsertHTML(table);
  }
    EpozElement.contentWindow.focus()
}


// Sets selected formats

function SelectFormat(selectname)
{
    // First one is only a label
    if (selectname.selectedIndex != 0) {
        EpozElement.contentWindow.document.execCommand(selectname.id, false, selectname.options[selectname.selectedIndex].value);
        selectname.selectedIndex = 0;
    }
    EpozElement.contentWindow.focus();
}


// Sets foreground-color

function SetTextColor() {
    EpozColorCommand='forecolor';
    window.open(form_path+'epoz_script_color.html','EpozColor','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=220,height=220');
}

// Sets background-color

function SetBackColor() {
    EpozColorCommand='backcolor';
    window.open(form_path+'epoz_script_color.html','EpozColor','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=220,height=220');
}

// Submit color-command to Rich-Text-Controls

function SetColor(color) {

    if (browser.isGecko) {
       EpozElement.contentWindow.document.execCommand('useCSS',false, false);
    }

    EpozElement.contentWindow.document.execCommand(EpozColorCommand, false, color);
    EpozElement.contentWindow.focus();
}

// Switch between Source- and Wysiwyg-View

function SwitchViewMode(source_mode)
{
    var html = GetHTML(!source_mode);

    if (source_mode) {
        EpozTextArea.value=TidyHTML(html);
        document.getElementById("EpozToolbar").style.display="none";
        EpozTextArea.style.display="inline";
    } else {
        html = html.replace('<script ', '<epoz:script style="display: none" ')
        html = html.replace('</script>', '</epoz:script>')
    
        EpozElement.contentWindow.document.body.innerHTML = html;
        document.getElementById("EpozToolbar").style.display="inline";
        EpozTextArea.style.display="none";

        if (browser.isGecko) {
            EpozElement.contentDocument.designMode = "on";
        }
    }
}

// Keyboard-Handler for Mozilla (supports same shortcuts as IE)

function HandleKeyboardEvent(event)
{
	if (event.ctrlKey) {
		var key = String.fromCharCode(event.charCode).toLowerCase();
		switch (key) {
			case 'b': FormatText('bold',''); event.preventDefault(); break;
			case 'i': FormatText('italic',''); event.preventDefault(); break;
			case 'u': FormatText('underline',''); event.preventDefault(); break;
			case 'k': CreateLink(); event.preventDefault(); break;
		};
	}
}

--- NEW FILE: vcXMLRPC.js.dtml ---
//
//    Copyright (C) 2000, 2001, 2002  Virtual Cowboys info-HusrHU7vuKPiUIqYCJb3xmZHpeb/A1Y/@public.gmane.org
//
//		Author: Ruben Daniels <ruben-HusrHU7vuKPiUIqYCJb3xmZHpeb/A1Y/@public.gmane.org>
//		Version: 0.91
//		Date: 29-08-2001
//		Site: www.vcdn.org/Public/XMLRPC/
//
//    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 for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program; if not, write to the Free Software
//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


Object.prototype.toXMLRPC = function(){
  var wo = this.valueOf();

  if(wo.toXMLRPC == this.toXMLRPC){
    retstr = "<struct>";

    for(prop in this){
      if(typeof wo[prop] != "function"){
        retstr += "<member><name>" + prop + "</name><value>" + XMLRPC.getXML(wo[prop]) + "</value></member>";
      }
    }
    retstr += "</struct>";

    return retstr;
  }
  else{
    return wo.toXMLRPC();
  }
}

String.prototype.toXMLRPC = function(){
  //<![CDATA[***your text here***]]>
  return "<string><![CDATA[" + this.replace(/\]\]/g, "] ]") + "]]></string>";//.replace(/</g, "&lt;").replace(/&/g, "&amp;")
}

Number.prototype.toXMLRPC = function(){
  if(this == parseInt(this)){
    return "<int>" + this + "</int>";
  }
  else if(this == parseFloat(this)){
    return "<double>" + this + "</double>";
  }
  else{
    return false.toXMLRPC();
  }
}

Boolean.prototype.toXMLRPC = function(){
  if(this) return "<boolean>1</boolean>";
  else return "<boolean>0</boolean>";
}

Date.prototype.toXMLRPC = function(){
  //Could build in possibilities to express dates
  //in weeks or other iso8601 possibillities
  //hmmmm ????
  //19980717T14:08:55
  return "<dateTime.iso8601>" + doYear(this.getUTCYear()) + doZero(this.getMonth()) + doZero(this.getUTCDate()) + "T" + doZero(this.getHours()) + ":" + doZero(this.getMinutes()) + ":" + doZero(this.getSeconds()) + "</dateTime.iso8601>";

  function doZero(nr) {
    nr = String("0" + nr);
    return nr.substr(nr.length-2, 2);
  }

  function doYear(year) {
    if(year > 9999 || year < 0)
      XMLRPC.handleError(new Error("Unsupported year: " + year));

    year = String("0000" + year)
    return year.substr(year.length-4, 4);
  }
}

Array.prototype.toXMLRPC = function(){
  var retstr = "<array><data>";
  for(var i=0;i<this.length;i++){
    retstr += "<value>" + XMLRPC.getXML(this[i]) + "</value>";
  }
  return retstr + "</data></array>";
}

function VirtualService(servername, oRPC){
  this.version = '0.91';
  this.URL = servername;
  this.multicall = false;
  this.autoroute = true;
  this.onerror = null;

  this.rpc = oRPC;
  this.receive = {};

  this.purge = function(receive){
    return this.rpc.purge(this, receive);
  }

  this.revert = function(){
    this.rpc.revert(this);
  }

  this.add = function(name, alias, receive){
    this.rpc.validateMethodName();if(this.rpc.stop){this.rpc.stop = false;return false}
    if(receive) this.receive[name] = receive;
    this[(alias || name)] = new Function('var args = new Array(), i;for(i=0;i<arguments.length;i++){args.push(arguments[i]);};return this.call("' + name + '", args);');
    return true;
  }

  //internal function for sending data
  this.call = function(name, args){
    var info = this.rpc.send(this.URL, name, args, this.receive[name], this.multicall, this.autoroute);

    if(info){
      if(!this.multicall) this.autoroute = info[0];
      return info[1];
    }
    else{
      if(this.onerror) this.onerror(XMLRPC.lastError);
      return false;
    }
  }
}


XMLRPC = {
  routeServer : "http://www.vcdn.org/cgi-bin/rpcproxy.cgi",
  autoroute : true,
  multicall : false,

  services : {},
  stack : {},
  queue : new Array(),
  timers : new Array(),
  timeout : 30000,

  ontimeout : null,

  getService : function(serviceName){
    //serviceNames cannot contain / or .
    if(/[\/\.]/.test(serviceName)){
      return new VirtualService(serviceName, this);
    }
    else if(this.services[serviceName]){
      return this.services[serviceName];
    }
    else{
      try{
        var ct = eval(serviceName);
        this.services[serviceName] = new ct(this);
      }
      catch(e){
        return false;
      }
    }
  },

  purge : function(modConst, receive){
    if(this.stack[modConst.URL].length){
      var info = this.send(modConst.URL, "system.multicall", [this.stack[modConst.URL]], receive, false, modConst.autoroute);
      modConst.autoroute = info[0];
      this.revert(modConst);

      if(info){
        modConst.autoroute = info[0];
        return info[1];
      }
      else{
        if(modConst.onerror) modConst.onerror(this.lastError);
        return false;
      }
    }
  },

  revert : function(modConst){
    this.stack[modConst.URL] = new Array();
  },

  call : function(){
    //[optional info || receive, servername,] functionname, args......
    var args = new Array(), i, a = arguments;
    var servername, methodname, receive, service, info, autoroute, multicall;

    if(typeof a[0] == "object"){
      receive = a[0][0];
      servername = a[0][1].URL;
      methodname = a[1];
      multicall = (a[0][1].supportsMulticall && a[0][1].multicall);
      autoroute = a[0][1].autoroute;
      service = a[0][1];
    }
    else if(typeof a[0] == "function"){
      i = 3;
      receive = a[0];
      servername = a[1];
      methodname = a[2];
    }
    else{
      i = 2;
      servername = a[0];
      methodname = a[1];
    }

    for(i=i;i<a.length;i++){
      args.push(a[i]);
    }

    info = this.send(servername, methodname, args, receive, multicall, autoroute);
    if(info){
      (service || this).autoroute = info[0];
      return info[1];
    }
    else{
      if(service && service.onerror) service.onerror(this.lastError);
      return false;
    }

  },

  /***
  * Perform typematching on 'vDunno' and return a boolean value corresponding
  * to the result of the evaluation-match of the mask-value stated in the 2nd argument.
  * The 2nd argument is optional (none will be treated as a 0-mask) or a sum of
  * several masks as follows:
  * type/s    ->  mask/s
  * --------------------
  * undefined ->  0/1 [default]
  * number    ->  2
  * boolean   ->  4
  * string    ->  8
  * function  -> 16
  * object    -> 32
  * --------------------
  * Examples:
  * Want [String] only: (eqv. (typeof(vDunno) == 'string') )
  *  Soya.Common.typematch(unknown, 8)
  * Anything else than 'undefined' acceptable:
  *  Soya.Common.typematch(unknown)
  * Want [Number], [Boolean] or [Function]:
  *  Soya.Common.typematch(unknown, 2 + 4 + 16)
  * Want [Number] only:
  *  Soya.Common.typematch(unknown, 2)
  **/
  typematch : function (vDunno, nCase){
    var nMask;
    switch(typeof(vDunno)){
      case 'number'  : nMask = 2;  break;
      case 'boolean' : nMask = 4;  break;
      case 'string'  : nMask = 8;  break;
      case 'function': nMask = 16; break;
      case 'object'  : nMask = 32; break;
      default	     : nMask = 1;  break;
    }
    return Boolean(nMask & (nCase || 62));
  },

  getNode : function(data, tree){
    var nc = 0;//nodeCount
    //node = 1
    if(data != null){
      for(i=0;i<data.childNodes.length;i++){
        if(data.childNodes[i].nodeType == 1){
          if(nc == tree[0]){
            data = data.childNodes[i];
            if(tree.length > 1){
              tree.shift();
              data = this.getNode(data, tree);
            }
            return data;
          }
          nc++
        }
      }
    }

    return false;
  },

  toObject : function(data){
    var ret, i;
    switch(data.tagName){
      case "string":
               var s=""
               //Mozilla has many textnodes with a size of 4096 chars each instead of one large one.
               //They all need to be concatenated.
               for(var j=0;j<data.childNodes.length;j++){
                  s+=new String(data.childNodes.item(j).nodeValue);
               }
               return s;
         break;
      case "int":
      case "i4":
      case "double":
        return (data.firstChild) ? new Number(data.firstChild.nodeValue) : 0;
        break;
      case "dateTime.iso8601":
        /*
        Have to read the spec to be able to completely
        parse all the possibilities in iso8601
        07-17-1998 14:08:55
        19980717T14:08:55
        */

        var sn = (isIE) ? "-" : "/";

        if(/^(\d{4})(\d{2})(\d{2})T(\d{2}):(\d{2}):(\d{2})/.test(data.firstChild.nodeValue)){;//data.text)){
            return new Date(RegExp.$2 + sn + RegExp.$3 + sn +
                      RegExp.$1 + " " + RegExp.$4 + ":" +
                      RegExp.$5 + ":" + RegExp.$6);
          }
          else{
            return new Date();
          }

        break;
      case "array":
        data = this.getNode(data, [0]);

        if(data && data.tagName == "data"){
          ret = new Array();

          var i = 0;
          while(child = this.getNode(data, [i++])){
              ret.push(this.toObject(child));
          }

          return ret;
        }
        else{
          this.handleError(new Error("Malformed XMLRPC Message1"));
          return false;
        }
        break;
      case "struct":
        ret = {};

        var i = 0;
        while(child = this.getNode(data, [i++])){
          if(child.tagName == "member"){
            ret[this.getNode(child, [0]).firstChild.nodeValue] = this.toObject(this.getNode(child, [1]));
          }
          else{
            this.handleError(new Error("Malformed XMLRPC Message2"));
            return false;
          }
        }

        return ret;
        break;
      case "boolean":
        return Boolean(isNaN(parseInt(data.firstChild.nodeValue)) ? (data.firstChild.nodeValue == "true") : parseInt(data.firstChild.nodeValue))

        break;
      case "base64":
        return this.decodeBase64(data.firstChild.nodeValue);
        break;
      case "value":
        child = this.getNode(data, [0]);
        return (!child) ? ((data.firstChild) ? new String(data.firstChild.nodeValue) : "") : this.toObject(child);

        break;
      default:
        this.handleError(new Error("Malformed XMLRPC Message: " + data.tagName));
        return false;
        break;
    }
  },

  /*** Decode Base64 ******
  * Original Idea & Code by [email protected]
  * from Soya.Encode.Base64 [http://soya.saltstorm.net]
  **/
  decodeBase64 : function(sEncoded){
    // Input must be dividable with 4.
    if(!sEncoded || (sEncoded.length % 4) > 0)
      return sEncoded;

    /* Use NN's built-in base64 decoder if available.
       This procedure is horribly slow running under NN4,
       so the NN built-in equivalent comes in very handy. :) */

    else if(typeof(atob) != 'undefined')
      return atob(sEncoded);

      var nBits, i, sDecoded = '';
      var base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
    sEncoded = sEncoded.replace(/\W|=/g, '');

    for(i=0; i < sEncoded.length; i += 4){
      nBits =
        (base64.indexOf(sEncoded.charAt(i))   & 0xff) << 18 |
        (base64.indexOf(sEncoded.charAt(i+1)) & 0xff) << 12 |
        (base64.indexOf(sEncoded.charAt(i+2)) & 0xff) <<  6 |
        base64.indexOf(sEncoded.charAt(i+3)) & 0xff;
      sDecoded += String.fromCharCode(
        (nBits & 0xff0000) >> 16, (nBits & 0xff00) >> 8, nBits & 0xff);
    }

    // not sure if the following statement behaves as supposed under
    // all circumstances, but tests up til now says it does.

    return sDecoded.substring(0, sDecoded.length -
     ((sEncoded.charCodeAt(i - 2) == 61) ? 2 :
      (sEncoded.charCodeAt(i - 1) == 61 ? 1 : 0)));
  },

  getObject : function(type, message){
    if(type == "HTTP"){
      if(isIE)
        obj = new ActiveXObject("microsoft.XMLHTTP");
      else if(isNS)
        obj = new XMLHttpRequest();
    }
    else if(type == "XMLDOM"){
      if(isIE){
        obj = new ActiveXObject("microsoft.XMLDOM");
        obj.loadXML(message)
      }else if(isNS){
        obj = new DOMParser();
        obj = obj.parseFromString(message, "text/xml");
      }

    }
    else{
      this.handleError(new Error("Unknown Object"));
    }

    return obj;
  },

  validateMethodName : function(name){
    /*do Checking:

    The string may only contain identifier characters,
    upper and lower-case A-Z, the numeric characters, 0-9,
    underscore, dot, colon and slash.

    */
    if(/^[A-Za-z0-9\._\/:]+$/.test(name))
      return true
    else
      this.handleError(new Error("Incorrect method name"));
  },

  getXML : function(obj){
    if(typeof obj == "function"){
      this.handleError(new Error("Cannot Parse functions"));
    }else if(obj == null || obj == undefined || (typeof obj == "number" && !isFinite(obj)))
      return false.toXMLRPC();
    else
      return obj.toXMLRPC();
  },

  handleError : function(e){
    if(!this.onerror || !this.onerror(e)){
      //alert("An error has occured: " + e.message);
      throw e;
    }
    this.stop = true;
    this.lastError = e;
  },

  cancel : function(id){
    //You can only cancel a request when it was executed async (I think)
    if(!this.queue[id]) return false;

    this.queue[id][0].abort();
    return true;
  },

  send : function(serverAddress, functionName, args, receive, multicall, autoroute){
    var id, http;
    //default is sync
    this.validateMethodName();
    if(this.stop){this.stop = false; return false;}

    //setting up multicall
    multicall = (multicall != null) ? multicall : this.multicall;

    if(multicall){
      if(!this.stack[serverAddress]) this.stack[serverAddress] = new Array();
      this.stack[serverAddress].push({methodName : functionName, params : args});
      return true;
    }

    //creating http object
    var http = this.getObject("HTTP");

    //setting some things for async/sync transfers
    if(!receive || isNS){;
      async = false;
    }
    else{
      async = true;
      /* The timer functionality is implemented instead of
        the onreadystatechange event because somehow
        the calling of this event crashed IE5.x
      */
      id = this.queue.push([http, receive, null, new Date()])-1;

      this.queue[id][2] = new Function("var id='" + id + "';var dt = new Date(new Date().getTime() - XMLRPC.queue[id][3].getTime());diff = parseInt(dt.getSeconds()*1000 + dt.getMilliseconds());if(diff > XMLRPC.timeout){if(XMLRPC.ontimeout) XMLRPC.ontimeout(); clearInterval(XMLRPC.timers[id]);XMLRPC.cancel(id);return};if(XMLRPC.queue[id][0].readyState == 4){XMLRPC.queue[id][0].onreadystatechange = function(){};XMLRPC.receive(id);clearInterval(XMLRPC.timers[id])}");
      this.timers[id] = setInterval("XMLRPC.queue[" + id + "][2]()", 20);
    }

    //setting up the routing
    autoroute = (autoroute || this.autoroute);

    //'active' is only set when direct sending the message has failed
    var srv = (autoroute == "active") ? this.routeServer : serverAddress;

    try{
      http.open('POST', srv, async);
      http.setRequestHeader("User-Agent", "vcXMLRPC v0.91 (" + navigator.userAgent + ")");
      http.setRequestHeader("Host", srv.replace(/^https?:\/{2}([:\[\]\-\w\.]+)\/?.*/, '$1'));
      http.setRequestHeader("Content-type", "text/xml");
      if(autoroute == "active"){
        http.setRequestHeader("X-Proxy-Request", serverAddress);
        http.setRequestHeader("X-Compress-Response", "gzip");
      }
    }
    catch(e){
      if(autoroute == true){
        //Access has been denied, Routing call.
        autoroute = "active";
        if(id){
          delete this.queue[id];
          clearInterval(this.timers[id]);
        }
        return this.send(serverAddress, functionName, args, receive, multicall, autoroute);
      }

      //Routing didn't work either..Throwing error
      this.handleError(new Error("Could not sent XMLRPC Message (Reason: Access Denied on client)"));
      if(this.stop){this.stop = false;return false}
    }

    //Construct the message
    var message = '<?xml version="1.0"?><methodCall><methodName>' + functionName + '</methodName><params>';
     for(i=0;i<args.length;i++){
       message += '<param><value>' + this.getXML(args[i]) + '</value></param>';
    }
    message += '</params></methodCall>';

    var xmldom = this.getObject('XMLDOM', message);
    if(self.DEBUG) alert(message);

    try{
      //send message
      http.send(xmldom);
    }
    catch(e){
      //Most likely the message timed out(what happend to your internet connection?)
      this.handleError(new Error("XMLRPC Message not Sent(Reason: " + e.message + ")"));
      if(this.stop){this.stop = false;return false}
    }

    if(!async && receive)
      return [autoroute, receive(this.processResult(http))];
    else if(receive)
      return [autoroute, id];
    else
      return [autoroute, this.processResult(http)];
  },

  receive : function(id){
    //Function for handling async transfers..
    if(this.queue[id]){
      var data = this.processResult(this.queue[id][0]);
      this.queue[id][1](data);
      delete this.queue[id];
    }
    else{
      this.handleError(new Error("Error while processing queue"));
    }
  },

  processResult : function(http){
    if(self.DEBUG) alert(http.responseText);
    if(http.status == 200){
      //getIncoming message
       dom = http.responseXML;

       if(dom){
         var rpcErr, main;

         //Check for XMLRPC Errors
         rpcErr = dom.getElementsByTagName("fault");
         if(rpcErr.length > 0){
           rpcErr = this.toObject(rpcErr[0].firstChild);
           this.handleError(new Error(rpcErr.faultCode, rpcErr.faultString));
           return false
         }

         //handle method result
         main = dom.getElementsByTagName("param");
          if(main.length == 0) this.handleError(new Error("Malformed XMLRPC Message"));
        data = this.toObject(this.getNode(main[0], [0]));

        //handle receiving
        if(this.onreceive) this.onreceive(data);
        return data;
       }
       else{
          this.handleError(new Error("Malformed XMLRPC Message"));
      }
    }
    else{
      this.handleError(new Error("HTTP Exception: (" + http.status + ") " + http.statusText + "\n\n" + http.responseText));
    }
  }
}

//Smell something
ver = navigator.appVersion;
app = navigator.appName;
isNS = Boolean(navigator.productSub)
//moz_can_do_http = (parseInt(navigator.productSub) >= 20010308)

isIE = (ver.indexOf("MSIE 5") != -1 || ver.indexOf("MSIE 6") != -1) ? 1 : 0;
isIE55 = (ver.indexOf("MSIE 5.5") != -1) ? 1 : 0;

isOTHER = (!isNS && !isIE) ? 1 : 0;


--- NEW FILE: epoz_blank_iframe.html.pt ---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<base tal:attributes="href python: request.get('pageurl',here.absolute_url())" />
<meta http-equiv="Content-Type"
          tal:define="dummy python:request.RESPONSE.setHeader('Content-Type', 'text/html;; charset=%s' % request.get('charset','utf-8'))"
          tal:attributes="content python: 'text/html;; charset=%s' % request.get('charset','utf-8')" />
<style media="all" type="text/css">
<!--
 a[name] {
     border:1px solid grey;
     background: lightgrey url(misc_/Epoz/epoz_button_anchor.gif) -2px -3px no-repeat;
     padding: 1px 0px 1px 20px;
     margin: 5px;
 }

 a[name]:after {
     content: attr(name);
 }
-->
</style>
<style tal:condition="python: request.get('css')" type="text/css" media="all"
          tal:content="string:@import url(${request/css});"></style>
<style tal:condition="python: request.get('customcss')" type="text/css" media="all"
          tal:content="string:@import url(${request/customcss});"></style>
</head>
<body class="visualFontSizeCorrection">
</body>
</html>
--- NEW FILE: epoz_script_color.html.dtml ---
<html>
<head>

<title>Epoz</title>

<script type="text/javascript">

function InitColorPalette() {
  if (document.getElementsByTagName)
      var x = document.getElementsByTagName('TD');
  else if (document.all)
      var x = document.all.tags('TD');
  for (var i=0;i<x.length;i++) {
      x[i].onmouseover = over;
      x[i].onmouseout = out;
      x[i].onclick = click;
  }
}

function over() {
  this.style.border='1px dotted white';
}

function out() {
  this.style.border='1px solid gray';
}

function click() {
  window.opener.SetColor(this.id);
  window.close();
}
</script>
</head>

<body bgcolor="white" onLoad="InitColorPalette(); this.focus();">

<table border="1" cellpadding="1" cellspacing="1">
<tr>
<td id="#FFFFFF" bgcolor="#FFFFFF" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCCCC" bgcolor="#FFCCCC" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCC99" bgcolor="#FFCC99" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFF99" bgcolor="#FFFF99" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFFCC" bgcolor="#FFFFCC" width="20" height="20"><img width="1" height="1"></td>
<td id="#99FF99" bgcolor="#99FF99" width="20" height="20"><img width="1" height="1"></td>
<td id="#99FFFF" bgcolor="#99FFFF" width="20" height="20"><img width="1" height="1"></td>
<td id="#CCFFFF" bgcolor="#CCFFFF" width="20" height="20"><img width="1" height="1"></td>
<td id="#CCCCFF" bgcolor="#CCCCFF" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCCFF" bgcolor="#FFCCFF" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#CCCCCC" bgcolor="#CCCCCC" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF6666" bgcolor="#FF6666" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF9966" bgcolor="#FF9966" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFF66" bgcolor="#FFFF66" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFF33" bgcolor="#FFFF33" width="20" height="20"><img width="1" height="1"></td>
<td id="#66FF99" bgcolor="#66FF99" width="20" height="20"><img width="1" height="1"></td>
<td id="#33FFFF" bgcolor="#33FFFF" width="20" height="20"><img width="1" height="1"></td>
<td id="#66FFFF" bgcolor="#66FFFF" width="20" height="20"><img width="1" height="1"></td>
<td id="#9999FF" bgcolor="#9999FF" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF99FF" bgcolor="#FF99FF" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#C0C0C0" bgcolor="#C0C0C0" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF0000" bgcolor="#FF0000" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF9900" bgcolor="#FF9900" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCC66" bgcolor="#FFCC66" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFF00" bgcolor="#FFFF00" width="20" height="20"><img width="1" height="1"></td>
<td id="#33FF33" bgcolor="#33FF33" width="20" height="20"><img width="1" height="1"></td>
<td id="#66CCCC" bgcolor="#66CCCC" width="20" height="20"><img width="1" height="1"></td>
<td id="#33CCFF" bgcolor="#33CCFF" width="20" height="20"><img width="1" height="1"></td>
<td id="#6666CC" bgcolor="#6666CC" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC66CC" bgcolor="#CC66CC" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#999999" bgcolor="#999999" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC0000" bgcolor="#CC0000" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF6600" bgcolor="#FF6600" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCC33" bgcolor="#FFCC33" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCC00" bgcolor="#FFCC00" width="20" height="20"><img width="1" height="1"></td>
<td id="#33CC00" bgcolor="#33CC00" width="20" height="20"><img width="1" height="1"></td>
<td id="#00CCCC" bgcolor="#00CCCC" width="20" height="20"><img width="1" height="1"></td>
<td id="#3366FF" bgcolor="#3366FF" width="20" height="20"><img width="1" height="1"></td>
<td id="#6633FF" bgcolor="#6633FF" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC33CC" bgcolor="#CC33CC" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#666666" bgcolor="#666666" width="20" height="20"><img width="1" height="1"></td>
<td id="#990000" bgcolor="#990000" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC6600" bgcolor="#CC6600" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC9933" bgcolor="#CC9933" width="20" height="20"><img width="1" height="1"></td>
<td id="#999900" bgcolor="#999900" width="20" height="20"><img width="1" height="1"></td>
<td id="#009900" bgcolor="#009900" width="20" height="20"><img width="1" height="1"></td>
<td id="#339999" bgcolor="#339999" width="20" height="20"><img width="1" height="1"></td>
<td id="#3333FF" bgcolor="#3333FF" width="20" height="20"><img width="1" height="1"></td>
<td id="#6600CC" bgcolor="#6600CC" width="20" height="20"><img width="1" height="1"></td>
<td id="#993399" bgcolor="#993399" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#333333" bgcolor="#333333" width="20" height="20"><img width="1" height="1"></td>
<td id="#660000" bgcolor="#660000" width="20" height="20"><img width="1" height="1"></td>
<td id="#993300" bgcolor="#993300" width="20" height="20"><img width="1" height="1"></td>
<td id="#996633" bgcolor="#996633" width="20" height="20"><img width="1" height="1"></td>
<td id="#666600" bgcolor="#666600" width="20" height="20"><img width="1" height="1"></td>
<td id="#006600" bgcolor="#006600" width="20" height="20"><img width="1" height="1"></td>
<td id="#336666" bgcolor="#336666" width="20" height="20"><img width="1" height="1"></td>
<td id="#000099" bgcolor="#000099" width="20" height="20"><img width="1" height="1"></td>
<td id="#333399" bgcolor="#333399" width="20" height="20"><img width="1" height="1"></td>
<td id="#663366" bgcolor="#663366" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#000000" bgcolor="#000000" width="20" height="20"><img width="1" height="1"></td>
<td id="#330000" bgcolor="#330000" width="20" height="20"><img width="1" height="1"></td>
<td id="#663300" bgcolor="#663300" width="20" height="20"><img width="1" height="1"></td>
<td id="#663333" bgcolor="#663333" width="20" height="20"><img width="1" height="1"></td>
<td id="#333300" bgcolor="#333300" width="20" height="20"><img width="1" height="1"></td>
<td id="#003300" bgcolor="#003300" width="20" height="20"><img width="1" height="1"></td>
<td id="#003333" bgcolor="#003333" width="20" height="20"><img width="1" height="1"></td>
<td id="#000066" bgcolor="#000066" width="20" height="20"><img width="1" height="1"></td>
<td id="#330099" bgcolor="#330099" width="20" height="20"><img width="1" height="1"></td>
<td id="#330033" bgcolor="#330033" width="20" height="20"><img width="1" height="1"></td>
</tr>
</table>
</body>
</html>

--- NEW FILE: epoz_script_detect.js.dtml ---
// Browser Detect  v2.1.6
// documentation: http://www.dithered.com/javascript/browser_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)


function BrowserDetect() {
   var ua = navigator.userAgent.toLowerCase(); 

   // browser engine name
   this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
   this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);

   // browser name
   this.isKonqueror   = (ua.indexOf('konqueror') != -1); 
   this.isSafari      = (ua.indexOf('safari') != - 1);
   this.isOmniweb     = (ua.indexOf('omniweb') != - 1);
   this.isOpera       = (ua.indexOf('opera') != -1); 
   this.isIcab        = (ua.indexOf('icab') != -1); 
   this.isAol         = (ua.indexOf('aol') != -1); 
   this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) ); 
   this.isMozilla     = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
   this.isFirebird    = (ua.indexOf('firebird/') != -1);
   this.isNS          = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
   
   // spoofing and compatible browsers
   this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
   
   // rendering engine versions
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
   this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 
   
   // correct version number
   if (this.isGecko && !this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
   }
   else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   }
   else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   }
   else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
   }
   else if (this.isOmniweb) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
   }
   else if (this.isOpera) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
   }
   else if (this.isIcab) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
   }
   
   this.versionMajor = parseInt(this.versionMinor); 
   
   // dom support
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   
   // css compatibility mode
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';

   // platform
   this.isWin    = (ua.indexOf('win') != -1);
   this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   this.isMac    = (ua.indexOf('mac') != -1);
   this.isUnix   = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux  = (ua.indexOf('linux') != -1);
   
   // specific browser shortcuts
   this.isNS4x = (this.isNS && this.versionMajor == 4);
   this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
   this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
   this.isNS4up = (this.isNS && this.versionMinor >= 4);
   this.isNS6x = (this.isNS && this.versionMajor == 6);
   this.isNS6up = (this.isNS && this.versionMajor >= 6);
   this.isNS7x = (this.isNS && this.versionMajor == 7);
   this.isNS7up = (this.isNS && this.versionMajor >= 7);
   
   this.isIE4x = (this.isIE && this.versionMajor == 4);
   this.isIE4up = (this.isIE && this.versionMajor >= 4);
   this.isIE5x = (this.isIE && this.versionMajor == 5);
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE5up = (this.isIE && this.versionMajor >= 5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
   this.isIE6up = (this.isIE && this.versionMajor >= 6);
   
   this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetect();
--- NEW FILE: epoz_script_widget.js.dtml ---
//
// Create HTML for Epoz-Editor
//
// Comment out the parts you don't want to be shown.
//

function CreateEpoz() {

    var widget = '';
    var spacer = '<img src="'+form_path+'epoz_button_space.gif" width="2" height="1">';

    widget += '<div id="EpozToolbar">';

/*
    The select-box for formats
*/

    widget += '<select id="formatblock" onchange="SelectFormat(this);" style="margin-bottom: 2px;">';
    widget += '<option value="">'+EpozLang["Normal"]+'</option>';
    widget += '<option value="<p>">'+EpozLang["Paragraph"]+'</option>';
    widget += '<option value="<h1>">'+EpozLang["Heading1"]+'</option>';
    widget += '<option value="<h2>">'+EpozLang["Heading2"]+'</option>';
    widget += '<option value="<h3>">'+EpozLang["Heading3"]+'</option>';
    widget += '<option value="<h4>">'+EpozLang["Heading4"]+'</option>';
    widget += '<option value="<h5>">'+EpozLang["Heading5"]+'</option>';
    widget += '<option value="<h6>">'+EpozLang["Heading6"]+'</option>';
    widget += '<option value="<pre>">'+EpozLang["Formatted"]+'</option>';
    widget += '</select>';
    widget += '<br />';

/*
    The font-face-buttons (bold, italic, underline)
*/

    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_bold.gif" width="23" height="22" alt="'+EpozLang["Bold"]+'" title="'+EpozLang["Bold"]+'" onClick="FormatText(\'bold\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_italic.gif" width="23" height="22" alt="'+EpozLang["Italic"]+'" title="'+EpozLang["Italic"]+'" onClick="FormatText(\'italic\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_underline.gif" width="23" height="22" alt="'+EpozLang["Underline"]+'" title="'+EpozLang["Underline"]+'" onClick="FormatText(\'underline\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_strikethrough.gif" width="23" height="22" alt="'+EpozLang["Strikethrough"]+'" title="'+EpozLang["Strikethrough"]+'" onClick="FormatText(\'strikethrough\', \'\');" />';
    widget += spacer;

/*
    The sub-/superscript-buttons
*/

    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_subscript.gif" width="23" height="22" alt="'+EpozLang["Subscript"]+'" title="'+EpozLang["Subscript"]+'" onClick="FormatText(\'subscript\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_superscript.gif" width="23" height="22" alt="'+EpozLang["Superscript"]+'" title="'+EpozLang["Superscript"]+'" onClick="FormatText(\'superscript\', \'\');" />';
    widget += spacer;

/*
    The remove-format-button
*/

    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_unformat.gif" width="23" height="22" alt="'+EpozLang["RemoveFormat"]+'" title="'+EpozLang["RemoveFormat"]+'" onClick="FormatText(\'removeformat\', \'\');" />';
    widget += spacer;

/*
    The color-selections (foreground, background)
*/
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_textcolor.gif" width="23" height="22" alt="'+EpozLang["TextColor"]+'" title="'+EpozLang["TextColor"]+'" onClick="SetTextColor();" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_bgcolor.gif" width="23" height="22" alt="'+EpozLang["BackColor"]+'" title="'+EpozLang["BackColor"]+'" onClick="SetBackColor();" />';
    widget += spacer;

/*
    Alignment-controls
*/
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_left_just.gif" width="23" height="22" alt="'+EpozLang["AlignLeft"]+'" title="'+EpozLang["AlignLeft"]+'" onClick="FormatText(\'justifyleft\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_centre.gif" width="23" height="22" alt="'+EpozLang["Center"]+'" title="'+EpozLang["Center"]+'" onClick="FormatText(\'justifycenter\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_right_just.gif" width="23" height="22" alt="'+EpozLang["AlignRight"]+'" title="'+EpozLang["AlignRight"]+'" onClick="FormatText(\'justifyright\', \'\');" />';
    widget += spacer;

/*
    Lists and In/Outdent
*/
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_numbered_list.gif" width="23" height="22" alt="'+EpozLang["OrderedList"]+'" title="'+EpozLang["OrderedList"]+'" onClick="FormatText(\'insertorderedlist\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_list.gif" width="23" height="22" alt="'+EpozLang["UnorderedList"]+'" title="'+EpozLang["UnorderedList"]+'" onClick="FormatText(\'insertunorderedlist\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_outdent.gif" width="23" height="22" alt="'+EpozLang["Outdent"]+'" title="'+EpozLang["Outdent"]+'" onClick="FormatText(\'outdent\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_indent.gif" width="23" height="22" alt="'+EpozLang["Indent"]+'" title="'+EpozLang["Indent"]+'" onClick="FormatText(\'indent\', \'\');" />';
    widget += spacer;

/*
    Insert Link, Image, Rule, Table
*/
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_hyperlink.gif" width="23" height="22" alt="'+EpozLang["InsertLink"]+'" title="'+EpozLang["InsertLink"]+'" onClick="CreateLink();" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_anchor.gif" width="23" height="22" alt="'+EpozLang["InsertAnchor"]+'" title="'+EpozLang["InsertAnchor"]+'" onClick="CreateAnchor();" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_image.gif" width="23" height="22" alt="'+EpozLang["InsertImage"]+'" title="'+EpozLang["InsertImage"]+'" onClick="CreateImage();" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_hr.gif" width="23" height="22" alt="'+EpozLang["InsertRule"]+'" title="'+EpozLang["InsertRule"]+'" onClick="FormatText(\'inserthorizontalrule\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_table.gif" width="23" height="22" alt="'+EpozLang["InsertTable"]+'" title="'+EpozLang["InsertTable"]+'" onClick="window.open(\''+form_path+'epoz_script_table.html\',\'EpozTable\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=220,height=220\');" />';

/*
    The optional toolbox
*/
    if ((form_toolbox != null) && (form_toolbox != "")) {
        widget += spacer;
        widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_tools.gif" width="23" height="22" alt="'+EpozLang["Toolbox"]+'" title="'+EpozLang["Toolbox"]+'"" onClick="window.open(\''+form_toolbox+'\',\'EpozToolbox\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=400\');" />';
    }

    widget += spacer;

/*
    Undo & Redo
*/

    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_undo.gif" width="23" height="22" alt="'+EpozLang["Undo"]+'" title="'+EpozLang["Undo"]+'" onClick="FormatText(\'undo\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_redo.gif" width="23" height="22" alt="'+EpozLang["Redo"]+'" title="'+EpozLang["Redo"]+'" onClick="FormatText(\'redo\', \'\');" />';

/*
     Don't remove!!! And better not touch...;)
*/

    widget += '\n<br />\n';
    widget += '<iframe src="'+form_pageurl+'/epoz_blank_iframe.html?charset='+form_charset+'&css='+form_css+'&customcss='+form_customcss+'&pageurl='+form_pageurl+'" frameborder="0" id="' + Epoz + '" style="' + form_area_style + '" onload="InitDocument();"></iframe>';
    widget += '</div>';

    widget += '<textarea style="display: none; ' + form_area_style + '"  id="' + form_name + '" name="' + form_name + '" value=""></textarea>';
    widget += '<div style="margin: 0px;"><input id="EpozViewMode" style="margin: 0px; width: 10px; height: 10px;" type="checkbox" onclick="SwitchViewMode(this.checked)" />&nbsp;<span style="font-size: 10px;">' + EpozLang["HTML"] + '</span></div>';

    document.writeln(widget);
}


// Create a default-textbox for browsers without Rich-Text-Features

function CreateTextarea() {
    document.writeln('<textarea name="' + form_name + '" id="' + Epoz + '" style="' + form_area_style + '">'+form_data+'</textarea>');
}

--- NEW FILE: epoz_script_table.html.dtml ---
<html>
<head>

<title>Epoz</title>

<style type="text/css">
<!--
* {font-family: Arial, Helvetica, Sans-Serif; font-size: 12px;}
//-->
</style>

<script type="text/javascript">

function SubmitForm() {
 rows = document.getElementById('rows').value;
 cols = document.getElementById('cols').value;
 border = document.getElementById('border').value;
 head = document.getElementById('head').value;
 window.opener.CreateTable(rows, cols, border, head);
 window.close();
};

</script>
</head>

<body onload="this.focus();">

<form>
<table border="0" cellspacing="4" cellpadding="4">
<tbody>

 <tr>
  <td><script type="text/javascript">document.writeln(opener.EpozLang["EnterTableRows"]);</script></td>
  <td><input type="text" name="rows" id="rows" size="5" value="3" /></td>
 </tr>

 <tr>
  <td><script type="text/javascript">document.writeln(opener.EpozLang["EnterTableColumns"]);</script></td>
  <td><input type="text" name="cols" id="cols" size="5" value="3" /></td>
 </tr>

 <tr>
  <td><script type="text/javascript">document.writeln(opener.EpozLang["EnterTableBorder"]);</script></td>
  <td><input type="text" name="border" id="border" size="5" value="1" /></td>
 </tr>

 <tr>
  <td colspan="2">
        <select id="head" name="head">
          <option value="0"><script type="text/javascript">document.writeln(opener.EpozLang["TableWithoutHead"]);</script></option>
          <option value="1"><script type="text/javascript">document.writeln(opener.EpozLang["TableWithHead"]);</script></option>
         </select>
   </td>
 </tr>

 <tr>
  <td colspan="2">
   <button type="button" onclick="return SubmitForm();"><script type="text/javascript">document.writeln(opener.EpozLang["InsertTable"]);</script></button>
  </td>
 </tr>

 </tbody>
</table>

</form>
</body>
</html>



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.