var arr_wifi_devid = new Array("wifi_sta", "wifi_pro", "wifi_btn", "wifi_wps", "wifi_save"); var arr_wifi_dev_val = new Array("1", "0"); var arr_sw_wifi_opt = new Array("wifi_pro", "wifi_btn", "wifi_wps"); var arr_wifi_opt = new Array(obj_sb_tle.manual, obj_sb_tle.wps); var arr_wifi_opt_val = new Array("0", "1"); var max_profile = 3; var wl_enable = 0; var wps_pin = "69457135"; var frz_wifi = false; if(isHebrew == "1") { var arr_wifi_dev = new Array(obj_sb_tle.off,obj_sb_tle.on); } else { var arr_wifi_dev = new Array(obj_sb_tle.on,obj_sb_tle.off); } function fn_wifi_init() { var wifi_form = document.frm_wifi; fn_onload(); if(parseInt(wl_enable)) { wifi_form.ra_wireless_device[0].checked = true; wifi_form.bt_site_survey.disabled = false; }else{ wifi_form.ra_wireless_device[1].checked = true; } fn_sw_wifi_item(wifi_form); top.frames[3].fn_prs_ntv_wifi_data(); if(top.frames[3].arr_pro_fld.length >= max_profile){wifi_form.bt_add_profile.disabled = true;} frz_wifi = fn_is_readonly(obj_page.wifi); } function fn_sw_wifi_item(AG_form) { var obj_div_id; var i; var wifi_dev = parseInt(AG_form.sl_wl_option.selectedIndex); for(i = 0; i < arr_wifi_devid.length; i++) { obj_div_id = document.getElementById(arr_wifi_devid[i]); if(obj_div_id == null) { alert("error on fn_show_wl_items"); return; } switch(wifi_dev) { case 0: arr_wifi_devid[i] != "wifi_wps" ? obj_div_id.style.display = "block" : obj_div_id.style.display = "none"; break; case 1: arr_wifi_devid[i] == "wifi_wps" ? obj_div_id.style.display = "block" : obj_div_id.style.display = "none"; break; } } } function fn_sw_new_wifi_pg(AG_page, AG_flag, AG_security) { var dest_form = top.document.getElementById("load_webpage").contentWindow.document.frm_wifi_pro; var wifi_proname = ""; var wifi_ssid = ""; var sec_ind = AG_security; dest_form.hdn_flag_add_new.value = parseInt(AG_flag); if(parseInt(dest_form.hdn_rec_index.value) != -1){dest_form.hdn_rec_index.value = -1;} fn_sw_wifi_pop_pg(AG_page); fn_set_wifi_pro_bsc(dest_form, wifi_proname, wifi_ssid, sec_ind); dest_form.hdn_valid.value = 4; } function fn_sw_site_srvy_pg(AG_flag) { var i; var arr_enable_disable_page_1 = new Array("div_disable_page", "div_enable_page_1"); var obj_div = top.document.getElementById("load_webpage_1"); if(obj_div == null) { alert("error: fn_sw_site_srvy_pg"); return; } for(i = 0; i < arr_enable_disable_page_1.length; i++) { obj_div = top.document.getElementById(arr_enable_disable_page_1[i]); if(obj_div == null) { alert("error: fn_sw_site_srvy_pg"); return; } if(obj_div.style.display == "none") { obj_div.style.display = "block"; if( (i == 0) && (AG_flag != "Cancel_add_entry") ) { top.document.getElementById("load_webpage_1").contentWindow.fn_count_down(); } }else if(AG_flag == "Add_list"){ obj_div.style.display = "none"; } else{ parent.window.location.href = obj_page.site_scan; obj_div.style.display = "none"; } } } function fn_rm_wifi_pro(AG_form, AG_smtform) { var profile_length = top.frames[3].arr_old_wifi_pro.length; var i; var obj_chkbox; var counter = 0; AG_smtform.hdn_submit_page.value = obj_page.wifi; AG_smtform.hdn_reply_page.value = obj_page.wifi; AG_smtform.hdn_wl_device.value = (AG_form.ra_wireless_device[0].checked) ? AG_form.ra_wireless_device[0].value : AG_form.ra_wireless_device[1].value; AG_smtform.hdn_wl_profiles.value = ""; AG_smtform.hdn_rm_wl_profiles.value = ""; if(top.frames[3].document.frm_wifi_pro_list.chk_sel_wifi_pro_all.checked && fn_chk_locked_pro()) { if(!confirm(errmsg.err84)) { return; } for(i = 0; i < profile_length; i++) { if(i == (profile_length - 1)) { AG_smtform.hdn_rm_wl_profiles.value = AG_smtform.hdn_rm_wl_profiles.value + top.frames[3].arr_old_wifi_pro[i].KEY; }else{ AG_smtform.hdn_rm_wl_profiles.value = AG_smtform.hdn_rm_wl_profiles.value + top.frames[3].arr_old_wifi_pro[i].KEY + smt_sep_ptn; } } }else{ for(i = 0; i < profile_length; i++) { eval("obj_chkbox = top.frames[3].document.getElementById(\"chk_sel_wifi_pro" + i + "\")"); if(obj_chkbox.checked) { counter++; AG_smtform.hdn_rm_wl_profiles.value = AG_smtform.hdn_rm_wl_profiles.value + top.frames[3].arr_old_wifi_pro[i].KEY + smt_sep_ptn;; } } if(counter) { if(!confirm(errmsg.err91)){return;} AG_smtform.hdn_rm_wl_profiles.value = AG_smtform.hdn_rm_wl_profiles.value.slice(0, AG_smtform.hdn_rm_wl_profiles.value.lastIndexOf(smt_sep_ptn)); }else{ alert(errmsg.err57); return; } } AG_smtform.submit(); } function fn_smt_wifi(AG_form, AG_smtform) { var profile_length = top.frames[3].arr_old_wifi_pro.length; var i; AG_smtform.hdn_submit_page.value = obj_page.wifi; AG_smtform.hdn_reply_page.value = obj_page.wifi; AG_smtform.hdn_wl_device.value = (AG_form.ra_wireless_device[0].checked) ? AG_form.ra_wireless_device[0].value : AG_form.ra_wireless_device[1].value; switch(parseInt(profile_length)) { case 0: AG_smtform.hdn_wl_profiles.value = ""; break; case 1: AG_smtform.hdn_wl_profiles.value = top.frames[3].arr_old_wifi_pro[0].KEY; break; default: AG_smtform.hdn_wl_profiles.value = ""; for(i = 0; i < profile_length; i++) { if(i == (profile_length - 1)) { AG_smtform.hdn_wl_profiles.value = AG_smtform.hdn_wl_profiles.value + top.frames[3].arr_old_wifi_pro[i].KEY; }else{ AG_smtform.hdn_wl_profiles.value = AG_smtform.hdn_wl_profiles.value + top.frames[3].arr_old_wifi_pro[i].KEY + smt_sep_ptn; } } } AG_smtform.submit(); } function fn_cancel_wifi(ARGV_page) { window.location.href = ARGV_page; } function fn_sw_wifi_pop_pg(AG_pgname) { var obj_div = top.document.getElementById("load_webpage"); if(obj_div == null) { alert("error: fn_sw_wifi_pop_pg"); return; } for(i = 0; i < arr_endis_pg.length; i++) { obj_div = top.document.getElementById(arr_endis_pg[i]); if(obj_div == null) { alert("error: fn_sw_wifi_pop_pg"); return; } if(obj_div.style.display == "none"){obj_div.style.display = "block";}else{obj_div.style.display = "none";} } } function fn_set_wifi_pro_bsc(AG_form, AG_wifi_proname, AG_wifi_ssid, AG_sec_ind) { AG_form.txt_wl_profile_name.value = AG_wifi_proname; AG_form.txt_wl_ssid.value = AG_wifi_ssid; fn_cln_all_sec_fld(AG_form); AG_form.sl_wl_security.selectedIndex = parseInt(AG_sec_ind); fn_sw_sec_opt(AG_form); } function fn_cln_all_sec_fld(AG_form) { var i; for(i = 0; i < AG_form.length; i++) { AG_form.elements[i].disabled = false; } AG_form.ra_wep_tx_key[0].checked = true; AG_form.sl_wep_encrypt.selectedIndex = 0; fn_chg_maxchar(AG_form, "txt_wep_key", 4); AG_form.sl_wpa_psk.selectedIndex = 0; AG_form.txt_wpa_psk.value = ""; AG_form.sl_eap_type.selectedIndex = 0; fn_sw_eap_opt(AG_form); AG_form.txt_wpa_user_id.value = ""; AG_form.txt_wpa_user_pwd.value = ""; AG_form.ra_wap_chk_server_certify[0].checked = true; AG_form.txt_wpa_anonymous_id.value = ""; AG_form.sl_wpa_ttls_inner.selectedIndex = 0; AG_form.txt_wpa_priv_pwd.value = ""; } function fn_sw_wifi_opt(AG_form) { var obj_div; var j; for(i = 0; i < arr_sw_wifi_opt.length; i++) { obj_div = document.getElementById(arr_sw_wifi_opt[i]); if(obj_div == null) { alert("error: fn_sw_wifi_opt"); return; } obj_div.style.display = "none"; } switch(parseInt(AG_form.sl_wl_option.selectedIndex)) { case 0: for(j = 0; j <= 1; j++) { document.getElementById(arr_sw_wifi_opt[j]).style.display = "block"; } document.getElementById("td_submit").innerHTML = fn_sw_smt_btn1("fn_smt_wifi(document.frm_wifi, document.frm_hidden_wireless)"); document.getElementById("td_cancel").innerHTML = fn_sw_cnl_btn1("fn_cancel_wifi(obj_page.wifi)"); if(frz_wifi) { AG_form.bt_submit.disabled = true; AG_form.bt_cancel.disabled = true; } break; case 1: document.getElementById(arr_sw_wifi_opt[2]).style.display = "block"; document.getElementById("td_submit").innerHTML = ""; document.getElementById("td_cancel").innerHTML = ""; document.getElementById("td_submit").height = "30"; break; } } function fn_sw_wps_txt(AG_txt, AG_flg) { document.write("