• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/www/sysdep/RT-AC5300/www/qis/
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>                                     
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
6<meta HTTP-EQUIV="Expires" CONTENT="-1">
7<link rel="stylesheet" type="text/css" href="/form_style.css">
8<script type="text/javascript" src="/qis/QISMobilePlugin.js"></script>
9<script type="text/JavaScript" src="/state.js"></script>
10<script type="text/JavaScript" src="/alttxt.js"></script>
11<script type="text/JavaScript" src="/general.js"></script>
12<script type="text/JavaScript" src="/help.js"></script>
13<script type="text/JavaScript" src="/validator.js"></script>
14<script type="text/JavaScript">
15<% wanlink(); %>
16
17<% login_state_hook(); %>
18
19var now_flag = '<% get_parameter("flag"); %>';
20var original_wan_proto = wanlink_type();
21var DHCPClient = '<% nvram_get("wan0_dhcpenable_x"); %>';
22var from_page = '<% get_parameter("prev_page"); %>';
23var original_switch_wantag = '<% nvram_get("switch_wantag"); %>';
24
25<% wan_get_parameter(); %>
26
27function QKInternet_load_body(){
28	parent.document.title = "<#Web_Title#> - <#QKSet_ISP_head#>";
29	if(parent.ISMOBILE){
30		parent.set_step("internet_type");
31		hideObjs();
32		document.getElementById("QISmain").style.display = "none";
33		document.getElementById("QISmain_m").style.display = "";	
34		displayLANIPCtrl();
35		displayDNSCtrl();
36
37		if(now_flag == "auto_way_vpn" && from_page == "start_apply.htm")
38			now_flag = "auto_way";
39
40		get_value_from_parent();
41		get_value_from_parent_m();
42
43		if(now_flag == "auto_way_static"){
44			blocking_m("showip_m", true);		
45			blocking_m("dns_sec_m", true);		
46			blocking_m("showserver_m", false);		
47			blocking_m("showhwaddr_m", true);
48		}
49		else if(now_flag == "auto_way"){
50			blocking_m("showip_m", true);		
51			blocking_m("dns_sec_m", true);		
52			blocking_m("showserver_m", true);
53			// blocking_m("vpn_enable_block", true);
54			blocking_m("showhwaddr_m", false);
55		}
56		else if(document.form.wan_proto.value == "pptp"	|| document.form.wan_proto.value == "l2tp"){
57			blocking_m("showip_m", true);		
58			blocking_m("dns_sec_m", true);		
59			blocking_m("showserver_m", true);
60			// blocking_m("heartbeat_server", true);
61			blocking_m("showhwaddr_m", false);		
62
63			document.form.prev_page.value = "QIS_internet_account.htm";
64			parent.set_step("internet_account");
65		}
66		else if(document.form.wan_proto.value == "static"){
67			blocking_m("dhcp_info_radio_m", false);
68			blocking_m("showip_m", true);
69			blocking_m("WANIPDiv", true);
70			blocking_m("dns_info_radio_m", false);
71			blocking_m("dns_sec_m", true);
72			blocking_m("DNSDiv", true);
73			blocking_m("showserver_m", false);
74			blocking_m("showhwaddr_m", true);
75
76			document.getElementById("dns_info_title_m").innerHTML = "<#PPPConnection_x_WANDNSServer_itemname#>";		
77			document.form.wan_dnsenable_x[0].checked = 0;
78			document.form.wan_dnsenable_x[1].checked = 1;
79			document.form.prev_page.value = "QIS_internet_type.htm";
80			parent.set_step("internet_type");
81		}
82		else{	// wan_proto == dhcp
83			blocking_m("showip_m", false);
84			blocking_m("dns_sec_m", true);
85			blocking_m("showserver_m", false);
86			blocking_m("showhwaddr_m", false);
87
88			document.form.prev_page.value = "QIS_internet_isp.htm";
89			parent.set_step("internet_isp");
90		}	
91
92		set_default_state();
93		if(confirm_vpn_enable()){
94			document.form.vpn_enable[0].checked = 1;
95			document.form.vpn_enable[1].checked = 0;
96		}
97		else{
98			document.form.vpn_enable[0].checked = 0;
99			document.form.vpn_enable[1].checked = 1;
100		}
101	}
102	else{
103		parent.set_step("t2");		
104		hideLinkTag();
105		flash_button();
106
107		if(now_flag.length <= 0)
108			showtext(document.getElementById("page_title"), "<#QKSet_ISP_desc#>");
109		else if(DHCPClient == "1")
110			showtext(document.getElementById("page_title"), "<#QKSet_ISP_desc3#>");
111		else	// if(DHCPClient == "0")
112			showtext(document.getElementById("page_title"), "<#QKSet_ISP_desc2#>");
113		
114		if(now_flag == "auto_way_vpn" && from_page == "start_apply.htm")
115			now_flag = "auto_way";
116		
117		get_value_from_parent();
118
119		if(now_flag == "auto_way_static"){
120			blocking("showip", true);		
121			blocking("dns_sec", true);		
122			blocking("showserver", false);		
123			blocking("showhwaddr", true);
124		}
125		else if(now_flag == "auto_way"){
126			blocking("showip", true);		
127			blocking("dns_sec", true);		
128			blocking("showserver", true);
129			blocking("vpn_enable_block", true);
130			blocking("showhwaddr", false);
131		}
132		else if(document.form.wan_proto.value == "pptp"
133						|| document.form.wan_proto.value == "l2tp"){
134			blocking("showip", true);		
135			blocking("dns_sec", true);		
136			blocking("showserver", true);
137			blocking("heartbeat_server", true);
138			inputCtrl(document.form.wan_heartbeat_x, 1);		
139			blocking("showhwaddr", false);		
140			document.form.prev_page.value = "QIS_internet_account.htm";
141		}
142		else if(document.form.wan_proto.value == "static"){
143			document.getElementById("dhcp_info_radio").style.display = "none";
144			blocking("showip", true);
145			document.getElementById("dns_info_title").innerHTML = "<#PPPConnection_x_WANDNSServer_itemname#>";		
146			document.getElementById("dns_info_radio").style.display = "none";
147			blocking("dns_sec", true);
148			blocking("showserver", false);
149			blocking("showhwaddr", true);
150			document.form.prev_page.value = "QIS_internet_type.htm";
151			document.form.wan_dnsenable_x[0].checked = 0;
152			document.form.wan_dnsenable_x[1].checked = 1;
153		}
154		else{	// wan_proto == dhcp
155			blocking("showip", false);
156			blocking("dns_sec", true);
157			blocking("showserver", false);
158			blocking("showhwaddr", false);
159			document.form.prev_page.value = "QIS_internet_isp.htm";
160		}
161		
162		set_default_state();
163		show_prev_button();
164		
165		if(confirm_vpn_enable()){
166			document.form.vpn_enable[0].checked = 1;
167			document.form.vpn_enable[1].checked = 0;
168		}
169		else{
170			document.form.vpn_enable[0].checked = 0;
171			document.form.vpn_enable[1].checked = 1;
172		}
173		show_next_button();
174	
175		if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod'){
176	    document.getElementsByClassName("IPaddr_qis")[0].style.width = "180px";
177	    document.getElementsByClassName("IPaddr_qis")[1].style.width = "180px";
178	    document.getElementsByClassName("IPaddr_qis")[2].style.width = "180px";
179	    document.getElementsByClassName("IPaddr_qis")[3].style.width = "180px";
180	    document.getElementsByClassName("IPaddr_qis")[4].style.width = "180px";
181		}
182		
183		document.getElementById("nextButton").focus();
184	}
185}
186
187function blocking_m(obj_id, show){
188	var state = show?'block':'none';
189	
190	if(document.getElementById)
191		document.getElementById(obj_id).style.display = state;
192	else if(document.layers)
193		document.layers[obj_id].display = state;
194	else if(document.all)
195		document.all[obj_id].style.display = state;
196}
197
198
199function get_value_from_parent(){
200	document.form.wan_proto.value = parent.document.QKform.wan_proto.value;
201	
202	document.form.wan_pppoe_username.value = parent.document.QKform.wan_pppoe_username.value;
203	document.form.wan_pppoe_passwd.value = parent.document.QKform.wan_pppoe_passwd.value;
204	
205	document.form.wan_hostname.value = parent.document.QKform.wan_hostname.value;
206	document.form.wan_hwaddr_x.value = parent.document.QKform.wan_hwaddr_x.value;
207	document.form.wan_hwaddr_x_m.value = parent.document.QKform.wan_hwaddr_x.value;
208	
209	
210	
211	document.form.lan_ipaddr.value = parent.document.QKform.lan_ipaddr.value;
212	document.form.lan_netmask.value = parent.document.QKform.lan_netmask.value;
213	
214	document.form.wan_ipaddr_x.value = parent.document.QKform.wan_ipaddr_x.value;
215	document.form.wan_netmask_x.value = parent.document.QKform.wan_netmask_x.value;
216	document.form.wan_gateway_x.value = parent.document.QKform.wan_gateway_x.value;
217	
218	document.form.wan_dns1_x.value = parent.document.QKform.wan_dns1_x.value;
219	document.form.wan_dns2_x.value = parent.document.QKform.wan_dns2_x.value;
220	if(parent.document.QKform.vpn_enable.value.length > 0){
221		if(parent.document.QKform.vpn_enable.value == 1){
222			document.form.vpn_enable[0].checked = 1;
223			document.form.vpn_enable[1].checked = 0;
224		}
225		else{
226			document.form.vpn_enable[0].checked = 0;
227			document.form.vpn_enable[1].checked = 1;
228		}
229	}
230	document.form.wan_heartbeat_x.value = parent.document.QKform.wan_heartbeat_x.value;
231	
232}
233
234function get_value_from_parent_m(){
235	document.form.wan_hwaddr_x_m.value = parent.document.QKform.wan_hwaddr_x.value;
236	document.form.wan_ipaddr_x_m.value = parent.document.QKform.wan_ipaddr_x.value;
237	document.form.wan_netmask_x_m.value = parent.document.QKform.wan_netmask_x.value;
238	document.form.wan_gateway_x_m.value = parent.document.QKform.wan_gateway_x.value;
239	document.form.wan_dns1_x_m.value = parent.document.QKform.wan_dns1_x.value;
240	document.form.wan_dns2_x_m.value = parent.document.QKform.wan_dns2_x.value;
241	document.form.wan_heartbeat_x_m.value = parent.document.QKform.wan_heartbeat_x.value;	
242}
243
244function set_value_to_parent(){
245	parent.document.QKform.wan_proto.value = document.form.wan_proto.value;	
246	parent.document.QKform.wan_ipaddr_x.value = document.form.wan_ipaddr_x.value;
247	parent.document.QKform.wan_netmask_x.value = document.form.wan_netmask_x.value;
248	parent.document.QKform.wan_gateway_x.value = document.form.wan_gateway_x.value;
249	parent.document.QKform.wan_dns1_x.value = document.form.wan_dns1_x.value;
250	parent.document.QKform.wan_dns2_x.value = document.form.wan_dns2_x.value;
251	
252	if(document.form.wan_dhcpenable_x[0].checked == 1)
253		parent.document.QKform.wan_dhcpenable_x.value = 0;
254	else
255		parent.document.QKform.wan_dhcpenable_x.value = 1;
256	
257	if(document.form.wan_dnsenable_x[0].checked == 1)
258		parent.document.QKform.wan_dnsenable_x.value = 1;
259	else
260		parent.document.QKform.wan_dnsenable_x.value = 0;
261	
262	if(document.form.vpn_enable[0].checked == 1)
263		parent.document.QKform.vpn_enable.value = 1;
264	else
265		parent.document.QKform.vpn_enable.value = 0;
266}
267
268function set_default_state(){
269	var parent_DHCPenable = parseInt(parent.document.QKform.wan_dhcpenable_x.value);
270	var parent_DNSenable = parseInt(parent.document.QKform.wan_dnsenable_x.value);
271	var wan_proto = document.form.wan_proto.value;
272
273	if(now_flag == "auto_way"){
274		if(from_page == "/qis/QIS_detect.htm"){
275			document.form.wan_dhcpenable_x[0].checked = 0;
276			document.form.wan_dhcpenable_x[1].checked = 1;
277			
278			document.form.wan_dnsenable_x[0].checked = 1;
279			document.form.wan_dnsenable_x[1].checked = 0;
280		}
281		else{
282			if(parent.document.QKform.wan_dhcpenable_x.value == 1){
283				document.form.wan_dhcpenable_x[0].checked = 0;
284				document.form.wan_dhcpenable_x[1].checked = 1;
285			}
286			else{
287				document.form.wan_dhcpenable_x[0].checked = 1;
288				document.form.wan_dhcpenable_x[1].checked = 0;
289			}
290			
291			if(parent.document.QKform.wan_dnsenable_x.value == 1){
292				document.form.wan_dnsenable_x[0].checked = 1;
293				document.form.wan_dnsenable_x[1].checked = 0;
294			}
295			else{
296				document.form.wan_dnsenable_x[0].checked = 0;
297				document.form.wan_dnsenable_x[1].checked = 1;
298			}
299		}
300	}
301	else if(wan_proto == "static" || (now_flag == "auto_way_static" && from_page.indexOf("QIS_detect.htm") >= 0)
302			){
303		document.form.wan_dhcpenable_x[0].checked = 1;
304		document.form.wan_dhcpenable_x[1].checked = 0;
305	}
306	else if(wan_proto == "pppoe"){
307		document.form.wan_dhcpenable_x[0].checked = 0;
308		document.form.wan_dhcpenable_x[1].checked = 1;
309		
310		document.form.wan_dnsenable_x[0].checked = 1;
311		document.form.wan_dnsenable_x[1].checked = 0;
312	}
313	else if(wan_proto == "pptp" ||
314			wan_proto == "l2tp"){
315		if(wan_proto != original_wan_proto){
316			document.form.wan_dhcpenable_x[0].checked = 1; //lock
317			document.form.wan_dhcpenable_x[1].checked = 0;
318		}
319		else{
320			document.form.wan_dhcpenable_x[0].checked = !parent_DHCPenable;
321			document.form.wan_dhcpenable_x[1].checked = parent_DHCPenable;			
322			document.form.wan_dnsenable_x[0].checked = parent_DNSenable;
323			document.form.wan_dnsenable_x[1].checked = !parent_DNSenable;
324		}
325	}
326	else{
327		document.form.wan_dhcpenable_x[0].checked = 0;
328		document.form.wan_dhcpenable_x[1].checked = 1;
329		
330		if(wan_proto != original_wan_proto){
331			document.form.wan_dnsenable_x[0].checked = 1;
332			document.form.wan_dnsenable_x[1].checked = 0;
333			show_dnsenable(document.form.wan_dnsenable_x[0].checked);
334		}
335		else{
336			document.form.wan_dnsenable_x[0].checked = parent_DNSenable;
337			document.form.wan_dnsenable_x[1].checked = !parent_DNSenable;
338			show_dnsenable(document.form.wan_dnsenable_x[0].checked);
339		}
340	}
341	
342	if(wan_proto != "dhcp" && wan_proto != "static"){
343			show_dhcpenable(!document.form.wan_dhcpenable_x[0].checked);
344			show_dnsenable(document.form.wan_dnsenable_x[0].checked);
345	}		
346}
347
348function confirm_vpn_enable(){
349	var str = "";
350	
351	if(now_flag != "auto_way")
352		return false;			
353if(document.form.vpn_enable[0].checked)
354		return true;
355if(document.form.vpn_enable[1].checked)
356		return false;
357	
358	if(DHCPClient == "1")
359		str += "<#QKSet_ISP_desc3#>";
360	else
361		str += "<#QKSet_ISP_desc2#>";
362	str += "\n\n<#QIS_internet_vpn_confirm#>";
363	
364	if(confirm(str))
365		return true;
366	else
367		return false;
368}
369
370function show_dhcpenable(flag){	
371	if(flag == "1" || flag == true){		
372		inputCtrl(document.form.wan_ipaddr_x, 0);
373		inputCtrl(document.form.wan_netmask_x, 0);
374		inputCtrl(document.form.wan_gateway_x, 0);
375		
376		inputCtrl(document.form.wan_dnsenable_x[0], 1);
377		inputCtrl(document.form.wan_dnsenable_x[1], 1);
378		document.form.wan_dhcpenable_x[1].focus();
379	}
380	else{
381		inputCtrl(document.form.wan_ipaddr_x, 1);
382		inputCtrl(document.form.wan_netmask_x, 1);
383		inputCtrl(document.form.wan_gateway_x, 1);
384		
385		document.form.wan_dnsenable_x[0].checked = 0;
386		document.form.wan_dnsenable_x[1].checked = 1;
387		inputCtrl(document.form.wan_dnsenable_x[0], 0);
388		inputCtrl(document.form.wan_dnsenable_x[1], 0);
389		document.form.wan_dhcpenable_x[0].focus();
390		show_dnsenable(0);		
391	}
392	
393	if(now_flag == "auto_way_static"
394			|| now_flag == "auto_way")
395		show_next_button();
396}
397
398function show_dnsenable(flag){
399	if(flag == "1" || flag == true){
400 		document.form.wan_dnsenable_x[0].focus();
401		inputCtrl(document.form.wan_dns1_x, 0);
402		inputCtrl(document.form.wan_dns2_x, 0);
403	}
404	else{
405 		document.form.wan_dnsenable_x[1].focus();		
406		inputCtrl(document.form.wan_dns1_x, 1);
407		inputCtrl(document.form.wan_dns2_x, 1);
408	}
409}
410
411function show_next_button(){
412	if(now_flag.length <= 0){	// manual setting.
413		document.getElementById("nextButton").onclick = submitForm;
414	}
415	else if(document.form.vpn_enable[0].checked){
416		document.getElementById("nextButton").onclick = gotoVPNtype;
417	}
418	else if(document.form.wan_dhcpenable_x[0].checked){
419		document.form.wan_proto.value = "static";
420		document.getElementById("nextButton").onclick = submitForm;
421	}
422	else{
423		document.form.wan_proto.value = "dhcp";
424		document.getElementById("nextButton").onclick = gotoMACclone;
425	}
426}
427
428function show_prev_button(){
429	if(now_flag == "auto_way_static"
430			|| now_flag == "auto_way")
431		document.getElementById("prevButton").style.display = "none";
432	else
433		document.getElementById("prevButton").style.display = "";
434}
435
436function gotoVPNtype(){
437	remove_red_field();
438	
439	if(!validate_ip())
440		return;
441	if(!validate_dns())
442		return;
443	
444	set_value_to_parent();
445	
446	parent.document.QKform.prev_page.value = "/qis/QIS_internet_ip.htm";
447	document.form.action = "/qis/QIS_internet_vpn.htm";
448	document.form.flag.value = "auto_way";
449	
450	document.form.submit();
451}
452
453function gotoMACclone(){
454	remove_red_field();
455	
456	if(!validate_dns())
457		return;
458	
459	set_value_to_parent();
460	
461	parent.document.QKform.prev_page.value = "/qis/QIS_internet_ip.htm";
462	document.form.action = "/qis/QIS_internet_isp.htm";
463	document.form.flag.value = "auto_way";
464	
465	document.form.submit();
466}
467
468// test if WAN IP & Gateway & DNS IP is a valid IP
469// DNS IP allows to input nothing
470function valid_IP(obj_name, obj_flag){
471		// A : 1.0.0.0~126.255.255.255
472		// B : 127.0.0.0~127.255.255.255 (forbidden)
473		// C : 128.0.0.0~255.255.255.254
474		var A_class_start = inet_network("1.0.0.0");
475		var A_class_end = inet_network("126.255.255.255");
476		var B_class_start = inet_network("127.0.0.0");
477		var B_class_end = inet_network("127.255.255.255");
478		var C_class_start = inet_network("128.0.0.0");
479		var C_class_end = inet_network("255.255.255.255");
480		
481		var ip_obj = obj_name;
482		var ip_num = inet_network(ip_obj.value);
483
484		if(obj_flag == "DNS" && ip_num == -1){ //DNS allows to input nothing
485			return true;
486		}
487		
488		if(obj_flag == "GW" && ip_num == -1){ //GW allows to input nothing
489			return true;
490		}
491		
492		if(ip_num > A_class_start && ip_num < A_class_end)
493			return true;
494		else if(ip_num > B_class_start && ip_num < B_class_end){
495			alert(ip_obj.value+" <#JS_validip#>");
496			ip_obj.focus();
497			ip_obj.select();
498			return false;
499		}
500		else if(ip_num > C_class_start && ip_num < C_class_end)
501			return true;
502		else{
503			alert(ip_obj.value+" <#JS_validip#>");
504			ip_obj.focus();
505			ip_obj.select();
506			return false;
507		}
508}
509
510// test if WAN IP & Gateway & DNS IP is a valid IP
511// DNS IP allows to input nothing
512function valid_IP(obj_name, obj_flag){
513		// A : 1.0.0.0~126.255.255.255
514		// B : 127.0.0.0~127.255.255.255 (forbidden)
515		// C : 128.0.0.0~255.255.255.254
516		var A_class_start = inet_network("1.0.0.0");
517		var A_class_end = inet_network("126.255.255.255");
518		var B_class_start = inet_network("127.0.0.0");
519		var B_class_end = inet_network("127.255.255.255");
520		var C_class_start = inet_network("128.0.0.0");
521		var C_class_end = inet_network("255.255.255.255");
522		
523		var ip_obj = obj_name;
524		var ip_num = inet_network(ip_obj.value);
525
526		if(obj_flag == "DNS" && ip_num == -1){ //DNS allows to input nothing
527			return true;
528		}
529		
530		if(obj_flag == "GW" && ip_num == -1){ //GW allows to input nothing
531			return true;
532		}
533		
534		if(ip_num > A_class_start && ip_num < A_class_end)
535			return true;
536		else if(ip_num > B_class_start && ip_num < B_class_end){
537			alert(ip_obj.value+" <#JS_validip#>");
538			ip_obj.focus();
539			ip_obj.select();
540			return false;
541		}
542		else if(ip_num > C_class_start && ip_num < C_class_end)
543			return true;
544		else{
545			alert(ip_obj.value+" <#JS_validip#>");
546			ip_obj.focus();
547			ip_obj.select();
548			return false;
549		}
550}
551
552function validate_ip(){
553	if(document.form.wan_dhcpenable_x != null && document.form.wan_dhcpenable_x[0].checked){
554		if(!valid_IP(document.form.wan_ipaddr_x, "")) return false;  //WAN IP
555		if(!valid_IP(document.form.wan_gateway_x, "GW"))return false;  //Gateway IP
556
557		if(document.form.wan_gateway_x.value == document.form.wan_ipaddr_x.value){
558			alert("<#IPConnection_warning_WANIPEQUALGatewayIP#>");
559			document.form.wan_ipaddr_x.focus();
560			document.form.wan_ipaddr_x.select();			
561			return false;
562		}
563var default_netmask = "";
564		var wrong_netmask = 0;
565		var netmask_obj = document.form.wan_netmask_x;
566		var netmask_num = inet_network(netmask_obj.value);
567		
568		if(netmask_num==0){
569			var netmask_reverse_num = 0;		//Viz 2011.07 : Let netmask 0.0.0.0 pass
570		}else{
571		var netmask_reverse_num = ~netmask_num;
572		}
573		
574		if(netmask_num < 0) wrong_netmask = 1;
575
576		var test_num = netmask_reverse_num;
577		while(test_num != 0){
578			if((test_num+1)%2 == 0)
579				test_num = (test_num+1)/2-1;
580			else{
581				wrong_netmask = 1;
582				break;
583			}
584		}
585		if(wrong_netmask == 1){
586			alert(netmask_obj.value+" <#JS_validip#>");
587			netmask_obj.value = default_netmask;
588			netmask_obj.focus();
589			netmask_obj.select();
590			return false;
591		}// end netmask check			
592	}
593	
594	
595	return true;
596}
597
598function validate_dns(){
599	if(document.form.wan_dnsenable_x != null && !document.form.wan_dnsenable_x[0].checked){
600		if(document.form.wan_dns1_x.value.length <= 0 && document.form.wan_dns2_x.value.length <= 0){
601			document.form.wan_dns1_x.focus();
602			document.form.wan_dns1_x.select();
603			alert("<#JS_fieldblank#>");
604			document.getElementById("wan_dns1_x_div").style.border = "2px solid #CE1E1E";
605			return false;
606		}
607		else{
608			if(document.form.wan_dns1_x.value.length > 0 
609					&& !validator.ipAddrFinalQIS(document.form.wan_dns1_x, "wan_dns1_x")){
610					return false;
611				}
612			else if(document.form.wan_dns2_x.value.length > 0 
613					&& !validator.ipAddrFinalQIS(document.form.wan_dns2_x, "wan_dns2_x")){
614					return false;					
615				}
616			}
617		}
618	
619	return true;
620}
621
622function remove_red_field(){
623	document.getElementById("wan_ipaddr_x_div").style.border = "2px inset #F4F4F4";
624	document.getElementById("wan_netmask_x_div").style.border = "2px inset #F4F4F4";
625	document.getElementById("wan_gateway_x_div").style.border = "2px inset #F4F4F4";
626	document.getElementById("wan_dns1_x_div").style.border = "2px inset #F4F4F4";
627	document.getElementById("wan_dns2_x_div").style.border = "2px inset #F4F4F4";
628}
629
630function showMAC(){
631	var tempMAC = "";	
632	document.form.wan_hwaddr_x.value = login_mac_str();
633	document.form.wan_hwaddr_x.focus();
634}
635
636function simplyMAC(fullMAC){
637	var ptr;
638	var tempMAC;
639	var pos1, pos2;
640	
641	ptr = fullMAC;
642	tempMAC = "";
643	pos1 = pos2 = 0;
644	
645	for(var i = 0; i < 5; ++i){
646		pos2 = pos1+ptr.indexOf(":");
647		
648		tempMAC += fullMAC.substring(pos1, pos2);
649		
650		pos1 = pos2+1;
651		ptr = fullMAC.substring(pos1);
652	}
653	
654	tempMAC += fullMAC.substring(pos1);
655	
656	return tempMAC;
657}
658
659function simple_showLoading(){
660	document.getElementById("loadingIcon").style.display = "";
661}function validForm(){
662	if(!validate_ip()){
663		changeiuiBackground(0);
664		return false;
665	}
666	if(!validate_dns()){
667		changeiuiBackground(0);
668		return false;
669	}
670	if(!check_macaddr(document.form.wan_hwaddr_x,check_hwaddr_flag(document.form.wan_hwaddr_x))){
671		document.form.wan_hwaddr_x.select();
672		document.form.wan_hwaddr_x.focus();
673		changeiuiBackground(0);
674		return false;
675	}	
676	
677	if((now_flag != "auto_way_static" && now_flag != "auto_way")
678			&& (document.form.wan_proto.value == "pptp" || document.form.wan_proto.value == "l2tp")){
679		if(document.form.wan_heartbeat_x.value.length <= 0){
680			alert("<#QIS_internet_vpn_alert#>");
681			document.form.wan_heartbeat_x.focus();
682			document.form.wan_heartbeat_x.select();
683			changeiuiBackground(0);
684			return false;
685		}
686		
687		if(!validator.string(document.form.wan_heartbeat_x)){
688			changeiuiBackground(0);
689			return false;
690		}
691	}
692	
693	return true;	
694}
695		
696function submitForm(){
697	if(parent.ISMOBILE){
698		document.form.wan_ipaddr_x.value = document.form.wan_ipaddr_x_m.value;
699		document.form.wan_netmask_x.value = document.form.wan_netmask_x_m.value;
700		document.form.wan_gateway_x.value = document.form.wan_gateway_x_m.value;
701		document.form.wan_dns1_x.value = document.form.wan_dns1_x_m.value;
702		document.form.wan_dns2_x.value = document.form.wan_dns2_x_m.value;
703		document.form.wan_heartbeat_x.value = document.form.wan_heartbeat_x_m.value;
704		document.form.wan_hwaddr_x.value = document.form.wan_hwaddr_x_m.value;
705
706		if(document.form.wan_proto.value == "static"){
707			document.form.wan_dns1_x.disabled = false;
708			document.form.wan_dns2_x.disabled = false;
709		}
710	}
711
712	remove_red_field();
713	if(validForm() == true){
714			simple_showLoading();
715			document.form.wan_dhcpenable_x[0].disabled = 0;
716			document.form.wan_dhcpenable_x[1].disabled = 0;
717			document.form.wan_ipaddr_x.disabled = 0;
718			document.form.wan_netmask_x.disabled = 0;
719			document.form.wan_gateway_x.disabled = 0;
720			document.form.wan_dhcpenable_x.disabled = 0;
721			document.form.wan_dhcpenable_x.disabled = 0;
722			document.form.wan_dnsenable_x[0].disabled = 0;
723			document.form.wan_dnsenable_x[1].disabled = 0;
724			if((now_flag != "auto_way_static" && now_flag != "auto_way")
725					&& (document.form.wan_proto.value == "pptp" || document.form.wan_proto.value == "l2tp")){
726					document.form.wan_heartbeat_x.disabled = 0;
727			}
728			else
729					document.form.wan_heartbeat_x.disabled = 1;
730
731			// uinfi
732			document.form.switch_wantag.value = parent.document.QKform.switch_wantag.value;
733			document.form.switch_wan0tagid.value = parent.document.QKform.switch_wan0tagid.value;
734			document.form.switch_wan0prio.value = parent.document.QKform.switch_wan0prio.value;
735			document.form.switch_wan1tagid.value = parent.document.QKform.switch_wan1tagid.value;
736			document.form.switch_wan1prio.value = parent.document.QKform.switch_wan1prio.value;
737			document.form.switch_wan2tagid.value = parent.document.QKform.switch_wan2tagid.value;
738			document.form.switch_wan2prio.value = parent.document.QKform.switch_wan2prio.value;
739			document.form.switch_stb_x.value = parent.document.QKform.switch_stb_x.value;
740			document.form.flag.value = "verify_detect";
741  			if(original_switch_wantag != document.form.switch_wantag.value){
742				/*
743				document.form.action_script.value	= "reboot";
744				document.form.flag.value = "verify_detect_reboot";
745				document.form.action_wait.value	= "<% get_default_reboot_time(); %>";
746				document.getElementById("loadHint").style.display = "";
747				document.getElementById("nextButton").style.display = "none";
748				document.getElementById("prevButton").style.display = "none";
749				*/
750
751				var reboot_time = eval("<% get_default_reboot_time(); %> + 10");
752				document.form.action_script.value = "saveNvram";
753				document.form.action_wait.value = "0";
754				parent.sysReboot = true;
755			
756				if(reboot_time > parent.rebootTime)
757					parent.rebootTime = reboot_time;
758			}
759
760			document.getElementById("x_Setting").disabled = false;
761			document.form.x_Setting.value = '<% nvram_get("x_Setting"); %>';
762			document.form.sw_mode.value = 1;
763			document.form.action = "/start_apply.htm";
764			if(parent.flag_manual) document.form.flag.value = "manual";
765
766			document.form.submit();
767			if(original_switch_wantag != document.form.switch_wantag.value)
768				setTimeout(function(){
769					location.href = "/qis/QIS_wireless.htm";
770				}, 500);
771			return true;
772	}
773	else
774			return false;
775}
776
777function check_macaddr(obj,flag){ //control hint of input mac address
778	
779	if(flag == 1){
780		var childsel=document.createElement("div");
781		childsel.setAttribute("id","check_mac");
782		childsel.style.color="#FFCC00";
783		obj.parentNode.appendChild(childsel);
784		document.getElementById("check_mac").innerHTML="<#LANHostConfig_ManualDHCPMacaddr_itemdesc#>";
785		document.getElementById("check_mac").style.display = "";
786		return false;
787	}else if(flag == 2){
788		var childsel=document.createElement("div");
789		childsel.setAttribute("id","check_mac");
790		childsel.style.color="#FFCC00";
791		obj.parentNode.appendChild(childsel);
792		document.getElementById("check_mac").innerHTML="<#IPConnection_x_illegal_mac#>";
793		document.getElementById("check_mac").style.display = "";
794		return false;		
795	}else{
796		document.getElementById("check_mac") ? document.getElementById("check_mac").style.display="none" : true;
797		return true;
798	}	
799}
800
801function clean_input(obj){
802	if(obj.value == "0.0.0.0"){
803			obj.focus();
804			obj.select();
805	}		
806}
807
808function submitenter(myfield,e)
809{	
810	var keycode;
811	if (window.event) keycode = window.event.keyCode;
812	else if (e) keycode = e.which;
813	else return true;
814
815	if (keycode == 13){
816		submitForm();
817   	return false;
818  }
819	else
820   	return true;
821}
822
823// for mobile
824function displayLANIPCtrl(){
825	if(document.getElementById("toggleWANIP").getAttribute("toggled") == "true"){ // DHCP
826		document.getElementById("WANIPDiv").style.display = "none";
827	  document.form.wan_dhcpenable_x[0].checked = 0; // static
828	  document.form.wan_dhcpenable_x[1].checked = 1; // DHCP
829		document.getElementById("dns_info_radio_m").style.display = "";
830		document.getElementById("toggleDNS").setAttribute("toggled", true);
831		document.getElementById("DNSDiv").style.display = "none";
832		document.form.wan_ipaddr_x.disabled = true;
833		document.form.wan_netmask_x.disabled = true;
834		document.form.wan_gateway_x.disabled = true;
835	}
836	else{
837	  document.form.wan_dhcpenable_x[0].checked = 1; // static
838	  document.form.wan_dhcpenable_x[1].checked = 0; // DHCP
839	  document.form.wan_dnsenable_x[0].checked = 0; // Automatic 
840	  document.form.wan_dnsenable_x[1].checked = 1; // static
841		document.getElementById("WANIPDiv").style.display = "";
842		document.getElementById("dns_info_radio_m").style.display = "none";
843		document.getElementById("toggleDNS").setAttribute("toggled", false);
844		document.getElementById("DNSDiv").style.display = "";
845		document.form.wan_ipaddr_x.disabled = false;
846		document.form.wan_netmask_x.disabled = false;
847		document.form.wan_gateway_x.disabled = false;
848	}
849
850	displayDNSCtrl();
851}
852
853function displayDNSCtrl(){
854	if(document.getElementById("toggleDNS").getAttribute("toggled") == "true"){ // Automatic
855		document.getElementById("DNSDiv").style.display = "none";
856	  document.form.wan_dnsenable_x[0].checked = 1;
857	  document.form.wan_dnsenable_x[1].checked = 0;
858		document.form.wan_dns1_x.disabled = true;
859		document.form.wan_dns2_x.disabled = true;
860	}
861	else{
862		document.getElementById("DNSDiv").style.display = "";
863	  document.form.wan_dnsenable_x[0].checked = 0;
864	  document.form.wan_dnsenable_x[1].checked = 1;
865		document.form.wan_dns1_x.disabled = false;
866		document.form.wan_dns2_x.disabled = false;
867	}
868}
869</script>
870</head>
871
872<body onLoad="QKInternet_load_body();" onunload="" onKeyPress="submitenter(this,event)">
873<div id="navtxt" class="navtext" style="position:absolute; top:50px; left:-100px; visibility:hidden; font-family:Arial, Verdana"></div>
874<iframe name="hidden_frame" id="hidden_frame" src="" width="0" height="0" frameborder="0"></iframe>
875<form method="post" name="form" target="hidden_frame" onsubmit="return submitForm();">
876<input type="hidden" name="productid" value="<% nvram_get("productid"); %>">
877<input type="hidden" name="prev_page" value="QIS_internet_type.htm">
878<input type="hidden" name="current_page" value="/qis/QIS_internet_ip.htm">
879<input type="hidden" name="next_page" value="/QIS_wizard.htm">
880<input type="hidden" name="flag" value="">
881<input type="hidden" name="action_mode" value="apply">
882<input type="hidden" name="action_script" value="restart_wan_if">
883<input type="hidden" name="action_wait" value="3">
884<input type="hidden" name="preferred_lang" value="<% nvram_get("preferred_lang"); %>">
885
886<input type="hidden" name="wan_proto" value="">
887<input type="hidden" name="wan_pppoe_username" value="">
888<input type="hidden" name="wan_pppoe_passwd" value="">
889<input type="hidden" name="wan_hostname" value="">
890
891
892<input type="hidden" name="lan_ipaddr" value="">
893<input type="hidden" name="lan_netmask" value="">
894<input type="hidden" name="x_Setting" id="x_Setting" value="" disabled>
895<input type="hidden" name="wan_unit" value="0">
896<input type="hidden" name="sw_mode" value="">
897<!-- unifi -->
898<input type="hidden" name="switch_wantag" value="">
899<input type="hidden" name="switch_wan0tagid" value="">
900<input type="hidden" name="switch_wan0prio" value="">
901<input type="hidden" name="switch_wan1tagid" value="">
902<input type="hidden" name="switch_wan1prio" value="">
903<input type="hidden" name="switch_wan2tagid" value="">
904<input type="hidden" name="switch_wan2prio" value="">
905<input type="hidden" name="switch_stb_x" value="">
906<div class="QISmain" id="QISmain">
907		<div>
908			<table width="730px">
909				<tr>
910					<td align="left">
911						<div class="description_down" id="page_title"></div>
912					</td>
913					<!--td align="right">
914						<img style="cursor:pointer;" onclick="parent.gotoIndex();" align="right" title="Go to Home" src="/images/backtohome.png" onMouseOver="this.src='/images/backtohomeclick.png'" onMouseOut="this.src='/images/backtohome.png'">
915					</td-->
916				</tr>
917			</table>
918		</div>
919		<div style="margin:5px;"><img style="width: 720px; *width: 710px; height: 2px;" src="/images/New_ui/export/line_export.png"></div>
920		
921<div id="showserver" style="width:730px; display:none">
922  <fieldset id="ifVPNfield">
923	<table id="heartbeat_server" class="QISform" width="400" border=0 align="center" cellpadding="5" cellspacing="0" style="display:none;">
924		<tr>
925			<th width="190">
926				<span onmouseout="return nd();" onclick="overlib('<#BOP_isp_heart_desc2#>');" style="cursor:help;"><#BOP_isp_heart_item#><img align="right" style="cursor:pointer;margin-top:-14px\9;" src="/images/New_ui/helpicon.png"></span>
927			</th>
928			<td class="QISformtd">	<!-- ASUS 2009.12 for maxlen -->
929				<input type="text" name="wan_heartbeat_x" value="" tabindex="10" size="36" maxlength="64" title="<#BOP_isp_heart_item#>" class="input_32_table" disabled autocorrect="off" autocapitalize="off">
930			</td>
931		</tr>
932	</table>
933	<table id="vpn_enable_block" class="QISform" width="400" border=0 align="center" cellpadding="5" cellspacing="0" style="display:none;">
934		<tr>
935			<th width="190">
936				<span onmouseout="return nd();" onclick="overlib('<#BOP_isp_heart_desc2#>');" style="cursor:help;"><#QIS_if_vpn_existed#><img align="right" style="cursor:pointer;margin-top:-14px\9;" src="/images/New_ui/helpicon.png"></span>
937			</th>
938			<td class="QISformtd">
939				<!-- wan_heartbeat_x -->
940				<input type="radio" name="vpn_enable" value="1" tabindex="11" onclick="show_next_button();" class="input"><#checkbox_Yes#>
941				<input type="radio" name="vpn_enable" value="0" tabindex="12" onclick="show_next_button();" class="input"><#checkbox_No#>
942			</td>
943		</tr>
944	</table>
945	</fieldset>
946</div>		
947<div id="showip" style="display:none">
948<fieldset>
949<legend>
950	<#Layer3Forwarding_x_UseStaticIP_itemname#>
951	<span id="dhcp_info_radio">
952		<input type="radio" name="wan_dhcpenable_x" class="input" value="0" tabindex="1" onclick="show_dhcpenable(this.value);"><#checkbox_Yes#>
953		<input type="radio" name="wan_dhcpenable_x" class="input" value="1" tabindex="2" onclick="show_dhcpenable(this.value);"><#checkbox_No#>
954	</span>	
955</legend>
956	<table id="tblsetting_2" class="QISform" width="400" border="0" align="center" cellpadding="3" cellspacing="0">
957		<tr>
958			<th  width="190">
959				<span onmouseout="return nd();" onclick="overlib('<#IPConnection_ExternalIPAddress_itemdesc#>');" style="cursor:help;"><#IPConnection_ExternalIPAddress_itemname#><img align="right" style="cursor:pointer;margin-top:-14px\9;" src="/images/New_ui/helpicon.png"></span>
960			</th>
961			<td class="QISformtd">
962	    	<input type="text" name="wan_ipaddr_x" value="<% nvram_get("wan_ipaddr_x"); %>" tabindex="3" onClick="clean_input(this)" onkeypress="return validator.isIPAddr(this, event);" size="36" maxlength="15" class="input_20_table" autocorrect="off" autocapitalize="off"/>
963				<!--input type="hidden" id="wan_ipaddr_x" name="wan_ipaddr_x" value="" maxlength="15" onkeypress="return validator.isIPAddr(this, event);" title="WAN IP"-->
964				<div class="IPaddr_qis" id="wan_ipaddr_x_div" style="display:none;">
965					<input maxlength="3" name="wan_ipaddr_x1"; onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);"
966                    onpaste="return   !clipboardData.getData('text').match(/\D/)" ndragenter="return false" autocomplete="off" />.
967					<input maxlength="3" id="wan_ipaddr2" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);"
968                    onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
969					<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);"
970                    onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
971					<input maxlength="3" name="wan_ipaddr_x4"; onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);"
972                    onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />
973				</div>
974			</td>
975		</tr>
976		
977		<tr>
978			<th width="190">
979				<span onmouseout="return nd();" onclick="overlib('<#IPConnection_x_ExternalSubnetMask_itemdesc#>');" style="cursor:help;"><#IPConnection_x_ExternalSubnetMask_itemname#><img align="right" style="cursor:pointer;margin-top:-14px\9;" src="/images/New_ui/helpicon.png"></span>
980			</th>
981			<td class="QISformtd">
982	    	<input type="text" name="wan_netmask_x" value="<% nvram_get("wan_netmask_x"); %>" tabindex="4" onClick="clean_input(this)" onkeypress="return validator.isIPAddr(this, event);" size="36" maxlength="15" class="input_20_table" autocorrect="off" autocapitalize="off"/>
983				<!--input type="hidden" id="wan_netmask_x" name="wan_netmask_x" value="" maxlength="15"  title="WAN Subnet Mask"-->
984				<div class="IPaddr_qis" id="wan_netmask_x_div" style="display:none;">
985					<input maxlength="3" name="wan_netmask_x1" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
986					onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
987					<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
988					onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
989					<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
990					onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
991					<input maxlength="3" name="wan_netmask_x4" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
992					onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />
993				</div>
994			</td>
995		</tr>
996		
997		<tr>
998			<th>
999				<span onmouseout="return nd();" onclick="overlib('<#IPConnection_x_ExternalGateway_itemdesc#>');" style="cursor:help;"><#IPConnection_x_ExternalGateway_itemname#><img align="right" style="cursor:pointer;margin-top:-14px\9;" src="/images/New_ui/helpicon.png"></span>
1000			</th>
1001			<td class="QISformtd">
1002	    	<input type="text" name="wan_gateway_x" value="<% nvram_get("wan_gateway_x"); %>" tabindex="5" onClick="clean_input(this)" onkeypress="return validator.isIPAddr(this, event);" size="36" maxlength="15" class="input_20_table" autocorrect="off" autocapitalize="off"/>
1003				<!--input type="hidden" id="wan_gateway_x" name="wan_gateway_x" value="" maxlength="15" onkeypress="return validator.isIPAddr(this, event);" class="input"-->
1004				<div class="IPaddr_qis" id="wan_gateway_x_div" style="display:none;">
1005					<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);" 
1006					onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1007					<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1008                    onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1009					<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1010                    onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1011					<input maxlength="3" name="wan_gateway_x4" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1012                    onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />
1013				</div>
1014			</td>
1015		</tr>
1016	</table>
1017</fieldset>
1018</div>
1019
1020	<div id="dns_sec" style="display:none">
1021  <fieldset>
1022  <legend>
1023	  <span id="dns_info_title"><#IPConnection_x_DNSServerEnable_itemname#></span>
1024	  <span id="dns_info_radio">
1025  		<input type="radio" name="wan_dnsenable_x" value="1" onclick="show_dnsenable(this.value);" tabindex="6" class="input"><#checkbox_Yes#>
1026			<input type="radio" name="wan_dnsenable_x" value="0" onclick="show_dnsenable(this.value);" tabindex="7" class="input"><#checkbox_No#>
1027	  </span>
1028  </legend>
1029  <table id="tblsetting_4" class="QISform" width="400" border=0 align="center" cellpadding="5" cellspacing="0">
1030  <tr>
1031	  <th width="190">
1032			<span onmouseout="return nd();" onclick="overlib('<#IPConnection_x_DNSServer1_itemdesc#>');" style="cursor:help;"><#IPConnection_x_DNSServer1_itemname#><img align="right" style="cursor:pointer;margin-top:-14px\9;" src="/images/New_ui/helpicon.png"></span>
1033	  </th>
1034	  <td class="QISformtd">
1035    	<input type="text" name="wan_dns1_x" value="<% nvram_get("wan_dns1_x"); %>" tabindex="8" onkeypress="return validator.isIPAddr(this, event);" size="36" maxlength="15" class="input_20_table" autocorrect="off" autocapitalize="off"/>
1036			<!--input type="hidden" id="wan_dns1_x" name="wan_dns1_x" value="" onkeypress="return validator.isIPAddr(this, event);" maxlength="15"-->
1037			<div class="IPaddr_qis" id="wan_dns1_x_div" style="display:none;">
1038				<input maxlength="3" name="wan_dns1_x1" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1039                onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1040				<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1041                onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1042				<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1043                onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1044				<input maxlength="3" name="wan_dns1_x4" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1045                onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />
1046			</div>
1047	  </td>
1048	</tr>
1049	
1050	<tr>
1051	  <th width="190">
1052			<span onmouseout="return nd();" onclick="overlib('<#IPConnection_x_DNSServer2_itemdesc#>');" style="cursor:help;"><#IPConnection_x_DNSServer2_itemname#><img align="right" style="cursor:pointer;margin-top:-14px\9;" src="/images/New_ui/helpicon.png"></span>
1053	  </th>
1054	  <td class="QISformtd">
1055    	<input type="text" name="wan_dns2_x" value="<% nvram_get("wan_dns2_x"); %>" tabindex="9" onkeypress="return validator.isIPAddr(this, event);" size="36" maxlength="15" class="input_20_table" autocorrect="off" autocapitalize="off"/>
1056			<!--input type="hidden" id="wan_dns2_x" name="wan_dns2_x" value="" maxlength="15" onkeypress="return validator.isIPAddr(this, event);" -->
1057			<div class="IPaddr_qis" id="wan_dns2_x_div" style="display:none;">
1058				<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1059                onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1060				<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1061                onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1062				<input maxlength="3" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1063                onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />.
1064				<input maxlength="3" name="wan_dns2_x4" onkeypress="return validator.checkIP(this,event);" onkeyup="return validator.checkWord(this,event);" onblur="validator.validateIP(this);"
1065                onpaste="return   !clipboardData.getData('text').match(/\D/)" ondragenter="return false" autocomplete="off" />
1066			</div>
1067	  </td>
1068	</tr>
1069	
1070  </table>
1071  </fieldset>
1072	</div><div id="showhwaddr" style="width:730px; display:none;">
1073	<fieldset id="ifVPNfield">
1074	<table id="heartbeat_server" class="QISform" width="400" border=0 align="center" cellpadding="5" cellspacing="0">
1075		<tr>
1076			<th width="190">
1077			<div onmouseout="return nd();" onclick="overlib('<#PPPConnection_x_MacAddressForISP_itemdesc#>', FIXX, 285, FIXY,50);" style="white-space:normal;cursor:help;"><#BOP_isp_mac_item#><img align="right" style="cursor:pointer;margin-top:-14px \9;" src="/images/New_ui/helpicon.png"></div>
1078			</th>
1079			<td class="QISformtd">
1080				<input type="text" name="wan_hwaddr_x" tabindex="13" onkeypress="return validator.isHWAddr(this,event);" style="height:25px;" class="input_20_table" size="36" maxlength="17" value="" autocorrect="off" autocapitalize="off">
1081				<input type="button" class="button_gen_long" tabindex="14" onclick="showMAC();" value="<#BOP_isp_MACclone#>">
1082			</td>
1083		</tr>
1084	</table>
1085	</fieldset>
1086</div>
1087	<div class="apply_gen" style="margin-top:30px">
1088  	<input type="button" id="prevButton" value="<#CTL_prev#>" tabindex="16" onclick="gotoprev(document.form);" class="button_gen">
1089  	<input type="submit" id="nextButton" value="<#CTL_next#>" tabindex="15" class="button_gen">
1090		<span id="loadHint" style="display:none"><#SAVE_note#></span>
1091		<img id="loadingIcon" style="display:none;" src="/images/InternetScan.gif"></span>
1092	</div>
1093</div>
1094
1095<div style="display:none;" id="QISmain_m">
1096	<div id="showip_m">
1097		<span class="itemTitle"><#Layer3Forwarding_x_UseStaticIP_itemname#></span>
1098		<fieldset>
1099			<div id="dhcp_info_radio_m">
1100				<div class="row">
1101					<label><#Auto#></label>
1102					<div id="toggleWANIP" class="toggle" onclick="displayLANIPCtrl();" toggled="true">
1103						<span class="thumb"></span>
1104						<span class="toggleOn"><#checkbox_Yes#></span>
1105						<span class="toggleOff"><#checkbox_No#></span>
1106					</div>
1107				</div>
1108			</div>
1109
1110			<div id="WANIPDiv">
1111				<div class="row">
1112					<label><#IPConnection_ExternalIPAddress_itemname#></label>
1113					<input type="text" name="wan_ipaddr_x_m" placeholder="" maxlength="15" value="" autocorrect="off" autocapitalize="off"/>
1114				</div>
1115				<div class="row">
1116					<label><#IPConnection_x_ExternalSubnetMask_itemname#></label>
1117					<input type="text" name="wan_netmask_x_m" placeholder="" maxlength="15" value="" autocorrect="off" autocapitalize="off"/>
1118				</div>
1119				<div class="row_end">
1120					<label><#IPConnection_x_ExternalGateway_itemname#></label>
1121					<input type="text" name="wan_gateway_x_m" placeholder="" maxlength="15" value="" autocorrect="off" autocapitalize="off"/>
1122				</div>
1123			</div>
1124		</fieldset>
1125		<br />
1126	</div>
1127
1128	<div id="dns_sec_m" style="display:none">
1129		<span class="itemTitle" id="dns_info_title_m"><#IPConnection_x_DNSServerEnable_itemname#></span>
1130		<fieldset>
1131			<div class="row" id="dns_info_radio_m">
1132				<label><#Auto#></label>
1133				<div id="toggleDNS" class="toggle" onclick="displayDNSCtrl();" toggled="true">
1134					<span class="thumb"></span>
1135					<span class="toggleOn"><#checkbox_Yes#></span>
1136					<span class="toggleOff"><#checkbox_No#></span>
1137				</div>
1138			</div>
1139
1140			<div id="DNSDiv">
1141				<div class="row">
1142					<label><#IPConnection_x_DNSServer1_itemname#></label>
1143					<input type="text" name="wan_dns1_x_m" placeholder="" maxlength="15" value="" autocorrect="off" autocapitalize="off"/>
1144				</div>
1145				<div class="row_end">
1146					<label><#IPConnection_x_DNSServer2_itemname#></label>
1147					<input type="text" name="wan_dns2_x_m" placeholder="" maxlength="15" value="" autocorrect="off" autocapitalize="off"/>
1148				</div>
1149			</div>
1150		</fieldset>
1151		<br />
1152	</div>
1153
1154	<div id="showserver_m" style="display:none">
1155		<fieldset>
1156			<div class="row_end">
1157				<label><#BOP_isp_heart_item#></label>
1158				<input type="text" name="wan_heartbeat_x_m" onkeypress="" placeholder="" maxlength="64" value="" autocorrect="off" autocapitalize="off"/>
1159			</div>
1160		</fieldset>
1161		<br />
1162	</div>
1163
1164	<div id="showhwaddr_m" style="display:none">
1165		<fieldset>
1166			<div class="row_end">
1167				<label><#BOP_isp_mac_item#></label>
1168				<input type="text" name="wan_hwaddr_x_m" onkeypress="return validator.isHWAddr(this,event);" placeholder="" maxlength="17" value="" autocorrect="off" autocapitalize="off"/>
1169			</div>
1170		</fieldset>
1171		<br />
1172	</div>
1173
1174	<fieldset class="theFieldset" id="theFieldset">
1175		<div class="row_end">
1176			<a id="loadingIcon_iui" class="iuiA" onclick="changeiuiBackground(1);submitForm();"><#CTL_next#></a>
1177		</div>
1178	</fieldset>
1179</div>
1180
1181</form>
1182</body>
1183