http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / html / dnscfg.html
1 <html>
2    <head>
3       <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
4       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
5       <link rel="stylesheet" href='stylemain.css' type='text/css'>
6          <link rel="stylesheet" href='colors.css' type='text/css'>
7             <script language="javascript" src="util.js"></script>
8             <script language="javascript">
9 <!-- hide
10 parent.helpframe.location.href="hlpdnscfg.html";
11 var randomNum = '<%ejGet(CheckNum)%>';
12 var old_enableAuto;
13 var auto = '<%ejGetOther(sysInfo, dnsAuto)%>';
14 var dns1Ip = '<%ejGetOther(sysInfo, psidns)%>';
15 var dns2Ip = '<%ejGetOther(sysInfo, psidns2)%>';
16
17 function hideDnsInfo(hide) {
18    var status = 'visible';
19
20    if ( hide == 1 )
21       status = 'hidden';
22    if (document.getElementById)  // DOM3 = IE5, NS6
23       document.getElementById('dnsInfo').style.visibility = status;
24    else {
25       if (document.layers == false) // IE4
26          document.all.dnsInfo.style.visibility = status;
27    }
28 }
29
30
31 function dnsClick(cb) {
32    if (cb.checked == true)
33       hideDnsInfo(1);
34    else
35       hideDnsInfo(0);
36 }
37
38 function do_cgi(){
39         var loc = 'dnscfg.cgi?';
40         loc += 'checkNum=' + randomNum + '&';
41
42         with ( document.forms[0] ) {
43         if (enableAuto.checked == false) {
44                 if ( isValidIpAddress(dnsPrimary.value) == false ) {
45                 alert('Primary DNS "' + dnsPrimary.value + '" has invalid IP address.');
46                 return;
47                 }
48                 loc += 'dnsPrimary=' + dnsPrimary.value;
49                 if (dnsSecondary.value != '') {
50                 if ( isValidIpAddress(dnsSecondary.value) == false ) {
51                         alert('Secondary DNS "' + dnsSecondary.value + '" has invalid IP address.');
52                         return;
53                 }
54                 loc += '&dnsSecondary=' + dnsSecondary.value;
55                 } else
56                 loc += '&dnsSecondary=' + '0.0.0.0';
57                 loc += '&dnsDynamic=0';//add by wilson
58         } else {
59                 loc += 'dnsPrimary=' + '0.0.0.0';
60                 loc += '&dnsSecondary=' + '0.0.0.0';
61                 loc += '&dnsDynamic=1';//add by wilson
62         }
63         }
64         var code = 'window.location.href="/'; // for Mac safari browser compatibility
65         code += loc + '"';
66         eval(code);
67 }
68
69
70 function btnApply() {
71    with ( document.forms[0] ) {
72       if (enableAuto.checked == true){
73         if (old_enableAuto == enableAuto.checked){
74               var loc = 'dnscfg.html';
75               var code = 'window.location.href="/'; // for Mac safari browser compatibility
76                           code += loc + '"';
77               eval(code);
78            } else {
79               do_cgi();
80            }
81         } else {
82           if ( old_enableAuto == enableAuto.checked && dnsPrimary.value == dns1Ip && dnsSecondary.value == dns2Ip) {
83               var loc = 'dnscfg.html';
84               var code = 'window.location.href="/'; // for Mac safari browser compatibility
85                           code += loc + '"';
86               eval(code);
87           } else {
88             do_cgi();
89           }
90         }
91    }
92 }
93
94
95 function frmLoad() {
96         with ( document.forms[0] ) {
97         if ( dns1Ip == '&nbsp' || dns1Ip == '0.0.0.0') dns1Ip = '';
98         if ( dns2Ip == '&nbsp' || dns2Ip == '0.0.0.0') dns2Ip = '';
99         dnsPrimary.value=dns1Ip;
100         dnsSecondary.value=dns2Ip;
101         if ( auto == '1' ) {
102                 enableAuto.checked = true;
103                 old_enableAuto=true;
104                 hideDnsInfo(1);
105         } else {
106                 enableAuto.checked = false;
107                 old_enableAuto=false;
108                 hideDnsInfo(0);
109         }
110         }
111         if (<%ejGet(changeset)%> == 1){
112                 parent.footerfrm.location.href="footer.html";
113         }
114 }
115
116 // done hiding -->
117 </script>
118    </head>
119    <body onLoad='frmLoad()'>
120
121          <form class="formpadding">
122 <table border="0" cellpadding="0" cellspacing="3" width="98%">
123 <tr>
124   <td><b><font class="netgear">DNS Server Configuration</font></b></td>
125 </tr>
126 <tr><td>&nbsp;</td></tr>
127 <tr>\r
128   <td background="liteblue.gif" height="12">&nbsp;</td>\r
129 </tr>
130 </table>
131             
132             <table border="0" cellpadding="0" cellspacing="0">
133                <tr>
134                   <td align="left" width="25" height="30">
135                      <input type='checkbox' name='enableAuto' onclick='dnsClick(this)'></td>
136                   <td colspan="2">
137                      Enable Automatic Assigned DNS</td>
138                </tr>
139             </table>
140             <br>
141             <div id='dnsInfo'>
142                <table border="0" cellpadding="0" cellspacing="0">
143                   <tr>
144                      <td>Primary DNS server:
145                      </td>
146                      <td><input type='text' name='dnsPrimary'></td>
147                   </tr>
148                   <tr>
149                      <td>Secondary DNS server:
150                      </td>
151                      <td><input type='text' name='dnsSecondary'></td>
152                   </tr>
153                </table>
154             </div>
155 <table border="0" cellpadding="0" cellspacing="3" width="98%">
156 <tr>\r
157   <td background="liteblue.gif" height="12">&nbsp;</td>\r
158 </tr>
159 </table>
160             <table width='520'><tr>
161                 <td align='left' width="50" valign="top"><input type='button' onClick='btnApply()' value='Apply'></td>
162                 <td align="left" width="60" valign="top"><input type="button" onClick="btnCancel('dnscfg.html')" value="Cancel"></td>
163                 <td class="grey_comment" width="410">If changing from unselected Automatic Assigned DNS to selected Automatic Assigned DNS, You must reboot the router to get the automatic assigned DNS addresses.</td>
164             </tr></table>
165          </form>
166
167    </body>
168 </html>