var spoil, sexual, t; // Fixes the commas between trait names and the hidden status of the entire row function fixrow(c) { var l = byName(byName(c, 'td')[1], 'span'); var first = 1; for(var i=0; i 1 : hasClass(k[i], 'charspoil_1') ? spoil < 1 : spoil < 2); for(var i=0; i<3; i++) setClass(h[i], 'sel', spoil == i); if(h[3]) setClass(h[3], 'sel', sexual); if(k.length) restripe(); return false; } function init() { var h = byName(byId('charops'), 'a'); t = byClass('table', 'stripe'); // Spoiler level for(var i=0; i<3; i++) { h[i].num = i; h[i].onclick = function() { spoil = this.num; return setall(h); }; if(hasClass(h[i], 'sel')) spoil = i; }; // Sexual toggle if(h[3]) { h[3].onclick = function() { sexual = !sexual; return setall(h); }; sexual = hasClass(h[3], 'sel'); } setall(h); } if(byId('charops')) init();