1 <% if has_v4 and has_v6 then %>
2 <script type="text/javascript">//<![CDATA[
4 function css(selector, property, value) {
5 for (var i=0; i<document.styleSheets.length;i++) {
6 try { document.styleSheets[i].insertRule(selector+ ' {'+property+':'+value+'}', document.styleSheets[i].cssRules.length);
7 } catch(err) {try { document.styleSheets[i].addRule(selector, property+':'+value);} catch(err) {}}//IE
11 window.onload = function() {
12 buttons = '<input type="button" name="show-proto-4" id="show-proto-4" class="cbi-button cbi-button-apply" style="margin-right: 5px" value="<%:Hide IPv4%>">'
13 buttons += '<input type="button" name="show-proto-6" id="show-proto-6" class="cbi-button cbi-button-apply" value="<%:Hide IPv6%>">'
15 document.getElementById('togglebuttons').innerHTML = buttons;
18 document.getElementById('show-proto-4').onclick = function() {
20 document.getElementById('show-proto-4').value = visible ? '<%:Hide IPv4%>' : '<%:Show IPv4%>';
21 document.getElementById('show-proto-4').className = visible ? 'cbi-button cbi-button-apply' : 'cbi-button cbi-button-reset';
22 css('.proto-4', 'display', visible ? 'table-row' : 'none')
26 document.getElementById('show-proto-6').onclick = function() {
28 document.getElementById('show-proto-6').value = visible6 ? '<%:Hide IPv6%>' : '<%:Show IPv6%>';
29 document.getElementById('show-proto-6').className = visible6 ? 'cbi-button cbi-button-apply' : 'cbi-button cbi-button-reset';
30 css('.proto-6', 'display', visible6 ? 'table-row' : 'none')