
// ############################################################################
// #                                                                          #
// #    Program   : Prophecy - A Library of JavaScript Utility Functions      #
// #    Version   : 1.00 - 15th April 1999                                    #
// #    Copyright : The Happy Hippy, (C) 1999                                 #
// #    Contact   : hippy@psynet.net                                          #
// #                                                                          #
// ############################################################################
// #                                                                          #
// #    Version History                                                       #
// #                                                                          #
// #    1.00    15 Apr 1999     First public release.                         #
// #                                                                          #
// ############################################################################

// ############################################################################
// #                                                                          #
// #    THESE ARE GLOBAL VARIABLES USED BY THESE UTILITY ROUTINES             #
// #                                                                          #
// ############################################################################

var t$
var o$
var StartPtr
var EndPtr

// ############################################################################
// #                                                                          #
// #    THESE ARE THE STRING UTILITY ROUTINES                                 #
// #                                                                          #
// ############################################################################
// #                                                                          #
// #    These functions allow string manipulations similar to those that are  #
// #    used in Visual Basic (TM) and Turbo Basic (TM) to allow fast-track    #
// #    development of JavaScript code without having to worry about the      #
// #    somewhat complicated string object methods supplied as standard in    #
// #    JavaScript.                                                           #
// #                                                                          #
// #    Functions that are provided are -                                     #
// #                                                                          #
// #            Trim$(t$)       Removes leading and trailing spaces           #
// #            Ltrim$(t$)      Removes leading spaces                        #
// #            Rtrim$(t$)      Removes trailing spaces                       #
// #            Left$(t$,n)     Returns the leftmost characters               #
// #            Right$(t$,n)    Returns the rightmost characters              #
// #            Mid$(t$,n,w)    Returns w characters starting from n          #
// #            PokeMid$(t$,n,w$) Put w$ into t$ at char posintion n          #
// #            Ucase$(t$)      Converts to upper case                        #
// #            Lcase$(t$)      Converts to lower case                        #
// #            Len(t$)         Returns length of string                      #
// #            Instr(t$,s$)    Returns first pos when string s is in t       #
// #            Val(t$)         Returns number represented by string          #
// #            Asc(t$)         Returns ascii value of first character        #
// #            Chr$(n)         Returns character represneted by ascii value  #
// #            Space$(n)       Returns n spaces                              #
// #            String$(t$,n)   Returns n occurances of string                #
// #            Hex$(n)         Returns string for hex value of number        #
// #            FNhex$(n,w)     As Hex$(n) but forcing w digits               #
// #            Oct$(n)         Returns string for octal value of number      #
// #            FNoct$(n,w)     As Oct$(n) but forcing w digits               #
// #                                                                          #
// #    These string handling routines define the first character in the      #
// #    string as being in position one.                                      #
// #                                                                          #
// ############################################################################

// ****************************************************************************
// *                                                                          *
// *    Trim$(t$)       This function will remove all leading and trailing    *
// *                    spaces from a string.                                 *
// *                                                                          *
// *    Example         Trim$("  Hello There  ") ==> "Hello There"            *
// *                                                                          *
// ****************************************************************************

function Trim$(t$)
{
  return ( Ltrim$(Rtrim$(t$)) )
}

// ****************************************************************************
// *                                                                          *
// *    Ltrim$(t$)      This function will remove all leading spaces from a   *
// *                    string.                                               *
// *                                                                          *
// *    Example         Ltrim$("  Hello There  ") ==> "Hello There  "         *
// *                                                                          *
// ****************************************************************************

function Ltrim$(t$)
{
  var Alpha$ = t$
  while ( Left$(Alpha$,1) == " " ) Alpha$ = Right$(Alpha$,-1)
  return ( Alpha$ )
}

// ****************************************************************************
// *                                                                          *
// *    Rtrim$(t$)      This function will remove all trailing spaces from a  *
// *                    string.                                               *
// *                                                                          *
// *    Example         Rrim$("  Hello There  ") ==> "  Hello There"          *
// *                                                                          *
// ****************************************************************************

function Rtrim$(t$)
{
  var Alpha$ = t$
  while ( Right$(Alpha$,1) == " " ) Alpha$ = Left$(Alpha$,-1)
  return ( Alpha$ )
}

// ****************************************************************************
// *                                                                          *
// *    Left$(t$,n)     This function will return the leftmost n characters   *
// *                    of a string or, if n is negative, will return the     *
// *                    string with the rightmost n charcters removed.        *
// *                                                                          *
// *    Examples        Left$("Hello There", 4) ==> "Hell"                    *
// *                    Left$("Hello There",-4) ==> "Hello T"                 *
// *                                                                          *
// ****************************************************************************

