$(document).ready(function(){
    function read_list_val(obj,attr_name){
            var lst=obj.attr(attr_name);
            lst=lst.split(",");
            return lst;
    }
    function write_attr_val(obj,lst,attr_name){
            obj.attr(attr_name,lst);
    }
    /*function addToList(lst,val){
          return  lst.push(val);
    }*/
    function removeFromList(lst,val){
            const index = lst.indexOf(val);
            if (index > -1) {
                lst.splice(index, 1);
            }
            return lst;
    }

    function removeAllSameFromList(lst,val){
            for(var i=0;i<lst.length;i++){
                    const index = lst.indexOf(val);
                    if (index > -1) {
                            lst.splice(index, 1);
                    }else{
                            break;
                    }
            }
            return lst;
    }
});