-

De Wiki Grepolis AR
Saltar a: navegación, buscar
 
(No se muestra una edición intermedia del mismo usuario)
Línea 1: Línea 1:
//Alias
+
/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios en cada carga de página */
(function ( $, mw ) {
 
/**
 
* Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 
* loaded for all users on every wiki page. If possible create a gadget that is
 
* enabled by default instead of adding it here (since gadgets are fully
 
* optimized ResourceLoader modules with possibility to add dependencies etc.)
 
*
 
* Since common.js isn't a gadget, there is no place to declare its
 
* dependencies, so we have to lazy load them with mw.loader.using on demand and
 
* then execute the rest in the callback. In most cases these dependencies will
 
* be loaded (or loading) already and the callback will not be delayed. In case a
 
* dependency hasn't arrived yet it'll make sure those are loaded before this.
 
*/
 
mw.loader.using( 'mediawiki.util', function() {
 
/* Begin of mw.loader.using callback */
 
  
//Compatibilidad
+
// Rewrite of announcement display. (by Menidan) add wiki grepolis.es by Atálida
 +
$ (function () {
 +
// Changes the announcement to the next announcement in the list.
 +
function changeAnnouncement () {
 +
$ (announcementList [currentAnnouncement]).fadeOut ("normal", function () {
 +
++currentAnnouncement;
 +
if (currentAnnouncement >= announcementList.length)
 +
currentAnnouncement = 0;
 +
$ (announcementList [currentAnnouncement]).fadeIn ();
 +
});
 +
}
  
/* Scripts specific to Internet Explorer */
+
var announcementList = $ (".announcement");
if ($.client.profile().name == 'msie') {
+
var currentAnnouncement = 0;
    if ( +$.client.profile().versionBase < 11 ) {
+
var announcementVisibilityTime = 5000; // ms
        /**
 
        *  Description: Fixes IE horizontal scrollbar bug
 
        *  Maintainers: [[User:Tom-]]?
 
        */
 
        var oldWidth;
 
        var docEl = document.documentElement;
 
  
        var doFixIEScroll = function () {
+
announcementList.hide ();
            docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth < 4) ? "hidden" : "";
+
if (announcementList.length > 1) {
        };
+
$ (announcementList [0]).fadeIn ();
        var fixIEScroll = function () {
+
setInterval (changeAnnouncement, announcementVisibilityTime);
            if (!oldWidth || docEl.clientWidth > oldWidth) {
+
} else if (announcementList.length > 0)
                doFixIEScroll();
+
announcementList.fadeIn ();
            } else {
 
                setTimeout(doFixIEScroll, 1);
 
            }
 
  
            oldWidth = docEl.clientWidth;
 
        };
 
  
        document.attachEvent("onreadystatechange", fixIEScroll);
+
// Piwik is undefined -> comment it out.
        document.attachEvent("onresize", fixIEScroll);
+
/*
    }
+
try {
 +
var piwikTracker = Piwik.getTracker (pkBaseURL + "piwik.php", 2);
 +
piwikTracker.trackPageView ();
 +
piwikTracker.enableLinkTracking ();
 +
} catch (err) {}
 +
*/
 +
});
  
    // IE overflow bug
 
    mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');
 
  
    // IE zoomfix
+
// hasta aquí
    // Use to fix right floating div/table inside tables
 
    mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}');
 
  
    /* Helper script for .hlist class in common.css
+
importScript_ = importScript
    * Maintainer: [[User:Edokter]]
+
importScript = function (page, proj){
    */
+
if (!proj) importScript_(page)
    /* Add pseudo-selector class to last child list items in IE 8 */
+
else {
    if ( $.client.profile().versionBase == '8' ) {
+
  if (proj.indexOf('.')==-1) proj += '.wikipedia.org'
        $( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' )
+
  importScriptURI('http://'+proj+'/w/index.php?action=raw&ctype=text/javascript&title='+encodeURIComponent(page.replace(/ /g,'_')))
          .addClass( 'hlist-last-child' );
+
}
    }
 
 
}
 
}
 +
importMW = function (name) { importScript('MediaWiki:'+name+'.js') }
  
/* Fixes for Windows XP font rendering */
 
if (navigator.appVersion.search(/windows nt 5/i) != -1) {
 
    mw.util.addCSS('.IPA {font-family: "Lucida Sans Unicode", "Arial Unicode MS";} ' +
 
                  '.Unicode {font-family: "Arial Unicode MS", "Lucida Sans Unicode";}');
 
}
 
 
/* Helper script for .hlist class in common.css
 
* Maintainer: [[User:Edokter]]
 
*/
 
  
// Funcionalidad
+
function LinkFA(){
 
+
  var pLang = document.getElementById('p-lang')
/**
+
  if (!pLang) return
  * Redirect User:Name/skin.js and skin.css to the current skin's pages
+
  var list = {
* (unless the 'skin' page really exists)
+
  'fa':'Эта статья является избранной',
  * @source: //www.mediawiki.org/wiki/Snippets/Redirect_skin.js
+
'fl':'Этот список или портал является избранным',
  * @rev: 3
+
'ga':'Эта статья является хорошей'}
  */
+
var iw = pLang.getElementsByTagName('li')
if ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgNamespaceNumber' ) === 2 ) {
+
for (var i=0; i<iw.length; i++)
    var titleParts = mw.config.get( 'wgPageName' ).split( '/' );
+
  for (var s in list)
    // Make sure there was a part before and after the slash
+
    if (document.getElementById(iw[i].className+'-'+s)){
    // And that the latter is 'skin.js' or 'skin.css'
+
      iw[i].className += ' ' + s.toUpperCase()
    if ( titleParts.length == 2 ) {
+
      iw[i].title = list[s] + ' в другом языковом разделе'
        var userSkinPage = titleParts[0] + '/' + mw.config.get( 'skin' );
+
    }
        if ( titleParts[1] === 'skin.js' ) {
 
            location.href = mw.util.getUrl( userSkinPage + '.js' );
 
        } else if ( titleParts[1] === 'skin.css' ) {
 
            location.href = mw.util.getUrl( userSkinPage + '.css' );
 
        }
 
    }
 
 
}
 
}
  
/** &withCSS= and &withJS= URL parameters *******
 
* Allow to try custom scripts from MediaWiki space
 
* without editing personal .css or .js files
 
*/
 
var extraCSS = mw.util.getParamValue('withCSS'),
 
    extraJS = mw.util.getParamValue('withJS');
 
  
if (extraCSS) {
+
function icqIcons(){
    if (extraCSS.match(/^MediaWiki:[^&<>=%#]*\.css$/)) {
+
var a, spans = document.getElementById('content').getElementsByTagName('span')
        mw.loader.load('/w/index.php?title=' + extraCSS + '&action=raw&ctype=text/css', 'text/css');
+
for (var i=0; a=spans[i]; i++)
    } else {
+
  if (a.className == 'ICQ')
        mw.notify('Solo se pueden cargar páginas del espacio de nombres MediaWiki.', {title: 'Valor withCSS no permitido'});
+
    a.style.backgroundImage = "url('http://status.icq.com/online.gif?icq="+a.id+"&img=5&randseed="+Math.floor(Math.random()*10000000)+"')"
    }
 
 
}
 
}
  
if (extraJS) {
 
    if (extraJS.match(/^MediaWiki:[^&<>=%#]*\.js$/)) {
 
        mw.loader.load('/w/index.php?title=' + extraJS + '&action=raw&ctype=text/javascript');
 
    } else {
 
        mw.notify('Solo se pueden cargar páginas del espacio de nombres MediaWiki.', {title: 'Valor withJS no permitido'});
 
    }
 
}
 
  
// Results from Wikidata
+
function editZeroSection(){
// [[File:Wdsearch_script_screenshot.png]]
+
var body = document.getElementById('bodyContent')
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ||  ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgCanonicalSpecialPageName' ) === false ) ) {
+
if (!body) return
        mw.loader.load("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");
+
var h2s = body.getElementsByTagName('H2')
 +
var h2 = h2s[0]
 +
if (!h2) return
 +
if (h2.parentNode.id == 'toctitle') h2 = h2s[1]
 +
if (!h2) return
 +
var span = h2.firstChild
 +
if (!span || span.className != 'editsection') return
 +
  var zero = span.cloneNode(true)
 +
body.insertBefore(zero, body.firstChild)
 +
var a = zero.getElementsByTagName('a')[0]
 +
if (a.href.indexOf('&section=T') == -1 )  a.title = a.title.replace(/:.*$/,': 0')
 +
else a.title = 'Править секцию: 0'
 +
a.setAttribute('href', wgScript + '?title='+encodeURIComponent(wgPageName) + '&action=edit&section=0')
 
}
 
}
  
//Edición
 
if ( $.inArray(mw.config.get('wgAction'), ['edit', 'submit'] ) > -1) {
 
    /** Fix edit summary prompt for undo  ******************************************
 
    *  Fixes the fact that the undo function combined with the "no edit summary prompter"
 
    *  causes problems if leaving the edit summary unchanged.
 
    *  Added by [[User:Deskana]], code by [[User:Tra]].
 
    *  See also [[bugzilla:8912]].
 
    */
 
    $(document).ready( function () {
 
        if (location.search.indexOf("undo=") != -1 && document.getElementsByName('wpAutoSummary')[0]) {
 
            document.getElementsByName('wpAutoSummary')[0].value = '1';
 
        }
 
    });
 
 
    /**
 
    * Caracteres especiales (edittools)
 
    * Crea (y coloca) el ''combobox'' que permite seleccionar un conjunto determinado de
 
    * caracteres especiales bajo la caja de edición.
 
    * Funciona en conjunto con [[MediaWiki:Edittools]] y [[MediaWiki:Edittools.js]].
 
    * Basado en [[commons:MediaWiki:Edittools.js]].
 
    */
 
    mw.loader.load('/w/index.php?title=MediaWiki:Edittools.javascript&action=raw&ctype=text/javascript');
 
  
    //Seguimiento
 
} else if (mw.config.get('wgPageName') == 'Especial:Seguimiento') {
 
    mw.loader.load( mw.config.get('wgServer') + mw.config.get('wgScript') +
 
        '?title=MediaWiki:Common.js/seguimiento.js&action=raw&ctype=text/javascript');
 
}
 
  
//Wikibugs
 
mw.loader.load('/w/index.php?title=MediaWiki:Wikibugs.js&action=raw&ctype=text/javascript');
 
  
/** WikiMiniAtlas *******************************************************
+
//Collapsiblе: [[ВП:СБ]]
*
 
*  Description: WikiMiniAtlas is a popup click and drag world map.
 
*              This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
 
*              The script itself is located on meta because it is used by many projects.
 
*              See [[Meta:WikiMiniAtlas]] for more information.
 
*  Maintainers: [[User:Dschwen]]
 
*/
 
window.wma_settings = {
 
    buttonImage: "//upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Erioll_world.svg/15px-Erioll_world.svg.png"
 
};
 
  
mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript');
+
var NavigationBarShowDefault = 2
 +
var NavigationBarHide = '[Ocultar]'
 +
var NavigationBarShow = '[Ver]'
  
/* OpenStreetMap */
+
var hasClass = (function (){
mw.config.set( 'osm_proj_map', 'mapa' ); //"map" in project language
+
var reCache = {}
mw.config.set( 'osm_proj_lang', 'es' ); //project language
+
return function (element, className){
 +
  return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className)
 +
  }
 +
})()
  
mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:OSM.js&action=raw&ctype=text/javascript');
+
function collapsibleTables(){
 +
var Table, HRow,  HCell, btn, a, tblIdx = 0, colTables = []
 +
var allTables = document.getElementsByTagName('table')
 +
for (var i=0; Table = allTables[i]; i++){
 +
  if (!hasClass(Table, 'collapsible')) continue
 +
  if (!(HRow=Table.rows[0])) continue
 +
  if (!(HCell=HRow.getElementsByTagName('th')[0])) continue
 +
  Table.id = 'collapsibleTable' + tblIdx
 +
  btn = document.createElement('span')
 +
  btn.style.cssText = 'float:right; font-weight:normal; font-size:smaller'
 +
  a = document.createElement('a')
 +
  a.id = 'collapseButton' + tblIdx
 +
  a.href = 'javascript:collapseTable(' + tblIdx + ');'
 +
  a.style.color = HCell.style.color
 +
  a.appendChild(document.createTextNode(NavigationBarHide))
 +
  btn.appendChild(a)
 +
  HCell.insertBefore(btn, HCell.childNodes[0])
 +
  colTables[tblIdx++] = Table
 +
}
 +
for (var i=0; i < tblIdx; i++)
 +
  if ((tblIdx > NavigationBarShowDefault && hasClass(colTables[i], 'autocollapse')) || hasClass(colTables[i], 'collapsed'))
 +
    collapseTable(i)
 +
}
  
/** Mejoras de diseño de la Portada
+
function collapseTable (idx){
  *
+
  var Table = document.getElementById('collapsibleTable' + idx)
  * Descripción: Varias mejoras de diseño para la portada, incluyendo un
+
  var btn = document.getElementById('collapseButton' + idx)
  *                      enlace adicional a la lista completa de idiomas disponibles.
+
  if (!Table || !btn) return false
  *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
+
  var Rows = Table.rows
  * Adaptado de [[en:MediaWiki:Common.js]]
+
  var isShown = (btn.firstChild.data == NavigationBarHide)
  */
+
  btn.firstChild.data = isShown ? NavigationBarShow : NavigationBarHide
if ($.inArray(mw.config.get('wgPageName'), ['Wikipedia:Portada']) > -1) {
+
  var disp = isShown ? 'none' : Rows[0].style.display
    $(document).ready(function () {
+
for (var i=1; i < Rows.length; i++)
        mw.util.addPortletLink('p-lang', '//es.wikipedia.org/wiki/Anexo:Wikipedias',
+
    Rows[i].style.display = disp
            'Lista completa', 'interwiki-completelist', 'Lista completa de Wikipedias');
 
    });
 
 
}
 
}
  
// Oculta los resumenes de edición para ciertas páginas
+
function collapsibleDivs(){
var paginasSinRE = [
+
var navIdx = 0, colNavs = [], i, NavFrame
    "Wikipedia:Tablón_de_anuncios_de_los_bibliotecarios/Portal/Plantillas/Fusión_de_historiales/precarga",
+
var divs = document.getElementById('content').getElementsByTagName('div')
    "Wikipedia:Tablón_de_anuncios_de_los_bibliotecarios/Portal/Plantillas/Permisos/precarga",
+
for (i=0; NavFrame = divs[i]; i++) {
    "Wikipedia:Bot/Solicitudes/Precarga"
+
  if (!hasClass(NavFrame, 'NavFrame')) continue
];
+
  NavFrame.id = 'NavFrame' + navIdx
if ( $.inArray(mw.util.getParamValue('preload'), paginasSinRE ) > -1) {
+
  var a = document.createElement('a')
    $(document).ready(function () {
+
  a.className = 'NavToggle'
        $('#wpSummary').hide();
+
  a.id = 'NavToggle' + navIdx
        $('#wpSummaryLabel').hide();
+
  a.href = 'javascript:collapseDiv(' + navIdx + ');'
    });
+
  a.appendChild(document.createTextNode(NavigationBarHide))
 +
  for (var j=0; j < NavFrame.childNodes.length; j++)
 +
    if (hasClass(NavFrame.childNodes[j], 'NavHead'))
 +
      NavFrame.childNodes[j].appendChild(a)
 +
  colNavs[navIdx++] = NavFrame
 +
}
 +
for (i=0; i < navIdx; i++)
 +
  if ((navIdx > NavigationBarShowDefault && !hasClass(colNavs[i], 'expanded')) || hasClass(colNavs[i], 'collapsed'))
 +
    collapseDiv(i)
 
}
 
}
  
 +
function collapseDiv(idx) {
 +
var div = document.getElementById('NavFrame' + idx)
 +
var btn = document.getElementById('NavToggle' + idx)
 +
if (!div || !btn) return false
 +
var isShown = (btn.firstChild.data == NavigationBarHide)
 +
btn.firstChild.data = isShown ? NavigationBarShow : NavigationBarHide
 +
var disp = isShown ? 'none' : 'block'
 +
for (var child = div.firstChild;  child != null;  child = child.nextSibling)
 +
  if (hasClass(child, 'NavPic') || hasClass(child, 'NavContent'))
 +
      child.style.display = disp
 +
}
  
/*
+
function voting12(){
* Cerrar mensajes
+
  if (votingTrigger = document.getElementById('voting-trigger'))
* Ver ejemplo en [[Usuario:Chabacano/Fírmalo]], por [[Usuario:Platonides]].
+
  importScriptURI(wgServer+wgScript
  */
+
  +'?title=MediaWiki:Voting12.js&action=raw&ctype=text/javascript&cversion='
if (document.getElementById("cierraPadre")) {
+
  +encodeURIComponent(votingTrigger.innerHTML.replace(/\D+/g, '.')))
    $(document).ready(function () {
 
        document.getElementById("cierraPadre").childNodes[0].onclick = function () {
 
            document.getElementById("cierraPadre").style.cursor = 'pointer';
 
            document.getElementById("cierraPadre").parentNode.style.display = 'none';
 
            return false; /*no seguir el href*/
 
        };
 
    });
 
 
}
 
}
  
/**
+
//Secure server
* Collapsible tables
+
var metaBase = 'http://meta.wikimedia.org'
*
+
if (wgServer == 'https://secure.wikimedia.org') {
* @version 2.0.1 (2013-03-26)
+
  importScript('MediaWiki:Common.js/secure.js','en')
* @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js
+
  metaBase = 'https://secure.wikimedia.org/wikipedia/meta'
* @author [[User:R. Koot]]
 
* @author [[User:Krinkle]]
 
* @deprecated Since MediaWiki 1.20: Use class="mw-collapsible" instead which
 
* is supported in MediaWiki core.
 
*/
 
 
var autoCollapse = 2;
 
var collapseCaption = 'ocultar';
 
var expandCaption = 'mostrar';
 
 
window.collapseTable = function( tableIndex ) {
 
var Button = document.getElementById( 'collapseButton' + tableIndex );
 
var Table = document.getElementById( 'collapsibleTable' + tableIndex );
 
 
if ( !Table || !Button ) {
 
return false;
 
}
 
 
var Rows = Table.rows;
 
 
if ( Button.firstChild.data == collapseCaption ) {
 
for ( var i = 1; i < Rows.length; i++ ) {
 
Rows[i].style.display = 'none';
 
}
 
Button.firstChild.data = expandCaption;
 
} else {
 
for ( var i = 1; i < Rows.length; i++ ) {
 
Rows[i].style.display = Rows[0].style.display;
 
}
 
Button.firstChild.data = collapseCaption;
 
}
 
};
 
 
window.createClickHandler = function( tableIndex ) {
 
return function ( e ) {
 
e.preventDefault();
 
collapseTable( tableIndex );
 
};
 
};
 
 
function createCollapseButtons() {
 
var tableIndex = 0;
 
var NavigationBoxes = {};
 
var Tables = document.getElementsByTagName( 'table' );
 
 
for ( var i = 0; i < Tables.length; i++ ) {
 
if ( $( Tables[i] ).hasClass( 'collapsible' ) ) {
 
/* only add button and increment count if there is a header row to work with */
 
var HeaderRow = Tables[i].getElementsByTagName( 'tr' )[0];
 
if ( !HeaderRow ) {
 
continue;
 
}
 
var Header = HeaderRow.getElementsByTagName( 'th' )[0];
 
if ( !Header ) {
 
continue;
 
}
 
 
NavigationBoxes[tableIndex] = Tables[i];
 
Tables[i].setAttribute( 'id', 'collapsibleTable' + tableIndex );
 
 
var Button = document.createElement( 'span' );
 
var ButtonLink = document.createElement( 'a' );
 
var ButtonText = document.createTextNode( collapseCaption );
 
 
Button.style.styleFloat = 'right';
 
Button.style.cssFloat = 'right';
 
Button.style.fontWeight = 'normal';
 
Button.style.textAlign = 'right';
 
Button.style.width = '6em';
 
 
ButtonLink.style.color = Header.style.color;
 
ButtonLink.setAttribute( 'id', 'collapseButton' + tableIndex );
 
$( ButtonLink ).on( 'click', createClickHandler( tableIndex ) );
 
ButtonLink.appendChild( ButtonText );
 
 
Button.appendChild( document.createTextNode( '[' ) );
 
Button.appendChild( ButtonLink );
 
Button.appendChild( document.createTextNode( ']' ) );
 
 
Header.insertBefore( Button, Header.childNodes[0] );
 
tableIndex++;
 
}
 
}
 
 
for ( var i = 0; i < tableIndex; i++ ) {
 
if ( $( NavigationBoxes[i] ).hasClass( 'collapsed' ) ||
 
( tableIndex >= autoCollapse && $( NavigationBoxes[i] ).hasClass( 'autocollapse' ) )
 
) {
 
collapseTable( i );
 
}
 
}
 
 
}
 
}
 
