Nota : aprés avêr sôvo, vos dête forciér lo rechargement de la pâge por vêre los changements : Mozilla / Firefox : Shift-Ctrl-R (Shift-Cmd-R en Apple Mac), IE : Ctrl-F5, Opera : F5, Safari : ⌘-R, Konqueror : Ctrl-R.

/*jshint maxerr:600, scripturl:true, laxbreak:true, sub:true, loopfunc:true, forin:false, unused:true*/
/*global mw, $*/
/**
 * Quint que seye JavaScript betâ ique serat chargiê por tôs los utilisators et por totes les pâges accèdâyes.
 *
 * ATENCION : devant que changiér ceta pâge, se vos plét èprovâd voutros changements avouéc voutron prôpro
 * vector.js. Na fôta sur ceta pâge pôt fâre cofeyér lo seto entiér (et gênar l’ensemblo des
 * visitors), mémo des hores aprés lo changement !
 *
 * Se vos plét, rengiéd les novèles fonccions dedens les sèccions adaptâyes :
 * - Fonccions JavaScript
 * - Fonccions spècifiques por MediaWiki
 * - Aplicacions spècifiques a la fenétra d’èdicion
 * - Aplicacions que pôvont étre empleyêes sur tota pâge
 * - Aplicacions spècifiques a un èspâço de noms ou ben na pâge
 *
 * <nowiki> /!\ Pas reteriér cela balisa
 */

/*************************************************************/
/* Fonccions JavaScript : cachient les limites de JavaScript */
/* Gouardâd : http://www.ecmascript.org/                     */
/*************************************************************/

/**
 * insertAfter : betar na piéce dedens na pâge
 */
mw.log.deprecate( window, 'insertAfter', function ( parent, node, referenceNode ) {
	parent.insertBefore( node, referenceNode.nextSibling );
}, 'Use jQuery\'s .after() or .insertAfter() instead.' );

/**
 * getElementsByClass : rechèrchiér les piéces de la pâge que lo paramètro "class" est celi rechèrchiê
 */
mw.log.deprecate( window, 'getElementsByClass', function ( searchClass, node, tag ) {
	if ( node === null ) {
		node = document;
	}
	if ( tag === null ) {
		tag = '*';
	}
	return $.makeArray( $( node ).find( tag + '.' + searchClass ) );
}, 'Use $( \'.someClass\' ) or $( element ).find( \'.someClass\' ) instead.' );

/**
 * Fonccions de totes sôrtes que manipulont les cllâsses
 * Emplèye des èxprèssions règuliéres et pués un cacho por de mèlyores perfs :
 * isClass et whichClass dês http://fr.wikibooks.org/w/index.php?title=MediaWiki:Common.js&oldid=140211
 * hasClass, addClass, removeClass et eregReplace dês http://drupal.org.in/doc/misc/drupal.js.source.html
 * Gouardâd l’emplèmentacion de .classList http://www.w3.org/TR/2008/WD-html5-diff-20080122/#htmlelement-extensions
 */
mw.log.deprecate( window, 'isClass', function ( element, classe ) {
	return $( element ).hasClass( classe );
}, 'Use $( element ).hasClass( \'class\' ) instead.' );


mw.log.deprecate( window, 'whichClass', function ( element, classes ) {
	var s = ' ' + element.className + ' ';
	for ( var i = 0; i < classes.length; i++ ) {
		if ( s.indexOf( ' ' + classes[ i ] + ' ' ) >= 0 ) {
			return i;
		}
	}
	return -1;
}, 'Use jQuery instead.' );

mw.log.deprecate( window, 'hasClass', function ( node, className ) {
	return $( node ).hasClass( className );
}, 'Use $( element ).hasClass( \'class\' ) instead.' );


mw.log.deprecate( window, 'addClass', function ( node, className ) {
	if ( $( node ).hasClass( className ) ) {
		return false;
	}
	var cache = node.className;
	if ( cache ) {
		node.className = cache + ' ' + className;
	} else {
		node.className = className;
	}
	return true;
}, 'Use $( element ).addClass( \'className\' ) instead.' );

function eregReplace( search, replace, subject ) {
	return subject.replace( new RegExp(search, 'g' ), replace );
}

mw.log.deprecate( window, 'removeClass', function ( node, className ) {
	if ( ! $( node ).hasClass( className ) ) {
		return false;
	}
	node.className = eregReplace( '(^|\\s+)'+ className +'($|\\s+)', ' ', node.className );
	return true;
}, 'Use $( element ).removeClass( \'className\' ) instead.' );

/* Petiôtes fonccions pratiques - fr:Darkoneko, 09/01/2008 */

//Fât un lim et lo retôrne.
//Lo paramètro onclick est u chouèx.
window.createAdressNode = function ( href, texte, onclick ) {
	var a = document.createElement('a');
	a.href = href;
	a.appendChild(document.createTextNode( texte ) );
	if(arguments.length == 3) { a.setAttribute("onclick", onclick ); }

	return a;
};

//Fât un cookie. Ègzistâve ren qu’una vèrsion consacrâye a la reçua. Ceta est ples g·ènèrica.
//Lo paramètro dura est en jorns.
window.setCookie = function ( nom, valor, dura ) {
	var expDate = new Date();
	expDate.setTime(expDate.getTime() + ( dura * 24 * 60 * 60 * 1000));
	document.cookie = nom + "=" + escape(valor) + ";expires=" + expDate.toGMTString() + ";path=/";
};

/**
 * Rècupère la valor du cookie.
 */
window.getCookieVal = function ( name ) {
	var cookiePos = document.cookie.indexOf(name + "=");
	var cookieValue = false;
	if (cookiePos > -1) {
		cookiePos += name.length + 1;
		var endPos = document.cookie.indexOf(";", cookiePos);
		if (endPos > -1)
			cookieValue = document.cookie.substring(cookiePos, endPos);
		else
			cookieValue = document.cookie.substring(cookiePos);
	}
	return cookieValue;
};

// Rècupère prôpro lo contegnu tèxtuèl d’un nuod et de sos nuods dèscendents.
// Copyright Harmen Christophe, http://openweb.eu.org/articles/validation_avancee, CC
window.getTextContent = function ( oNode ) {
	if( !oNode ) return null;
	if ( typeof oNode.textContent !== "undefined" ) {return oNode.textContent;}
	switch ( oNode.nodeType ) {
		case 3: // TEXT_NODE
		case 4: // CDATA_SECTION_NODE
			return oNode.nodeValue;
			break;
		case 7: // PROCESSING_INSTRUCTION_NODE
		case 8: // COMMENT_NODE
			if ( getTextContent.caller!=getTextContent ) {
				return oNode.nodeValue;
			}
			break;
		case 9: // DOCUMENT_NODE
		case 10: // DOCUMENT_TYPE_NODE
		case 12: // NOTATION_NODE
			return null;
			break;
	}
	var _textContent = "";
	oNode = oNode.firstChild;
	while ( oNode ) {
		_textContent += getTextContent( oNode );
		oNode = oNode.nextSibling;
	}
	return _textContent;
};

