rem: legends = children[i].getElementsByTagName('LEGEND'); 
add: legends = children[i].getElementsByTagName('legend'); 
context: function tabbedprefs() {    prefform = document.getElementById('preferences');    if(!prefform || !document.createElement) return;    if(prefform.nodeName == 'A') return; // Occasional IE problem    prefform.className = prefform.className + 'jsprefs';    var sections = new Array();    children = prefform.childNodes;    var seci = 0;    for(i=0;i<children.length;i++) {        if(children[i].nodeName.indexOf('FIELDSET') != -1) {            children[i].id = 'prefsection-' + seci;            children[i].className = 'prefsection';            if(is_opera || is_khtml) children[i].className = 'prefsection operaprefsection';            legends = children[i].getElementsByTagName('LEGEND');            sections[seci] = new Object();            if(legends[0] && legends[0].firstChild.nodeValue)                sections[seci].text = legends[0].firstChild.nodeValue;            else                sections[seci].text = '# ' + seci;            sections[seci].secid = children[i].id;            seci++;            if(sections.length != 1) children[i].style.display = 'none';            else var selectedid = children[i].id;        }    }    var toc = document.createElement('UL');    toc.id = 'preftoc';    toc.selectedid = selectedid;    for(i=0;i<sections.length;i++) {        var li = document.createElement('LI');        if(i == 0) li.className = 'selected';        var a =  document.createElement('A');        a.href = '#' + sections[i].secid;        a.onclick = uncoversection;        a.innerHTML = sections[i].text;        a.secid = sections[i].secid;        li.appendChild(a);        toc.appendChild(li);    }    prefform.insertBefore(toc, children[0]);    document.getElementById('prefsubmit').id = 'prefcontrol';}
meta: 2776	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2776/a473d6ec1a46d0ad3a728b112431ebfde164928c/wikibits.js/clean/skins/common/wikibits.js