1var Untranslated = {
2	fw_size_higher_mem : 'Memory space is NOT enough to upgrade on internet. Please wait for rebooting.',
3	the_array_is_end : "end here.",
4	link_rate : "Link rate",
5	ASUSGATE_note9 : "Your DSL line appears to be unstable. DLA (Dynamic Line Adjustment) which enabled by default already adopted necessary changes and ensure stability. However if interruption continues please submit a feedback form for our analysis.",
6	ASUSGATE_note6 : "Your DSL line appears to be unstable. We strongly recommend that you submit a feedback form for our analysis.",
7	ASUSGATE_note7 : "If you are experiencing any DSL related issues or have any comments / suggestions, please feel free to inform our support team.",
8	JS_validclientname : "Client device name only accept alphanumeric characters, under line and dash symbol. The first character cannot be dash \"-\" or under line \"_\".",
9	ASUSGATE_act_feedback : "Feedback now",
10	ASUSGATE_DSL_setting : "Go setting DSL",
11	period_time_validation : 'The value of check period can\'t be less than',
12	filter_lw_date_valid : 'Please select at least one day or disable this feature.',
13	ctf_fa_hint : 'System will reboot automatically after enable AiProtection for function working fine. Please click apply to enable this function or click cancel to back to page.'
14};
15var clicked_help_string = "<#Help_init_word1#> <a class=\"hintstyle\" style=\"background-color:#7aa3bd\"><#Help_init_word2#></a> <#Help_init_word3#>";
16
17var rc_support = '<% nvram_get("rc_support"); %>';
18function isSupport(_ptn){
19	return (rc_support.search(_ptn) == -1) ? false : true;
20}
21if(isSupport("tmo"))
22        var theUrl = "cellspot.router";
23else
24        var theUrl = "router.asus.com";
25
26var gobi_support = isSupport("gobi");
27
28/* convert some special character for shown string */
29function handle_show_str(show_str)
30{
31	show_str = show_str.replace(/\&/g, "&amp;");
32	show_str = show_str.replace(/\</g, "&lt;");
33	show_str = show_str.replace(/\>/g, "&gt;");
34	show_str = show_str.replace(/\ /g, "&nbsp;");
35	return show_str;
36}
37
38
39function show_str_ssid(show_ssid)
40{
41	show_ssid = show_ssid.replace(/\%/g, "%25");
42	return show_ssid;
43}
44
45
46function isMobile_help(){
47	return false; //disable mobile QIS temporary, Jieming added at 2013.08.12
48
49	if(screen.width < 640 || screen.height < 640){
50		return true;
51	}
52	else{
53		var mobiles = new Array(
54									"midp", "j2me", "avant", "docomo", "novarra", "palmos", "palmsource",
55									"240x320", "opwv", "chtml", "pda", "windows ce", "mmp/",
56									"blackberry", "mib/", "symbian", "wireless", "nokia", "hand", "mobi",
57									"phone", "cdm", "up.b", "audio", "sie-", "sec-", "samsung", "htc",
58									"mot-", "mitsu", "sagem", "sony", "alcatel", "lg", "eric", "vx",
59									"NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch",
60									"rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi",
61									"bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo",
62									"sgh", "gradi", "jb", "dddi", "moto", "iphone", "android",
63									"iPod", "incognito", "webmate", "dream", "cupcake", "webos",
64									"s8000", "bada", "googlebot-mobile");
65
66	 	var ua = navigator.userAgent.toLowerCase();
67		var _isMobile = false;
68
69		for(var i = 0; i < mobiles.length; i++){
70			if(ua.indexOf(mobiles[i]) > 0){
71				_isMobile = true;
72				break;
73			}
74		}
75		return _isMobile;
76	}
77}
78
79var helptitle = new Array();
80var helpcontent = new Array();
81
82(function(){
83	if(!isMobile_help()){
84		setTimeout(function(){
85			var newScript = document.createElement("script");
86			newScript.type = "text/javascript";
87			newScript.src = '/help_content.js';
88			document.getElementsByTagName("head")[0].appendChild(newScript);
89		}, 2000);
90	}
91})();
92
93function suspendconn(wan_index, wanenable){
94	if(gobi_support && (wan_index == usb_index)){
95		document.internetForm_title.wan_enable.value = wanenable;
96		document.internetForm_title.wan_unit.value = wan_index;
97	}
98	else if(wan_index == dsl_index) {
99		document.internetForm_title.dslx_link_enable.value = wanenable;
100		if(wanenable)
101			document.internetForm_title.action_script.value = "start_dslwan_if 0";
102		else
103			document.internetForm_title.action_script.value = "stop_dslwan_if 0";
104	}
105	else{
106		document.internetForm_title.wan_enable.value = wanenable;
107	}
108
109	showLoading();
110	document.internetForm_title.submit();
111}
112
113function enableMonomode(){
114	document.titleForm.action = "/apply.cgi";
115	document.titleForm.current_page.value = top.location.pathname.split("/")[1];
116	document.titleForm.action_mode.value = "mfp_monopolize";
117	document.titleForm.action_wait.value = "2";
118	showLoading(2);
119	document.titleForm.submit();
120}
121
122function remove_disk(disk_num){
123	var str = "<#Safelyremovedisk_confirm#>";
124	if(confirm(str)){
125		showLoading();
126		document.diskForm_title.disk.value = disk_num;
127		setTimeout("document.diskForm_title.submit();", 1);
128	}
129}
130
131function gotoguestnetwork(){
132	top.location.href = "/Guest_network.asp";
133}
134
135function gotocooler(){
136	top.location.href = "/Advanced_PerformanceTuning_Content.asp";
137}
138
139function priority_change(){
140	top.location.href = "/QoS_EZQoS.asp";
141}
142
143function qos_disable(){
144	document.qosDisableForm.submit();
145}
146
147// Viz add 2013.04 for dsl sync status
148function gotoDSL_log(){
149	top.location.href = "/Main_AdslStatus_Content.asp";
150}
151
152function gotoModem(){
153	document.titleForm.wan_unit.value = usb_index;
154	if( usb_index == -1){
155		top.location.href = "/Advanced_WANPort_Content.asp";
156	}
157	else{
158		if(gobi_support)
159			document.titleForm.current_page.value = "Advanced_MobileBroadband_Content.asp?af=pincode";
160		else
161			document.titleForm.current_page.value = "Advanced_Modem_Content.asp";
162		document.titleForm.action_mode.value = "change_wan_unit";
163		document.titleForm.action = "apply.cgi";
164		document.titleForm.target = "";
165		document.titleForm.submit();
166	}
167}
168
169function setTrafficLimit(){
170	document.titleForm.wan_unit.value = usb_index;
171	document.titleForm.current_page.value = "Advanced_MobileBroadband_Content.asp?af=data_limit;show=0";
172	document.titleForm.action_mode.value = "change_wan_unit";
173	document.titleForm.action = "apply.cgi";
174	document.titleForm.target = "hidden_frame";
175	document.titleForm.submit();
176}
177
178function upated_sim_record(){ //delete the oldest record and save the current data usage settings
179	document.titleForm.current_page.value = "Advanced_MobileBroadband_Content.asp";
180	document.titleForm.action_mode.value = "restart_sim_del";
181	document.titleForm.sim_order.value = "1";
182	document.titleForm.action = "apply.cgi";
183	document.titleForm.target = "";
184	document.titleForm.submit();
185}
186
187
188var debug_end_time = parseInt("<% nvram_get("dslx_diag_end_uptime"); %>");
189var wans_mode = '<%nvram_get("wans_mode");%>';
190var wans_lanport = '<% nvram_get("wans_lanport"); %>';
191
192function overHint(itemNum){
193	var statusmenu = "";
194	var title2 = 0;
195	var title5 = 0;
196	var title5_2 = 0;
197
198	if(itemNum == 50){
199		statusmenu ="<span>Enable PPTP or L2TP client (optional)</span>";
200	}
201
202	if(itemNum == 85){
203		statusmenu ="<span>Manually prioritize apps category depending on your preference.</span>";		/* untranslated */
204	}
205	else if(itemNum == 86){
206		statusmenu ="<span>This mode is suitable for playing internet game and boost your gaming bandwidth.<br><#Adaptive_Category1#></span>";		/* untranslated */
207	}
208	else if(itemNum == 87){
209		statusmenu ="<span>This mode is suitable for playing video streaming and make sure your viewing experience.<br><#Adaptive_Category2#></span>";	/* untranslated */
210	}
211	else if(itemNum == 88){
212		statusmenu ="<span>This mode is suitable for general web browsing and avoid to networking latency whilefifile transferring.<br><#Adaptive_Category4#></span>";	/* untranslated */
213	}
214	else if(itemNum == 89){
215		statusmenu ="<span>Enable this function allow block advertisement in the streaming video.</span>";
216	}
217	else if(itemNum == 90){
218		statusmenu ="<span>Enable this function allow you to block websites used to display banner or popup advertisement.</span>";
219	}
220	else if(itemNum == 91){
221		statusmenu ="<span><#Adaptive_Category1#></span>";
222	}
223	else if(itemNum == 92){
224		statusmenu ="<span><#Adaptive_Category2#></span>";
225	}
226	else if(itemNum == 93){
227		statusmenu ="<span><#Adaptive_Category3#></span>";
228	}
229	else if(itemNum == 94){
230		statusmenu ="<span><#Adaptive_Category4#></span>";
231	}
232	else if(itemNum == 95){
233		statusmenu ="<span><#Adaptive_Category5#></span>";
234	}
235	else if(itemNum == 96){
236		statusmenu ="<span><#Adaptive_Category6#></span>";
237	}
238
239	if(itemNum == 98){
240		var signal = parseInt(sim_signal);
241		if(isNaN(signal) || signal <= 0){
242			statusmenu += "<div class='StatusHint'><#Mobile_no_signal#></div>";
243		}
244		else if(usb_state == 2 && usb_sbstate == 0 && usb_auxstate == 0){
245			statusmenu += "<div class='StatusHint'><#Connected#> <#HSDPAConfig_ISP_itemname#>: </div><span>" + sim_spn + "</span>";
246		}
247		else{
248			statusmenu += "<div class='StatusHint'><#Disconnected#></div>";
249		}
250	}
251
252	if(itemNum == 99){
253		if(sim_state == "1")
254			statusmenu += "<div class='StatusHint'><#Mobile_sim_ready#></div>";
255		else if(sim_state == "2"){
256			if( g3err_pin == "1" && pin_remaining_count < 3)
257				statusmenu += "<div class='StatusHint'>Wrong PIN code. Please input the correct PIN code.</div>";
258			else
259				statusmenu += "<div class='StatusHint'><#Mobile_need_pin#></div>";
260		}
261		else if(sim_state == "3")
262			statusmenu += "<div class='StatusHint'><#Mobile_need_puk#></div>";
263		else if(sim_state == "4")
264			statusmenu += "<div class='StatusHint'><#Mobile_need_pin2#></div>";
265		else if(sim_state == "5")
266			statusmenu += "<div class='StatusHint'><#Mobile_need_puk2#></div>";
267		else if(sim_state == "6")
268			statusmenu += "<div class='StatusHint'><#Mobile_wait_sim#></div>";
269		else if(sim_state == "-1")
270			statusmenu += "<div class='StatusHint'><#Mobile_sim_miss#></div>";
271		else if(sim_state == "-10" || sim_state == "-2")
272			statusmenu += "<div><#Mobile_sim_fail#></div>";
273		else
274			statusmenu += "<div><#Mobile_fail_connect#></div>";
275	}
276
277	if(itemNum == 24)
278		statusmenu += "<span>The USB 3.0 cable without well-shielded would affect the 2.4Ghz wireless range.Enabling this feature to ensure the best wireless performance If your USB 3.0 device is not USB-IF certified.</span>";
279
280	//for AiProtection-Router Security Assessment
281	if(itemNum == 25)
282		statusmenu += "<span>Disable Wi-Fi Protected Setup to avoid attacker to obtain the keys via an intelligent brute force </span>";
283	else if(itemNum == 23)
284		statusmenu += "<span><#AiProtection_scan_note23#></span>";
285	else if(itemNum == 22)
286		statusmenu += "<span><#AiProtection_scan_note22#></span>";
287	else if(itemNum == 21)
288		statusmenu += "<span><#AiProtection_scan_note21#></span>";
289	else if(itemNum == 20)
290		statusmenu += "<span><#AiProtection_scan_note20#></span>";
291	else if(itemNum == 19)
292		statusmenu += "<span><#AiProtection_scan_note19#></span>";
293	else if(itemNum == 18)
294		statusmenu += "<span><#AiProtection_scan_note18#></span>";
295	else if(itemNum == 17)
296		statusmenu += "<span><#AiProtection_scan_note17#></span>";
297	else if(itemNum == 16)
298		statusmenu += "<span><#AiProtection_scan_note16#></span>";
299	else if(itemNum == 15)
300		statusmenu += "<span><#AiProtection_scan_note15#></span>";
301	else if(itemNum == 14)
302		statusmenu += "<span><#AiProtection_scan_note14#></span>";
303	else if(itemNum == 13)
304		statusmenu += "<span><#AiProtection_scan_note13#></span>";
305	else if(itemNum == 12)
306		statusmenu += "<span><#AiProtection_scan_note12#></span>";
307	else if(itemNum == 11)
308		statusmenu += "<span><#AiProtection_scan_note11#></span>";
309	else if(itemNum == 10)
310		statusmenu += "<span><#AiProtection_scan_note10#></span>";
311
312	// Viz add 2015.07 bwdpi : Adpative QoS mode start
313	if(itemNum == "A"){
314		statusmenu = "<div class='StatusHint'><#Adaptive_QoS#> :</div>";
315		if(bwdpi_app_rulelist == "9,20<8<4<0,5,6,15,17<13,24<1,3,14<7,10,11,21,23<<game"){
316			modeDesc = "Game mode";		/* untranslated */
317		}
318		else if(bwdpi_app_rulelist == "9,20<4<0,5,6,15,17<8<13,24<1,3,14<7,10,11,21,23<<media"){
319			modeDesc = "Media Streaming mode";		/* untranslated */
320		}
321		else if(bwdpi_app_rulelist == "9,20<13,24<4<0,5,6,15,17<8<1,3,14<7,10,11,21,23<<web"){
322			modeDesc = "Web Surfing mode";		/* untranslated */
323		}
324		else{
325			modeDesc = "Customize mode";		/* untranslated */
326		}
327
328		statusmenu += "<span>" + modeDesc + "</span>";
329	}
330	// Viz add 2015.07 bwdpi : Adpative QoS mode end
331
332	// Viz add 2013.04 for dsl sync status
333	if(itemNum == 9){
334		statusmenu = "<div class='StatusHint'>DSL :</div>";
335		if(wan_diag_state == "1" && allUsbStatus.search("storage") >= 0){
336			lineDesc = "Diagnostic debug log capture in progress.<br>";
337			lineDesc += show_diagTime(boottime_update);
338		}
339		else if(wan_line_state == "up")
340			lineDesc = "Link up";
341		else if(wan_line_state == "wait for init")
342			lineDesc = "Wait for init";
343		else if(wan_line_state == "init" || wan_line_state == "initializing")
344			lineDesc = "Initializing";
345		else
346			lineDesc = "Link down";
347
348		statusmenu += "<span>" + lineDesc + "</span>";
349	}
350	// wifi hw switch
351	if(itemNum == 8){
352		statusmenu = "<div class='StatusHint'>Wi-Fi:</div>";
353
354		if(band5g_support){
355				if(wlan0_radio_flag == "0" && wlan1_radio_flag == "0")
356						wifiDesc = "<b>2.4GHz -</b><br><#btn_Disabled#><br><br><b>5 GHz -</b><br><#btn_Disabled#>";
357				else if(wlan0_radio_flag == "1" && wlan1_radio_flag == "0")
358						wifiDesc = "<b>2.4GHz -</b><br><#btn_Enabled#><br><br><b>5 GHz -</b><br><#btn_Disabled#>";
359				else if(wlan0_radio_flag == "0" && wlan1_radio_flag == "1")
360						wifiDesc = "<b>2.4GHz -</b><br><#btn_Disabled#><br><br><b>5 GHz -</b><br><#btn_Enabled#>";
361				else
362						wifiDesc = "<b>2.4GHz -</b><br><#btn_Enabled#><br><br><b>5 GHz -</b><br><#btn_Enabled#>";
363
364				statusmenu += "<span>" + wifiDesc + "</span>";
365		}
366		else{
367				if(wlan0_radio_flag == "0")
368						wifiDesc = "<#btn_Disabled#>";
369				else
370						wifiDesc = "<#btn_Enabled#>";
371
372				statusmenu += "<span>" + wifiDesc + "</span>";
373		}
374	}
375
376	// cooler
377	if(itemNum == 7){
378		statusmenu = "<div class='StatusHint'>Cooler:</div>";
379		if(cooler == "cooler=0")
380			coolerDesc = "cooler=Disabled"
381		else if(cooler == "cooler=1")
382			coolerDesc = "cooler=Manually"
383		else
384			coolerDesc = "cooler=Automatic"
385
386		statusmenu += "<span>" + coolerDesc.substring(7, coolerDesc.length) + "</span>";
387	}
388
389	// printer
390	if(itemNum == 6){
391	 	require(['/require/modules/diskList.js'], function(diskList){
392	 		var usbDevicesList = diskList.list();
393			for(var i=0; i<usbDevicesList.length; i++){
394				if(usbDevicesList[i].deviceType != "printer") continue;
395
396				statusmenu += "<div class='StatusHint' style='margin-top:8px'>" + usbDevicesList[i].deviceName + ":</div>";
397				if(usbDevicesList[i].serialNum == '<% nvram_get("u2ec_serial"); %>'){
398					statusmenu += "<div><#CTL_Enabled#></div>";
399
400					if(monoClient != "monoClient=")
401						statusmenu += "<div><#Printing_button_item#>" + monoClient.substring(11, monoClient.length) + "</div>";
402				}
403				else
404					statusmenu += "<div><#CTL_Disabled#></div>";
405			}
406
407			if(statusmenu != "")
408				return overlib(statusmenu, OFFSETX, -160, LEFT, DELAY, 400);
409		});
410	}
411
412	if(itemNum == 5){
413		statusmenu = "<span class='StatusHint'><#no_printer_detect#></span>";
414	}
415
416	// guest network
417	if(itemNum == 4){
418		for(var i=0; i<gn_array_2g.length; i++){
419			if(gn_array_2g[i][0] == 1){
420				if(title2 == 0){
421					statusmenu += "<div class='StatusHint'>2.4GHz Network:</div>";
422					title2 = 1;
423				}
424
425				var show_str = gn_array_2g[i][1];
426				show_str = decodeURIComponent(show_str);
427				show_str = handle_show_str(show_str);
428				statusmenu += "<span><b>" + show_str + "</b><br> (";
429
430				if(gn_array_2g[i][11] == 0)
431					statusmenu += "<#Limitless#>)</span><br>";
432				else{
433					var expire_day = Math.floor(gn_array_2g[i][13]/86400);
434					var expire_hr = Math.floor((gn_array_2g[i][13]%86400)/3600);
435					var expire_min = Math.floor((gn_array_2g[i][13]%3600)/60);
436
437					statusmenu += '<#mssid_time_remaining#>: ';
438					if(expire_day > 0)
439						statusmenu += '<b id="expire_day_'+i+'">'+ expire_day + '</b> <#Day#> <b id="expire_hr_'+i+'">'+ expire_hr + '</b> <#Hour#> <b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
440					else if(expire_hr > 0)
441						statusmenu += '<b id="expire_hr_'+i+'">'+ expire_hr + '</b> <#Hour#> <b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
442					else{
443						if(expire_min > 0)
444								statusmenu += '<b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
445						else
446								statusmenu += '<b id="expire_min_'+i+'">< 1</b> <#Minute#>';
447					}
448					statusmenu += ")</span><br>";
449				}
450			}
451		}
452		if(band5g_support){
453			for(var i=0; i<gn_array_5g.length; i++){
454				if(gn_array_5g[i][0] == 1){
455					if(title5 == 0){
456						if(wl_info.band5g_2_support)
457							statusmenu += "<div class='StatusHint' style='margin-top:15px;'>5GHz-1 Network:</div>";
458						else
459							statusmenu += "<div class='StatusHint' style='margin-top:15px;'>5GHz Network:</div>";
460						title5 = 1;
461					}
462
463					var show_str = gn_array_5g[i][1];
464					show_str = decodeURIComponent(show_str);
465					show_str = handle_show_str(show_str);
466					statusmenu += "<span><b>" + show_str + "</b><br> (";
467
468					if(gn_array_5g[i][11] == 0)
469						statusmenu += '<#Limitless#>)</span><br>';
470					else{
471						var expire_day = Math.floor(gn_array_5g[i][13]/86400);
472						var expire_hr = Math.floor((gn_array_5g[i][13]%86400)/3600);
473						var expire_min = Math.floor((gn_array_5g[i][13]%3600)/60);
474
475						statusmenu += '<#mssid_time_remaining#>: ';
476						if(expire_day > 0)
477							statusmenu += '<b id="expire_day_'+i+'">'+ expire_day + '</b> <#Day#> <b id="expire_hr_'+i+'">'+ expire_hr + '</b> <#Hour#> <b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
478						else if(expire_hr > 0)
479							statusmenu += '<b id="expire_hr_'+i+'">'+ expire_hr + '</b> <#Hour#> <b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
480						else{
481							if(expire_min > 0)
482								statusmenu += '<b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
483							else
484								statusmenu += '<b id="expire_min_'+i+'">< 1</b> <#Minute#>';
485						}
486						statusmenu += ")</span><br>";
487					}
488				}
489			}
490		}
491		if(wl_info.band5g_2_support){
492			for(var i=0; i<gn_array_5g_2.length; i++){
493				if(gn_array_5g_2[i][0] == 1){
494					if(title5_2 == 0){
495						statusmenu += "<div class='StatusHint' style='margin-top:15px;'>5GHz-2 Network:</div>";
496						title5_2 = 1;
497					}
498
499					var show_str = gn_array_5g_2[i][1];
500					show_str = decodeURIComponent(show_str);
501					show_str = handle_show_str(show_str);
502					statusmenu += "<span><b>" + show_str + "</b><br> (";
503
504					if(gn_array_5g_2[i][11] == 0)
505						statusmenu += '<#Limitless#>)</span><br>';
506					else{
507						var expire_day = Math.floor(gn_array_5g_2[i][13]/86400);
508						var expire_hr = Math.floor((gn_array_5g_2[i][13]%86400)/3600);
509						var expire_min = Math.floor((gn_array_5g_2[i][13]%3600)/60);
510
511						statusmenu += '<#mssid_time_remaining#>: ';
512						if(expire_day > 0)
513							statusmenu += '<b id="expire_day_'+i+'">'+ expire_day + '</b> <#Day#> <b id="expire_hr_'+i+'">'+ expire_hr + '</b> <#Hour#> <b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
514						else if(expire_hr > 0)
515							statusmenu += '<b id="expire_hr_'+i+'">'+ expire_hr + '</b> <#Hour#> <b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
516						else{
517							if(expire_min > 0)
518								statusmenu += '<b id="expire_min_'+i+'">' + expire_min +'</b> <#Minute#>';
519							else
520								statusmenu += '<b id="expire_min_'+i+'">< 1</b> <#Minute#>';
521						}
522						statusmenu += ")</span><br>";
523					}
524				}
525			}
526		}
527		if(title2 == 0 && title5 == 0 && title5_2 == 0)
528			statusmenu += "<div class='StatusHint'><#Guest_Network#>:</div><span><#CTL_Disabled#></span>";
529	}
530
531	// internet
532	if(itemNum == 3){
533		var eLAN_str = "<#Ethernet_wan#>".replace(/WAN/, "LAN");
534		if(gobi_support){
535			if(dualWAN_support && wans_dualwan_array.indexOf("none") == -1){
536				if( wans_dualwan_array[0] == "wan")
537					statusmenu += "<div class='StatusHint'><#Ethernet_wan#>:</div>";
538				else if( wans_dualwan_array[0] == "lan")
539					//statusmenu += "<div class='StatusHint'><#Ethernet_wan#> (<#Port_Mapping_item1#> "+wans_lanport+"):</div>";
540					statusmenu += "<div class='StatusHint'>"+eLAN_str+" (<#Port_Mapping_item1#> "+wans_lanport+"):</div>";
541				else if( wans_dualwan_array[0] == "usb")
542					statusmenu += "<div class='StatusHint'><#Mobile_title#>:</div>";
543			}
544			else
545				statusmenu = "<div class='StatusHint'><#statusTitle_Internet#>:</div>";
546		}
547		else{
548			if(dualWAN_support && wans_dualwan_array.indexOf("none") == -1)
549				statusmenu = "<div class='StatusHint'><#dualwan_primary#>:</div>";
550			else
551				statusmenu = "<div class='StatusHint'><#statusTitle_Internet#>:</div>";
552
553			if( wans_dualwan_array[0] == "wan")
554				statusmenu += "<b><#Ethernet_wan#> -</b><br>";
555			else if( wans_dualwan_array[0] == "lan")
556				statusmenu += "<b><#Port_Mapping_item1#> "+wans_lanport+" -</b><br>";
557			else if( wans_dualwan_array[0] == "usb")
558					statusmenu += "<b><#menu5_4_4#> -</b><br>";
559		}
560
561		if(dualWAN_support && wans_dualwan_array.indexOf("none") == -1 ){
562			if(first_link_status == "1")
563				statusmenu += "<span><#web_redirect_reason2_2#></span>";
564			else if((first_link_status == "2" && first_link_auxstatus == "0") || (first_link_status == "2" && first_link_auxstatus == "2")){
565				if((wans_mode == "fo" || wans_mode == "fb") && active_wan_unit == "1")
566					statusmenu += "<span><#Status_Standby#></span>";
567				else
568					statusmenu += "<span><#Connected#></span>";
569			}
570			else{
571				if(sw_mode == 1){
572					if( wans_dualwan_array[0] == "usb"){
573						if(wan0_enable == "0"){
574							if(gobi_support)
575								statusmenu += "<div><#Mobile_disabled#></div>";
576							else
577								statusmenu += "<div><#USB_disabled#></div>";
578						}
579						else{
580							if(sim_state != ""){
581								if(sim_state == "2"){
582									if( g3err_pin == "1" && pin_remaining_count < 3)
583										statusmenu += "<div>Wrong PIN code. Please input the correct PIN code.</div>";
584									else
585										statusmenu += "<div><#Mobile_need_pin#></div>";
586								}
587								else if(sim_state == "3")
588									statusmenu += "<div><#Mobile_need_puk#></div>";
589								else if(sim_state == "4")
590									statusmenu += "<div><#Mobile_need_pin2#></div>";
591								else if(sim_state == "5")
592									statusmenu += "<div><#Mobile_need_puk2#></div>";
593								else if(sim_state == "6")
594									statusmenu += "<div><#Mobile_wait_sim#></div>";
595								else if(sim_state == "-1")
596									statusmenu += "<div><#Mobile_sim_miss#></div>";
597								else if(sim_state == "-10" || sim_state == "-2")
598									statusmenu += "<div><#Mobile_sim_fail#></div>";
599								else
600									statusmenu += "<div><#Mobile_fail_connect#></div>";
601							}
602							else
603								statusmenu += "<span><#Disconnected#></span>";
604						}
605					}
606					else{
607						if(wan0_enable == 0){
608							statusmenu += "<span><#WAN_disabled#></span>";
609						}
610						else{
611							if(first_link_auxstatus == "1"){
612								if( wans_dualwan_array[0] == "lan"){
613									statusmenu += "<span><#Check_cable#> : <#Port_Mapping_item1#> "+wans_lanport+"</span>";
614								}
615								else
616									statusmenu += "<span><#QKSet_detect_wanconnfault#></span>";
617							}
618							else if(first_link_sbstatus == "1")
619								statusmenu += "<span><#web_redirect_reason3_2#></span>";
620							else if(first_link_sbstatus == "2")
621								statusmenu += "<span><#QKSet_Internet_Setup_fail_reason2#></span>";
622							else if(first_link_sbstatus == "3")
623								statusmenu += "<span><#QKSet_Internet_Setup_fail_reason1#></span>";
624							else if(first_link_sbstatus == "4")
625								statusmenu += "<span><#web_redirect_reason5_2#></span>";
626							else if(first_link_sbstatus == "5")
627								statusmenu += "<span><#web_redirect_reason5_1#></span>";
628							else if(first_link_sbstatus == "6")
629								statusmenu += "<span>System error. <#Reboot_manually#></span>";
630							else
631								statusmenu += "<span><#Disconnected#></span>";
632						}
633					}
634				}
635			}
636		}
637		else{
638			if(link_status == "1")
639				statusmenu += "<span><#web_redirect_reason2_2#></span>";
640			else if((link_status == "2" && link_auxstatus == "0") || (link_status == "2" && link_auxstatus == "2")){
641				statusmenu += "<span><#Connected#></span>";
642			}
643			else{
644				if(sw_mode == 1){
645					if( wans_dualwan_array[0] == "usb"){
646						if(wan0_enable == "0"){
647							if(gobi_support)
648								statusmenu += "<div><#Mobile_disabled#></div>";
649							else
650								statusmenu += "<div><#USB_disabled#></div>";
651						}
652						else{
653							if(sim_state != ""){
654								if(sim_state == "2"){
655									if( g3err_pin == "1" && pin_remaining_count < 3)
656										statusmenu += "<div><#Mobile_wrong_pin#></div>";
657									else
658										statusmenu += "<div><#Mobile_need_pin#></div>";
659								}
660								else if(sim_state == "3")
661									statusmenu += "<div><#Mobile_need_puk#></div>";
662								else if(sim_state == "4")
663									statusmenu += "<div><#Mobile_need_pin2#></div>";
664								else if(sim_state == "5")
665									statusmenu += "<div><#Mobile_need_puk2#></div>";
666								else if(sim_state == "6")
667									statusmenu += "<div><#Mobile_wait_sim#></div>";
668								else if(sim_state == "-1")
669									statusmenu += "<div><#Mobile_sim_miss#></div>";
670								else if(sim_state == "-10" || sim_state == "-2")
671									statusmenu += "<div><#Mobile_sim_fail#></div>";
672								else
673									statusmenu += "<div><#Mobile_fail_connect#></div>";
674							}
675							else
676								statusmenu += "<span><#Disconnected#></span>";
677						}
678					}
679					else{
680						if(wan0_enable == 0){
681							statusmenu += "<span><#WAN_disabled#></span>";
682						}
683						else{
684							if(link_auxstatus == "1"){
685								if( wans_dualwan_array[0] == "lan"){
686									statusmenu += "<span><#Check_cable#> : <#Port_Mapping_item1#> "+wans_lanport+"</span>";
687								}
688								else
689									statusmenu += "<span><#QKSet_detect_wanconnfault#></span>";
690							}
691							else if(link_sbstatus == "1")
692								statusmenu += "<span><#web_redirect_reason3_2#></span>";
693							else if(link_sbstatus == "2")
694								statusmenu += "<span><#QKSet_Internet_Setup_fail_reason2#></span>";
695							else if(link_sbstatus == "3")
696								statusmenu += "<span><#QKSet_Internet_Setup_fail_reason1#></span>";
697							else if(link_sbstatus == "4")
698								statusmenu += "<span><#web_redirect_reason5_2#></span>";
699							else if(link_sbstatus == "5")
700								statusmenu += "<span><#web_redirect_reason5_1#></span>";
701							else if(link_sbstatus == "6")
702								statusmenu += "<span>System error. <#Reboot_manually#></span>";
703							else
704								statusmenu += "<span><#Disconnected#></span>";
705						}
706					}
707				}
708				else if(sw_mode == 2 || sw_mode == 4){
709					if(_wlc_state == "wlc_state=2"){
710						statusmenu += "<span><#APSurvey_msg_connected#></span><br><br>";
711						if(wlc_band == 0)
712							statusmenu += "<b>Link rate: </b>"+ data_rate_info_2g;
713						else if(wlc_band == 1)
714							statusmenu += "<b>Link rate: </b>"+ data_rate_info_5g;
715						else if(wlc_band == 2)
716							statusmenu += "<b>Link rate: </b>"+ data_rate_info_5g_2;
717					}
718					else{
719						if(_wlc_sbstate == "wlc_sbstate=2")
720							statusmenu += "<span><#APSurvey_action_ConnectingStatus1#></span>";
721						else
722							statusmenu += "<span><#APSurvey_action_ConnectingStatus0#></span>";
723					}
724				}
725			}
726		}
727
728		if(sw_mode == 1){
729			if(dualWAN_support && wans_dualwan_array[1] != "none" ){
730				if(gobi_support){
731					if( wans_dualwan_array[1] == "wan")
732						statusmenu += "<div class='StatusHint'><br><#Ethernet_wan#>:</div>";
733					else if( wans_dualwan_array[1] == "lan")
734						statusmenu += "<div class='StatusHint'><br>"+eLAN_str+" (<#Port_Mapping_item1#> "+wans_lanport+"):</div>";
735					else if( wans_dualwan_array[1] == "usb")
736						statusmenu += "<div class='StatusHint'><br><#Mobile_title#>:</div>";
737				}
738				else{
739					statusmenu += "<div class='StatusHint'><br><#dualwan_secondary#>:</div>";
740					if( wans_dualwan_array[1] == "wan")
741						statusmenu += "<b><#Ethernet_wan#> -</b><br>";
742					else if( wans_dualwan_array[1] == "lan")
743						statusmenu += "<b><#Port_Mapping_item1#> "+wans_lanport+" -</b><br>";
744					else if( wans_dualwan_array[1] == "usb")
745						statusmenu += "<b><#menu5_4_4#> -</b><br>";
746				}
747
748				if(secondary_link_status == "1")
749					statusmenu += "<span><#web_redirect_reason2_2#></span>";
750				else if(secondary_link_status == "2" && (secondary_link_auxstatus == "0" || secondary_link_auxstatus == "2")){
751					if((wans_mode == "fo" || wans_mode == "fb") && active_wan_unit == "0")
752						statusmenu += "<span><#Status_Standby#></span>";
753					else
754						statusmenu += "<span><#Connected#></span>";
755				}
756				else{
757					if( wans_dualwan_array[1] == "usb"){
758						if(wan1_enable == "0"){
759							if(gobi_support)
760								statusmenu += "<div><#Mobile_disabled#></div>";
761							else
762								statusmenu += "<div><#USB_disabled#></div>";
763						}
764						else{
765							if(sim_state != ""){
766								if(sim_state == "2"){
767									if( g3err_pin == "1" && pin_remaining_count < 3)
768										statusmenu += "<div>Wrong PIN code. Please input the correct PIN code.</div>";
769									else
770										statusmenu += "<div><#Mobile_need_pin#></div>";
771								}
772								else if(sim_state == "3")
773									statusmenu += "<div><#Mobile_need_puk#></div>";
774								else if(sim_state == "4")
775									statusmenu += "<div><#Mobile_need_pin2#></div>";
776								else if(sim_state == "5")
777									statusmenu += "<div><#Mobile_need_puk2#></div>";
778								else if(sim_state == "6")
779									statusmenu += "<div><#Mobile_wait_sim#></div>";
780								else if(sim_state == "-1")
781									statusmenu += "<div><#Mobile_sim_miss#></div>";
782								else if(sim_state == "-10" || sim_state == "-2")
783									statusmenu += "<div><#Mobile_sim_fail#></div>";
784								else
785									statusmenu += "<div><#Mobile_fail_connect#></div>";
786							}
787							else
788								statusmenu += "<span><#Disconnected#></span>";
789						}
790					}
791					else{
792						if(wan1_enable == 0){
793							statusmenu += "<span><#WAN_disabled#></span>";
794						}
795						else{
796							if(secondary_link_auxstatus == "1"){
797								if( wans_dualwan_array[1] == "lan"){
798									statusmenu += "<span><#Check_cable#> : <#Port_Mapping_item1#> "+wans_lanport+"</span>";
799								}
800								else
801									statusmenu += "<span><#QKSet_detect_wanconnfault#></span>";
802							}
803							else if(secondary_link_sbstatus == "1")
804								statusmenu += "<span><#web_redirect_reason3_2#></span>";
805							else if(secondary_link_sbstatus == "2")
806								statusmenu += "<span><#QKSet_Internet_Setup_fail_reason2#></span>";
807							else if(secondary_link_sbstatus == "3")
808								statusmenu += "<span><#QKSet_Internet_Setup_fail_reason1#></span>";
809							else if(secondary_link_sbstatus == "4")
810								statusmenu += "<span><#web_redirect_reason5_2#></span>";
811							else if(secondary_link_sbstatus == "5")
812								statusmenu += "<span><#web_redirect_reason5_1#></span>";
813							else if(secondary_link_sbstatus == "6")
814								statusmenu += "<span><#ALERT_OF_ERROR_System4#> <#Reboot_manually#></span>";
815							else
816								statusmenu += "<span><#Disconnected#></span>";
817						}
818					}
819				}
820			}
821		}
822	}
823
824	// usb storage
825	if(itemNum == 2){
826	 	require(['/require/modules/diskList.js'], function(diskList){
827	 		var usbDevicesList = diskList.list();
828
829			statusmenu = "";
830			for(var i=0; i<usbDevicesList.length; i++){
831				if(usbDevicesList[i].deviceType == "printer") continue;
832
833				statusmenu += "<div class='StatusHint' style='margin-top:8px'>" + usbDevicesList[i].deviceName + ":</div>";
834				statusmenu += "<div>" + usbDevicesList[i].deviceType.charAt(0).toUpperCase() + usbDevicesList[i].deviceType.substring(1).toLowerCase() + "</div>";
835
836				if(usbDevicesList[i].deviceType == "storage" && usbDevicesList[i].mountNumber == 0)
837					statusmenu += "<div><#DISK_UNMOUNTED#></div>";
838				else if(usbDevicesList[i].hasErrPart)
839					statusmenu += "<div><#diskUtility_crash_found#></div>";
840				else{
841					if(usbDevicesList[i].hasAppDev)
842						statusmenu += "<div><#menu5_4#></div>";
843					if(usbDevicesList[i].hasTM)
844						statusmenu += "<div>Time Machine</div>";
845				}
846			}
847
848			if( statusmenu == "" )
849				statusmenu = "<div class='StatusHint'><#no_usb_found#></div>";
850
851			return overlib(statusmenu, OFFSETX, -160, LEFT, DELAY, 400);
852		});
853	}
854
855	if( statusmenu != "" )
856		return overlib(statusmenu, OFFSETX, -160, LEFT, DELAY, 400);
857}
858
859function show_diagTime(boottime_update){
860
861	Etime = debug_end_time - boottime_update;
862	EHours = Math.floor(Etime / 3600);
863	EMinutes = Math.floor(Etime % 3600 / 60);
864
865	if(EHours <= 0 && EMinutes <= 0)
866		return "<#mssid_time_remaining#> : <span>0</span> <#Hour#> <span>0</span> <#Minute#>";
867	else
868		return "<#mssid_time_remaining#> : <span>"+EHours+"</span> <#Hour#> <span>"+EMinutes+"</span> <#Minute#>";
869}
870
871function cancel_diag(){
872		parent.document.canceldiagForm.submit();
873}
874
875function openHint(hint_array_id, hint_show_id, flag){
876	statusmenu = "";
877	if(hint_array_id == 24){
878		var _caption = "";
879
880		if(hint_show_id == 9){	//2015.07 Viz add for bwdpi : Adaptive QoS mode
881			statusmenu = "<span class='StatusClickHint' onclick='priority_change();' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>Change priority mode</span><br>";	/* untranslated */
882			statusmenu += "<span class='StatusClickHint' onclick='qos_disable();' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>Disable QoS</span>";	/* untranslated */
883			_caption = "<#Adaptive_QoS#>";
884		}
885		else if(hint_show_id == 8){	//2014.10 Viz add for dsl dslx_diag_state
886			statusmenu = "<span class='StatusClickHint' onclick='cancel_diag();' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>Cancel debug capture</span>";
887			_caption = "DSL Line Diagnostic capture";
888		}
889		else if(hint_show_id == 7){
890			statusmenu = "<span class='StatusClickHint' onclick='gotoModem();' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>";
891			if(usb_index == -1){
892				statusmenu += "<#Activate_usb#></span>"
893				_caption = "<#dualwan#>";
894			}
895			else{
896				if(gobi_support){
897					statusmenu += "<#Mobile_setting_page#></span>"
898					_caption = "<#Mobile_title#>";
899				}
900				else{
901					statusmenu += "<#GO_HSDPA_SETTING#></span>"
902					_caption = "<#menu5_4_4#>";
903				}
904			}
905		}
906		else if(hint_show_id == 6){	// Viz add 2013.04 for dsl sync status
907			statusmenu = "<span class='StatusClickHint' onclick='gotoDSL_log();' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>Go to DSL Log</span>";
908			_caption = "DSL Log";
909		}
910		else if(hint_show_id == 5){
911			statusmenu = "<span class='StatusClickHint' onclick='gotocooler();' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>Go to Performance tuning</span>";
912			_caption = "Perfomance Tuning";
913		}
914		else if(hint_show_id == 4){
915			statusmenu = "<span class='StatusClickHint' onclick='gotoguestnetwork();' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'><#go_GuestNetwork#></span>";
916			_caption = "Guest Network";
917		}
918		else if(hint_show_id == 3){
919			var eLAN_str = "<#Ethernet_wan#>".replace(/WAN/, "LAN");
920			if(sw_mode == 1){
921				if(!dualWAN_support || wans_dualwan_array[1] == "none"){
922					if((link_status == "2" && link_auxstatus == "0") || (link_status == "2" && link_auxstatus == "2"))
923						statusmenu = "<span class='StatusClickHint' onclick='suspendconn(0, 0);' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'><#disconnect_internet#></span>";
924					else{
925						statusmenu = "<span class='StatusClickHint' onclick='goToWAN(0);' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>";
926						if(usb_index == 0){
927							if(gobi_support)
928								statusmenu += "<#Mobile_setting_page#></span>";
929							else
930								statusmenu += "<#GO_HSDPA_SETTING#></span>";
931						}
932						else
933							statusmenu += "<#WAN_setting_page#></span>";
934					}
935				}
936				else{
937					if(gobi_support){
938						if( wans_dualwan_array[0] == "wan")
939							statusmenu += "<div class='StatusHint'><#Ethernet_wan#>:</div>";
940						else if( wans_dualwan_array[0] == "lan")
941							statusmenu += "<div class='StatusHint'>"+eLAN_str+" (<#Port_Mapping_item1#> "+wans_lanport+"):</div>";
942						else if( wans_dualwan_array[0] == "usb")
943							statusmenu += "<div class='StatusHint'><#Mobile_title#>:</div>";
944					}
945					else{
946						statusmenu = "<div class='StatusHint'><#dualwan_primary#>:</div>";
947						if( wans_dualwan_array[0] == "wan")
948							statusmenu += "<b><#Ethernet_wan#> -</b><br>";
949						else if( wans_dualwan_array[0] == "lan")
950							statusmenu += "<b><#Port_Mapping_item1#> "+wans_lanport+" -</b><br>";
951						else if( wans_dualwan_array[0] == "usb")
952							statusmenu += "<b><#menu5_4_4#> -</b><br>";
953					}
954					if((first_link_status == "2" && first_link_auxstatus == "0") || (first_link_status == "2" && first_link_auxstatus == "2"))
955						statusmenu += "<span class='StatusClickHint' onclick='suspendconn(0, 0);' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'><#disconnect_internet#></span>";
956					else{
957						statusmenu += "<span class='StatusClickHint' onclick='goToWAN(0);' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>";
958						if(usb_index == 0){
959							if(gobi_support)
960								statusmenu += "<#Mobile_setting_page#></span>";
961							else
962								statusmenu += "<#GO_HSDPA_SETTING#></span>";
963						}
964						else
965							statusmenu += "<#WAN_setting_page#></span>";
966					}
967
968					if(gobi_support){
969						if( wans_dualwan_array[1] == "wan")
970							statusmenu += "<div class='StatusHint'><br><#Ethernet_wan#>:</div>";
971						else if( wans_dualwan_array[1] == "lan")
972						statusmenu += "<div class='StatusHint'><br>"+eLAN_str+" (<#Port_Mapping_item1#> "+wans_lanport+"):</div>";
973						else if( wans_dualwan_array[1] == "usb")
974							statusmenu += "<div class='StatusHint'><br><#Mobile_title#>:</div>";
975					}
976					else{
977						statusmenu += "<div class='StatusHint'><br><#dualwan_secondary#>:</div>";
978						if( wans_dualwan_array[1] == "wan")
979							statusmenu += "<b><#Ethernet_wan#> -</b><br>";
980						else if( wans_dualwan_array[1] == "lan")
981							statusmenu += "<b><#Port_Mapping_item1#> "+wans_lanport+" -</b><br>";
982						else if( wans_dualwan_array[1] == "usb")
983							statusmenu += "<b><#menu5_4_4#> -</b><br>";
984					}
985					if((secondary_link_status == "2" && secondary_link_auxstatus == "0") || (secondary_link_status == "2" && secondary_link_auxstatus == "2"))
986						statusmenu += "<span class='StatusClickHint' onclick='suspendconn(1, 0);' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'><#disconnect_internet#></span>";
987					else{
988						statusmenu += "<span class='StatusClickHint' onclick='goToWAN(1);' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>";
989						if(usb_index == 1){
990							if(gobi_support)
991								statusmenu += "<#Mobile_setting_page#></span>";
992							else
993								statusmenu += "<#GO_HSDPA_SETTING#></span>";
994						}
995						else
996							statusmenu += "<#WAN_setting_page#></span>";
997					}
998				}
999			}
1000			else if(sw_mode == 2){
1001				statusmenu = "<span class='StatusClickHint' onclick='top.location.href=\"http://"+ theUrl +"/QIS_wizard.htm?flag=sitesurvey_rep\";' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'><#APSurvey_action_search_again_hint2#></span>";
1002			}
1003			else if(sw_mode == 4){
1004				statusmenu = "<span class='StatusClickHint' onclick='top.location.href=\"/QIS_wizard.htm?flag=sitesurvey_mb\";' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'><#APSurvey_action_search_again_hint2#></span>";
1005			}
1006
1007			_caption = "Internet Status";
1008		}
1009		else if(hint_show_id == 2){
1010			statusmenu = "";
1011
1012		 	require(['/require/modules/diskList.js'], function(diskList){
1013		 		var usbDevicesList = diskList.list();
1014				for(var i=0; i<usbDevicesList.length; i++){
1015					if(usbDevicesList[i].mountNumber > 0){
1016						statusmenu += "<div style='margin-top:2px;' class='StatusClickHint' onclick='remove_disk("+ usbDevicesList[i].node +");' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>";
1017						statusmenu += "<#Eject_usb_disk#> <span style='font-weight:normal'>"+ usbDevicesList[i].deviceName +"</span></div>";
1018					}
1019				}
1020
1021				if(statusmenu == "")
1022					statusmenu = "<span class='StatusHint'><#DISK_UNMOUNTED#></span>";
1023				else if(statusmenu.howMany("remove_disk") > 1)
1024					statusmenu += "<div style='margin-top:2px;' class='StatusClickHint' onclick='remove_disk(\"all\");' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>Eject all USB disks</div>";
1025
1026				_caption = "USB storage";
1027				return overlib(statusmenu, OFFSETX, -160, LEFT, STICKY, CAPTION, " ", CLOSETITLE, '');
1028			});
1029		}
1030		else if(hint_show_id == 1){
1031			if(hadPlugged("printer"))
1032				statusmenu = "<span class='StatusClickHint' onclick='enableMonomode();' onmouseout='this.className=\"StatusClickHint\"' onmouseover='this.className=\"StatusClickHint_mouseover\"'>Enable Monopoly mode</span>";
1033			else
1034				statusmenu = "<span class='StatusHint'><#no_printer_detect#></span>";
1035			_caption = "Printer";
1036		}
1037
1038		return overlib(statusmenu, OFFSETX, -160, LEFT, STICKY, CAPTION, " ", CLOSETITLE, '');
1039	}
1040
1041	var tag_name= document.getElementsByTagName('a');
1042	for (var i=0;i<tag_name.length;i++)
1043		tag_name[i].onmouseout=nd;
1044
1045	if(helpcontent == [] || helpcontent == "" || hint_array_id > helpcontent.length)
1046		return overlib('<#defaultHint#>', HAUTO, VAUTO);
1047	else if(hint_array_id == 0 && hint_show_id > 21 && hint_show_id < 24)
1048		return overlib(helpcontent[hint_array_id][hint_show_id], FIXX, 270, FIXY, 30);
1049	else{
1050		if(hint_show_id > helpcontent[hint_array_id].length)
1051			return overlib('<#defaultHint#>', HAUTO, VAUTO);
1052		else
1053			return overlib(helpcontent[hint_array_id][hint_show_id], HAUTO, VAUTO);
1054	}
1055}
1056
1057//\/////
1058//\  overLIB 4.21 - You may not remove or change this notice.
1059//\  Copyright Erik Bosrup 1998-2004. All rights reserved.
1060//\
1061//\  Contributors are listed on the homepage.
1062//\  This file might be old, always check for the latest version at:
1063//\  http://www.bosrup.com/web/overlib/
1064//\
1065//\  Please read the license agreement (available through the link above)
1066//\  before using overLIB. Direct any licensing questions to erik@bosrup.com.
1067//\
1068//\  Do not sell this as your own work or remove this copyright notice.
1069//\  For full details on copying or changing this script please read the
1070//\  license agreement at the link above. Please give credit on sites that
1071//\  use overLIB and submit changes of the script so other people can use
1072//\  them as well.
1073//   $Revision: 1.119 $                $Date: 2005/07/02 23:41:44 $
1074//\/////
1075//\mini
1076
1077////////
1078// PRE-INIT
1079// Ignore these lines, configuration is below.
1080////////
1081var olLoaded = 0;var pmStart = 10000000; var pmUpper = 10001000; var pmCount = pmStart+1; var pmt=''; var pms = new Array(); var olInfo = new Info('4.21', 1);
1082var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3; var FCHAIN=4;
1083var olHideForm=0;  // parameter for hiding SELECT and ActiveX elements in IE5.5+
1084var olHautoFlag = 0;  // flags for over-riding VAUTO and HAUTO if corresponding
1085var olVautoFlag = 0;  // positioning commands are used on the command line
1086var hookPts = new Array(), postParse = new Array(), cmdLine = new Array(), runTime = new Array();
1087// for plugins
1088registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy,relx,rely,fgbackground,bgbackground,padx,pady,fullhtml,above,below,capicon,textfont,captionfont,closefont,textsize,captionsize,closesize,timeout,function,delay,hauto,vauto,closeclick,wrap,followmouse,mouseoff,closetitle,cssoff,compatmode,cssclass,fgclass,bgclass,textfontclass,captionfontclass,closefontclass');
1089
1090////////
1091// DEFAULT CONFIGURATION
1092// Settings you want everywhere are set here. All of this can also be
1093// changed on your html page or through an overLIB call.
1094////////
1095if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#EEEEEE";
1096if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#CCC";
1097if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000";
1098if (typeof ol_capcolor=='undefined') var ol_capcolor="#777";
1099if (typeof ol_closecolor=='undefined') var ol_closecolor="#000000";
1100if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica";
1101if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica";
1102if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica";
1103if (typeof ol_textsize=='undefined') var ol_textsize="2";
1104if (typeof ol_captionsize=='undefined') var ol_captionsize="1";
1105if (typeof ol_closesize=='undefined') var ol_closesize="2";
1106if (typeof ol_width=='undefined') var ol_width="200";
1107if (typeof ol_border=='undefined') var ol_border="1";
1108if (typeof ol_cellpad=='undefined') var ol_cellpad=6;
1109if (typeof ol_offsetx=='undefined') var ol_offsetx=10;
1110if (typeof ol_offsety=='undefined') var ol_offsety=10;
1111if (typeof ol_text=='undefined') var ol_text='<#aicloud_for_privateIP3#>';
1112if (typeof ol_cap=='undefined') var ol_cap="";
1113if (typeof ol_sticky=='undefined') var ol_sticky=0;
1114if (typeof ol_background=='undefined') var ol_background="";
1115if (typeof ol_close=='undefined') var ol_close="&times;&nbsp;";
1116if (typeof ol_hpos=='undefined') var ol_hpos=RIGHT;
1117if (typeof ol_status=='undefined') var ol_status="";
1118if (typeof ol_autostatus=='undefined') var ol_autostatus=0;
1119if (typeof ol_height=='undefined') var ol_height=-1;
1120if (typeof ol_snapx=='undefined') var ol_snapx=0;
1121if (typeof ol_snapy=='undefined') var ol_snapy=0;
1122if (typeof ol_fixx=='undefined') var ol_fixx=-1;
1123if (typeof ol_fixy=='undefined') var ol_fixy=-1;
1124if (typeof ol_relx=='undefined') var ol_relx=null;
1125if (typeof ol_rely=='undefined') var ol_rely=null;
1126if (typeof ol_fgbackground=='undefined') var ol_fgbackground="";
1127if (typeof ol_bgbackground=='undefined') var ol_bgbackground="";
1128if (typeof ol_padxl=='undefined') var ol_padxl=1;
1129if (typeof ol_padxr=='undefined') var ol_padxr=1;
1130if (typeof ol_padyt=='undefined') var ol_padyt=1;
1131if (typeof ol_padyb=='undefined') var ol_padyb=1;
1132if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0;
1133if (typeof ol_vpos=='undefined') var ol_vpos=BELOW;
1134if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0;
1135if (typeof ol_capicon=='undefined') var ol_capicon="";
1136if (typeof ol_frame=='undefined') var ol_frame=self;
1137if (typeof ol_timeout=='undefined') var ol_timeout=0;
1138if (typeof ol_function=='undefined') var ol_function=null;
1139if (typeof ol_delay=='undefined') var ol_delay=0;
1140if (typeof ol_hauto=='undefined') var ol_hauto=0;
1141if (typeof ol_vauto=='undefined') var ol_vauto=0;
1142if (typeof ol_closeclick=='undefined') var ol_closeclick=0;
1143if (typeof ol_wrap=='undefined') var ol_wrap=0;
1144if (typeof ol_followmouse=='undefined') var ol_followmouse=1;
1145if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0;
1146if (typeof ol_closetitle=='undefined') var ol_closetitle='Close';
1147if (typeof ol_compatmode=='undefined') var ol_compatmode=0;
1148if (typeof ol_css=='undefined') var ol_css=CSSOFF;
1149if (typeof ol_fgclass=='undefined') var ol_fgclass="";
1150if (typeof ol_bgclass=='undefined') var ol_bgclass="";
1151if (typeof ol_textfontclass=='undefined') var ol_textfontclass="";
1152if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass="";
1153if (typeof ol_closefontclass=='undefined') var ol_closefontclass="";
1154
1155////////
1156// ARRAY CONFIGURATION
1157////////
1158
1159// You can use these arrays to store popup text here instead of in the html.
1160if (typeof ol_texts=='undefined') var ol_texts = new Array("Text 0", "Text 1");
1161if (typeof ol_caps=='undefined') var ol_caps = new Array("Caption 0", "Caption 1");
1162
1163////////
1164// END OF CONFIGURATION
1165// Don't change anything below this line, all configuration is above.
1166////////
1167
1168////////
1169// INIT
1170////////
1171// Runtime variables init. Don't change for config!
1172var o3_text="";
1173var o3_cap="";
1174var o3_sticky=0;
1175var o3_background="";
1176var o3_close="Close";
1177var o3_hpos=RIGHT;
1178var o3_offsetx=2;
1179var o3_offsety=2;
1180var o3_fgcolor="";
1181var o3_bgcolor="";
1182var o3_textcolor="";
1183var o3_capcolor="";
1184var o3_closecolor="";
1185var o3_width=100;
1186var o3_border=1;
1187var o3_cellpad=2;
1188var o3_status="";
1189var o3_autostatus=0;
1190var o3_height=-1;
1191var o3_snapx=0;
1192var o3_snapy=0;
1193var o3_fixx=-1;
1194var o3_fixy=-1;
1195var o3_relx=null;
1196var o3_rely=null;
1197var o3_fgbackground="";
1198var o3_bgbackground="";
1199var o3_padxl=0;
1200var o3_padxr=0;
1201var o3_padyt=0;
1202var o3_padyb=0;
1203var o3_fullhtml=0;
1204var o3_vpos=BELOW;
1205var o3_aboveheight=0;
1206var o3_capicon="";
1207var o3_textfont="Verdana,Arial,Helvetica";
1208var o3_captionfont="Verdana,Arial,Helvetica";
1209var o3_closefont="Verdana,Arial,Helvetica";
1210var o3_textsize="1";
1211var o3_captionsize="1";
1212var o3_closesize="1";
1213var o3_frame=self;
1214var o3_timeout=0;
1215var o3_timerid=0;
1216var o3_allowmove=0;
1217var o3_function=null;
1218var o3_delay=0;
1219var o3_delayid=0;
1220var o3_hauto=0;
1221var o3_vauto=0;
1222var o3_closeclick=0;
1223var o3_wrap=0;
1224var o3_followmouse=1;
1225var o3_mouseoff=0;
1226var o3_closetitle='';
1227var o3_compatmode=0;
1228var o3_css=CSSOFF;
1229var o3_fgclass="";
1230var o3_bgclass="";
1231var o3_textfontclass="";
1232var o3_captionfontclass="";
1233var o3_closefontclass="";
1234
1235// Display state variables
1236var o3_x = 0;
1237var o3_y = 0;
1238var o3_showingsticky = 0;
1239var o3_removecounter = 0;
1240
1241// Our layer
1242var over = null;
1243var fnRef, hoveringSwitch = false;
1244var olHideDelay;
1245
1246// Decide browser version
1247var isMac = (navigator.userAgent.indexOf("Mac") != -1);
1248var olOp = (navigator.userAgent.toLowerCase().indexOf('opera') > -1 && document.createTextNode);  // Opera 7
1249var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4);
1250var olNs6 = (document.getElementById) ? true : false;
1251var olKq = (olNs6 && /konqueror/i.test(navigator.userAgent));
1252var olIe4 = (document.all) ? true : false;
1253var olIe5 = false;
1254var olIe55 = false; // Added additional variable to identify IE5.5+
1255var docRoot = 'document.body';
1256
1257// Resize fix for NS4.x to keep track of layer
1258if (olNs4) {
1259	var oW = window.innerWidth;
1260	var oH = window.innerHeight;
1261	window.onresize = function() { if (oW != window.innerWidth || oH != window.innerHeight) location.reload(); }
1262}
1263
1264// Microsoft Stupidity Check(tm).
1265if (olIe4) {
1266	var agent = navigator.userAgent;
1267	if (/MSIE/.test(agent)) {
1268		var versNum = parseFloat(agent.match(/MSIE[ ](\d+\.\d+)\.*/i)[1]);
1269		if (versNum >= 5){
1270			olIe5=true;
1271			olIe55=(versNum>=5.5&&!olOp) ? true : false;
1272			if (olNs6) olNs6=false;
1273		}
1274	}
1275	if (olNs6) olIe4 = false;
1276}
1277
1278// Check for compatability mode.
1279if (document.compatMode && document.compatMode == 'CSS1Compat') {
1280	docRoot= ((olIe4 && !olOp) ? 'document.documentElement' : docRoot);
1281}
1282
1283// Add window onload handlers to indicate when all modules have been loaded
1284// For Netscape 6+ and Mozilla, uses addEventListener method on the window object
1285// For IE it uses the attachEvent method of the window object and for Netscape 4.x
1286// it sets the window.onload handler to the OLonload_handler function for Bubbling
1287if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false);
1288else if (window.attachEvent) window.attachEvent("onload",OLonLoad_handler);
1289
1290var capExtent;
1291
1292////////
1293// PUBLIC FUNCTIONS
1294////////
1295
1296// overlib(arg0,...,argN)
1297// Loads parameters into global runtime variables.
1298function overlib() {
1299	if(typeof overlib.isOut != "undefined")
1300		overlib.isOut = false;
1301
1302	if (!olLoaded || isExclusive(overlib.arguments)) return true;
1303	if (olCheckMouseCapture) olMouseCapture();
1304	if (over) {
1305		over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over;
1306		cClick();
1307	}
1308
1309	// Load defaults to runtime.
1310  olHideDelay=0;
1311	o3_text=ol_text;
1312	o3_cap=ol_cap;
1313	o3_sticky=ol_sticky;
1314	o3_background=ol_background;
1315	o3_close=ol_close;
1316	o3_hpos=ol_hpos;
1317	o3_offsetx=ol_offsetx;
1318	o3_offsety=ol_offsety;
1319	o3_fgcolor=ol_fgcolor;
1320	o3_bgcolor=ol_bgcolor;
1321	o3_textcolor=ol_textcolor;
1322	o3_capcolor=ol_capcolor;
1323	o3_closecolor=ol_closecolor;
1324	o3_width=ol_width;
1325	o3_border=ol_border;
1326	o3_cellpad=ol_cellpad;
1327	o3_status=ol_status;
1328	o3_autostatus=ol_autostatus;
1329	o3_height=ol_height;
1330	o3_snapx=ol_snapx;
1331	o3_snapy=ol_snapy;
1332	o3_fixx=ol_fixx;
1333	o3_fixy=ol_fixy;
1334	o3_relx=ol_relx;
1335	o3_rely=ol_rely;
1336	o3_fgbackground=ol_fgbackground;
1337	o3_bgbackground=ol_bgbackground;
1338	o3_padxl=ol_padxl;
1339	o3_padxr=ol_padxr;
1340	o3_padyt=ol_padyt;
1341	o3_padyb=ol_padyb;
1342	o3_fullhtml=ol_fullhtml;
1343	o3_vpos=ol_vpos;
1344	o3_aboveheight=ol_aboveheight;
1345	o3_capicon=ol_capicon;
1346	o3_textfont=ol_textfont;
1347	o3_captionfont=ol_captionfont;
1348	o3_closefont=ol_closefont;
1349	o3_textsize=ol_textsize;
1350	o3_captionsize=ol_captionsize;
1351	o3_closesize=ol_closesize;
1352	o3_timeout=ol_timeout;
1353	o3_function=ol_function;
1354	o3_delay=ol_delay;
1355	o3_hauto=ol_hauto;
1356	o3_vauto=ol_vauto;
1357	o3_closeclick=ol_closeclick;
1358	o3_wrap=ol_wrap;
1359	o3_followmouse=ol_followmouse;
1360	o3_mouseoff=ol_mouseoff;
1361	o3_closetitle=ol_closetitle;
1362	o3_css=ol_css;
1363	o3_compatmode=ol_compatmode;
1364	o3_fgclass=ol_fgclass;
1365	o3_bgclass=ol_bgclass;
1366	o3_textfontclass=ol_textfontclass;
1367	o3_captionfontclass=ol_captionfontclass;
1368	o3_closefontclass=ol_closefontclass;
1369
1370	setRunTimeVariables();
1371
1372	fnRef = '';
1373
1374	// Special for frame support, over must be reset...
1375	o3_frame = ol_frame;
1376
1377	if(!(over=createDivContainer())) return false;
1378
1379	parseTokens('o3_', overlib.arguments);
1380	if (!postParseChecks()) return false;
1381
1382	if (o3_delay == 0) {
1383		return runHook("olMain", FREPLACE);
1384 	} else {
1385		o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay);
1386		return false;
1387	}
1388}
1389
1390// Clears popups if appropriate
1391function nd(time) {
1392	if(typeof overlib.isOut != "undefined")
1393		overlib.isOut = true;
1394
1395	if (olLoaded && !isExclusive()) {
1396		hideDelay(time);  // delay popup close if time specified
1397
1398		if (o3_removecounter >= 1) { o3_showingsticky = 0 };
1399
1400		if (o3_showingsticky == 0) {
1401			o3_allowmove = 0;
1402			if (over != null && o3_timerid == 0) runHook("hideObject", FREPLACE, over);
1403		} else {
1404			o3_removecounter++;
1405		}
1406	}
1407
1408	return true;
1409}
1410
1411// The Close onMouseOver function for stickies
1412function cClick() {
1413	if (olLoaded) {
1414		runHook("hideObject", FREPLACE, over);
1415		o3_showingsticky = 0;
1416	}
1417	return false;
1418}
1419
1420// Method for setting page specific defaults.
1421function overlib_pagedefaults() {
1422	parseTokens('ol_', overlib_pagedefaults.arguments);
1423}
1424
1425
1426////////
1427// OVERLIB MAIN FUNCTION
1428////////
1429
1430// This function decides what it is we want to display and how we want it done.
1431function olMain() {
1432	var layerhtml, styleType;
1433 	runHook("olMain", FBEFORE);
1434
1435	if (o3_background!="" || o3_fullhtml) {
1436		// Use background instead of box.
1437		layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
1438	} else {
1439		// They want a popup box.
1440		styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass");
1441
1442		// Prepare popup background
1443		if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\"";
1444		if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground);
1445
1446		// Prepare popup colors
1447		if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor);
1448		if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor);
1449
1450		// Prepare popup height
1451		if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height);
1452		else o3_height = "";
1453
1454		// Decide which kinda box.
1455		if (o3_cap=="") {
1456			// Plain
1457			layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text);
1458		} else {
1459			// With caption
1460			if (o3_sticky) {
1461				// Show close text
1462				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, o3_close);
1463			} else {
1464				// No close text
1465				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, "");
1466			}
1467		}
1468	}
1469
1470	// We want it to stick!
1471	if (o3_sticky) {
1472		if (o3_timerid > 0) {
1473			clearTimeout(o3_timerid);
1474			o3_timerid = 0;
1475		}
1476		o3_showingsticky = 1;
1477		o3_removecounter = 0;
1478	}
1479
1480	// Created a separate routine to generate the popup to make it easier
1481	// to implement a plugin capability
1482	if (!runHook("createPopup", FREPLACE, layerhtml)) return false;
1483
1484	// Prepare status bar
1485	if (o3_autostatus > 0) {
1486		o3_status = o3_text;
1487		if (o3_autostatus > 1) o3_status = o3_cap;
1488	}
1489
1490	// When placing the layer the first time, even stickies may be moved.
1491	o3_allowmove = 0;
1492
1493	// Initiate a timer for timeout
1494	if (o3_timeout > 0) {
1495		if (o3_timerid > 0) clearTimeout(o3_timerid);
1496		o3_timerid = setTimeout("cClick()", o3_timeout);
1497	}
1498
1499	// Show layer
1500	runHook("disp", FREPLACE, o3_status);
1501	runHook("olMain", FAFTER);
1502
1503	return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != '');
1504}
1505
1506////////
1507// LAYER GENERATION FUNCTIONS
1508////////
1509// These functions just handle popup content with tags that should adhere to the W3C standards specification.
1510
1511// Makes simple table without caption
1512function ol_content_simple(text) {
1513	var cpIsMultiple = /,/.test(o3_cellpad);
1514	var txt = '<table id="overDiv_table1" width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_height)+'><tr><td><table id="overDiv_table2" width="100%" border="0" '+((olNs4||!cpIsMultiple) ? 'cellpadding="'+o3_cellpad+'" ' : '')+'cellspacing="0" '+(o3_fgclass ? 'class="'+o3_fgclass+'"' : o3_fgcolor+' '+o3_fgbackground+' '+o3_height)+'><tr><td valign="TOP"'+(o3_textfontclass ? ' class="'+o3_textfontclass+'">' : ((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td></tr></table></td></tr></table>';
1515
1516	set_background("");
1517	return txt;
1518}
1519
1520// Makes table with caption and optional close link
1521function ol_content_caption(text,title,close) {
1522	var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad);
1523	var closing, closeevent;
1524
1525	closing = "";
1526	closeevent = "onclick";
1527	if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
1528	if (o3_capicon != "") {
1529	  nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"';
1530	  if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
1531	  o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
1532	}
1533
1534	if (close != "")
1535		closing = '<td '+(!o3_compatmode && o3_closefontclass ? 'class="'+o3_closefontclass : 'align="RIGHT')+'"><a href="javascript:return '+fnRef+'cClick();"'+((o3_compatmode && o3_closefontclass) ? ' class="' + o3_closefontclass + '" ' : ' ')+closeevent+'="return '+fnRef+'cClick();"><img width="18px" height="18px" src="/images/button-close.png" onmouseover="this.src=\'/images/button-close2.png\'" onmouseout="this.src=\'/images/button-close.png\'" border="0"></a></td>';
1536	txt = '<table id="overDiv_table3" width="'+o3_width+ '" border="0" cellpadding="0" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_bgbackground+' '+o3_height)+'><tr><td><table id="overDiv_table4" bgColor="#CCCCCC" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td'+(o3_captionfontclass ? ' class="'+o3_captionfontclass+'">' : '>')+(o3_captionfontclass ? '' : '<b>'+wrapStr(0,o3_captionsize,'caption'))+o3_capicon+title+(o3_captionfontclass ? '' : wrapStr(1,o3_captionsize)+'</b>')+'</td>'+closing+'</tr></table><table id="overDiv_table5" width="100%"  border="0" '+((olNs4||!cpIsMultiple) ? 'cellpadding="5" ' : '')+'cellspacing="0" '+(o3_fgclass ? 'class="'+o3_fgclass+'"' : o3_fgcolor+' '+o3_fgbackground+' '+o3_height)+'><tr><td valign="TOP"'+(o3_textfontclass ? ' class="'+o3_textfontclass+'">' :((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize)) + '</td></tr></table></td></tr></table>';
1537
1538	set_background("");
1539	return txt;
1540}
1541
1542// Sets the background picture,padding and lots more. :)
1543function ol_content_background(text,picture,hasfullhtml) {
1544	if (hasfullhtml) {
1545		txt=text;
1546	} else {
1547		txt='<table id="overDiv_table5" width="'+o3_width+'" border="0" cellpadding="0" cellspacing="0" height="'+o3_height+'"><tr><td colspan="3" height="'+o3_padyt+'"></td></tr><tr><td width="'+o3_padxl+'"></td><td valign="TOP" width="'+(o3_width-o3_padxl-o3_padxr)+(o3_textfontclass ? '" class="'+o3_textfontclass : '')+'">'+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td><td width="'+o3_padxr+'"></td></tr><tr><td colspan="3" height="'+o3_padyb+'"></td></tr></table>';
1548	}
1549
1550	set_background(picture);
1551	return txt;
1552}
1553
1554// Loads a picture into the div.
1555function set_background(pic){
1556	if (pic == "") {
1557		if (olNs4) {
1558			over.background.src = null;
1559		} else if (over.style) {
1560			over.style.backgroundImage = "none";
1561		}
1562	} else {
1563		if (olNs4) {
1564			over.background.src = pic;
1565		} else if (over.style) {
1566			over.style.width=o3_width + 'px';
1567			over.style.backgroundImage = "url("+pic+")";
1568		}
1569	}
1570}
1571
1572////////
1573// HANDLING FUNCTIONS
1574////////
1575var olShowId=-1;
1576
1577// Displays the popup
1578function disp(statustext) {
1579	runHook("disp", FBEFORE);
1580
1581	if (o3_allowmove == 0) {
1582		runHook("placeLayer", FREPLACE);
1583		(olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
1584		o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1;
1585	}
1586
1587	runHook("disp", FAFTER);
1588
1589	if (statustext != "") self.status = statustext;
1590}
1591
1592// Creates the actual popup structure
1593function createPopup(lyrContent){
1594	runHook("createPopup", FBEFORE);
1595
1596	if (o3_wrap) {
1597		var wd,ww,theObj = (olNs4 ? over : over.style);
1598		theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
1599		layerWrite(lyrContent);
1600		wd = (olNs4 ? over.clip.width : over.offsetWidth);
1601		if (wd > (ww=windowWidth())) {
1602			lyrContent=lyrContent.replace(/\&nbsp;/g, ' ');
1603			o3_width=ww;
1604			o3_wrap=0;
1605		}
1606	}
1607
1608	layerWrite(lyrContent);
1609
1610	// Have to set o3_width for placeLayer() routine if o3_wrap is turned on
1611	if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth);
1612
1613	runHook("createPopup", FAFTER, lyrContent);
1614
1615	return true;
1616}
1617
1618// Decides where we want the popup.
1619function placeLayer() {
1620	var placeX, placeY, widthFix = 0;
1621
1622	// HORIZONTAL PLACEMENT, re-arranged to work in Safari
1623	if (o3_frame.innerWidth) widthFix=18;
1624	iwidth = windowWidth();
1625
1626	// Horizontal scroll offset
1627	winoffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset;
1628	placeX = runHook('horizontalPlacement',FCHAIN,iwidth,winoffset,widthFix);
1629
1630	// VERTICAL PLACEMENT, re-arranged to work in Safari
1631	if (o3_frame.innerHeight) {
1632		iheight=o3_frame.innerHeight;
1633	} else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval('o3_frame.'+docRoot+'.clientHeight')) {
1634		iheight=eval('o3_frame.'+docRoot+'.clientHeight');
1635	}
1636
1637	// Vertical scroll offset
1638	scrolloffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset;
1639	placeY = runHook('verticalPlacement',FCHAIN,iheight,scrolloffset);
1640
1641	// Actually move the object.
1642	repositionTo(over, placeX, placeY);
1643}
1644
1645// Moves the layer
1646function olMouseMove(e) {
1647	var e = (e) ? e : event;
1648
1649	if (e.pageX) {
1650		o3_x = e.pageX;
1651		o3_y = e.pageY;
1652	} else if (e.clientX) {
1653		o3_x = eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft');
1654		o3_y = eval('e.clientY+o3_frame.'+docRoot+'.scrollTop');
1655	}
1656
1657	if (o3_allowmove == 1) runHook("placeLayer", FREPLACE);
1658
1659	// MouseOut handler
1660	if (hoveringSwitch && !olNs4 && runHook("cursorOff", FREPLACE)) {
1661		(olHideDelay ? hideDelay(olHideDelay) : cClick());
1662		hoveringSwitch = !hoveringSwitch;
1663	}
1664}
1665
1666// Fake function for 3.0 users.
1667function no_overlib() { return ver3fix; }
1668
1669// Capture the mouse and chain other scripts.
1670function olMouseCapture() {
1671	capExtent = document;
1672	var fN, str = '', l, k, f, wMv, sS, mseHandler = olMouseMove;
1673	var re = /function[ ]*(\w*)\(/;
1674
1675	wMv = (!olIe4 && window.onmousemove);
1676	if (document.onmousemove || wMv) {
1677		if (wMv) capExtent = window;
1678		f = capExtent.onmousemove.toString();
1679		fN = f.match(re);
1680		if (fN == null) {
1681			str = f+'(e); ';
1682		} else if (fN[1] == 'anonymous' || fN[1] == 'olMouseMove' || (wMv && fN[1] == 'onmousemove')) {
1683			if (!olOp && wMv) {
1684				l = f.indexOf('{')+1;
1685				k = f.lastIndexOf('}');
1686				sS = f.substring(l,k);
1687				if ((l = sS.indexOf('(')) != -1) {
1688					sS = sS.substring(0,l).replace(/^\s+/,'').replace(/\s+$/,'');
1689					if (eval("typeof " + sS + " == 'undefined'")) window.onmousemove = null;
1690					else str = sS + '(e);';
1691				}
1692			}
1693			if (!str) {
1694				olCheckMouseCapture = false;
1695				return;
1696			}
1697		} else {
1698			if (fN[1]) str = fN[1]+'(e); ';
1699			else {
1700				l = f.indexOf('{')+1;
1701				k = f.lastIndexOf('}');
1702				str = f.substring(l,k) + '\n';
1703			}
1704		}
1705		str += 'olMouseMove(e); ';
1706		mseHandler = new Function('e', str);
1707	}
1708
1709	capExtent.onmousemove = mseHandler;
1710	if (olNs4) capExtent.captureEvents(Event.MOUSEMOVE);
1711}
1712
1713////////
1714// PARSING FUNCTIONS
1715////////
1716
1717// Does the actual command parsing.
1718function parseTokens(pf, ar) {
1719	// What the next argument is expected to be.
1720	var v, i, mode=-1, par = (pf != 'ol_');
1721	var fnMark = (par && !ar.length ? 1 : 0);
1722
1723	for (i = 0; i < ar.length; i++) {
1724		if (mode < 0) {
1725			// Arg is maintext,unless its a number between pmStart and pmUpper
1726			// then its a command.
1727			if (typeof ar[i] == 'number' && ar[i] > pmStart && ar[i] < pmUpper) {
1728				fnMark = (par ? 1 : 0);
1729				i--;   // backup one so that the next block can parse it
1730			} else {
1731				switch(pf) {
1732					case 'ol_':
1733						ol_text = ar[i].toString();
1734						break;
1735					default:
1736						o3_text=ar[i].toString();
1737				}
1738			}
1739			mode = 0;
1740		} else {
1741			// Note: NS4 doesn't like switch cases with vars.
1742			if (ar[i] >= pmCount || ar[i]==DONOTHING) { continue; }
1743			if (ar[i]==INARRAY) { fnMark = 0; eval(pf+'text=ol_texts['+ar[++i]+'].toString()'); continue; }
1744			if (ar[i]==CAPARRAY) { eval(pf+'cap=ol_caps['+ar[++i]+'].toString()'); continue; }
1745			if (ar[i]==STICKY) { if (pf!='ol_') eval(pf+'sticky=1'); continue; }
1746			if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; }
1747			if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; }
1748			if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; }
1749			if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; }
1750			if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; }
1751			if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; }
1752			if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; }
1753			if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; }
1754			if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; }
1755			if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; }
1756			if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; }
1757			if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; }
1758			if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; }
1759			if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; }
1760			if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; }
1761			if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; }
1762			if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; }
1763			if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again.
1764			if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; }
1765			if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; }
1766			if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; }
1767			if (ar[i]==FIXX) { eval(pf+'fixx='+ar[++i]); continue; }
1768			if (ar[i]==FIXY) { eval(pf+'fixy='+ar[++i]); continue; }
1769			if (ar[i]==RELX) { eval(pf+'relx='+ar[++i]); continue; }
1770			if (ar[i]==RELY) { eval(pf+'rely='+ar[++i]); continue; }
1771			if (ar[i]==FGBACKGROUND) { eval(pf+'fgbackground="'+ar[++i]+'"'); continue; }
1772			if (ar[i]==BGBACKGROUND) { eval(pf+'bgbackground="'+ar[++i]+'"'); continue; }
1773			if (ar[i]==PADX) { eval(pf+'padxl='+ar[++i]); eval(pf+'padxr='+ar[++i]); continue; }
1774			if (ar[i]==PADY) { eval(pf+'padyt='+ar[++i]); eval(pf+'padyb='+ar[++i]); continue; }
1775			if (ar[i]==FULLHTML) { if (pf!='ol_') eval(pf+'fullhtml=1'); continue; }
1776			if (ar[i]==BELOW || ar[i]==ABOVE) { eval(pf+'vpos='+ar[i]); if (pf!='ol_') olVautoFlag=1; continue; }
1777			if (ar[i]==CAPICON) { eval(pf+'capicon="'+ar[++i]+'"'); continue; }
1778			if (ar[i]==TEXTFONT) { eval(pf+"textfont='"+escSglQuote(ar[++i])+"'"); continue; }
1779			if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; }
1780			if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; }
1781			if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; }
1782			if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; }
1783			if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; }
1784			if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; }
1785			if (ar[i]==FUNCTION) { if (pf=='ol_') { if (typeof ar[i+1]!='number') { v=ar[++i]; ol_function=(typeof v=='function' ? v : null); }} else {fnMark = 0; v = null; if (typeof ar[i+1]!='number') v = ar[++i];  opt_FUNCTION(v); } continue; }
1786			if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; }
1787			if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; }
1788			if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; }
1789			if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; }
1790			if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; }
1791			if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; }
1792			if (ar[i]==MOUSEOFF) { eval(pf +'mouseoff=('+pf+'mouseoff==0) ? 1 : 0'); v=ar[i+1]; if (pf != 'ol_' && eval(pf+'mouseoff') && typeof v == 'number' && (v < pmStart || v > pmUpper)) olHideDelay=ar[++i]; continue; }
1793			if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; }
1794			if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; }
1795			if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; }
1796			if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; }
1797			if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; }
1798			if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; }
1799			if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; }
1800			if (ar[i]==CLOSEFONTCLASS) { eval(pf+'closefontclass="'+ar[++i]+'"'); continue; }
1801			i = parseCmdLine(pf, i, ar);
1802		}
1803	}
1804
1805	if (fnMark && o3_function) o3_text = o3_function();
1806
1807	if ((pf == 'o3_') && o3_wrap) {
1808		o3_width = 0;
1809
1810		var tReg=/<.*\n*>/ig;
1811		if (!tReg.test(o3_text)) o3_text = o3_text.replace(/[ ]+/g, '&nbsp;');
1812		if (!tReg.test(o3_cap))o3_cap = o3_cap.replace(/[ ]+/g, '&nbsp;');
1813	}
1814	if ((pf == 'o3_') && o3_sticky) {
1815		if (!o3_close && (o3_frame != ol_frame)) o3_close = ol_close;
1816		if (o3_mouseoff && (o3_frame == ol_frame)) opt_NOCLOSE(' ');
1817	}
1818}
1819
1820
1821////////
1822// LAYER FUNCTIONS
1823////////
1824
1825// Writes to a layer
1826function layerWrite(txt) {
1827	txt += "\n";
1828	if (olNs4) {
1829		var lyr = o3_frame.document.layers['overDiv'].document
1830		lyr.write(txt)
1831		lyr.close()
1832	} else if (typeof over.innerHTML != 'undefined') {
1833		if (olIe5 && isMac) over.innerHTML = '';
1834		over.innerHTML = txt;
1835	} else {
1836		range = o3_frame.document.createRange();
1837		range.setStartAfter(over);
1838		domfrag = range.createContextualFragment(txt);
1839
1840		while (over.hasChildNodes()) {
1841			over.removeChild(over.lastChild);
1842		}
1843
1844		over.appendChild(domfrag);
1845	}
1846}
1847
1848// Make an object visible
1849function showObject(obj) {
1850	runHook("showObject", FBEFORE);
1851
1852	var theObj=(olNs4 ? obj : obj.style);
1853	theObj.visibility = 'visible';
1854
1855	runHook("showObject", FAFTER);
1856}
1857
1858// Hides an object
1859function hideObject(obj) {
1860	runHook("hideObject", FBEFORE);
1861
1862	var theObj=(olNs4 ? obj : obj.style);
1863	if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; }
1864	theObj.visibility = 'hidden';
1865	theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
1866
1867	if (o3_timerid > 0) clearTimeout(o3_timerid);
1868	if (o3_delayid > 0) clearTimeout(o3_delayid);
1869
1870	o3_timerid = 0;
1871	o3_delayid = 0;
1872	self.status = "";
1873
1874	if (obj.onmouseout||obj.onmouseover) {
1875		if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
1876		obj.onmouseout = obj.onmouseover = null;
1877	}
1878
1879	runHook("hideObject", FAFTER);
1880}
1881
1882// Move a layer
1883function repositionTo(obj, xL, yL) {
1884	var theObj=(olNs4 ? obj : obj.style);
1885	theObj.left = xL + (!olNs4 ? 'px' : 0);
1886	theObj.top = yL + (!olNs4 ? 'px' : 0);
1887}
1888
1889// Check position of cursor relative to overDiv DIVision; mouseOut function
1890function cursorOff() {
1891	var left = parseInt(over.style.left);
1892	var top = parseInt(over.style.top);
1893	var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
1894	var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);
1895
1896	if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;
1897
1898	return false;
1899}
1900
1901
1902////////
1903// COMMAND FUNCTIONS
1904////////
1905
1906// Calls callme or the default function.
1907function opt_FUNCTION(callme) {
1908	o3_text = (callme ? (typeof callme=='string' ? (/.+\(.*\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function'));
1909
1910	return 0;
1911}
1912
1913// Handle hovering
1914function opt_NOCLOSE(unused) {
1915	if (!unused) o3_close = "";
1916
1917	if (olNs4) {
1918		over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
1919		over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } }
1920		over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); }
1921	} else {
1922		over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } }
1923	}
1924
1925	return 0;
1926}
1927
1928// Function to scan command line arguments for multiples
1929function opt_MULTIPLEARGS(i, args, parameter) {
1930  var k=i, re, pV, str='';
1931
1932  for(k=i; k<args.length; k++) {
1933		if(typeof args[k] == 'number' && args[k]>pmStart) break;
1934		str += args[k] + ',';
1935	}
1936	if (str) str = str.substring(0,--str.length);
1937
1938	k--;  // reduce by one so the for loop this is in works correctly
1939	pV=(olNs4 && /cellpad/i.test(parameter)) ? str.split(',')[0] : str;
1940	eval(parameter + '="' + pV + '"');
1941
1942	return k;
1943}
1944
1945// Remove &nbsp; in texts when done.
1946function nbspCleanup() {
1947	if (o3_wrap) {
1948		o3_text = o3_text.replace(/\&nbsp;/g, ' ');
1949		o3_cap = o3_cap.replace(/\&nbsp;/g, ' ');
1950	}
1951}
1952
1953// Escape embedded single quotes in text strings
1954function escSglQuote(str) {
1955  return str.toString().replace(/'/g,"\\'");
1956}
1957
1958// Onload handler for window onload event
1959function OLonLoad_handler(e) {
1960	var re = /\w+\(.*\)[;\s]+/g, olre = /overlib\(|nd\(|cClick\(/, fn, l, i;
1961
1962	if(!olLoaded) olLoaded=1;
1963
1964  // Remove it for Gecko based browsers
1965	if(window.removeEventListener && e.eventPhase == 3) window.removeEventListener("load",OLonLoad_handler,false);
1966	else if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick()
1967		window.detachEvent("onload",OLonLoad_handler);
1968		var fN = document.body.getAttribute('onload');
1969		if (fN) {
1970			fN=fN.toString().match(re);
1971			if (fN && fN.length) {
1972				for (i=0; i<fN.length; i++) {
1973					if (/anonymous/.test(fN[i])) continue;
1974					while((l=fN[i].search(/\)[;\s]+/)) != -1) {
1975						fn=fN[i].substring(0,l+1);
1976						fN[i] = fN[i].substring(l+2);
1977						if (olre.test(fn)) eval(fn);
1978					}
1979				}
1980			}
1981		}
1982	}
1983}
1984
1985// Wraps strings in Layer Generation Functions with the correct tags
1986//    endWrap true(if end tag) or false if start tag
1987//    fontSizeStr - font size string such as '1' or '10px'
1988//    whichString is being wrapped -- 'text', 'caption', or 'close'
1989function wrapStr(endWrap,fontSizeStr,whichString) {
1990	var fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\-a-z]+$/.test(fontSizeStr);
1991	fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
1992	if (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
1993	else {
1994		fontStr='o3_'+whichString+'font';
1995		fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';
1996		return (hasDims&&!olNs4) ? (isClose ? '<span style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';">' : '<div style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';">') : '<font face="'+eval(fontStr)+'" color="'+eval(fontColor)+'" size="'+(parseInt(fontSizeStr)>7 ? '7' : fontSizeStr)+'">';
1997	}
1998}
1999
2000// Quotes Multi word font names; needed for CSS Standards adherence in font-family
2001function quoteMultiNameFonts(theFont) {
2002	var v, pM=theFont.split(',');
2003	for (var i=0; i<pM.length; i++) {
2004		v=pM[i];
2005		v=v.replace(/^\s+/,'').replace(/\s+$/,'');
2006		if(/\s/.test(v) && !/['"]/.test(v)) {
2007			v="\'"+v+"\'";
2008			pM[i]=v;
2009		}
2010	}
2011	return pM.join();
2012}
2013
2014// dummy function which will be overridden
2015function isExclusive(args) {
2016	return false;
2017}
2018
2019// Sets cellpadding style string value
2020function setCellPadStr(parameter) {
2021	var Str='', j=0, ary = new Array(), top, bottom, left, right;
2022
2023	Str+='padding: ';
2024	ary=parameter.replace(/\s+/g,'').split(',');
2025
2026	switch(ary.length) {
2027		case 2:
2028			top=bottom=ary[j];
2029			left=right=ary[++j];
2030			break;
2031		case 3:
2032			top=ary[j];
2033			left=right=ary[++j];
2034			bottom=ary[++j];
2035			break;
2036		case 4:
2037			top=ary[j];
2038			right=ary[++j];
2039			bottom=ary[++j];
2040			left=ary[++j];
2041			break;
2042	}
2043
2044	Str+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');
2045
2046	return Str;
2047}
2048
2049// function will delay close by time milliseconds
2050function hideDelay(time) {
2051	if (time&&!o3_delay) {
2052		if (o3_timerid > 0) clearTimeout(o3_timerid);
2053
2054		o3_timerid=setTimeout("cClick()",(o3_timeout=time));
2055	}
2056}
2057
2058// Was originally in the placeLayer() routine; separated out for future ease
2059function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {
2060	var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount;
2061	var parsedWidth = parseInt(o3_width);
2062
2063	if (o3_fixx > -1 || o3_relx != null) {
2064		// Fixed position
2065		placeX=(o3_relx != null ? ( o3_relx < 0 ? winoffset +o3_relx+ iwidth - parsedWidth - widthFix : winoffset+o3_relx) : o3_fixx);
2066	} else {
2067		// If HAUTO, decide what to use.
2068		if (o3_hauto == 1) {
2069			if ((o3_x - winoffset) > (iwidth / 2)) {
2070				o3_hpos = LEFT;
2071			} else {
2072				o3_hpos = RIGHT;
2073			}
2074		}
2075
2076		// From mouse
2077		if (o3_hpos == CENTER) { // Center
2078			placeX = o3_x+o3_offsetx-(parsedWidth/2);
2079
2080			if (placeX < winoffset) placeX = winoffset;
2081		}
2082
2083		if (o3_hpos == RIGHT) { // Right
2084			placeX = o3_x+o3_offsetx;
2085
2086			if ((placeX+parsedWidth) > (winoffset+iwidth - widthFix)) {
2087				placeX = iwidth+winoffset - parsedWidth - widthFix;
2088				if (placeX < 0) placeX = 0;
2089			}
2090		}
2091		if (o3_hpos == LEFT) { // Left
2092			placeX = o3_x-o3_offsetx-parsedWidth-150;
2093			if (placeX < winoffset) placeX = winoffset;
2094		}
2095
2096		// Snapping!
2097		if (o3_snapx > 1) {
2098			var snapping = placeX % o3_snapx;
2099
2100			if (o3_hpos == LEFT) {
2101				placeX = placeX - (o3_snapx+snapping);
2102			} else {
2103				// CENTER and RIGHT
2104				placeX = placeX+(o3_snapx - snapping);
2105			}
2106
2107			if (placeX < winoffset) placeX = winoffset;
2108		}
2109	}
2110
2111	return placeX;
2112}
2113
2114// was originally in the placeLayer() routine; separated out for future ease
2115function verticalPlacement(browserHeight,verticalScrollAmount) {
2116	var placeY, iheight=browserHeight, scrolloffset=verticalScrollAmount;
2117	var parsedHeight=(o3_aboveheight ? parseInt(o3_aboveheight) : (olNs4 ? over.clip.height : over.offsetHeight));
2118
2119	if (o3_fixy > -1 || o3_rely != null) {
2120		// Fixed position
2121		placeY=(o3_rely != null ? (o3_rely < 0 ? scrolloffset+o3_rely+iheight - parsedHeight : scrolloffset+o3_rely) : o3_fixy);
2122	} else {
2123		// If VAUTO, decide what to use.
2124		if (o3_vauto == 1) {
2125			if ((o3_y - scrolloffset) > (iheight / 2) && o3_vpos == BELOW && (o3_y + parsedHeight + o3_offsety - (scrolloffset + iheight) > 0)) {
2126				o3_vpos = ABOVE;
2127			} else if (o3_vpos == ABOVE && (o3_y - (parsedHeight + o3_offsety) - scrolloffset < 0)) {
2128				o3_vpos = BELOW;
2129			}
2130		}
2131
2132		// From mouse
2133		if (o3_vpos == ABOVE) {
2134			if (o3_aboveheight == 0) o3_aboveheight = parsedHeight;
2135
2136			placeY = o3_y - (o3_aboveheight+o3_offsety);
2137			if (placeY < scrolloffset) placeY = scrolloffset;
2138		} else {
2139			// BELOW
2140			placeY = o3_y+o3_offsety;
2141		}
2142
2143		// Snapping!
2144		if (o3_snapy > 1) {
2145			var snapping = placeY % o3_snapy;
2146
2147			if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
2148				placeY = placeY - (o3_snapy+snapping);
2149			} else {
2150				placeY = placeY+(o3_snapy - snapping);
2151			}
2152
2153			if (placeY < scrolloffset) placeY = scrolloffset;
2154		}
2155	}
2156
2157	return placeY;
2158}
2159
2160// checks positioning flags
2161function checkPositionFlags() {
2162	if (olHautoFlag) olHautoFlag = o3_hauto=0;
2163	if (olVautoFlag) olVautoFlag = o3_vauto=0;
2164	return true;
2165}
2166
2167// get Browser window width
2168function windowWidth() {
2169	var w;
2170	if (o3_frame.innerWidth) w=o3_frame.innerWidth;
2171	else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientWidth=='number'")&&eval('o3_frame.'+docRoot+'.clientWidth'))
2172		w=eval('o3_frame.'+docRoot+'.clientWidth');
2173	return w;
2174}
2175
2176// create the div container for popup content if it doesn't exist
2177function createDivContainer(id,frm,zValue) {
2178	id = (id || 'overDiv'), frm = (frm || o3_frame), zValue = (zValue || 500);
2179	var objRef, divContainer = layerReference(id);
2180
2181	if (divContainer == null) {
2182		if (olNs4) {
2183			divContainer = frm.document.layers[id] = new Layer(window.innerWidth, frm);
2184			objRef = divContainer;
2185		} else {
2186			var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]);
2187			if (olIe4&&!document.getElementById) {
2188				body.insertAdjacentHTML("beforeEnd",'<div id="'+id+'"></div>');
2189				divContainer=layerReference(id);
2190			} else {
2191				divContainer = frm.document.createElement("DIV");
2192				divContainer.id = id;
2193				body.appendChild(divContainer);
2194			}
2195			objRef = divContainer.style;
2196		}
2197
2198		//objRef.marginLeft = '170px';
2199		objRef.position = 'absolute';
2200		objRef.visibility = 'hidden';
2201		objRef.zIndex = zValue;
2202		if (olIe4&&!olOp) objRef.left = objRef.top = '0px';
2203		else objRef.left = objRef.top =  -10000 + (!olNs4 ? 'px' : 0);
2204	}
2205
2206	var id_name = document.getElementById('overDiv');
2207	id_name.setAttribute("onclick","return nd();");
2208	//id_name.setAttribute("onmouseout","setTimeout('nd();', 1000);");
2209
2210	return divContainer;
2211}
2212
2213// get reference to a layer with ID=id
2214function layerReference(id) {
2215	return (olNs4 ? o3_frame.document.layers[id] : (document.all ? o3_frame.document.all[id] : o3_frame.document.getElementById(id)));
2216}
2217////////
2218//  UTILITY FUNCTIONS
2219////////
2220
2221// Checks if something is a function.
2222function isFunction(fnRef) {
2223	var rtn = true;
2224
2225	if (typeof fnRef == 'object') {
2226		for (var i = 0; i < fnRef.length; i++) {
2227			if (typeof fnRef[i]=='function') continue;
2228			rtn = false;
2229			break;
2230		}
2231	} else if (typeof fnRef != 'function') {
2232		rtn = false;
2233	}
2234
2235	return rtn;
2236}
2237
2238// Converts an array into an argument string for use in eval.
2239function argToString(array, strtInd, argName) {
2240	var jS = strtInd, aS = '', ar = array;
2241	argName=(argName ? argName : 'ar');
2242
2243	if (ar.length > jS) {
2244		for (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], ';
2245		aS = aS.substring(0, aS.length-2);
2246	}
2247
2248	return aS;
2249}
2250
2251// Places a hook in the correct position in a hook point.
2252function reOrder(hookPt, fnRef, order) {
2253	var newPt = new Array(), match, i, j;
2254
2255	if (!order || typeof order == 'undefined' || typeof order == 'number') return hookPt;
2256
2257	if (typeof order=='function') {
2258		if (typeof fnRef=='object') {
2259			newPt = newPt.concat(fnRef);
2260		} else {
2261			newPt[newPt.length++]=fnRef;
2262		}
2263
2264		for (i = 0; i < hookPt.length; i++) {
2265			match = false;
2266			if (typeof fnRef == 'function' && hookPt[i] == fnRef) {
2267				continue;
2268			} else {
2269				for(j = 0; j < fnRef.length; j++) if (hookPt[i] == fnRef[j]) {
2270					match = true;
2271					break;
2272				}
2273			}
2274			if (!match) newPt[newPt.length++] = hookPt[i];
2275		}
2276
2277		newPt[newPt.length++] = order;
2278
2279	} else if (typeof order == 'object') {
2280		if (typeof fnRef == 'object') {
2281			newPt = newPt.concat(fnRef);
2282		} else {
2283			newPt[newPt.length++] = fnRef;
2284		}
2285
2286		for (j = 0; j < hookPt.length; j++) {
2287			match = false;
2288			if (typeof fnRef == 'function' && hookPt[j] == fnRef) {
2289				continue;
2290			} else {
2291				for (i = 0; i < fnRef.length; i++) if (hookPt[j] == fnRef[i]) {
2292					match = true;
2293					break;
2294				}
2295			}
2296			if (!match) newPt[newPt.length++]=hookPt[j];
2297		}
2298
2299		for (i = 0; i < newPt.length; i++) hookPt[i] = newPt[i];
2300		newPt.length = 0;
2301
2302		for (j = 0; j < hookPt.length; j++) {
2303			match = false;
2304			for (i = 0; i < order.length; i++) {
2305				if (hookPt[j] == order[i]) {
2306					match = true;
2307					break;
2308				}
2309			}
2310			if (!match) newPt[newPt.length++] = hookPt[j];
2311		}
2312		newPt = newPt.concat(order);
2313	}
2314
2315	hookPt = newPt;
2316
2317	return hookPt;
2318}
2319
2320////////
2321//  PLUGIN ACTIVATION FUNCTIONS
2322////////
2323
2324// Runs plugin functions to set runtime variables.
2325function setRunTimeVariables(){
2326	if (typeof runTime != 'undefined' && runTime.length) {
2327		for (var k = 0; k < runTime.length; k++) {
2328			runTime[k]();
2329		}
2330	}
2331}
2332
2333// Runs plugin functions to parse commands.
2334function parseCmdLine(pf, i, args) {
2335	if (typeof cmdLine != 'undefined' && cmdLine.length) {
2336		for (var k = 0; k < cmdLine.length; k++) {
2337			var j = cmdLine[k](pf, i, args);
2338			if (j >- 1) {
2339				i = j;
2340				break;
2341			}
2342		}
2343	}
2344
2345	return i;
2346}
2347
2348// Runs plugin functions to do things after parse.
2349function postParseChecks(pf,args){
2350	if (typeof postParse != 'undefined' && postParse.length) {
2351		for (var k = 0; k < postParse.length; k++) {
2352			if (postParse[k](pf,args)) continue;
2353			return false;  // end now since have an error
2354		}
2355	}
2356	return true;
2357}
2358
2359
2360////////
2361//  PLUGIN REGISTRATION FUNCTIONS
2362////////
2363
2364// Registers commands and creates constants.
2365function registerCommands(cmdStr) {
2366	if (typeof cmdStr!='string') return;
2367
2368	var pM = cmdStr.split(',');
2369	pms = pms.concat(pM);
2370
2371	for (var i = 0; i< pM.length; i++) {
2372		eval(pM[i].toUpperCase()+'='+pmCount++);
2373	}
2374}
2375
2376// Registers no-parameter commands
2377function registerNoParameterCommands(cmdStr) {
2378	if (!cmdStr && typeof cmdStr != 'string') return;
2379	pmt=(!pmt) ? cmdStr : pmt + ',' + cmdStr;
2380}
2381
2382// Register a function to hook at a certain point.
2383function registerHook(fnHookTo, fnRef, hookType, optPm) {
2384	var hookPt, last = typeof optPm;
2385
2386	if (fnHookTo == 'plgIn'||fnHookTo == 'postParse') return;
2387	if (typeof hookPts[fnHookTo] == 'undefined') hookPts[fnHookTo] = new FunctionReference();
2388
2389	hookPt = hookPts[fnHookTo];
2390
2391	if (hookType != null) {
2392		if (hookType == FREPLACE) {
2393			hookPt.ovload = fnRef;  // replace normal overlib routine
2394			if (fnHookTo.indexOf('ol_content_') > -1) hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef;
2395
2396		} else if (hookType == FBEFORE || hookType == FAFTER) {
2397			var hookPt=(hookType == 1 ? hookPt.before : hookPt.after);
2398
2399			if (typeof fnRef == 'object') {
2400				hookPt = hookPt.concat(fnRef);
2401			} else {
2402				hookPt[hookPt.length++] = fnRef;
2403			}
2404
2405			if (optPm) hookPt = reOrder(hookPt, fnRef, optPm);
2406
2407		} else if (hookType == FALTERNATE) {
2408			if (last=='number') hookPt.alt[pms[optPm-1-pmStart]] = fnRef;
2409		} else if (hookType == FCHAIN) {
2410			hookPt = hookPt.chain;
2411			if (typeof fnRef=='object') hookPt=hookPt.concat(fnRef); // add other functions
2412			else hookPt[hookPt.length++]=fnRef;
2413		}
2414
2415		return;
2416	}
2417}
2418
2419// Register a function that will set runtime variables.
2420function registerRunTimeFunction(fn) {
2421	if (isFunction(fn)) {
2422		if (typeof fn == 'object') {
2423			runTime = runTime.concat(fn);
2424		} else {
2425			runTime[runTime.length++] = fn;
2426		}
2427	}
2428}
2429
2430// Register a function that will handle command parsing.
2431function registerCmdLineFunction(fn){
2432	if (isFunction(fn)) {
2433		if (typeof fn == 'object') {
2434			cmdLine = cmdLine.concat(fn);
2435		} else {
2436			cmdLine[cmdLine.length++] = fn;
2437		}
2438	}
2439}
2440
2441// Register a function that does things after command parsing.
2442function registerPostParseFunction(fn){
2443	if (isFunction(fn)) {
2444		if (typeof fn == 'object') {
2445			postParse = postParse.concat(fn);
2446		} else {
2447			postParse[postParse.length++] = fn;
2448		}
2449	}
2450}
2451
2452////////
2453//  PLUGIN REGISTRATION FUNCTIONS
2454////////
2455
2456// Runs any hooks registered.
2457function runHook(fnHookTo, hookType) {
2458	var l = hookPts[fnHookTo], k, rtnVal = null, optPm, arS, ar = runHook.arguments;
2459
2460	if (hookType == FREPLACE) {
2461		arS = argToString(ar, 2);
2462
2463		if (typeof l == 'undefined' || !(l = l.ovload)) rtnVal = eval(fnHookTo+'('+arS+')');
2464		else rtnVal = eval('l('+arS+')');
2465
2466	} else if (hookType == FBEFORE || hookType == FAFTER) {
2467		if (typeof l != 'undefined') {
2468			l=(hookType == 1 ? l.before : l.after);
2469
2470			if (l.length) {
2471				arS = argToString(ar, 2);
2472				for (var k = 0; k < l.length; k++) eval('l[k]('+arS+')');
2473			}
2474		}
2475	} else if (hookType == FALTERNATE) {
2476		optPm = ar[2];
2477		arS = argToString(ar, 3);
2478
2479		if (typeof l == 'undefined' || (l = l.alt[pms[optPm-1-pmStart]]) == 'undefined') {
2480			rtnVal = eval(fnHookTo+'('+arS+')');
2481		} else {
2482			rtnVal = eval('l('+arS+')');
2483		}
2484	} else if (hookType == FCHAIN) {
2485		arS=argToString(ar,2);
2486		l=l.chain;
2487
2488		for (k=l.length; k > 0; k--) if((rtnVal=eval('l[k-1]('+arS+')'))!=void(0)) break;
2489	}
2490
2491	return rtnVal;
2492}
2493
2494////////
2495// OBJECT CONSTRUCTORS
2496////////
2497
2498// Object for handling hooks.
2499function FunctionReference() {
2500	this.ovload = null;
2501	this.before = new Array();
2502	this.after = new Array();
2503	this.alt = new Array();
2504	this.chain = new Array();
2505}
2506
2507// Object for simple access to the overLIB version used.
2508// Examples: simpleversion:351 major:3 minor:5 revision:1
2509function Info(version, prerelease) {
2510	this.version = version;
2511	this.prerelease = prerelease;
2512
2513	this.simpleversion = Math.round(this.version*100);
2514	this.major = parseInt(this.simpleversion / 100);
2515	this.minor = parseInt(this.simpleversion / 10) - this.major * 10;
2516	this.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10;
2517	this.meets = meets;
2518}
2519
2520// checks for Core Version required
2521function meets(reqdVersion) {
2522	return (!reqdVersion) ? false : this.simpleversion >= Math.round(100*parseFloat(reqdVersion));
2523}
2524
2525
2526////////
2527// STANDARD REGISTRATIONS
2528////////
2529registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSOFF);
2530registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF);
2531registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF);
2532registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS);
2533registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS);
2534registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS);
2535registerPostParseFunction(checkPositionFlags);
2536registerHook("hideObject", nbspCleanup, FAFTER);
2537registerHook("horizontalPlacement", horizontalPlacement, FCHAIN);
2538registerHook("verticalPlacement", verticalPlacement, FCHAIN);
2539if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1;
2540registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode');
2541///////
2542// ESTABLISH MOUSECAPTURING
2543///////
2544
2545// Capture events, alt. diffuses the overlib function.
2546var olCheckMouseCapture=true;
2547if ((olNs4 || olNs6 || olIe4)) {
2548	olMouseCapture();
2549} else {
2550	overlib = no_overlib;
2551	nd = no_overlib;
2552	ver3fix = true;
2553}
2554
2555// ---------- Viz add common string check for password 2015.09 start--------
2556function check_common_string(pwd, flag){
2557	//Sequential
2558	var termAlphas = "abcdefghijklmnopqrstuvwxyz";
2559	var termNumerics = "01234567890";
2560	var termSymbols = "~!@#$%^&*()_+";
2561	var termKeyboards1 = "qwertyuiop";
2562	var termKeyboards2 = "asdfghjkl";
2563	var termKeyboards3 = "zxcvbnm";
2564	var termCommon5 = ["123123","abc123","letmein","master","qazwsx","admin"];
2565	var termCommon8 = ["adminpassword","loginpassword","passw0rd","password","useradmin","userpassword"];
2566	var nSeqString = 0;
2567	if(flag == "httpd_password"){	//at lease length 5
2568		if(termAlphas.toLowerCase().indexOf(pwd) != -1 || termAlphas.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2569		if(termNumerics.toLowerCase().indexOf(pwd) != -1 || termNumerics.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2570		if(termSymbols.toLowerCase().indexOf(pwd) != -1 || termSymbols.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2571		if(termKeyboards1.toLowerCase().indexOf(pwd) != -1 || termKeyboards1.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2572		if(termKeyboards2.toLowerCase().indexOf(pwd) != -1 || termKeyboards2.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2573		if(termKeyboards3.toLowerCase().indexOf(pwd) != -1 || termKeyboards3.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2574		for(var s=0;s<termCommon5.length;s++){
2575			if(pwd == termCommon5[s])	{ nSeqString++; }
2576		}
2577		for(var t=0;t<termCommon8.length;t++){
2578			if(pwd == termCommon8[t])	{ nSeqString++; }
2579		}
2580	}
2581	else if(flag == "wpa_key"){	//at lease length 8
2582		if(termAlphas.toLowerCase().indexOf(pwd) != -1 || termAlphas.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2583		if(termNumerics.toLowerCase().indexOf(pwd) != -1 || termNumerics.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2584		if(termSymbols.toLowerCase().indexOf(pwd) != -1 || termSymbols.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2585		if(termKeyboards1.toLowerCase().indexOf(pwd) != -1 || termKeyboards1.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2586		if(termKeyboards2.toLowerCase().indexOf(pwd) != -1 || termKeyboards2.strReverse().toLowerCase().indexOf(pwd) != -1) { nSeqString++; }
2587		for(var s=0;s<termCommon8.length;s++){
2588			if(pwd == termCommon8[s])	{ nSeqString++; }
2589		}
2590	}
2591
2592	//pure repeat character string
2593	if(pwd == pwd.charAt(0).repeat(pwd.length)) { nSeqString++; }
2594
2595	if(nSeqString > 0)
2596		return true;
2597	else
2598		return false;
2599}
2600// ---------- Viz add common string check for password 2015.09 end--------
2601
2602// ---------- Viz add for pwd strength check [Start] 2012.12 -----
2603
2604function chkPass(pwd, flag) {
2605	var orig_pwd = "";
2606	var oScorebar = document.getElementById("scorebar");
2607	var oScore = document.getElementById("score");
2608
2609	// Simultaneous variable declaration and value assignment aren't supported in IE apparently
2610	// so I'm forced to assign the same value individually per var to support a crappy browser *sigh*
2611	var nScore=0, nLength=0, nAlphaUC=0, nAlphaLC=0, nNumber=0, nSymbol=0, nMidChar=0, nRequirements=0, nAlphasOnly=0, nNumbersOnly=0, nUnqChar=0, nRepChar=0, nRepInc=0, nConsecAlphaUC=0, nConsecAlphaLC=0, nConsecNumber=0, nConsecSymbol=0, nConsecCharType=0, nSeqAlpha=0, nSeqNumber=0, nSeqSymbol=0, nSeqChar=0, nReqChar=0, nMultConsecCharType=0;
2612	var nMultRepChar=1, nMultConsecSymbol=1;
2613	var nMultMidChar=2, nMultRequirements=2, nMultConsecAlphaUC=2, nMultConsecAlphaLC=2, nMultConsecNumber=2;
2614	var nReqCharType=3, nMultAlphaUC=3, nMultAlphaLC=3, nMultSeqAlpha=3, nMultSeqNumber=3, nMultSeqSymbol=3;
2615	var nMultLength=4, nMultNumber=4;
2616	var nMultSymbol=6;
2617	var nTmpAlphaUC="", nTmpAlphaLC="", nTmpNumber="", nTmpSymbol="";
2618	var sAlphaUC="0", sAlphaLC="0", sNumber="0", sSymbol="0", sMidChar="0", sRequirements="0", sAlphasOnly="0", sNumbersOnly="0", sRepChar="0", sConsecAlphaUC="0", sConsecAlphaLC="0", sConsecNumber="0", sSeqAlpha="0", sSeqNumber="0", sSeqSymbol="0";
2619	var sAlphas = "abcdefghijklmnopqrstuvwxyz";
2620	var sNumerics = "01234567890";
2621	var sSymbols = "~!@#$%^&*()_+";
2622	var sComplexity = "";
2623	var nMinPwdLen = 8;
2624	if (document.all) { var nd = 0; } else { var nd = 1; }
2625	if (pwd) {
2626		nScore = parseInt(pwd.length * nMultLength);
2627		nLength = pwd.length;
2628		var arrPwd = pwd.replace(/\s+/g,"").split(/\s*/);
2629		var arrPwdLen = arrPwd.length;
2630
2631		/* Main calculation for strength:
2632				Loop through password to check for Symbol, Numeric, Lowercase and Uppercase pattern matches */
2633		for (var a=0; a < arrPwdLen; a++) {
2634			if (arrPwd[a].match(/[A-Z]/g)) {
2635				if (nTmpAlphaUC !== "") { if ((nTmpAlphaUC + 1) == a) { nConsecAlphaUC++; nConsecCharType++; } }
2636				nTmpAlphaUC = a;
2637				nAlphaUC++;
2638			}
2639			else if (arrPwd[a].match(/[a-z]/g)) {
2640				if (nTmpAlphaLC !== "") { if ((nTmpAlphaLC + 1) == a) { nConsecAlphaLC++; nConsecCharType++; } }
2641				nTmpAlphaLC = a;
2642				nAlphaLC++;
2643			}
2644			else if (arrPwd[a].match(/[0-9]/g)) {
2645				if (a > 0 && a < (arrPwdLen - 1)) { nMidChar++; }
2646				if (nTmpNumber !== "") { if ((nTmpNumber + 1) == a) { nConsecNumber++; nConsecCharType++; } }
2647				nTmpNumber = a;
2648				nNumber++;
2649			}
2650			else if (arrPwd[a].match(/[^a-zA-Z0-9_]/g)) {
2651				if (a > 0 && a < (arrPwdLen - 1)) { nMidChar++; }
2652				if (nTmpSymbol !== "") { if ((nTmpSymbol + 1) == a) { nConsecSymbol++; nConsecCharType++; } }
2653				nTmpSymbol = a;
2654				nSymbol++;
2655			}
2656			/* Internal loop through password to check for repeat characters */
2657			var bCharExists = false;
2658			for (var b=0; b < arrPwdLen; b++) {
2659				if (arrPwd[a] == arrPwd[b] && a != b) { /* repeat character exists */
2660					bCharExists = true;
2661					/*
2662					Calculate icrement deduction based on proximity to identical characters
2663					Deduction is incremented each time a new match is discovered
2664					Deduction amount is based on total password length divided by the
2665					difference of distance between currently selected match
2666					*/
2667					nRepInc += Math.abs(arrPwdLen/(b-a));
2668				}
2669			}
2670			if (bCharExists) {
2671				nRepChar++;
2672				nUnqChar = arrPwdLen-nRepChar;
2673				nRepInc = (nUnqChar) ? Math.ceil(nRepInc/nUnqChar) : Math.ceil(nRepInc);
2674			}
2675		}
2676
2677		/* Check for sequential alpha string patterns (forward and reverse) */
2678		for (var s=0; s < 23; s++) {
2679			var sFwd = sAlphas.substring(s,parseInt(s+3));
2680			var sRev = sFwd.strReverse();
2681			if (pwd.toLowerCase().indexOf(sFwd) != -1 || pwd.toLowerCase().indexOf(sRev) != -1) { nSeqAlpha++; nSeqChar++;}
2682		}
2683
2684		/* Check for sequential numeric string patterns (forward and reverse) */
2685		for (var s=0; s < 8; s++) {
2686			var sFwd = sNumerics.substring(s,parseInt(s+3));
2687			var sRev = sFwd.strReverse();
2688			if (pwd.toLowerCase().indexOf(sFwd) != -1 || pwd.toLowerCase().indexOf(sRev) != -1) { nSeqNumber++; nSeqChar++;}
2689		}
2690
2691		/* Check for sequential symbol string patterns (forward and reverse) */
2692		for (var s=0; s < 8; s++) {
2693			var sFwd = sSymbols.substring(s,parseInt(s+3));
2694			var sRev = sFwd.strReverse();
2695			if (pwd.toLowerCase().indexOf(sFwd) != -1 || pwd.toLowerCase().indexOf(sRev) != -1) { nSeqSymbol++; nSeqChar++;}
2696		}
2697
2698	/* Modify overall score value based on usage vs requirements */
2699
2700		/* General point assignment */
2701		//document.getElementById("nLengthBonus").innerHTML = "+ " + nScore;
2702		if (nAlphaUC > 0 && nAlphaUC < nLength) {
2703			nScore = parseInt(nScore + ((nLength - nAlphaUC) * 2));
2704			sAlphaUC = "+ " + parseInt((nLength - nAlphaUC) * 2);
2705		}
2706		if (nAlphaLC > 0 && nAlphaLC < nLength) {
2707			nScore = parseInt(nScore + ((nLength - nAlphaLC) * 2));
2708			sAlphaLC = "+ " + parseInt((nLength - nAlphaLC) * 2);
2709		}
2710		if (nNumber > 0 && nNumber < nLength) {
2711			nScore = parseInt(nScore + (nNumber * nMultNumber));
2712			sNumber = "+ " + parseInt(nNumber * nMultNumber);
2713		}
2714		if (nSymbol > 0) {
2715			nScore = parseInt(nScore + (nSymbol * nMultSymbol));
2716			sSymbol = "+ " + parseInt(nSymbol * nMultSymbol);
2717		}
2718		if (nMidChar > 0) {
2719			nScore = parseInt(nScore + (nMidChar * nMultMidChar));
2720			sMidChar = "+ " + parseInt(nMidChar * nMultMidChar);
2721		}
2722		//document.getElementById("nAlphaUCBonus").innerHTML = sAlphaUC;
2723		//document.getElementById("nAlphaLCBonus").innerHTML = sAlphaLC;
2724		//document.getElementById("nNumberBonus").innerHTML = sNumber;
2725		//document.getElementById("nSymbolBonus").innerHTML = sSymbol;
2726		//document.getElementById("nMidCharBonus").innerHTML = sMidChar;
2727
2728		/* Point deductions for poor practices */
2729		if ((nAlphaLC > 0 || nAlphaUC > 0) && nSymbol === 0 && nNumber === 0) {  // Only Letters
2730			nScore = parseInt(nScore - nLength);
2731			nAlphasOnly = nLength;
2732			sAlphasOnly = "- " + nLength;
2733		}
2734		if (nAlphaLC === 0 && nAlphaUC === 0 && nSymbol === 0 && nNumber > 0) {  // Only Numbers
2735			nScore = parseInt(nScore - nLength);
2736			nNumbersOnly = nLength;
2737			sNumbersOnly = "- " + nLength;
2738		}
2739		if (nRepChar > 0) {  // Same character exists more than once
2740			nScore = parseInt(nScore - nRepInc);
2741			sRepChar = "- " + nRepInc;
2742		}
2743		if (nConsecAlphaUC > 0) {  // Consecutive Uppercase Letters exist
2744			nScore = parseInt(nScore - (nConsecAlphaUC * nMultConsecAlphaUC));
2745			sConsecAlphaUC = "- " + parseInt(nConsecAlphaUC * nMultConsecAlphaUC);
2746		}
2747		if (nConsecAlphaLC > 0) {  // Consecutive Lowercase Letters exist
2748			nScore = parseInt(nScore - (nConsecAlphaLC * nMultConsecAlphaLC));
2749			sConsecAlphaLC = "- " + parseInt(nConsecAlphaLC * nMultConsecAlphaLC);
2750		}
2751		if (nConsecNumber > 0) {  // Consecutive Numbers exist
2752			nScore = parseInt(nScore - (nConsecNumber * nMultConsecNumber));
2753			sConsecNumber = "- " + parseInt(nConsecNumber * nMultConsecNumber);
2754		}
2755		if (nSeqAlpha > 0) {  // Sequential alpha strings exist (3 characters or more)
2756			nScore = parseInt(nScore - (nSeqAlpha * nMultSeqAlpha));
2757			sSeqAlpha = "- " + parseInt(nSeqAlpha * nMultSeqAlpha);
2758		}
2759		if (nSeqNumber > 0) {  // Sequential numeric strings exist (3 characters or more)
2760			nScore = parseInt(nScore - (nSeqNumber * nMultSeqNumber));
2761			sSeqNumber = "- " + parseInt(nSeqNumber * nMultSeqNumber);
2762		}
2763		if (nSeqSymbol > 0) {  // Sequential symbol strings exist (3 characters or more)
2764			nScore = parseInt(nScore - (nSeqSymbol * nMultSeqSymbol));
2765			sSeqSymbol = "- " + parseInt(nSeqSymbol * nMultSeqSymbol);
2766		}
2767
2768		/* Determine complexity based on overall score */
2769		if (nScore > 100) { nScore = 100; } else if (nScore < 0) { nScore = 0; }
2770		if(document.form.current_page.value != "AiProtection_HomeProtection.asp"){
2771			if (nScore >= 0 && nScore < 20) { sComplexity = "<#PASS_score0#>"; }
2772			else if (nScore >= 20 && nScore < 40) { sComplexity = "<#PASS_score1#>"; }
2773			else if (nScore >= 40 && nScore < 60) { sComplexity = "<#PASS_score2#>"; }
2774			else if (nScore >= 60 && nScore < 80) { sComplexity = "<#PASS_score3#>"; }
2775			else if (nScore >= 80 && nScore <= 100) { sComplexity = "<#PASS_score4#>"; }
2776		}
2777		else{
2778			if (nScore >= 0 && nScore < 20) { sComplexity = "<a href='Advanced_Wireless_Content.asp' target='_blank'><#PASS_score0#></a>"; }
2779			else if (nScore >= 20 && nScore < 40) { sComplexity = "<a href='Advanced_Wireless_Content.asp' target='_blank'><#PASS_score1#></a>"; }
2780			else if (nScore >= 40 && nScore < 60) { sComplexity = "<a href='Advanced_Wireless_Content.asp' target='_blank'><#PASS_score2#></a>"; }
2781			else if (nScore >= 60 && nScore < 80) { sComplexity = "<a href='Advanced_Wireless_Content.asp' target='_blank'><#PASS_score3#></a>"; }
2782			else if (nScore >= 80 && nScore <= 100) { sComplexity = "<a href='Advanced_Wireless_Content.asp' target='_blank'><#PASS_score4#></a>"; }
2783		}
2784
2785		/* Display updated score criteria to client */
2786		if(document.form.current_page.value != "AiProtection_HomeProtection.asp"){		//for Router weakness status, Jimeing added at 2014/06/07
2787			document.getElementById('scorebarBorder').style.display = "";
2788			oScorebar.style.backgroundPosition = "-" + parseInt(nScore * 4) + "px";
2789		}
2790		else{
2791			if(nScore >= 0 && nScore < 40){
2792				document.getElementById('score').className = "status_no";
2793			}
2794			else if(nScore >= 40 && nScore <= 100){
2795				document.getElementById('score').className = "status_yes";
2796			}
2797		}
2798
2799		oScore.innerHTML = sComplexity;
2800	}
2801	else {
2802		/* Display default score criteria to client */
2803		if(flag == 'http_passwd'){
2804			chkPass(" ", 'http_passwd');
2805		}
2806	}
2807}
2808
2809String.prototype.strReverse = function() {
2810	var newstring = "";
2811	for (var s=0; s < this.length; s++) {
2812		newstring = this.charAt(s) + newstring;
2813	}
2814	return newstring;
2815	//strOrig = ' texttotrim ';
2816	//strReversed = strOrig.revstring();
2817};
2818
2819// ---------- Viz add for pwd strength check [End] 2012.12 -----
2820
2821function goToWAN(index){
2822	document.titleForm.wan_unit.value = index;
2823	if(index == usb_index){
2824		if(gobi_support)
2825			document.titleForm.current_page.value = "Advanced_MobileBroadband_Content.asp?af=pincode";
2826		else
2827			document.titleForm.current_page.value = "Advanced_Modem_Content.asp";
2828	}
2829	else if(index == dsl_index)
2830		document.titleForm.current_page.value = "Advanced_DSL_Content.asp";
2831	else
2832		document.titleForm.current_page.value = "Advanced_WAN_Content.asp";
2833	document.titleForm.action_mode.value = "change_wan_unit";
2834	document.titleForm.action = "apply.cgi";
2835	document.titleForm.target = "";
2836	document.titleForm.submit();
2837}
2838