function dodecode(textstr)
{
  var textlen = textstr.length;
  var blocksize = 5;
  var ix = 0;
  var arr = new Array();

  // split string into pieces of size blocksize
  while (ix < textlen)
  {
    newix = Math.min(ix + blocksize, textlen);
    var subtextstr = textstr.substring(ix, newix);
    arr[arr.length] = subtextstr;
    ix = newix;
  }

  // swap pieces to "decode"
  var half = arr.length / 2;
  var mlen = arr.length - 1;
  for (ix=0;  ix<half;  ix+=2)
  {
    var temp = arr[ix];
    arr[ix] = arr[mlen - ix];
    arr[mlen - ix] = temp;
  }

  // output results
  for (ix=0;  ix<arr.length;  ++ix)
  {  document.write(arr[ix]);  }
}
