var uctl_record_next_index = 0;
var uctl_record_edit_index = 0;
var uctl_max_number = 20;
var uctl_count =0;
/*
utcl account
*/
var uctl_account_csid = new Array(
"N00202200",
"N00202201",
"N00202202",
"N00202203",
"N00202204",
"N00202205",
"N00202206",
"N00202207",
"N00202208",
"N00202209",
"N0020220A",
"N0020220B",
"N0020220C",
"N0020220D",
"N0020220E",
"N0020220F",
"N00202210",
"N00202211",
"N00202212",
"N00202213",
""
)
var uctl_account_index = new Array(
"1",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
var uctl_rule_csid = new Array(
"S00101000",
"S00101001",
"S00101002",
"S00101003",
"S00101004",
"S00101005",
"S00101006",
"S00101007",
"S00101008",
"S00101009",
"S0010100A",
"S0010100B",
"S0010100C",
"S0010100D",
"S0010100E",
"S0010100F",
"S00101010",
"S00101011",
"S00101012",
"S00101013",
""
)
var uctl_rule_sche_csid = new Array(
"N00103000",
"N00103001",
"N00103002",
"N00103003",
"N00103004",
"N00103005",
"N00103006",
"N00103007",
"N00103008",
"N00103009",
"N0010300A",
"N0010300B",
"N0010300C",
"N0010300D",
"N0010300E",
"N0010300F",
"N00103010",
"N00103011",
"N00103012",
"N00103013",
""
)
var uctl_rule_en_csid = new Array(
"N00102000",
"N00102001",
"N00102002",
"N00102003",
"N00102004",
"N00102005",
"N00102006",
"N00102007",
"N00102008",
"N00102009",
"N0010200A",
"N0010200B",
"N0010200C",
"N0010200D",
"N0010200E",
"N0010200F",
"N00102010",
"N00102011",
"N00102012",
"N00102013",
""
)
var uctl_rule_en = new Array(
"1",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
var uctl_rule_name_csid = new Array(
"S00105000",
"S00105001",
"S00105002",
"S00105003",
"S00105004",
"S00105005",
"S00105006",
"S00105007",
"S00105008",
"S00105009",
"S0010500A",
"S0010500B",
"S0010500C",
"S0010500D",
"S0010500E",
"S0010500F",
"S00105010",
"S00105011",
"S00105012",
"S00105013",
""
)
var uctl_rule_name = new Array(
"Rule1",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
var uctl_port_csid = new Array(
"N00104000",
"N00104001",
"N00104002",
"N00104003",
"N00104004",
"N00104005",
"N00104006",
"N00104007",
"N00104008",
"N00104009",
"N0010400A",
"N0010400B",
"N0010400C",
"N0010400D",
"N0010400E",
"N0010400F",
"N00104010",
"N00104011",
"N00104012",
"N00104013",
""
)
var uctl_port = new Array(
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
var group_sip_csid = new Array(
"S00109000",
"S00109001",
"S00109002",
"S00109003",
"S00109004",
"S00109005",
"S00109006",
"S00109007",
"S00109008",
"S00109009",
"S0010900A",
"S0010900B",
"S0010900C",
"S0010900D",
"S0010900E",
"S0010900F",
"S00109010",
"S00109011",
"S00109012",
"S00109013",
""
)
var group_mac_csid = new Array(
"S0010A000",
"S0010A001",
"S0010A002",
"S0010A003",
"S0010A004",
"S0010A005",
"S0010A006",
"S0010A007",
"S0010A008",
"S0010A009",
"S0010A00A",
"S0010A00B",
"S0010A00C",
"S0010A00D",
"S0010A00E",
"S0010A00F",
"S0010A010",
"S0010A011",
"S0010A012",
"S0010A013",
""
)
var uctl_next_index = 0;
for(var a=0;a<uctl_account_index.length;a++)
{
if(uctl_account_index[a] == "")
{
uctl_next_index = a;
break;
}
}
function add_uctl_account(obj)
{
if(uctl_next_index != uctl_max_number)
{
obj.form.action = "uctladd.htm";
obj.form.Ntid.value = (uctl_record_next_index+1);
obj.form.Nuctlindex.value = uctl_next_index;
obj.form.Nrule.value = uctl_record_next_index;
obj.form.submit();
}
else
{
alert(GetElmCont("dhcp_0","Rule could not be added anymore."));
}
}
function add_edit_utcl_account(type,edit_user_index)
{
var add_edit_table = document.getElementById("add_edit_account_table");
var add_button = document.getElementById("add_save_button");
var edit_button = document.getElementById("edit_save_button");
var user_url_contant = document.getElementById("uctl_url_text");
var user_active_checked = document.getElementById("uctl_active_check");
var anchor = document.getElementById("_a_anchor");
if(type == 'add')
{
if(uctl_next_index == uctl_max_number)
{
alert(GetElmCont("dhcp_0","Rule could not be added anymore."));
return false;
}
}
else
{
user_url_contant.value = document.getElementById("s_account_url_"+edit_user_index).innerHTML;
user_active_checked.checked = (document.getElementById("c_urlblock_rule_"+edit_user_index).checked)?"checked":"";
uctl_record_edit_index = edit_user_index;
}
add_edit_table.style.display = "";
add_button.style.display = (type == "add")?"":"none";
edit_button.style.display = (type == "add")?"none":"";
displayschesel_add_edit(edit_user_index);
anchor.click();
}
function save_uctl_user_account(type,obj)
{
var add_url = document.getElementById("uctl_url_text").value;
var add_select = document.getElementById("s_uctl_rule_sche_no").value;
var add_user_avtive_check = document.getElementById("uctl_active_check").checked;
var add_user_avtive = (add_user_avtive_check)?1:0;
var account_str = "";
var add_index = uctl_record_next_index;
var div_obj =  document.getElementById("d_hidden_element");
var str_message = "";
if(add_url == "")
{
str_message = GetElmCont("_0","URL / Domain Name / Keyword can not be empty!");
alert(str_message);
return false;
}
if(type == 'add')
{
account_str += "<input typt='text' name='"+uctl_account_csid[uctl_next_index]+"' value='"+(add_index+1)+"'>";
account_str += "<input typt='text' name='"+uctl_rule_csid[add_index]+"' value='"+add_url+"'>";
account_str += "<input typt='text' name='"+uctl_rule_sche_csid[add_index]+"' value='"+add_select+"'>";
account_str += "<input typt='text' name='"+uctl_rule_en_csid[add_index]+"' value='"+add_user_avtive+"'>";
}
else if(type == 'edit')
{
account_str += "<input typt='text' name='"+uctl_rule_csid[uctl_record_edit_index]+"' value='"+add_url+"'>";
account_str += "<input typt='text' name='"+uctl_rule_sche_csid[uctl_record_edit_index]+"' value='"+add_select+"'>";
account_str += "<input typt='text' name='"+uctl_rule_en_csid[uctl_record_edit_index]+"' value='"+add_user_avtive+"'>";
}
div_obj.innerHTML = account_str;
document.getElementById("_awary_59_").click();
}
function del_uctl_user_account()
{
var tmp_del = document.getElementsByName("uctl_del");
var del_arr = new Array();
var index = 0;
var new_index = 0;
var sent_str ="uctl.htm?";
for(var t=0;t<tmp_del.length;t++)
{
if(tmp_del[t].checked)
{
del_arr[index] = tmp_del[t].value;
index++;
}
}
if(del_arr.length == 0)
{
alert(GetElmCont("lb_0","Please choose one or more rule."));
return false;
}
for(var r=0;r<uctl_account_index.length;r++)
{
for(var n=0;n<del_arr.length;n++)
{
if(uctl_account_index[r] == del_arr[n])
{
uctl_account_index[r] = "";
}
}
}
for(var a=0;a<uctl_account_csid.length;a++)
{
if(uctl_account_index[a] != "")
{
sent_str += (sent_str == "uctl.htm?")?uctl_account_csid[new_index]+"="+uctl_account_index[a]:"&"+uctl_account_csid[new_index]+"="+uctl_account_index[a];
new_index++;
}
}
for(var c=new_index;c<uctl_account_csid.length-1;c++)
{
sent_str += (sent_str == "uctl.htm?")?uctl_account_csid[c]+"=":"&"+uctl_account_csid[c]+"=";
}
for(var x=0;x<del_arr.length;x++)
{
var xx = del_arr[x]-1;
sent_str += (sent_str == "uctl.htm?")?uctl_rule_name_csid[xx]+"=&"+uctl_rule_en_csid[xx]+"=&"+group_sip_csid[xx]+"=&"+group_mac_csid[xx]+"=":"&"+uctl_rule_name_csid[xx]+"=&"+uctl_rule_en_csid[xx]+"=&"+group_sip_csid[xx]+"=&"+group_mac_csid[xx]+"=";
}
GURL(sent_str+"&_cce=0x80100001");
}
/*
utcl account
*/