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>Time « Device</title>
9 <link href="usr_layout.css" type="text/css" rel="stylesheet" />
10 <script src="usr_layout.js" type="text/javascript"></script>
12 <link href="usr_device.css" type="text/css" rel="stylesheet" />
13 <script src="usr_device.js" type="text/javascript"></script>
15 <link href="usr_menus_dropdown.css" rel="stylesheet" type="text/css">
16 <script src="usr_menus_dropdown.js" type="text/javascript"></script>
17 <script src="usr_menus_build.js" type="text/javascript"></script>
19 <link href="usr_91xx.css" type="text/css" rel="stylesheet" />
20 <script src="usr_91xx.js" type="text/javascript"></script>
21 <script src="usr_resources.js" type="text/javascript"></script>
23 <script type="text/javascript">
26 var state = '<%ejGetSntp(sntpRefresh)%>';
28 var code = 'location = "sntpcfg.sntp?sntpRefresh=0"';
32 var ntpServers = new Array(
38 "time.cachenetworks.com",
42 var timeZones = new Array(
43 "(UTC-12:00) International Date Line West",
44 "(UTC-11:00) Midway Island, Samoa",
47 "(UTC-08:00) Pacific Time, Tijuana",
48 "(UTC-07:00) Arizona, Mazatlan",
49 "(UTC-07:00) Chihuahua, La Paz",
50 "(UTC-07:00) Mountain Time",
51 "(UTC-06:00) Central America",
52 "(UTC-06:00) Central Time",
53 "(UTC-06:00) Guadalajara, Mexico City, Monterrey",
54 "(UTC-06:00) Saskatchewan",
55 "(UTC-05:00) Bogota, Lima, Quito",
56 "(UTC-05:00) Eastern Time",
57 "(UTC-05:00) Indiana",
58 "(UTC-04:00) Atlantic Time",
59 "(UTC-04:00) Caracas, La Paz",
60 "(UTC-04:00) Santiago",
61 "(UTC-03:30) Newfoundland",
62 "(UTC-03:00) Brasilia",
63 "(UTC-03:00) Buenos Aires, Georgetown",
64 "(UTC-03:00) Greenland",
65 "(UTC-02:00) Mid-Atlantic",
67 "(UTC-01:00) Cape Verde Is.",
68 "(UTC) Casablanca, Monrovia",
69 "(UTC) Universal Coordinated Time: Dublin, Edinburgh, Lisbon, London",
70 "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
71 "(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",
72 "(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",
73 "(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",
74 "(UTC+01:00) West Central Africa",
75 "(UTC+02:00) Athens, Istanbul, Minsk",
76 "(UTC+02:00) Bucharest",
78 "(UTC+02:00) Harare, Pretoria",
79 "(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",
80 "(UTC+02:00) Jerusalem",
81 "(UTC+03:00) Baghdad",
82 "(UTC+03:00) Kuwait, Riyadh",
83 "(UTC+03:00) Moscow, St. Petersburg, Volgograd",
84 "(UTC+03:00) Nairobi",
86 "(UTC+04:00) Abu Dhabi, Muscat",
87 "(UTC+04:00) Baku, Tbilisi, Yerevan",
89 "(UTC+05:00) Ekaterinburg",
90 "(UTC+05:00) Islamabad, Karachi, Tashkent",
91 "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",
92 "(UTC+05:45) Kathmandu",
93 "(UTC+06:00) Almaty, Novosibirsk",
94 "(UTC+06:00) Astana, Dhaka",
95 "(UTC+06:00) Sri Jayawardenepura",
96 "(UTC+06:30) Rangoon",
97 "(UTC+07:00) Bangkok, Hanoi, Jakarta",
98 "(UTC+07:00) Krasnoyarsk",
99 "(UTC+08:00) Beijing, Chongquing, Hong Kong, Urumqi",
100 "(UTC+08:00) Irkutsk, Ulaan Bataar",
101 "(UTC+08:00) Kuala Lumpur, Singapore",
103 "(UTC+08:00) Taipei",
104 "(UTC+09:00) Osaka, Sapporo, Tokyo",
106 "(UTC+09:00) Yakutsk",
107 "(UTC+09:30) Adelaide",
108 "(UTC+09:30) Darwin",
109 "(UTC+10:00) Brisbane",
110 "(UTC+10:00) Canberra, Melbourne, Sydney",
111 "(UTC+10:00) Guam, Port Moresby",
112 "(UTC+10:00) Hobart",
113 "(UTC+10:00) Vladivostok",
114 "(UTC+11:00) Magadan",
115 "(UTC+11:00) Solomon Is., New Caledonia",
116 "(UTC+12:00) Auckland, Wellington",
117 "(UTC+12:00) Fiji, Kamchatka, Marshall Is."
120 function getTimeZoneIndex(timeZoneName) {
121 var i = 0, ret = 4; // default to Pacific time
123 for ( var i = 0; i < timeZones.length; i++ ) {
124 if ( timeZones[i].search(timeZoneName) != -1 )
128 if ( i < timeZones.length )
134 function getTimeZoneName(idx) {
135 var str = timeZones[idx];
138 if ( idx != 25 && idx != 26 )
139 ret = str.substr(12);
146 function getTimeZoneOffset(idx) {
147 var str = timeZones[idx];
150 if ( idx != 25 && idx != 26 )
151 ret = str.substr(4, 6);
156 function writeTimeZoneList() {
157 for( var i = 0; i < timeZones.length; i++ )
158 document.writeln("<option value=" + getTimeZoneOffset(i) + ">" + timeZones[i] + "</option>");
161 function ntpChange(optionlist,textbox) {
162 if( optionlist[optionlist.selectedIndex].value == "Other" )
163 textbox.disabled = false;
166 textbox.disabled = true;
170 function btnApply() {
171 var loc = 'sntpcfg.sntp?ntp_enabled=';
173 with( document.forms[0] ) {
174 if( ntpEnabled.checked ) {
175 loc += '1&ntpServer1=';
176 if( ntpServer1.selectedIndex == ntpServers.length ) {
177 if( ntpServerOther1.value.length == 0 ) { // == Other
178 alert("The first time server is \"Other,\" but the IP address field is blank.");
181 loc += ntpServerOther1.value;
184 loc += ntpServer1[ntpServer1.selectedIndex].value;
187 loc += '&ntpServer2=';
188 if( ntpServer2.selectedIndex == ntpServers.length+1 ) {
189 if( ntpServerOther2.value.length == 0 ) { // == Other
190 alert("The second time server is \"Other,\" but the IP address field is blank.");
193 loc += ntpServerOther2.value;
196 if( ntpServer2.selectedIndex > 0 )
197 loc += ntpServer2[ntpServer2.selectedIndex].value;
200 loc += '&timezone_offset=' + cboTimeZone[cboTimeZone.selectedIndex].value;
201 loc += '&timezone=' + getTimeZoneName(cboTimeZone.selectedIndex);
208 var code = 'location = "' + loc + '";';
214 var ntp1 = "<%ejGetSntp(ntpServer1)%>";
215 var ntp2 = "<%ejGetSntp(ntpServer2)%>";
216 var ntp_enabled = "<%ejGetSntp(ntp_enabled)%>";
217 var tz_name = "<%ejGetSntp(timezone)%>";
219 with (document.forms[0]) {
220 if( ntp_enabled == "1" ) {
221 ntpEnabled.checked = true;
223 ntpEnabled.checked = false;
227 for( i = 0; i < ntpServers.length; i++ ) {
228 if( ntp1 == ntpServers[i] ) {
229 ntpServer1.selectedIndex = i;
233 if( i == ntpServers.length ) {
234 ntpServer1.selectedIndex = i; // Set to 'Other'
235 ntpServerOther1.value = ntp1;
238 ntpChange(ntpServer1,ntpServerOther1);
241 for( i = 0; i < ntpServers.length; i++ ) {
242 if( ntp2 == ntpServers[i] ) {
243 ntpServer2.selectedIndex = i+1;
247 if( i == ntpServers.length ) {
248 ntpServer2.selectedIndex = i+1; // Set to 'Other'
249 ntpServerOther2.value = ntp2;
252 ntpChange(ntpServer2,ntpServerOther2);
254 cboTimeZone.selectedIndex = getTimeZoneIndex(tz_name);
260 function hideNtpConfig(hide) {
261 var status = 'visible';
266 if( document.getElementById )
267 document.getElementById('ntpConfig').style.visibility = status;
270 document.all.ntpConfig.style.visibility = status;
273 function ntpEnblChange() {
274 if( document.forms[0].ntpEnabled.checked )
280 function writeNtpList(needed) {
282 document.writeln("<option value=\"None\">Disable</option>");
283 for( var i = 0; i < ntpServers.length; i++ )
284 document.writeln("<option value=" + ntpServers[i] + ">" + ntpServers[i] + "</option>");
285 document.writeln("<option value=\"Other\">(specify IP address manually)</option>");
291 <body onload="initMenu(); frmLoad();">
293 <script type="text/javascript">
294 writeHeader("Device");
299 <p>This page allows you to configure the router’s time servers.</p>
302 <p><input type="checkbox" name="ntpEnabled" id="ntpEnabled" onClick="ntpEnblChange()"> <label for="ntpEnabled">Automatically synchronize with Internet time servers</label></p>
305 <table border="0" cellpadding="2" cellspacing="0">
307 <td><label for="">Time server 1:</label></td>
309 <select name="ntpServer1" id="ntpServer1" onChange="ntpChange(this.form.ntpServer1,this.form.ntpServerOther1)">
310 <script type="text/javascript">
315 <td><input type="text" name="ntpServerOther1" id="ntpServerOther1"></td>
318 <td><label for="">Time server 2:</label></td>
320 <select name="ntpServer2" id="ntpServer2" onChange="ntpChange(this.form.ntpServer2,this.form.ntpServerOther2)">
321 <script type="text/javascript">
326 <td><input type="text" name="ntpServerOther2" id="ntpServerOther2"></td>
330 <td><label for="">Time zone offset:</label></td>
332 <select name="cboTimeZone" id="cboTimeZone">
333 <script type="text/javascript">
342 <p><input type="button" value="Save" onClick="btnApply()"></p>
345 <script type="text/javascript">