/** 
    @ Name : Careff Javascript Library 
    @ Author : 
    @ Date : 2019-08-19
    @ Email : 
    @ Version : 1.0 
    @ Update : 
    功能： 开始建立自己的JS类库，需要按照功能进行分类；
     */
(function () {
    if (!window.usspanfont) {
        window.usspanfont = {};
    };
    window.usspanfont = {
        NAME: "usspanfont",
        VERSION: '1.0',
        DATE: '2019-08-19',
        INDEX:10,
        /** 
       @ Name :显示背景SPAN按钮效果文字
       @ Update : 
       */
        usspan: function (id,txt) {
            var ret = "";
            var cls = "us-span-blue";
            var z = "us-span-blue,us-span-green,us-span-yellow,us-span-cyan,us-span-red,us-span-orange,us-span-bluev2,us-span-greenv2,us-span-redv2,us-span-black,us-span-gray";
            var sz = z.split(",");
            var i = parseInt(id) % 11;
           // console.debug(id)
            //console.debug(i)
            cls = sz[i];
            ret = '<span class="us-span-default ' + cls + '">' + (txt||'') + '</span>';
            //console.debug(ret);
            return ret;
        },
        /** 
          @ Name :显示背景SPAN按钮效果文字
          @ Update : para格式为：1001,1002,1003，这些修改后对应颜色的序号
          */
        usspanself: function (id, txt,para) {
            var ret = "";
            var cls = "us-span-blue";
            var z = "us-span-blue,us-span-green,us-span-yellow,us-span-cyan,us-span-red,us-span-orange,us-span-bluev2,us-span-greenv2,us-span-redv2,us-span-black,us-span-gray";
            var sz = z.split(",");
            i = 0;
            var sulist = para.split(",");
            
            for (var j = 0; j < sulist.length; j++) {
                if (sulist[j] == id) {
                    i = j;
                    break;
                }
            }
            //console.debug(i)
            cls = sz[i];
            ret = '<span class="us-span-default ' + cls + '">' + (txt || '') + '</span>';
            //console.debug(ret);
            return ret;
        },
        usspanselfv2: function (id, txt, para,clrpara) {
            var ret = "";
            var cls = "us-span-blue";
            var z = "us-span-blue,us-span-green,us-span-yellow,us-span-cyan,us-span-red,us-span-orange,us-span-bluev2,us-span-greenv2,us-span-redv2,us-span-black,us-span-gray";
            var sz = z.split(",");
            i = 0;
            var sulist = para.split(",");
            var clrlist = clrpara.split(",");
            
            for (var j = 0; j < sulist.length; j++) {
                if (sulist[j] == id) {
                    i = j;
                    break;
                }
            }
            //console.debug(i)
            cls = clrlist[i];
            ret = '<span class="us-span-default ' + cls + '">' + (txt || '') + '</span>';
            //console.debug(ret);
            return ret;
        }
    };

})();