function Left$(t$,n)
{
  if ( n >=0 )
    return ( t$.substring(0,n) )
  else
    return ( Left$(t$,Len(t$)+n) )
}

// ****************************************************************************
// *                                                                          *
// *    Right$(t$,n)    This function will return the rightmost n characters  *
// *                    of a string or, if n is negative, will return the     *
// *                    string with the leftmost n charcters removed.         *
// *                                                                          *
// *    Examples        Right$("Hello There", 4) ==> "here"                   *
// *                    Right$("Hello There",-4) ==> "o There"                *
// *                                                                          *
// ****************************************************************************

function Right$(t$,n)
{
  if ( n >=0 )
    return ( t$.substring(Len(t$)-n,Len(t$)) )
  else
    return ( Right$(t$,Len(t$)+n) )
}

// ****************************************************************************
// *                                                                          *
// *    Mid$(t$,n,w)    This function will return w characters of the string  *
// *                    starting from position n.                             *
// *                                                                          *
// *    Example         Mid$("Hello There",3,5) ==> "llo T"                   *
// *                                                                          *
// ****************************************************************************

function Mid$(t$,n,w)
{
  return ( t$.substring(n-1,n-1+w) )
}

// ****************************************************************************
// *                                                                          *
// *    PokeMid(t$,n,w$)        This function will
// *                                                                          *
// *    Example         PokeMid$("Hello There",3,"XX") ==> "HeXXo There"      *
// *                                                                          *
// ****************************************************************************

function PokeMid$(t$,n,w$)
{
  return ( Left$(t$,n-1)+w$+Right$(t$, (-(n+Len(w$)))+1 ) )
}

// ****************************************************************************
// *                                                                          *
// *    Ucase$(t$)      This function will convert all characters in a string *
// *                    to uppercase.                                         *
// *                                                                          *
// *    Example         Ucase$("Hello There") ==> "HELLO THERE"               *
// *                                                                          *
// ****************************************************************************

function Ucase$(t$)
{
  return ( t$.toUpperCase() )
}

// ****************************************************************************
// *                                                                          *
// *    Lcase$(t$)      This function will convert all characters in a string *
// *                    to lowercase.                                         *
// *                                                                          *
// *    Example         Ucase$("Hello There") ==> "hello there"               *
// *                                                                          *
// ****************************************************************************

function Lcase$(t$)
{
   return ( t$.toLowerCase() )
}

// ****************************************************************************
// *                                                                          *
// *    Len(t$)         This function will return the number of characters    *
// *                    in a string.                                          *
// *                                                                          *
// *    Examples        Len("Hello There") ==> 11                             *
// *                    Len("")            ==>  0                             *
// *                    Len(null)          ==>  0                             *
// *                                                                          *
// ****************************************************************************

function Len(t$)
{
 if ( t$ == null )
   return ( 0 )
 else
   return ( t$.length )
}

// ****************************************************************************
// *                                                                          *
// *    Instr(t$,s$)    This function will return the character position of   *
// *                    the first character in the target string where the    *
// *                    substring can be found in that target.  If the sub-   *
// *                    string cannot be found in the traget it will return   *
// *                    a zero value.                                         *
// *                                                                          *
// *    Examples        Instr("Hello There","There") ==> 7                    *
// *                    Instr("Hello There","llo")   ==> 3                    *
// *                    Instr("Hello There","X")     ==> 0                    *
// *                                                                          *
// ****************************************************************************

function Instr(t$,s$)
{
  return ( t$.indexOf(s$)+1 )
}

// ****************************************************************************
// *                                                                          *
// *    Val(t$)         This function will return the value represented by    *
// *                    a string.                                             *
// *                                                                          *
// *    Examples        Val("255")  ==> 255                                   *
// *                    Val("0xFF") ==> 255                                   *
// *                    Val("0.12") ==> 0.12                                  *
// *                                                                          *
// ****************************************************************************

function Val(t$)
{
  return ( parseFloat(t$) )
}

// ****************************************************************************
// *                                                                          *
// *    Asc(t$)         This function returns the ascii character value of    *
// *                    the first character of the string.                    *
// *                                                                          *
// *    Examples        Asc("A")        ==> 65                                *
// *                    Asc("Aardvark") ==> 65                                *
// *                    Asc("B")        ==> 66                                *
// *                    Asc("")         ==> 0                                 *
// *                                                                          *
// ****************************************************************************

