/* GC0 remove
function show_s_eventdi1(){
var obj1 = document.getElementById("s_eventdi-1");
var span_str = "<select id='s_Nevent_di-1' xonchange=''>";
span_str += "<option value='On--%3E%20Off'>On--> Off</option>"
span_str += "<option value='Off--%3E%20On'>Off--> On</option>"
span_str += "</select>"
obj1.innerHTML = span_str;
}
show_s_eventdi1()
function show_s_eventdi2(){
var obj2 = document.getElementById("s_eventdi-2");
var span_str = "<select id='s_Nevent_di-2' xonchange=''>";
span_str += "<option value='On--%3E%20Off'>On--> Off</option>"
span_str += "<option value='Off--%3E%20On'>Off--> On</option>"
span_str += "</select>"
obj2.innerHTML = span_str;
}
show_s_eventdi2()
*/
function show_s_eventdigitalinput(){
var xml_di_pro = "di_profile.xml";
var t=new Date()
var xmlurl=xml_di_pro+"?ZT="+t.getTime();
$.ajax({
url:xmlurl,
type:"GET",
dataType:"xml",
error:function(){
},
success:function(xml){
var xmlDoc=xml;
var obj1 = document.getElementById("s_eventdigitalinput");
var span_str = "<select id='s_Nevent_digitalinput' xonchange=''>";
diprofile_name_arr = [];      //DI Profile Name
diprofile_enable_arr = [];    //Enable
for(var x=0;x<10;x++)
{
diprofile_rule_index = xmlDoc.getElementsByTagName("diprofile_rule_index")[x].childNodes[0];
if(diprofile_rule_index != null)
{
index = parseInt(diprofile_rule_index.nodeValue);
xml_index = (index-1);
diprofile_name = xml_getvalue(xmlDoc,"diprofile_name",xml_index);
diprofile_enable = xml_getvalue(xmlDoc,"diprofile_enable",xml_index);
var enable_check = (diprofile_enable == 1);
if(enable_check){ span_str += "<option value="+xml_index+">"+diprofile_name+"</option>" }
}
}
span_str += "</select>"
if(span_str.indexOf("<option") != -1){ obj1.innerHTML = span_str; }
}
});
}
show_s_eventdigitalinput()
function show_s_eventwan(){
var obj1 = document.getElementById("s_eventwan");
var arrw = Interfc_info(1)  //arrw[0] = Wan1 ; arrw[1] = Wan2 ;arrw[2] = Wan3 ;
var span_str = "<select id='s_Nevent_wan' xonchange=''>";
for(o=0;o<arrw.length;o++){
span_str += "<option value='WAN-"+(o+1)+"%20Physical%20Link%20Up'>WAN-"+(o+1)+" Physical Link Up</option>"
span_str += "<option value='WAN-"+(o+1)+"%20Physical%20Link%20Down'>WAN-"+(o+1)+" Physical Link Down</option>"
}
span_str += "<option value='Dial-up%20Fail%205%20Times'>Dial-up Fail 5 Times</option>"
span_str += "<option value='WAN%20Interface%20Failover'>WAN Interface Failover</option>"
var devicN = (("_"=="0_0")||("_"=="_"))?1:2;
var str1 ="";
var lte_ary = new Array(
"1_1","1_1",
"0_1",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"0_0",
"")
for(var s=0;s<devicN;s++){
span_str += "<option value='Module-"+(s+1)+"%20SIM%20Switching'>Module-"+(s+1)+" SIM Switching</option>"
}
span_str += "</select>"
obj1.innerHTML = span_str;
}
show_s_eventwan()
function show_s_eventlanvlan(){
var obj1 = document.getElementById("s_eventlanvlan");
var lanx = 4 ;
var lan_mip = 4; //support most 4 DHCP servers now, DHCP 1~4 (1 DHCP server + 3 VLAN Server)
var span_str = "<select id='s_Nevent_lanvlan' xonchange=''>";
for(q = 0 ; q < lan_mip ; q++){
span_str += "<option value='LAN-"+(q+1)+"%20IP%20Address%20be%20Changed'>LAN-"+(q+1)+" IP Address be Changed</option>"
}
for(s = port_startN ; s < port_countN ; s++){
if(wanfixN==0 && wanableN==0 && have_adslN==1 && s==1){ s=s+1; }
var _s = get_portnumberN(s)
span_str += "<option value='Port-"+_s+"%20Link%20Up'>Port-"+_s+" Link Up</option>"
span_str += "<option value='Port-"+_s+"%20Link%20Down'>Port-"+_s+" Link Down</option>"
}
span_str += "</select>"
obj1.innerHTML = span_str;
}
show_s_eventlanvlan()
function show_s_eventwifi2(){
var obj1 = document.getElementById("s_eventwifi");
var allwifi = false ;
var sw5g = false , sw2_4g = false ;
var span_str = "<select id='s_Nevent_wifi' xonchange=''>";
if(((4 != 0)&&(0 == 0))||((24 != 0)&&(1 == 0))){
sw2_4g = true ;   // Display WiFi 2.4G item
}
if(((4 != 0)&&(0 == 1))||((24 != 0)&&(1 == 1))){
sw5g = true ;   // Display WiFi 5G item
}
if(allwifi || sw2_4g){
span_str += "<option value='2.4G%20WiFi%20Module%20Up'>2.4G WiFi Module Up</option>"
span_str += "<option value='2.4G%20WiFi%20Module%20Down'>2.4G WiFi Module Down</option>"
}
if(allwifi || sw5g){
span_str += "<option value='5G%20WiFi%20Module%20Up'>5G WiFi Module Up</option>"
span_str += "<option value='5G%20WiFi%20Module%20Down'>5G WiFi Module Down</option>"
}
if(allwifi || sw2_4g){
span_str += "<option value='2.4G%20WiFi%20Operation%20Mode%20Changed'>2.4G WiFi Operation Mode Changed</option>"
}
if(allwifi || sw5g){
span_str += "<option value='5G%20WiFi%20Operation%20Mode%20Changed'>5G WiFi Operation Mode Changed</option>"
}
if(allwifi || sw2_4g){
span_str += "<option value='2.4G%20WiFi%20Channel%20Changed'>2.4G WiFi Channel Changed</option>"
}
if(allwifi || sw5g){
span_str += "<option value='5G%20WiFi%20Channel%20Changed'>5G WiFi Channel Changed</option>"
}
span_str += "</select>"
obj1.innerHTML = span_str;
}
show_s_eventwifi2()
var isddns = true ;/* GC0 always show */
function show_s_eventddns(){
var obj1 = document.getElementById("s_eventddns");
var span_str = "<select id='s_Nevent_ddns' xonchange=''>";
span_str += "<option value='DDNS%20Update%20Fail'>DDNS Update Fail</option>"
span_str += "</select>"
obj1.innerHTML = span_str;
}
if(isddns){ show_s_eventddns() }
var isadminis = true ;/* GC0 always show */
function show_s_eventadministration(){
var obj1 = document.getElementById("s_eventadministration");
var span_str = "<select id='s_Nevent_administration' xonchange=''>";
span_str += "<option value='Login%20Fail%20by%20Web'>Login Fail by Web</option>"
span_str += "<option value='Login%20Fail%20by%20Telnet'>Login Fail by Telnet</option>"
span_str += "<option value='Login%20Fail%20by%20SSH'>Login Fail by SSH</option>"
span_str += "<option value='Login%20Fail%20by%20Console'>Login Fail by Console</option>"
span_str += "<option value='System%20Password%20Changed'>System Password Changed</option>"
span_str += "<option value='FW%20Upgrade%20is%20under%20processing'>FW Upgrade is under processing</option>"
span_str += "</select>"
obj1.innerHTML = span_str
}
if(isadminis){ show_s_eventadministration() }
function show_s_eventDataUsage(){
var devicN = (("_"=="0_0")||("_"=="_"))?1:2;
var obj1 = document.getElementById("s_eventdatausage");
var span_str = "<select id='s_Nevent_datausage' xonchange=''>";
var str1 ="<input type='text' id='t_Nevent_datausage' onkeyup=\"chkN(this,'c','1-100')\" maxlength=3> % (1 ~ 100)"
if(devicN == 1){
span_str += "<option value=0>3G/4G-1 SIM-A</option>"
span_str += "<option value=1>3G/4G-1 SIM-B</option>"
}
else {
span_str += "<option value=0>3G/4G-1 SIM-A</option>"
span_str += "<option value=1>3G/4G-1 SIM-B</option>"
span_str += "<option value=2>3G/4G-2 SIM-A</option>"
span_str += "<option value=3>3G/4G-2 SIM-B</option>"
}
span_str += "</select>"
obj1.innerHTML = span_str+str1;
}
show_s_eventDataUsage()
function show_s_Nhanlderdigitaloutput(){
var xml_do_pro = "do_profile.xml";
var t=new Date()
var xmlurl=xml_do_pro+"?ZT="+t.getTime();
$.ajax({
url:xmlurl,
type:"GET",
dataType:"xml",
error:function(){
},
success:function(xml){
var xmlDoc=xml;
var obj1 = document.getElementById("s_Nhanlderdigitaloutput");
var span_str = "<table width='95%' border='0' align='center' cellpadding='0' cellspacing='0' class='linetab1'>";
span_str +="<tr><td class='evt_width1 evt_padding'>"+GetElmCont("mevt_0","DO Profile")+"</td><td>";
span_str += "<select id='s_c_hanlderN_DigitalOutput' xonchange=''>";
doprofile_name_arr = [];      //DO Profile Name
doprofile_enable_arr = [];    //Enable
for(var x=0;x<10;x++)
{
doprofile_rule_index = xmlDoc.getElementsByTagName("doprofile_rule_index")[x].childNodes[0];
if(doprofile_rule_index != null)
{
index = parseInt(doprofile_rule_index.nodeValue);
xml_index = (index-1);
doprofile_name = xml_getvalue(xmlDoc,"doprofile_name",xml_index);
doprofile_enable = xml_getvalue(xmlDoc,"doprofile_enable",xml_index);
var enable_check = (doprofile_enable == 1);
if(enable_check){ span_str += "<option value="+xml_index+">"+doprofile_name+"</option>" }
}
}
span_str += "</select>"
span_str +="</td></tr>";
span_str += "</table>";
if(span_str.indexOf("<option") != -1){ obj1.innerHTML = span_str; }
}
});
}
show_s_Nhanlderdigitaloutput()
function show_s_NhanlderSyslog(){//Syslog: ■ Enable;
var obj1 = document.getElementById("s_Nhanldersyslog");
var span_str = "<table width='95%' border='0' align='center' cellpadding='0' cellspacing='0' class='linetab1'>";
span_str +="<tr><td class='evt_width1 evt_padding'>"+GetElmCont("apcon_0","Syslog")+"</td><td>";
span_str +="<input type='checkbox' id='s_c_hanlderN_Syslog' checked>"+GetElmCont("wary_0","Enable");
span_str +="</td></tr></table>";
obj1.innerHTML = span_str;
}
show_s_NhanlderSyslog()
function show_s_NhanlderEmailAlert(){
var obj1 = document.getElementById("s_Nhanlderemailalert");
var span_str = "<table width='95%' border='0' align='center' cellpadding='0' cellspacing='0' class='linetab1'>";
span_str +="<tr><td class='evt_width1 evt_padding'>"+GetElmCont("emailalt_0","Email Alert")+"</td><td>";
span_str += "<select id='s_c_hanlderN_EmailAlert' xonchange=''>";
span_str += "<option value=0>ID1</option>"
span_str += "</select>"
span_str +="</td></tr>";
span_str += "</table>";
if(span_str.indexOf("<option") != -1){ obj1.innerHTML = span_str; }
}
show_s_NhanlderEmailAlert()