mw.hook( 'wikipage.content' ).add( createCollapseButtons );
 
  
// == Código del plegado/desplegado de plantillas ==
 
var NavigationBarHide = '[' + collapseCaption + ']';
 
var NavigationBarShow = '[' + expandCaption + ']';
 
  
var NavigationBarShowDefault = 0;
+
//Execution
  
// shows and hides content and picture (if available) of navigation bars
+
if (wgCanonicalNamespace == 'Special'){
// Parameters:
 
//    indexNavigationBar: the index of navigation bar to be toggled
 
window.toggleNavigationBar = function (indexNavigationBar) {
 
    var NavToggle = document.getElementById("NavToggle" + indexNavigationBar),
 
        NavFrame = document.getElementById("NavFrame" + indexNavigationBar),
 
        NavChild;
 
  
    if (!NavFrame || !NavToggle) {
+
if (/^(Uplo|Sear|Stat|Spec|Abus|Prefe)/i.test(wgCanonicalSpecialPageName))
        return false;
+
  importMW(wgCanonicalSpecialPageName)
    }
+
 
 +
}else switch (wgAction){
  
    // if shown now
+
case 'history': importMW('History'); break
    if (NavToggle.firstChild.data == NavigationBarHide) {
 
        for (NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
 
            if ( $(NavChild).hasClass( 'NavContent' ) || $(NavChild).hasClass( 'NavPic' ) ) {
 
                NavChild.style.display = 'none';
 
            }
 
        }
 
        NavToggle.firstChild.data = NavigationBarShow;
 
  
        // if hidden now
+
case 'delete': importMW('Deletepage'); break
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
 
        for (NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
 
            if ( $(NavChild).hasClass( 'NavContent' ) || $(NavChild).hasClass( 'NavPic' ) ) {
 
                NavChild.style.display = 'block';
 
            }
 
        }
 
        NavToggle.firstChild.data = NavigationBarHide;
 
    }
 
};
 
  
// adds show/hide-button to navigation bars
+
case 'edit': case 'submit': importMW('Editpage') //and continue with the default: view, purge
function createNavigationBarToggleButton() {
 
    var indexNavigationBar = 0,
 
    // iterate over all < div >-elements
 
        divs = document.getElementsByTagName("div"),
 
        NavFrame,
 
        NavChild,
 
        i;
 
    for (i = 0; NavFrame = divs[i]; i++) {
 
        // if found a navigation bar
 
        if ( $(NavFrame).hasClass( 'NavFrame' ) ) {
 
  
            indexNavigationBar++;
+
default:
            var NavToggle = document.createElement("a");
 
            NavToggle.className = 'NavToggle';
 
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
 
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
 
  
            var isCollapsed = $(NavFrame).hasClass( 'collapsed' );
+
  addOnloadHook(editZeroSection)
            /*
+
  addOnloadHook(collapsibleDivs)
            * Check if any children are already hidden. This loop is here for backwards compatibility:
+
  addOnloadHook(collapsibleTables)
            * the old way of making NavFrames start out collapsed was to manually add style="display:none"
+
  importScriptURI(metaBase+'/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400')
            * to all the NavPic/NavContent elements. Since this was bad for accessibility (no way to make
+
  if (navigator.platform.indexOf('Win') != -1)
            * the content visible without JavaScript support), the new recommended way is to add the class
+
    importStylesheetURI('http://en.wikipedia.org/w/index.php?title=MediaWiki:Common.css/WinFixes.css&action=raw&ctype=text/css')
            * "collapsed" to the NavFrame itself, just like with collapsible tables.
 
            */
 
            for (NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling) {
 
                if ( $(NavChild).hasClass( 'NavPic' ) || $(NavChild).hasClass( 'NavContent' ) ) {
 
                    if (NavChild.style.display == 'none') {
 
                        isCollapsed = true;
 
                    }
 
                }
 
            }
 
            if (isCollapsed) {
 
                for (NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
 
                    if ( $(NavChild).hasClass( 'NavPic' ) || $(NavChild).hasClass( 'NavContent' ) ) {
 
                        NavChild.style.display = 'none';
 
                    }
 
                }
 
            }
 
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide),
 
                j;
 
            NavToggle.appendChild(NavToggleText);
 
  
            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
+
  if (wgNamespaceNumber==0 || wgNamespaceNumber==100){
            for (j = 0; j < NavFrame.childNodes.length; j++) {
+
    addOnloadHook(LinkFA)
                if ( $(NavFrame.childNodes[j]).hasClass( 'NavHead' ) ) {
+
    importMW('Osm')
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
+
    importMW('Collapserefs')
                    NavFrame.childNodes[j].appendChild(NavToggle);
+
    if (wgArticleId==4401) importMW('Mainpage')
                }
+
  }else{
            }
+
    if (wgNamespaceNumber==4){
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
+
      if (/^(Мастер статей|Инкубатор)/.test(wgTitle)) importMW('Incubator')
        }
+
      if (wgTitle=='Скрипты') importMW('Scripts')
 
     }
 
     }
 +
    addOnloadHook(icqIcons)
 +
  }
 +
 
}
 
}
  
