function trim(pValor){
   while ((pValor.length>0) && (pValor.substr(0,1)==' '))
      pValor = pValor.substr(1);
   while ((pValor.length>0) && (pValor[pValor.length-1]==' '))
      pValor = pValor.substr(0,pValor.length-1);
   return pValor;
}