function Asc(t$)
{
  var Alpha$
  var index
  if ( t$ == null )
    return ( 0 )
  else
    if ( t$ == "" )
      return ( 0 )
    else
    {
      if ( IncludeJsAsc$ == null )
      {
        IncludeJsAsc$  = " !\"#$%&\'()*+,-./"
        IncludeJsAsc$ += "0123456789:;<=>?"
        IncludeJsAsc$ += "@ABCDEFGHIJKLMNO"
        IncludeJsAsc$ += "PQRSTUVWXYZ[\\]^_"
        IncludeJsAsc$ += "`abcdefghijklmno"
        IncludeJsAsc$ += "pqrstuvwxyz{|}~ "
      }
      index = Instr(IncludeJsAsc$,Left$(t$,1))
      if (index == 0 )
        return ( 0 )
      else
        return ( index + 31 )
    }
}

// ****************************************************************************
// *                                                                          *
// *    Chr$(n)         This function returns the character that has ascii    *
// *                    value n.                                              *
// *                                                                          *
// *    Examples        Chr$(65) ==> "A"                                      *
// *                    Chr$(66) ==> "B"                                      *
// *                    Chr$(12) ==> "\n"       Carraige Return / Newline     *
// *                                                                          *
// ****************************************************************************

function Chr$(n)
{
  var Alpha$
  if ( n < 0 )
    return ( "" )
  else
  {
    if ( IncludeJsChr$ == null )
    {
      IncludeJsChr$  = "         \t  \n   "
      IncludeJsChr$ += "                "
      IncludeJsChr$ += " !\"#$%&\'()*+,-./"
      IncludeJsChr$ += "0123456789:;<=>?"
      IncludeJsChr$ += "@ABCDEFGHIJKLMNO"
      IncludeJsChr$ += "PQRSTUVWXYZ[\\]^_"
      IncludeJsChr$ += "`abcdefghijklmno"
      IncludeJsChr$ += "pqrstuvwxyz{|}~ "
    }
    return ( Mid$(IncludeJsChr$,n & 0x7F,1) )
  }
}

// ****************************************************************************
// *                                                                          *
// *    Space$(n)       This function will return a string that consists of   *
// *                    n spaces.                                             *
// *                                                                          *
// *    Examples        Space$(0) ==> ""                                      *
// *                    Space$(1) ==> " "                                     *
// *                    Space$(2) ==> "  "                                    *
// *                                                                          *
// ****************************************************************************

function Space$(n)
{
  if ( n <= 0 )
    return ( "" )
  else
    return ( " "+Space$(n-1) )
}

// ****************************************************************************
// *                                                                          *
// *    String$(t$,n)   This function will return n copies of the string all  *
// *                    concatenated together.                                *
// *                                                                          *
// *    Examples        String$("X",9)   ==> "XXXXXXXXX"                      *
// *                    String$("Abc",3) ==> "AbcAbcAbc"                      *
// *                    String$("Abc",0) ==> ""                               *
// *                                                                          *
// ****************************************************************************

function String$(t$,n)
{
  if ( n <= 0 )
    return ( "" )
  else
    return ( t+String$(t$,n-1) )
}

// ****************************************************************************
// *                                                                          *
// *    Hex$(n)         Returns a string representing the hexadecimal value   *
// *                    of the number supplied. If the number is negative a   *
// *                    string of "?" is returned.                            *
// *                                                                          *
// *    Examples        Hex$(10)  ==> "A"                                     *
// *                    Hex$(255) ==> "FF"                                    *
// *                    Hex$(-1)  ==> "?"                                     *
// *                                                                          *
// ****************************************************************************

function HexDigit$(n) { return ( Mid$("0123456789ABCDEF",n+1,1) ) }

function Hex$(n)
{

  if ( n < 0 )
    return ( "?" )
  else
    if ( parseInt(n) > 0xF )
      return ( Hex$(parseInt(n) >> 4 ) + HexDigit$( parseInt(n) & 0xF ))
    else
      return ( HexDigit$( parseInt(n) & 0xF ) )
}

// ****************************************************************************
// *                                                                          *
// *    FNhex$(n)       Returns a string representing the hexadecimal value   *
// *                    of the number supplied which will always contain w    *
// *                    digits. If the number is negative a string with "?"   *
// *                    repeated w times is returned. If w is negative the    *
// *                    returned string will be prefixed with "0x".           *
// *                                                                          *
// *    Examples        FNhex$(10,3)  ==> "00A"                               *
// *                    FNhex$(255,3) ==> "0FF"                               *
// *                    FNhex$(255,1) ==> "F"       Note lefthand truncation  *
// *                    FNhex$(-1,3)  ==> "???"                               *
// *                    FNhex$(255,-3) ==> "0x0FF"                            *
// *                    FNhex$(-1,-3)  ==> "0x???"                            *
// *                                                                          *
// ****************************************************************************

