// JScript File


function removeRow(Id, con)
{
    
    var cel = con.parentElement;
    var row = cel.parentElement;
    var tbl = row.parentElement;
    var hid = '';
    tbl.deleteRow(row.rowIndex);
   
     var str = "";
     str = document.getElementById('ctl00_BodyContentPH_hdf_Policy').value;
     

     var arr_List = new Array();
     arr_List = str.split("*");
     for(var i=0; i < arr_List.length; i++)
     {    
        var p =  arr_List[i].lastIndexOf(',');     
        var len=arr_List[i].length;     
        var id=arr_List[i].substring(p+1,len);     
        var intId=parseInt(id);
        if(Id == intId)
        {
            arr_List[i] = null;
            break;
        }
     }    
     str = "";
     for(var i=0; i < arr_List.length; i++)
     {
        if(arr_List[i] != null && arr_List[i] != "0")
        {
            if(str == "")
            {
                str = arr_List[i];
            }
            else
            {
                str = str + "*" + arr_List[i];
            }
        }
     }
    document.getElementById('ctl00_BodyContentPH_hdf_Policy').value = str;
    
    if(document.getElementById('tbl_LeavePolicydetails')!=null)
    {
        document.getElementById('tbl_LeavePolicydetails').style.display="none";
    }
    
    if(document.getElementById('tbl_emp')!=null)
    {
        document.getElementById('tbl_emp').style.display="none";
    }
    
    assign_hidden_policy_ModAdd();
    
}
function removeRowAdd(Id, con)
{
    //alert("hi");
    var cel = con.parentElement;
    var row = cel.parentElement;
    var tbl = row.parentElement;
    var hid = '';
    tbl.deleteRow(row.rowIndex);
   
     var str = "";
     str = document.getElementById('ctl00_BodyContentPH_hdf_Policy').value;
     

     var arr_List = new Array();
     arr_List = str.split("*");
     for(var i=0; i < arr_List.length; i++)
     {    
        var p =  arr_List[i].lastIndexOf(',');     
        var len=arr_List[i].length;     
        var id=arr_List[i].substring(p+1,len);     
        var intId=parseInt(id);
        if(Id == intId)
        {
            arr_List[i] = null;
            break;
        }
     }    
     str = "";
     for(var i=0; i < arr_List.length; i++)
     {
        if(arr_List[i] != null && arr_List[i] != "0")
        {
            if(str == "")
            {
                str = arr_List[i];
            }
            else
            {
                str = str + "*" + arr_List[i];
            }
        }
     }
    document.getElementById('ctl00_BodyContentPH_hdf_Policy').value = str;
    
    if(document.getElementById('tbl_LeavePolicydetails')!=null)
    {
        document.getElementById('tbl_LeavePolicydetails').style.display="none";
    }
    
    if(document.getElementById('tbl_emp')!=null)
    {
        document.getElementById('tbl_emp').style.display="none";
    }
    
    assign_hidden_policyAdd();
    
}