$(document).ready(createNavigationBarToggleButton);
 
  
/**
+
if (wgUserGroups){
* Interwiki links to featured articles ***************************************
+
  for (var i=0; i<wgUserGroups.length; i++) switch (wgUserGroups[i]){
*
+
    case 'sysop': importMW('Sysop'); break
* Description: Highlights interwiki links to featured articles (or
+
}
*              equivalents) by changing the bullet before the interwiki link
+
if (wgNamespaceNumber==2 && wgTitle.indexOf(wgUserName)==0 && wgArticleId==0 && /\/skin\.(js|css)$/.test(wgTitle))
*              into a star.
+
  window.location.href = window.location.href.replace(/skin\.(css|js)$/, skin+'.$1')
* Maintainers: [[User:R. Koot]]
 
*/
 
function LinkFA() {
 
    if ( document.getElementById( 'p-lang' ) ) {
 
        var InterwikiLinks = document.getElementById( 'p-lang' ).getElementsByTagName( 'li' );
 
 
        for ( var i = 0; i < InterwikiLinks.length; i++ ) {
 
            var className = InterwikiLinks[i].className.match(/interwiki-[-\w]+/);
 
            if ( document.getElementById( className + '-fa' ) && InterwikiLinks[i].className.indexOf( 'badge-featuredarticle' ) === -1 ) {
 
                InterwikiLinks[i].className += ' destacado';
 
                InterwikiLinks[i].title = 'Éste es un artículo destacado en esta Wikipedia.';
 
            } else if ( document.getElementById( className + '-ga' ) && InterwikiLinks[i].className.indexOf( 'badge-goodarticle' ) === -1 ) {
 
                InterwikiLinks[i].className += ' bueno';
 
                InterwikiLinks[i].title = 'Éste es un artículo bueno en esta Wikipedia.';
 
            }
 
        }
 
    }
 
 
}
 
}
 