function FNhex$(n,w)
{
  if ( w < 0 )
    return ( "0x" + Right$(String$("0",-w)+Hex$(n),-w) )
  else
    return ( Right$(String$("0",w)+Hex$(n),w) )
}

// ****************************************************************************
// *                                                                          *
// *    Oct$(n)         Returns a string representing the octal value of the  *
// *                    number supplied. If the number is negative a string   *
// *                    of "?" is returned.                                   *
// *                                                                          *
// *    Examples        Oct$(8)   ==> "10"                                    *
// *                    Oct$(255) ==> "377"                                   *
// *                    Oct$(-1)  ==> "?"                                     *
// *                                                                          *
// ****************************************************************************

function OctDigit$(n) { return ( Mid$("01234567",n+1,1) ) }

function Oct$(n)
{

  if ( n < 0 )
    return ( "?" )
  else
    if ( parseInt(n) > 7 )
      return ( Oct$(parseInt(n) >> 3 ) + OctDigit$( parseInt(n) & 7 ))
    else
      return ( OctDigit$( parseInt(n) & 7 ) )
}

// ****************************************************************************
// *                                                                          *
// *    FNoct$(n)       Returns a string representing the ocatl value of      *
// *                    the number supplied which will always contain w       *
// *                    digits. If the number is negative a string with "?"   *
// *                    repeated w times is returned. If w is negative the    *
// *                    returned string will be prefixed with "0".            *
// *                                                                          *
// *    Examples        FNoct$(8,3)   ==> "00A"                               *
// *                    FNoct$(255,3) ==> "377"                               *
// *                    FNoct$(255,1) ==> "7"       Note lefthand truncation  *
// *                    FNoct$(-1,3)  ==> "???"                               *
// *                    FNoct$(255,-3) ==> "0377"                             *
// *                    FNoct$(-1,-3)  ==> "0???"                             *
// *                                                                          *
// ****************************************************************************

function FNoct$(n,w)
{
  if ( w < 0 )
    return ( "0x" + Right$(String$("0",-w)+Oct$(n),-w) )
  else
    return ( Right$(String$("0",w)+Oct$(n),w) )
}

// ############################################################################
// #                                                                          #
// #    THIS IS THE END OF THE STRING UTILITY ROUTINES                        #
// #                                                                          #
// ############################################################################

// ############################################################################
// #                                                                          #
// #    THESE ARE THE TRANSLATION ROUTINES                                    #
// #                                                                          #
// ############################################################################

function $$(original$,replacement$)
{
  if ( w$ == original$ ) { w$ = replacement$ }
}

