/*

┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│                                                                              │
│     LLLL         III                          RRRRRRRRRR        CCCCC        │
│     LLLL         III                          RRRRRRRRRRRR    CCCCCCCCC      │
│     LLLL                                      RRR      RRR   CCC     CCC     │
│     LLLL         III  VV     VV  EEEEEEEEE    RRR      RRR  CCC              │
│     LLLL         III   VV   VV   EEE          RRRRRRRRRRR   CCC              │
│     LLLL         III   VV   VV   EEEEEE       RRRRRRRRRR    CCC              │
│     LLLL         III    VV VV    EEEEEE       RRR     RRR    CCC     CCC     │
│     LLLLLLLLLLL  III    VVVVV    EEE          RRR      RRR    CCCCCCCCC      │
│     LLLLLLLLLLL  III     VVV     EEEEEEEEE    RRR       RRR     CCCCC        │
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘
modifier

License

modifier

Copyright © 2013, copyright holders : see below

For any purpose, you can choose one of the following licenses :

Authors

modifier

Documentation

modifier

Code source

modifier

Variables globales

modifier
 */

  window.LiveRC_Version = "1.0.5";
  window.LiveRC_Version_Dev = "1.0.6-beta";

/*

Paramètres de LiveRC

modifier
 */

  window.Custom_lrcParams = {};

  window.lrcParams = {
    "Language"                : "en",                                                     // Langue de l’interface (par défaut)
    "PageTitle"               : mw.config.get('wgSiteName')+":LiveRC",                    // Page principale de LiveRC
    "SandboxPage"             : mw.config.get('wgSiteName')+":Bac à sable",               // Page bac à sable
    "CommonsURL"              : "//upload.wikimedia.org/wikipedia/commons/",              // Adresse des images Commons
    "SearchURL"               : "https://duckduckgo.com/?q=$1",                           // Moteur de recherche externe
    "TchatURL"                : "https://kiwiirc.com/client/irc.freenode.net/?nick=$2$1", // Adresse du client IRC
    "TchatChannel"            : "#wikipedia-fr-liverc",                                   // Canal de tchat
    "WhoisURL"                : "https://tools.wmflabs.org/whois/$1/lookup",              // URL de l’outil Whois
    "RClinkid"                : "n-recentchanges",                                        // ID du lien "Modifications récentes"
    "MiniPreviewHeight"       : '250px', // Hauteur maxi par défaut du minidiff;
    "PreviewWindowHeight"     : '250px', // Hauteur par défaut de la fenêtre de prévisualisation;
    "HistoryWindowHeight"     : '250px', // Hauteur par défaut de l’historique des prévisualisations;
    "SearchWindowHeight"      : '250px', // Hauteur par défaut de la fenêtre de recherche Google;
    "TchatWindowHeight"       : '350px', // Hauteur par défaut de la fenêtre de tchat;
    "FollowWindowHeight"      : '100px', // Hauteur des listes de suivi;
    "TZ"                      : '00:00', // Fuseau horaire (+02:00, 02:00, -0200, -05:45, ...)
    "InterwikiList"           : '',      // Langues des interwikis montrés (exemple : 'de|en|es|fr|it')
    "RCLimit"                 : 50,      // Nombre de ligne maximum de la table de RC;
    "Refresh"                 : 10,      // Délai de rafraichissement des RC
    "ArticleLengthLimit"      : 0,       // Limite du nombre de caractères affichés de l’article dans les RC
    "UserLengthLimit"         : 0,       // Limite du nombre de caractères affichés de l’utilisateur dans les RC
    "MinYellowWatchers"       : 5,       // Limite basse du nombre de suiveurs de la page (rouge/jaune)
    "MinGreenWatchers"        : 10,      // Limite basse du nombre de suiveurs de la page (jaune/vert)
    "MinBacklinks"            : 3,       // Limite basse du nombre de backlinks vers la page
    "MinLinks"                : 3,       // Limite basse du nombre de liens sur la page
    "BoldComments"            : false,   // Commentaires de modification en gras
    "ShowArticleLength"       : true,    // Afficher la taille totale de la page
    "ShowTimer"               : true,    // Afficher le timer
    "ShowPreviewOnTop"        : false,   // Afficher la prévisualisation au-dessus des RC
    "LoadUsersInGroupsList"   : true,    // Charger la liste des bots et sysops
    "LoadWatchlist"           : true,    // Charger la liste des articles et utilisateurs suivis (coûteux au démarrage)
    "LoadIPCat"               : true,    // Charger les catégories d'utilisateurs (coûteux au démarrage)
    "LoadLastBlocks"          : true,    // Charger les derniers blocages (coûteux au démarrage)
    "GetPageInfos"            : true,    // Charger les infos sur les pages (coûteux)
    "GetFileInfos"            : true,    // Charger les infos sur les images uploadées (coûteux)
    "GetWikidataInfos"        : false,   // Charger les infos wikidata sur les rc wikidata (coûteux)
    "UseMiniDiff"             : false,   // Afficher le diff-réduit (très coûteux)
    "ShowNotifications"       : true,    // Afficher les notifications
    "ShowInterwikiList"       : true,    // Montrer les liens inter-langues dans les RC
    "InterwikiPreviewEnabled" : true,    // Activer la prévisualisation des pages interwiki
    "KeepAllLines"            : false,   // Conserver toutes les lignes RC
    "InvertUpdate"            : false,   // Inverser le sens d’apparition des RC
    "AutoCloseDiff"           : false,   // Supprimer une ligne après visualisation du diff
    "PreloadLines"            : true,    // Préchargement des diff en utilisant le bouton [Suivant]
    "SubstWarnings"           : true,    // Substitution des modèles d'avertissement
    "BypassWatchdefault"      : true     // Ne pas ajouter automatiquement les pages modifiées à la liste de suivi
  };

/*

Options de démarrage

modifier
 */

  window.Custom_lrcOptionMenuValues = {};

  window.lrcOptionMenuValues = {
    "LiveRCDisplayed"          : true,    // Afficher l’interface de LiveRC
    "LiveRCRCTableDisplayed"   : true,    // Afficher le tableau des RC
    "LiveRCTchatDisplayed"     : false,   // Afficher la fenêtre de tchat
    "LiveRCPreviewDisplayed"   : false,   // Afficher la fenêtre de prévisualisation
    "LiveRCFollowDisplayed"    : true,    // Afficher les listes de suivi
    "DisplayDebug"             : false,   // Afficher le panneau de débogage
    "Debug_Ajax"               : false,   // Panneau de débogage : Afficher les requêtes Ajax
    "Debug_Errors"             : false,   // Panneau de débogage : N’afficher que les erreurs
    "Stop"                     : false,   // Case "Pause"
    "Diff"                     : false,   // Case "Diff réduit"
    "RC"                       : true,    // Case "RC"
    "RC_edit"                  : true,    // Case "RC (modifications normales)"
    "RC_minor"                 : true,    // Case "RC (modifications mineurs)"
    "RC_new"                   : true,    // Case "RC (nouvelles pages)"
    "RC_categorize"            : false,   // Case "RC (changements de catégories)"
    "RC_external"              : false,   // Case "RC (edits wikidata)"
    "Log"                      : true,    // Case "Journaux"
    "WL_watched"               : true,    // Case "Pages suivies"
    "WL_unwatched"             : true,    // Case "Pages non suivies"
    "Tags"                     : false,   // Case "Balises"
    "Tags_notag"               : true,    // Case "Balises" : ''Pas de balise''
    "NS"                       : false,   // Case "Espaces de noms"
    "User"                     : true,    // Case "Utilisateurs"
    "User_IP"                  : true,    // Case "IP"
    "User_REGISTERED"          : true,    // Case "Enregistrés"
    "User_NEWBIE"              : true,    // Case "Débutants"
    "User_AUTOPATROLLED"       : false,   // Case "Confirmés"
    "User_HideOwnSubpage"      : false,   // Case "Masquer les modifications d’un utilisateur sur ses propres sous-pages"
    "User_ShowAllSelf"         : true,    // Case "Toujours afficher mes propres modifications"
    "User_ShowAllContact"      : true,    // Case "Toujours afficher mes contacts"
    "User_ShowAllWatchlist"    : true,    // Case "Toujours afficher ma liste de suivi"
    "User_ShowAllRevert"       : true,    // Case "Toujours afficher les révocations"
    "User_ShowAllBlanking"     : true,    // Case "Toujours afficher les blanchiments"
    "User_ShowAllReplaced"     : true     // Case "Toujours afficher les remplacements"
  };

/*

Textes de l'interface

modifier
Textes non traduits
modifier
 */

  window.Custom_UnTranslatedTexts = {};

  window.UnTranslatedTexts = {
    ON_ARTICLE:             "sur",
    UPDATEMESSAGES:         "Mise à jour de la configuration Mediawiki locale",
    MWSiteGlobalLegend:     "Configuration locale de Mediawiki",
    MWGeneralConfigLegend:  "Configuration générale de Mediawiki",
    MWLanguagesLegend:      "Langues supportées",
    MWMessagesLegend:       "Messages système",
    MWExtensionsLegend:     "Extensions Mediawiki",
    MWNamespacesLegend:     "Espaces de noms",
    MWMagicwordsLegend:     "Mots magiques",
    MWInterwikimapLegend:   "Table interwiki",
    MWWikibaseLegend:       "Wikibase",
    MWTagsLegend:           "Balises",
    TAG_RESUME:             "Bandeau",
    USERMSG_RESUME:         "Message",
    EMPTY_RESUME:           "Blanchiment",
    USERTHANK_RESUME:       "Remerciement",
    BLOCKTEMPLATE:          "Blocage",
    RESUMESTART:            "[[WP:LRC|LiveRC]] : ",
    Comment:                "Personnalisation pour LiveRC"
  };
/*
Textes traduits
modifier
 */

   // Textes
  window.lrcTexts = {};
  window.lrcTranslatedTexts = {};
  window.Custom_lrcTranslatedTexts = {};

   // Descriptions de variables
  window.lrcParamDesc = {};
  window.lrcTranslatedParamDesc = {};
  window.Custom_lrcTranslatedParamDesc = {};

/*

Icônes

modifier
 */

  window.Custom_lrcIcons = {};

  window.lrcIcons = {
  // Page & Edit type
    "AdQIcon" : {
      type:1,
      src:"thumb/c/c7/Fairytale_bookmark_gold.png/10px-Fairytale_bookmark_gold.png",
      width:10,
      height:10
    },
    "APDQIcon" : {
      type:1,
      src:"thumb/e/e0/Fairytale_bookmark_half_gold_silverlight_question.png/10px-Fairytale_bookmark_half_gold_silverlight_question.png",
      width:10,
      height:10
    },
    "BAIcon" : {
      type:1,
      src:"thumb/0/08/Fairytale_bookmark_silver.png/10px-Fairytale_bookmark_silver.png",
      width:10,
      height:10
    },
    "HomonIcon" : {
      type:0,
      src:"thumb/7/72/Disambig.svg/16px-Disambig.svg.png",
      width:16,
      height:16
    },
    "StubIcon" : {
      type:0,
      src:"thumb/a/a6/Construction_cone.png/16px-Construction_cone.png",
      width:16,
      height:16
    },
    "PaSIcon" : {
      type:0,
      src:"thumb/9/9e/Icono_consulta_borrar.png/16px-Icono_consulta_borrar.png",
      width:16,
      height:16
    },
    "CopyrightIcon" : {
      type:0,
      src:"thumb/b/b0/Copyright.svg/16px-Copyright.svg.png",
      width:16,
      height:16
    },
    "RecentIcon" : {
      type:0,
      src:"thumb/1/19/Ambox_currentevent.svg/16px-Ambox_currentevent.svg.png",
      width:16,
      height:16
    },
    "R3RIcon" : {
      type:0,
      src:"thumb/b/bc/R3R.svg/16px-R3R.svg.png",
      width:16,
      height:16
    },
    "WIPIcon" : {
      type:0,
      src:"thumb/6/6a/Under_construction_icon-orange.svg/16px-Under_construction_icon-orange.svg.png",
      width:16,
      height:13
    },
    "LockIcon" : {
      type:0,
      src:"thumb/e/e0/Padlock-gold.svg/16px-Padlock-gold.svg.png",
      width:16,
      height:16
    },
    "ExtendedLockIcon" : {
      type:0,
      src:"thumb/e/e0/Padlock-gold.svg/16px-Padlock-gold.svg.png", // TODO - créer une version grise de l'icône
      width:16,
      height:16
    },
    "FullLockIcon" : {
      type:0,
      src:"thumb/4/48/Padlock-red.svg/16px-Padlock-red.svg.png",
      width:16,
      height:16
    },
    "TrackingCategoriesIcon" : {
      type:0,
      src:"4/49/Error.png",
      width:16,
      height:16
    },
    "Watchers0Icon" : {
      type:0,
      src:"thumb/b/b5/Webroot_Spy_Sweeper_%28red%29.png/12px-Webroot_Spy_Sweeper_%28red%29.png",
      width:12,
      height:12
    },
    "Watchers1Icon" : {
      type:0,
      src:"thumb/4/48/Webroot_Spy_Sweeper_%28orange%29.png/12px-Webroot_Spy_Sweeper_%28orange%29.png",
      width:12,
      height:12
    },
    "Watchers2Icon" : {
      type:0,
      src:"thumb/f/ff/Webroot_Spy_Sweeper_%28yellow%29.png/12px-Webroot_Spy_Sweeper_%28yellow%29.png",
      width:12,
      height:12
    },
    "Watchers3Icon" : {
      type:0,
      src:"thumb/0/01/Webroot_Spy_Sweeper_%28green%29.png/12px-Webroot_Spy_Sweeper_%28green%29.png",
      width:12,
      height:12
    },
    "RedirectIcon" : {
      type:0,
      src:"thumb/7/71/Symbol_redirect_arrow_with_gradient.svg/16px-Symbol_redirect_arrow_with_gradient.svg.png",
      width:16,
      height:10
    },
    "ExternalIcon" : {
      type:0,
      src:"thumb/e/e4/Wikidata-logo_S.svg/16px-Wikidata-logo_S.svg.png",
      width:16,
      height:9
    },
    "FlowIcon" : {
      type:0,
      src:"thumb/6/64/Talk_page_icon_crystal.png/16px-Talk_page_icon_crystal.png",
      width:16,
      height:16
    },
  // Logs
    "ManagetagsIcon" : {
      type:0,
      src:"thumb/7/7b/Gnome-mime-manpage.png/16px-Gnome-mime-manpage.png",
      width:16,
      height:16
    },
    "ChangetagIcon" : {
      type:0,
      src:"thumb/b/b4/Curation_Bar_Icon_Add_Tags_Blue_with_transparent_background.png/16px-Curation_Bar_Icon_Add_Tags_Blue_with_transparent_background.png",
      width:16,
      height:16
    },
    "AbusefilterIcon" : {
      type:0,
      src:"thumb/7/78/Nuvola_apps-agent_and_Icon_tools_red.png/16px-Nuvola_apps-agent_and_Icon_tools_red.png",
      width:16,
      height:13
    },
    "AbuselogIcon" : {
      type:0,
      src:"thumb/5/5e/Nuvola_apps_agent.svg/16px-Nuvola_apps_agent.svg.png",
      width:16,
      height:13
    },
    "UploadIcon" : {
      type:0,
      src:"thumb/4/47/Gartoon-Gnome-dev-floppy.png/16px-Gartoon-Gnome-dev-floppy.png",
      width:16,
      height:16
    },
    "ImportIcon" : {
      type:0,
      src:"thumb/a/a0/Document_arrow_green.svg/32px-Document_arrow_green.svg.png",
      width:32,
      height:16
    },
    "NewUserIcon" : {
      type:0,
      src:"thumb/c/c1/Crystal_personal.png/16px-Crystal_personal.png",
      width:16,
      height:16
    },
    "BlockIcon" : {
      type:0,
      src:"thumb/8/8b/B1.svg/16px-B1.svg.png",
      width:16,
      height:16
   },
    "DeleteIcon" : {
      type:0,
      src:"thumb/e/ef/Editcut.png/16px-Editcut.png",
      width:16,
      height:16
    },
    "MoveIcon" : {
      type:0,
      src:"thumb/0/0e/Forward.png/16px-Forward.png",
      width:16,
      height:16
    },
    "ProtectIcon" : {
      type:0,
      src:"thumb/6/64/Crystal_Clear_action_lock3.png/16px-Crystal_Clear_action_lock3.png",
      width:16,
      height:16
    },
    "ThanksIcon" : {
      type:0,
      src:"thumb/7/7d/Heart_icon.svg/16px-Heart_icon.svg.png",
      width:16,
      height:16
    },
    "RenameuserIcon" : {
      type:0,
      src:"thumb/b/b9/Blue_&_gray_people.png/15px-Blue_&_gray_people.png",
      width:16,
      height:16
    },
    "RightsIcon" : {
      type:0,
      src:"thumb/0/07/Fairytale_kdmconfig.png/18px-Fairytale_kdmconfig.png",
      width:16,
      height:16
    },
    "MassMessageIcon" : {
      type:0,
      src:"thumb/b/b3/Nuvola_apps_email-several.png/16px-Nuvola_apps_email-several.png",
      width:16,
      height:16
    },
    "CheckUserIcon" : {
      type:0,
      src:"thumb/c/cb/Nuvola_search_person.png/16px-Nuvola_search_person.png",
      width:16,
      height:16
    },
    "OversightIcon" : {
      type:0,
      src:"thumb/2/2c/Icon_delete.svg/16px-Icon_delete.svg.png",
      width:16,
      height:16
    },
    "ReviewIcon" : {
      type:0,
      src:"thumb/6/66/Copyvio-NormalMagnifier.png/16px-Copyvio-NormalMagnifier.png",
      width:16,
      height:16
    },
    "StableIcon" : {
      type:0,
      src:"thumb/a/a7/Copyvio-WarningMagnifier.png/16px-Copyvio-WarningMagnifier.png",
      width:16,
      height:16
    },
    "PagetriageDeletionIcon" : {
      type:0,
      src:"thumb/c/cb/Curation_Bar_Icon_Trash_Blue_with_transparent_background.png/16px-Curation_Bar_Icon_Trash_Blue_with_transparent_background.png",
      width:16,
      height:16
    },
    "PagetriageCurationIcon" : {
      type:0,
      src:"thumb/5/5c/Curation_Bar_Icon_Love_Blue_with_transparent_background.png/16px-Curation_Bar_Icon_Love_Blue_with_transparent_background.png",
      width:16,
      height:16
    },
    "EducationProgramIcon" : {
      type:0,
      src:"thumb/4/47/WIKI_AND_ACADEMIA.PNG/16px-WIKI_AND_ACADEMIA.PNG",
      width:16,
      height:16
    },
    "LiquidThreadsIcon" : {
      type:0,
      src:"thumb/e/e7/FAQ_icon.svg/16px-FAQ_icon.svg.png",
      width:16,
      height:16
    },
    "TranslateIcon" : {
      type:0,
      src:"thumb/4/40/Icono_de_traducción.svg/16px-Icono_de_traducción.svg.png",
      width:16,
      height:16
    },
    "OAuthIcon" : {
      type:0,
      src:"thumb/e/e9/Crystal_Clear_Password.png/16px-Crystal_Clear_Password.png",
      width:16,
      height:16
    },
    "MoodBarIcon" : {
      type:0,
      src:"thumb/7/75/Oxygen480-emotes-face-plain.svg/16px-Oxygen480-emotes-face-plain.svg.png",
      width:16,
      height:16
    },
    "InterwikiIcon" : {
      type:0,
      src:"thumb/1/19/Interprogetto.png/16px-Interprogetto.png",
      width:16,
      height:16
    },
  // User type
    "SharedIPIcon" : {
      type:0,
      src:"thumb/b/b7/WLM_logo.svg/16px-WLM_logo.svg.png",
      width:16,
      height:16
    },
    "ScolarIPIcon" : {
      type:0,
      src:"thumb/9/98/Crystal_kdmconfig.png/16px-Crystal_kdmconfig.png",
      width:16,
      height:16
    },
    "OpenProxyIcon" : {
      type:0,
      src:"thumb/0/0a/Crystal_Clear_kdmconfig-danger.png/16px-Crystal_Clear_kdmconfig-danger.png",
      width:16,
      height:16
    },
    "NewbieIcon" : {
      type:0,
      src:"thumb/c/c1/Crystal_personal.png/16px-Crystal_personal.png",
      width:16,
      height:16
    },
    "SysopIcon" : {
      type:0,
      src:"thumb/6/61/Gnome-stock_person_admin2.svg/16px-Gnome-stock_person_admin2.svg.png",
      width:16,
      height:16
   },
    "BotIcon" : {
      type:0,
      src:"thumb/c/c2/Gnome-stock_person_bot.svg/16px-Gnome-stock_person_bot.svg.png",
      width:16,
      height:16
    },
    "BlockedIcon" : {
      type:0,
      src:"thumb/b/b8/Modern_clock_chris_kemps_01_with_Octagon-warning.svg/16px-Modern_clock_chris_kemps_01_with_Octagon-warning.svg.png",
      width:16,
      height:16
    },
    "CopyrightUserIcon" : {
      type:0,
      src:"thumb/b/b0/Copyright.svg/16px-Copyright.svg.png",
      width:16,
      height:16
    },
    "SpamblacklistUserIcon" : {
      type:0,
      src:"thumb/b/b5/Nospam_at.svg/16px-Nospam_at.svg.png",
      width:16,
      height:16
    },
    "PediaProjectIcon" : {
      type:0,
      src:"thumb/7/79/A13a_French_road_sign.svg/15px-A13a_French_road_sign.svg.png",
      width:16,
      height:16
    },
// Edit type (comments)
    "MinorEditIcon" : {
      type:0,
      src:"thumb/d/d0/M_in_a_Circle.png/12px-M_in_a_Circle.png",
      width:12,
      height:12
    },
    "RevertIcon" : {
      type:0,
      src:"thumb/2/2c/Nuvola_actions_undo.png/12px-Nuvola_actions_undo.png",
      width:12,
      height:12
    },
    "ReplacedIcon" : {
      type:0,
      src:"thumb/9/95/Categorie_III.svg/12px-Categorie_III.svg.png",
      width:12,
      height:12
    },
    "RedirectedIcon" : {
      type:0,
      src:"thumb/7/7f/Redirect_arrow_without_text_(cropped).svg/12px-Redirect_arrow_without_text_(cropped).svg.png",
      width:12,
      height:12
    },
    "BlankingIcon" : {
      type:0,
      src:"thumb/4/41/Kde_crystalsvg_eraser.png/12px-Kde_crystalsvg_eraser.png",
      width:12,
      height:12
    },
    "WPCIcon" : {
      type:0,
      src:"thumb/2/2d/Nuvola_web_broom.svg/12px-Nuvola_web_broom.svg.png",
      width:12,
      height:12
    },
    "AWBIcon" : {
      type:0,
      src:"thumb/b/b4/AWB_logo_draft.png/12px-AWB_logo_draft.png",
      width:12,
      height:12
    },
    "BandeauxPortailsIcon" : {
      type:0,
      src:"thumb/e/e1/Portal_icon.svg/12px-Portal_icon.svg.png",
      width:12,
      height:12
    },
    "BandeauxEbauchesIcon" : {
      type:0,
      src:"thumb/3/37/Icon-wrench.png/12px-Icon-wrench.png",
      width:12,
      height:12
    },
    "HotCatIcon" : {
      type:0,
      src:"thumb/f/fd/Magnify-clip_%28sans_arrow%29.svg/12px-Magnify-clip_(sans_arrow).svg.png",
      width:12,
      height:12
    },
    "PopupsIcon" : {
      type:0,
      src:"thumb/1/11/Toolbaricon_hiddencomment.png/12px-Toolbaricon_hiddencomment.png",
      width:12,
      height:12
    },
    "CatRenameIcon" : {
      type:0,
      src:"thumb/5/56/Crystal_Project_2rightarrow.png/12px-Crystal_Project_2rightarrow.png",
      width:12,
      height:12
    },
    "LRCIcon" : {
      type:0,
      src:"thumb/b/b2/LiveRC.svg/12px-LiveRC.svg.png",
      width:12,
      height:12
    },
  // Interface icons
    "TchatButtonIcon" : {
      type:0,
      src:"thumb/7/7a/Mercury_bw.png/25px-Mercury_bw.png",
      width:32,
      height:32
    },
    "DebugButtonIcon" : {
      type:0,
      src:"thumb/6/69/Logviewer_bw.png/32px-Logviewer_bw.png",
      width:32,
      height:32
    },
    "ConfigButtonIcon" : {
      type:0,
      src:"thumb/2/27/Folder-system.png/32px-Folder-system.png",
      width:32,
      height:32
    },
    "LiveRCButtonIcon" : {
      type:0,
      src:"thumb/6/66/Exaile_bw.png/32px-Exaile_bw.png",
      width:32,
      height:32
    },
    "RCListButtonIcon" : {
      type:0,
      src:"thumb/7/78/Ethereal.png/25px-Ethereal.png",
      width:25,
      height:25
    },
    "PreviewButtonIcon" : {
      type:0,
      src:"thumb/0/05/Preferences-desktop-screensaver.png/25px-Preferences-desktop-screensaver.png",
      width:25,
      height:25
    },
    "FollowButtonIcon" : {
      type:0,
      src:"thumb/3/35/Utilities-system-monitor.png/25px-Utilities-system-monitor.png",
      width:25,
      height:25
    },
    "HistoryButtonIcon" : {
      type:0,
      src:"thumb/c/c7/File-manager.png/25px-File-manager.png",
      width:25,
      height:25
    },
    "LogoIcon" : {
      type:0,
      src:"thumb/2/2d/LiveRC_Ts-for_anim.svg/52px-LiveRC_Ts-for_anim.svg.png",
      width:52,
      height:32
    },
    "AnimatedLogoIcon" : {
      type:0,
      src:"9/97/LiveRC_Ts-anim1.gif",
      width:52,
      height:32
    },
    "FavIcon" : {
      type:0,
      src:"thumb/b/b2/LiveRC.svg/16px-LiveRC.svg.png",
      width:16,
      height:16
    },
    "SuggestExistIcon" : {
      type:0,
      src:"thumb/b/be/P_yes.svg/20px-P_yes.svg.png",
      width:20,
      height:20
    },
    "SuggestNoExistIcon" : {
      type:0,
      src:"thumb/4/42/P_no.svg/20px-P_no.svg.png",
      width:20,
      height:20
    }
  };

