跳转到内容

MediaWiki:Common.js:修订间差异

计算器百科,非营利的计算器专业知识百科。
Qinyongr留言 | 贡献
无编辑摘要
Qinyongr留言 | 贡献
无编辑摘要
 
(未显示2个用户的18个中间版本)
第1行: 第1行:
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */
/*
所有用戶在加載任何頁面時,這裡的JavaScript都會加載
*/
mw.log.deprecate( window, 'JSConfig', {} );


/* NavBar 开始 */
mw.loader.using(['mediawiki.util', 'ext.gadget.site-lib'], function () {
mw.loader.using(['mediawiki.util', 'ext.gadget.site-lib'], function () {
   (function ($, mw) {
   (function ($, mw) {


    /* 當需要時載入對應的 scripts */
/**
    if (mw.config.get('wgAction') == "edit" || mw.config.get('wgAction') == "submit" || mw.config.get('wgCanonicalSpecialPageName') == 'Search') { // scripts specific to editing pages
* Dynamic Navigation Bars. See [[Wikipedia:NavFrame]]
      importScript('MediaWiki:Common.js/edit.js');
*
* Based on script from en.wikipedia.org, 2008-09-15.
*
* @source www.mediawiki.org/wiki/MediaWiki:Gadget-NavFrame.js
* @maintainer Helder.wiki, 2012–2013
* @maintainer Krinkle, 2013
* @maintainer Fantasticfears, 2013-2014
*/
( function () {
 
var collapseCaption = wgULS('隐藏', '隱藏');
var expandCaption = wgULS('显示', '顯示');
 
var navigationBarHide = collapseCaption + '▲';
var navigationBarShow = expandCaption + '▼';
/**
* Shows and hides content and picture (if available) of navigation bars.
*
* @param {number} indexNavigationBar The index of navigation bar to be toggled
* @param {jQuery.Event} e Event object
*/
function toggleNavigationBar( indexNavigationBar, e ) {
        var toggle = $( '#NavToggle' + indexNavigationBar ),
                frame = $( '#NavFrame' + indexNavigationBar ),
                isFrameCollapsed;
 
        if ( !frame || !toggle ) {
                return false;
        }
 
isFrameCollapsed = frame.hasClass( 'collapsed' );
        if ( isFrameCollapsed ) {
                frame.find( '> .NavPic, > .NavContent, > .toogleShow' ).each( function() {
                        $( this ).css( 'display', 'block' );
                });
                frame.find( '> .toggleHide' ).each( function() {
                        $( this ).css( 'display', 'none' );
                });
                toggle.text( navigationBarHide );
                frame.removeClass( 'collapsed' );
        } else {
                frame.find( '> .NavPic, > .NavContent, > .toogleShow' ).each( function() {
                        $( this ).css( 'display', 'none' );
                });
                frame.find( '> .toggleHide' ).each( function() {
                        $( this ).css( 'display', 'block' );
                });
                toggle.text( navigationBarShow );
                frame.addClass( 'collapsed' );
        }
}
 
/**
* Adds show/hide-button to navigation bars.
*
* @param {jQuery} $content
*/
function createNavigationBarToggleButton( $content ) {
        // Iterate over all (new) nav frames
        $content.find( 'div.NavFrame' ).each( function( indexNavigationBar ) {
                var frame = $( this ).attr( 'id', 'NavFrame' + indexNavigationBar );
                // If found a navigation bar
                var navToggle = $( '<span class="NavToggle" id="NavToggle' + indexNavigationBar + '"></span>' );
                frame.find( '> .NavHead' ).each( function() {
                        $( this ).on( 'click', $.proxy( toggleNavigationBar, null, indexNavigationBar ) );
                return false;
});
                if ( frame.hasClass( 'collapsed' ) ) {
                        frame.find( '> .NavPic, > .NavContent, > .toggleHide' ).each( function() {
                                $( this ).css( 'display', 'none' );
                        });
                } else {
                        frame.find( '> .toggleShow' ).each( function() {
                                $( this ).css( 'display', 'none' );
                        });
                }
 
                var showNavigationBarHide = true;
                frame.find( '> .NavPic, > .NavContent' ).each( function() {
                        if ( $( this ).css( 'display' ) === 'none' ) {
                                showNavigationBarHide = false;
                                return false;
                        }
                });
 
                navToggle.text( showNavigationBarHide? navigationBarHide: navigationBarShow );
 
                frame.find( '> .NavHead' ).each( function() {
                        $( this ).append( navToggle );
                        return false;
                });
        });
}
 
        mw.hook( 'wikipage.content' ).add( createNavigationBarToggleButton );
 
}());
 
/**
* Collapsible tables
*
* Allows tables to be collapsed, showing only the header. See [[Wikipedia:NavFrame]].
*
* @version 2.0.3 (2014-03-14)
* @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js
* @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 = wgULS('隐藏', '隱藏');
var expandCaption = wgULS('显示', '顯示');
var tableIndex = 0;
 
function collapseTable( tableIndex ) {
    var Button = document.getElementById( 'collapseButton' + tableIndex );
    var Table = document.getElementById( 'collapsibleTable' + tableIndex );
 
    if ( !Table || !Button ) {
        return false;
    }
 
    var Rows = Table.rows;
    var i;
 
    if ( Button.firstChild.data === collapseCaption ) {
        for ( i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = 'none';
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
     }
     }
}


    // wiki URL
function createClickHandler( tableIndex ) {
     window.wgProjectURL = {
     return function ( e ) {
      en: '//en.wikipedia.org',
        e.preventDefault();
      de: '//de.wikipedia.org',
        collapseTable( tableIndex );
      fr: '//fr.wikipedia.org',
      pl: '//pl.wikipedia.org',
      ja: '//ja.wikipedia.org',
      it: '//it.wikipedia.org',
      nl: '//nl.wikipedia.org',
      pt: '//pt.wikipedia.org',
      es: '//es.wikipedia.org',
      sv: '//sv.wikipedia.org',
      // 僅列前十名其它語言百科
      m: '//meta.wikimedia.org',
      b: '//zh.wikibooks.org',
      q: '//zh.wikiquote.org',
      n: '//zh.wikinews.org',
      wikt: '//zh.wiktionary.org',
      mw: '//www.mediawiki.org',
      commons: '//commons.wikimedia.org'
     };
     };
}
function createCollapseButtons( $content ) {
    var NavigationBoxes = {};
    var $Tables = $content.find( 'table' );
    var i;
    $Tables.each( function( i, table ) {
        if ( $(table).hasClass( 'collapsible' ) ) {
            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = table.getElementsByTagName( 'tr' )[0];
            if ( !HeaderRow ) {
                return;
            }
            var Header = table.getElementsByTagName( 'th' )[0];
            if ( !Header ) {
                return;
            }
            NavigationBoxes[ tableIndex ] = table;
            table.setAttribute( 'id', 'collapsibleTable' + tableIndex );
            var Button    = document.createElement( 'span' );
            var ButtonLink = document.createElement( 'a' );
            var ButtonText = document.createTextNode( collapseCaption );
            // Styles are declared in [[MediaWiki:Common.css]]
            Button.className = 'collapseButton';
            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( 'id', 'collapseButton' + tableIndex );
            ButtonLink.setAttribute( 'href', '#' );
            $( ButtonLink ).on( 'click', createClickHandler( tableIndex ) );
            ButtonLink.appendChild( ButtonText );


    /** 将页面名称转换为URL
            Button.appendChild( document.createTextNode( '[' ) );
    *
            Button.appendChild( ButtonLink );
    * @param page 页面名称
            Button.appendChild( document.createTextNode( ']' ) );
    * @param paras 附加后缀对象,用空对象{}做参数可以取得源码
 
    */
            Header.insertBefore( Button, Header.firstChild );
    window.getWikiPath = function (page, paras) {
            tableIndex++;
      var reg = /^[a-z]+:/;
      var pre = page.match(reg);
      pre = pre && wgProjectURL[pre[0].replace(/:$/, '').toLowerCase()];
      if (pre) {
        page = page.replace(reg, '');
      } else {
        pre = mw.config.get('wgServer');
      } // 保障没有相对路径,以照顾在线代理。
      var url = pre + mw.config.get('wgScript') + '?title=' + encodeURI(page.replace(' ', '_'));
      if (typeof paras == 'object') {
        paras.ctype = paras.ctype || 'text';
        paras.action = paras.action || 'raw';
        for (var k in paras) {
          url += '&' + k + '=' + paras[k];
         }
         }
      }
     } );
      return url;
     };


     /**
     for ( i = 0;  i < tableIndex; i++ ) {
    * Helper script for .hlist class in Common.css
        if ( $( NavigationBoxes[i] ).hasClass( 'collapsed' ) ||
    * Add pseudo-selector class to last-child list items in IE8
            ( tableIndex >= autoCollapse && $( NavigationBoxes[i] ).hasClass( 'autocollapse' ) )
    * @source mediawiki.org/wiki/Snippets/Horizontal_lists
        ) {
    * @revision 6 (2014-08-23)
            collapseTable( i );
    * @author [[User:Edokter]]
         }
    */
        else if ( $( NavigationBoxes[i] ).hasClass ( 'innercollapse' ) ) {
    var profile = $.client.profile();
            var element = NavigationBoxes[i];
    if ( profile.name === 'msie' && profile.versionNumber === 8 ) {
            while ((element = element.parentNode)) {
         mw.hook( 'wikipage.content' ).add( function ( $content ) {
                if ( $( element ).hasClass( 'outercollapse' ) ) {
            $content.find( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' )
                    collapseTable ( i );
                .addClass( 'hlist-last-child' );
                    break;
         } );
                }
            }
         }
     }
     }
}
mw.hook( 'wikipage.content' ).add( createCollapseButtons );


    /* 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";}');
    }
   


    // 修正摺疊後定位變化
/* NavBar 结束 */
    $(function () {
      if (location.hash) {
        location.href = location.hash;
      }
    });


    /** metaBox
/* Tabs 开始*/
    *
    * Funcionament de la Plantilla:Metacaixa
    * Implementat per: Usuari:Peleguer.
    * Actualitzat per Joanjoc seguint les indicacions d'en Martorell
    */
     function MetaCaixaInit() {
     function MetaCaixaInit() {
       // S'executa al carregar-se la pàgina, si hi ha metacaixes,
       // S'executa al carregar-se la pàgina, si hi ha metacaixes,
第150行: 第278行:
     $(MetaCaixaInit);
     $(MetaCaixaInit);


    /* 智能讨论页编辑(新建) */
/* Tabs 结束 */
    $(function () {
      var catalk = $('#ca-talk');
      if (catalk.hasClass('new') && mw.config.get('wgNamespaceNumber') != 2) {
        var a = $('a:first', catalk);
        a.attr('href', a.attr('href') + '&section=new');
      }
    });
 
/**
* Magic editintros ****************************************************
*
* Description: Adds editintros on disambiguation pages and BLP pages.
* Maintainers: [[User:RockMFR]]
*/
function addEditIntro( name ) {
    $( '.mw-editsection, #ca-edit' ).find( 'a' ).each( function ( i, el ) {
        el.href = $( this ).attr( 'href' ) + '&editintro=' + name;
    } );
}
 
if ( mw.config.get( 'wgNamespaceNumber' ) === 0 ) {
    $( function () {
        if ( document.getElementById( 'disambigbox' ) ) {
            addEditIntro( 'Template:Disambig_editintro' );
        }
    } );
 
    $( function () {
        var cats = mw.config.get('wgCategories');
        if ( !cats ) {
            return;
        }
        if ( $.inArray( '在世人物', cats ) !== -1 ) {
            addEditIntro( 'Template:BLP_editintro' );
        }
    } );
}
 
    /* 引用錯誤標籤名字解碼 */
    $(function () {
      $('.anchordecodeme').each(function () {
        $(this).text(decodeURIComponent($(this).text().replace(/\.([0-9A-F]{2})/g, '%$1')));
      });
    });
 
    /** &withCSS= and &withJS= URL parameters
    * Allow to try custom scripts from MediaWiki space
    * without editing personal .css or .js files
    */
/**
* @source www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL
* @rev 6
*/
var extraCSS = mw.util.getParamValue( 'withCSS' ),
    extraJS = mw.util.getParamValue( 'withJS' );
 
if ( extraCSS ) {
    if ( extraCSS.match( /^MediaWiki:[^&<>=%#]*\.css$/ ) ) {
        importStylesheet( extraCSS );
    } else {
        mw.notify( '只允许从MediaWiki名字空间加载。', { title: '无效的withCSS值' } );
    }
}
 
if ( extraJS ) {
    if ( extraJS.match( /^MediaWiki:[^&<>=%#]*\.js$/ ) ) {
        importScript( extraJS );
    } else {
        mw.notify( '只允许从MediaWiki名字空间加载。', { title: '无效的withJS值' } );
    }
}
 
 
    /* 页面历史加&hilight=高亮 */
    {
      var hilight = mw.util.getParamValue('hilight');
      if (mw.config.get('wgAction') === 'history' && hilight) {
          $.each(hilight.split(','), function (_, v) {
            $('input[name=oldid][value=' + v + ']').parent().addClass('not-patrolled');
          });
      }
    }
 
    /* Main page hacks */
    if ( mw.config.get( 'wgIsMainPage' ) && mw.config.get( 'wgAction' ) == 'view' ) {
        /* 维基百科语言列表 */
        $( function () {
            mw.util.addPortletLink(
                'p-lang',
                mw.util.getUrl( 'Wikipedia:维基百科语言列表' ),
                wgULS( '维基百科语言列表', '維基百科語言列表' ),
                'interwiki-completelist',
                wgULS( '维基百科的完整各语言列表', '維基百科的完整各語言列表' )
            );
        } );
        /* Remove red links */
        $( '#mw-content-text a.new' ).contents().unwrap();
    }
  })(jQuery, mediaWiki);
});
 
/* Check for any client-side simplified/traditional Chinese conversion */
/* This routine must be placed here to make sure the field is inserted in time */
$('#antispam-container').append(
    $('<input type="text" />').attr({
        id: 'wpAntiConv',
        value: '\u6c49\u6f22'
    })
);

2016年7月24日 (日) 06:51的最新版本

/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */

/* NavBar 开始 */
mw.loader.using(['mediawiki.util', 'ext.gadget.site-lib'], function () {
  (function ($, mw) {

/**
 * Dynamic Navigation Bars. See [[Wikipedia:NavFrame]]
 * 
 * Based on script from en.wikipedia.org, 2008-09-15.
 *
 * @source www.mediawiki.org/wiki/MediaWiki:Gadget-NavFrame.js
 * @maintainer Helder.wiki, 2012–2013
 * @maintainer Krinkle, 2013
 * @maintainer Fantasticfears, 2013-2014
 */
( function () {

var collapseCaption = wgULS('隐藏', '隱藏');
var expandCaption = wgULS('显示', '顯示');

var navigationBarHide = collapseCaption + '▲';
var navigationBarShow = expandCaption + '▼';
 
/**
 * Shows and hides content and picture (if available) of navigation bars.
 *
 * @param {number} indexNavigationBar The index of navigation bar to be toggled
 * @param {jQuery.Event} e Event object
 */
function toggleNavigationBar( indexNavigationBar, e ) {
        var toggle = $( '#NavToggle' + indexNavigationBar ),
                frame = $( '#NavFrame' + indexNavigationBar ),
                isFrameCollapsed;

        if ( !frame || !toggle ) {
                return false;
        }

	isFrameCollapsed = frame.hasClass( 'collapsed' );
        if ( isFrameCollapsed ) {
                frame.find( '> .NavPic, > .NavContent, > .toogleShow' ).each( function() {
                        $( this ).css( 'display', 'block' );
                });
                frame.find( '> .toggleHide' ).each( function() {
                        $( this ).css( 'display', 'none' );
                });
                toggle.text( navigationBarHide );
                frame.removeClass( 'collapsed' );
        } else {
                frame.find( '> .NavPic, > .NavContent, > .toogleShow' ).each( function() {
                        $( this ).css( 'display', 'none' );
                });
                frame.find( '> .toggleHide' ).each( function() {
                        $( this ).css( 'display', 'block' );
                });
                toggle.text( navigationBarShow );
                frame.addClass( 'collapsed' );
        }
}

/**
 * Adds show/hide-button to navigation bars.
 *
 * @param {jQuery} $content
 */
function createNavigationBarToggleButton( $content ) {
        // Iterate over all (new) nav frames
        $content.find( 'div.NavFrame' ).each( function( indexNavigationBar ) {
                var frame = $( this ).attr( 'id', 'NavFrame' + indexNavigationBar );
                // If found a navigation bar
                var navToggle = $( '<span class="NavToggle" id="NavToggle' + indexNavigationBar + '"></span>' );
                frame.find( '> .NavHead' ).each( function() {
                        $( this ).on( 'click', $.proxy( toggleNavigationBar, null, indexNavigationBar ) );
                	return false;
		});
                if ( frame.hasClass( 'collapsed' ) ) {
                        frame.find( '> .NavPic, > .NavContent, > .toggleHide' ).each( function() {
                                $( this ).css( 'display', 'none' );
                        });
                } else {
                        frame.find( '> .toggleShow' ).each( function() {
                                $( this ).css( 'display', 'none' );
                        });
                }

                var showNavigationBarHide = true;
                frame.find( '> .NavPic, > .NavContent' ).each( function() {
                        if ( $( this ).css( 'display' ) === 'none' ) {
                                showNavigationBarHide = false;
                                return false;
                        }
                });

                navToggle.text( showNavigationBarHide? navigationBarHide: navigationBarShow );

                frame.find( '> .NavHead' ).each( function() {
                        $( this ).append( navToggle );
                        return false;
                });
        });
}

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

}());

/**
 * Collapsible tables
 *
 * Allows tables to be collapsed, showing only the header. See [[Wikipedia:NavFrame]].
 *
 * @version 2.0.3 (2014-03-14)
 * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js
 * @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 = wgULS('隐藏', '隱藏');
var expandCaption = wgULS('显示', '顯示');
var tableIndex = 0;

function collapseTable( tableIndex ) {
    var Button = document.getElementById( 'collapseButton' + tableIndex );
    var Table = document.getElementById( 'collapsibleTable' + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;
    var i;

    if ( Button.firstChild.data === collapseCaption ) {
        for ( i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = 'none';
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createClickHandler( tableIndex ) {
    return function ( e ) {
        e.preventDefault();
        collapseTable( tableIndex );
    };
}

function createCollapseButtons( $content ) {
    var NavigationBoxes = {};
    var $Tables = $content.find( 'table' );
    var i;

    $Tables.each( function( i, table ) {
        if ( $(table).hasClass( 'collapsible' ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = table.getElementsByTagName( 'tr' )[0];
            if ( !HeaderRow ) {
                return;
            }
            var Header = table.getElementsByTagName( 'th' )[0];
            if ( !Header ) {
                return;
            }

            NavigationBoxes[ tableIndex ] = table;
            table.setAttribute( 'id', 'collapsibleTable' + tableIndex );

            var Button     = document.createElement( 'span' );
            var ButtonLink = document.createElement( 'a' );
            var ButtonText = document.createTextNode( collapseCaption );
            // Styles are declared in [[MediaWiki:Common.css]]
            Button.className = 'collapseButton';

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( 'id', 'collapseButton' + tableIndex );
            ButtonLink.setAttribute( 'href', '#' );
            $( ButtonLink ).on( 'click', createClickHandler( tableIndex ) );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( '[' ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( ']' ) );

            Header.insertBefore( Button, Header.firstChild );
            tableIndex++;
        }
    } );

    for ( i = 0;  i < tableIndex; i++ ) {
        if ( $( NavigationBoxes[i] ).hasClass( 'collapsed' ) ||
            ( tableIndex >= autoCollapse && $( NavigationBoxes[i] ).hasClass( 'autocollapse' ) )
        ) {
            collapseTable( i );
        }
        else if ( $( NavigationBoxes[i] ).hasClass ( 'innercollapse' ) ) {
            var element = NavigationBoxes[i];
            while ((element = element.parentNode)) {
                if ( $( element ).hasClass( 'outercollapse' ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

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


// 在这行的上面加入其他代码
})});

/* NavBar 结束 */

/* Tabs 开始*/
    function MetaCaixaInit() {
      // S'executa al carregar-se la pàgina, si hi ha metacaixes,
      // s'assignen els esdeveniments als botons
      //alert("MetaCaixaInit");
      var i = 0; // Inicialitzem comptador de caixes
      for (i = 0; i <= 9; i++) {
        var vMc = document.getElementById("mc" + i);
        if (!vMc) break;
        //alert("MetaCaixaInit, trobada Metacaixa mc"+i);
        var j = 1; // Inicialitzem comptador de botons dins de la caixa
        var vPsIni = 0; // Pestanya visible inicial
        for (j = 1; j <= 9; j++) {
          var vBt = document.getElementById("mc" + i + "bt" + j);
          if (!vBt) break;
          //alert("MetaCaixaInit, trobat botó mc"+i+"bt"+j);
          vBt.onclick = MetaCaixaMostraPestanya; // A cada botó assignem l'esdeveniment onclick
          //alert (vBt.className);
          if (vBt.className == "mcBotoSel") vPsIni = j; // Si tenim un botó seleccionat, en guardem l'index
        }
        //alert ("mc="+i+", ps="+j+", psini="+vPsIni );
        if (vPsIni === 0) { // Si no tenim cap botó seleccionat, n'agafem un aleatòriament
          vPsIni = 1 + Math.floor((j - 1) * Math.random());
          //alert ("Activant Pestanya a l'atzar; _mc"+i+"bt"+vPsIni +"_");
          document.getElementById("mc" + i + "ps" + vPsIni).style.display = "block";
          document.getElementById("mc" + i + "ps" + vPsIni).style.visibility = "visible";
          document.getElementById("mc" + i + "bt" + vPsIni).className = "mcBotoSel";
        }
      }
    }

    function MetaCaixaMostraPestanya() {
      // S'executa al clicar una pestanya,
      // aquella es fa visible i les altres s'oculten
      var vMcNom = this.id.substr(0, 3); // A partir del nom del botó, deduïm el nom de la caixa
      var vIndex = this.id.substr(5, 1); // I l'index
      var i = 1;
      for (i = 1; i <= 9; i++) { // busquem totes les pestanyes d'aquella caixa
        //alert(vMcNom+"ps"+i);
        var vPsElem = document.getElementById(vMcNom + "ps" + i);
        if (!vPsElem) break;
        if (vIndex == i) { // Si és la pestanya bona la mostrem i canviem la classe de botó
          vPsElem.style.display = "block";
          vPsElem.style.visibility = "visible";
          document.getElementById(vMcNom + "bt" + i).className = "mcBotoSel";
        } else { // Sinó, l'ocultem i canviem la classe de botó
          vPsElem.style.display = "none";
          vPsElem.style.visibility = "hidden";
          document.getElementById(vMcNom + "bt" + i).className = "mcBoto";
        }
      }
      return false; // evitem la recàrrega de la pàgina
    }
    $(MetaCaixaInit);

/* Tabs 结束 */