/* generated javascript */
var skin = 'monobook';
var stylepath = '/skins';

/* MediaWiki:Common.js */
// <source lang="javascript">
/****** includePage ******
 * force the loading of JavaScript files (see import below)
 */
 
function includePage( name )
{
 document.write('<script type="text/javascript" src="' + wgScript + '?title='
  + name 
  + '&action=raw&ctype=text/javascript"><\/script>' 
 );
}
/* End of includePage */

/*********************************************/
/* Import more specific scripts if necessary */
if (wgAction == "edit" || wgAction == "submit") 
{
    includePage("MediaWiki:Edittools.js");
}
else if (wgCanonicalSpecialPageName == "Upload")
{
    includePage("MediaWiki:Onlyifuploading.js");
    includePage("MediaWiki:Edittools.js");
}

/*********************************************/
/* Test if an element has a certain class
 *
 * Description: Uses regular expressions and caching for better performance.
 */

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

/*********************************************/
/* Collapsible tables
 *
 * Description: Allows tables to be collapsed, showing only the header.
 */

var autoCollapse = 2;
var collapseCaption = "[--]";
var expandCaption = "[+]";

function collapseTable( 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;
    }
}

function createCollapseButtons()
{
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( "table" );

    for ( var i = 0; i < Tables.length; i++ ) {
        if ( hasClass( Tables[i], "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.className = "collapseButton";  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + 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 ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, "outercollapse" ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

addOnloadHook( createCollapseButtons );

/*********************************************/
/* Table sorting fixes
 *
 *  Description: Disables code in table sorting routine to set classes on even/odd rows
 */

ts_alternate_row_colors = false;

/*********************************************/
/* Verändert die Tabellensortierfunktion so,
 * dass auch deutsche Tausenderpunkt und Dezimalkommata gehen
 * Original aus sv.wikipedia.org
 */

function ts_parseFloat(num) {
    if (!num) return 0;
    num = num.replace(/\./g, "");
    num = num.replace(/,/, ".");
    num = parseFloat(num);
    return (isNaN(num) ? 0 : num);
}

/***********************************************************/
/* Fügt eine Betreffzeile auf leeren Diskussionsseiten ein */
 
addOnloadHook(function() {
        if(wgNamespaceNumber != 0 && wgNamespaceNumber != 1) return;
	var tab = document.getElementById( 'ca-talk' );
	if( !tab || tab.className != 'new' ) return;
	var link = tab.getElementsByTagName( 'a' )[0];
	if( !link ) return;
	link.href += '&section=new';
});

/***********************************************************/
/* Lädt zusätzliche Stylesheets */

importStylesheet("MediaWiki:Common.css/AdminMark.css");

// </source>

/* MediaWiki:Monobook.js */
// <source lang="javascript">
/* Der Grossteil der Codes befindet sich in [[MediaWiki:Common.js]] */

//================================================================================
//*** moveEditsection: Moving of the editsection links

/*
 * moveEditsection
 * Dieses Script verschiebt die [Bearbeiten]-Buttons vom rechten Fensterrand
 * direkt rechts neben die jeweiligen Überschriften.
 * This script moves the [edit]-buttons from the right border of the window
 * directly right next to the corresponding headings.
 *
 * Zum Abschalten die folgende Zeile (ohne führendes Sternchen) in die eigene
 * monobook.js (zu finden unter [[Special:Mypage/monobook.js|Benutzer:Name/monobook.js]]) kopieren:
 * var oldEditsectionLinks = true;
 *
 */
addOnloadHook(function() {
    if (typeof oldEditsectionLinks != 'undefined' && oldEditsectionLinks)   return;
    var spans = document.getElementsByTagName("span");
    for (var i=0; i<spans.length; i++) {
        var span = spans[i];
        if (span.className != "editsection")    continue;
        span.style.fontSize = "x-small";
        span.style.fontWeight = "normal";
        span.style.styleFloat = "none"; // IE-Fix für die folgende Zeile
        span.style.cssFloat = "none";
        span.style.marginLeft = "0px";
        span.parentNode.appendChild(document.createTextNode(" "));
        span.parentNode.appendChild(span);
    }
});


// </source>