mw.hook( 'wikipage.content' ).add( LinkFA );
 
  
/**
 
* Enlace «sección nueva» junto a «editar» en la última sección de las páginas de discusión.
 
* Fuente: //de.wikipedia.org/w/index.php?oldid=133547849
 
*/
 
$( 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*$/, '' );
 
        } );
 
        // con la skin vector se muestra como "Sección nueva", pasamos a minúsculas para integrarlo mejor
 
        link.css( {
 
            "text-transform" : "lowercase"
 
        } );
 
        //add it within the brackets
 
        var lastEditsectionLink = $( 'span.mw-editsection:last a:last' );
 
        lastEditsectionLink.after( link );
 
        lastEditsectionLink.after( '&#32;·&#32;' ); //see [[MediaWiki:Pipe-separator]]
 
    }
 
} );
 
  
/*
+
// ВП:СО, кроме статей  В Контакте, Одноклассники и Facebook
// == Interproyectos en un recuadro a la izquierda ==
+
if (wgArticleId!=639373 && wgArticleId!=932117 && wgArticleId!=1297302 && wgArticleId!=25133866)
  Funcionan con la plantilla {{ep|commons}} y en otras
+
  importMW('Wikibugs')
[[:Categoría:Wikipedia:Plantillas_de_enlace_entre_proyectos|plantillas de enlace entre proyectos]]
+
 
*/
+
 
 +