if( !String.prototype.HTMLize ) {
	String.prototype.HTMLize = function() {
		var chars = [ '&', '<', '>', '"' ];
		var entities = [ 'amp', 'lt', 'gt', 'quot' ];
		var string = this;
		for ( var i = 0; i < chars.length; i++ ) {
			var regex = new RegExp( chars[ i ], 'g' );
			string = string.replace( regex, '&' + entities[ i ] + ';' );
		}
		return string;
	};
}


/**********************************************************************************************************/
/* Fonccions g·ènèrâles MediaWiki (cachient les limitacions de la programeria)                            */
/* Gouardâd : https://git.wikimedia.org/history/mediawiki%2Fcore.git/HEAD/skins%2Fcommon%2Fwikibits.js    */
/**********************************************************************************************************/

/*
 * Fonccions g·ènèrâles de lancement de fonccions ou ben de scripts
 * DÈPRÈCIYÊ : empleyéd $( func ) qu’est avouéc jQuery.
 */
mw.log.deprecate( window, 'addLoadEvent', function ( hookFunct ) {
	$( function() {
		hookFunct();
	} );
}, 'Use jQuery instead.' );

/**
 * Entrebetar un JavaScript d’una pâge particuliére
 * DÈPRÈCIYÊ : empleyéd importScript( page ) qu’est avouéc MediaWiki.
 */
mw.log.deprecate( window, 'loadJs', importScript, 'Use importScript instead.' );

/**
 * Projèt JavaScript
 */
window.aver = function ( name ) {
	importScript( 'MediaWiki:Gadget-' + name + '.js' );
};

/**
 * Transformar les pâges du Câfè du Velâjo, du GA et les pâges spècifiâyes en pâge de discussion
 */
function TransformeEnDiscussion( $ ) {
	if (
		mw.config.get( 'wgPageName' ).search( 'Vouiquipèdia:Lo_Câfè_du_Velâjo' ) != -1 ||
		mw.config.get( 'wgPageName' ).search( 'Vouiquipèdia:Gazèta_des_administrators' ) != -1 ||
		$( '#transformeEnPageDeDiscussion' ).length
	) {
		$( 'body' ).removeClass( 'ns-subject' ).addClass( 'ns-talk' );
	}
}
$( TransformeEnDiscussion );

/**
 * Apondre un boton a la fin de la bârra d’outils
 */
if ( typeof addCustomButton === 'undefined' ) {
	mw.log.deprecate( window, 'addCustomButton', function ( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId ) {
		if ( mw.toolbar ) {
			mw.toolbar.addButton( {
				imageFile: imageFile.replace( /^http:(\/\/upload.wikimedia.org\/)/, '$1' ),
				speedTip: speedTip,
				tagOpen: tagOpen,
				tagClose: tagClose,
				sampleText: sampleText,
				imageId: imageId
			} );
		}
	}, 'Use mw.toolbar.addButton instead.' );
}


/****************************************/
/* Aplicacions por l’ensemblo du seto   */
/****************************************/

/**
 * Tot cen que regârde la pâge d’èdicion.
 * Vêde MediaWiki:Common.js/edit.js por celes fonccions.
 */
if( ['edit','submit'].indexOf(mw.config.get('wgAction')) !== -1 ) {
	importScript( 'MediaWiki:Common.js/edit.js' );
}

/**
 * Rècritura des titros
 *
 * Fonccion empleyêe per [[Modèlo:Titro fôx]]
 *
 * La fonccion chèrche na benda de la fôrma
 * <div id="RealTitleBanner">
 *   <span id="RealTitle">Titro</span>
 * </div>
 *
 * Na piéce que presente id="DisableRealTitle" dèsactive la fonccion.
 */
function rewritePageTitle( $ ) {
	var $realTitle, titleText, $h1,
		$realTitleBanner = $( '#RealTitleBanner' );
	if ( $realTitleBanner.length && !$( '#DisableRealTitle' ).length ) {
		$realTitle = $( '#RealTitle' );
		$h1 = $( 'h1:first' );
		if ( $realTitle.length && $h1.length ) {
			titleText = $realTitle.html();
			if ( titleText === '' ) {
				$h1.hide();
			} else {
				$h1.html( titleText );
				if ( mw.config.get('wgAction') == 'view' && $realTitle.children().length === 0 ) {
					document.title = $realTitle.text() + " — Vouiquipèdia";
				}
			}
			$realTitleBanner.hide();
			$( '<p>' ).css( 'font-size', '80%' )
				.html( 'Titro a empleyér por fâre un lim de dedens : <b>' + mw.config.get('wgPageName').replace( /_/g, ' ' ) + '</b>' )
				.insertAfter( $h1 );
		}
	}
}
$( rewritePageTitle );

/**
 * Aponsa d’un sot-titro
 *
 * Fonccion empleyêe per [[Modèlo:Sot-titro]]
 *
 * La fonccion chèrche na piéce de la fôrma
 * <span id="sot_titro_h1">Sot-titro</span>
 */

function sotTitroH1( $content ) {
	$( '#firstHeading > #sot_titro_h1' ).remove();
	var $span = $content.find( '#sot_titro_h1' );
	if ( $span.length ) {
		$span.prepend( ' ' );
		$( '#firstHeading' ).append( $span );
	}
}
mw.hook( 'wikipage.content' ).add( sotTitroH1 );


/**
 * Bouètes dèroulantes
 *
 * Por [[Modèlo:Mètâ palèta de navigacion]]
 */

var Paleta_Enroular = '[cachiér]';
var Paleta_Deroular = '[montrar]';

var Paleta_max = 1;

function Paleta_toggle( $table ) {
	$table.find( 'tr:not(:first)' ).toggleClass( 'navboxHidden' );
}

function Paleta( element ) {
	if ( !element ) {
		element = document;
	}
	var $tables = $( element ).find( 'table.collapsible' );
	var autoCollapse = $tables.length > Paleta_max;

	$.each( $tables, function( _, table ) {
		var $table = $( table );
		var collapsed = $table.hasClass( 'collapsed' ) || ( autoCollapse && $table.hasClass( 'autocollapse' ) );
		$table.find( 'tr:first th:first' ).prepend(
			$( '<span class="navboxToggle">\u00a0</span>' ).append(
				$( '<a href="#">' + (collapsed ? Paleta_Deroular : Paleta_Enroular) + '</a>' ).click( function() {
					if ( $( this ).text() === Paleta_Enroular ) {
						$( this ).text( Paleta_Deroular );
					} else {
						$( this ).text( Paleta_Enroular );
					}
					Paleta_toggle( $table );
					return false;
				} )
			)
		);
		if ( collapsed ) {
			Paleta_toggle( $table );
		}
	} );
}
$( function() {
	Paleta();
} );


