/******************************************************************************
* Spaces.js                                                                   *
*                                                                             *
* Copyright 2000 CPIDT                                                        *
* Web address: http://www.cpidt.pt                                            *
* Last update: 12 Fevereiro 2000                                              *
*                                                                             *
* JavaScript para Tratamento de Texto                                         *
******************************************************************************/

function spaces(texto) {
var aux=''

for(i=0 ; i < texto.length;i++)
  if (texto.charAt(i) == ' ')
     aux+='+';
  else
     if (texto.charAt(i) == '\n')
        aux+='<br>';
     else
        if (texto.charAt(i) == "'")
           aux+="''";
        else
           if (texto.charAt(i) == '%')
              aux+='%25';
           else
              aux+=texto.charAt(i);


/*
    else
         if (texto.charAt(i) == '/' && texto.charAt(i+1) == '/')
             {                          
              aux+='&#47;&#47;';
            aux+=escape('/')+escape('/');   
             i++
             }
*/


return aux;
}



function spaces2(texto) {
var aux=''

for(i=0 ; i < texto.length;i++)
  if (texto.charAt(i) == ' ')
     aux+=' ';
  else
     if (texto.charAt(i) == '\n')
        aux+='<br>';
     else
        if (texto.charAt(i) == "'")
           /* aux+="''"; */
           aux+="`";
        else
           if (texto.charAt(i) == '%')
              aux+='%25';
           else
              if (texto.charAt(i) == '&')
                 aux+='%26';
               else
                 aux+=texto.charAt(i);

return aux;
}