// iwiki sorting
 +
if (!wgUserName
 +
    || (wgUserName
 +
        && (((typeof wgLangPrefs == 'undefined') ? false : true)
 +
            || ((typeof wgAddLangHints == 'undefined') ? false : wgAddLangHints)
 +
            || ((typeof wgUseUserLanguage == 'undefined') ? false : wgUseUserLanguage))))
 +
    importMW('Interwiki-links');
  
function iProject() {
+
var withJS = document.URL.match(/[&?]withjs=((mediawiki:)?([^&#]+))/i)
    var elementos = [],
+
if (withJS) importScript_('MediaWiki:'+withJS[3])
        i;
 
  
    if (document.getElementsByClassName) {
+
if (!window.wgUserName) appendCSS('#mw-fr-revisiontag {display:none}')
        elementos = document.getElementsByClassName("interProject");
 
    } else {
 
        var els = document.getElementsByTagName("span"),
 
            elsLen = els.length,
 
            j;
 
        for (i = 0, j = 0; i < elsLen; i++) {
 
            if ("interProject" == els[i].className) {
 
                elementos[j] = els[i];
 
                j++;
 
            }
 
        }
 
    }
 
    if (elementos.length > 0) {
 
        mw.util.addCSS('#interProject {display: none; speak: none;} #p-tb .pBody {padding-right: 0;}');
 
        var portal = document.createElement('div');
 
        portal.setAttribute("class", "portlet portal"); /* portlet en monobook, portal en vector */
 
  
        var tit = document.createElement('h3');
 
        tit.setAttribute("lang", "es");
 
        tit.appendChild(document.createTextNode('Otros proyectos'));
 
        portal.appendChild(tit);
 
  
        var IPY = document.createElement('div');
+
/* Any JavaScript here will be loaded for all users on every page load. */
        IPY.setAttribute('class', "pBody body");
 
        var ul = document.createElement('ul');
 
        IPY.appendChild(ul);
 
  
        for (i = 0; i < elementos.length; i++) {
+
/*
            var li = document.createElement('li');
+
////////////////////////////////////////////////////////////////
            li.innerHTML = elementos[i].innerHTML;
+
// =-=-=- HELPER FUNCTIONS -=-=-=-
            ul.appendChild(li);
+
function addlilink(tabs, url, name, id, title, key){
 +
    var na = document.createElement('a');
 +
    na.href = url;
 +
    na.appendChild(document.createTextNode(name));
 +
    var li = document.createElement('li');
 +
    if(id) li.id = id;
 +
    li.appendChild(na);
 +
    tabs.appendChild(li);
 +
    if(id)
 +
    {
 +
        if(key && title)
 +
        {
 +
            ta[id] = [key, title];
 
         }
 
         }
         portal.appendChild(IPY);
+
         else if(key)
 
+
         {
         if (document.getElementById("p-tb").nextSibling) {
+
             ta[id] = [key, ''];
             document.getElementById("p-tb").parentNode.insertBefore(portal, document.getElementById("p-tb").nextSibling);
 
 
         }
 
         }
         else {
+
         else if(title)
             document.getElementById("p-tb").parentNode.appendChild(portal);
+
        {
 +
             ta[id] = ['', title];
 
         }
 
         }
 
     }
 
     }
 +
    // re-render the title and accesskeys from existing code in wikibits.js
 +
    akeytt();
 +
    return li;
 
}
 
}
$(document).ready(iProject);
 
  
/* End of mw.loader.using callback */
+
function addToolboxLink(url, name, id, title){
});
+
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
 +
    addlilink(tb, url, name, id, title);
 +
}
  
/* Ordenación de tablas:
+
function addTab(url, name, id, title, key) {
* Desde MediaWiki 1.22wmf13 las ordenaciones numéricas funcionan correctamente con nuestros separadores de millares y decimales, sin necesidad de código adicional
+
    return addPortletLink('p-cactions', url, name, id, title, key);
 +
}
  
* Personalización de la ordenación de fechas:
+
function addLink(where, url, name, id, title, key, after){
* Se ordenan según "dd de mm de yy" o "dd de mm de yyyy"
+
    var na = document.createElement('a');
* También reconoce dd-mm-yy, dd-mm-yyyy (y otras variaciones usando / , .)
+
    na.href = url;
*/
+
    na.appendChild(document.createTextNode(name));
mw.loader.using( 'jquery.tablesorter', function () {
+
    var li = document.createElement('li');
    var ts = $.tablesorter,
+
    if(id) li.id = id;
        i,
+
    li.appendChild(na);
        j;
+
     var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
+
    if(after) {
    ts.formatDateCustom = function ( s ) {
+
tabs.insertBefore(li,document.getElementById(after));
            var match;
+
    } else {
            s = $.trim( s.toLowerCase() );
+
tabs.appendChild(li);
 
            s = s.replace( /( de |[\-\.\,' ])/g, '/' );
 
 
            if ( ( match = s.match( ts.dateRegex[0] ) ) !== null ) {
 
                if ( mw.config.get( 'wgDefaultDateFormat' ) === 'mdy' || mw.config.get( 'wgContentLanguage' ) === 'en' ) {
 
                    s = [ match[3], match[1], match[2] ];
 
                } else if ( mw.config.get( 'wgDefaultDateFormat' ) === 'dmy' ) {
 
                    s = [ match[3], match[2], match[1] ];
 
                } else {
 
                    // If we get here, we don't know which order the dd-dd-dddd
 
                    // date is in. So return something not entirely invalid.
 
                    return '99999999';
 
                }
 
            } else if ( ( match = s.match( ts.dateRegex[1] ) ) !== null ) {
 
                s = [ match[3], '' + ts.monthNames[match[2]], match[1] ];
 
            } else if ( ( match = s.match( ts.dateRegex[2] ) ) !== null ) {
 
                s = [ match[3], '' + ts.monthNames[match[1]], match[2] ];
 
            } else {
 
                // Should never get here
 
                return '99999999';
 
            }
 
 
            // Pad Month and Day
 
            if ( s[1].length === 1 ) {
 
                s[1] = '0' + s[1];
 
            }
 
            if ( s[2].length === 1 ) {
 
                s[2] = '0' + s[2];
 
            }
 
 
            var y;
 
            if ( ( y = parseInt( s[0], 10) ) < 100 ) {
 
                // Guestimate years without centuries
 
                if ( y < 30 ) {
 
                    s[0] = 2000 + y;
 
                } else {
 
                    s[0] = 1900 + y;
 
                }
 
            }
 
            while ( s[0].length < 4 ) {
 
                s[0] = '0' + s[0];
 
            }
 
            return parseInt( s.join( '' ), 10 );
 
    };
 
 
     var regex = [];
 
    ts.monthNames = {};
 
 
    for ( i = 1; i < 13; i++ ) {
 
        var name = mw.config.get( 'wgMonthNames' )[i].toLowerCase();
 
        ts.monthNames[name] = i;
 
        regex.push( mw.RegExp.escape( name ) );
 
        name = mw.config.get( 'wgMonthNamesShort' )[i].toLowerCase().replace( '.', '' );
 
        ts.monthNames[name] = i;
 
        regex.push( mw.RegExp.escape( name ) );
 
 
     }
 
     }
     regex = regex.join( '|' );
+
     if(id) {
+
if(key && title) { ta[id] = [key, title]; }
    ts.dateRegexCustom = new RegExp( "^\\d\\d?\\sde\\s(" + regex + ")\\sde\\s\\d{2,4}$" );
+
else if(key) { ta[id] = [key, '']; }
+
else if(title) { ta[id] = ['', title];}
    ts.addParser( {
+
    }
        id: 'dateCustom',
+
    // re-render the title and accesskeys from existing code in wikibits.js
        is: function( s ) {
+
    akeytt();
            return ( $.tablesorter.dateRegexCustom.test(s) );
+
     return li;
        },
+
}
        format: function( s ) {
 
            return $.tablesorter.formatDateCustom( s );
 
        },
 
        type: 'numeric'
 
     });
 
/* End of mw.loader.using callback */
 
});
 
  
/** Ajusta el ordenamiento alfabético en las tablas "sortable" */
+
function addlimenu(tabs, name, id)
(function() {
+
{
  var letras = [["áàâäãāăåą", "a"], ["æ", "ae"], ["ćĉčç", "c"], ["ďḑđð", "d"], ["éèêëẽěēĕę", "e"],
+
    var na = document.createElement('a');
            ["ĝḡğģǥ", "g"], ["ĥḧḩħ", "h"], ["íìÎîïĩīĭįı", "i"], ["ĵ", "j"], ["ķ", "k"],
+
    na.href = '#';
            ["ĺľļł", "l"], ["ńňņ", "n"], ["ñ", "n~"], ["óòôöõōŏǫőø", "o"], ["œ", "oe"],
+
    var mn = document.createElement('ul');
            ["ŕřŗ", "r"], ["śŝšş", "s"], ["ß", "ss"], ["ťţŧ", "t"], ["úùûüũūŭůųű", "u"], ["ṽ", "v"],
+
    na.appendChild(document.createTextNode(name));
            ["ŵẅ", "w"], ["ẍ", "x"], ["ýŷÿỹ", "y"], ["źẑžƶ", "z"]];
+
     var li = document.createElement('li');
  var hash = {};
+
     li.id = id;
  for (var i = 0; i < letras.length; i++) {
+
     li.className = 'tabmenu';
     var arr = letras[i][0].split("");
+
    li.appendChild(na);
     var dest = letras[i][1];
+
     li.appendChild(mn);
     for (var j = 0; j < arr.length; j++) {
+
    tabs.appendChild(li);
      hash[arr[j]] = dest;
+
    return li;
     }
+
}
  }
 
  mw.config.set('tableSorterCollation', hash);
 
})();
 
  
/**
+
function addnavbox_link(URL,Name,ID)
* Los WikiWidgets son pequeños programas que sirven para ilustrar y explicar de manera interactiva conceptos tratados en los artículos.
+
{
* El código de inicialización de los WikiWidgets se carga desde Commons cuando se encuentra una plantilla de WikiWidgets en la página.
+
var portlet = document.getElementById('p-navigation');
*/
+
var links = portlet.getElementsByTagName('ul')[0];
if ( $( '.WikiWidget' ).length ) {
+
links.innerHTML += '<li id="' + ID + '"><a href="' + URL + '">' + Name + '</a></li>';
mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:WikiWidgets.js&action=raw&ctype=text/javascript' );
 
 
}
 
}
 +
/////////////////////////////////////////////
 +
*/
 +
document.write("<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js' type='text/javascript'></script>");
  
/* Fin de alias */
+
document.write("<script src='/index.php?title=Global.js&action=raw&smaxage=0&ctype=text/javascript' type='text/javascript'></script>")
})( jQuery, mediaWiki );
 

Revisión actual del 19:25 27 nov 2017

/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios en cada carga de página */

// Rewrite of announcement display. (by Menidan) add wiki grepolis.es by Atálida
$ (function () {
	// Changes the announcement to the next announcement in the list.
	function changeAnnouncement () {
		$ (announcementList [currentAnnouncement]).fadeOut ("normal", function () {
			++currentAnnouncement;
			if (currentAnnouncement >= announcementList.length)
				currentAnnouncement = 0;
			$ (announcementList [currentAnnouncement]).fadeIn ();
		});
	}

	var announcementList = $ (".announcement");
	var currentAnnouncement = 0;
	var announcementVisibilityTime = 5000; // ms

	announcementList.hide ();
	if (announcementList.length > 1) {
		$ (announcementList [0]).fadeIn ();
		setInterval (changeAnnouncement, announcementVisibilityTime);
	} else if (announcementList.length > 0)
		announcementList.fadeIn ();


	// Piwik is undefined -> comment it out.
	/*
	try {
		var piwikTracker = Piwik.getTracker (pkBaseURL + "piwik.php", 2);
		piwikTracker.trackPageView ();
		piwikTracker.enableLinkTracking ();
	} catch (err) {}
	*/
});


// hasta aquí 

importScript_ = importScript
importScript = function (page, proj){
 if (!proj) importScript_(page)
 else {
   if (proj.indexOf('.')==-1) proj += '.wikipedia.org'
   importScriptURI('http://'+proj+'/w/index.php?action=raw&ctype=text/javascript&title='+encodeURIComponent(page.replace(/ /g,'_')))
 }
}
importMW = function (name) { importScript('MediaWiki:'+name+'.js') }


function LinkFA(){
 var pLang = document.getElementById('p-lang')
 if (!pLang) return
 var list = {
 'fa':'Эта статья является избранной',
 'fl':'Этот список или портал является избранным',
 'ga':'Эта статья является хорошей'}
 var iw = pLang.getElementsByTagName('li')
 for (var i=0; i<iw.length; i++)
   for (var s in list)
     if (document.getElementById(iw[i].className+'-'+s)){
       iw[i].className += ' ' + s.toUpperCase()
       iw[i].title = list[s] + ' в другом языковом разделе'
     }
}


function icqIcons(){
 var a, spans = document.getElementById('content').getElementsByTagName('span')
 for (var i=0; a=spans[i]; i++)
   if (a.className == 'ICQ')
     a.style.backgroundImage = "url('http://status.icq.com/online.gif?icq="+a.id+"&img=5&randseed="+Math.floor(Math.random()*10000000)+"')"
}


function editZeroSection(){
 var body = document.getElementById('bodyContent')
 if (!body) return
 var h2s = body.getElementsByTagName('H2')
 var h2 = h2s[0]
 if (!h2) return
 if (h2.parentNode.id == 'toctitle') h2 = h2s[1]
 if (!h2) return
 var span = h2.firstChild
 if (!span || span.className != 'editsection') return
 var zero = span.cloneNode(true)
 body.insertBefore(zero, body.firstChild)
 var a = zero.getElementsByTagName('a')[0]
 if (a.href.indexOf('&section=T') == -1 )  a.title = a.title.replace(/:.*$/,': 0')
 else a.title = 'Править секцию: 0'
 a.setAttribute('href', wgScript + '?title='+encodeURIComponent(wgPageName) + '&action=edit&section=0')
}




//Collapsiblе: [[ВП:СБ]]

var NavigationBarShowDefault = 2
var NavigationBarHide = '[Ocultar]'
var NavigationBarShow = '[Ver]'

var hasClass = (function (){
 var reCache = {}
 return function (element, className){
   return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className)
  }
})()

function collapsibleTables(){
 var Table, HRow,  HCell, btn, a, tblIdx = 0, colTables = []
 var allTables = document.getElementsByTagName('table')
 for (var i=0; Table = allTables[i]; i++){
   if (!hasClass(Table, 'collapsible')) continue
   if (!(HRow=Table.rows[0])) continue
   if (!(HCell=HRow.getElementsByTagName('th')[0])) continue
   Table.id = 'collapsibleTable' + tblIdx
   btn = document.createElement('span')
   btn.style.cssText = 'float:right; font-weight:normal; font-size:smaller'
   a = document.createElement('a')
   a.id = 'collapseButton' + tblIdx
   a.href = 'javascript:collapseTable(' + tblIdx + ');'
   a.style.color = HCell.style.color
   a.appendChild(document.createTextNode(NavigationBarHide))
   btn.appendChild(a)
   HCell.insertBefore(btn, HCell.childNodes[0])
   colTables[tblIdx++] = Table
 }
 for (var i=0; i < tblIdx; i++)
   if ((tblIdx > NavigationBarShowDefault && hasClass(colTables[i], 'autocollapse')) || hasClass(colTables[i], 'collapsed'))
     collapseTable(i)
}

function collapseTable (idx){
 var Table = document.getElementById('collapsibleTable' + idx)
 var btn = document.getElementById('collapseButton' + idx)
 if (!Table || !btn) return false
 var Rows = Table.rows
 var isShown = (btn.firstChild.data == NavigationBarHide)
 btn.firstChild.data = isShown ?  NavigationBarShow : NavigationBarHide
 var disp = isShown ? 'none' : Rows[0].style.display
 for (var i=1; i < Rows.length; i++)
    Rows[i].style.display = disp
}

function collapsibleDivs(){
 var navIdx = 0, colNavs = [], i, NavFrame
 var divs = document.getElementById('content').getElementsByTagName('div')
 for (i=0; NavFrame = divs[i]; i++) {
   if (!hasClass(NavFrame, 'NavFrame')) continue
   NavFrame.id = 'NavFrame' + navIdx
   var a = document.createElement('a')
   a.className = 'NavToggle'
   a.id = 'NavToggle' + navIdx
   a.href = 'javascript:collapseDiv(' + navIdx + ');'
   a.appendChild(document.createTextNode(NavigationBarHide))
   for (var j=0; j < NavFrame.childNodes.length; j++)
     if (hasClass(NavFrame.childNodes[j], 'NavHead'))
       NavFrame.childNodes[j].appendChild(a)
   colNavs[navIdx++] = NavFrame
 }
 for (i=0; i < navIdx; i++)
  if ((navIdx > NavigationBarShowDefault && !hasClass(colNavs[i], 'expanded')) || hasClass(colNavs[i], 'collapsed'))
     collapseDiv(i)
}

function collapseDiv(idx) {
 var div = document.getElementById('NavFrame' + idx)
 var btn = document.getElementById('NavToggle' + idx)
 if (!div || !btn) return false
 var isShown = (btn.firstChild.data == NavigationBarHide)
 btn.firstChild.data = isShown ? NavigationBarShow : NavigationBarHide
 var disp = isShown ? 'none' : 'block'
 for (var child = div.firstChild;  child != null;  child = child.nextSibling)
   if (hasClass(child, 'NavPic') || hasClass(child, 'NavContent'))
      child.style.display = disp
}

function voting12(){
 if (votingTrigger = document.getElementById('voting-trigger'))
  importScriptURI(wgServer+wgScript
   +'?title=MediaWiki:Voting12.js&action=raw&ctype=text/javascript&cversion='
   +encodeURIComponent(votingTrigger.innerHTML.replace(/\D+/g, '.')))
}

//Secure server
var metaBase = 'http://meta.wikimedia.org'
if (wgServer == 'https://secure.wikimedia.org') {
  importScript('MediaWiki:Common.js/secure.js','en')
  metaBase = 'https://secure.wikimedia.org/wikipedia/meta'
}


//Execution

if (wgCanonicalNamespace == 'Special'){

 if (/^(Uplo|Sear|Stat|Spec|Abus|Prefe)/i.test(wgCanonicalSpecialPageName))
   importMW(wgCanonicalSpecialPageName)

}else switch (wgAction){

 case 'history': importMW('History'); break

 case 'delete': importMW('Deletepage'); break

 case 'edit': case 'submit': importMW('Editpage') //and continue with the default: view, purge

 default:

  addOnloadHook(editZeroSection)
  addOnloadHook(collapsibleDivs)
  addOnloadHook(collapsibleTables)
  importScriptURI(metaBase+'/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400')
  if (navigator.platform.indexOf('Win') != -1)
    importStylesheetURI('http://en.wikipedia.org/w/index.php?title=MediaWiki:Common.css/WinFixes.css&action=raw&ctype=text/css')

  if (wgNamespaceNumber==0 || wgNamespaceNumber==100){
    addOnloadHook(LinkFA)
    importMW('Osm')
    importMW('Collapserefs')
    if (wgArticleId==4401) importMW('Mainpage')
  }else{
    if (wgNamespaceNumber==4){
      if (/^(Мастер статей|Инкубатор)/.test(wgTitle)) importMW('Incubator')
      if (wgTitle=='Скрипты') importMW('Scripts')
    }
    addOnloadHook(icqIcons)
  }

}


if (wgUserGroups){
  for (var i=0; i<wgUserGroups.length; i++) switch (wgUserGroups[i]){
    case 'sysop': importMW('Sysop'); break
 }
 if (wgNamespaceNumber==2 && wgTitle.indexOf(wgUserName)==0 && wgArticleId==0 && /\/skin\.(js|css)$/.test(wgTitle))
   window.location.href = window.location.href.replace(/skin\.(css|js)$/, skin+'.$1')
}


// ВП:СО, кроме статей  В Контакте, Одноклассники и Facebook
if (wgArticleId!=639373 && wgArticleId!=932117 && wgArticleId!=1297302 && wgArticleId!=25133866)
 importMW('Wikibugs')


// iwiki sorting
 if (!wgUserName
     || (wgUserName
         && (((typeof wgLangPrefs == 'undefined') ? false : true)
             || ((typeof wgAddLangHints == 'undefined') ? false : wgAddLangHints)
             || ((typeof wgUseUserLanguage == 'undefined') ? false : wgUseUserLanguage))))
     importMW('Interwiki-links');

var withJS = document.URL.match(/[&?]withjs=((mediawiki:)?([^&#]+))/i)
if (withJS) importScript_('MediaWiki:'+withJS[3])

if (!window.wgUserName) appendCSS('#mw-fr-revisiontag {display:none}')


/* Any JavaScript here will be loaded for all users on every page load. */

/*
////////////////////////////////////////////////////////////////
// =-=-=- HELPER FUNCTIONS -=-=-=-
function addlilink(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    if(id)
    {
        if(key && title)
        {
            ta[id] = [key, title];
        }
        else if(key)
        {
            ta[id] = [key, ''];
        }
        else if(title)
        {
            ta[id] = ['', title];
        }
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}

function addToolboxLink(url, name, id, title){
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    addlilink(tb, url, name, id, title);
}

function addTab(url, name, id, title, key) {
    return addPortletLink('p-cactions', url, name, id, title, key);
}

function addLink(where, url, name, id, title, key, after){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
    if(after) {
	tabs.insertBefore(li,document.getElementById(after));
    } else {
	tabs.appendChild(li);
    }
    if(id) {
	if(key && title) { ta[id] = [key, title]; }
	else if(key) { ta[id] = [key, '']; }
	else if(title) { ta[id] = ['', title];} 
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}

function addlimenu(tabs, name, id)
{
    var na = document.createElement('a');
    na.href = '#';
    var mn = document.createElement('ul');
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.id = id;
    li.className = 'tabmenu';
    li.appendChild(na);
    li.appendChild(mn);
    tabs.appendChild(li);
    return li;
}

function addnavbox_link(URL,Name,ID)
{
var portlet = document.getElementById('p-navigation');
var links = portlet.getElementsByTagName('ul')[0];
links.innerHTML += '<li id="' + ID + '"><a href="' + URL + '">' + Name + '</a></li>';
}
/////////////////////////////////////////////
*/
document.write("<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js' type='text/javascript'></script>");

document.write("<script src='/index.php?title=Global.js&action=raw&smaxage=0&ctype=text/javascript' type='text/javascript'></script>")