function fixup_uu()
{
//  $$("abbreuuez","abbreuuez")
//  $$("appouuris","appouuris")
//  $$("Beuuant","Beuuant")
//  $$("bouuiers","bouuiers")
//  $$("breuuage","breuuage")
//  $$("concauuer","concauuer")
//  $$("couuers","couuers")
//  $$("couuert","couuert")
//  $$("couuerte","couuerte")
//  $$("couuerts","couuerts")
//  $$("Couurira","Couurira")
//  $$("d&eacute;couuerts","d&eacute;couuerts")
//  $$("d'oeuure","d'oeuure")
//  $$("D'ouurir","D'ouurir")
//  $$("decouuers","decouuers")
//  $$("decouuerts","decouuerts")
//  $$("descouuers","descouuers")
//  $$("descouuert","descouuert")
//  $$("descouuerte","descouuerte")
//  $$("descouurant","descouurant")
//  $$("descouurement","descouurement")
//  $$("Descouurira","Descouurira")
//  $$("Descouuriront","Descouuriront")
//  $$("espouuantable","espouuantable")
//  $$("espouuantal","espouuantal")
//  $$("espouuental","espouuental")
//  $$("esprouuee","esprouuee")
//  $$("esprouuera","esprouuera")
//  $$("esprouuez","esprouuez")
//  $$("Fleuue","Fleuue")
//  $$("fleuue","fleuue")
//  $$("fleuues","fleuues")
//  $$("Fleuues","Fleuues")
//  $$("fleuues","fleuues")
//  $$("Fleuues","Fleuues")
//  $$("gouuernement","gouuernement")
//  $$("gouuerneur","gouuerneur")
//  $$("gouuert","gouuert")
//  $$("iouuenceau","iouuenceau")
//  $$("L'oeuure","L'oeuure")
//  $$("mouuement","mouuement")
//  $$("Nauuarre","Nauuarre")
//  $$("neuue","neuue")
//  $$("nouueau","nouueau")
//  $$("Nouueaux","Nouueaux")
//  $$("nouueaux","nouueaux")
//  $$("nouuel","nouuel")
//  $$("Nouuelle","Nouuelle")
//  $$("nouuelle","nouuelle")
//  $$("nouuelles","nouuelles")
//  $$("ouuers","ouuers")
//  $$("ouuert","ouuert")
//  $$("ouuerte","ouuerte")
//  $$("Ouuertes","Ouuertes")
//  $$("ouuertes","ouuertes")
//  $$("ouuerts","ouuerts")
//  $$("ouurage","ouurage")
//  $$("ouuree","ouuree")
//  $$("ouurir","ouurir")
//  $$("ouurira","ouurira")
//  $$("pauure","pauure")
//  $$("pauures","pauures")
//  $$("pleuuoir","pleuuoir")
//  $$("pleuura","pleuura")
//  $$("plouuoir","plouuoir")
//  $$("pouuant","pouuant")
//  $$("pouuoir","pouuoir")
//  $$("preuue","preuue")
//  $$("prouu&eacute;","prouu&eacute;")
//  $$("prouuee","prouuee")
//  $$("prouuera","prouuera")
//  $$("prouuez","prouuez")
//  $$("qu'esprouue","qu'esprouue")
//  $$("recouuree","recouuree")
//  $$("recouurez","recouurez")
//  $$("recouurira","recouurira")
//  $$("Renouuellant","Renouuellant")
//  $$("renouuelle","renouuelle")
//  $$("Renouueller","Renouueller")
//  $$("reprouuez","reprouuez")
//  $$("retrouuers","retrouuers")
//  $$("sauu&eacute;","sauu&eacute;")
//  $$("sauue","sauue")
//  $$("sauuer","sauuer")
//  $$("sauuera","sauuera")
//  $$("Souuent","Souuent")
//  $$("souuerain","souuerain")
//  $$("souueraine","souueraine")
//  $$("souuerains","souuerains")
//  $$("treuue","treuue")
//  $$("trouu&eacute;","trouu&eacute;")
//  $$("Trouu&eacute;","Trouu&eacute;")
//  $$("trouu&eacute;","trouu&eacute;")
//  $$("trouue","trouue")
//  $$("trouuee","trouuee")
//  $$("trouuees","trouuees")
//  $$("trouuera","trouuera")
//  $$("trouueront","trouueront")
//  $$("trouues","trouues")
//  $$("trouuez","trouuez")
}

