User:Wester/vector.js

$( function {      //if (!prefs) return;      prefs=["nl"];      trans=["Nederlands"];      var iwlinks = [];      for (i=0;i<prefs.length;i++) {          iwlinks["interwiki-" + prefs[i]] = trans[i];      }      var container = document.getElementById("p-lang");      if (!container) return;      var keeps = Array;      var ul = container.getElementsByTagName("ul");      if (!ul) return;      if (ul.length != 1) return;      ul = ul[0];      var childs = container.getElementsByTagName("li");      for (i=0;i=0;i--) { if ( !iwlinks[ childs[i].getAttribute( 'class' ) ] ) { keeps[--n] = childs[i]; }         else { childs[i].setAttribute( 'class', childs[i].getAttribute( 'class' ) + ' iw-focus' ); }     }      var child; while (child = ul.firstChild) { ul.removeChild(child); }     for (i=0;i<keeps.length;i++) { ul.appendChild(keeps[i]); } });