1function changeStyle(hideRegex) { 2 for (m in document.styleSheets) { 3 var theRules; 4 if (document.styleSheets[m].cssRules) { 5 theRules = document.styleSheets[m].cssRules; 6 } else if (document.styleSheets[m].rules) { 7 theRules = document.styleSheets[m].rules; 8 } 9 for (n in theRules) { 10 var rule = theRules[n]; 11 var sel = rule.selectorText; 12 if (sel != undefined && sel.match(/vv/)) { 13 var theStyle = rule.style; 14 if (sel.match(hideRegex)) { 15 if (theStyle.display == 'table-row') { 16 theStyle.display = null; 17 } 18 } else { 19 if (theStyle.display != 'table-row') { 20 theStyle.display = 'table-row'; 21 } 22 } 23 } 24 } 25 } 26} 27 28function setStyles() { 29 var hideRegexString = "X1234X"; 30 for (i=0; i < document.checkboxes.elements.length; i++){ 31 var item = document.checkboxes.elements[i]; 32 if (!item.checked) { 33 hideRegexString += "|"; 34 hideRegexString += item.name; 35 } 36 } 37 var hideRegex = new RegExp(hideRegexString); 38 changeStyle(hideRegex); 39} 40