/**
 * Por [[Modèlo:Bouèta dèroulanta]]
 */

var BouetaDeroulanta_Enroular = '[cachiér]';
var BouetaDeroulanta_Deroular = '[montrar]';
var BouetaDeroulanta_max = 0;
var BouetaDeroulanta_index = -1;

function BouetaDeroulanta_toggle(indexBouetaDeroulanta){
	var NavFrame = document.getElementById("NavFrame" + indexBouetaDeroulanta);
	var NavToggle = document.getElementById("NavToggle" + indexBouetaDeroulanta);
	var CaptionContainer = document.getElementById("NavCaption" + indexBouetaDeroulanta);
	if (!NavFrame || !NavToggle || !CaptionContainer) return;
	var caption = [];
	var CaptionSpans = CaptionContainer.getElementsByTagName('span');
	caption[0] = CaptionSpans[0].innerHTML;
	caption[1] = CaptionSpans[1].innerHTML;

	var Contents = NavFrame.getElementsByTagName('div');
	if (NavToggle.innerHTML == caption[1]) {
		NavToggle.innerHTML = caption[0];
		for(var a=0,m=Contents.length;a<m;a++){
			if( $( Contents[a] ).hasClass( 'NavContent' ) ){
				Contents[a].style.display = 'none';
				return;
			}
		}
	}else{
		NavToggle.innerHTML = caption[1];
		for(var a=0,m=Contents.length;a<m;a++){
			if($(Contents[a]).hasClass("NavContent")){
				Contents[a].style.display = 'block';
				return;
			}
		}
	}
}

function BouetaDeroulanta(Element){
	if(!Element) Element = document;
	var NavFrameCount = -1;
	var NavFrames = Element.getElementsByTagName("div");
	for(var i=0,l=NavFrames.length;i<l;i++){
		if( $( NavFrames[i] ).hasClass( 'NavFrame' ) ){
			var NavFrame = NavFrames[i];
			NavFrameCount++;
			BouetaDeroulanta_index++;

			if (NavFrame.title && NavFrame.title.indexOf("/")!=-1) {
				var Enroular = NavFrame.title.HTMLize().split("/")[1];
				var Deroular = NavFrame.title.HTMLize().split("/")[0];
			}else{
				var Enroular = BouetaDeroulanta_Enroular;
				var Deroular = BouetaDeroulanta_Deroular;
			}
			NavFrame.title='';
			var CaptionContainer = document.createElement('span');
			CaptionContainer.id = 'NavCaption' + BouetaDeroulanta_index;
			CaptionContainer.style.display = "none";
			CaptionContainer.innerHTML = '<span>' + Deroular + '</span><span>' + Enroular + '</span>';
			NavFrame.appendChild(CaptionContainer);

			var NavToggle = document.createElement("a");
			NavToggle.className = 'NavToggle';
			NavToggle.id = 'NavToggle' + BouetaDeroulanta_index;
			NavToggle.href = 'javascript:BouetaDeroulanta_toggle(' + BouetaDeroulanta_index + ');';
			var NavToggleText = document.createTextNode(Enroular);
			NavToggle.appendChild(NavToggleText);

			NavFrame.insertBefore( NavToggle, NavFrame.firstChild );
			NavFrame.id = 'NavFrame' + BouetaDeroulanta_index;
			if (BouetaDeroulanta_max <= NavFrameCount) {
				BouetaDeroulanta_toggle(BouetaDeroulanta_index);
			}
		}
	}

}
$( function() {
	BouetaDeroulanta();
} );

/**
 * Usâjo du modèlo Modèlo:Animacion
 */

var Diaporama = {};
Diaporama.Params = {};
Diaporama.Fonccions = {};

Diaporama.Params.DiaporamaIndex = 0;
Diaporama.Params.ImageDelay = 1;
Diaporama.Params.Paused = [];
Diaporama.Params.Visible = [];
Diaporama.Params.Length = [];
Diaporama.Params.Delay = [];
Diaporama.Params.Timeout = [];

Diaporama.Fonccions.Init = function(node){
	if(!node) node = document;
	var Diaporamas = $( node ).find( 'div.diaporama' ).get();
	for(var a=0,l=Diaporamas.length;a<l;a++){
		Diaporama.Fonccions.InitDiaporama(Diaporamas[a]);
	}
};
Diaporama.Fonccions.InitDiaporama = function(DiaporamaDiv){
	var index = Diaporama.Params.DiaporamaIndex;
	Diaporama.Params.DiaporamaIndex++;
	DiaporamaDiv.id = "Diaporama_"+index;
	var DiaporamaFileContainer = $( DiaporamaDiv ).find( 'div.diaporamaFiles' )[0];
	var DiaporamaControl = $( DiaporamaDiv ).find( 'div.diaporamaControl' )[0];
	if(!DiaporamaFileContainer || !DiaporamaControl) return;
	var DiaporamaFiles = $( DiaporamaFileContainer ).find( 'div.ImageFile' ).get();
	var width;
	var firstTumbinner = $( DiaporamaFileContainer ).find( 'div.thumbinner' )[0];
	if(firstTumbinner){ // fôrce la largior du diaporama (por IE)
		width = firstTumbinner.style.width.split("px").join("");
	}else{
		if(DiaporamaFileContainer.firstChild.firstChild) width = DiaporamaFileContainer.firstChild.firstChild.offsetWidth;
	}
	if(width) DiaporamaDiv.style.width = (parseInt(width)+30) + "px";
	if(DiaporamaFiles.length<2) return;
	Diaporama.Params.Length[index] = DiaporamaFiles.length;
	DiaporamaFileContainer.id = "DiaporamaFileContainer_"+index;
	DiaporamaControl.id = "DiaporamaControl_"+index;
	Diaporama.Params.Delay[index] = Diaporama.Params.ImageDelay;
	var DiaporamaDivClass = DiaporamaDiv.className.HTMLize();
	var ParamDelay = DiaporamaDivClass.match(/Delay[0-9]+(\.|,)?[0-9]*/);
	if(ParamDelay!==null){
		ParamDelay = parseFloat(ParamDelay[0].split("Delay").join("").split(",").join("."));
		if(ParamDelay && ParamDelay>0) Diaporama.Params.Delay[index] = ParamDelay;
	}
	Diaporama.Fonccions.ShowThisDiapo(index, 0);
	var ControlLinks = DiaporamaControl.getElementsByTagName("a");
	ControlLinks[0].firstChild.id = "DiaporamaPlay"+index;
	ControlLinks[0].href = "javascript:Diaporama.Fonccions.Play("+index+");";
	ControlLinks[1].firstChild.id = "DiaporamaPause"+index;
	ControlLinks[1].href = "javascript:Diaporama.Fonccions.Pause("+index+");";
	ControlLinks[2].firstChild.id = "DiaporamaStop"+index;
	ControlLinks[2].href = "javascript:Diaporama.Fonccions.Stop("+index+");";
	ControlLinks[3].firstChild.id = "DiaporamaLast"+index;
	ControlLinks[3].href = "javascript:Diaporama.Fonccions.ToggleDiapo("+index+",-1);";
	ControlLinks[4].firstChild.id = "DiaporamaNext"+index;
	ControlLinks[4].href = "javascript:Diaporama.Fonccions.ToggleDiapo("+index+", 1);";
	ControlLinks[5].parentNode.appendChild(Diaporama.Fonccions.CreateSelect(index, ControlLinks[5].title));
	ControlLinks[5].parentNode.removeChild(ControlLinks[5]);
	for(var e=0,t=ControlLinks.length;e<t;e++){
		ControlLinks[e].onmousedown = function(){Diaporama.Fonccions.Onclick(this);};
		ControlLinks[e].onmouseup = function(){Diaporama.Fonccions.Offclick(this, index);};
		ControlLinks[e].firstChild.style.backgroundColor = "white";
		ControlLinks[e].onmouseover = function(){ this.focus(); };
	}
	DiaporamaControl.style.display = "block";
	if( $( DiaporamaDiv ).hasClass( 'Autoplay' ) ){
		Diaporama.Fonccions.Play(index);
	}else{
		Diaporama.Fonccions.Pause(index);
	}
};

