private int[] randomComputeLastIndex(String key, boolean skipFirst)
  {
    int count = 0;
    int keyIndex = lastHTMLReply.indexOf(key);
    // 1. Count the number of times we find key
    while (keyIndex != -1)
    {
      count++;
      keyIndex = lastHTMLReply.indexOf(key, keyIndex+key.length());
    }
    if ((count == 0) || (skipFirst && (count <= 1)))
    {
      if (debugLevel>0)
        System.err.println("Thread "+this.getName()+": Cannot find "+key+" in last HTML reply<br>");
      if (debugLevel>1)
        System.err.println("Thread "+this.getName()+": Last HTML reply is: "+lastHTMLReply+"<br>");
      return null;
    }

    // 2. Pickup randomly a key
    keyIndex = -key.length();
    count = rand.nextInt(count)+1;
    if ((skipFirst) && (count == 1))
      count++; // Force to skip the first element
    while (count > 0)
    {
      keyIndex = lastHTMLReply.indexOf(key, keyIndex+key.length());
      count--;
    }
    keyIndex += key.length();
    int lastIndex = isMin(Integer.MAX_VALUE, lastHTMLReply.indexOf('\"', keyIndex));
    lastIndex = isMin(lastIndex, lastHTMLReply.indexOf('?', keyIndex));
    lastIndex = isMin(lastIndex, lastHTMLReply.indexOf('&', keyIndex));
    lastIndex = isMin(lastIndex, lastHTMLReply.indexOf('>', keyIndex));
    int[] result = new int[2];
    result[0] = keyIndex;
    result[1] = lastIndex;
    return result;
  }