1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 (c) 2005 U.S. Robotics Corporation
7 <title>Device » Time</title>
9 <link href="usr_main.css" rel="stylesheet" type="text/css">
10 <link href="usr_menus.css" rel="stylesheet" type="text/css"><script src="usr_menus.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
11 <script src="usr_common.js" type="text/javascript"></script
13 <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
14 <script type="text/javascript">
17 setPageTitle("<%ejGetWlJS(wlInterface)%>");
19 var state = '<%ejGetSntp(sntpRefresh)%>';
21 var code = 'location = "sntpcfg.sntp?sntpRefresh=0"';
25 var ntpServers = new Array(
31 "time.cachenetworks.com",
35 var timeZones = new Array(
36 "(UTC-12:00) International Date Line West",
37 "(UTC-11:00) Midway Island, Samoa",
40 "(UTC-08:00) Pacific Time, Tijuana",
41 "(UTC-07:00) Arizona, Mazatlan",
42 "(UTC-07:00) Chihuahua, La Paz",
43 "(UTC-07:00) Mountain Time",
44 "(UTC-06:00) Central America",
45 "(UTC-06:00) Central Time",
46 "(UTC-06:00) Guadalajara, Mexico City, Monterrey",
47 "(UTC-06:00) Saskatchewan",
48 "(UTC-05:00) Bogota, Lima, Quito",
49 "(UTC-05:00) Eastern Time",
50 "(UTC-05:00) Indiana",
51 "(UTC-04:00) Atlantic Time",
52 "(UTC-04:00) Caracas, La Paz",
53 "(UTC-04:00) Santiago",
54 "(UTC-03:30) Newfoundland",
55 "(UTC-03:00) Brasilia",
56 "(UTC-03:00) Buenos Aires, Georgetown",
57 "(UTC-03:00) Greenland",
58 "(UTC-02:00) Mid-Atlantic",
60 "(UTC-01:00) Cape Verde Is.",
61 "(UTC) Casablanca, Monrovia",
62 "(UTC) Universal Coordinated Time: Dublin, Edinburgh, Lisbon, London",
63 "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
64 "(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",
65 "(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",
66 "(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",
67 "(UTC+01:00) West Central Africa",
68 "(UTC+02:00) Athens, Istanbul, Minsk",
69 "(UTC+02:00) Bucharest",
71 "(UTC+02:00) Harare, Pretoria",
72 "(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",
73 "(UTC+02:00) Jerusalem",
74 "(UTC+03:00) Baghdad",
75 "(UTC+03:00) Kuwait, Riyadh",
76 "(UTC+03:00) Moscow, St. Petersburg, Volgograd",
77 "(UTC+03:00) Nairobi",
79 "(UTC+04:00) Abu Dhabi, Muscat",
80 "(UTC+04:00) Baku, Tbilisi, Yerevan",
82 "(UTC+05:00) Ekaterinburg",
83 "(UTC+05:00) Islamabad, Karachi, Tashkent",
84 "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",
85 "(UTC+05:45) Kathmandu",
86 "(UTC+06:00) Almaty, Novosibirsk",
87 "(UTC+06:00) Astana, Dhaka",
88 "(UTC+06:00) Sri Jayawardenepura",
89 "(UTC+06:30) Rangoon",
90 "(UTC+07:00) Bangkok, Hanoi, Jakarta",
91 "(UTC+07:00) Krasnoyarsk",
92 "(UTC+08:00) Beijing, Chongquing, Hong Kong, Urumqi",
93 "(UTC+08:00) Irkutsk, Ulaan Bataar",
94 "(UTC+08:00) Kuala Lumpur, Singapore",
97 "(UTC+09:00) Osaka, Sapporo, Tokyo",
99 "(UTC+09:00) Yakutsk",
100 "(UTC+09:30) Adelaide",
101 "(UTC+09:30) Darwin",
102 "(UTC+10:00) Brisbane",
103 "(UTC+10:00) Canberra, Melbourne, Sydney",
104 "(UTC+10:00) Guam, Port Moresby",
105 "(UTC+10:00) Hobart",
106 "(UTC+10:00) Vladivostok",
107 "(UTC+11:00) Magadan",
108 "(UTC+11:00) Solomon Is., New Caledonia",
109 "(UTC+12:00) Auckland, Wellington",
110 "(UTC+12:00) Fiji, Kamchatka, Marshall Is."
113 function getTimeZoneIndex(timeZoneName) {
114 var i = 0, ret = 4; // default to Pacific time
116 for ( var i = 0; i < timeZones.length; i++ ) {
117 if ( timeZones[i].search(timeZoneName) != -1 )
121 if ( i < timeZones.length )
127 function getTimeZoneName(idx) {
128 var str = timeZones[idx];
131 if ( idx != 25 && idx != 26 )
132 ret = str.substr(12);
139 function getTimeZoneOffset(idx) {
140 var str = timeZones[idx];
143 if ( idx != 25 && idx != 26 )
144 ret = str.substr(4, 6);
149 function writeTimeZoneList() {
150 for( var i = 0; i < timeZones.length; i++ )
151 document.writeln("<option value=" + getTimeZoneOffset(i) + ">" + timeZones[i] + "</option>");
154 function ntpChange(optionlist,textbox) {
155 if( optionlist[optionlist.selectedIndex].value == "Other" )
156 textbox.disabled = false;
159 textbox.disabled = true;
163 function btnApply() {
164 var loc = 'sntpcfg.sntp?ntp_enabled=';
166 with( document.forms[0] ) {
167 if( ntpEnabled.checked ) {
168 loc += '1&ntpServer1=';
169 if( ntpServer1.selectedIndex == ntpServers.length ) {
170 if( ntpServerOther1.value.length == 0 ) { // == Other
171 alert("The first time server is \"Other,\" but the IP address field is blank.");
174 loc += ntpServerOther1.value;
177 loc += ntpServer1[ntpServer1.selectedIndex].value;
180 loc += '&ntpServer2=';
181 if( ntpServer2.selectedIndex == ntpServers.length+1 ) {
182 if( ntpServerOther2.value.length == 0 ) { // == Other
183 alert("The second time server is \"Other,\" but the IP address field is blank.");
186 loc += ntpServerOther2.value;
189 if( ntpServer2.selectedIndex > 0 )
190 loc += ntpServer2[ntpServer2.selectedIndex].value;
193 loc += '&timezone_offset=' + cboTimeZone[cboTimeZone.selectedIndex].value;
194 loc += '&timezone=' + getTimeZoneName(cboTimeZone.selectedIndex);
201 var code = 'location = "' + loc + '";';
207 var ntp1 = "<%ejGetSntp(ntpServer1)%>";
208 var ntp2 = "<%ejGetSntp(ntpServer2)%>";
209 var ntp_enabled = "<%ejGetSntp(ntp_enabled)%>";
210 var tz_name = "<%ejGetSntp(timezone)%>";
212 with (document.forms[0]) {
213 if( ntp_enabled == "1" ) {
214 ntpEnabled.checked = true;
216 ntpEnabled.checked = false;
220 for( i = 0; i < ntpServers.length; i++ ) {
221 if( ntp1 == ntpServers[i] ) {
222 ntpServer1.selectedIndex = i;
226 if( i == ntpServers.length ) {
227 ntpServer1.selectedIndex = i; // Set to 'Other'
228 ntpServerOther1.value = ntp1;
231 ntpChange(ntpServer1,ntpServerOther1);
234 for( i = 0; i < ntpServers.length; i++ ) {
235 if( ntp2 == ntpServers[i] ) {
236 ntpServer2.selectedIndex = i+1;
240 if( i == ntpServers.length ) {
241 ntpServer2.selectedIndex = i+1; // Set to 'Other'
242 ntpServerOther2.value = ntp2;
245 ntpChange(ntpServer2,ntpServerOther2);
247 cboTimeZone.selectedIndex = getTimeZoneIndex(tz_name);
253 function hideNtpConfig(hide) {
254 var status = 'visible';
259 if( document.getElementById )
260 document.getElementById('ntpConfig').style.visibility = status;
263 document.all.ntpConfig.style.visibility = status;
266 function ntpEnblChange() {
267 if( document.forms[0].ntpEnabled.checked )
273 function writeNtpList(needed) {
275 document.writeln("<option value=\"None\">Disable</option>");
276 for( var i = 0; i < ntpServers.length; i++ )
277 document.writeln("<option value=" + ntpServers[i] + ">" + ntpServers[i] + "</option>");
278 document.writeln("<option value=\"Other\">(specify IP address manually)</option>");
284 <body onload="initMenu(); frmLoad();">
286 <script type="text/javascript">
287 writeHeader("Device", "<%ejGetJS(curUserName)%>", "<%ejGetOther(sysInfo, adslStd)%>", "<%ejGetOther(sysInfo, noBrPrtcl)%>", <%ejGetOther(sysInfo, pppIpExtension)%>, <%ejGetOther(sysInfo, enblFirewall)%>, <%ejGetOther(sysInfo, enblNat)%>, "<%ejGetWlJS(wlInterface)%>", <%ejGetJS(enblQos)%>);
292 <p>This page allows you to configure the router’s time servers.</p>
295 <p><input type="checkbox" name="ntpEnabled" id="ntpEnabled" onClick="ntpEnblChange()"> <label for="ntpEnabled">Automatically synchronize with Internet time servers</label></p>
298 <table border="0" cellpadding="2" cellspacing="0">
300 <td><label for="">Time server 1:</label></td>
302 <select name="ntpServer1" id="ntpServer1" onChange="ntpChange(this.form.ntpServer1,this.form.ntpServerOther1)">
303 <script type="text/javascript">
308 <td><input type="text" name="ntpServerOther1" id="ntpServerOther1"></td>
311 <td><label for="">Time server 2:</label></td>
313 <select name="ntpServer2" id="ntpServer2" onChange="ntpChange(this.form.ntpServer2,this.form.ntpServerOther2)">
314 <script type="text/javascript">
319 <td><input type="text" name="ntpServerOther2" id="ntpServerOther2"></td>
323 <td><label for="">Time zone offset:</label></td>
325 <select name="cboTimeZone" id="cboTimeZone">
326 <script type="text/javascript">
335 <p><input type="button" value="Save" onClick="btnApply()"></p>
338 <script type="text/javascript">