Diaporama.Fonccions.Play = function(index){
	if(Diaporama.Params.Paused[index] === false) return;
	Diaporama.Params.Paused[index] = false;
	clearTimeout(Diaporama.Params.Timeout[index]);
	Diaporama.Params.Timeout[index] = setTimeout("Diaporama.Fonccions.ToggleDiapo("+index+",1);", Diaporama.Params.Delay[index]*1000);
	var ButtonPlay = document.getElementById("DiaporamaPlay"+index);
	ButtonPlay.style.backgroundColor = "silver";
	var ButtonPause = document.getElementById("DiaporamaPause"+index);
	ButtonPause.style.backgroundColor = "white";
	var ButtonStop = document.getElementById("DiaporamaStop"+index);
	ButtonStop.style.backgroundColor = "white";
};

Diaporama.Fonccions.Pause = function(index){
	Diaporama.Params.Paused[index] = true;
	clearTimeout(Diaporama.Params.Timeout[index]);
	var ButtonPlay = document.getElementById("DiaporamaPlay"+index);
	ButtonPlay.style.backgroundColor = "white";
	var ButtonPause = document.getElementById("DiaporamaPause"+index);
	ButtonPause.style.backgroundColor = "silver";
	var ButtonStop = document.getElementById("DiaporamaStop"+index);
	ButtonStop.style.backgroundColor = "white";
};

Diaporama.Fonccions.Stop = function(index){
	Diaporama.Params.Paused[index] = true;
	clearTimeout(Diaporama.Params.Timeout[index]);
	Diaporama.Fonctions.ShowThisDiapo(index, 0);
	var ButtonPlay = document.getElementById("DiaporamaPlay"+index);
	ButtonPlay.style.backgroundColor = "white";
	var ButtonPause = document.getElementById("DiaporamaPause"+index);
	ButtonPause.style.backgroundColor = "white";
	var ButtonStop = document.getElementById("DiaporamaStop"+index);
	ButtonStop.style.backgroundColor = "silver";
};

Diaporama.Fonccions.ToggleDiapo = function(index, diff){
	clearTimeout(Diaporama.Params.Timeout[index]);
	var DiaporamaFileContainer = document.getElementById("DiaporamaFileContainer_"+index);
	var DiaporamaFiles = $( DiaporamaFileContainer ).find( 'div.ImageFile' ).get();
	var VisibleIndex = Diaporama.Params.Visible[index];
	var NextDiaporamaIndex = (VisibleIndex+diff);
	if(NextDiaporamaIndex==DiaporamaFiles.length || NextDiaporamaIndex<0){
			var DiaporamaDiv = document.getElementById("Diaporama_"+index);
			if( diff < 0 || ! $( DiaporamaDiv ).hasClass( 'AutoLoop' ) ){
				return;
			}
			NextDiaporamaIndex = 0;
	}
	Diaporama.Fonccions.ShowThisDiapo(index, NextDiaporamaIndex);
};

Diaporama.Fonccions.ShowThisDiapo = function(index, Value){
	clearTimeout(Diaporama.Params.Timeout[index]);
	var DiaporamaFileContainer = document.getElementById("DiaporamaFileContainer_"+index);
	var DiaporamaFiles = $( DiaporamaFileContainer ).find( 'div.ImageFile' ).get();
	for(var x=0,z=DiaporamaFiles.length;x<z;x++){
			if(x!=Value){
				DiaporamaFiles[x].style.display = "none";
			}else{
				DiaporamaFiles[x].style.display = "block";
			}
	}
	Diaporama.Params.Visible[index] = Value;
	Diaporama.Fonccions.UpdateBar(index);
	Diaporama.Fonccions.UpdateSelect(index);
	if(!Diaporama.Params.Paused[index]){
			var multipl = 1;
			if(Value==(Diaporama.Params.Length[index]-1)) multipl = 3;
			Diaporama.Params.Timeout[index] = setTimeout("Diaporama.Fonccions.ToggleDiapo("+index+",1);", Diaporama.Params.Delay[index]*1000*multipl);
	}
};

Diaporama.Fonccions.CreateSelect = function(index, Title){
	var Total = Diaporama.Params.Length[index];
	var Select = document.createElement('select');
	Select.id = "DiaporamaSelect"+index;
	Select.title = Title;
	for(var s=0;s<Total;s++){
			var Opt = document.createElement('option');
			if(s===0) Opt.selected = "selected";
			Opt.text = (s+1)+"/"+Total;
			Opt.innerHTML = (s+1)+"/"+Total;
			Opt.value = s;
			Select.appendChild(Opt);
	}
	Select.onchange = function(){ Diaporama.Fonccions.SelectDiapo(Diaporama.Fonccions.getIndex(this)); };
	Select.onmouseover = function(){ this.focus(); };
	return Select;
};

Diaporama.Fonccions.SelectDiapo = function(index){
	var Select = document.getElementById("DiaporamaSelect"+index);
	if(!Select) return;
	var Opts = Select.getElementsByTagName('option');
	for(var o=0,p=Opts.length;o<p;o++){
		if(Opts[o].selected) {
			var Value = parseInt(Opts[o].value);
			return Diaporama.Fonccions.ShowThisDiapo(index, Value);
		}
	}
};

