MediaWiki:Common.js

/* */

/* Include Global Anime-Common.js Information */ document.write(' ');

if (skin == 'monobook'){ document.write(' '); }

/* Allows toggle of game navigation */ var displayStates = new Array('none', ''); var displayText = new Array('show', 'hide');

function gamenav_init { var idnum = 0; // Find all tables with class gamenav var tables = getElementsByClassName(document, "table", "game nav"); for (var ti = 0; ti < tables.length ; ti++) { var tab = tables[ti];

tab.setAttribute('state', 1); // 1 is the show state var gameNavTog = document.createElement("a"); gameNavTog.setAttribute('href', 'javascript:toggleGameNav("' + tab.id + '");'); gameNavTog.setAttribute('id', 'tog_' + tab.id);

var gameNavTogText = document.createTextNode('hide'); gameNavTog.appendChild(gameNavTogText);

var spans = getElementsByClassName(tab, "span", "game nav tog"); for( var sj=0; sj < spans.length; sj++ ){ spans[sj].appendChild(gameNavTog); }	} } function toggleGameNav(tableID) { var nothing; var tab = document.getElementById(tableID); var newState = 1- tab.getAttribute('state'); tab.setAttribute('state', newState); for (var ti=0; ti < tab.rows.length; ti++){ var myRow = tab.rows[ti]; if (myRow.className != "nohide"){ myRow.style.display = displayStates[newState]; }	}	var togA = document.getElementById('tog_' + tableID); var togTxt = togA.firstChild; togTxt.data = displayText[newState]; }

addOnloadHook(gamenav_init);

/* */