/*

Paramètres des fonctions automatiques

modifier
Avertissement
modifier
 */

  window.Custom_lstAverto = [];

  window.lstAverto = [
    { template: "Test 0"                , string: "Test 0"            , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Test 1"                , string: "Test 1"            , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Test 2"                , string: "Test 2"            , hasPage: false, addName: false, addSectionTitle: false },
    { template: "Test 3"                , string: "Test 3"            , hasPage: false, addName: false, addSectionTitle: false },
    { template: "Seul avertissement"    , string: "Test 4"            , hasPage: false, addName: false, addSectionTitle: false },
    { template: "Retrait injustifié"    , string: "Retrait injustifié", hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Motivation modif"      , string: "Résumé"            , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "LE HC"                 , string: "LE hors-critères"  , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "LE dans texte"         , string: "LE dans texte"     , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Spammeur"              , string: "Spam"              , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Ortho"                 , string: "Ortho"             , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Ajout POV"             , string: "Non-neutre"        , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Non-encyclo"           , string: "Non-encyclo"       , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Faut sourcer"          , string: "Faut sourcer"      , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Faut sourcer EV"       , string: "Faut sourcer EV"   , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Maladresse"            , string: "Modif corrigée"    , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Suppr Bandeaux"        , string: "Bandeaux"          , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Bienvenue Copyvio 1"   , string: "Copyright"         , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Compte publicitaire"   , string: "PU publicitaire"   , hasPage: false, addName: true,  addSectionTitle: false },
    { template: "BSI CAA"               , string: "BSI CAA"           , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "BSI BàS"               , string: "BSI BàS"           , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "BSI promo"             , string: "BSI promo"         , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "BSI canular"           , string: "BSI canular"       , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Aide sources"          , string: "Aide sources"      , hasPage: false, addName: true,  addSectionTitle: false },
    { template: "Aide images"           , string: "Aide images"       , hasPage: false, addName: true,  addSectionTitle: false },
    { template: "Aide wikification"     , string: "Aide wikif"        , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Aide liens"            , string: "Aide liens"        , hasPage: false, addName: true,  addSectionTitle: false },
    { template: "AideMeta/Promo"        , string: "Aide BandoPromo"   , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "AideMeta/RefLié"       , string: "Aide BandoRefLié"  , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "AideMeta/RefSec"       , string: "Aide BandoRefSec"  , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "AideMeta/TI"           , string: "Aide BandoTI"      , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "AideMeta/Delist"       , string: "Aide BandoDelist"  , hasPage: true,  addName: true,  addSectionTitle: false },
    { template: "Bienvenue"             , string: "Bienvenue"         , hasPage: false, addName: true,  addSectionTitle: false },
    { template: "Bienvenue IP"          , string: "Bienvenue IP"      , hasPage: false, addName: true,  addSectionTitle: false },
    { template: "Bienvenue IP méritante", string: "Bienvenue IP +"    , hasPage: false, addName: true,  addSectionTitle: false }
  ];

/*
Blanchiment
modifier
 */

  window.Custom_lstBlank = [];

  window.lstBlank = [
    {tooltip: "copyvio"      , resume: "[[WP:COPY|copie de site web sans autorisation explicite]]" },
    {tooltip: "CAA"          , resume: "[[WP:CAA|critères d’admissibilité non atteints]]"          },
    {tooltip: "non encyclo"  , resume: "[[WP:P|non encyclopédique en l’état]]"                     },
    {tooltip: "BaS"          , resume: "bac à sable"                                               },
    {tooltip: "vandalisme"   , resume: "vandalisme"                                                }
  ];

/*
Révocation
modifier
 */

  window.Custom_lrcRevertMessages = [];

  window.lrcRevertMessages = [
    { resume: "[[Wikipédia:Bac à sable|Bac à sable]]" , text: "Bac à sable" },
    { resume: "[[Wikipédia:Vandalisme|Vandalisme]]"   , text: "Vandalisme"  },
    { resume: "Retrait d’information non sourcée"     , text: "Non-sourcé"  },
    { resume: "Traduction automatique"                , text: "Trad auto"   }
  ];

/*
Bandeaux
modifier
 */

  window.Custom_lstBando = [];

  window.lstBando = [
    { template: "Admissibilité à vérifier" , string: "admissibilité"          , withDate: "$month $year" },
    { template: "Copie à vérifier"         , string: "copyvio"                , withDate: ""             },
    { template: "À sourcer"                , string: "à sourcer"              , withDate: "$month $year" },
    { template: "À wikifier"               , string: "à wikifier"             , withDate: "$month $year" },
    { template: "Sources secondaires"      , string: "sources secondaires"    , withDate: "$month $year" },
    { template: "Sources à lier"           , string: "sources à lier"         , withDate: "$month $year" },
    { template: "À délister"               , string: "à délister"             , withDate: "$month $year" },
    { template: "Rédaction"                , string: "rédaction"              , withDate: "$month $year" },
    { template: "Travail inédit"           , string: "TI"                     , withDate: ""             },
    { template: "Règle des 3 révocations"  , string: "R3R"                    , withDate: ""             }
  ];

/*
Requête aux administrateurs
modifier
 */

  window.Custom_lstReport = [];

  window.lstReport = [
        {  userright:"delete",
           text:"REPORTING_DELETION",
           page:"Wikipédia:Demande de suppression immédiate",
           template:"Wikipédia:LiveRC/Modèles/Demande de suppression",
           parampage:true,
           paramuser:false,
           resume:"[[:$1]]",
           reasonsdropdownname:"deletereason-dropdown"
        },
        {  userright:"protect",
           text:"REPORTING_PROTECTION",
           page:"Wikipédia:Demande de protection de page",
           template:"Wikipédia:LiveRC/Modèles/Demande de protection",
           parampage:true,
           paramuser:false,
           resume:"{{a-court|$1}}",
           reasonsdropdownname:"protect-dropdown"
        },
        {  userright:"block",
           text:"REPORTING_BLOCK",
           page:"Wikipédia:Vandalisme en cours",
           template:"Wikipédia:LiveRC/Modèles/Demande de blocage",
           parampage:false,
           paramuser:true,
           resume:"Demande de blocage de $2",
           reasonsdropdownname:"ipbreason-dropdown"
        },
        {  userright:"anyRight",
           text:"REPORTING_HELP",
           page:"Wikipédia:Forum des nouveaux",
           template:"Wikipédia:LiveRC/Modèles/Nouveau ayant besoin d'aide",
           parampage:false,
           paramuser:true,
           resume:"Demande d'aide pour un nouveau : [[User:$2|$2]]",
           reasonsdropdownname:""
        }
    ];

/*

Boutons de suppression de lignes

modifier
 */

  window.Custom_lrcSupprLineParams = [];

  window.lrcSupprLineParams = [
    {textid:"HIDE_ALL"      , color:"red"              , class:"*"          , separator:"|" },
    {textid:"HIDE_REVIEWED" , color:"rgb(255,235,71)"  , class:"RcChecked"  , separator:""  },
    {textid:"HIDE_REVERTS"  , color:"rgb(255,99,83)"   , class:"RcRevert"   , separator:""  },
    {textid:"HIDE_NEW"      , color:"rgb(178,243,113)" , class:"RcNew"      , separator:""  },
    {textid:"HIDE_BLANKING" , color:"white"            , class:"RcBlanking" , separator:""  },
    {textid:"HIDE_LOG"      , color:"blue"             , class:"RcLog"      , separator:""  }
  ];

/*

Variables d'état (pour test sur rc.state)

modifier
Commentaire de modif
modifier
 */

  window.Custom_commenttests = [];

  window.commenttests = [
    { state: "REVERT"     , icon:"RevertIcon",           class:"RcRevert",           regex: /\b([Aa]nnulation|[Rr]évocation)\b|^(Undid|Revert to( the)?) revision|^(Undoing|Reverted( \d+)?) edit|^r(e)?v(ert(ing|ed)?)?\b|^La dernière modification du texte .* a été rejetée/, hide:false},
    { state: "BLANKING"   , icon:"BlankingIcon",         class:"RcBlanking",         regex: /^Résumé automatique : blanchiment|^[Bb]lanchi|(Live|Patrouille) *(RC)?( : )?Blanchiment/  , hide:false},
    { state: "REPLACED"   , icon:"ReplacedIcon",         class:"RcReplaced",         regex: /^Résumé automatique : contenu remplacé par/  , hide:false},
    { state: "REDIRECTED" , icon:"RedirectedIcon",       class:"RcRedirected",       regex: /^Page redirigée vers|^#REDIRECT/,   hide:false},
    { state: "WPCLEANER"  , icon:"WPCIcon",              class:"RcWPC",              regex: /(WPCleaner|Correction syntaxique)/, hide:false},
    { state: "AWB"        , icon:"AWBIcon",              class:"RcAWB",              regex: /(AWB|AutoWikiBrowser)/,             hide:false},
    { state: "POPUPS"     , icon:"PopupsIcon",           class:"RcPopups",           regex: /(P|p)opups/,                        hide:false}
  ];

/*
Catégories de pages
modifier
 */

  window.Custom_categoriestests = [];

  window.categoriestests = [
    { state: "ADQ"       , icon:"AdQIcon"      , class:"RcADQ",       regex: /Article de qualité( contesté|)$/                },
    { state: "BA"        , icon:"BAIcon"       , class:"RcBA",        regex: /Bon article$/                                   },
    { state: "APDQ"      , icon:"APDQIcon"     , class:"RcAPDQ",      regex: /Article potentiellement (bon|de qualité)/       },
    { state: "STUB"      , icon:"StubIcon"     , class:"RcStub",      regex: /Wikipédia:ébauche/                              },
    { state: "COPYRIGHT" , icon:"CopyrightIcon", class:"RcCopyright", regex: /Article soupçonné de travail sous copyright/    },
    { state: "PAS"       , icon:"PaSIcon"      , class:"RcPaS",       regex: /Page proposée à la suppression/                 }
  ];

/*
Catégories d'utilisateurs
modifier
 */

  window.Custom_watchCategories = [];

  window.watchCategories = [
    { state: "SCOLARIP"      , icon:"ScolarIPIcon"      , class:"RcScolarIP",      category: "Adresse IP scolaire"                  },
    { state: "SHAREDIP"      , icon:"SharedIPIcon"      , class:"RcSharedIP",      category: "Adresse IP partagée"                  },
    { state: "OPENPROXY"     , icon:"OpenProxyIcon"     , class:"RcOpenProxy",     category: "Proxy ouvert"                         },
    { state: "COPYRIGHTUSER" , icon:"CopyrightUserIcon" , class:"RcCopyrightUser", category: "Utilisateur enfreignant un copyright" },
    { state: "PEDIAPROJECT"  , icon:"PediaProjectIcon"  , class:"RcPediaProject",  category: "Utilisateur projet pédagogique"       }
  ];

/*
Modèles
modifier
 */

  window.Custom_templatestests = [];

  window.templatestests = [
    { state: "PORTAIL"    , icon:""             , class:"RcPortail"  , template: "Méta lien vers portail"          },
    { state: "RECENT"     , icon:"RecentIcon"   , class:"RcRecent"   , template: "Méta bandeau d'événement récent" },
    { state: "R3R"        , icon:"R3RIcon"      , class:"RcR3R"      , template: "Règle des 3 révocations"         },
    { state: "PAS"        , icon:"PaSIcon"      , class:"RcPaS"      , template: "Suppression"                     },
    { state: "COPYRIGHT"  , icon:"CopyrightIcon", class:"RcCopyright", template: "Copie de site"                   },
    { state: "COPYRIGHT"  , icon:"CopyrightIcon", class:"RcCopyright", template: "Copie à vérifier"                },
    { state: "COPYRIGHT"  , icon:"CopyrightIcon", class:"RcCopyright", template: "Copyrighté"                      },
    { state: "COPYRIGHT"  , icon:"CopyrightIcon", class:"RcCopyright", template: "Texte copyvio"                   },
    { state: "COPYRIGHT"  , icon:"CopyrightIcon", class:"RcCopyright", template: "Image copyvio"                   },
    { state: "COPYRIGHT"  , icon:"CopyrightIcon", class:"RcCopyright", template: "Synopsis"                        },
    { state: "WIP"        , icon:"WIPIcon"      , class:"RcWIP"      , template: "En cours"                        },
    { state: "WIP"        , icon:"WIPIcon"      , class:"RcWIP"      , template: "En travaux"                      }
  ];

/*

Autres variables personnalisables

modifier
Extensions
modifier
 */

  window.Custom_lrcExtensions = [];

  window.lrcExtensions = [
    {
      "name":"ProposeTranslationExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/ProposeTranslationExtension.js",
      "desc":"Ajoute un formulaire pour proposer une traduction de l’interface.",
      "neededright": ""
    },
    {
      "name":"InstallAndConfigLiveRCExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/InstallAndConfigLiveRCExtension.js",
      "desc":"Fournit une interface de configuration lorsque l’utilisateur est présent sur la page d’installation",
      "neededright": ""
    },
    {
      "name":"UserWarningsExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/UserWarningsExtension.js",
      "desc":"Ajoute une icône aux utilisateurs ayant reçu un avertissement. En option, indique si la page de discussion de l’utilisateur existe ou non.",
      "neededright": ""
    },
    {
      "name":"MostModifiedPagesExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/MostModifiedPagesExtension.js",
      "desc":"Ajoute une icône aux pages ayant été modifiées récemment par plusieurs utilisateurs ou ayant fait l’objet de plusieurs reverts.",
      "neededright": ""
    },
    {
      "name":"LinkOnIconExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/LinkOnIconExtension.js",
      "desc":"Lie les icônes PàS, AdQ, BA et copyvio aux pages de discussion associées.",
      "neededright": ""
    },
    {
      "name":"LinkOnLanglinkCountExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/LinkOnLanglinkCountExtension.js",
      "desc":"Ajoute un lien vers wikidata par dessus le compteur de liens inter-langues.",
      "neededright": ""
    },
    {
      "name":"ToolbarExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/ToolbarExtension.js",
      "desc":"Fournit une barre d’outils lors d’une édition.",
      "neededright": ""
    },
    {
      "name":"HotCatsMulti",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/HotCatsMulti.js",
      "desc":"Permet d’ajouter/modifier/retirer une ou plusieurs catégories lors de la prévisualisation d’une page",
      "neededright": ""
    },
    {
      "name":"CategoryRC",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/CategoryRCExtension.js",
      "desc":"Permet de ne surveiller que les pages appartenant à une ou plusieur catégories",
      "neededright": ""
    },
    {
      "name":"PreviewAllLinksExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/PreviewAllLinksExtension.js",
      "desc":"Permet de prévisualiser tout lien interne de la fenêtre de prévisualisation",
      "neededright": ""
    },
    {
      "name":"PreviewThisPageExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/PreviewThisPageExtension.js",
      "desc":"Permet de prévisualiser une page au choix",
      "neededright": ""
    },
    {
      "name":"DiffExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/DiffExtension.js",
      "desc":"Permet d’avoir les fonctions automatiques de LiveRC dans les diff \"normaux\"",
      "neededright": ""
    },
    {
      "name":"AskForRevisionDeleteFromHistExtension",
      "url":"//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/Extensions/AskForRevisionDeleteFromHistExtension.js",
      "desc":"Ajoute des cases à cocher et un bouton dans la prévisualisation d’un historique pour demander un masquage (non sysop)",
      "neededright": "!deleterevision"
    }

  ];


/*
Styles CSS
modifier
Voir MediaWiki:Gadget-LiveRC.js/CSS.js
 */


/*
Onglets du menu de configuration
modifier
 */

    // Config panel tabs
  window.Custom_lstParamMenuTabs = {};
  window.lstParamMenuTabs = {
    "lrcParams"              : true,
    "lrcOptionMenuValues"    : true,
    "lstBlank"               : true,
    "lrcRevertMessages"      : true,
    "lstAverto"              : true,
    "lstBando"               : true,
    "lstReport"              : false,
    "lrcIcons"               : true,
    "lrcTranslatedTexts"     : true,
    "lrcTranslatedParamDesc" : true,
    "UnTranslatedTexts"      : true,
    "lrcExtensions"          : false,
    "commenttests"           : true,
    "categoriestests"        : true,
    "templatestests"         : true,
    "watchCategories"        : true,
    "lrcSupprLineParams"     : false,
    "ContactListLegend"      : true,
    "HiddenListLegend"       : true,
    "ExtensionsLegend"       : true,
    "lrcCSSstyles"           : true
  };

/*

Variables non personnalisables

modifier
 */

// Configuration

  if(typeof(window.LiveRC_Config)==="undefined") window.LiveRC_Config = {};

  if(typeof(LiveRC_Config["InstallationPage"])==="undefined")
    LiveRC_Config["InstallationPage"] = ( mw.config.get('wgServer')==='//fr.wikipedia.org' ? "MediaWiki:Gadget-LiveRC-frWP.js" : "Mediawiki:Gadget-LiveRC.js" );

  if(typeof(LiveRC_Config["SiteConfigPage"])==="undefined")
    LiveRC_Config["SiteConfigPage"] = "MediaWiki:Gadget-LiveRCSiteConfig.js";      // Page de stockage de la config locale

  if(typeof(LiveRC_Config["CSSPage"])==="undefined")
    LiveRC_Config["CSSPage"] = "MediaWiki:Gadget-LiveRC-local.css";                // Page de stockage du css local

  if(typeof(LiveRC_Config["UserParamPage"])==="undefined")
    LiveRC_Config["UserParamPage"] = "/LiveRCparam";                               // Sous-page utilisateur de stockage des personnalisations

  if(typeof(LiveRC_Config["HostServerPath"])==="undefined")
    LiveRC_Config["HostServerPath"] = "//fr.wikipedia.org/w/index.php?title=";     // Serveur hébergeant le code de LiveRC


  LiveRC_Config["BugzillaURL"] = "https://fr.wikipedia.org/wiki/Discussion MediaWiki:Gadget-LiveRC.js";

  LiveRC_Config["LaunchProcess"] = [];    // Process d'initialisation
  LiveRC_Config["LaunchProcessForce"] = {};

    // Configuration du wiki local
  LiveRC_Config["MediawikiGeneralConfig"] = {};                        // Liste des paramètres de configuration
  LiveRC_Config["MediawikiLanguages"] = {};                            // Liste des langues supportées
  LiveRC_Config["MediawikiMessages"] = {};                             // Liste des messages système Mediawiki
  LiveRC_Config["MediawikiExtensions"] = {};                           // Liste des extensions Mediawiki
  LiveRC_Config["MediawikiNamespaces"] = {};                           // Liste des espaces de noms
  LiveRC_Config["MediawikiMagicwords"] = {};                           // Liste des mots magiques
  LiveRC_Config["MediawikiUsergroups"] = {};                           // Liste des groupes d'utilisateurs et des droits associés
  LiveRC_Config["MediawikiInterwikimap"] = {};                         // Liste des liens interwiki possibles
  LiveRC_Config["MediawikiWikibase"] = {};                             // Liste des paramètres de la wikibase
  LiveRC_Config["MediawikiTags"] = {};                                 // Liste des balises Abuse filter

  LiveRC_Config["ToolTags"] = {   // Balises pour marquer les édits faits avec des outils automatiques
    "LiveRC" : ""
  };

    // Informations sur l'utilisateur courant
  LiveRC_Config["UserInfos"] = {
    Rights      : [],                                                   // Liste des droits
    Groups      : [],                                                   // Liste des groupes
    isAdmin     : (mw.config.get('wgUserGroups').indexOf("sysop")!=-1), // Utilisateur administrateur;
    isBlocked   : false,                                                // Utilisateur bloqué
    EditCount   : 0,                                                    // Editcount
    RealName    : "",                                                   // "Vrai" nom (si renseigné)
    eMail       : "",                                                   // adresse mail (si renseignée)
    Preferences : {},                                                   // Préférences
    APIlimit    : 499                                                   // Limite de requête API
  };
    // Gestion des langues
  LiveRC_Config["SupportedLanguages"] = ["fr", "en", "it"];
  LiveRC_Config["AvailableLanguages"] = [];
  LiveRC_Config["LoadedLanguages"] = [];
  LiveRC_Config["LoadFunctions"] = [];

    //Historique des prévisualisations
  LiveRC_Config["History"] = {
    "Type"   : [],
    "Params" : [],
    "URL"    : [],
    "Text"   : [],
    "Index"  : -1,
    "IsOld"  : false
  };

    // Listes de suivi spéciales
  LiveRC_Config["SpecialLogList"] = [];         // Définition des listes de suivi spéciales
  LiveRC_Config["SpecialLogListConfig"] = {     // Configuration des listes spéciales
    "liveAbuseLog"       : { "Values" : {}, "DefaultState" : true  },  // Liste des déclenchements de filtre anti-abus
    "liveTag"            : { "Values" : {}, "DefaultState" : true  },  // Liste des modifications balisées
    "liveSpam"           : { "Values" : {}, "DefaultState" : false },  // Liste des utilisateurs ayant déclenché le filtre anti-spam
    "liveRevoc"          : { "Values" : {}, "DefaultState" : true  },  // Liste des utilisateurs révoqués
    "liveNewUsers"       : { "Values" : {}, "DefaultState" : true  },  // Liste des utilisateurs inscrits durant la session
    "liveContact"        : { "Values" : {}, "DefaultState" : false },  // Liste des utilisateurs suivis
    "liveHidden"         : { "Values" : {}, "DefaultState" : false },  // Liste des utilisateurs masqués
    "liveSuivi"          : { "Values" : {}, "DefaultState" : false },  // Liste des pages suivies
    "liveHiddenPages"    : { "Values" : {}, "DefaultState" : false },  // Liste des pages masquées
    "liveNewPages"       : { "Values" : {}, "DefaultState" : true  },  // Liste des nouvelles pages
    "livePendingChanges" : { "Values" : {}, "DefaultState" : true  }   // Liste des pages en attente de validation
  };


   // Listes d'utilisateurs locaux par groupe
  LiveRC_Config["UserGroupList"] = {
    "sysop" : { list:[], show:false },
    "bot"   : { list:[], show:false }
  };

    // Autres listes
  LiveRC_Config["Blocks"] = [];                // Liste des utilisateurs récemment bloqués
  LiveRC_Config["UserCat"] = {};               // Liste des catégories d'utilisateurs
  LiveRC_Config["Blocked"] = [];               // Liste des utilisateurs bloqués durant la session
  LiveRC_Config["Notificationtimestamp"] = {}; // Liste des notificationtimestamp
  LiveRC_Config["ListLoaded"] = {};            // État de chargement des liste spéciales

    // IDs à rechercher pour le contenu d'une page
  LiveRC_Config["PageContentIds"] = [
    'bodyContent',
    'article',
    'mw_contentholder'
  ];

    // Menu de paramétrage
  LiveRC_Config["LiveRCcustomParams"] = {};
  LiveRC_Config["ParamStartComment"] = '//<syntaxhighligh'+'t lang="javascript">//<pr'+'e>//<no'+'wiki>\n\n';
  LiveRC_Config["ParamEndComment"] = '//END PARAMS\n//</no'+'wiki></pr'+'e></syntaxhighligh'+'t>\n';
  LiveRC_Config["MediawikiConfigComment1"] = "// AUTOMATIC SAVE BEGIN";  // Config locale : commentaire début
  LiveRC_Config["MediawikiConfigComment2"] = "// AUTOMATIC SAVE END";    // Config locale : commentaire fin
  LiveRC_Config["CustomCatTemplate"] = 'Catégorisation JS';
  LiveRC_Config["AlwaysShownTabs"] = ["lstParamMenuTabs"];

    // Z-index Checklists
  LiveRC_Config["CheckListZIndex"] = 6000;

  // Limitations
  LiveRC_Config["RevertLimit"] = 10;
  LiveRC_Config["LimitationsRight"] = {
    "Default" : "autopatrol",
    "Revert"  : "autopatrol",
    "Blank"   : "autopatrol",
    "Tag"     : "autopatrol",
    "Message" : "autopatrol",
    "Thank"   : "autopatrol",
    "Report"  : "autopatrol"
  };
  // Utilisateurs qui ne sont pas concernés par la limitation (reservé aux développeurs)
  LiveRC_Config["LimitationsWhitelist"] = ["Dr Brains"];
  // Utilisateurs qui sont interdits d'outils automatiques
  LiveRC_Config["LimitationsBlacklist"] = [];

// Timestamps d'initialisation des RC, Log et Filtres
  LiveRC_Config["LastRCid"] = 0;
  LiveRC_Config["LastLOGid"] = 0;
  LiveRC_Config["LastFILTERid"] = 0;
  LiveRC_Config["LastRCtimestamp"] = 1;
  LiveRC_Config["LastLOGtimestamp"] = 1;
  LiveRC_Config["LastFILTERtimestamp"] = 1;
  LiveRC_Config["LastCUtimestamp"] = 1;

// Autres initialisations
  LiveRC_Config["ClockTime"] = {};             // Horloge de LiveRC ("H","M","S")
  LiveRC_Config["Timeout"] = {};               // Liste des timeout
  LiveRC_Config["LoadingTime"] = 0;            // Temps de chargement, en secondes
  LiveRC_Config["RequestError"] = 0;           // Nombre de requêtes RC consécutives échoués
  LiveRC_Config["PendingDebug"] = [];          // Ligne de débogage en attente
  LiveRC_Config["AlertCount"] = -1;            // Index des alertes
  LiveRC_Config["NextFreeID"] = 0;             // Index des ID automatiques
  LiveRC_Config["NextPreviewIndex"] = 0;       // Index des prévisualisations

  // Préchargement de la prévisualisation
  LiveRC_Config["RCEvents"] = {};
  LiveRC_Config["AllLinesSeen"] = true;

    // Suggestions de pages
  LiveRC_Config["SuggestParams"] = {};
  LiveRC_Config["SuggestParams"]["ZIndex"] = 5;                // Propriété "z-index" de départ
  LiveRC_Config["SuggestParams"]["Input"] = [];                // Matrice des <input> (champ de saisie)
  LiveRC_Config["SuggestParams"]["Suggest"] = [];              // Matrice des <select> (liste de suggestions)
  LiveRC_Config["SuggestParams"]["ExistInput"] = [];           // Matrice des <input> (page existe ou pas)
  LiveRC_Config["SuggestParams"]["ExistImg"] = [];             // Matrice des <img> (page existe ou pas)
  LiveRC_Config["SuggestParams"]["IsRunning"] = [];            // Matrice de l'état de la requête de suggestions
  LiveRC_Config["SuggestParams"]["Index"] = 1;                 // Index de départ (id)
      // Valeurs configurables
  LiveRC_Config["SuggestParams"]["NSFilter"] = [];             // Matrice de l'option de filtrage par espace de noms
  LiveRC_Config["SuggestParams"]["StripNS"] = [];              // Matrice de l'option d'affichage de l'espace de noms
  LiveRC_Config["SuggestParams"]["SuggestLimit"] = [];         // Matrice de la limite des suggestions
  LiveRC_Config["SuggestParams"]["SuggestSelectLimit"] = [];   // Matrice de la taille de la liste de suggestions
  LiveRC_Config["SuggestParams"]["ListDown"] = [];             // Matrice de l'affichage de la liste de suggestions
  LiveRC_Config["SuggestParams"]["AddExist"] = [];             // Matrice de l'affichage de l'icône
  LiveRC_Config["SuggestParams"]["Prefix"] = [];               // Matrice des préfixes de filtrage
  LiveRC_Config["SuggestParams"]["Suffix"] = [];               // Matrice des suffixes de filtrage
  LiveRC_Config["SuggestParams"]["RedirectFilter"] = [];       // Matrice des filtrages de redirection
      // Valeurs par défaut
  LiveRC_Config["SuggestParams"]["NSFilter"][0] = false;
  LiveRC_Config["SuggestParams"]["StripNS"][0] = false;
  LiveRC_Config["SuggestParams"]["SuggestLimit"][0] = 10;
  LiveRC_Config["SuggestParams"]["SuggestSelectLimit"][0] = 5;
  LiveRC_Config["SuggestParams"]["ListDown"][0] = false;
  LiveRC_Config["SuggestParams"]["AddExist"][0] = false;
  LiveRC_Config["SuggestParams"]["Prefix"][0] = false;
  LiveRC_Config["SuggestParams"]["Suffix"][0] = false;
  LiveRC_Config["SuggestParams"]["RedirectFilter"][0] = "all";

    // List des extensions LiveRC installées par l'utilisateur
  LiveRC_Config["InstalledLiveRCExtensions"] = [];
  LiveRC_Config["UsedLiveRCExtensions"] = [];

    // List des mots magiques utilisés
  LiveRC_Config["NeededMagicWords"] = [];

    // Liste des messages systèmes utilisés
  LiveRC_Config["NeededMessages"] = [
    "abusefilter-log",
    "abusefilter-action-block",
    "abusefilter-action-blockautopromote",
    "abusefilter-action-degroup",
    "abusefilter-action-disallow",
    "abusefilter-action-rangeblock",
    "abusefilter-action-tag",
    "abusefilter-action-throttle",
    "abusefilter-action-warn",
    "abusefilter-log-noactions",
    "abusefilter-edit-warn-actions",
    "block-log-flags-angry-autoblock",
    "block-log-flags-anononly",
    "block-log-flags-hiddenname",
    "block-log-flags-noautoblock",
    "block-log-flags-nocreate",
    "block-log-flags-noemail",
    "block-log-flags-nousertalk",
    "hide",
    "show",
    "watch",
    "unwatch",
    "log",
    "mycontris",
    "protect-unchain-permissions",
    "red-link-title",
    "revertpage",
    "markedaspatrolled",
    "whatlinkshere-filters",
    "whatlinkshere-hideimages",
    "whatlinkshere-hidelinks",
    "whatlinkshere-hideredirs",
    "whatlinkshere-hidetrans",
    "january",
    "february",
    "march",
    "april",
    "may",
    "june",
    "july",
    "august",
    "september",
    "october",
    "november",
    "december"
  ];

    // Types de journaux, avec extensions mediawiki et/ou droits nécessaires
  LiveRC_Config["LogNames"] = {
    'upload':             {page:'uploadlogpage'                                                                         },
    'newusers':           {page:'newuserlogpage'                                                                        },
    'patrol':             {page:'patrol-log-page'                                                                       },
    'move':               {page:'movelogpage'                                                                           },
    'merge':              {page:'mergelog'                                                                              },
    'protect':            {page:'protectlogpage'                                                                        },
    'delete':             {page:'dellogpage'                                                                            },
    'block':              {page:'blocklogpage'                                                                          },
    'rights':             {page:'rightslog'                                                                             },
    'import':             {page:'importlogpage'                                                                         },
    'managetags':         {page:'log-name-managetags'                                                                   },
    'tag':                {page:'log-name-tag'                                                                          },
    'gblblock':           {page:'globalblocking-logpage',           extension:'GlobalBlocking'                          },
    'globalauth':         {page:'centralauth-log-name',             extension:'Central Auth'                            },
    'gblrename':          {page:'log-name-gblrename',               extension:'Central Auth'                            },
    'gblrights':          {page:'centralauth-rightslog-name',       extension:'Central Auth'                            },
    'renameuser':         {page:'log-name-renameuser',              extension:'Renameuser'                              },
    'abusefilter':        {page:'abusefilter-log-name',             extension:'Abuse Filter'                            },
    'abuselog':           {page:'abusefilter-log',                  extension:'Abuse Filter'                            },
    'thanks':             {page:'log-name-thanks',                  extension:'Thanks'                                  },
    'massmessage':        {page:'log-name-massmessage',             extension:'MassMessage'                             },
    'suppress':           {page:'suppressionlog',                   extension:'Oversight',        right:'suppressionlog'},
    'checkuser':          {page:'checkuserlog',                     extension:'CheckUser',        right:'checkuser-log' },
    'pagetriage-curation':{page:'log-name-pagetriage-curation',     extension:'PageTriage'                              },
    'pagetriage-deletion':{page:'log-name-pagetriage-deletion',     extension:'PageTriage'                              },
    'review':             {page:'review-logpage',                   extension:'Flagged Revisions'                       },
    'stable':             {page:'stable-logpage',                   extension:'Flagged Revisions'                       },
    'online':             {page:'log-name-online',                  extension:'Education Program'                       },
    'campus':             {page:'log-name-campus',                  extension:'Education Program'                       },
    'course':             {page:'log-name-course',                  extension:'Education Program'                       },
    'institution':        {page:'log-name-institution',             extension:'Education Program'                       },
    'instructor':         {page:'log-name-instructor',              extension:'Education Program'                       },
    'student':            {page:'log-name-student',                 extension:'Education Program'                       },
    'student':            {page:'log-name-student',                 extension:'Education Program'                       },
    'translatorsandbox':  {page:'log-name-translatorsandbox',       extension:'Translate'                               },
    'translationreview':  {page:'log-name-translationreview',       extension:'Translate'                               },
    'pagetranslation':    {page:'log-name-pagetranslation',         extension:'Translate'                               },
    'notifytranslators':  {page:'log-name-notifytranslators',       extension:'TranslationNotifications'                },
    'liquidthreads':      {page:'lqt-log-name',                     extension:'Liquid Threads'                          },
    'mwoauthconsumer':    {page:'mwoauthconsumer-consumer-logpage', extension:'OAuth'                                   },
    'moodbar':            {page:'moodbar-log-name',                 extension:'MoodBar'                                 },
    'interwiki':          {page:'log-name-interwiki',               extension:'Interwiki'                               }
  };

    // Catégories de suivi ([[Special:TrackingCategories]])
  LiveRC_Config["TrackingCategories"] = [
    "expensive-parserfunction-category",
    "post-expand-template-argument-category",
    "post-expand-template-inclusion-category",
    "hidden-category-category",
    "broken-file-category",
    "node-count-exceeded-category",
    "expansion-depth-exceeded-category",
    "score-error-category",
    "massmessage-list-category",
    "commonsmetadata-trackingcategory-no-license",
    "commonsmetadata-trackingcategory-no-description",
    "commonsmetadata-trackingcategory-no-author",
    "commonsmetadata-trackingcategory-no-source",
    "geodata-broken-tags-category",
    "geodata-unknown-globe-category",
    "geodata-unknown-region-category",
    "geodata-unknown-type-category",
    "scribunto-common-error-category",
    "scribunto-module-with-errors-category"
  ];


    // Hooks
  LiveRC_Config["Hooks"] = {
  /* Lancement */
    "BeforeInitActivationProcess"   : [],
    "AfterInitActivationProcess"    : [],
    "AfterGotUserInfos"             : [],
    "AfterGotSiteInfos"             : [],
    "AfterTranslationsLoaded"       : [],
    "AfterSpecialLogList"           : [],
    "AfterOptions"                  : [],
  /* Requête RC */
    "BeforeRC"                      : [],
    "AfterRC"                       : [],
    "AfterRCNotification"           : [],
    "AfterSpecialLogListUpdated"    : [],
    "AfterAllSpecialLogListUpdated" : [],
  /* Prévisualisation */
    "AfterPreviewDiff"              : [],
    "AfterPreviewArticle"           : [],
    "AfterPreviewHistory"           : [],
    "AfterPreviewContribs"          : [],
    "AfterPreviewDeletedContribs"   : [],
    "AfterPreviewLog"               : [],
    "AfterPreviewFilter"            : [],
    "AfterPreviewEdit"              : [],
    "AfterPreviewMove"              : [],
    "AfterPreviewProtect"           : [],
    "AfterPreviewDelete"            : [],
    "AfterPreviewBlock"             : [],
    "AfterPreviewRevisiondelete"    : [],
    "AfterPreviewWhatlinkshere"     : [],
    "AfterPreviewStabilization"     : [],
    "AfterPreviewChangetag"         : [],
    "AfterPreviewInterwiki"         : [],
    "AfterMiniDiffPrewiew"          : [],
  /* Menu de configuration */
    "AfterFillParamPanel"           : [],
    "AfterCreateParamPanel"         : [],
    "BeforeParamPanelSaved"         : [],
  /* Autres */
    "AfterDisplayDebug"             : [],
    "AfterDisplayTchat"             : [],
    "AfterDisplayNewWindowTchat"    : []
  };

  // Config extensions mediawiki. TODO : trouver un moyen pour remplir ces variables automatiquement (via l'API ?)
    /* === Flagged Revisions === */
     // Liste des namespaces où la validation est active
  LiveRC_Config["FlagRevNamespaces"] = [0, 6, 10, 828];
     // Stabilisation intégrée à l'outil de protection
  LiveRC_Config["FlagRevProtection"] = false;
    /* === Flow === */
     // Liste des pages où flow est actif
  LiveRC_Config["FlowOccupyPages"] = ["Discussion Wikipédia:Flow", "Wikipédia:Forum des nouveaux/Flow"];
     // Liste des namespaces où flow est actif
  LiveRC_Config["FlowOccupyNamespaces"] = [2600];
     // Actions permises sur les pages où flow est actif
  LiveRC_Config["FlowCoreActionWhitelist"] = ['info', 'history', 'protect', 'unprotect', 'unwatch', 'watch'];



    // Variables obsolètes, conservées pour compatibilité avec anciennes personnalisations
  var lang_log = [];
  var lrcManageParamsDesc = [];
  var lrcHotCatsVariables = [];
  var lrcHotCatsText = [];
  var lrcHooks = [];
  var lrcIcon = [];
  var lrcManageParams_Desc = [];
  var lrcParams_Custom = [];
  var lrcOptionMenuValues_Custom = [];
  var lstBlank_Custom = [];
  var lrcRevertMessages_Custom = [];
  var lstAverto_Custom = [];
  var lstBando_Custom = [];
  var lrcIcons_Custom = [];
  var lrcExtensions_Custom = [];
  var UnTranslatedTexts_Custom = [];
  var lrcTexts_Custom = [];
  var lrcParamDesc_Custom = [];

  // fonction spéciale pour supprimer/modifier un paramètre chargé dans le LiveRCparam.js d'un utilisateur

window.LiveRC_getSpecialCustom = function(){

    for(var tag in LiveRC_Config["MediawikiTags"]){
        if(typeof(LiveRC_Config["MediawikiTags"][tag]) === "boolean") delete LiveRC_Config["MediawikiTags"][tag];
    }

    for(var a=0,l=lrcIcons.length;a<l;a++){
      if(lrcIcons[a].type == "sup_img") lrcIcons[a].type = 1;
      else if(lrcIcons[a].type == "sub_img") lrcIcons[a].type = 2;
      else lrcIcons[a].type = 0;
      if(!lrcIcons[a].height) lrcIcons[a].height = lrcIcons[a].width;
    }
    for(var a=0,l=Custom_lrcIcons.length;a<l;a++){
      if(Custom_lrcIcons[a].type == "sup_img") Custom_lrcIcons[a].type = 1;
      else if(Custom_lrcIcons[a].type == "sub_img") Custom_lrcIcons[a].type = 2;
      else Custom_lrcIcons[a].type = 0;
      if(!Custom_lrcIcons[a].height) lrcIcons[a].height = Custom_lrcIcons[a].width;
    }
    for(var a=0,l=Custom_commenttests.length;a<l;a++){
      if(!Custom_commenttests[a].hide) Custom_commenttests[a].hide = false;
      if(Realtypeof(Custom_commenttests[a].regex)=="string") Custom_commenttests[a].regex = new RegExp(Custom_commenttests[a].regex);
    }
    for(var a=0,l=commenttests.length;a<l;a++){
      if(Realtypeof(commenttests[a].regex)=="string") commenttests[a].regex = new RegExp(commenttests[a].regex);
    }
    for(var a=0,l=Custom_categoriestests.length;a<l;a++){
      if(Realtypeof(Custom_categoriestests[a].regex)=="string") Custom_categoriestests[a].regex = new RegExp(Custom_categoriestests[a].regex);
    }
    for(var a=0,l=categoriestests.length;a<l;a++){
      if(Realtypeof(categoriestests[a].regex)=="string") categoriestests[a].regex = new RegExp(categoriestests[a].regex);
    }
    if(typeof(lrcUserWarningsMessages)!="undefined"){
      for(var a=0,l=lrcUserWarningsMessages.length;a<l;a++){
        if(Realtypeof(lrcUserWarningsMessages[a].regex)=="string") lrcUserWarningsMessages[a].regex = new RegExp(lrcUserWarningsMessages[a].regex);
      }
    }
    if(typeof(Custom_lrcUserWarningsMessages)!="undefined"){
      for(var a=0,l=Custom_lrcUserWarningsMessages.length;a<l;a++){
        if(Realtypeof(Custom_lrcUserWarningsMessages[a].regex)=="string") Custom_lrcUserWarningsMessages[a].regex = new RegExp(Custom_lrcUserWarningsMessages[a].regex);
      }
    }
    for(var a=0,l=Custom_lstBando.length;a<l;a++){
      if(typeof(Custom_lstBando[a].withDate)==="boolean" && Custom_lstBando[a].withDate) Custom_lstBando[a].withDate = "$month $year";
      else if(!Custom_lstBando[a].withDate) Custom_lstBando[a].withDate = "";
    }
    for(var a=0,l=Custom_lstAverto.length;a<l;a++){
      if(typeof(Custom_lstAverto[a].addSectionTitle)==="undefined") Custom_lstAverto[a].addSectionTitle = false;
    }
    if(typeof(Custom_lrcParams["LoadSysopBotList"])!="undefined") Custom_lrcParams["LoadUsersInGroupsList"] = Custom_lrcParams["LoadSysopBotList"];

    for(var a=0,l=Custom_lrcExtensions.length;a<l;a++){
      delete Custom_lrcExtensions[a]["Installed"];
      if(!Custom_lrcExtensions[a]["neededright"]) Custom_lrcExtensions[a]["neededright"] = "";
    }
    for(var a=0,l=lrcExtensions.length;a<l;a++){
      if(!lrcExtensions[a]["neededright"]) lrcExtensions[a]["neededright"] = "";
    }
    if(typeof(Custom_lrcEditToolBarSetup)==="object" && typeof(lrcEditToolBarSetup)==="object"){
      for(var a=0,l=Custom_lrcEditToolBarSetup.length;a<l;a++){
        var IconId = Custom_lrcEditToolBarSetup[a].iconid.split("ToolbarIcon_").join("");
        if(["enum", "list", "gallery", "table", "math"].indexOf(IconId)!==-1 && Custom_lrcEditToolBarSetup[a].before.indexOf("\n")==-1){
          for(var b=0,m=lrcEditToolBarSetup.length;b<m;b++){
            if(lrcEditToolBarSetup[b].iconid.split("ToolbarIcon_").join("") != IconId) continue;
            Custom_lrcEditToolBarSetup[a] = lrcEditToolBarSetup[b];
          }
        }
      }
    }
    var ObsoleteCustomParams = [
      "AddExtensionCustom",
      "LoadSysopBotList",
      "ShowAllRevoc",
      "ShowAllBlank",
      "HideWPCleaner",
      "HideAWB",
      "RvMinorEdit",
      "AddStyleCustom",
      "RCType",
      "RCns",
      "ShowUserInfos"
    ];
    var ParamToOption = [
      "ShowAllSelf",
      "ShowAllContact",
      "ShowAllWatchlist",
      "HideOwnSubpage"
    ];
    var OptionToParam = [
      "InterwikiList"
    ];
    for(var param in Custom_lrcParams){
      if(ObsoleteCustomParams.indexOf(param)!=-1) delete Custom_lrcParams[param];
      if(ParamToOption.indexOf(param)!=-1){
        Custom_lrcOptionMenuValues[("User_"+param)] = Custom_lrcParams[param];
        delete Custom_lrcParams[param];
      }
    }
    for(var option in Custom_lrcOptionMenuValues){
      if(ObsoleteCustomParams.indexOf(option)!=-1) delete Custom_lrcOptionMenuValues[option];
      if(OptionToParam.indexOf(option)!=-1){
        Custom_lrcParams[option] = Custom_lrcOptionMenuValues[option];
        delete Custom_lrcOptionMenuValues[option];
      }
    }

  };

/*

Fonctions utilitaires

modifier
 */

window.wpajax = {
  /* preloadReq.state
     0 : no request
     1 : pending request
     2 : pending request, the result will be used with preloadReq.bundle
         (preloadReq is locked until the request is complete)
     3 : completed request
  */
  preloadReq: {url: null, xmlhttp: null, bundle: null, state: 0},
  preload: function(url) {
    if (!lrcMakeParam("PreloadLines")) return;
    var plr = wpajax.preloadReq;
    if (plr.state == 2) return 0;
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
      if (xmlhttp.readyState != 4
          || !((plr.state == 1 || plr.state == 2) && plr.url == url)) return;
      var oldState = plr.state;
      plr.xmlhttp = xmlhttp;
      plr.state = 3;
      if (oldState == 2)
        wpajax.httpComplete(xmlhttp, plr.bundle);
    };
    plr.state = 1;
    plr.url = url;
    xmlhttp.open("GET", url, true);
    xmlhttp.send(null);
    return 1;
  },
  // mandatory: bundle.url
  // optional:  bundle.async
  // optional:  bundle.method
  // optional:  bundle.headers
  // optional:  bundle.data
  // optional:  bundle.onSuccess (xmlhttprequest, bundle)
  // optional:  bundle.onFailure (xmlhttprequest, bundle)
  // optional:  bundle.otherStuff OK too, passed to onSuccess and onFailure
  http: function(bundle) {
    lrcDisplayDebug("Ajax request sent : " + bundle.url + (bundle.data ? " ; data = "+bundle.data : ""), true);
    var plr = wpajax.preloadReq;
    if (!(bundle.method || bundle.headers || bundle.async == false || bundle.data)
        && (plr.state == 1 || plr.state == 3) && plr.url == bundle.url) {
      if (plr.state == 1) {
        plr.state = 2;
        plr.bundle = bundle;
      } else {
        wpajax.httpComplete(plr.xmlhttp, bundle);
      }
      return 2;
    }
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
      if (xmlhttp.readyState == 4)
        wpajax.httpComplete(xmlhttp, bundle);
    };
    xmlhttp.open(bundle.method ? bundle.method : "GET", bundle.url, bundle.async == false ? false : true);
    if (bundle.headers) {
      for (var field in bundle.headers)
        try {
          xmlhttp.setRequestHeader(field, bundle.headers[field]);
        } catch(err) {
          //Argos42 : pour rendre LiveRC fonctionnel sur chrome
        }
    }
    xmlhttp.send(bundle.data ? bundle.data : null);
    return 1;
  },
  httpComplete: function(xmlhttp, bundle) {
    if (xmlhttp.status == 200 || xmlhttp.status == 302) {
      if (bundle.onSuccess)
        bundle.onSuccess(xmlhttp, bundle);
    } else if (bundle.onFailure) {
      bundle.onFailure(xmlhttp, bundle);
    }
    lrcDisplayDebug("Ajax request received : " + bundle.url + (bundle.data ? " ; data = "+bundle.data : "") + " (" + xmlhttp.status+")", true);
  }
};

/*

Hook functions

modifier
 */

// Ajout d'une fonction à un hook

window.LiveRC_AddHook = function(Type, func){
  if(typeof(LiveRC_Config["Hooks"][Type])==="undefined") LiveRC_Config["Hooks"][Type] = [];
  if(typeof(func)==="function") LiveRC_Config["Hooks"][Type].push(func);
};

// Exécution des fonctions

window.LiveRC_RunHooks = function(Type, Params){
  var HookResult = true;
  if(typeof(LiveRC_Config["Hooks"][Type])!='undefined'){
    lrcDisplayDebug("Run hook ("+Type+")");
    for(var a=0,l=LiveRC_Config["Hooks"][Type].length;a<l;a++){
      var ThisHookResult = LiveRC_Config["Hooks"][Type][a](Params);
      if(ThisHookResult===false) HookResult = false;
    }
  }
  return HookResult;
};

/*

Fonctions d'état

modifier
 */

window.lrcHasState = function(state, thisState){
    if(!state) return false;
    return (state.indexOf(thisState)!=-1);
};

window.lrcAddState = function(state, thisState){
    if(!state) state = [];
    if(!lrcHasState(state, thisState)) state[(state.length)] = thisState;
    return state;
};

window.lrcRemoveState = function(state, thisState){
    if(!state) return [];
    var index = state.indexOf(thisState);
    if(index!=-1) state = state.splice(index, 1);
    return state;
};

/*

Fonctions de suivi

modifier
 */

// Requête AJAX Ajout/Retrait d'un utilisateur ou d'une page du suivi

window.watchAPICall = function(title, watch) {
  var url = lrcGetAPIURL({format:"xml",action:"query",meta:"tokens",type:"watch"});
  wpajax.http({url: url, onSuccess: watchAPICallStep2, title: title, watch: watch});
};

window.watchAPICallStep2 = function(xmlreq, data){
  var tokens = xmlreq.responseXML.getElementsByTagName("tokens")[0];
  var url = lrcGetAPIURL({format:"xml",action:'watch'});
  var postdata = "title=" + encodeURIComponent(data.title)
              + "&token=" + encodeURIComponent(tokens.getAttribute("watchtoken"))
              + (data.watch ? "" : "&unwatch=1");
  var headers = {"Content-Type": "application/x-www-form-urlencoded"};
  wpajax.http({url: url, method: "POST", headers: headers, data: postdata, onSuccess: watchAPICallStep3,datas:data});
};

window.watchAPICallStep3 = function(xmlreq, data){
  var olddatas = data.datas;
  if(!olddatas) return;
  var title = olddatas.title;
  if(!title) return;
  var messageprefix = "WATCHLIST";
  if(title.indexOf('LiveRCWatch:')!=-1){
    title = title.split('LiveRCWatch:').join('');
    messageprefix = "WATCHUSER";
    try{ updateFollowContact(); }catch(e){ };
  }else if(title.indexOf('LiveRCHidden:')!=-1){
    title = title.split('LiveRCHidden:').join('');
    messageprefix = "HIDEUSER";
    try{ updateFollowHiddenUsers(); }catch(e){ };
  }else if(title.indexOf('LiveRCHiddenPage:')!=-1){
    title = title.split('LiveRCHiddenPage:').join('');
    messageprefix = "HIDEPAGE";
    try{ updateFollowHiddenPages(); }catch(e){ };
  }else{
    try{ updateFollowWatchlist(); }catch(e){ };
  }
  var messagesuffix = (olddatas.watch ? "ON" : "OFF");
  LiveRC_alert(lrcMakeText(messageprefix+messagesuffix).split("$1").join("<b>"+title+"</b>"));
};

// Basculement du bouton de suivi/masquage d'utilisateur

window.lrcToggleWatchLink = function(WatchLink){
   try{
     var Li = WatchLink.parentNode.parentNode;
     var Spans = lrcGetElementsByClass("watchedLink", Li, "span");
     for(var a=0,l=Spans.length;a<l;a++){
        if(Spans[a].style.display == "none"){
          Spans[a].style.display = "";
        }else{
          Spans[a].style.display = "none";
        }
     }
  }catch(e){ }
};

window.addPageToSuivi = function(title){
  if(typeof(LiveRC_Config["SpecialLogListConfig"]["liveSuivi"]["Values"][title])!="undefined") return
  LiveRC_Config["SpecialLogListConfig"]["liveSuivi"]["Values"][title] = {};
  LiveRC_Config["SpecialLogListConfig"]["liveSuivi"]["Values"][title].ts = "--:--";
  LiveRC_Config["SpecialLogListConfig"]["liveSuivi"]["Values"][title].edits = [];
};


window.removePageFromSuivi = function(title){
  if(typeof(LiveRC_Config["SpecialLogListConfig"]["liveSuivi"]["Values"][title])=="undefined") return
  delete LiveRC_Config["SpecialLogListConfig"]["liveSuivi"]["Values"][title];
};
/*
Hors LiveRC
modifier
 */

// Ajout du bouton de suivi d'utilisateur

window.LiveWatchInitButtons = function(Req, data) {
  var Li = document.getElementById('n-liveRC');
  if(!Li) return;
  var user = data.user;
  var api = Req.responseXML.getElementsByTagName('api')[0];
  if (api.firstChild.nodeName == "error") return;
  LiveRC_getMediawikiDefaultLanguage();
  if(!LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"]) LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"] = {};
  if(!LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"]) LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"] = {};
  var ThisIsContact = false;
  var ThisIsHidden = false;
  var Pages = api.getElementsByTagName('page');
  if(Pages[0] && Pages[0].getAttributeNode('watched')){
    ThisIsContact = true;
    LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"][user] = {};
    LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"][user].ts = "--:--";
    LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"][user].edits = [];
  }
  if(Pages[1] && Pages[1].getAttributeNode('watched')){
    ThisIsHidden = true;
    LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"][user] = {};
    LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"][user].ts = "--:--";
    LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"][user].edits = [];
  }
  var UL = Li.getElementsByTagName('ul')[0];
  if(!UL){
    UL = document.createElement('ul');
    Li.appendChild(UL);
  }
  var ContactLi = document.createElement('li');
  ContactLi.appendChild(lrcCreateWatchUserLink(mw.config.get('wgTitle'), ThisIsContact, 1));
  ContactLi.id = 'n-liveRC-contact';
  var HiddenLi = document.createElement('li');
  HiddenLi.appendChild(lrcCreateHideUserLink(mw.config.get('wgTitle'), ThisIsHidden, 1));
  HiddenLi.id = 'n-liveRC-hidden';
  UL.appendChild(ContactLi);
  UL.appendChild(HiddenLi);

  var Links = Li.getElementsByTagName('a');
  for(var a=1,l=Links.length;a<l;a++){
    var Link = Links[a];
    Link.title = Link.title + ' (LiveRC)';
    Link.className = "";
  }
  lrcDisplayDebug('Add watch/hide links in tools panel : got user status (watched='+ThisIsContact+' ; hidden='+ThisIsHidden+')');
};

/*
Dans LiveRC
modifier
Suivi de page
modifier
 */

// Création du bouton de suivi de page

window.lrcCreateWatchPageLink = function(title, watched, type, trID){
  var UnwatchLinkText = (type ? lrcGetMediawikiMessage("unwatch", true) : lrcMakeText("USER_UNWATCH_SHORT") );
  var WatchLinkText = (type ? lrcGetMediawikiMessage("watch", true) : lrcMakeText("USER_WATCH_SHORT") );
  var WatchLinks = document.createElement('span');
  if(!lrcGetFlowStatusForAction(title, "watch")) return WatchLinks;
  var WatchLinks_UnWatch = document.createElement('span');
  WatchLinks_UnWatch.className = "watchedLink";
  if(!watched) WatchLinks_UnWatch.style.display = "none";
  var UnWatchLink = document.createElement('a');
  if(!type) UnWatchLink.className = "pageunwatchLink";
  UnWatchLink.href = lrcGetUglyPageURL(title,'&action=unwatch');
  UnWatchLink.onclick = function(){
    LiveRC_WatchArticle(title, false, trID);
    lrcToggleWatchLink(this);
    return false;
  };
  UnWatchLink.title = lrcGetMediawikiMessage("unwatch", true) + ' « '+title+' »';
  UnWatchLink.innerHTML = UnwatchLinkText;
  WatchLinks_UnWatch.appendChild(UnWatchLink);
  WatchLinks.appendChild(WatchLinks_UnWatch);
  var WatchLinks_Watch = document.createElement('span');
  WatchLinks_Watch.className = "watchedLink";
  if(watched) WatchLinks_Watch.style.display = "none";
  var WatchLink = document.createElement('a');
  if(!type) WatchLink.className = "pagewatchLink";
  WatchLink.href = lrcGetUglyPageURL(title,'&action=watch');
  WatchLink.onclick = function(){
    LiveRC_WatchArticle(title, true, trID);
    lrcToggleWatchLink(this);
    return false;
  };
  WatchLink.title = lrcGetMediawikiMessage("watch", true) + ' « '+title+' »';
  WatchLink.innerHTML = WatchLinkText;
  WatchLinks_Watch.appendChild(WatchLink);
  WatchLinks.appendChild(WatchLinks_Watch);
  return WatchLinks;
};

// Ajout du bouton de suivi de page

window.LiveRC_WatchArticle = function(page, watch, trid){
  var sothername = lrcGetOtherPagename(page);
  if(watch){
    addPageToSuivi(page);
    if(sothername) addPageToSuivi(sothername);
    watchAPICall(page, true);
  }else{
    removePageFromSuivi(page);
    if(sothername) removePageFromSuivi(sothername);
    watchAPICall(page, false);
  }
  if (trid == null) return;
  var tr = document.getElementById(trid);
  if (tr == null) return;
  if(watch) {
    lrcAddClass(tr, "RcWatched");
  }else{
    lrcRemoveClass(tr, "RcWatched");
  }
};

/*
Suivi d'utilisateur
modifier
 */

window.lrcCreateWatchUserLink = function(user, watched, type, trID){
  var UnwatchLinkText = (type ? lrcGetMediawikiMessage("unwatch", true) : lrcMakeText("USER_UNWATCH_SHORT") );
  var WatchLinkText = (type ? lrcGetMediawikiMessage("watch", true) : lrcMakeText("USER_WATCH_SHORT") );
  var ContactLinks = document.createElement('span');
  var ContactLinks_UnWatch = document.createElement('span');
  ContactLinks_UnWatch.className = "watchedLink";
  if(!watched) ContactLinks_UnWatch.style.display = "none";
  var UnWatchLink = document.createElement('a');
  if(!type) UnWatchLink.className = "userwatchLink";
  UnWatchLink.href = "javascript:;";
  UnWatchLink.onclick = function(){
    LiveRC_WatchUser(user, false, trID);
    lrcToggleWatchLink(this);
    return false;
  };
  UnWatchLink.title = lrcGetMediawikiMessage("unwatch", true) + ' « '+user+' »';
  UnWatchLink.innerHTML = UnwatchLinkText;
  ContactLinks_UnWatch.appendChild(UnWatchLink);
  ContactLinks.appendChild(ContactLinks_UnWatch);
  var ContactLinks_Watch = document.createElement('span');
  ContactLinks_Watch.className = "watchedLink";
  if(watched) ContactLinks_Watch.style.display = "none";
  var WatchLink = document.createElement('a');
  if(!type) WatchLink.className = "userunwatchLink";
  WatchLink.href = "javascript:;";
  WatchLink.onclick = function(){
    LiveRC_WatchUser(user, true, trID);
    lrcToggleWatchLink(this);
    return false;
  };
  WatchLink.title = lrcGetMediawikiMessage("watch", true) + ' « '+user+' »';
  WatchLink.innerHTML = WatchLinkText;
  ContactLinks_Watch.appendChild(WatchLink);
  ContactLinks.appendChild(ContactLinks_Watch);
  return ContactLinks;
};

window.LiveRC_WatchUser = function(uname, watch, trid) {
  var WLitem = LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"][uname];
  var page = 'LiveRCWatch:' + uname;
  if (!WLitem && watch) {
    LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"][uname] = {};
    LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"][uname].ts = "--:--";
    LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"][uname].edits = [];
    watchAPICall(page, true);
  } else if (WLitem && !watch) {
    watchAPICall(page, false);
    delete LiveRC_Config["SpecialLogListConfig"]["liveContact"]["Values"][uname];
  }else{
    return;
  }
  if (trid == null) return;
  var tr = document.getElementById(trid);
  if (tr == null) return;
  if(watch) {
    lrcAddClass(tr, "RcContact");
  }else{
    lrcRemoveClass(tr, "RcContact");
  }
};

/*
Masquage d'utilisateur
modifier
 */

window.lrcCreateHideUserLink = function(user, hidden, type, trID){
  var UnhideLinkText = (type ? lrcGetMediawikiMessage("show", true) : lrcMakeText("USER_UNHIDE_SHORT") );
  var HideLinkText = (type ? lrcGetMediawikiMessage("hide", true) : lrcMakeText("USER_HIDE_SHORT") );
  var HiddenLinks = document.createElement('span');
  var HiddenLinks_UnHide = document.createElement('span');
  HiddenLinks_UnHide.className = "watchedLink";
  if(!hidden) HiddenLinks_UnHide.style.display = "none";
  var UnHideLink = document.createElement('a');
  if(!type) UnHideLink.className = "userhideLink";
  UnHideLink.href = "javascript:;";
  UnHideLink.onclick = function(){
    LiveRC_HideUser(user, false, trID);
    lrcToggleWatchLink(this);
    return false;
  };
  UnHideLink.title = lrcGetMediawikiMessage("show") + ' « '+user+' »';
  UnHideLink.innerHTML = UnhideLinkText;
  HiddenLinks_UnHide.appendChild(UnHideLink);
  HiddenLinks.appendChild(HiddenLinks_UnHide);

  var HiddenLinks_Hide = document.createElement('span');
  HiddenLinks_Hide.className = "watchedLink";
  if(hidden) HiddenLinks_Hide.style.display = "none";
  var HideLink = document.createElement('a');
  if(!type) HideLink.className = "userhideLink";
  HideLink.href = "javascript:;";
  HideLink.onclick = function(){
    LiveRC_HideUser(user, true, trID);
    lrcToggleWatchLink(this);
    return false;
  };
  HideLink.title = lrcGetMediawikiMessage("hide") + ' « '+user+' »';
  HideLink.innerHTML = HideLinkText;
  HiddenLinks_Hide.appendChild(HideLink);
  HiddenLinks.appendChild(HiddenLinks_Hide);
  return HiddenLinks;
};


window.LiveRC_HideUser = function(uname, hide, trid) {
  var WLitem = LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"][uname];
  var page = 'LiveRCHidden:' + uname;
  if (!WLitem && hide) {
    LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"][uname] = {};
    LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"][uname].ts = "--:--";
    LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"][uname].edits = [];
    watchAPICall(page, true);
  } else if (WLitem && !hide) {
    watchAPICall(page, false);
    delete LiveRC_Config["SpecialLogListConfig"]["liveHidden"]["Values"][uname];
  }
  if(trid == null) return;
  var tr = document.getElementById(trid);
  if(tr == null) return;
  if(hide){
    supprLigne(tr.id);
  }
};

/*
Masquage de page
modifier
 */

window.lrcCreateHidePageLink = function(title, hidden, type, trID){
  var UnhideLinkText = (type ? lrcGetMediawikiMessage("show", true) : lrcMakeText("USER_UNHIDE_SHORT") );
  var HideLinkText = (type ? lrcGetMediawikiMessage("hide", true) : lrcMakeText("USER_HIDE_SHORT") );
  var HiddenLinks = document.createElement('span');
  var HiddenLinks_UnHide = document.createElement('span');
  HiddenLinks_UnHide.className = "watchedLink";
  if(!hidden) HiddenLinks_UnHide.style.display = "none";
  var UnHideLink = document.createElement('a');
  if(!type) UnHideLink.className = "pagehideLink";
  UnHideLink.href = "javascript:;";
  UnHideLink.onclick = function(){
    LiveRC_HidePage(title, false, trID);
    lrcToggleWatchLink(this);
    return false;
  };
  UnHideLink.title = lrcGetMediawikiMessage("show") + ' « '+title+' »';
  UnHideLink.innerHTML = UnhideLinkText;
  HiddenLinks_UnHide.appendChild(UnHideLink);
  HiddenLinks.appendChild(HiddenLinks_UnHide);

  var HiddenLinks_Hide = document.createElement('span');
  HiddenLinks_Hide.className = "watchedLink";
  if(hidden) HiddenLinks_Hide.style.display = "none";
  var HideLink = document.createElement('a');
  if(!type) HideLink.className = "pagehideLink";
  HideLink.href = "javascript:;";
  HideLink.onclick = function(){
    LiveRC_HidePage(title, true, trID);
    lrcToggleWatchLink(this);
    return false;
  };
  HideLink.title = lrcGetMediawikiMessage("hide") + ' « '+title+' »';
  HideLink.innerHTML = HideLinkText;
  HiddenLinks_Hide.appendChild(HideLink);
  HiddenLinks.appendChild(HiddenLinks_Hide);
  return HiddenLinks;
};


window.LiveRC_HidePage = function(title, hide, trid) {
  var WLitem = LiveRC_Config["SpecialLogListConfig"]["liveHiddenPages"]["Values"][title];
  var page = 'LiveRCHiddenPage:' + title;
  if (!WLitem && hide) {
    LiveRC_Config["SpecialLogListConfig"]["liveHiddenPages"]["Values"][title] = {};
    LiveRC_Config["SpecialLogListConfig"]["liveHiddenPages"]["Values"][title].ts = "--:--";
    LiveRC_Config["SpecialLogListConfig"]["liveHiddenPages"]["Values"][title].edits = [];
    watchAPICall(page, true);
  } else if (WLitem && !hide) {
    watchAPICall(page, false);
    delete LiveRC_Config["SpecialLogListConfig"]["liveHiddenPages"]["Values"][title];
  }
  if(trid == null) return;
  var tr = document.getElementById(trid);
  if(tr == null) return;
  if(hide){
    supprLigne(tr.id);
  }
};


/*
Remise à zéro des notificationtimestamp
modifier
 */

window.RAZnotificationtimestamps = function(){
  for(var title in LiveRC_Config["Notificationtimestamp"]){
    var timestamp = LiveRC_Config["Notificationtimestamp"][title];
    if(!timestamp) continue;
    var URL = lrcGetAPIURL({format:'xml',action:'query',prop:'info',meta:'tokens',type:'csrf',inprop:'notificationtimestamp',titles:title});
    wpajax.http({ url: URL,
                onSuccess: RAZthisnotificationtimestamp,
                title: title,
                timestamp:timestamp
    });
  }
};

window.RAZthisnotificationtimestamp = function(Req, data){
  var title = data.title;
  var timestamp = data.timestamp;

  var Page = Req.responseXML.getElementsByTagName("page")[0];
  var notificationtimestamp = encodeURIComponent(Page.getAttribute("notificationtimestamp"));
  if(notificationtimestamp == timestamp) return;
  var EditParam = {};
  EditParam["titles"] = title;
  EditParam["timestamp"] = timestamp;
  EditParam["converttitles"] = "1";
  EditParam["token"] = Req.responseXML.getElementsByTagName('tokens')[0].getAttribute('csrftoken');
  var Params = [];
  for(var Param in EditParam){
    Params.push(Param+"="+encodeURIComponent(EditParam[Param]));
  }
  Params = Params.join("&");
  var headers = {'Content-Type':'application/x-www-form-urlencoded'};
  wpajax.http({ url: lrcGetAPIURL({action:'setnotificationtimestamp'}),
                  method: "POST", headers: headers,
                  onSuccess:RAZthisnotificationtimestampDone,
                  data: Params,
                  editparams:EditParam
  });
};

window.RAZthisnotificationtimestampDone = function(Req, data){
  var title = data.editparams["titles"];
  var ts = data.editparams["timestamp"];
  var translatedts = tsToDate(ts)+' '+tsToHhMm(ts);
  lrcDisplayDebug("notificationtimestamp reset for page "+title+" done ("+translatedts+")");
  delete LiveRC_Config["Notificationtimestamp"][title];
};

/*

Horloges

modifier
 */

window.lrcSetClocks = function(){
  var ClockSpanTitle = document.getElementById('ClockSpanTitle');
  if(ClockSpanTitle){
    ClockSpanTitle.className="RunningClock";
    var Link = ClockSpanTitle.parentNode;
    if(Link){
      Link.href= "javascript:lrcToggleClockState('ClockSpanTitle');";
      Link.title= lrcMakeText("CLOCKTITLE");
      lrcClockTimer("ClockSpanTitle");
    }
  }
};

window.lrcClockTimer = function(ID){
  var Now = new Date();
  var Heures = Now.getHours();
  var Minutes = Now.getMinutes();
  var Secondes = Now.getSeconds();
  LiveRC_Config["ClockTime"]["H"] = Heures;
  LiveRC_Config["ClockTime"]["M"] = Minutes;
  LiveRC_Config["ClockTime"]["S"] = Secondes;
  if(ID){
    var ClockSpan = document.getElementById(ID);
    if(ClockSpan){
      if(lrcHasClass(ClockSpan, "RunningClock")){
        ClockSpan.innerHTML =  (Heures < 10 ? '0' : '') + Heures + ':' + (Minutes < 10 ? '0' : '') + Minutes + ':' + (Secondes<10 ? '0' : '') + Secondes;
      }
    }
  }
  if(LiveRC_Config["Timeout"][("Clock_"+ID)]) clearTimeout(LiveRC_Config["Timeout"][("Clock_"+ID)]);
  LiveRC_Config["Timeout"][("Clock_"+ID)] = setTimeout("lrcClockTimer("+lrcEscapeStr(ID)+");", 1000);
};

window.lrcToggleClockState = function(ID){
  var ClockSpan = document.getElementById(ID);
  if(!ClockSpan) return;
  if(lrcHasClass(ClockSpan, "RunningClock")){
    lrcRemoveClass(ClockSpan, "RunningClock");
    lrcAddClass(ClockSpan, "FrozenClock");
  }else{
    lrcRemoveClass(ClockSpan, "FrozenClock");
    lrcAddClass(ClockSpan, "RunningClock");
  }
};

window.LiveRC_CreateTimer = function(){
  var TimerTD = document.getElementById("LiveRCTimer");
  if(!TimerTD) return;
  var Buttons = document.getElementById("LiveRCButtons");
  if(Buttons) TimerTD.style.width = Buttons.offsetWidth + "px";
  if(!lrcMakeParam("ShowTimer")) return;
  var divtimer = document.createElement('div');
  divtimer.id = "lrctimecount";
  divtimer.className = "lrctimecount";
  var tenhour = document.createElement('div');
  tenhour.className = "lrctimecountelement tenhours";
  var hour = document.createElement('div');
  hour.className = "lrctimecountelement hours";
  var tenminut = document.createElement('div');
  tenminut.className = "lrctimecountelement tenminuts";
  var minut = document.createElement('div');
  minut.className = "lrctimecountelement minuts";
  var tensecond = document.createElement('div');
  tensecond.className = "lrctimecountelement tenseconds";
  var second = document.createElement('div');
  second.className = "lrctimecountelement seconds";
  divtimer.appendChild(tenhour);
  divtimer.appendChild(hour);
  divtimer.appendChild(document.createTextNode(' '));
  divtimer.appendChild(tenminut);
  divtimer.appendChild(minut);
  divtimer.appendChild(document.createTextNode(' '));
  divtimer.appendChild(tensecond);
  divtimer.appendChild(second);
  TimerTD.appendChild(divtimer);
  var Now = new Date();
  var H = Now.getHours();
  var M = Now.getMinutes();
  var S = Now.getSeconds();
  var TH =  Math.floor(H/10);
  H = H - (TH * 10);
  var TM =  Math.floor(M/10);
  M = M - (TM * 10);
  var TS =  Math.floor(S/10);
  S = S - (TS * 10);
  LiveRC_Config["TimerInitialValues"] = {Global:Now.getTime(), TH:TH, H:H, TM:TM, M:M, TS:TS, S:S};
  lrcSetTimer();
};

window.lrcSetTimer = function(){
  var divtimer = document.getElementById("lrctimecount");
  if(!divtimer) return;
  var InitialValues = LiveRC_Config["TimerInitialValues"];
  var Now = new Date().getTime();
  var time = Now - InitialValues["Global"];
  var TH = Math.floor(time/36000000);
  time = time - (TH*36000000);
  var H = Math.floor(time/3600000);
  time = time - ( H*3600000);
  var TM = Math.floor(time/600000);
  time = time - (TM*600000);
  var M = Math.floor(time/60000);
  time = time - ( M*60000);
  var TS = Math.floor(time/10000);
  time = time - (TS*10000);
  var S = Math.floor(time/1000);
  var tenhour = divtimer.querySelector("div.tenhours");
  var hour = divtimer.querySelector("div.hours");
  var tenminut = divtimer.querySelector("div.tenminuts");
  var minut = divtimer.querySelector("div.minuts");
  var tensecond = divtimer.querySelector("div.tenseconds");
  var second = divtimer.querySelector("div.seconds");
  if(TH != InitialValues["TH"]){
    lrcSetTimerElement(tenhour, TH);
    LiveRC_Config["TimerInitialValues"]["TH"] = TH;
  }
  if(H != InitialValues["H"]){
    lrcSetTimerElement(hour, H);
    LiveRC_Config["TimerInitialValues"]["H"] = H;
  }
  if(TM != InitialValues["TM"]){
    lrcSetTimerElement(tenminut, TM);
    LiveRC_Config["TimerInitialValues"]["TM"] = TM;
  }
  if(M != InitialValues["M"]){
    lrcSetTimerElement(minut, M);
    LiveRC_Config["TimerInitialValues"]["M"] = M;
  }
  if(TS != InitialValues["TS"]){
    lrcSetTimerElement(tensecond, TS);
    LiveRC_Config["TimerInitialValues"]["TS"] = TS;
  }
  if(S != InitialValues["S"]){
    lrcSetTimerElement(second, S);
    LiveRC_Config["TimerInitialValues"]["S"] = S;
  }
  if(LiveRC_Config["Timeout"]["Timer"]) clearTimeout(LiveRC_Config["Timeout"]["Timer"]);
  LiveRC_Config["Timeout"]["Timer"] = setTimeout(function(){ lrcSetTimer(); }, 1000 );
};

window.lrcSetTimerElement = function(el, val){
  if(!el) return;
  var posX = (Math.round(10*(-12.5 * val))/10);
  var posY = 0;
  el.style.backgroundPosition = posX+"px "+posY+"px";
};

/*

Zones de déplacement et redimensionnement

modifier
 */

// Détermination de la hauteur de l'écran

window.LiveRC_GetScreenHeight = function(){
     return window.innerHeight;
};

// Détermination de la largeur de l'écran

window.LiveRC_GetScreenWidth = function(){
     return window.innerWidth;
};

// Détermination du positionnement de la souris

window.LiveRC_GetMousePosition = function(event){
     return { "X": parseInt(event.clientX), "Y": parseInt(event.clientY) };
};

// Mise en place d'une zone de déplacement

window.LiveRC_SetMoveZone = function(anchorNode, elementsToMove){
     if((!anchorNode)||(!elementsToMove)) return;
     anchorNode.onmousedown = function(event){
          if(!event) { event = window.event; }
          var PositionSouris = LiveRC_GetMousePosition(event);
          for(var a=0;a<elementsToMove.length;a++){
               elementsToMove[a].initialX = parseInt( PositionSouris["X"] - elementsToMove[a].offsetLeft);
               elementsToMove[a].initialY = parseInt( PositionSouris["Y"] - elementsToMove[a].offsetTop);
          }
          lrcAddClass(document.body, "MouseMoveFunctionRunning");
          document.body.onmousemove = function(event) {
               if(!event) { event = window.event; }
               PositionSouris = LiveRC_GetMousePosition(event);
               for(var a=0;a<elementsToMove.length;a++){
                    var Element = elementsToMove[a];
                    if(!Element) continue;
                    var PositionGauche = parseInt( PositionSouris["X"] ) - Element.initialX;
                    var PositionHaut = parseInt(PositionSouris["Y"] ) - Element.initialY;
                    Element.style.left = PositionGauche + 'px';
                    Element.style.top = PositionHaut + 'px';
                    Element.style.right = '';
                    Element.style.bottom = '';
               }
          };
          document.body.onmouseup=function(event){
               document.body.onmousemove = null;
               document.body.onmouseup = null;
               lrcRemoveClass(document.body, "MouseMoveFunctionRunning");
          };
     }
     anchorNode.style.cursor = "move";
};

// Mise en place d'une zone de redimensionnement vertical

window.LiveRC_SetVerticalResizeZone = function(anchorNode, ToResizeNodes, containerNode, invert){
     if((!anchorNode)||(!ToResizeNodes)) return;
     invert = (invert===true ? -1 : 1);
     anchorNode.onmousedown = function(event){
          if(!event) { event = window.event; }
          var positionSouris_Y = (LiveRC_GetMousePosition(event)["Y"] * invert);
          var MaxHeight = LiveRC_GetScreenHeight();
          for(var a=0;a<ToResizeNodes.length;a++){
               ToResizeNodes[a].initialHeight = parseInt( (MaxHeight-positionSouris_Y) - ToResizeNodes[a].offsetHeight );
          }
          lrcAddClass(document.body, "MouseMoveFunctionRunning");
          document.body.onmousemove=function(event) {
               if(!event) { event = window.event; }
               var positionSouris_Y = (LiveRC_GetMousePosition(event)["Y"] * invert);
               var MaxHeight = LiveRC_GetScreenHeight();
               var HeightLimit = false;
               for(var a=0;a<ToResizeNodes.length;a++){
                    var NewHeight = parseInt((MaxHeight-positionSouris_Y) - ToResizeNodes[a].initialHeight);
                    if(NewHeight>MaxHeight) HeightLimit = true;
               }
               if(HeightLimit) return;
               for(var a=0;a<ToResizeNodes.length;a++){
                    var Element = ToResizeNodes[a];
                    if(!Element) continue;
                    var NewHeight = parseInt((MaxHeight-positionSouris_Y) - Element.initialHeight);
                    NewHeight = (NewHeight>0 ? NewHeight : 1);
                    if(Element.tagName && (Element.tagName.toLowerCase()=="iframe" || Element.tagName.toLowerCase()=="img")){
                         Element.height = NewHeight;
                    }else{
                         Element.style.height = NewHeight + 'px';
                    }
               }
               lrcInitTableHeight();

          };
          document.body.onmouseup = function(event) {
               document.body.onmousemove = null;
               document.body.onmouseup = null;
               lrcRemoveClass(document.body, "MouseMoveFunctionRunning");
          };
     };
     lrcaddCustomizableClasses(anchorNode, "LiveRC_MenuAnchor");
     lrcAddClass(containerNode, "LiveRC_MenuContainer");
     anchorNode.style.cursor = "n-resize";
};

// Mise en place d'une zone de redimensionnement total

window.LiveRC_SetTotalResizeZone = function(anchorNode, elementsToResize, Container){
  if((!anchorNode)||(!elementsToResize)) return;
  if(!LiveRC_Config["TotalResize"]) LiveRC_Config["TotalResize"] = [];
  var ID = Container.id;
  if(!ID) return;
  LiveRC_Config["TotalResize"][ID] = [];
  LiveRC_Config["TotalResize"][ID].initialWidthDiffs = [];
  LiveRC_Config["TotalResize"][ID].initialHeightDiffs  = [];
  for(var a=0;a<elementsToResize.length;a++){
    var element = elementsToResize[a];
    LiveRC_Config["TotalResize"][ID].initialWidthDiffs[a] = ( Container.offsetWidth - element.offsetWidth );
    LiveRC_Config["TotalResize"][ID].initialHeightDiffs[a] = ( Container.offsetHeight - element.offsetHeight );
  }
  anchorNode.onmousedown = function(event){
    if(!event) { event = window.event; }
    var PositionSouris = LiveRC_GetMousePosition(event);
    Container.initialWidth = ( PositionSouris["X"] - Container.offsetWidth ) ;
    Container.initialHeight = ( PositionSouris["Y"] - Container.offsetHeight ) ;
    Container.style.top = Container.offsetTop + 'px';
    Container.style.left = Container.offsetLeft + 'px';
    Container.style.right = '';
    Container.style.bottom = '';
    lrcAddClass(document.body, "MouseMoveFunctionRunning");
    document.body.onmousemove = function(event) {
      if(!event) { event = window.event; }
      var PositionSouris = LiveRC_GetMousePosition(event);
      var NewWidth = ( PositionSouris["X"] - Container.initialWidth );
      var NewHeight = ( PositionSouris["Y"] - Container.initialHeight );
      Container.style.width = parseInt( NewWidth ) + 'px';
      Container.style.height = parseInt( NewHeight ) + 'px';
      for(var a=0;a<elementsToResize.length;a++){
        var Element = elementsToResize[a];
        if(!Element) continue;
        var NewElementWidth = parseInt( NewWidth - LiveRC_Config["TotalResize"][(Container.id)].initialWidthDiffs[a] );
        var NewElementHeight = parseInt( NewHeight - LiveRC_Config["TotalResize"][(Container.id)].initialHeightDiffs[a] );
        NewElementWidth = (NewElementWidth > 0 ? NewElementWidth : 1);
        NewElementHeight = (NewElementHeight > 0 ? NewElementHeight : 1);
        if(Element.tagName && (Element.tagName.toLowerCase()=="iframe" || Element.tagName.toLowerCase()=="img")){
          Element.width  = NewElementWidth + 'px';
          Element.height = NewElementHeight + 'px';
        }else{
          Element.style.width  = NewElementWidth + 'px';
          Element.style.height = NewElementHeight + 'px';
        }
      }
    };
    document.body.onmouseup = function(event) {
      document.body.onmousemove = null;
      document.body.onmouseup = null;
      lrcRemoveClass(document.body, "MouseMoveFunctionRunning");
    };
  };
  anchorNode.style.cursor = "se-resize";
};

/*

Suggestions

modifier
 */

window.LiveRC_Suggest_UpDateLabel = function(InputNode, NewID){
     var OldId = InputNode.id;
     var TheNode = InputNode.parentNode;
     if(!OldId || !TheNode) return;
     var Labels = TheNode.getElementsByTagName('label');
     for(var a=0,l=Labels.length;a<l;a++){
          var For = Labels[a].getAttribute("for");
          if(For){
               if(For == OldId){
                    Labels[a].setAttribute("for", NewID);
                    return;
               }
          }
     }
};

window.LiveRC_Suggest_GetSuggestionIndex = function( Element ){
    return parseInt(Element.id.replace(/[^0-9]/g, ""));
};

window.LiveRC_Suggest_ucFirst = function(Text, Namespace) {
    if(LiveRC_Config["MediawikiNamespaces"][Namespace]["case"] === "first-letter"){
        Text = Text.substr(0,1).toUpperCase() + Text.substr(1,Text.length);
    }
    return Text;
};

window.LiveRC_Suggest_setVar = function(Args, id) {
    if(typeof(Args[id])!="undefined") return Args[id];
    return LiveRC_Config["SuggestParams"][id][0];
};

/*
Suggestions de page
modifier
 */

window.LiveRC_Suggest_AddPageSuggestion = function(Args){
     if(!Args) return;
     var InputNode = Args["InputNode"];
     if(!InputNode) return;
     var GlobalIndex = LiveRC_Config["SuggestParams"]["Index"]++;
     var NSFilter = LiveRC_Suggest_setVar(Args, "NSFilter");
     var StripNS = LiveRC_Suggest_setVar(Args, "StripNS");
     var SuggestLimit = LiveRC_Suggest_setVar(Args, "SuggestLimit");
     var SuggestListSize = LiveRC_Suggest_setVar(Args, "SuggestSelectLimit");
     var AddExist = LiveRC_Suggest_setVar(Args, "AddExist");
     var ListDown = LiveRC_Suggest_setVar(Args, "ListDown");
     var Prefix = LiveRC_Suggest_setVar(Args, "Prefix");
     var Suffix = LiveRC_Suggest_setVar(Args, "Suffix");
     var RedirectFilter = LiveRC_Suggest_setVar(Args, "RedirectFilter");
     LiveRC_Suggest_UpDateLabel(InputNode, "InputWithSuggestion_"+GlobalIndex);
     InputNode.id = "InputWithSuggestion_"+GlobalIndex;
     var ExistInputNode = document.createElement("input");
     ExistInputNode.type = "hidden";
     ExistInputNode.id = "ThisPageExist_"+GlobalIndex;
     ExistInputNode.value = "0";
     InputNode.parentNode.insertBefore(ExistInputNode, InputNode.nextSibling);
     if(AddExist===true){
          var ExistImgNode = document.createElement("span");
          ExistImgNode.id = "ThisPageExistIMG_"+GlobalIndex;
          ExistImgNode.className = "SuggestionExist";
          ExistImgNode.innerHTML = lrcMakeIcon("SuggestNoExistIcon").split("$1").join("").split("  ").join(" ");
          InputNode.parentNode.insertBefore(ExistImgNode, InputNode.nextSibling);
     }
     var SelectNode = document.createElement('select');
     SelectNode.id = "SuggestionForInput_"+GlobalIndex;
     SelectNode.style.display = "none";
     SelectNode.className = "SuggestionList";
     InputNode.parentNode.insertBefore(SelectNode, InputNode.nextSibling);
     LiveRC_Config["SuggestParams"]["Input"][GlobalIndex] = InputNode;
     LiveRC_Config["SuggestParams"]["Suggest"][GlobalIndex] = SelectNode;
          LiveRC_Config["SuggestParams"]["ExistInput"][GlobalIndex] = ExistInputNode;
     if(AddExist===true){
          LiveRC_Config["SuggestParams"]["ExistImg"][GlobalIndex] = ExistImgNode;
     }
     LiveRC_Config["SuggestParams"]["NSFilter"][GlobalIndex] = NSFilter;
     if(!NSFilter) StripNS = false;
     if(Prefix){
          if(NSFilter){
               var ThisNamespaceName = lrcGetNamespaceName(NSFilter);
               var Match = new RegExp("^"+ThisNamespaceName+":", "ig");
               if(Prefix.match(Match)!=null){
                    Prefix = Prefix.substring((ThisNamespaceName=="" ? "" : ThisNamespaceName+":").length, Prefix.length);
               }
               StripNS = true;
          }
     }
     LiveRC_Config["SuggestParams"]["NSFilter"][GlobalIndex] = NSFilter;
     LiveRC_Config["SuggestParams"]["StripNS"][GlobalIndex] = StripNS;
     LiveRC_Config["SuggestParams"]["Prefix"][GlobalIndex] = Prefix;
     LiveRC_Config["SuggestParams"]["Suffix"][GlobalIndex] = Suffix;
     LiveRC_Config["SuggestParams"]["SuggestLimit"][GlobalIndex] = SuggestLimit;
     LiveRC_Config["SuggestParams"]["SuggestSelectLimit"][GlobalIndex] = SuggestListSize;
     LiveRC_Config["SuggestParams"]["ListDown"][GlobalIndex] = ListDown;
     LiveRC_Config["SuggestParams"]["AddExist"][GlobalIndex] = AddExist;
     LiveRC_Config["SuggestParams"]["RedirectFilter"][GlobalIndex] = RedirectFilter;
     LiveRC_Config["SuggestParams"]["IsRunning"][GlobalIndex] = false;
     InputNode.onkeyup = function(){
          var ThisIndex = LiveRC_Suggest_GetSuggestionIndex(this);
          LiveRC_Suggest_GetPageSuggestions(ThisIndex);
     };
     return GlobalIndex;
};

window.LiveRC_Suggest_GetPageSuggestions = function(Index){
     var IsRunning = LiveRC_Config["SuggestParams"]["IsRunning"][Index];
     if(IsRunning===true) return;
     var NamespaceFilter = LiveRC_Config["SuggestParams"]["NSFilter"][Index];
     var StripNamespace = LiveRC_Config["SuggestParams"]["StripNS"][Index];
     var Limit = LiveRC_Config["SuggestParams"]["SuggestLimit"][Index];
     var Select = LiveRC_Config["SuggestParams"]["Suggest"][Index];
     var Input = LiveRC_Config["SuggestParams"]["Input"][Index];
     var Prefix = LiveRC_Config["SuggestParams"]["Prefix"][Index];
     var Suffix = LiveRC_Config["SuggestParams"]["Suffix"][Index];
     var RedirectFilter = LiveRC_Config["SuggestParams"]["RedirectFilter"][Index];
     var Page = Input.value;
     if(Page===""){
          Select.style.display = "none";
          return;
     }
     var ValueNamespace = (NamespaceFilter ? NamespaceFilter : getNamespaceInfoFromPage(Prefix+Page));
     var ValuePageName = getNamespaceInfoFromPage(Page, "PageName");
     if(StripNamespace && NamespaceFilter && !Prefix){
          var ThisNamespaceName = lrcGetNamespaceName(NamespaceFilter);
          var Match = new RegExp("^"+ThisNamespaceName+":", "ig");
          if(Page.match(Match)!=null){ Page = ValuePageName; }
          var ThisCanonicalNamespaceName = lrcGetNamespaceName(NamespaceFilter, true);
          var CanonicalMatch = new RegExp("^"+ThisCanonicalNamespaceName+":", "ig");
          if(Page.match(CanonicalMatch)!=null){ Page = LiveRC_Suggest_ucFirst(ValuePageName, NamespaceFilter); }
          Input.value = LiveRC_Suggest_ucFirst(Page, NamespaceFilter);
     }else if(Prefix && NamespaceFilter){
          Match = new RegExp("^"+Prefix, "ig");
          if(Page.match(Match)!=null){
               Page = Page.substring(Prefix.length, Page.length);
          }
          Page = Prefix+Page;
     }else if(Prefix && !NamespaceFilter){
          ValueNamespace = getNamespaceInfoFromPage((Prefix+Page),"NamespaceNumber");
          Page = getNamespaceInfoFromPage((Prefix+Page), "PageName");
     }else if(!Prefix && !NamespaceFilter){
          ValueNamespace = getNamespaceInfoFromPage(Page,"NamespaceNumber");
          Page = getNamespaceInfoFromPage(Page, "PageName");
          Input.value = lrcGetNamespaceName(ValueNamespace)+(ValueNamespace ? ":" : "") + LiveRC_Suggest_ucFirst(Page, ValueNamespace);
     }
     LiveRC_Config["SuggestParams"]["IsRunning"][Index] = true;
     var APILimit = LiveRC_Config["UserInfos"].APIlimit;
     if(Limit>APILimit) Limit = APILimit;
     var URL =  lrcGetAPIURL({format:'xml',action:'query',list:'allpages',apnamespace:ValueNamespace,apprefix:Page,apfilterredir:RedirectFilter,aplimit:Limit});
     wpajax.http({url:URL,
                  onSuccess:LiveRC_Suggest_GetPageSuggestionsDone,
                  index: Index
     });
};

window.LiveRC_Suggest_GetPageSuggestionsDone = function(Req, data){
     var Index = data.index;
     var NamespaceFilter = LiveRC_Config["SuggestParams"]["NSFilter"][Index];
     var StripNamespace = LiveRC_Config["SuggestParams"]["StripNS"][Index];
     var Limit = LiveRC_Config["SuggestParams"]["SuggestLimit"][Index];
     var Select = LiveRC_Config["SuggestParams"]["Suggest"][Index];
     var Input = LiveRC_Config["SuggestParams"]["Input"][Index];
     var Prefix = LiveRC_Config["SuggestParams"]["Prefix"][Index];
     var Suffix = LiveRC_Config["SuggestParams"]["Suffix"][Index];
     var RedirectFilter = LiveRC_Config["SuggestParams"]["RedirectFilter"][Index];
     var xml = Req.responseXML ;
     if ( xml == null ) return ;
     var titles = new Array () ;
     var pages = xml.getElementsByTagName("p") ;
     for(var i=0;i<pages.length;i++){
          var s = pages[i].getAttribute("title");
          if(Suffix){
               var Reg = new RegExp(Suffix+"$", "g");
               if(s.match(Reg)==null) continue;
          }
          if(StripNamespace){
               var ThisNamespaceName = lrcGetNamespaceName(NamespaceFilter);
               var Match = new RegExp("^"+ThisNamespaceName+":", "ig");
               if(s.match(Match)!=null){
                    s = getNamespaceInfoFromPage(s, "PageName");
               }
               var CanonicalThisNamespaceName = lrcGetNamespaceName(NamespaceFilter, true);
               var Cani=onicalMatch = new RegExp("^"+CanonicalThisNamespaceName+":", "ig");
               if(s.match(Cani=onicalMatch)!=null){
                    s = getNamespaceInfoFromPage(s, "PageName");
               }
          }
          if(Prefix){
               s = s.substring(s.indexOf(Prefix)+Prefix.length, s.length);
          }
          if(titles.indexOf(s)==-1) titles.push(s);
     }
     LiveRC_Config["SuggestParams"]["IsRunning"][Index] = false;
     LiveRC_Suggest_ShowPageSuggestions(titles, Index);
};

window.LiveRC_Suggest_ShowPageSuggestions = function(titles, Index){
     var Select = LiveRC_Config["SuggestParams"]["Suggest"][Index];
     var Input = LiveRC_Config["SuggestParams"]["Input"][Index];
     var ExistInputNode = LiveRC_Config["SuggestParams"]["ExistInput"][Index];
     var ExistImgNode = LiveRC_Config["SuggestParams"]["ExistImg"][Index];
     var ListDown = LiveRC_Config["SuggestParams"]["ListDown"][Index];
     var NamespaceFilter = LiveRC_Config["SuggestParams"]["NSFilter"][Index];
     var Prefix = LiveRC_Config["SuggestParams"]["Prefix"][Index];
     var TheNamespace = "";
     if(NamespaceFilter!==false){
          TheNamespace = lrcGetNamespaceName(NamespaceFilter);
          TheNamespace = (TheNamespace ==="" ? "" : TheNamespace+":");
     }
     if(Prefix){
          TheNamespace += Prefix;
     }
     var CurrentValue = Input.value;
     if(ExistInputNode) ExistInputNode.value = "0";
     if(ExistImgNode){
          ExistImgNode.innerHTML = lrcMakeIcon("SuggestNoExistIcon").split("$1").join(TheNamespace+CurrentValue);
     }
     if(titles.length==0){
          Select.style.display = "none" ;
          Input.title = "";
          return;
     }
     Select.style.display = "inline" ;
     if(ExistInputNode) ExistInputNode.value = "1";
     if(ExistImgNode){
          ExistImgNode.innerHTML = lrcMakeIcon("SuggestExistIcon").split("$1").join(TheNamespace+CurrentValue);
     }
     if(titles[0]===Input.value){
          Select.style.display = "none" ;
          Input.title = "";
          return;
     }
     var TailleListe = LiveRC_Config["SuggestParams"]["SuggestSelectLimit"][Index];
     if (titles.length < TailleListe ) TailleListe = titles.length;
     Select.size = TailleListe ;
     Select.style.align = "left" ;
     Select.style.zIndex = LiveRC_Config["SuggestParams"]["ZIndex"]++ ;
     Select.style.position = "relative" ;
     Select.style.width = Input.offsetWidth + "px" ;
     Select.style.height = (TailleListe * 20) + "px" ;
     while(Select.firstChild) Select.removeChild(Select.firstChild);
     for ( var i = 0 ; i < titles.length ; i++ ) {
          var opt = document.createElement("option");
          var ot = document.createTextNode(titles[i]);
          opt.appendChild(ot) ;
          opt.value = titles[i];
          Select.appendChild(opt) ;
     }
     Select.onkeyup = LiveRC_Suggest_ReplacePageSuggestionsKeyPress;
     Select.onclick = LiveRC_Suggest_ReplacePageSuggestions;
     if(ListDown){
          Select.style.top = parseInt(Input.offsetHeight) + "px";
          Select.style.marginBottom = "-" + ((TailleListe * 20) + parseInt(Input.offsetHeight)) + "px" ;
     }else{
          Select.style.marginTop = "-" + (TailleListe * 20) + "px" ;
     }
     Select.style.marginLeft = "-" + Input.offsetWidth + "px" ;
     var suggestion = titles[0] ;
     if(suggestion.match(new RegExp("^"+CurrentValue))==null){
          LiveRC_Suggest_GetPageSuggestions(Index);
          return;
     }
     var StripNamespace = LiveRC_Config["SuggestParams"]["StripNS"][Index];
     var CurrentValueLength = CurrentValue.length;
     if(StripNamespace){
          var NamespaceName = getNamespaceInfoFromPage(CurrentValue,"NamespaceName");
          NamespaceName = ( NamespaceName==="" ? "" : NamespaceName+":");
          if(NamespaceName==TheNamespace){
               CurrentValueLength = getNamespaceInfoFromPage(CurrentValue,"PageName").length + TheNamespace.length;
          }
     }else if(NamespaceFilter!==false && !Prefix){
          var NamespaceName = getNamespaceInfoFromPage(CurrentValue,"NamespaceName");
          NamespaceName = ( NamespaceName==="" ? "" : NamespaceName+":");
          if(NamespaceName==TheNamespace){
               CurrentValueLength = getNamespaceInfoFromPage(CurrentValue,"PageName").length + TheNamespace.length;
          }else{
               CurrentValueLength = CurrentValueLength  + TheNamespace.length;
          }
     }
     //alert("CurrentValueLength : "+CurrentValueLength+"\nsuggestion.length : "+suggestion.length);
     Input.value = suggestion;
     Input.title = TheNamespace + suggestion;
     if (Input.createTextRange) {
          var ra = Input.createTextRange();
          ra.moveStart("character", CurrentValueLength);
          ra.moveEnd("character", suggestion.length);
          ra.select();
     } else if( Input.setSelectionRange ) {
          Input.setSelectionRange( CurrentValueLength, suggestion.length );
     } else {
          Input.selectionStart = CurrentValueLength;
          Input.selectionEnd = suggestion.length ;
     }
     if(ExistImgNode){
          CurrentValue = Input.value;
          ExistImgNode.innerHTML = lrcMakeIcon("SuggestExistIcon").split("$1").join(TheNamespace+CurrentValue);
     }
};

window.LiveRC_Suggest_ReplacePageSuggestionsKeyPress = function(e){
     if (!e) e = window.event;
     if (e.keyCode != 13) return;
     LiveRC_Suggest_ReplacePageSuggestions();
};

window.LiveRC_Suggest_ReplacePageSuggestions = function(){
     var Index = LiveRC_Suggest_GetSuggestionIndex(this);
     var Select = LiveRC_Config["SuggestParams"]["Suggest"][Index];
     var Input = LiveRC_Config["SuggestParams"]["Input"][Index];
     if(!Input|| !Select) return;
     var NamespaceFilter = LiveRC_Config["SuggestParams"]["NSFilter"][Index];
     var Prefix = LiveRC_Config["SuggestParams"]["Prefix"][Index];
     var TheNamespace = "";
     if(NamespaceFilter){
          TheNamespace = lrcGetNamespaceName(NamespaceFilter);
          TheNamespace = (TheNamespace ==="" ? "" : TheNamespace+":");
     }
     if(Prefix){
          TheNamespace += Prefix;
     }
     Select.style.zIndex = LiveRC_Config["SuggestParams"]["ZIndex"]++ ;
     var Options = Select.getElementsByTagName('option');
     for(var a=0;a<Options.length;a++){
          if(Options[a].selected){
            Input.value = Options[a].value;
            Input.title = TheNamespace+Options[a].value;
            Input.focus();
            LiveRC_Suggest_GetPageSuggestions(Index);
            return;
        }
    }
};

/*
Suggestions d'utilisateur
modifier
 */

window.LiveRC_Suggest_AddUserSuggestion = function(Args){
     if(!Args) return;
     var InputNode = Args["InputNode"];
     if(!InputNode) return;
     var GlobalIndex = LiveRC_Config["SuggestParams"]["Index"]++;
     var SuggestLimit = LiveRC_Suggest_setVar(Args, "SuggestLimit");
     var SuggestListSize = LiveRC_Suggest_setVar(Args, "SuggestSelectLimit");
     var AddExist = LiveRC_Suggest_setVar(Args, "AddExist");
     var ListDown = LiveRC_Suggest_setVar(Args, "ListDown");
     LiveRC_Suggest_UpDateLabel(InputNode, "InputWithSuggestion_"+GlobalIndex);
     InputNode.id = "InputWithSuggestion_"+GlobalIndex;
     var ExistInputNode = document.createElement("input");
     ExistInputNode.type = "hidden";
     ExistInputNode.id = "ThisPageExist_"+GlobalIndex;
     ExistInputNode.value = "0";
     InputNode.parentNode.insertBefore(ExistInputNode, InputNode.nextSibling);
     if(AddExist===true){
          var ExistImgNode = document.createElement("span");
          ExistImgNode.id = "ThisPageExistIMG_"+GlobalIndex;
          ExistImgNode.className = "SuggestionExist";
          ExistImgNode.innerHTML = lrcMakeIcon("SuggestNoExistIcon").split("$1").join("").split("  ").join(" ");
          InputNode.parentNode.insertBefore(ExistImgNode, InputNode.nextSibling);
     }
     var SelectNode = document.createElement('select');
     SelectNode.id = "SuggestionForInput_"+GlobalIndex;
     SelectNode.style.display = "none";
     SelectNode.className = "SuggestionList";
     InputNode.parentNode.insertBefore(SelectNode, InputNode.nextSibling);
     LiveRC_Config["SuggestParams"]["Input"][GlobalIndex] = InputNode;
     LiveRC_Config["SuggestParams"]["Suggest"][GlobalIndex] = SelectNode;
          LiveRC_Config["SuggestParams"]["ExistInput"][GlobalIndex] = ExistInputNode;
     if(AddExist===true){
          LiveRC_Config["SuggestParams"]["ExistImg"][GlobalIndex] = ExistImgNode;
     }
     LiveRC_Config["SuggestParams"]["SuggestLimit"][GlobalIndex] = SuggestLimit;
     LiveRC_Config["SuggestParams"]["SuggestSelectLimit"][GlobalIndex] = SuggestListSize;
     LiveRC_Config["SuggestParams"]["ListDown"][GlobalIndex] = ListDown;
     LiveRC_Config["SuggestParams"]["AddExist"][GlobalIndex] = AddExist;
     LiveRC_Config["SuggestParams"]["IsRunning"][GlobalIndex] = false;
     InputNode.onkeyup = function(){
          var ThisIndex = LiveRC_Suggest_GetSuggestionIndex(this);
          LiveRC_Suggest_GetUserSuggestions(ThisIndex);
     };
     return GlobalIndex;
};

window.LiveRC_Suggest_GetUserSuggestions = function(Index){
     var IsRunning = LiveRC_Config["SuggestParams"]["IsRunning"][Index];
     if(IsRunning===true) return;
     var Limit = LiveRC_Config["SuggestParams"]["SuggestLimit"][Index];
     var Select = LiveRC_Config["SuggestParams"]["Suggest"][Index];
     var Input = LiveRC_Config["SuggestParams"]["Input"][Index];
     var Page = Input.value;
     if(Page===""){
          Select.style.display = "none";
          return;
     }
     LiveRC_Config["SuggestParams"]["IsRunning"][Index] = true;
     var APILimit = LiveRC_Config["UserInfos"].APIlimit;
     if(Limit>APILimit) Limit = APILimit;
     var URL = lrcGetAPIURL({format:'xml',action:'query',list:'allusers',auprefix:Page,aulimit:Limit});
     wpajax.http({url:URL,
                  onSuccess:LiveRC_Suggest_GetUserSuggestionsDone,
                  index: Index
     });
};

window.LiveRC_Suggest_GetUserSuggestionsDone = function(Req, data){
     var Index = data.index;
     var xml = Req.responseXML ;
     if ( xml == null ) return ;
     var titles = new Array () ;
     var pages = xml.getElementsByTagName("u") ;
     for(var i=0;i<pages.length;i++){
          var s = pages[i].getAttribute("name");
        if(titles.indexOf(s)==-1) titles.push(s);
     }
     LiveRC_Config["SuggestParams"]["IsRunning"][Index] = false;
     LiveRC_Suggest_ShowUserSuggestions(titles, Index);
};

window.LiveRC_Suggest_ShowUserSuggestions = function(titles, Index){
     var Select = LiveRC_Config["SuggestParams"]["Suggest"][Index];
     var Input = LiveRC_Config["SuggestParams"]["Input"][Index];
     var ExistInputNode = LiveRC_Config["SuggestParams"]["ExistInput"][Index];
     var ExistImgNode = LiveRC_Config["SuggestParams"]["ExistImg"][Index];
     var ListDown = LiveRC_Config["SuggestParams"]["ListDown"][Index];
     var TailleListe = LiveRC_Config["SuggestParams"]["SuggestSelectLimit"][Index];

     var CurrentValue = Input.value;
     if(ExistInputNode) ExistInputNode.value = "0";
     if(ExistImgNode){
          ExistImgNode.innerHTML = lrcMakeIcon("SuggestNoExistIcon").split("$1").join(CurrentValue);
     }
     if(titles.length==0){
          Select.style.display = "none" ;
          Input.title = "";
          return;
     }
     Select.style.display = "inline" ;
     if(ExistInputNode) ExistInputNode.value = "1";
     if(ExistImgNode){
          ExistImgNode.innerHTML = lrcMakeIcon("SuggestExistIcon").split("$1").join(TCurrentValue);
     }
     if(titles[0]===Input.value){
          Select.style.display = "none" ;
          Input.title = "";
          return;
     }
     if (titles.length < TailleListe ) TailleListe = titles.length;
     Select.size = TailleListe ;
     Select.style.align = "left" ;
     Select.style.zIndex = LiveRC_Config["SuggestParams"]["ZIndex"]++ ;
     Select.style.position = "relative" ;
     Select.style.width = Input.offsetWidth + "px" ;
     Select.style.height = (TailleListe * 20) + "px" ;
     while(Select.firstChild) Select.removeChild(Select.firstChild);
     for ( var i = 0 ; i < titles.length ; i++ ) {
          var opt = document.createElement("option");
          var ot = document.createTextNode(titles[i]);
          opt.appendChild(ot) ;
          opt.value = titles[i];
          Select.appendChild(opt) ;
     }
     Select.onkeyup = LiveRC_Suggest_ReplaceUserSuggestionsKeyPress;
     Select.onclick = LiveRC_Suggest_ReplaceUserSuggestions;
     if(ListDown){
          Select.style.top = parseInt(Input.offsetHeight) + "px";
          Select.style.marginBottom = "-" + ((TailleListe * 20) + parseInt(Input.offsetHeight)) + "px" ;
     }else{
          Select.style.marginTop = "-" + (TailleListe * 20) + "px" ;
     }
     Select.style.marginLeft = "-" + Input.offsetWidth + "px" ;
     var suggestion = titles[0] ;
     if(suggestion.match(new RegExp("^"+CurrentValue))==null){
          LiveRC_Suggest_GetUserSuggestions(Index);
          return;
     }
     var CurrentValueLength = CurrentValue.length;
     Input.value = suggestion;
     Input.title = lrcGetNamespaceName(2, true)+":"+suggestion;
     if (Input.createTextRange) {
          var ra = Input.createTextRange();
          ra.moveStart("character", CurrentValueLength);
          ra.moveEnd("character", suggestion.length);
          ra.select();
     } else if( Input.setSelectionRange ) {
          Input.setSelectionRange( CurrentValueLength, suggestion.length );
     } else {
          Input.selectionStart = CurrentValueLength;
          Input.selectionEnd = suggestion.length ;
     }
     if(ExistImgNode){
          CurrentValue = Input.value;
          ExistImgNode.innerHTML = lrcMakeIcon("SuggestExistIcon").split("$1").join(suggestion);
     }
};

window.LiveRC_Suggest_ReplaceUserSuggestionsKeyPress = function(e){
     if (!e) e = window.event;
     if (e.keyCode != 13) return;
     LiveRC_Suggest_ReplaceUserSuggestions();
};

window.LiveRC_Suggest_ReplaceUserSuggestions = function(){
     var Index = LiveRC_Suggest_GetSuggestionIndex(this);
     var Select = LiveRC_Config["SuggestParams"]["Suggest"][Index];
     var Input = LiveRC_Config["SuggestParams"]["Input"][Index];
     if(!Input|| !Select) return;
     Select.style.zIndex = LiveRC_Config["SuggestParams"]["ZIndex"]++ ;
     var Options = Select.getElementsByTagName('option');
     for(var a=0;a<Options.length;a++){
          if(Options[a].selected){
            Input.value = Options[a].value;
            Input.title = lrcGetNamespaceName(2, true)+":"+Options[a].value;
            Input.focus();
            LiveRC_Suggest_GetUserSuggestions(Index);
            return;
        }
    }
};

/*

Boîtes pop-up

modifier
 */

window.LiveRC_CreateNewAlert = function(){
  var Alert = document.getElementById("LiveRCAlert");
  if(!Alert){
    var Target = document.getElementById("LiveRCContainer");
    if(!Target) Target = document.body;
    if(!Target) return;
    Alert = document.createElement('ul');
    Alert.id = "LiveRCAlert";
    lrcAddClass(Alert, "error");
    lrcaddCustomizableClasses(Alert, "LiveRCAlert");
    Target.insertBefore(Alert, Target.firstChild);
  }
  Alert.style.maxWidth = Math.round(LiveRC_GetScreenWidth()/2) + "px";
  Alert.style.minWidth = Math.round(LiveRC_GetScreenWidth()/4) + "px";
  LiveRC_Config["AlertCount"]++;
  var Lis = Alert.getElementsByTagName('li');
  var index = LiveRC_Config["AlertCount"];
  var id = "LiveRCAlert_"+index;
  var NewLi = document.createElement('li');
  NewLi.id = id;
  lrcAddClass(NewLi, "LiveRC_Opacity_100");
  Alert.appendChild(NewLi);
  return NewLi;
};

/*
 */

window.LiveRC_prompt = function(text, onOK, onCancel, suggestion){
  if(!text) return;
  if(!suggestion) suggestion = '';
  text = text.split("\n").join("");
  var NewLi = LiveRC_CreateNewAlert();
  var id = NewLi.id;
  var Fieldset = document.createElement('fieldset');
  NewLi.appendChild(Fieldset);
  var Ptext = document.createElement('p');
  Ptext.className = "AlertText";
  Ptext.innerHTML = text;
  Fieldset.appendChild(Ptext);
  var Psuggest = document.createElement('input');
  Psuggest.id = id+"_AlertSuggest";
  Psuggest.type = "text";
  Psuggest.className = "AlertSuggest";
  if(suggestion) Psuggest.value = suggestion;
  Fieldset.appendChild(Psuggest);
  var Pbuttons = document.createElement('p');
  var OKInput = document.createElement('input');
  OKInput.type = "button";
  OKInput.value = lrcMakeText("OK");
  var OKFunction = function(){
    var SuggestInput = document.getElementById(id+"_AlertSuggest");
    if(typeof(onOK)==="function" && SuggestInput) onOK(SuggestInput.value);
    NewLi.parentNode.removeChild(NewLi);
    return false;
  };
  OKInput.onclick = OKFunction;
  OKInput.onselect = OKFunction;
  Pbuttons.appendChild(OKInput);
  var CancelInput = document.createElement('input');
  CancelInput.type = "button";
  CancelInput.value = lrcMakeText("Cancel");
  var CancelFunction = function(){
    var SuggestInput = document.getElementById(id+"_AlertSuggest");
    if(typeof(onCancel)==="function" && SuggestInput) onCancel(SuggestInput.value);
    NewLi.parentNode.removeChild(NewLi);
    return false;
  };
  CancelInput.onclick = CancelFunction;
  CancelInput.onselect = CancelFunction;
  Pbuttons.appendChild(CancelInput);
  NewLi.appendChild(Pbuttons);
  Psuggest.focus();
  return NewLi;
};

/*
confirm
modifier
 */

window.LiveRC_confirm = function(text, onOK, onCancel){
  if(!text) return;
  text = text.split("\n").join("");
  var NewLi = LiveRC_CreateNewAlert();
  var Fieldset = document.createElement('fieldset');
  NewLi.appendChild(Fieldset);
  var Ptext = document.createElement('p');
  Ptext.className = "AlertText";
  Ptext.innerHTML = text;
  Fieldset.appendChild(Ptext);
  var Pbuttons = document.createElement('p');
  var OKInput = document.createElement('input');
  OKInput.type = "button";
  OKInput.value = lrcMakeText("OK");
  var OKFunction = function(){
    if(typeof(onOK)==="function") onOK();
    NewLi.parentNode.removeChild(NewLi);
    return false;
  };
  OKInput.onclick = OKFunction;
  OKInput.onselect = OKFunction;
  Pbuttons.appendChild(OKInput);
  var CancelInput = document.createElement('input');
  CancelInput.type = "button";
  CancelInput.value = lrcMakeText("Cancel");
  var CancelFunction = function(){
    if(typeof(onCancel)==="function") onCancel();
    NewLi.parentNode.removeChild(NewLi);
    return false;
  };
  CancelInput.onclick = CancelFunction;
  CancelInput.onselect = CancelFunction;
  Pbuttons.appendChild(CancelInput);
  NewLi.appendChild(Pbuttons);
  OKInput.focus();
  return NewLi;
};

/*
 */

window.LiveRC_alert = function(text){
  if(!text) return;
  var NewLi = LiveRC_CreateNewAlert();
  var id = NewLi.id;
  NewLi.innerHTML = text.split("\n").join("");
  NewLi.onmouseover = function(){
    LiveRC_alert_stopOpacity(this.id);
  };
  NewLi.onmouseout = function(){
    LiveRC_Config["Timeout"][this.id] = setTimeout("LiveRC_alert_setOpacity("+lrcEscapeStr(this.id)+", false, 5, 75);", 500);
  };
  LiveRC_Config["Timeout"][id] = setTimeout("LiveRC_alert_setOpacity("+lrcEscapeStr(id)+", false, 5, 75);", 3000);
  return NewLi;
};

window.LiveRC_alert_setOpacity = function(id, removefunc, diff, delay){
  if(!diff) diff = 5;
  if(!delay) delay = 75;
  var Element = document.getElementById(id);
  if(!Element || !Element.className) return;
  var ElClass = Element.className.match(/LiveRC_Opacity_[0-9]*/);
  if(ElClass==null){
    lrcAddClass(Element, "LiveRC_Opacity_100");
    LiveRC_alert_setOpacity(id, removefunc, diff, delay);
    return;
  }
  clearTimeout(LiveRC_Config["Timeout"][id]);
  var Opacity = parseInt(ElClass[0].replace(/\D/g, ""));
  if(typeof(Opacity)!="number") return;
  var NewOpacity = (Opacity-parseInt(diff));
  if(NewOpacity < 1){
    if(!removefunc){
      Element.parentNode.removeChild(Element);
    }else{
      if(typeof(removefunc)==="function") removefunc(ElClass[0]);
    }
    return;
  }
  if(NewOpacity > 100){
    Element.className = Element.className.replace(ElClass[0], "LiveRC_Opacity_100");
    return;
  }
  Element.className = Element.className.replace(ElClass[0], "LiveRC_Opacity_"+NewOpacity);
  LiveRC_Config["Timeout"][id] = setTimeout(function(){ LiveRC_alert_setOpacity(id, removefunc, diff, delay); }, delay);
};

window.LiveRC_alert_stopOpacity = function(id){
  var Element = document.getElementById(id);
  if(!Element || !Element.className) return;
  var ElClass = Element.className.match(/LiveRC_Opacity_[0-9]*/);
  if(ElClass==null) return;
  Element.className = Element.className.replace(ElClass[0], "LiveRC_Opacity_100");
  LiveRC_Config["Timeout"][id] = clearTimeout(LiveRC_Config["Timeout"][id]);
};

/*

Module de gestion des variables

modifier
Récupération des styles locaux
modifier
 */

window.liveOldLocalCSS = function(){
    lrcDisplayDebug("Get LiveRC local styles");
    var URL = lrcGetAPIURL({format:'xml',action:'query',prop:'revisions',rvlimit:'1',rvprop:'ids',titles:LiveRC_Config["CSSPage"]});
    wpajax.http({url: URL, onSuccess: liveOldLocalCSSOldid});
    LiveRC_LaunchProcessNextStep();
};

window.liveOldLocalCSSOldid = function(RequeteOldid){
  var ObjetXML = RequeteOldid.responseXML;
  if (ObjetXML){
    var LastRevision = ObjetXML.getElementsByTagName('rev')[0];
    if (LastRevision){
      var Oldid = LastRevision.getAttribute('revid');
      var URL = lrcGetUglyPageURL(LiveRC_Config["CSSPage"],'&action=raw&oldid='+Oldid);
      wpajax.http({url:URL, onSuccess:LiveRC_ManageParams_GetOldCSS, page:LiveRC_Config["CSSPage"]});
    }
  }
};

/*
Récupération des styles personnalisés
modifier
 */

window.liveOldPersonalCSS = function(){
    lrcDisplayDebug("Get LiveRC personal styles");
    var Page = 'User:'+mw.config.get('wgUserName')+ LiveRC_Config["UserParamPage"]+".css";
    var URL = lrcGetAPIURL({format:'xml',action:'query',prop:'revisions',rvlimit:'1',rvprop:'ids',titles:Page});
    wpajax.http({url: URL, onSuccess: LiveRC_ManageParams_GetOldCSSOldid});
    LiveRC_LaunchProcessNextStep();
};

window.LiveRC_ManageParams_GetOldCSSOldid = function(RequeteOldid){
  var ObjetXML = RequeteOldid.responseXML;
  if (ObjetXML){
    var LastRevision = ObjetXML.getElementsByTagName('rev')[0];
    if (LastRevision){
      var Oldid = LastRevision.getAttribute('revid');
      var URL = lrcGetUglyPageURL('User:'+mw.config.get('wgUserName')+LiveRC_Config["UserParamPage"]+'.css','&action=raw&oldid='+Oldid);
      wpajax.http({url:URL, onSuccess:LiveRC_ManageParams_GetOldCSS, page:'User:'+mw.config.get('wgUserName')+LiveRC_Config["UserParamPage"]+'.css'});
    }
  }
};

/*
Parsing des styles
modifier
 */

window.LiveRC_ManageParams_GetOldCSS = function(Req, data){
     var localpage = (data.page === LiveRC_Config["CSSPage"]);
     var Response = Req.responseText;
     if(Response=="") return;
     Response = Response.split("/*");
     for(var a=0,l=Response.length;a<l;a++){
       if(Response[a].indexOf("*/")!=-1) Response[a] = Response[a].split("*/")[1];
     }
     Response = Response.join("");
     Response = Response.replace(/[ ]*\n[ ]*/g, "");
     var FoundSetup = false;
     var Reg = new RegExp("[^\\}]*\\{[^\\}]*\\}", "g");
     var matches = Response.match(Reg);
     if(matches == null) return;
     var personalstylescount = 0;
     for(var a=0,l=matches.length;a<l;a++){
         var Thismatch = matches[a];
         var matchtarget = Thismatch.split("{")[0];
         matchtarget = matchtarget.trim();
         var matchstyle = Thismatch.split("}")[0].split("{")[1];
         matchstyle = LiveRC_ManageParams_StripStyle(matchstyle);
         var styleupdated = false;
         for(var b=0,r=lrcCSSstyles.length;b<r;b++){
             var target = lrcCSSstyles[b].target;
             if(target != matchtarget) continue;
             lrcCSSstyles[b].style = LiveRC_ManageParams_StripStyle(lrcCSSstyles[b].style);
             if(localpage) lrcCSSstyles[b].localstyle = matchstyle;
             else lrcCSSstyles[b].customstyle = matchstyle;
             styleupdated = true;
         }
         if(!styleupdated){
             personalstylescount++;
             var NewStyleItem = {};
             if(localpage){
               NewStyleItem.localtarget = matchtarget;
               NewStyleItem.localstyle = matchstyle;
             }else{
               NewStyleItem.customtarget = matchtarget;
               NewStyleItem.customstyle = matchstyle;
             }
             lrcCSSstyles.push(NewStyleItem);
         }
     }
     LiveRC_ManageParams_FillOpenedStylesMenu();
};

window.LiveRC_ManageParams_StripStyle = function(style){
  if(!style) return "";
  return style.trim().replace(/ *; */g, ";").replace(/ *: */g, ":").replace(/;;/g, ";");
};

/*
Fonctions d'ajout de variables
modifier
Variables par défaut
modifier
 */

window.defineParam = function(textcode, Param){
  lrcParams[textcode] = Param;
};

window.defineOption = function(textcode, Option){
  lrcOptionMenuValues[textcode] = Option;
};

window.defineBlankMessages = function(BlankMessages){
  lstBlank = BlankMessages;
};

window.defineRevertMessages = function(RevertMessages){
  lrcRevertMessages = RevertMessages;
};

window.defineWarningTemplates = function(WarningTemplates){
  lstAverto = WarningTemplates;
};

window.defineTagTemplates = function(TagTemplates){
  lstBando = TagTemplates;
};

window.defineReportParams = function(ReportParams){
  lstReport = ReportParams;
};

window.defineIcon = function(textcode, Icon){
  lrcIcons[textcode] = Icon;
};

window.defineUnTranslatedText = function(textcode, UnTranslatedText){
  UnTranslatedTexts[textcode] = UnTranslatedText;
};

window.defineExtensions = function(Extensions){
  lrcExtensions = Extensions;
};

window.defineCommentTests = function(CommentTests){
  commenttests = CommentTests;
};

window.defineTemplateTest = function(TemplateTest){
  templatestests = TemplateTest;
};

window.definePageCategoryTests = function(PageCategoryTests){
  categoriestests = PageCategoryTests;
};

window.defineUserCategoryTests = function(UserCategoryTests){
  watchCategories = UserCategoryTests;
};

window.defineSupprLineParams = function(SupprLineParams){
  lrcSupprLineParams = SupprLineParams;
};

window.addParamMenuTab = function(textcode, ParamMenuTab){
  lstParamMenuTabs[textcode] = ParamMenuTab;
};

window.addTradToTranslatedTexts = function(textcode, lang, text){
  if(typeof(lrcTranslatedTexts[textcode])!="object") lrcTranslatedTexts[textcode] = [];
  if(typeof(lrcTranslatedTexts[textcode][lang])==="undefined") lrcTranslatedTexts[textcode][lang] = text;
};

window.addTradToTranslatedParamDesc = function(textcode, lang, text){
  if(typeof(lrcTranslatedParamDesc[textcode])!="object") lrcTranslatedParamDesc[textcode] = [];
  if(typeof(lrcTranslatedParamDesc[textcode][lang])==="undefined") lrcTranslatedParamDesc[textcode][lang] = text;
};

window.addTradToExtensions = function(extensionname, lang, text){
  for(var a=0,l=lrcExtensions.length;a<l;a++){
    if(lrcExtensions[a]["name"] != extensionname) continue;
    lrcExtensions[a][("desc-"+lang)] = text;
    delete lrcExtensions[a]["desc"];
  }
};

window.addTradToCSSstyles = function(stylename, lang, text){
  for(var a=0,l=lrcCSSstyles.length;a<l;a++){
    if(lrcCSSstyles[a]["target"] != stylename) continue;
    lrcCSSstyles[a][("desc-"+lang)] = text;
    delete lrcCSSstyles[a]["desc"];
  }
};

/*
Variables personnalisées
modifier
 */

window.addCustomParam = function(textcode, Param){
  Custom_lrcParams[textcode] = Param;
};

window.addCustomOption = function(textcode, Option){
  Custom_lrcOptionMenuValues[textcode] = Option;
};

window.defineCustomBlankMessages = function(BlankMessages){
  Custom_lstBlank = BlankMessages;
};

window.defineCustomRevertMessages = function(RevertMessages){
  Custom_lrcRevertMessages = RevertMessages;
};

window.defineCustomWarningTemplates = function(WarningTemplates){
  Custom_lstAverto = WarningTemplates;
};

window.defineCustomTagTemplates = function(TagTemplates){
  Custom_lstBando = TagTemplates;
};

window.defineCustomReportParams = function(ReportParams){
  Custom_lstReport = ReportParams;
};

window.addCustomIcon = function(textcode, Icon){
  Custom_lrcIcons[textcode] = Icon;
};

window.addCustomTradToTranslatedTexts = function(textcode, Args){
  if(typeof(Custom_lrcTranslatedTexts[textcode])!="object") Custom_lrcTranslatedTexts[textcode] = [];
  for(var lang in Args){
    var text = Args[lang];
    Custom_lrcTranslatedTexts[textcode][lang] = text;
  }
};

window.addCustomTradToTranslatedParamDesc = function(textcode, Args){
  if(typeof(Custom_lrcTranslatedParamDesc[textcode])!="object") Custom_lrcTranslatedParamDesc[textcode] = [];
  for(var lang in Args){
    var text = Args[lang];
    Custom_lrcTranslatedParamDesc[textcode][lang] = text;
  }
};

window.addCustomUnTranslatedText = function(textcode, UnTranslatedText){
  Custom_UnTranslatedTexts[textcode] = UnTranslatedText;
};

window.defineCustomExtensions = function(Extensions){
  Custom_lrcExtensions = Extensions;
};

window.defineCustomCommentTests = function(CommentTests){
  Custom_commenttests = CommentTests;
};

window.defineCustomTemplateTest = function(TemplateTest){
  Custom_templatestests = TemplateTest;
};

window.defineCustomPageCategoryTests = function(PageCategoryTests){
  Custom_categoriestests = PageCategoryTests;
};

window.defineCustomUserCategoryTests = function(UserCategoryTests){
  Custom_watchCategories = UserCategoryTests;
};

window.defineCustomSupprLineParams = function(SupprLineParams){
  Custom_lrcSupprLineParams = SupprLineParams;
};

window.addCustomParamMenuTab = function(textcode, ParamMenuTab){
  Custom_lstParamMenuTabs[textcode] = ParamMenuTab;
};

window.lrcSetConfigSetting = function(variable, textcode, value){
  if(typeof(window[variable])==="undefined") return;
  if(textcode===false){
    window[variable] = value;
  }else{
    if(typeof(textcode)!=="undefined") window[variable][textcode] = value;
  }
};

/*
Création du menu de paramétrage
modifier
Remplissage de la variable globale
modifier
 */

// Création des variables

window.LiveRC_ManageParams_GlobalFill = function(){
    LiveRC_Config["LiveRCcustomParams"] = [];
    LiveRC_ManageParams_Fill(lrcParams              , "lrcParams"              , "addCustomParam"                      , false );
    LiveRC_ManageParams_Fill(lrcOptionMenuValues    , "lrcOptionMenuValues"    , "addCustomOption"                     , false );
    LiveRC_ManageParams_Fill(lstBlank               , "lstBlank"               , "defineCustomBlankMessages"           , true  );
    LiveRC_ManageParams_Fill(lrcRevertMessages      , "lrcRevertMessages"      , "defineCustomRevertMessages"          , true  );
    LiveRC_ManageParams_Fill(lstAverto              , "lstAverto"              , "defineCustomWarningTemplates"        , true  );
    LiveRC_ManageParams_Fill(lstBando               , "lstBando"               , "defineCustomTagTemplates"            , true  );
    LiveRC_ManageParams_Fill(lstReport              , "lstReport"              , "defineCustomReportParams"            , true  );
    LiveRC_ManageParams_Fill(lrcIcons               , "lrcIcons"               , "addCustomIcon"                       , false );
    LiveRC_ManageParams_Fill(lrcTranslatedTexts     , "lrcTranslatedTexts"     , "addCustomTradToTranslatedTexts"      , false );
    LiveRC_ManageParams_Fill(lrcTranslatedParamDesc , "lrcTranslatedParamDesc" , "addCustomTradToTranslatedParamDesc"  , false );
    LiveRC_ManageParams_Fill(UnTranslatedTexts      , "UnTranslatedTexts"      , "addCustomUnTranslatedText"           , false );
    LiveRC_ManageParams_Fill(lrcExtensions          , "lrcExtensions"          , "defineCustomExtensions"              , true  );
    LiveRC_ManageParams_Fill(commenttests           , "commenttests"           , "defineCustomCommentTests"            , true  );
    LiveRC_ManageParams_Fill(templatestests         , "templatestests"         , "defineCustomTemplateTest"            , true  );
    LiveRC_ManageParams_Fill(categoriestests        , "categoriestests"        , "defineCustomPageCategoryTests"       , true  );
    LiveRC_ManageParams_Fill(watchCategories        , "watchCategories"        , "defineCustomUserCategoryTests"       , true  );
    LiveRC_ManageParams_Fill(lrcSupprLineParams     , "lrcSupprLineParams"     , "defineCustomSupprLineParams"         , true  );
    LiveRC_RunHooks("AfterFillParamPanel");
    LiveRC_ManageParams_Fill(lstParamMenuTabs       , "lstParamMenuTabs"       , "addCustomParamMenuTab"               , false);
};

window.LiveRC_ManageParams_Fill = function(OptionArray, ArrayName, AddCustomFunction, AddButton){
    if(typeof(lstParamMenuTabs[ArrayName])==="undefined") lstParamMenuTabs[ArrayName] = true;
    var TheOptionArray = [];
    var CustomOptionArray = false;
    var test = "Custom_"+ ArrayName;
    if(!LiveRC_Config["GlobalFill_OnlyDefault"]){
        CustomOptionArray = eval( test );
        if(typeof(CustomOptionArray) !== "object"){
            test = ArrayName + "_Custom";
            try{ CustomOptionArray = eval( test ); }catch(e){ };
        }
    }else{
        CustomOptionArray = OptionArray;
    }
    if(typeof(CustomOptionArray) === "object" && !LiveRC_Config["GlobalFill_OnlyDefault"]){
        if(AddButton){ // ------------------------------------------- if there is a custom array, search values
            var foundvalues = false;
            for(var val in CustomOptionArray){
                if(['number','string','boolean','object','regexp'].indexOf(Realtypeof(CustomOptionArray[val]))!=-1)
                    foundvalues = true;
            }
            if(foundvalues) TheOptionArray = CustomOptionArray; // --- if found values : take in account the custom array
            else TheOptionArray = OptionArray;                  // --- if not, take in account the normal array
        }else{  // --------------------------------------------------- otherwise, merge the two arrays
            for(var val in OptionArray) TheOptionArray[val] = OptionArray[val];
            for(var val in CustomOptionArray) TheOptionArray[val] = CustomOptionArray[val];
        }
    }else{
        TheOptionArray = OptionArray;
    }
    var Types = null;
    for(var Param in TheOptionArray){
        var ParamName = Param;
        var ParamDefValue = OptionArray[Param];
        var ParamCustomValue = CustomOptionArray[Param];
        var CustomValueType = Realtypeof(ParamCustomValue);
        var CustomValueTest = (['number','string','boolean','regexp'].indexOf(CustomValueType) != -1 );
        if(CustomValueType == "object"){
            CustomValueTest = false;
            for(var X in ParamCustomValue){
                if(['number','string','boolean','regexp'].indexOf(Realtypeof(ParamCustomValue[X]))!= -1 ) CustomValueTest = true;
            }
        }
        if(!Types && AddButton) Types = LiveRC_ManageParams_Fill_GetVarTypes(ParamOldValue);
        var ParamOldValue = ( CustomValueTest ? ParamCustomValue : ParamDefValue);
        var ParamType = Realtypeof(ParamOldValue);  // 'number', 'string', 'boolean', 'object', 'regexp';
        if(['number', 'string', 'boolean', 'object', 'regexp'].indexOf(ParamType) !== -1){
            var NewArray = {};
            NewArray["ArrayName"]            = ArrayName;
            NewArray["Name"]                 = ParamName;
            NewArray["Desc"]                 = lrcMakeParamDescription(ParamName);
            NewArray["ValueType"]            = ParamType;
            NewArray["AddButton"]            = (AddButton ? true : false);
            NewArray["AddCustomFunction"]    = AddCustomFunction;
            NewArray["CustomValue"]          = ParamCustomValue;
            NewArray["DefaultValue"]         = ParamDefValue;
            NewArray["OldValue"]             = ParamOldValue;
            if(Types) NewArray["ItemsTypes"] = Types;
            if(!LiveRC_Config["LiveRCcustomParams"][ArrayName])
              LiveRC_Config["LiveRCcustomParams"][ArrayName] = [];
            LiveRC_Config["LiveRCcustomParams"][ArrayName][ParamName] = NewArray;
        }
    }
};

window.LiveRC_ManageParams_Fill_GetVarTypes = function(ParamObject){
    var Types = [];
    if(Realtypeof(ParamObject)!="object") return false;
    for(var VarIndex in ParamObject){
        if(!ParamObject.hasOwnProperty(VarIndex)) continue;
        Types.push(lrcEscapeStr(VarIndex)+":"+lrcEscapeStr(Realtypeof(ParamObject[VarIndex])));
    }
    if(Types.length===0) return null;
    return '{'+Types.join(",")+'}';
};

/*
Ouverture/Fermeture du menu de paramétrage
modifier
 */

// Fermeture du menu

window.LiveRC_ManageParams_CloseMenu = function(){
    var ID = "LiveRC_ParamMenu";
    var Menu = document.getElementById(ID);
    if(Menu){
        lrcRemoveClass(document.body, "LiveRCConfigDisplayed");
        Menu.parentNode.removeChild(Menu);
        clearTimeout(LiveRC_Config["Timeout"]["ManageParams"]);
        updateFollowContact();
        updateFollowHiddenUsers();
        updateFollowHiddenPages();
        lrcInitTableHeight();
    }
};

// Création du menu

window.LiveRC_ManageParams_OpenMenu = function(onlydefault){
    var OldMenu = document.getElementById("LiveRC_ParamMenu");
    if(OldMenu){
        LiveRC_ManageParams_CloseMenu();
        return;
    }
    lrcAddClass(document.body, "LiveRCConfigDisplayed");
    LiveRC_Config["GlobalFill_OnlyDefault"] = (!onlydefault ? false : true);

    LiveRC_ManageParams_GlobalFill();
    var TargetDiv = document.getElementById("OutFixedBottomPanel");
    if(!TargetDiv) return;

    var Menu = document.createElement('div');
    Menu.id = "LiveRC_ParamMenu";
    lrcAddClass(Menu, "LiveRC_Opacity_100");
    var MenuAnchor = document.createElement('div');
    MenuAnchor.id = "LiveRC_ParamMenuAnchor";
    MenuAnchor.innerHTML = lrcMakeText("ConfigMenuTitle");
    Menu.appendChild(MenuAnchor);
    var MenuContent = document.createElement('div');
    MenuContent.id = "LiveRC_ParamMenuContent";
    lrcaddCustomizableClasses(MenuContent, "LiveRC_MenuContent");
    var Form = document.createElement('form');
    Form.id = "LiveRC_ParamMenuForm";
    MenuContent.appendChild(Form);
    for(var ThisVariableIndex in LiveRC_Config["LiveRCcustomParams"]){
        var ArrayVariable = LiveRC_Config["LiveRCcustomParams"][ThisVariableIndex];
        var VariableFieldset = document.createElement('fieldset');
        VariableFieldset.id = "LiveRC_OptionsContent_"+ThisVariableIndex;
        VariableFieldset.className = "LiveRC_ParamMenuFieldset";
        VariableFieldset.setAttribute("style", "text-align:left;");
        var VariableLegend = document.createElement('legend');
        VariableLegend.appendChild(document.createTextNode(lrcMakeParamDescription(ThisVariableIndex)));
        VariableFieldset.appendChild(VariableLegend);
        VariableFieldset.appendChild(LiveRC_ManageParams_CreateActionButtons());
        var VariableDiv = document.createElement('div');
        VariableDiv.className = "LiveRC_ParamMenuPart";
        var VariableUl = document.createElement('ul');
        var ArraysInArray = false;
        var count = 0;
        for(var q in ArrayVariable){
          count++;
          if(ArrayVariable[q]["ValueType"]=='object') ArraysInArray = true;
        }
        if(count==0) continue;
        if(!ArraysInArray) VariableUl.setAttribute("style", "column-count:2");
        VariableDiv.appendChild(VariableUl);
        VariableFieldset.appendChild(VariableDiv);
        var AddButton;
        for(var a in ArrayVariable){
            var ThisVariable = ArrayVariable[a];
            AddButton = ThisVariable["AddButton"];
            var P = LiveRC_ManageParams_CreateLiFromParam(ThisVariable);
            VariableUl.appendChild(P);
        }
        if(AddButton && ThisVariable["ItemsTypes"]){
            var P = document.createElement('li');
            var Types = ThisVariable["ItemsTypes"];
            var func = 'LiveRC_ManageParams_AddNewParam('+lrcEscapeStr(ThisVariableIndex)+', '+Types+');';
            P.innerHTML = '<a id="AddParam_'+ThisVariableIndex+'" title="'+lrcMakeText("AddParamLineButton_Title")+'" href="javascript:'+func+'" >'+lrcMakeText("AddParamLineButton_Text")+'</a>';
            VariableUl.appendChild(P);
        }
        Form.appendChild(VariableFieldset);
    }
    Menu.appendChild(MenuContent);
    TargetDiv.appendChild(Menu);
    LiveRC_ManageParams_TransformInputToSelect();
    LiveRC_ManageParams_MoveFollowListsOptions();
    LiveRC_ManageParams_MoveLogOptions();
    LiveRC_ManageParams_MoveTagsOptions();
    LiveRC_ManageParams_MoveNamespaceOptions();
    LiveRC_ManageParams_MoveUsersOptions();
    LiveRC_ManageParams_AddIconsDescriptions();
    LiveRC_ManageParams_AddNewIcon_CreateAddButton();
    LiveRC_ManageParams_AddTextTranslationsLangToggleAndDescriptions();
    LiveRC_ManageParams_AddNewText_CreateAddButton();
    LiveRC_ManageParams_RemoveSomeExtensions();
    LiveRC_ManageParams_AddContactListMenu();
    LiveRC_ManageParams_AddHiddenListMenu();
    LiveRC_ManageParams_AddHiddenPagesListMenu();
    LiveRC_ManageParams_AddExtensionsMenu();
    LiveRC_ManageParams_AddStylesMenu();

    LiveRC_RunHooks("AfterCreateParamPanel");

    LiveRC_ManageParams_CreateToggleButtons();
    LiveRC_ManageParams_ToggleMenu();
    LiveRC_ManageParams_HideSomeTabs();
    LiveRC_SetVerticalResizeZone(document.getElementById("LiveRC_ParamMenuAnchor"),
                         lrcGetElementsByClass("LiveRC_ParamMenuPart",document.getElementById("LiveRC_ParamMenu"),"div"),
                         document.getElementById("LiveRC_ParamMenu")
                        );
    lrcInitTableHeight();
};


window.LiveRC_ManageParams_HideSomeTabs = function(){
  for(var tab in lstParamMenuTabs){
    if(lrcMakeParamMenuTabs(tab) === false){
      var Fieldset = document.getElementById("LiveRC_OptionsContent_"+tab);
      if(Fieldset) Fieldset.style.display = "none";
      var Input = document.getElementById("LiveRC_OptionsContentInput_"+tab);
      if(Input) Input.style.display = "none";
    }
    if(LiveRC_Config["AlwaysShownTabs"].indexOf(tab)!=-1){
      var LI = document.getElementById("LI_"+tab);
      if(LI){
        var Inputs = LI.getElementsByTagName('input');
        for(var a=0,l=Inputs.length;a<l;a++){
          if(Inputs[a].type == "checkbox") Inputs[a].disabled = "disabled";
        }
      }
    }
  }
  var InputsP = document.getElementById("ToggleButtons");
  if(InputsP){
    var Inputs = InputsP.getElementsByTagName('input');
    var index = 0;
    var Input = Inputs[index];
    while(Input && Input.style && Input.style.display == "none"){
      index++;
      Input = Inputs[index];
    }
    if(Input && index !== 0) LiveRC_ManageParams_ToggleMenu(Input);
  }
};

window.LiveRC_ManageParams_CreateLiFromParam = function(ThisVariable){
  var ThisVariable_Desc = ThisVariable["Desc"];
  var ThisVariable_Name = ThisVariable["Name"];
  var ThisVariable_AddButton = ThisVariable["AddButton"];
  var ThisVariable_ValueType = ThisVariable["ValueType"];
  var ThisVariable_OldValue = ThisVariable["OldValue"];
  var ThisVariable_DefaultValue = ThisVariable["DefaultValue"];
  var LetOneItem = (typeof(ThisVariable["LetOneItem"])==="boolean" && ThisVariable["LetOneItem"]===false ? false : true);
  var P = document.createElement('li');
  lrcaddCustomizableClasses(P, "ParamMenuLi");
  lrcAddClass(P, "RealParamMenuLi");
  var addtitle = true;
  var thisvartitle = ThisVariable_Desc;
  for(var d=0,s=10;d<s;d++){ if(thisvartitle.indexOf("Desc"+d)!=-1) addtitle = false; }
  if(addtitle){
    P.title = thisvartitle;
    P.id = "LI_"+ThisVariable_Name;
  }
  var HiddenInput = document.createElement('input');
  HiddenInput.type = "hidden";
  HiddenInput.name = "variable_index";
  HiddenInput.value = ThisVariable_Name;
  P.appendChild(HiddenInput);
  var AddButton = ThisVariable_AddButton;
  if(ThisVariable_ValueType!='object'){
    var ValueSpan = LiveRC_ManageParams_CreateNewParamSpan(ThisVariable_OldValue, ThisVariable_ValueType, ThisVariable_Name, ThisVariable_Desc);
    if(ObjIsDifferent(ThisVariable_OldValue, ThisVariable_DefaultValue))
      lrcAddClass(P, "ParamMenuLiCustom");
    P.appendChild(ValueSpan);
  }else{
    for(var VarIndex in ThisVariable_OldValue){
      var VariableType = Realtypeof(ThisVariable_OldValue[VarIndex]);
      if(["boolean","number","string","regexp"].indexOf(VariableType)==-1) continue;
      var ValueSpan = LiveRC_ManageParams_CreateNewParamSpan(ThisVariable_OldValue[VarIndex], VariableType, VarIndex, VarIndex, true);
      if(Realtypeof(ThisVariable_DefaultValue)==="undefined" || ObjIsDifferent(ThisVariable_OldValue[VarIndex], ThisVariable_DefaultValue[VarIndex]))
        lrcAddClass(ValueSpan, "ParamMenuLiCustom");
      P.appendChild(ValueSpan);
      P.appendChild(document.createTextNode(" "));
    }
    if(AddButton) P.appendChild(LiveRC_ManageParams_AddDeleteParamLineLink(LetOneItem));
  }
  return P;
};

// Ajouter une nouvelle ligne

window.LiveRC_ManageParams_AddNewParam = function(Id, Vars, LetOne){
    var LetOneItem = (typeof(LetOne)==="boolean" && LetOne===false ? false : true);
    var Link = document.getElementById('AddParam_'+Id);
    if(!Link) return;
    var Variable = LiveRC_Config["LiveRCcustomParams"][Id];
    var ThisVariableName = 0;
    var Li = Link.parentNode;
    PreviousLi = Li.previousSibling;
    if(PreviousLi){
        var PreviousLiHidden = PreviousLi.getElementsByTagName('input')[0];
        if(PreviousLiHidden){
            var PreviousLiHiddenValue = PreviousLiHidden.value;
            if(typeof(parseInt(PreviousLiHiddenValue))==="number") ThisVariableName = (parseInt(PreviousLiHiddenValue) + 1);
        }
    }
    var P = document.createElement('li');
    lrcaddCustomizableClasses(P, "ParamMenuLi");
    lrcAddClass(P, "RealParamMenuLi");
    lrcAddClass(P, "ParamMenuLiCustom");
    var HiddenInput = document.createElement('input');
    HiddenInput.type = "hidden";
    HiddenInput.name = "variable_index";
    HiddenInput.value = ThisVariableName;
    P.appendChild(HiddenInput);
    for(var iName in Vars){
        var ValueSpan = LiveRC_ManageParams_CreateNewParamSpan("", Vars[iName], iName, iName, true);
        P.appendChild(ValueSpan);
        P.appendChild(document.createTextNode(" "));
    }
    P.appendChild(LiveRC_ManageParams_AddDeleteParamLineLink(LetOneItem));
    Li.parentNode.insertBefore(P, Li);
};

window.LiveRC_ManageParams_CreateNewParamSpan = function(VarValue, VariableType, VarIndex, Desc, LabelFirst){
  Desc = ( Desc ? Desc : VarIndex);
  var ValueSpan = document.createElement('span');
  lrcAddClass(ValueSpan, "ParamMenuLiElement");
  lrcAddClass(ValueSpan, "ParamMenuLiElement_"+VariableType);
  if(["boolean","number","string","regexp"].indexOf(VariableType)!=-1){
    var Input = document.createElement('input');
    Input.name = VarIndex;
    if(VariableType=="boolean"){
      Input.type = "checkbox";
      if(VarValue) Input.checked = "checked";
    }else{
      Input.type = "text";
      if(VariableType=="string" || VariableType == "regexp") Input.size = 35;
      if(VariableType=="number") Input.size = 4;
      Input.setAttribute("style", "padding:2px;margin:0");
      if(VariableType=="regexp"){
        Input.value = VarValue.toString();
      }else if(VariableType=="string"){
        Input.value = lrcEscapeStrSpecialChars(VarValue);
      }else{
        Input.value = VarValue;
      }
    }
    var Label = document.createElement('label');
    Label.setAttribute('for', VarIndex);
    Label.innerHTML = Desc;
    if(LabelFirst){
      ValueSpan.appendChild(Label);
      ValueSpan.appendChild(document.createTextNode(":"));
      ValueSpan.appendChild(Input);
    }else{
      ValueSpan.appendChild(Input);
      ValueSpan.appendChild(document.createTextNode(" "));
      ValueSpan.appendChild(Label);
    }
  }
  return ValueSpan;
};

// Bouton de suppression de ligne (paramètres)

window.LiveRC_ManageParams_AddDeleteParamLineLink = function(LetOne){
    var Link = document.createElement('a');
    Link.innerHTML = lrcMakeText("DeleteParamLineButton_Text");
    Link.title = lrcMakeText("DeleteParamLineButton_Title");
    Link.href = "javascript:;";
    Link.onclick = function(){ LiveRC_ManageParams_DeleteThisParam(this, LetOne); };
    return Link;
};

// Bouton de suppression de ligne (utilisateur suivi/masqué)

window.LiveRC_ManageParams_AddDeleteUserLink = function(){
    var Link = document.createElement('a');
    Link.innerHTML = lrcMakeText("DeleteUserButton_Text");
    Link.title = lrcMakeText("DeleteUserButton_Title");
    Link.href = "javascript:;";
    Link.onclick = function(){ LiveRC_ManageParams_DeleteThisParam(this, false); };
    return Link;
};

// Bouton de suppression de ligne (page masquée)

window.LiveRC_ManageParams_AddDeletePageLink = function(){
    var Link = document.createElement('a');
    Link.innerHTML = lrcMakeText("DeletePageButton_Text");
    Link.title = lrcMakeText("DeletePageButton_Title");
    Link.href = "javascript:;";
    Link.onclick = function(){ LiveRC_ManageParams_DeleteThisParam(this, false); };
    return Link;
};

// Suppression d'une ligne

window.LiveRC_ManageParams_DeleteThisParam = function(Link, LetOneLine){
    var Line = Link.parentNode;
    var UL = Line.parentNode;
    var LineNumber = lrcGetElementsByClass("ParamMenuLi", UL, "li").length;
    if(LetOneLine && LineNumber==1) return;
    Line.parentNode.removeChild(Line);
    return false;
};

// Création boutons d’action ( Valider / RAZ )

window.LiveRC_ManageParams_CreateActionButtons = function(){
    var ActionP = document.createElement('p');
    ActionP.className = 'ActionButtons';
    var OKInput = document.createElement('input');
    OKInput.type = "button";
    OKInput.value = lrcMakeText("OK");
    OKInput.onclick = function(){ LiveRC_ManageParams_CheckMenu(this); return false;};
    OKInput.onselect = function(){ LiveRC_ManageParams_CheckMenu(this); return false;};
    ActionP.appendChild(OKInput);
    var RAZInput = document.createElement('input');
    RAZInput.type = "button";
    RAZInput.value = lrcMakeText("RAZ");
    RAZInput.onclick = function(){ LiveRC_ManageParams_RAZParams(this); return false;};
    RAZInput.onselect = function(){ LiveRC_ManageParams_RAZParams(this); return false;};
    ActionP.appendChild(RAZInput);
    var CancelInput = document.createElement('input');
    CancelInput.type = "button";
    CancelInput.value = lrcMakeText("Cancel");
    CancelInput.onclick = function(){ LiveRC_ManageParams_CloseMenu(this); return false;};
    CancelInput.onselect = function(){ LiveRC_ManageParams_CloseMenu(this); return false;};
    ActionP.appendChild(CancelInput);
    return ActionP;
};

// Création des onglets

window.LiveRC_ManageParams_CreateToggleButtons = function(){
    var Form = document.getElementById("LiveRC_ParamMenuForm");
    var P = document.createElement('p');
    P.id = "ToggleButtons";
    var Fieldsets = Form.getElementsByTagName('fieldset');
    for(var a=0,l=Fieldsets.length;a<l;a++){
        var Id = ""+Fieldsets[a].id.split("LiveRC_OptionsContent_").join("");
        var Input = document.createElement('input');
        Input.id = "LiveRC_OptionsContentInput_"+Id;
        Input.type = "button";
        Input.value = lrcMakeParamDescription(Id+"_short");
        Input.title = lrcMakeParamDescription(Id);
        Input.onclick = function(){ LiveRC_ManageParams_ToggleMenu(this); return false;};
        Input.onselect = function(){ LiveRC_ManageParams_ToggleMenu(this); return false;};
        P.appendChild(Input);
    }
    var NSMessages = getNamespaceInfoFromPage(LiveRC_Config["SiteConfigPage"]);
    if( LiveRC_Config["SiteConfigPage"].indexOf(".js") != -1
        &&
        ( (