Diaporama.Fonccions.UpdateSelect = function(index){
	var Select = document.getElementById("DiaporamaSelect"+index);
	if(!Select) return;
	var Opts = Select.getElementsByTagName('option');
	for(var o=0,p=Opts.length;o<p;o++){
		if(o==Diaporama.Params.Visible[index]) {
			Opts[o].selected = "selected";
		}else{
			Opts[o].selected = false;
		}
	}
};

Diaporama.Fonccions.UpdateBar = function(index){
	var Percent = (100/(Diaporama.Params.Length[index]-1)) * Diaporama.Params.Visible[index];
	if(Percent>100) Percent = 100;
	var DiaporamaControl = document.getElementById("DiaporamaControl_"+index);
	var DiaporamaScrollBar = $( DiaporamaControl ).find( 'div.ScrollBar' )[0];
	DiaporamaScrollBar.style.width = Percent + "%";
};

Diaporama.Fonccions.Onclick = function(Link){
	var Image = Link.getElementsByTagName('img')[0];
	Image.style.backgroundColor = "gray";
};

Diaporama.Fonccions.Offclick = function(Link, index){
	var Span = Link.parentNode;
	var SpanClass = Span.className;
	var Image = Link.getElementsByTagName('img')[0];
	var DiapoState = Diaporama.Params.Paused[index];
	if( ( $( Span ).hasClass( 'Play' ) && DiapoState === false ) || ( ( $( Span ).hasClass( 'Pause' ) || $( Span ).hasClass( 'Stop' ) ) && DiapoState === true ) ){
		Image.style.backgroundColor = "silver";
	}else{
		Image.style.backgroundColor = "white";
	}
};

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

$( function () {
	Diaporama.Fonccions.Init();
} );

/**
 * Pèrmèt de fâre vêre les catègories cachiêes por los contributors encartâs, en apondent un (+) a la façon de les bouètes dèroulantes.
 */
function hiddencat( $ ) {
	if(typeof DesactiveHiddenCat !== "undefined" && DesactiveHiddenCat) return;
	if(document.URL.indexOf("printable=yes")!=-1) return;
	var cl = document.getElementById('catlinks'); if(!cl) return;
	var $hc = $('#mw-hidden-catlinks');
	if( !$hc.length ) return;
	if( $hc.hasClass('mw-hidden-cats-user-shown') ) return;
	if( $hc.hasClass('mw-hidden-cats-ns-shown') ) $hc.addClass('mw-hidden-cats-hidden');
	var nc = document.getElementById('mw-normal-catlinks');
	if( !nc ) {
		var catline = document.createElement('div');
		catline.id = 'mw-normal-catlinks';
		var a = document.createElement('a');
		a.href = '/wiki/Catègorie:Reçua';
		a.title = 'Catègorie:Reçua';
		a.appendChild(document.createTextNode('Catègories'));
		catline.appendChild(a);
		catline.appendChild(document.createTextNode(' : '));
		nc = cl.insertBefore(catline, cl.firstChild);
	}
	else nc.appendChild(document.createTextNode(' | '));
	var lnk = document.createElement('a');
	lnk.id = 'mw-hidden-cats-link';
	lnk.title = 'Cet’articllo contint des catègories cachiêes';
	lnk.style.cursor = 'pointer';
	lnk.style.color = 'black';
	$(lnk).click(toggleHiddenCats);
	lnk.appendChild(document.createTextNode('[+]'));
	nc.appendChild(lnk);
}

function toggleHiddenCats(e) {
	var $hc = $('#mw-hidden-catlinks');
	if( $hc.hasClass('mw-hidden-cats-hidden') ) {
		$hc.removeClass('mw-hidden-cats-hidden');
		$hc.addClass('mw-hidden-cat-user-shown');
		$(e.target).text('[–]');
	} else {
		$hc.removeClass('mw-hidden-cat-user-shown');
		$hc.addClass('mw-hidden-cats-hidden');
		$(e.target).text('[+]');
	}
}

$( hiddencat );

/**
 * Script por altèrnar entre-mié un mouél de mapes de g·eolocalisacion
 */

function GeoBox_Init($content) {
	$content.find( '.img_toggle' ).each( function ( i, Container ) {
		Container.id = 'img_toggle_' + i;
		var Boxes = $( Container ).find( '.geobox' );
		if (Boxes.length < 2) {
			return;
		}
		var ToggleLinksDiv = document.createElement('ul');
		ToggleLinksDiv.id = 'geoboxToggleLinks_' + i;
		Boxes.each( function ( a, ThisBox ) {
			ThisBox.id = 'geobox_' + i + '_' + a;
			var ThisAlt;
			var ThisImg = ThisBox.getElementsByTagName('img')[0];
			if (ThisImg) {
				ThisAlt = ThisImg.alt;
			}
			if (!ThisAlt) {
				ThisAlt = 'erreur : description non trouvée';
			}
			var toggle = document.createElement('a');
			toggle.id = 'geoboxToggle_' + i + '_' + a;
			toggle.textContent = ThisAlt;
			toggle.href = 'javascript:';
			toggle.onclick = function (e) {
				e.preventDefault();
				GeoBox_Toggle(this);
			};
			var Li = document.createElement('li');
			Li.appendChild(toggle);
			ToggleLinksDiv.appendChild(Li);
			if (a === (Boxes.length - 1)) {
				toggle.style.color = '#888';
				toggle.style.pointerEvents = 'none';
			} else {
				ThisBox.style.display = 'none';
			}
		} );
		Container.appendChild(ToggleLinksDiv);
	} );
}

function GeoBox_Toggle(link) {
	var ImgToggleIndex = link.id.replace('geoboxToggle_', '').replace(/_.*/g, '');
	var GeoBoxIndex = link.id.replace(/.*_/g, '');
	var ImageToggle = document.getElementById('img_toggle_' + ImgToggleIndex);
	var Links = document.getElementById('geoboxToggleLinks_' + ImgToggleIndex);
	var Geobox = document.getElementById('geobox_' + ImgToggleIndex + '_' + GeoBoxIndex);
	var Link = document.getElementById('geoboxToggle_' + ImgToggleIndex + '_' + GeoBoxIndex);
	if ( !ImageToggle || !Links || !Geobox || !Link ) {
		return;
	}
	$( ImageToggle ).find( '.geobox' ).each( function ( _, ThisgeoBox ) {
		if (ThisgeoBox.id === Geobox.id) {
			ThisgeoBox.style.display = '';
		} else {
			ThisgeoBox.style.display = 'none';
		}
	} );
	$( Links ).find( 'a' ).each( function ( _, thisToggleLink ) {
		if (thisToggleLink.id === Link.id) {
			thisToggleLink.style.color = '#888';
			thisToggleLink.style.pointerEvents = 'none';
		} else {
			thisToggleLink.style.color = '';
			thisToggleLink.style.pointerEvents = '';
		}
	} );
}

