var evtm_record_next_index = 0;   //�ثe�Ĥ@���� �s�W�����X
var evtm_record_edit_index = 0;
var evtm_max_number = 10;         //�ثeCTA���w�}�X�̤j�Ӽ�
var evtm_count =0;
var delete_check_arr = [];
for(var a=0;a<63;a++)
{
delete_check_arr[a] = 0;
}
/*
Add/Delete/Edit external server
evtm_account_next_index => �n���J C_WEBUI_VPNPPTPACC_RECORD_RULE ���U�@�� index �ΨӰO��Ū��CSID �o����
evtm_record_next_index => �U�@���� index  ���Ĥ@�Ӫťժ�CSID
by kent
*/
var evtm_account_csid = [];
var evtm_descrip_csid = [];
var evtm_event_csid = [];
var evtm_hanlder_csid = [];
var evtm_response_csid = [];
var evtm_enable_csid = [];
evtm_account_csid.push("N002028E0");
evtm_descrip_csid.push("S003B4C00");
evtm_event_csid.push("S003B4800");
evtm_hanlder_csid.push("S003B4900");
evtm_response_csid.push("S003B4A00");
evtm_enable_csid.push("N003B4B00");
evtm_account_csid.push("N002028E1");
evtm_descrip_csid.push("S003B4C01");
evtm_event_csid.push("S003B4801");
evtm_hanlder_csid.push("S003B4901");
evtm_response_csid.push("S003B4A01");
evtm_enable_csid.push("N003B4B01");
evtm_account_csid.push("N002028E2");
evtm_descrip_csid.push("S003B4C02");
evtm_event_csid.push("S003B4802");
evtm_hanlder_csid.push("S003B4902");
evtm_response_csid.push("S003B4A02");
evtm_enable_csid.push("N003B4B02");
evtm_account_csid.push("N002028E3");
evtm_descrip_csid.push("S003B4C03");
evtm_event_csid.push("S003B4803");
evtm_hanlder_csid.push("S003B4903");
evtm_response_csid.push("S003B4A03");
evtm_enable_csid.push("N003B4B03");
evtm_account_csid.push("N002028E4");
evtm_descrip_csid.push("S003B4C04");
evtm_event_csid.push("S003B4804");
evtm_hanlder_csid.push("S003B4904");
evtm_response_csid.push("S003B4A04");
evtm_enable_csid.push("N003B4B04");
evtm_account_csid.push("N002028E5");
evtm_descrip_csid.push("S003B4C05");
evtm_event_csid.push("S003B4805");
evtm_hanlder_csid.push("S003B4905");
evtm_response_csid.push("S003B4A05");
evtm_enable_csid.push("N003B4B05");
evtm_account_csid.push("N002028E6");
evtm_descrip_csid.push("S003B4C06");
evtm_event_csid.push("S003B4806");
evtm_hanlder_csid.push("S003B4906");
evtm_response_csid.push("S003B4A06");
evtm_enable_csid.push("N003B4B06");
evtm_account_csid.push("N002028E7");
evtm_descrip_csid.push("S003B4C07");
evtm_event_csid.push("S003B4807");
evtm_hanlder_csid.push("S003B4907");
evtm_response_csid.push("S003B4A07");
evtm_enable_csid.push("N003B4B07");
evtm_account_csid.push("N002028E8");
evtm_descrip_csid.push("S003B4C08");
evtm_event_csid.push("S003B4808");
evtm_hanlder_csid.push("S003B4908");
evtm_response_csid.push("S003B4A08");
evtm_enable_csid.push("N003B4B08");
evtm_account_csid.push("N002028E9");
evtm_descrip_csid.push("S003B4C09");
evtm_event_csid.push("S003B4809");
evtm_hanlder_csid.push("S003B4909");
evtm_response_csid.push("S003B4A09");
evtm_enable_csid.push("N003B4B09");
function sw_s_hanlder(obj){
swids("s_hanlderwan",((document.getElementById('c_hanlder_WAN')!=null)&&(document.getElementById('c_hanlder_WAN').checked)));
swids("s_hanlderlanvlan",((document.getElementById('c_hanlder_LANVLAN')!=null)&&(document.getElementById('c_hanlder_LANVLAN').checked)));
swids("s_hanlderwifi",((document.getElementById('c_hanlder_WiFi')!=null)&&(document.getElementById('c_hanlder_WiFi').checked)));
swids("s_hanldernat",((document.getElementById('c_hanlder_NAT')!=null)&&(document.getElementById('c_hanlder_NAT').checked)));
swids("s_hanlderfirewall",((document.getElementById('c_hanlder_Firewall')!=null)&&(document.getElementById('c_hanlder_Firewall').checked)));
swids("s_hanldervpn",((document.getElementById('c_hanlder_VPN')!=null)&&(document.getElementById('c_hanlder_VPN').checked)));
swids("s_hanldergre",((document.getElementById('c_hanlder_GRE')!=null)&&(document.getElementById('c_hanlder_GRE').checked)));
swids("s_hanldersystemmanagement",((document.getElementById('c_hanlder_SystemManagement')!=null)&&(document.getElementById('c_hanlder_SystemManagement').checked)));
swids("s_hanlderadministration",((document.getElementById('c_hanlder_Administration')!=null)&&(document.getElementById('c_hanlder_Administration').checked)));
swids("s_hanlderdo",((document.getElementById('c_hanlder_DO')!=null)&&(document.getElementById('c_hanlder_DO').checked)));
swids("s_hanldermodbus",((document.getElementById('c_hanlder_Modbus')!=null)&&(document.getElementById('c_hanlder_Modbus').checked)));
if(!obj.checked){ clrsub_Hanlders(obj) }
}
function Foolproofing1(tp){
var tp1 = new Array('c_hanlder_DO','s_response'); //Hanlder and Response�����P�s��DO
var tp2 = new Array('s_evtm','c_hanlder_NetworkStatus'); // �� NetworkStatus �N������Event DI
var sw_id ="tp"+tp;
var sw1 = false ;
var str1 = "" ;
var obj1 = document.getElementById(eval(sw_id+"[0]"))
var obj2 = document.getElementById(eval(sw_id+"[1]"))
if((obj1!=null)&&((obj2!=null))){
if(tp == "1"){
sw1 = ((obj1.checked)&&(obj2.value == "DO"))
str1 = (sw1)?"Hanlder and Response is invalid!":""
}
else if(tp == "2"){
sw1 = ((obj1.value == "DI")&&(obj2.checked))
str1 = (sw1)?"Event and Action is invalid!":""
}
if(sw1){  alert(str1);  }
}
return sw1;
}
function swsubfunc(obj,tp){
var sw_str1 = obj.value;
if(tp =="e"){
swids("s_eventsms",(sw_str1 =='SMS'));
swids("s_eventsnmptrap",(sw_str1 =='SNMPTrap'));
swids("s_eventdi",(sw_str1 =='DI'));
swids("s_eventmodbus",(sw_str1 =='Modbus'));
}
else if(tp =="r"){
swids("s_responsesms",(sw_str1 =='SMS'));
swids("s_responsedo",(sw_str1 =='DO'));
swids("s_responsembus",(sw_str1 =='Modbus'));
}
}
function Foolproofing(obj,tp){
for(s=0;s<obj.length;s++){
var sw_s1 = obj.options[s].value;
if(tp =="e"){
if((sw_s1 =='SMS')&&(document.getElementById('s_eventsms')!=null)){
var str_s1 = document.getElementById('s_eventsms').innerHTML;
obj.options[s].disabled =(str_s1 == "")
}
else if((sw_s1 =='SNMPTrap')&&(document.getElementById('s_eventsnmptrap')!=null)){
var str_s1 = document.getElementById('s_eventsnmptrap').innerHTML;
obj.options[s].disabled =(str_s1 == "")
}
else if((sw_s1 =='DI')&&(document.getElementById('s_eventdi')!=null)){
var str_s1 = document.getElementById('s_eventdi').innerHTML;
obj.options[s].disabled =(str_s1 == "")
}
else if((sw_s1 =='Modbus')&&(document.getElementById('s_eventmodbus')!=null)){
var str_s1 = document.getElementById('s_eventmodbus').innerHTML;
obj.options[s].disabled =(str_s1 == "")
}
}
if(tp =="r"){
if((sw_s1 =='SMS')&&(document.getElementById('s_responsesms')!=null)){
var str_s1 = document.getElementById('s_responsesms').innerHTML;
obj.options[s].disabled =(str_s1 == "")
}
else if((sw_s1 =='DO')&&(document.getElementById('s_responsedo')!=null)){
var str_s1 = document.getElementById('s_responsedo').innerHTML;
obj.options[s].disabled =(str_s1 == "")
}
else if((sw_s1 =='Modbus')&&(document.getElementById('s_responsembus')!=null)){
var str_s1 = document.getElementById('s_responsembus').innerHTML;
obj.options[s].disabled =(str_s1 == "")
}
}
}
}
function add_edit_evtm_account(type,edit_arr_index,edit_csid_index)
{
var add_edit_table = document.getElementById("add_edit_table_m");
var obj_save = document.getElementById("_wary_99");
var add_button = document.getElementById("add_save_button");
var edit_button = document.getElementById("edit_save_button");
var evtm_event = document.getElementById("s_evtm");
var evtm_descrip = document.getElementById("t_descrip");
var evtm_event1 = document.getElementById("s_event_sms");
var evtm_hanlder = document.getElementById("h_hanlder");
var evtm_response = document.getElementById("s_response");
var evtm_checked = document.getElementById("c_evtmenable");
var hanlder_clr = document.getElementsByName("na_hanlders");
var anchor = document.getElementById("_a_anchor_evtM");
if(type == 'add')
{
if(evtm_account_next_index == evtm_max_number)
{
alert("rule can't more than "+evtm_max_number);
return false;
}
evtm_event.value = evtm_event.options[0].value;  //"SMS"
swsubfunc(evtm_event,'e')
if(document.getElementById('s_event_sms')!=null){document.getElementById('s_event_sms').value="";}
if(document.getElementById('s_event_snmptrap')!=null){document.getElementById('s_event_snmptrap').value="";}
evtm_descrip.value = "";    //Description
evtm_hanlder.value = "";
clrHanlders()  //�M�� Hanlders
evtm_response.value = "None";
swsubfunc(evtm_response,'r')
evtm_checked.checked = true;
}
else
{
var str_evt1 = evtm_event_arr[edit_arr_index]       // @SMS|3dsdsfdfs
var str_evt2 = get_splitmark(str_evt1,'|','0')      // @SMS
var str_evt3 = get_splitmark(str_evt2,'@','1')      // SMS
var str_evt4 = "s_event_";
str_evt3 = (str_evt3 == "SNMP Trap")?"SNMPTrap":str_evt3  //SNMP Trap or ...
str_evt3 = (str_evt3 == "Digital Input")?"DI":str_evt3  //Digital Input or SMS
evtm_event.value = str_evt3  //SMS
swsubfunc(evtm_event,'e')
if(document.getElementById(str_evt4+str_evt3.toLowerCase())!=null){
var obj_evt1 = document.getElementById(str_evt4+str_evt3.toLowerCase()); //id=s_event_sms
obj_evt1.value = get_splitmark(str_evt1,'|','1') //3dsdsfdfs
}
evtm_descrip.value = evtm_descrip_arr[edit_arr_index]
var str_hanlder1 = evtm_hanlder_arr[edit_arr_index];  // @WAN|LTE-1 Disconnect|LTE-1 Auto|LTE-2 LTE@NAT|DMZ On@Administration|Reboot
var ary_hanlder1 = str_hanlder1.split('@')  // [1]=WAN|LTE-1 Disconnect|LTE-1 Auto|LTE-2 LTE ;[2]=NAT|DMZ On@Administration|Reboot
var str_hanlder2 = "c_hanlder_"    //document.getElementById("c_hanlder_WAN")
var str_hanlder3 = "s_hanlder_";   // only select
var ary_hanlder2 = [];
clrHanlders()  //�M�� Hanlders
for(kt=1;kt<ary_hanlder1.length;kt++){
var str_kt1 = ary_hanlder1[kt]  //[1]=WAN|LTE-1 Disconnect|LTE-1 Auto|LTE-2 LTE or [1]=WAN
var str_kt2 = get_splitmark(str_kt1,'|','0') //WAN
if(str_kt2 == "LAN&VLAN"){ str_kt2 = "LANVLAN" }
else if(str_kt2 == "System Manage"){ str_kt2 = "SystemManagement" }
else if(str_kt2 == "Digital Output"){ str_kt2 = "DO" }
else if(str_kt2 == "Network Status"){ str_kt2 = "NetworkStatus" }
var obj_kt1 = document.getElementById(str_hanlder2+str_kt2)
obj_kt1.checked = true;  // --- ���ĳQ���� Hanlders �� checkbox ---
sw_s_hanlder(obj_kt1);   // --- ���}�Q�İ_ checkbox radio�� span  ---
if((str_kt1.indexOf('|')!=-1)&&(str_kt2 != "DO")){
var ary_kt1 = str_kt1.split('|')  //ary_kt1 = [WAN],[LTE-1 Disconnect],[LTE-1 Auto],[LTE-2 LTE]
ary_hanlder2.push(sw_radio(ary_kt1));	// --- �����Ҧ��Q���쪺	radio  ---
}
if(document.getElementById(str_hanlder3+str_kt2.toLowerCase())!=null){
var obj_hanlder1 = document.getElementById(str_hanlder3+str_kt2.toLowerCase()); //id=s_hanlderdo
obj_hanlder1.value = get_splitmark(str_kt1,'|','1') //3dsdsfdfs
}
}
for(d=0;d<ary_hanlder2.length;d++){
var ary_d1 = ary_hanlder2[d]
for(w=0;w<ary_d1.length;w++){
var str_w1 = ary_d1[w]  // str_w1 =0~LTE-1 Disconnect
var str_w2 = get_splitmark(str_w1,'~','0')  // 0,
var str_w3 = get_splitmark(str_w1,'~','1')  //LTE-1 Disconnect
var rdo_name = get_splitmark(hanlders_arry[str_w2],'|','0')  //r_hanlder_wanA0
var rdo_text = get_splitmark(hanlders_arry[str_w2],'|','1')  //LTE-1 Reconnect~LTE-1 Disconnect
var ary_w1 = rdo_text.split('~')
var str_w4 = 0;
for(f=0;f<ary_w1.length;f++){
if(str_w3 == ary_w1[f]){ str_w4 = f ; break }
}
var fm = document.forms[0];
eval("fm."+rdo_name+"["+str_w4+"].checked = true");
eval("document.getElementById('h"+rdo_name+"').value = str_w3");
}
}
var str_res1 = evtm_response_arr[edit_arr_index]    // @SNMP Trap or @Modbus|7
var str_res2 = get_splitmark(str_res1,'|','0')      // @SNMP Trap.split('|') or @Modbus|7.split('|')
var str_res3 = get_splitmark(str_res2,'@','1')      // SNMP Trap or SMS
var str_res4 = "s_response_";
str_res3 = (str_res3 == "SNMP Trap")?"SNMPTrap":str_res3  //SNMP Trap or SMS
evtm_response.value = str_res3  //SMS
swsubfunc(evtm_response,'r')
if(document.getElementById(str_res4+str_res3.toLowerCase())!=null){
var obj_res1 = document.getElementById(str_res4+str_res3.toLowerCase()); //id=s_response_sms
obj_res1.value = get_splitmark(str_res1,'|','1') //3dsdsfdfs
}
evtm_checked.checked = (evtm_enable_arr[edit_arr_index] == 1)?"checked":"";
evtm_record_edit_index = edit_csid_index;
}
set_Action();
add_edit_table.style.display = "";
add_button.style.display = (type == "add")?"":"none";
edit_button.style.display = (type == "add")?"none":"";
obj_save.style.display = "none"
anchor.click();
}
function set_Action(){
var objck1 = $("[name=na_hanlders]")
var sw1 = "";
for(var t=0;t<objck1.length;t++){
if(objck1.eq(t).prop("checked")){ sw1 = t ; break }
}
if(sw1 == '0'){
clrHanlders(1);
$("[name=na_hanlders]:gt(0)").prop("disabled", true);
}
else if(sw1 == ''){
objck1.eq(0).prop("disabled", false);
$("[name=na_hanlders]:gt(0)").prop("disabled", false);
}
else{
objck1.eq(0).prop("disabled", true);
objck1.eq(0).prop("checked", false);
$("[name=na_hanlders]:gt(0)").prop("disabled", false);
}
}
function sw_radio(sw_ary){ //sw_ary = WAN,LTE-1 Disconnect,LTE-1 Auto,LTE-2 LTE
var rdo_name ="";
var rdo_text ="";
var ary_idx = [];
for(s=1;s<sw_ary.length;s++){
var str_s1 = sw_ary[s] //LTE-1 Disconnect
for(q=0;q<hanlders_arry.length;q++){
if(hanlders_arry[q].lastIndexOf(str_s1) != -1){
str_q1=q+"~"+str_s1
ary_idx.push(str_q1);
break;
}
}
}
return ary_idx
}
function getaddEvent(val0){
var str1 = val0.toLowerCase();
var str2 = "s_event_"+str1;  // id='s_event_snmptrap'
var str3 = "@"//@SNMP Trap|TrapMsg
var obj1 = eval("document.getElementById('"+str2+"')")
var obj2 = document.getElementById("s_evtm")
for(a=0;a<obj2.length;a++){
if(obj2.options[a].value==val0){
str3 += obj2.options[a].text ;
break;
}
}
if(obj1!=null){ str3 += "|"+obj1.value ; }
return str3
}
function getaddResponse(val0){
var str1 = val0.toLowerCase();
var str2 = "s_response_"+str1;  // id='s_event_sms'
var str3 = "@"//@SNMP Trap|TrapMsg
var obj1 = eval("document.getElementById('"+str2+"')")
var obj2 = document.getElementById("s_response")
for(a=0;a<obj2.length;a++){
if(obj2.options[a].value==val0){
str3 += obj2.options[a].text ;
break;
}
}
if(obj1!=null){ str3 += "|"+obj1.value ; }
return str3
}
function getadd_hanlders(){
var str1 = "c_hanlder_";
var str2 = "hs_hanlder";
var str5 = "";
var strx = ""   //@WAN|LTE-1 Reconnect|LTE-2 LTE@WiFi|2.4G WiFi On@.....
var hanlders_save = document.getElementsByName("na_hanlders");
for(var g=0;g<hanlders_save.length;g++){
if(hanlders_save[g].checked){
var ary1 = hanlders_save[g].id.split(str1) //[]c_hanlder_[WAN]
var str3 = ary1[1];  //WAN
var str4 = str2 + str3.toLowerCase(); // hs_hanlderwan
var obj1 = document.getElementsByName(str4); // hs_hanlderwan
if(str3 == "LANVLAN"){ str3 = "LAN%26VLAN" }
else if(str3 == "SystemManagement"){ str3 = "System Manage" }
else if(str3 == "DO"){ str5 = str3 ; str3 = "Digital Output" }
else if(str3 == "NetworkStatus"){ str5 = str3 ; str3 = "Network Status" }
else if(str3 == "Modbus"){ str5 = str3  }
strx += "@"+str3
if((str3 == "Digital Output")||(str3 == "Modbus")){
var sw = "s_hanlder_" + str5.toLowerCase()
obj1 = document.getElementById(sw); // s_hanlder_do
if(obj1!=null){ strx += "|"+obj1.value }
else { strx += "|" }
}
else {
var sw_j1 = 0;
for(j=0;j<obj1.length;j++){
if(obj1[j].value!=""){ strx += "|"+obj1[j].value }
else{ sw_j1 ++ }
}
if((sw_j1 == obj1.length)&&(g!=0)){
alert("Action is invalid");
strx = true;
break ;
}
}
}
}
if(strx == ""){
alert("Action is invalid");
strx = true;
}
return strx
}
function save_evtm(type,obj)
{
var add_evtm = get_encode_value("s_evtm");
var add_descrip = get_encode_value("t_descrip");
var add_hanlders = get_encode_value("h_hanlder");
var add_response = get_encode_value("s_response");
var add_checked = document.getElementById("c_evtmenable").checked;
var add_enable = (add_checked)?1:0;
var index = (type == 'add')?evtm_record_next_index:evtm_record_edit_index;
var account_str = "hide.htm?";
var str_message = "";
var iframe = document.getElementById("iframeH");
var str_ghanlders = "";
saveResult()
if(add_descrip == "")
{
str_message = "Description can not be empty";
alert(str_message);
return false;
}
if(!chkForm()){  return false;  }
else if(Foolproofing1("1")){ return false; }
else if(Foolproofing1("2")){ return false; }
str_ghanlders = getadd_hanlders();
if(typeof(str_ghanlders)=="boolean"){  return false;  }
if(type == 'add')
{
account_str += evtm_account_csid[evtm_account_next_index]+"="+(index+1)+"&";
}
account_str += evtm_event_csid[index]+"="+getaddEvent(add_evtm);
account_str += "&"+evtm_descrip_csid[index]+"="+add_descrip;
account_str += "&"+evtm_hanlder_csid[index]+"="+str_ghanlders;
account_str += "&"+evtm_response_csid[index]+"="+getaddResponse(add_response);
account_str += "&"+evtm_enable_csid[index]+"="+add_enable;
account_str += "&N803B0001=1&N80420715=1"
iframe.src = account_str+'&csrftok='+get_csrf_token();
setTimeout("show_evtm_list();saveResult('9999')",2000);
swids("add_edit_table_m",false);
}
function save_evtm1(type,obj){// for paggy test
var add_evtm = get_encode_value("s_evtm");
var add_response = get_encode_value("s_response");
var str_ghanlders = "";
}
function del_evtm()
{
var tmp_del = document.getElementsByName("evtm_del");
var del_arr = new Array();
var index = 0;
var del_index =0;
var new_index = 0;
var sent_str ="hide.htm?";
var iframe = document.getElementById("iframeH");
var reset_del = "";
var show_message = 0;
var show_message_str = "";
for(var t=0;t<tmp_del.length;t++)
{
var index = (tmp_del[t].value-1);
if(tmp_del[t].checked)
{
del_arr[del_index] = tmp_del[t].value;  //del_arr[del_index] �n�R����item
del_index++;
}
}
if(del_arr.length == 0)
{
alert(GetElmCont("lb_0","Please choose one or more rule."));
return false;
}
for(var r=0;r<evtm_account_index.length;r++)
{
for(var n=0;n<del_arr.length;n++)
{
if(evtm_account_index[r] == del_arr[n])
{
evtm_account_index[r] = "";
}
}
}
for(var a=0;a<evtm_account_csid.length;a++)
{
if(evtm_account_index[a] != "")
{
sent_str += (sent_str == "hide.htm?")?evtm_account_csid[new_index]+"="+evtm_account_index[a]:"&"+evtm_account_csid[new_index]+"="+evtm_account_index[a];
new_index++;
}
}
for(var c=new_index;c<evtm_account_csid.length;c++)
{
sent_str += (sent_str == "hide.htm?")?evtm_account_csid[c]+"=":"&"+evtm_account_csid[c]+"=";
}
for(var x=0;x<del_arr.length;x++)
{
var xx = del_arr[x]-1;
sent_str += (sent_str == "hide.htm?")?evtm_descrip_csid[xx]+"=":"&"+evtm_descrip_csid[xx]+"=";
sent_str += "&"+evtm_enable_csid[xx]+"=0";
}
iframe.src = sent_str+'&csrftok='+get_csrf_token();
setTimeout("show_evtm_list()",2000);
}
function get_encode_value(id)
{
var obj = document.getElementById(id);
return (obj != null)?encodeURIComponent(obj.value):"";
}
function clrHanlders(sw1){
var hanlder_clr = document.getElementsByName("na_hanlders");
var tt = (sw1!=null)?sw1:0
for(var t=tt;t<hanlder_clr.length;t++){//---  �����Ҧ��Q������ checkbox ---
hanlder_clr[t].checked = false ;
sw_s_hanlder(hanlder_clr[t])
}
$(":radio").attr('checked',false);  //  �����Ҧ��Q������radio
$(".hHh").val("");  //---  �M�ũҦ�hidden �� text ---
}
function get_splitmark(xx,tp,aryEix){
var str1 =xx;
if(str1.indexOf(tp)!=-1){
var ary_x = str1.split(tp)  // @SMS|3dsdsfdfs.split('|') or @SMS.split('@')
return ary_x[aryEix]
}
else { return str1 ; }
}
function clrsub_Hanlders(obj){
var str1 = "c_hanlder_";
var str2 = "s_hanlder";
var obj_ary1 = obj.id.split(str1) //[]c_hanlder_[WAN]
var str3 = obj_ary1[1];  //WAN
var str4 = str2 + str3.toLowerCase(); // s_hanlderwan
if(document.getElementById(str4)!=null){ //�S��radio���M��
var sww1 = document.getElementById(str4);
var teststr0 = (sww1.innerHTML);
var strx = '" name="'
var ary1 = teststr0.split(strx)
var ary2 = []; //radio
var ary3 = []; //hidden
for(var t=1;t<ary1.length;t++){ //radio
var tp = '" onclick="'
if(ary1[t].indexOf(tp)!=-1){
arytmp = ary1[t].split(tp)
ary2.push(arytmp[0]);
}
}
for(var o=1;o<ary1.length;o++){ //hidden
var tp1 = '" id="hr_hanlder'
if(ary1[o].indexOf(tp1)!=-1){
arytmp = ary1[o].split(tp1)
ary3.push(arytmp[0]);
}
}
for(var w=0;w<ary2.length;w++){ //radio.checked = false
var str_w1 = ary2[w]
var obj_w1 = eval("document.forms[0]."+str_w1)
if((w == 0)||(w>0)&&(ary2[w-1]!=str_w1)){
for(var r=0;r<obj_w1.length;r++){ obj_w1[r].checked = false ; }
}
}
for(var s=0;s<ary3.length;s++){ //hidden.value = ""
var str_s1 = ary3[s]
var obj_s1 = eval("document.forms[0]."+str_s1)
for(var r=0;r<obj_s1.length;r++){ obj_s1[r].value = "" ; }
}
}
}