function fixup_v()
{
//  $$("Avant","Avant")
//  $$("avec","avec")
//  $$("Avecques","Avecques")
//  $$("AVGE","AVGE")
//  $$("Avtour","Avtour")
//  $$("chevalier","chevalier")
//  $$("Cuve","Cuve")
//  $$("D'o&ugrave;","D'o&ugrave;")
    $$("d'vn","d'un")
    $$("D'vn","D'un")
    $$("d'vne","d'une")
//  $$("D'vnic","D'vnic")
//  $$("d'Vticense","d'Vticense")
//  $$("delvasacle","delvasacle")
//  $$("divers","divers")
//  $$("DRVX","DRVX")
//  $$("DVVMVIRAT","DVVMVIRAT")
//  $$("EIOVAS","EIOVAS")
//  $$("esslevee","esslevee")
//  $$("Genevois","Genevois")
//  $$("iusqu'&agrave;","iusqu'&agrave;")
//  $$("IVRA","IVRA")
//  $$("l&agrave;","l&agrave;")
//  $$("L&agrave;","L&agrave;")
    $$("l'vn","l'un")
    $$("L'vn","L'un")
//  $$("l'vnde","l'vnde")
    $$("l'vne","l'une")
    $$("L'vne","L'une")
    $$("L'vnion","L'union")
    $$("l'vniuers","l'univers")
    $$("l'Vniuers","l'univers")
    $$("l'vnivers","l'univers")
//  $$("l'vrie","l'vrie")
//  $$("l'vrne","l'vrne")
//  $$("l'vsitant","l'vsitant")
//  $$("l'vsurpera","l'vsurpera")
//  $$("LAVDE","LAVDE")
//  $$("Levant","Levant")
//  $$("n'avoit","n'avoit")
//  $$("Nepveu","Nepveu")
//  $$("neveu","neveu")
//  $$("nouveau","nouveau")
//  $$("nouveaux","nouveaux")
//  $$("PAV","PAV")
//  $$("plouvoir","plouvoir")
    $$("qu'vn","qu'un")
    $$("Qu'vn","Qu'un")
    $$("qu'vne","qu'une")
//  $$("Ravir","Ravir")
//  $$("s&ccedil;avoir","s&ccedil;avoir")
//  $$("sov","sov")
//  $$("t'avoir","t'avoir")
//  $$("traverse","traverse")
//  $$("tres-vieillard","tres-vieillard")
//  $$("vague","vague")
//  $$("vaguera","vaguera")
//  $$("vagueront","vagueront")
//  $$("vagues","vagues")
//  $$("vaillans","vaillans")
//  $$("vaillant","vaillant")
//  $$("Vaillant","Vaillant")
//  $$("vaillant","vaillant")
//  $$("Vaincu","Vaincu")
//  $$("vaincu","vaincu")
//  $$("vaincue","vaincue")
//  $$("vaine","vaine")
//  $$("Vaine","Vaine")
//  $$("vaines","vaines")
//  $$("Vainqueur","Vainqueur")
//  $$("vaisseaux","vaisseaux")
//  $$("valbuee","valbuee")
//  $$("valee","valee")
//  $$("Valence","Valence")
//  $$("Valent","Valent")
//  $$("valloit","valloit")
//  $$("vaner","vaner")
//  $$("vanicra","vanicra")
//  $$("vapin","vapin")
//  $$("vaqua","vaqua")
//  $$("Var","Var")
//  $$("Varennes","Varennes")
//  $$("Varneigne","Varneigne")
//  $$("Vast","Vast")
//  $$("vast","vast")
//  $$("vastant","vastant")
//  $$("vaste","vaste")
//  $$("vastee","vastee")
//  $$("vastera","vastera")
//  $$("vastient","vastient")
//  $$("Vaucile","Vaucile")
//  $$("vaultorte","vaultorte")
//  $$("vbert&eacute;","vbert&eacute;")
//  $$("Ve","Ve")
//  $$("ve","ve")
//  $$("ve&uuml;e","ve&uuml;e")
//  $$("veau","veau")
//  $$("vefue","vefue")
//  $$("veille","veille")
//  $$("veilles","veilles")
//  $$("veine","veine")
//  $$("veines","veines")
//  $$("velle","velle")
//  $$("venant","venant")
//  $$("Venant","Venant")
//  $$("vendang&eacute;","vendang&eacute;")
//  $$("vendange","vendange")
//  $$("vendanges","vendanges")
//  $$("Vendosme","Vendosme")
//  $$("Vendredy","Vendredy")
//  $$("vendu","vendu")
//  $$("vendu&euml;","vendu&euml;")
//  $$("venerer","venerer")
//  $$("vengeance","vengeance")
//  $$("vengee","vengee")
//  $$("Venger","Venger")
//  $$("venger","venger")
//  $$("vengera","vengera")
//  $$("venguddos","venguddos")
//  $$("venin","venin")
//  $$("Venins","Venins")
//  $$("venir","venir")
//  $$("venise","venise")
//  $$("Venise","Venise")
//  $$("Venitiens","Venitiens")
//  $$("venne","venne")
//  $$("vent","vent")
//  $$("Vent","Vent")
//  $$("ventre","ventre")
//  $$("vents","vents")
//  $$("venu","venu")
//  $$("venu&euml;","venu&euml;")
//  $$("venue","venue")
//  $$("Venus","Venus")
//  $$("venus","venus")
//  $$("venuste","venuste")
//  $$("ver","ver")
//  $$("verbe","verbe")
//  $$("Verbe","Verbe")
//  $$("Verbiesque","Verbiesque")
//  $$("Verbine","Verbine")
//  $$("Verceil","Verceil")
//  $$("verdoyant","verdoyant")
//  $$("verdure","verdure")
//  $$("verges","verges")
//  $$("vermeil","vermeil")
//  $$("Verone","Verone")
//  $$("Veronne","Veronne")
//  $$("Veront","Veront")
//  $$("verra","verra")
//  $$("Verra","Verra")
//  $$("verras","verras")
//  $$("verrez","verrez")
//  $$("verrier","verrier")
//  $$("verrifique","verrifique")
//  $$("verront","verront")
//  $$("Verront","Verront")
//  $$("Vers","Vers")
//  $$("vers","vers")
//  $$("VERS","VERS")
//  $$("versee","versee")
//  $$("Verseil","Verseil")
//  $$("verser","verser")
//  $$("versera","versera")
//  $$("versez","versez")
//  $$("versien","versien")
//  $$("vert","vert")
//  $$("vertes","vertes")
//  $$("vertu","vertu")
//  $$("vertueux","vertueux")
//  $$("vestu","vestu")
//  $$("vetustique","vetustique")
//  $$("veu","veu")
//  $$("Veu","Veu")
//  $$("veu","veu")
//  $$("veuille","veuille")
//  $$("veut","veut")
//  $$("vex&eacute;","vex&eacute;")
//  $$("vexee","vexee")
//  $$("Vexee","Vexee")
//  $$("vexees","vexees")
//  $$("vexer","vexer")
//  $$("Vexer","Vexer")
//  $$("vexera","vexera")
//  $$("vexez","vexez")
//  $$("Vexez","Vexez")
//  $$("vi&ecirc;dra","vi&ecirc;dra")
//  $$("Vicaire","Vicaire")
//  $$("Vice","Vice")
//  $$("Vicence","Vicence")
//  $$("Vicenne","Vicenne")
//  $$("victeur","victeur")
//  $$("Victeur","Victeur")
//  $$("Victime","Victime")
//  $$("victime","victime")
//  $$("victoire","victoire")
//  $$("Victoire","Victoire")
//  $$("Victor","Victor")
//  $$("victorieux","victorieux")
//  $$("victume","victume")
//  $$("Vidame","Vidame")
//  $$("vie","vie")
//  $$("Vie","Vie")
//  $$("vieil","vieil")
//  $$("vieillard","vieillard")
//  $$("vieillart","vieillart")
//  $$("vieille","vieille")
//  $$("viel","viel")
//  $$("vielle","vielle")
//  $$("viellesse","viellesse")
//  $$("Vien","Vien")
//  $$("viendra","viendra")
//  $$("Viendra","Viendra")
//  $$("viendront","viendront")
//  $$("Viendront","Viendront")
//  $$("Vienne","Vienne")
//  $$("vienne","vienne")
//  $$("vient","vient")
//  $$("vierge","vierge")
//  $$("Vierge","Vierge")
//  $$("vierges","vierges")
//  $$("vieux","vieux")
//  $$("Vieux","Vieux")
//  $$("vif","vif")
//  $$("vifs","vifs")
//  $$("Vifs","Vifs")
//  $$("vignes","vignes")
//  $$("vigueur","vigueur")
//  $$("vilain","vilain")
//  $$("vilaine","vilaine")
//  $$("vilan","vilan")
//  $$("ville","ville")
//  $$("villes","villes")
//  $$("vin","vin")
//  $$("Vin","Vin")
//  $$("Vincence","Vincence")
//  $$("vindicatif","vindicatif")
//  $$("vindications","vindications")
//  $$("Vindicte","Vindicte")
//  $$("vindicte","vindicte")
//  $$("vindra","vindra")
//  $$("vingtcinq","vingtcinq")
//  $$("vingts","vingts")
//  $$("violance","violance")
//  $$("Violant","Violant")
//  $$("violee","violee")
//  $$("violence","violence")
//  $$("violer","violer")
//  $$("vires","vires")
//  $$("vis","vis")
//  $$("Visage","Visage")
//  $$("visage","visage")
//  $$("vise","vise")
//  $$("visibles","visibles")
//  $$("vit","vit")
//  $$("vitrix","vitrix")
//  $$("Vitry","Vitry")
//  $$("vitupere","vitupere")
//  $$("viuans","viuans")
//  $$("viuant","viuant")
//  $$("viue","viue")
//  $$("Viuiers","Viuiers")
//  $$("viura","viura")
//  $$("viures","viures")
//  $$("Viuront","Viuront")
//  $$("Vlisbonne","Vlisbonne")
//  $$("Vlme","Vlme")
//  $$("Vlpian","Vlpian")
//  $$("vmbre","vmbre")
//  $$("vmbres","vmbres")
    $$("vn","un")
    $$("Vn","Un")
    $$("vndans","undans")
    $$("vnde","unde")
    $$("vne","une")
    $$("Vne","Une")
    $$("vnics","unics")
    $$("vnies","unies")
    $$("vnion","union")
    $$("vnique","unique")
    $$("Vnique","Unique")
    $$("vnir","unir")
    $$("vnis","unis")
    $$("vniuersel","uniuersel")
    $$("vniuerselle","vuiuerselle")
    $$("Vns","Uns")
    $$("vny","Uny")
//  $$("voeu;","voeu;")
//  $$("voguera","voguera")
//  $$("Voiant","Voiant")
//  $$("voil","voil")
//  $$("voiles","voiles")
//  $$("Voille","Voille")
//  $$("voille","voille")
//  $$("voilles","voilles")
//  $$("voir","voir")
//  $$("Voir","Voir")
//  $$("voisin","voisin")
//  $$("voisins","voisins")
//  $$("voit","voit")
//  $$("voix","voix")
//  $$("Voix","Voix")
//  $$("vol","vol")
//  $$("volant","volant")
//  $$("volce","volce")
//  $$("volera","volera")
//  $$("volerie","volerie")
//  $$("vollee","vollee")
//  $$("Volsicque","Volsicque")
//  $$("Volsques","Volsques")
//  $$("voltigeant","voltigeant")
//  $$("voluptueux","voluptueux")
//  $$("vopisque","vopisque")
//  $$("vorer","vorer")
//  $$("Vostre","Vostre")
//  $$("Voudra","Voudra")
//  $$("voudra","voudra")
//  $$("voudront","voudront")
//  $$("Voudront","Voudront")
//  $$("voulans","voulans")
//  $$("voulant","voulant")
//  $$("vouldra","vouldra")
//  $$("vouloir","vouloir")
//  $$("voy","voy")
//  $$("voyage","voyage")
//  $$("voyages","voyages")
//  $$("Voyant","Voyant")
//  $$("voyant","voyant")
//  $$("voye","voye")
//  $$("voyt","voyt")
//  $$("Vrabiq","Vrabiq")
//  $$("Vratislaue","Vratislaue")
//  $$("vray","vray")
//  $$("vraye","vraye")
    $$("Vrban","Urban")
    $$("vrben","urben")
    $$("vrne","urne")
    $$("Vrnel","Urnel")
    $$("Vrsins","Ursins")
    $$("Vstagois","Ustagois")
    $$("vsurp&eacute;","usurp&eacute;")
//  $$("Vvitemberg","Vvitemberg")
}