mw.hook( 'wikipage.content' ).add( GeoBox_Init );


/**
 * Pèrmèt d’apondre un petiôt lim (per ègzemplo d’éde) a la fin du titro d’una pâge.
 * Cofieria cognua : conflit avouéc lo changement de titro cllassico.
 * Por los comentèros, marci de sè veriér vers [[fr:user:Plyd|Plyd]].
 */
function rewritePageH1bis() {
	try {
		var helpPage = document.getElementById("helpPage");
		if (helpPage) {
			var helpPageURL = document.getElementById("helpPageURL");
			var h1 = document.getElementById('firstHeading');
			if (helpPageURL && h1) {
				h1.innerHTML = h1.innerHTML + '<span id="h1-helpPage">' + helpPageURL.innerHTML + '</span>';
				helpPage.style.display = "none";
			}
		}
	} catch (e) {
		/* Something went wrong. */
	}
}
$( rewritePageH1bis );

/**
 * Aplicacion de [[fr:Wikipédia:Prise de décision/Système de cache]]
 * Un <span class="noarchive"> u tôrn du lim l’empache d’étre prês en compto
 * por ceti justo.
 * Un no_external_cache=true dedens un monobook a sè dèsactive lo script.
 */
function addcache(element) {

	if (typeof no_external_cache !== "undefined" && no_external_cache) {
		return;
	}

	var liens = element ? $(element).find('ol.references').find('a.external') : $('ol.references').find('a.external');
	for (var i = 0, l = liens.length; i < l; i++) {
		var lim_en_cors = liens[i];
		var chemin = lim_en_cors.hrrief;
		if (!chemin || chemin.indexOf("http://archive.wikiwix.com/cache/") > -1 || chemin.indexOf("http://web.archive.org/web/") > -1 || chemin.indexOf("wikipedia.org") > -1 || chemin.indexOf("wikimedia.org") > -1) {
			continue;
		}
		var element_parent = lim_en_cors.parentNode;
		if ( $( element_parent ).hasClass( 'noarchive' ) ) {
			continue;
		}
		var titre = getTextContent(lim_en_cors);
		var last = document.createElement("small");
		last.className = "cachelinks";
		last.appendChild(document.createTextNode("\u00a0["));

		/*
		Commented out because: ReferenceError: titro is not defined

		var link = document.createElement("a");
		link.setAttribute("href", "http://archive.wikiwix.com/cache/?url=" + chemin.replace(/%/g, "%25").replace(/&/g, "%26") + "&title=" + encodeURIComponent(titro));
		link.setAttribute("title", "archive de " + titro);
		link.appendChild(document.createTextNode("archive"));*/

		last.appendChild(link);
		last.appendChild(document.createTextNode("]"));

		element_parent.insertBefore(last, lim_en_cors.nextSibling);
	}
}

if ( mw.config.get( 'wgNamespaceNumber' ) === 0 ) {
	$( function() {
		addcache();
	} );
}

$( function ($) {
	/**
	* Rètablét l’accès cllaviér a la fonccion de tri de les grelyes.
	*/

	$( '.sortable th' ).attr( 'tabindex', 0 ).keypress( function( event ) {
		if ( event.which == 13 ) {
			$( this ).click();
		}
	} );
} );


/**
 * Direct imagelinks to Commons
 *
 * Required modules: mediawiki.util
 *
 * @source www.mediawiki.org/wiki/Snippets/Direct_imagelinks_to_Commons
 * @author Krinkle
 * @version 2015-06-23
 */
if ( mw.config.get( 'wgNamespaceNumber' ) >= 0 ) {
	mw.loader.using( [ 'mediawiki.util' ] ).done(function(){
		mw.hook( 'wikipage.content' ).add( function ( $content ) {
			var
				uploadBaseRe = /^\/\/upload\.wikimedia\.org\/wikipedia\/commons/,
	
				localBasePath = new RegExp( '^' + mw.RegExp.escape( mw.util.getUrl( mw.config.get( 'wgFormattedNamespaces' )['6'] + ':' ) ) ),
				localBaseScript = new RegExp( '^' + mw.RegExp.escape( mw.util.wikiScript() + '?title=' + mw.util.wikiUrlencode( mw.config.get( 'wgFormattedNamespaces' )['6'] + ':' ) ) ),
	
				commonsBasePath = '//commons.wikimedia.org/wiki/File:',
				commonsBaseScript = '//commons.wikimedia.org/w/index.php?title=File:';
	
			$content.find( 'a.image, a.mw-file-description' ).attr( 'href', function ( i, currVal ) {
				if ( uploadBaseRe.test( $( this ).find( 'img' ).attr( 'src' ) ) ) {
					return currVal
						.replace( localBasePath, commonsBasePath )
						.replace( localBaseScript, commonsBaseScript );
				}
			} );
		} );
	} );
}

/**
 * Aponsa d’un lim apondre na sèccion por la dèrriére sèccion
 * https://de.wikipedia.org/wiki/MediaWiki:Common.js
 */
$( function( $ ) {
	var $newSectionLink = $( '#ca-addsection a' );
	if ( $newSectionLink.length ) {
		var link = $newSectionLink.clone(); //create a copy
		//avoid duplicate accesskey
		link.removeAttr( 'accesskey' ).attr( 'title', function ( index, oldTitle ) {
			return oldTitle.replace( /\s*\[.*\]\s*$/, '' );
		} );
		// add it within the brackets
		var lastEditsectionLink = $( 'span.mw-editsection:last a:last' );
		lastEditsectionLink.after( link );
		lastEditsectionLink.after( ' | ' ); // see [[MediaWiki:Pipe-separator]]
	}
} );

/***************************************************************************/
/* Fonccions rigorosament spècifiques a un èspâço de noms ou ben a na pâge */
/***************************************************************************/

/**
 * Sur la pâge de reçua solament
 */
if ( mw.config.get( 'wgIsMainPage' ) ) {

	/**
	 * Lim de vers la lista complèta de les Vouiquipèdies d’avâl la lista de les lengoues
	 */
	mw.loader.using( [ 'mediawiki.util' ], function () {
		$( function() {
			mw.util.addPortletLink( 'p-lang', '//www.wikipedia.org/', 'Lista complèta', 'entervouiqui-listacompleta', 'Lista complèta de les Vouiquipèdies' );
		} );
	} );

}

// ÈSPÂÇO DE NOMS 'SPÈCIÂL'
if ( mw.config.get( 'wgNamespaceNumber' ) === -1 ) {


/**
 * Fât vêre un modèlo Enformacion sur la pâge de tèlèchargement de fichiérs [[Spèciâl:Tèlèchargement]].
 * Vêde asse-ben [[MediaWiki:Onlyifuploading.js]].
 */
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {
	importScript( 'MediaWiki:Onlyifuploading.js' );
}


/**
 * Ôte de la lista de les balises disponibles et de la lista de les balises suprimâbles 
 * doux-três balises resèrvâyes a des outils ôtomaticos.
 * 
 */
if(mw.config.get('wgCanonicalSpecialPageName') === 'EditTags'){ (function(){
  var TagsToHide = [
    'AWB',
    'BendesCategories',
    'BendesComencons',
    'BendesPortals',
    'HotCats',
    'LiveRC',
    'PaFtec',
    'PaStec',
    'Popups',
    'RenomajoCategoria',
    'WPCleaner'
  ];
  var trytodeletesometags = function(){
    var permissionError = $.makeArray( $(document).find("div.permissions-errors") ); 
    if(permissionError.length > 0) return;
    var a, l;
    var Container = document.getElementById("mw_edittags_tag_list_chzn");
    if(Container){
      var choices = $.makeArray( $(Container).find("li.search-choice") );
      for(a=0,l=choices.length;a<l;a++){
        var thischoice = choices[a];
        var thischoicetext = thischoice.firstChild.innerHTML;
        if(TagsToHide.indexOf(thischoicetext) !== -1){
          var deletelink = thischoice.getElementsByTagName('a')[0];
          if(deletelink){
            deletelink.parentNode.removeChild(deletelink);
            thischoice.style.paddingLeft = "5px";
            thischoice.style.paddingRight = "5px";
          }
        }
      }
      var activeresult = $.makeArray( $(Container).find("li.active-result"));
      for(a=0,l=activeresult.length;a<l;a++){
        var thisactiveresult = activeresult[a];
        var thisactiveresulttext = thisactiveresult.innerHTML;
        if(TagsToHide.indexOf(thisactiveresulttext) !== -1) thisactiveresult.parentNode.removeChild(thisactiveresult);
      }
    }
    var Checkboxes = $.makeArray( $(document).find("input.mw-edittags-remove-checkbox"));
    var canremoveall = true;
    for(a=0,l=Checkboxes.length;a<l;a++){
      var thischeckbox = Checkboxes[a];
      if(TagsToHide.indexOf(thischeckbox.value) !== -1){
        thischeckbox.disabled = "disabled";
        canremoveall = false;
      }
    }
    if(!canremoveall){
      var removeall = document.getElementById("mw-edittags-remove-all");
      if(removeall) removeall.disabled = "disabled";
    }
  };
  mw.loader.using("mediawiki.special.edittags", function(){ 
    $(trytodeletesometags);
  });
})(); }

} // Fin du code que regârde l’èspâço de noms 'Spèciâl'


// ÈSPÂÇO DE NOMS 'UTILISATOR'
if ( mw.config.get( 'wgNamespaceNumber' ) === 2 ) {

/* COMENCEMENT DU CODE JAVASCRIPT DE « CÂDRO D’ONGLLÈTES »
 * Fonccionement du [[Modèlo:Câdro d’ongllètes]]
 * Modèlo emplantâ per User:Peleguer de https://ca.wikipedia.org
 * Betâ a jorn per User:Joanjoc de https://ca.wikipedia.org
 * Traduccion et adaptacion User:Antaya de https://fr.wikipedia.org
 * Endèpendence de cllâsses CSS et neteyâjo per User:Nemoi de https://fr.wikipedia.org
*/

function CadroOnglletaInitN( $ ) {

	var Cllassors = $('div.cllassor');
	for ( var i = 0; i < Cllassors.length; i++ ) {
		var Cllassor = Cllassors[i];

		Cllassor.setAttribute( "id", "cllassor" + i );

		var vOgIni = -1; // por cognetre l’onglèta rensègnêe

		var Onglletes = $(Cllassor).children("div").eq(0).children("div");
		var Folyets = $(Cllassor).children("div").eq(1).children("div");

		for ( var j = 0; j < Onglletes.length; j++) {
				var Onglleta = Onglletes[j];
				var Folyet = Folyets[j];

				Onglleta.setAttribute( "id", "cllassor" + i + "onglleta" + j );
				Folyet.setAttribute( "id", "cllassor" + i + "folyet" + j );
				Onglleta.onclick = CadroOnglletaVereOnglletaN;

				if ( $( Onglleta ).hasClass( 'onglletaBotonSel' ) ) vOgIni=j;
		}

		// inutilo mas pas se l’ongllèta de dèpârt est *mâl-rensègnêe*
		if (vOgIni == -1) {
				var vOgIni = Math.floor((Onglletes.length)*Math.random());
				document.getElementById("cllassor"+i+"folyet"+vOgIni).style.display = "block";
				document.getElementById("cllassor"+i+"folyet"+vOgIni).style.visibility = "visible";
				var vBtElem = document.getElementById("cllassor"+i+"onglleta"+vOgIni);
				$(Onglleta).removeClass("onglletaBotonPasSel");
				$(Onglleta).addClass("onglletaBotonSel");
				vBtElem.style.cursor="default";
				vBtElem.style.backgroundColor="inherit";
				vBtElem.style.borderTopColor="inherit"; // a châ propriètât ôtrament Chrome/Chromium sè manque
				vBtElem.style.borderRightColor="inherit";
				vBtElem.style.borderBottomColor="inherit";
				vBtElem.style.borderLeftColor="inherit";
		}
	}
}

function CadroOnglletaVereOnglletaN(){
	var vOnglletaNom = this.id.substr(0,this.id.indexOf("onglleta",1));
	var vOnglletaEndex = this.id.substr(this.id.indexOf("onglleta",0)+6,this.id.length);

	var rule1=$('#' + vOnglletaNom + ' .onglletaBotonPasSel')[0].style.backgroundColor.toString();
	var rule2=$('#' + vOnglletaNom + ' .onglletaBotonPasSel')[0].style.borderColor.toString(); // rule2=$('.onglletaBotonPasSel').css("border-color"); fonccione pas desot Firefox

	var Onglletes = $('#' + vOnglletaNom).children("div").eq(0).children("div");

	for ( var j = 0; j < Onglletes.length; j++) {
		var Onglleta = Onglletes[j];
		var Folyet = document.getElementById(vOnglletaNom + "folyet" + j);

		if (vOnglletaEndex==j){
			Folyet.style.display = "block";
			Folyet.style.visibility = "visible";
			$(Onglleta).removeClass("onglletaBotonPasSel");
			$(Onglleta).addClass("onglletaBotonSel");
			Onglleta.style.cursor="default";
			Onglleta.style.backgroundColor="inherit";
			Onglleta.style.borderTopColor="inherit"; // a châ propriètât ôtrament Chrome/Chromium sè manque
			Onglleta.style.borderRightColor="inherit";
			Onglleta.style.borderBottomColor="inherit";
			Onglleta.style.borderLeftColor="inherit";
		} else {
			Folyet.style.display = "none";
			Folyet.style.visibility = "hidden";
			$(Onglleta).removeClass("onglletaBotonSel");
			$(Onglleta).addClass("onglletaBotonPasSel");
			Onglleta.style.cursor="pointer";
			Onglleta.style.backgroundColor=rule1;
			Onglleta.style.borderColor=rule2;
		}
	}
	return false;
}

$( CadroOnglletaInitN );
/* FIN DU CODE JAVASCRIPT DE « CÂDRO D’ONGLLÈTES » */

} // Fin du code que regârde l’èspâço de noms 'Utilisator'