function fixup_others()
{
}

function IsWhiteSpace(i)
{
  return ( Instr(" .,:?\n",Mid$(t$,i,1)) > 0 )
}

function FindStart()
{
  var done
  done=false
  while ( ! done )
  {
    if ( StartPtr>Len(t$) )
    {
      StartPtr=0
      done=true
    }
    else
    {
      if ( IsWhiteSpace(StartPtr) )
      {
        c$=Mid$(t$,StartPtr,1)
        if ( c$ != " " ) { o$=o$+c$ }
        StartPtr++
      }
      else
        done=true
    }
  }
}

function FindEnd()
{
  var done
  EndPtr=StartPtr+1
  done=false
  while ( ! done )
  {
    if ( EndPtr>Len(t$) )
    {
      done=true
    }
    else
    {
      if ( IsWhiteSpace(EndPtr) )
        done=true
      else
        EndPtr++
    }
  }
}

function $(Object)
{
var i$

  // Get the text to translate and convert old French to new

  t$=Object.innerText
  o$=""
  StartPtr=1
  FindStart()
  while ( StartPtr>0 )
  {
    FindEnd()
    w$=Mid$(t$,StartPtr,EndPtr-StartPtr)
    fixup_uu()
    fixup_v()
    fixup_others()
    if ( o$ != "" ) if ( Right$(o$,1) != "\n" ) { o$=o$+" " }
    o$=o$+w$
    StartPtr=EndPtr
    FindStart()
  }

  // Get name of object and convert to "c.qq" if a normal quatrain
  //                                   "n"    if other quatrain
  //                                   "S.ss" if sixtain
  // Leave normal headings as they are

  i$=Object.id
  if ( Left$(i$,1) == "z" )
  {
    o$=escape(o$)
  }
  else
  {
    if ( ( Left$(i$,1) != "S" ) && ( Left$(i$,1) != "N" ) ) { i$=Right$(i$,-1) }
    i$=PokeMid$(i$,Instr(i$,"_"),".")
    o$=i$+"%0D%0A%0D%0A"+escape(o$)
  }

  // Call Alta Vista's Babelfish

  o$="http://jump.altavista.com/trans.go?urltext="+o$+"&language=fr_en"
  location.href=o$
  t$=""
  o$=""
}

// ############################################################################
// #                                                                          #
// #    THIS IS THE END OF THE TRANSLATION ROUTINES                           #
// #                                                                          #
// ############################################################################