// ÈSPÂÇO DE NOMS 'REFÈRENCE'
if ( mw.config.get( 'wgNamespaceNumber' ) === 104 ) {

/*
 * Chouèx de la fôrma de visualisacion de les refèrences
 * Devriant en principo sè trovar en fllanc de sèrvior.
 * @nota L’ôrdre de cela lista dêt corrèspondre a celi de Modèlo:Èdicion !
 */

function addBibSubsetMenu( $ ) {
	var specialBib = document.getElementById('specialBib');
	if (!specialBib) return;

	specialBib.style.display = 'block';
	menu = '<select style="display:inline;" onChange="chooseBibSubset(selectedIndex)">'
		+ '<option>Lista</option>'
		+ '<option>VouiquiNôrma</option>'
		+ '<option>BibTeX</option>'
		+ '<option>ISBD</option>'
		+ '<option>ISO690</option>'
		+ '</select>';
	specialBib.innerHTML = specialBib.innerHTML + menu;

	/* default subset - try to use a cookie some day */
	chooseBibSubset(0);
}

// select subsection of special characters
function chooseBibSubset(s) {
	var l = document.getElementsByTagName('div');
	for (var i = 0; i < l.length; i++) {
		if(l[i].className == 'BibList') l[i].style.display = s === 0 ? 'block' : 'none';
		else if(l[i].className == 'VouiquiNorma') l[i].style.display = s == 1 ? 'block' : 'none';
		else if(l[i].className == 'BibTeX') l[i].style.display = s == 2 ? 'block' : 'none';
		else if(l[i].className == 'ISBD') l[i].style.display = s == 3 ? 'block' : 'none';
		else if(l[i].className == 'ISO690') l[i].style.display = s == 4 ? 'block' : 'none';
	}
}
$( addBibSubsetMenu );
} // Fin du code que regârde l’èspâço de noms 'Refèrence'


/* Pèrmèt de fâre vêre un compt’a revèrchon sur na pâge avouéc lo modèlo [[Modèlo:Compt’a revèrchon]]. */
/* fr:Plyd - 3 de fevriér 2009 */
function Reverchon() {
	try {
		if (document.getElementById("reverchon")) {
			destime = document.getElementById("reverchon").title.HTMLize().split(";;");
			Ora = (new Date ()).getTime();
			Future = new Date(Date.UTC(destime[0], (destime[1]-1), destime[2], destime[3], destime[4], destime[5])).getTime();
			Diff = (Future-Ora);
			if (Diff < 0) {Diff = 0;}
			TempsRestentJ = Math.floor(Diff/(24*3600*1000));
			TempsRestentH = Math.floor(Diff/(3600*1000)) % 24;
			TempsRestentM = Math.floor(Diff/(60*1000)) % 60;
			TempsRestentS = Math.floor(Diff/1000) % 60;
			TempsRestent = "" + destime[6] + " ";
			if (TempsRestentJ == 1) {
					TempsRestent = TempsRestent + TempsRestentJ + " jorn ";
			} else if (TempsRestantJ > 1) {
					TempsRestent = TempsRestent + TempsRestentJ + " jorns ";
			}
			TempsRestent = TempsRestent + TempsRestentH + " h " + TempsRestentM + " men " + TempsRestentS + " s";
			document.getElementById("reverchon").innerHTML = TempsRestent;
			setTimeout("Reverchon()", 1000);
		}
	} catch (e) {}
}
if ( mw.config.get( 'wgNamespaceNumber' ) !== 0 ) {
	$( Reverchon );
}

/**
 * Apond la dâta de dèrriér changement sur la benda novél èvènement
 */
function LastModCopy( $ ) {
	// L’id change entre-mié Monobook et Modern d’un fllanc, et pués Vector d’un ôtro fllanc.
	$( '.lastmodcopy' ).html( $( '#lastmod, #footer-info-lastmod' ).html() );
}
$( LastModCopy );

/**
 * Impôrt des scripts liyês a la lista de siuvu
 */
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist' ) {
	importScript( 'MediaWiki:Common.js/watchlist.js' );
}

/********************************/
/* Ôtres fonccions pas rengiêes */
/********************************/

/*
* Fonccion
*
* Rècupère la valor d’una variâbla gllobâla en govèrnent lo câs quand cela variâbla ègziste pas.
* @param nom_variabla Nom de la variâbla que vôlont cognetre la valor.
* @param val_defot Valor per dèfôt se la variâbla ègziste pas.
* @return La valor de la variâbla, ou ben val_defot se la variâbla ègziste pas.
*
* Ôtor : fr:Sanao
* Dèrriére vèrsion : 22 de novembro 2007
*/
function getVarValue(nom_variabla, val_defot)
{
	var result = null;

	try {
		result = eval(nom_variabla.toString());
	} catch (e) {
		result = val_defot;
	}

	return(result);
}

/*
* Fonccion
*
* Retôrne na chêna de caractèros de la dâta corenta d’aprés dens un cèrtin format.
* @param format Format de la dâta "j" por lo jorn, "m" por lo mês et "a" por l’an. D’ense s’o est lo 21 de novembro 2007 et pâssont en paramètro cela chêna "a_m_d", la chêna retornâye serat "2007_novembro_21"
* Ôtor : fr:Sanao
* Dèrriére vèrsion : 21 de novembro 2007
*/
function getStrDateToday(format)
{
	var str_mes = [];
	with (str_mes)
	{
		push("janviér");
		push("fevriér");
		push("mârs");
		push("avril");
		push("mê");
		push("jouen");
		push("julyèt");
		push("oût");
		push("septembro");
		push("octobro");
		push("novembro");
		push("dècembro");
	}
	var today = new Date();
	var day = today.getDate();
	var year = today.getYear();
	if (year < 2000)
	{
		year = year + 1900;
	}
	var str_date = format;

	//Crèacion de la chêna
	var regex = /j/gi;
	str_date = str_date.replace(regex, day.toString());
	regex = /a/gi;
	str_date = str_date.replace(regex, year.toString());
	regex = /m/gi;
	str_date = str_date.replace(regex, str_mois[today.getMonth()]);

	return (str_date);
}