﻿var Lpar = { goal1: 1, goal2: 2, uriBbs: '', matchinfo: '', netlink: '' };
Lpar.mode = 1;/*0 = 动态 1 = 静态*/
Lpar.version = 6.89; /*2012-1-14,改回了广告*/
Lpar.uriLive = location.href.substr(0, location.href.indexOf('/', 10) + 1);
Lpar.bmatchpath = 'data13/';
function $(id) { return document.getElementById(id); }
var Link = {};
var Lbase = { _gcIndex: 0 };
Lbase.keys = function (obj) { var arr = []; for (var key in obj) { arr.push(key); } arr.sort(); return arr; };
Lbase.printInfo = function (obj) { var d = []; for (var key in obj) { d.push(key + ' = ' + obj[key]); } alert(d.join('\n')); };
Lbase.gc = function () { if (document.all && Lbase._gcIndex++ > 10) { CollectGarbage(); Lbase._gcIndex = 0; } };
Lbase.addfavorite = function () { if (document.all) { window.external.addFavorite(location.href, document.title); } else if (window.sidebar) { window.sidebar.addPanel(document.title, location.href, ""); } };
Lbase.sethome = function () {
    if (document.all) {
        document.body.style.behavior = ' url(#default#homepage) '; document.body.setHomePage(location.href);
    } else if (window.sidebar) {
        if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege(" UniversalXPConnect "); } catch (e) { return; } }
        var prefs = Components.classes[' @mozilla.org/preferences-service;1 '].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref(' browser.startup.homepage ', location.href);
    }
};
Lbase.createJsFile = function (name, uri, skip, isAppend) {
    var o = $(name), d = document.body;
    if (o) { if (skip) { return; } o.parentNode.removeChild(o); }
    o = document.createElement("script"); o.type = "text/javascript"; o.id = name; o.src = uri;
    if (isAppend) { d.insertBefore(o, d.childNodes[0]); } else { document.getElementsByTagName('head')[0].appendChild(o); }
    return o;
};
Lbase.event = function (o, name, call) {
    if (window.attachEvent) { o.attachEvent(name, call); return; }
    if (window.addEventListener) { o.addEventListener(name.substr(2), call, false); return; }
    o[name] = call;
};
var Lflash = { isReady: false, swf: null, swfId: "Lflash_cookie", swfUrl: "fookie.swf", application: "fookie_data", path: "/", expires: 1000, secure: false, onready: function () { }, imReady: function () { this.isReady = true; this.swf = document[this.swfId] ? document[this.swfId] : window[this.swfId]; this.onready() }, init: function (b, a) { if (b) { this.swfUrl = b } a = a || {}; this.onready = a.onready ? a.onready : this.onready; this.application = a.application ? a.application : this.application; this.path = a.path ? a.path : this.path; this.expires = a.expires ? a.expires : this.expires; this.secure = a.secure ? true : this.secure; this._waitDomReady() }, write: function (d, g, c) { c = c || {}; var b = c.application ? c.application : this.application; var i = c.path ? c.path : this.path; var h = c.expires ? c.expires : this.expires; var f = c.secure ? true : this.secure; if (this.swf && this.swf.write) { return this.swf.write(d, g, b, i, h, f) } return null }, read: function (d, c) { c = c || {}; var b = c.application ? c.application : this.application; var f = c.path ? c.path : this.path; var e = c.secure ? true : this.secure; if (this.swf && this.swf.read) { return this.swf.read(d, b, f, e) } }, remove: function (d, c) { c = c || {}; var b = c.application ? c.application : this.application; var f = c.path ? c.path : this.path; var e = c.secure ? true : this.secure; if (this.swf && this.swf.remove) { return this.swf.remove(d, b, f, e) } }, clear: function (c) { c = c || {}; var b = c.application ? c.application : this.application; var e = c.path ? c.path : this.path; var d = c.secure ? true : this.secure; if (this.swf && this.swf.clear) { return this.swf.remove(b, e, d) } } };

var Lsearch = {};
Lsearch.getPar = function (name, uri) {
    if (!uri) { uri = location.href.toLowerCase(); }
    uri = uri.split('#')[0];
    uri = uri.split('?')[1]; if (!uri) { return ''; }
    uri = uri.split('&'); if (!uri) { return ''; }
    name = name.toLowerCase();
    for (var i = 0, l = uri.length; i < l; i++) {
        if (uri[i].length < 2) { continue; }
        var arr = uri[i].split('=');
        if (arr[0].length < 1) { continue; }
        if (arr[0] != name) { continue; }
        return arr[1];
    }
    return '';
};

Lsearch.insert = function (txt, name, delnames) {
    var arrNew = [], objDel = {}, arr = name ? name.replace(/\s+/g, ' ').split(' ') : [];
    for (var i = 0, l = arr.length; i < l; i++) { objDel[arr[i]] = true; }
    if (delnames) {
        var arrDel = delnames.replace(/\s+/g, ' ').split(' ');
        for (var i = 0, l = arrDel.length; i < l; i++) { objDel[arrDel[i]] = true; }
    }
    txt = txt || '';
    arr = txt.replace(/\s+/g, ' ').split(' ');
    for (var i = 0, l = arr.length; i < l; i++) { if (!objDel[arr[i]]) { arrNew.push(arr[i]); } }
    if (name) { arrNew.push(name); }
    return arrNew.join(' ');
};
Lsearch.del = function (txt, names) {
    var arr = names.replace(/\s+/g, ' ').split(' '), objDel = {}, arrNew = [];
    for (var i = 0, l = arr.length; i < l; i++) { objDel[arr[i]] = true; }
    arr = txt.replace(/\s+/g, ' ').split(' ');
    for (var i = 0, l = arr.length; i < l; i++) { if (!objDel[arr[i]]) { arrNew.push(arr[i]); } }
    return arrNew.join(' ');
};
Lsearch.cssInsert = function (obj, name, delnames) { obj.className = Lsearch.insert(obj.className, name, delnames); };
Lsearch.cssDel = function (obj, names) { obj.className = Lsearch.del(obj.className, names); };
var Lajax = { _initId: null, _index: 0, _hashXml: {}, _hashName: {}, _hcount: {} };
Lajax._arrXmlHttp = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"];
Lajax.onChange = function () {
    try {
        if (this.readyState == 4) {
            if (this.status == 200 && this.responseText && this.responseText != ' ') {
                try {
                    this._call(this.responseText, this._par); 
                } catch (ex1) {
                    Lsys.newLog('exec1：\r\n' + ex1);
                }
            }
            delete Lajax._hashName[this._name];
            Lbase.gc();
        }
    } catch (ex) {
        delete Lajax._hashName[this._name];
        Lsys.newLog('Lajax.onChange：\r\n' + ex); 
    }
};
Lajax.initialize = function (name, call, par) {
    var ajax = null, isNew = false;
    switch (Lajax._initId) {
        case -100: break;
        case -2: ajax = new window.XMLHttpRequest(); isNew = true; break;
        case null:
            var id = null;
            if (window.XMLHttpRequest) {
                ajax = new window.XMLHttpRequest();
                isNew = true;
                id = -2;
            } else {
                id = -100;
                var arr = Lajax._arrXmlHttp;
                for (var i = 0, l = arr.length; i < l; i++) {
                    try {
                        ajax = new ActiveXObject(arr[i]);
                        id = i; break;
                    } catch (e) { }
                }
            }
            Lajax._initId = id;
            break;
        default:
            ajax = new ActiveXObject(Lajax._arrXmlHttp[Lajax._initId]);
            break;
    }
    if (ajax && call) {
        if (isNew) {
            ajax._call = call;
            ajax._par = par;
            ajax._name = name;
            ajax.onreadystatechange = Lajax.onChange;
        } else {
            ajax.onreadystatechange = Lajax._hashXml[name] = function () {
                try {
                    if (ajax.readyState == 4) {
                        if (ajax.status == 200 && ajax.responseText && ajax.responseText != ' ') {
                            try {
                                call(ajax.responseText, par);
                            } catch (ex2) {
                                Lsys.newLog('exec2(' + name + ')：\r\n' + ex2);
                            }
                        }
                        ajax = null;
                        Lajax.delXml(name);
                    }
                } catch (ex) {
                    Lajax.delXml(name);
                    Lsys.newLog('ajax.onreadystatechange(' + name + ')：\r\n' + ex);
                }
            };
        }
    }
    return ajax;
};
Lajax.delXml = function (name) { delete Lajax._hashXml[name]; delete Lajax._hashName[name]; Lbase.gc(); };
Lajax.formatUri = function (uri) { return uri + (uri.indexOf('?') == -1 ? '?' : '&') + 'sendmethod=ajax'; };
Lajax.send = function (name, call, uri, par) {
    if (Lajax._hashName[name]) {
        var hn = Lajax._hcount[name];
        if (!hn) { hn = Lajax._hcount[name] = 0; }
        if (hn > 3) {
            delete Lajax._hashName[name];
            delete Lajax._hcount[name];
            Lsys.newLog('上次加载可能中断，已等待' + hn + '次，现取消上次加载:' + name);
        } else {
            Lajax._hcount[name] = hn + 1;
            return;
        }
    }
    var ajax = Lajax._hashName[name] = Lajax.initialize(name, call, par == undefined ? Lsys.area : par);
    ajax.open('GET', uri, !Lbase._ie); /*第三个参数设成 false ，则是同步方式打开的，就是必须等待这个完成之后，才会继续后面的语句。*/
    try { ajax.send(null); } catch (ex) { Lajax.delXml(name); Lsys.newLog('Ajax错误(' + name + ')：' + uri); }
    ajax = null;
};
Lajax.xmlSend = function (xml) {
    var ajax = Lajax.initialize(), uri = Lajax.formatUri(xml.geturi());
    ajax.open('POST', uri, true);
    ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
    ajax.setRequestHeader("If-Modified-Since", "0");
    ajax.send(xml.getdoc());
};
var Lad = { _ads: {}, _listAd: [], _txtAdPar: {}, _isBind: false };
Lad.append = function (id, type, uri, html, style) {
    var arr = Lad._ads[id];
    if (!arr) { Lad._ads[id] = arr = []; }
    arr.push({ 'uri': uri, 'html': html, 'type': type, 'style': style });
};
Lad.parameter = function (par) {
    var arr = Lad._ads[par.id];
    if (!arr) { Lad._ads[par.id] = arr = []; }
    arr._count = par.count;
    arr._skippar = par.txtList;
    arr._fly = par.fly;
    arr._style = par.style;
};
Lad.analy = function (ad, type, style) {
    var txt = '', obj = type ? document.createElement(type) : null;
    style = ad.style || style;
    switch (ad.type) {
        case 'txt': case 'img':
            txt = ad.type == 'txt' ? ad.html : '<img src="' + ad.html + '" ' + (style ? 'style="' + style + '"' : '') + ' />';
            if (obj) {
                var str = '<a target="_blank" ';
                if (ad.uri) { str += 'href="' + ad.uri + '"'; }
                str += '>' + txt + '</a>';
                txt = str;
            } else {
                obj = document.createElement('a');
                if (ad.uri) { obj.href = ad.uri; }
                obj.target = '_blank';
                if (style) { obj.setAttribute('style', style); }
            }
            obj.innerHTML = txt;
            break;
        case 'swf':
            txt = '<embed src="' + ad.uri + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent" ' + (style ? 'style="' + style + '"' : '') + '></embed>';
            if (!obj) { obj = document.createElement('span'); }
            obj.innerHTML = txt;
            break;
    }
    return obj;
};
Lad.load = function () {
    var objAd = Lad._ads, divId = null,adcount = 0,id,arr,nodeName;
    function append(obj, index) {
        if (index == 0) { obj.className = 'first'; }
        divId.appendChild(obj);
    }
    for (id in objAd) {
        adcount++;
        if (typeof objAd[id] != 'object') { continue; }
        divId = $(id);
        if (!divId) { continue; }
        arr = objAd[id];
        if (arr._skippar) { Lad.txtInit(arr, id); continue; }
        if (Lad._haveLoad) { continue; }
        divId.innerHTML = '';
        nodeName = divId.nodeName, index = 0, type = '';
        switch (nodeName) {
            case 'UL': case 'OL': type = 'li'; break;
            case 'TR': type = 'td'; break;
            case 'DL': type = 'dd'; break;
        }
        for (var i = 0, l = arr.length; i < l; i++) {
            var ad = arr[i], obj = Lad.analy(ad, type, arr._style);
            if (!obj) { continue; }
            append(obj, index++);
        }
	if (index == 0) { divId.style.display = 'none'; }
        var count = arr._count;
        if (!count || index >= count || !Lad._defaultTxt) { continue; }
        var nullAd = { 'uri': null, 'html': Lad._defaultTxt, 'type': 'txt' };
        for (i = index; i < count; i++) {
            var obj = Lad.analy(nullAd, type, arr._style);
            if (!obj) { continue; }
            append(obj, i);
        }
    }
    if (!adcount) {
        Lsys.newTimeout('reloadAd', setTimeout(Lad.load, 1000));
        return;
    }
    Lad._haveLoad = true;
    Lbf.adFixed();
};
Lad.txtInit = function (arr, tableId) {
    var par = arr._skippar.split(','), xad = Lad._txtAdPar;
    xad.tableId = tableId;
    xad.arrskip = par;
    xad.count = arr._count || arr.length;
    xad.arr = arr;
    Lad._isBind = true;
};
Lad.txtList = function () {
    switch (Lsys.matchType) {
        case 1:
        case 3:
            Lbf.dataRefBgClass();
            return;
    }
    var xad = Lad._txtAdPar, tbody = $(xad.tableId);
    if (!tbody) { return; }
    var arr = xad.arr, arrskip = xad.arrskip, count = xad.count, adNull = { 'uri': '', 'html': Lad._defaultTxt, 'type': 'txt' }, rows = tbody.rows, rowLength = rows.length;
    Lad._listAd = [];
    function getRowIndex(j, skip) {
        var tr, j2 = 0, x = 0;
        for (x = j; x < rowLength && j2 < skip; x++) {
            tr = rows[x];
            j++;
            if (!tr.id || tr.hide || tr._colltop) { continue; }
            j2++;
        }
        if (x < rowLength) {
            tr = rows[x];
            if (!tr.id || tr.hide) { j++; }
        }
        return j;
    }

    var adIndex = 0, adLength = 0;
    function ctr(j2) {
        var tr, td, ad;
        td = document.createElement('td');
        td.colSpan = Lsys.colspan;
        ad = arr[adIndex] || adNull;
        td.className = 'txtad';
        td.innerHTML = '广告：' + Lad.analy(ad, 'td').innerHTML;/*<span class="txtadClose" >x</span>
        td.childNodes[0].onclick = Lad.txtCloseClick;*/
        tr = tbody.insertRow(j2);
        tr.appendChild(td);
        Lad._listAd.push(tr);
        adIndex++;
        adLength++;
        rowLength++;
    }
    var index = 0;
    for (var j = getRowIndex(0, parseInt(arrskip[index++]) || 3); j < rowLength; ) {
        ctr(j);
        if (adLength >= count) { break; }
        j = getRowIndex(j, parseInt(arrskip[index++]) || 3);
    }
    while (adLength < count) { ctr(rowLength); }
    Lbf.dataRefBgClass();
};
Lad.txtListClose = function () {
    var ads = Lad._listAd, tr;
    for (var i = 0, l = ads.length; i < l; i++) { tr = ads[i]; if (tr && tr.parentNode) { tr.parentNode.removeChild(tr); } }
    Lad._listAd = [];
};
Lad.txtCloseClick = function () { Lad.txtListClose(); Lbf._stopAd = true; };
Lad.txtListBind = function () {
    if (Lbf._stopAd || Lsys.matchType == 1) { Lbf.dataRefBgClass(); return; }
    if (!Lad._isBind) { Lsys.newTimeout('txtListBind', setTimeout(Lad.txtListBind, 1000)); return; }
    Lad.txtListClose();
    Lad.txtList();
};
var Lcookie = { flash: false,
    set: function (name, value, day, hour, minute, path) {
        if (Lcookie.flash) { Lflash.write(name, value); return; }
        var expires = new Date();
        if (typeof (day) == "number") { expires.setDate(expires.getDate() + day); }
        if (typeof (hour) == "number") { expires.setHours(expires.getHours() + hour); }
        if (typeof (minute) == "number") { expires.setMinutes(expires.getMinutes() + minute); }
        document.cookie = name + "=" + escape(value) + ";" + (day || hour || minute ? " expires=" + expires.toGMTString() : "") + ((path == null) ? "" : "; path=" + path);
    },
    get: function (name, dv) {
        if (Lcookie.flash) { var s = Lflash.read(name); if (s == undefined) { return dv || ''; } else { return s; } }
        var arr = document.cookie.split("; "), l = arr.length;
        for (var i = 0; i < l; i++) { var kv = arr[i].split("="); if (name == kv[0]) { return unescape(kv[1]); } }
        return dv;
    },
    remove: function (name) {
        document.cookie = name + "=; expires=Fri, 31 Dec 1000 23:59:59 GMT;";
        if (Lcookie.flash) { Lflash.remove(name); }
    },
    keys: function (name, isInt) {
        var objKey = {}, cookie = Lcookie.flash ? Lflash.read(name) : Lcookie.get(name, null);
        if (!cookie) { return objKey; }
        var arr = cookie.split(';');
        for (var i = 0, l = arr.length; i < l; i++) { var d = arr[i].split('='); objKey[d[0]] = isInt ? parseInt(d[1] || 0) : (d[1] || ''); }
        return objKey;
    },
    value: function (objs, name, dv) {
        var v = objs[name];
        if (v == undefined) { return dv; }
        switch (typeof dv) {
            case 'number': return parseFloat(v);
            case 'boolean': return v != '';
            default: return v;
        }
    }
};
var Lposition = {};
Lposition.cursor = function (evt) {
    var ml = evt ? document.body.scrollLeft : document.documentElement.scrollLeft, mt = evt ? document.body.scrollTop : document.documentElement.scrollTop;
    evt = evt ? evt : (window.event ? window.event : null);
    var x = evt.x != undefined ? evt.x : evt.pageX, y = evt.y != undefined ? evt.y : evt.pageY;
    return { 'x': x + ml, 'y': y + mt };
};
Lposition.cursorY = function (evt) {
    evt = evt ? evt : (window.event ? window.event : null);
    var y = evt.y != undefined ? evt.y + (document.body.scrollTop || document.documentElement.scrollTop) : evt.pageY;
    return y;
};
Lposition.offset = function (o, o2, div, topAlign) {
    var oo = o, x = 0, y = 0, x2 = 0, y2 = 0;
    do { x += o.offsetLeft || 0; y += o.offsetTop || 0; o = o.offsetParent; } while (o);
    if (o2) {
        var w = o2.clientWidth, h = o2.clientHeight, dw = document.body.clientWidth;
        x2 = ((x + w > dw) ? dw - w : x);
        y2 = topAlign ? ((y - h < 1) ? 0 : y - h) : (y + oo.clientHeight);
    } else { x2 = x; y2 = y; }
    if (div) { div.style.left = x2 + 'px'; div.style.top = y2 + 'px'; }
    return { "x": x, "y": y, 'x2': x2, 'y2': y2 };
};
var Ltransparent = { _o: null, _count: 0, _index: 0, _out: 0 };
Ltransparent.begin = function (o, count) {
    if (count) {
        clearTimeout(Ltransparent._out);
        Ltransparent._o = o;
        Ltransparent._count = count;
        Ltransparent._index = 1;
        o.style.visibility = 'visible';
    } else { o = Ltransparent._o; }
    if (document.all) { o.style.filter = 'alpha(opacity=' + Ltransparent._index + ')'; } else { o.style.opacity = Ltransparent._index * 0.01; }
    Ltransparent._index += 4;
    if (Ltransparent._index < Ltransparent._count) { Ltransparent._out = setTimeout(Ltransparent.begin, 10); }
};
Ltransparent.end = function () {
    var o = Ltransparent._o;
    if (document.all) { o.style.filter = 'alpha(opacity=' + Ltransparent._index + ')'; } else { o.style.opacity = Ltransparent._index * 0.01; }
    Ltransparent._index -= 4;
    if (Ltransparent._index > 0) { Ltransparent._out = setTimeout(Ltransparent.end, 20); } else { o.style.visibility = 'hidden'; }
};
var Lchange = {};
Lchange.decpoint = function (tmpior, show) {
    var x = tmpior < 0 ? -1 : 1;
    tmpior = (Math.floor(Math.abs(tmpior) * show + 1 / show)) / show;
    return (tmpior * x);
};
Lchange.otherIor = function (d, x1, x2) {
    if (!d[x1] && !d[x2]) { return; }
    var ior = [], iorH = d[x1] || 0, iorC = d[x2] || 0;
    if (iorH < 3) { iorH *= 1000; }
    if (iorC < 3) { iorC *= 1000; }
    switch (Lsys.oddtype) {
        case "H": /*香港變盤(輸水盤)*/
            ior = Lchange.hkIor(iorH, iorC); break;
        case "M": /*馬來盤*/
            ior = Lchange.maIor(iorH, iorC); break;
        case "I": /*印尼盤*/
            ior = Lchange.indIor(iorH, iorC); break;
        case "E": /*歐洲盤*/
            ior = get_EU_ior(iorH, iorC); break;
        default: /*香港盤*/
            ior[0] = iorH; ior[1] = iorC;
    }
    ior[0] /= 1000;
    ior[1] /= 1000;
    ior[0] = Lchange.decpoint(ior[0], Lsys.iorshow);
    ior[1] = Lchange.decpoint(ior[1], Lsys.iorshow);
    d[x1] = ior[0];
    d[x2] = ior[1];
};
Lchange.hkIor = function (hr, cr) {/*換算成輸水盤賠率*/
    if (hr <= 1000 && cr <= 1000) { return [hr, cr]; }
    var lowRatio, nowRatio, highRatio, nowType = "", line = 2000 - (hr + cr);
    if (hr > cr) { lowRatio = cr; nowType = "C"; } else { lowRatio = hr; nowType = "H"; }
    if (((2000 - line) - lowRatio) > 1000) {
        nowRatio = (lowRatio + line) * (-1); /*對盤馬來盤*/
    } else {
        nowRatio = (2000 - line) - lowRatio; /*對盤香港盤*/
    }
    if (nowRatio < 0) { highRatio = Math.floor(Math.abs(1000 / nowRatio) * 1000); } else { highRatio = (2000 - line - nowRatio); }
    if (nowType == "H") { return [lowRatio, highRatio]; } else { return [highRatio, lowRatio]; }
};
Lchange.maIor = function (hr, cr) {/*換算成馬來盤賠率*/
    if ((hr <= 1000 && cr <= 1000)) { return [hr, cr]; }
    var lowRatio, highRatio, nowType = "", line = 2000 - (hr + cr);
    if (hr > cr) { lowRatio = cr; nowType = "C"; } else { lowRatio = hr; nowType = "H"; }
    highRatio = (lowRatio + line) * (-1);
    if (nowType == "H") { return [lowRatio, highRatio]; } else { return [highRatio, lowRatio]; }
};
Lchange.indIor = function (hr, cr) {/*換算成印尼盤賠率*/
    var arr = Lchange.hkIor(hr, cr);
    hr = arr[0]; cr = arr[1];
    hr /= 1000; cr /= 1000;
    if (hr < 1) { hr = (-1) / hr; }
    if (cr < 1) { cr = (-1) / cr; }
    return [hr * 1000, cr * 1000];
};
var Lsys = { time: 0, cid: 1, coname: 'SB', arrlan: [], plc: 1, iorpoint: 2, iorshow: 100, oddtype: 'H', netmode: false, name: '', currentMenu: '', stop: false, matchType: 0, uid: null, hashOut: {}, colspan: 11, linkArea: 'b2', area: '', isOpenZd: false, userid: 0, usernamecoll: '', mymatch: [], isnet: false, alog: [] };
Lsys.arrPath = ['pl_bf_ds_8bo_', 'pl_bf_ds_ch_8bo_', 'pl_bf_zd_ch_8bo_'];
Lsys.domainAspx = 'read.aspx?name=';
Lsys.domainJs = 'js/{0}.js';
Lsys.pathPlInit = '';
Lsys.pathPlDs = '';
Lsys.pathPlZd = '';
Lsys.pathBf = 'bf_ch_8bo';
Lsys.pathDetail = 'bf_detail_ch';
Lsys.isConvert = true;
Lsys.writeLog = false;
Lsys.refInter = 2000;
Lsys.title = document.title;
Lsys.error = [];
Lsys.printerror = function () { if (Lsys.error.length > 0) { alert('数据源有错误：\n\n' + Lsys.error.join('\n')); } };
Lsys.killError = function () { return true; };
Lsys.pageReload = function () { location.reload(); };
Lsys.delTimeout = function (name) {
    var obj = Lsys.hashOut[name];
    if (obj) { window.clearTimeout(obj.id); }
    delete Lsys.hashOut[name];
};
Lsys.newTimeout = function (name, id) { Lsys.delTimeout(name); Lsys.hashOut[name] = { 'id': id, 'area': Lsys.area, 'time': new Date().toLocaleTimeString() }; };
Lsys.endTimeout = function (name) { delete Lsys.hashOut[name]; };
Lsys.getTimeout = function (name) { return Lsys.hashOut[name]; };
Lsys.clearLog = function (o) { o.parentNode.style.display = 'none'; Lsys.alog = []; };
Lsys.printLog = function () {
    var arr = Lsys.alog, o = this.div;
    if (arr.length < 1) { return; }
    if (!o) {
        var d = document;
        this.div = o = d.createElement('div');
        o.style.cssText += ';text-align:left;border:solid 1px black;padding:4px;width:90%;position:absolute;left:0;top:0;z-index:8000;background-color:white;';
        o.title = '双击隐藏';
        o.ondblclick = function () { this.style.display = 'none'; };
        d.body.insertBefore(o, d.body.childNodes[0]);
    }
    o.style.display = '';
    o.innerHTML = '<a style="color:red;" onclick="Lsys.clearLog(this)">清除调试记录</a><br>' + arr.join('<br/>');
};
Lsys.newLog = function (msg) {
    if (Lsys.alog.length > 100) { Lsys.alog.splice(0, Lsys.alog.length - 20); }
    Lsys.alog.push((new Date()).toLocaleTimeString() + ' : ' + msg);
    var x = Lsys.alog_load;
    if (!x) {
        Lsys.alog_load = {};
        var o = $('ffunselect');
        if (!o) { return; }
        o = o.getElementsByTagName('h3')[0];
        o.ondblclick = Lsys.printLog;
        x = Lsys.alog_load = o;
    }
};
Lsys.initTimeout = function () {
    Lsys.stop = true;
    Lbf._loadmatchcount = 0;
    var obj;
    for (var key in Lsys.hashOut) { obj = Lsys.hashOut[key]; if (obj.area != Lsys.area) { window.clearTimeout(obj.id); } }
    Lsys.uid = null;
    Lsys.uidInit();
};
Lsys.click = function () {
    var a = this;
    Lsys.load(a._name);
    Lsys.initTimeout();
    Lsys.loadData();
    if (Lsys.currentMenu) { Lsys.currentMenu.className = Lsys.currentMenu._css || ''; }
    Lsys.currentMenu = a;
    if (a.className && a.className != 'sel') { a._css = a.className; }
    a.className = 'sel';
    a.blur();
};
Lsys.setTitle = function () { document.title = Lsys.title + Lsys.name; };

Lsys.tryEval = function (txt) {
    try {
        eval(txt);
        return 0;
    } catch (ex) {
        var i, l, errors = [], arr = txt.split(/\r\n/gi);
        for (i = 0, l = arr.length; i < l; i++) {
            txt = arr[i];
            if (!txt) { continue; }
            try { eval(txt); } catch (ex) { errors.push('第' + i + '行（' + ex + '）：' + txt); }
        }
        if (errors.length > 0) {
            Lsys.error = errors;
            Lsys.newLog('数据源有错误' + errors.join('\n'));
        }
        return errors.length;
    }
};
Lsys.collskip = false;
Lsys.load = function (area) {
    Lsys.cid = 1;
    Lsys.showtime = 0;
    Lsys.coname = '煌冠';
    Lsys.arrlan = ',bf_8bo_big_1,bf_8bo_gb_1,bf_8bo_en_1'.split(',');
    Lsys.pathPlInit = '';
    Lsys.pathPlDs = '';
    Lsys.pathPlZd = '';
    Lsys.plc = 1;
    Lsys.iorpoint = 2;
    Lsys.iorshow = 100;
    Lsys.colspan = 11;
    Lsys.oddtype = "H";
    Lsys.name = '';
    Lsys.linkArea = 'b2';
    Lsys.matchType = 0;
    Lsys.isConvert = true;
    Lsys.isOpenZd = false;
    Lsys.lan = 0;
    var isSetPath = true, cskip = false;
    switch (area) {
        case 'gunqiu':
            Lsys.name = '|煌冠滚球比分';
            Lsys.matchType = 2;
            Lsys.colspan = 12;
            Lsys.ispi = 1;
            Lsys.isOpenZd = true;
            break;
        case 'world':
            Lsys.name = '|世界杯比分';
            Lsys.arrlan = ',bf_8bo_big_fifa,bf_8bo_gb_fifa,bf_8bo_en_fifa'.split(',');
            Lsys.pathPlInit = 'pl_bf_ds_8bo_fifa';
            Lsys.colspan = 12;
            Lsys.isOpenZd = true;
            cskip = true;
            break;
        case 'asia':
            Lsys.name = '|亚洲杯比分';
            Lsys.arrlan = ',bf_8bo_big_yzb,bf_8bo_gb_yzb,bf_8bo_en_yzb'.split(',');
            Lsys.pathPlInit = 'pl_bf_ds_8bo_yzb';
            Lsys.colspan = 12;
            Lsys.isOpenZd = true;
            Lsys.showtime = 1;
            cskip = true;
            break;
        case 'zucai':
            Lsys.name = '|足球彩票比分';
            Lsys.arrlan = ',bf_zc_big_8bo,bf_zc_gb_8bo,bf_zc_en_8bo'.split(',');
            Lsys.plc = 0;
            Lsys.matchType = 3;
            Lsys.colspan = 12;
            Lsys.pathPlInit = 'pl_bf_zc_ds';
            Lsys.pathPlDs = 'pl_bf_ds_ch_8bo_1';
            Lsys.lan = 2;
            isSetPath = false;
            cskip = true;
            break;
        case 'huangguan':
            Lsys.name = '|煌冠足球比分';
            Lsys.isOpenZd = true;
            Lsys.ispi = 1;
            break;
        case 'aocai':
            Lsys.name = '|澳彩足球比分';
            Lsys.plc = 0;
            Lsys.arrlan = ',bf_8bo_big_2,bf_8bo_gb_2,bf_8bo_en_2'.split(',');
            Lsys.cid = 2;
            Lsys.coname = '澳彩';
            Lsys.isConvert = false;
            Lsys.linkArea = 'b3';
            Lsys.pathPlZd = '*';
            break;
        case 'yinni':
            Lsys.name = '|印尼足球比分';
            Lsys.oddtype = "I";
            Lsys.coname = '印尼';
            Lsys.linkArea = 'b4';
            Lsys.ispi = 1;
            break;
        case 'malai':
            Lsys.name = '|马来足球比分';
            Lsys.oddtype = "M";
            Lsys.coname = '马来';
            Lsys.linkArea = 'b5';
            Lsys.ispi = 1;
            break;
        case 'yinghe':
            Lsys.name = '|盈禾足球比分';
            Lsys.arrlan = ',bf_8bo_big_14,bf_8bo_gb_14,bf_8bo_en_14'.split(',');
            Lsys.plc = 0;
            Lsys.cid = 14;
            Lsys.coname = '赢禾';
            Lsys.isConvert = false;
            Lsys.linkArea = 'b6';
            break;
        case 'jingjian':
            Lsys.name = '|精简版足球比分';
            Lsys.plc = 0;
            Lsys.matchType = 1;
            Lsys.colspan = 9;
            break;
        case 'ylg':
            Lsys.name = '|永利高足球比分';
            Lsys.arrlan = ',bf_8bo_big_16,bf_8bo_gb_16,bf_8bo_en_16'.split(',');
            Lsys.plc = 0;
            Lsys.coname = '永利高';
            Lsys.cid = 16;
            Lsys.isConvert = false;
            Lsys.pathPlZd = '*';
            Lsys.linkArea = 'b116';
            Lsys.iorpoint = 3;
            break;
        case 'lb':
            Lsys.name = '|立博足球比分';
            Lsys.arrlan = ',bf_8bo_big_20,bf_8bo_gb_20,bf_8bo_en_20'.split(',');
            Lsys.plc = 0;
            Lsys.coname = '立博';
            Lsys.cid = 20;
            Lsys.isConvert = false;
            Lsys.pathPlZd = '*';
            Lsys.linkArea = 'b117';
            Lsys.iorpoint = 3;
            break;
        case 'lj':
            Lsys.name = '|利记足球比分';
            Lsys.arrlan = ',bf_8bo_big_10,bf_8bo_gb_10,bf_8bo_en_10'.split(',');
            Lsys.plc = 0;
            Lsys.coname = '利记';
            Lsys.cid = 10;
            Lsys.isConvert = false;
            Lsys.pathPlZd = '*';
            Lsys.linkArea = 'b110';
            break;
        case 'bet365':
            Lsys.name = '|bet365足球比分';
            Lsys.arrlan = ',bf_8bo_big_5,bf_8bo_gb_5,bf_8bo_en_5'.split(',');
            Lsys.plc = 0;
            Lsys.coname = 'bet365';
            Lsys.cid = 5;
            Lsys.isConvert = false;
            Lsys.linkArea = 'b105';
            Lsys.iorpoint = 3;
            Lsys.pathPlZd = '*';
            break;
        default:
            area = 'all';
            Lsys.isOpenZd = true;
            Lsys.arrlan = ',bf_8bo_big,bf_8bo_gb,bf_8bo_en'.split(',');
            Lsys.ispi = 1;
            break;
    }
    var cookie = Lbf._cookieNumber = Lcookie.keys('Lbf_number');
    Lbf._cookielan = Lsys.lan || Lcookie.value(cookie, 'lan', 1); /*语言 =1繁体 ,=2简体,=3 英文*/
    $('alan_1').className = ''; $('alan_2').className = ''; $('alan_3').className = '';
    $('alan_' + Lbf._cookielan).className = "red"; 
    Lsys.collskip = cskip;
    Lsys.area = area;
    if (isSetPath) {
        Lsys.pathPlInit = Lsys.pathPlInit || (Lsys.arrPath[0] + Lsys.cid); /*SB赔率 初盘数据*/
        Lsys.pathPlDs = Lsys.pathPlDs || (Lsys.arrPath[1] + Lsys.cid); /*SB赔率 单式变化数据*/
        Lsys.pathPlZd = Lsys.pathPlZd || (Lsys.arrPath[2] + Lsys.cid); /*SB赔率 走地变化数据*/
    }
    Lsys.pathPlZd == '*' && (Lsys.pathPlZd = '');
    Lbf.setSwitchInfo(0, 0, '正在加载' + Lsys.name + '...');
};
Lsys.formatUri = function (name) {
    var url = '';
    if (Lpar.mode == 0) { url = Lsys.domainAspx + name + '&con=' + Lsys.uid + '&rnd='; } else { url = Lsys.domainJs.replace('{0}', name) + '?rnd='; }
    return url + Math.random();
};
Lsys.init = function () {
    var wMenu = $('wSysMenu'), area = location.href.split('#')[1] || 'all', as = wMenu.getElementsByTagName('a'), a;
    for (var i = 0, l = as.length; i < l; i++) {
        a = as[i];
        if (a.target) { continue; }
        a._name = a.href.split('#')[1] || '';
        a.onclick = Lsys.click;
        if (a._name == area) { a.className = 'sel'; Lsys.currentMenu = a; }
    }
    Lsys.load(area);
};
Lsys.menu2out = function () { this.className = 'bmenu2'; };
Lsys.menu2 = function (o) {
    !o.onmouseout && (o.onmouseout = Lsys.menu2out);
    o.className = 'bmenu2 bmenu2over';
};
Lsys.loadData = function () {
    if (Lsys.uid == null) { Lsys.newTimeout('loadData', setTimeout(Lsys.loadData, 100)); return; }
    Lbf._tryLMIC = 0;
    Lbf.loadmatchinfo(true);
    var wf = $('wls_frame');
    if (wf) { wf.src = Lsys.loadframematch(); }
};
Lsys.loadframematch=function(){ return Lpar.bmatchpath + (Lsys.area == 'zucai' ? 'sfc2' : 'index2') + '.html?rnd='+Math.random();};
Lsys.loadUid = function (txt) { Lsys.uid = parseInt(txt); };
Lsys.uidInit = function () { if (Lpar.mode == 0) { var url = Lsys.formatUri('&action=con'); Lajax.send('uidInit', Lsys.loadUid, url); } else { Lsys.loadUid(1); } };
Lsys.poplayerMouseUp = function (e) {
    if (!e) { e = window.event; }
    if (e.button == 2) { this.onmouseout = null; }
};
Lsys.uidInit();
var Lnet = { _run: false, _outime: 180000, _subtime: 180000, _first: false, _hideline: 0, _secondTxt: null, _secondWait: 60000, _startTime: null, _outId: null, _outId2: null, _outId3: null,_outId_end:null, _toUri: null, _netTest: null, _objLi: [] };
Lnet.hide = function (n, hl) {
    clearTimeout(Lnet._outId);
    clearTimeout(Lnet._outId0);
    clearTimeout(Lnet._outId2);
    clearTimeout(Lnet._outId3);
    clearTimeout(Lnet._outId_end);
    Lnet._netTest && (Lnet._netTest.style.visibility = 'hidden');
    Lnet._run = false;
    hl && (Lnet._hideline = hl);
};
Lnet.autohide = function () {
    Lnet._run && (Lnet.hide()); 
};
Lnet.toTarget = function () { if (Lnet._toUri) { location.href = Lnet._toUri; } };
Lnet.waitSecond = function () {
    var sec = Lnet._secondTxt;
    if (!sec) { return; }
    if (sec._second > 0) { sec.innerHTML = (sec._second--) + '秒后自动跳转到此站点'; } else { sec.innerHTML = ''; }
};
Lnet.isTimeout = function (lu, iscancel) {
    var d = new Date(parseInt(lu)), n = new Date(new Date() - parseInt(Lsys.time || 0)), max = n - d;
    if (max > Lnet._subtime) {
        return true;
    } else {
        if (iscancel && Lnet._run) {
            clearTimeout(Lnet._outId);
            Lnet._netTest._title.innerHTML = '服务器更新数据已经自动恢复，本提示即将隐藏';
            Lnet._secondTxt && (Lnet._secondTxt.innerHTML = '跳转被取消');
            setTimeout(Lnet.hide, 4000);
        }
        return false;
    }
};
Lnet.appendLink = function (txt, uri) {
    var div = $('wNetSelBox');
    if (!div) { return; }
    if (!txt) { div.innerHTML = ''; return; }
    div.innerHTML += '<a href="' + uri + '">' + txt + '</a>';
};
Lnet.init = function () {
    var ul = Lpar.domain, i = 0;
    Lnet.appendLink('');
    for (var uri in ul) { i++ != 0 && (Lnet.appendLink(ul[uri], uri)); }
};
Lnet.result = function (txt, index) {
    var pl, second = ((new Date() - Lnet._startTime) / 1000), error, li = Lnet._objLi[index];
    if (txt.indexOf('lu:') != -1) {
        try { pl = eval('({' + txt + '})'); } catch (ex) { return; }
        if (Lnet.isTimeout(pl.lu)) { error = true; txt = '超时'; } else { txt = second + '秒'; }
    } else {
        if (txt == '1!' || txt == '2!' || txt == '3!') { txt = second + '秒'; } else { error = true; }
    }
    li._txt.innerHTML = txt;
    li._complute = true;
    if (!error && !Lnet._first) {
        Lnet._first = true;
        Lnet._toUri = li._uri;
        li._txt.innerHTML += '<b>（最快）</b>';
        li.className = 'LnetLi LnetBest';
        var sec = Lnet._secondTxt = document.createElement('span');
        var k = sec._second = Lnet._secondWait / 1000;
        sec.innerHTML = k + '秒后自动跳转到此站点';
        sec.className = 'LnetSecondWait';
        li._txt.appendChild(sec);
        Lnet._outId = setInterval(Lnet.waitSecond, 1000);
        Lnet._outId2 = setTimeout(Lnet.toTarget, Lnet._secondWait);
    }
};
Lnet.start = function () { Lsys.newTimeout('didTestweb', setTimeout(Lnet.test, Lnet._outime)); };
Lnet.start2 = function () { !Lnet._outId0 && (Lnet._outId0 = setTimeout(Lnet.test, Lnet._outime)); };
Lnet.testEnd = function () {
    var lis = Lnet._objLi, count = 0, i, li;
    for (i = 0; li = lis[i++]; ) { if (!li._complute) { count++; li._txt.innerHTML = '测试超时'; } }
    if (count == i) { Lnet._outId_end = setTimeout(Lsys.pageReload, 60 * 1000); }
};
Lnet.test = function (temp, title) {
    if (Lnet._run) { return; }
    if (Lnet._hideline) { Lnet._hideline--; return; }
    Lnet.hide();
    var divNet = Lnet._netTest, lis = Lnet._objLi, d = document;
    Lnet._startTime = new Date();
    Lnet._run = true;
    Lnet._first = false;
    Lnet._toUri = '';
    !title && (title = '您当前浏览的服务器更新数据不及时，请切换到其他速度较快的服务器。');
    if (!divNet) {
        divNet = Lnet._netTest = d.createElement('ul');
        divNet.className = 'LnetBox';
        var obj = Lpar.domain;
        var li, txt, uri, index = 0;
        divNet.innerHTML = '<li class="LnetClose"><div class="closebox" onclick="Lnet.hide(0,10);">x</div><div class="LnetTitle">' + (title || '') + '</div></li>';
        divNet._title = divNet.getElementsByTagName('div')[1];
        for (var key in obj) {
            txt = obj[key];
            uri = key;
            li = d.createElement('li');
            li.className = 'LnetLi';
            li._index = index++;
            li._link = uri + '/Lnet.aspx?path=' + Lsys.domainJs.replace('{0}', Lsys.pathBf) + '&index=' + li._index + '&rnd=';
            li.innerHTML = '<span class="LnetUri"><a href="' + uri + '">' + uri + ' <b>' + txt + '</b></a></span><span class="LnetTxt">正在测速...</span>';
            li._uri = uri;
            li._name = txt;
            li._key = key;
            li._txt = li.getElementsByTagName('span')[1];
            lis.push(li);
            divNet.appendChild(li);
        }
        var div = d.createElement('div');
        div.className = 'Lnet';
        div.appendChild(divNet);
        d.body.insertBefore(div, d.body.childNodes[0]);
    } else {
        divNet._title.innerHTML = title;
    }
    var uri, script, he = document.getElementsByTagName('head')[0];
    for (var i = 0, li; li = lis[i++]; ) {
        li._txt.innerHTML = '正在测速...';
        li._complute = false;
        li.className = 'LnetLi';
        script = $('Lnetli' + i);
        if (script) { script.parentNode.removeChild(script); }
        script = d.createElement('script');
        script.id = 'Lnetli' + i;
        script.type = 'text/javascript';
        script.src = li._link + Math.random();
        he.appendChild(script);
    }
    divNet.style.visibility = 'visible';
    Lbf.adFixed();
    Lnet._outId3 = setTimeout(Lnet.testEnd, 10000);
};
var Lmatch = { date: '', otherinfo: '', _match: {}, _data: [], _odds: {}, _pk: [], _country: {}, noMatch: false };
var Lbf = { _isdatainit: false, _tempcoll: '', _arrcoll: [], _maxline: 0, _tryLMIC: 0 };
Lbf._countryId = 0;
Lbf._runcount = 0;
Lbf._loadAd = false;
Lbf._stopAd = false;
Lbf._hidecount = 0;
Lbf._arrdxpk = "0,0/0.5,0.5,0.5/1,1,1/1.5,1.5,1.5/2,2,2/2.5,2.5,2.5/3,3,3/3.5,3.5,3.5/4,4,4/4.5,4.5,4.5/5,5,5/5.5,5.5,5.5/6,6,6/6.5,6.5,6.5/7,7,7/7.5,7.5,7.5/8,8,8/8.5,8.5,8.5/9,9,9/9.5,9.5,9.5/10,10,10/10.5,10.5,10.5/11,11,11/11.5,11.5,11.5/12,12,12/12.5,12.5,12.5/13,13,13/13.5,13.5,13.5/14,14,14/14.5,14.5,14.5/15,15,15/15.5,15.5,15.5/16,16,16/16.5,16.5,16.5/17,17,17/17.5,17.5,17.5/18,18,18/18.5,18.5,18.5/19,19,19/19.5,19.5,19.5/20,20".split(",");
Lbf._arrweater = ["", "晴天", "少雲", "多雲", "陰天", "小雨", "中到大雨", "雷陣雨", "雷暴", "小雪", "大雨", "晴天", "晴間多雲", "少雲", "多雲", "雨加雪", "", "", "晴間多雲", "小雷雨", "小陣雨", "汽霧", "凍霧", "零星小雨", "中雨", "小陣雪", "細雨", "陣雪", "風塵", "低空飄雪", "大陣雪", "中雪"];
Lbf._arrpkfb = ['', 'bgYellow', 'bgYellow']; /*盘口升降*/
Lbf._arrpksj = ['', 'bgRed', 'bgGreen'];
Lbf._arrsound = ['0-8bo', '1-music', '2-good', '3-sing', '4-goal', '5-broadcast', '6-cheer', '7-payout', '8-gooooal', '9-bet007', '10-spbo', '11-zqzz', '12-jql', '13-7mcn', '14-90ko', '15-310v'];
Lbf._arrjq = "i_goal,i_dq,i_wl,i_hp,i_redp,i_redyellow".split(",");
Lbf._arrcary2 = ",SB,澳彩,印尼,马来,云博,12bet,,盈禾".split(",");
Lbf._arrqcname = '全场,上半场'.split(',');
Lbf._arr_smtj = [, 0, , 46]; /*加几分钟*/
Lbf._arr_smtd1 = [, 45, , 90]; /*大于几分钟*/
Lbf._arr_smtd2 = ",45+,,90+".split(','); /*大于几分钟等于几分钟*/
Lbf._arr_smtd3 = [, 1, , 46]; /*小于几分钟等于几分钟*/
Lbf._arrstatus = [];
Lbf._collhash = {};
Lbf._loadmatchcount = 0;
Lbf._ajaxmatch = {};
Lbf._odds = {};
Lbf._detail = null;
Lbf._spop = null;
Lbf._poplayer = null;
Lbf._isshow = true;
Lbf._tbody = null;
Lbf._outIndex = 0;
Lbf._arrads = [];
Lbf._arrrqpk = [];
Lbf._objRedCard = {};
Lbf._objGoals = {};
Lbf._objMoveBottom = {};
Lbf._objGunQiu = {};
Lbf._objPkClass = {};
Lbf._arrZc = [];
Lbf._hashtime = {};
Lbf._hashodds = {};
Lbf._hashhide = {};
Lbf._hashtr = {};
Lbf._hashdetail = {};
Lbf._time_odds = 0;
Lbf._cookiepki = 1;
Lbf._cookielan = 1;
Lbf._cookiepm = 1;
Lbf._cookiesound = 0;
Lbf._cookierqs = 1;
Lbf._ckCredSound = 1;
Lbf._ckGunQiuView = 1;
Lbf._cookierqw = 1;
Lbf._ckCredWindow = 1;
Lbf._cookiehideids = '';
Lbf._cookiewinp = 0;
Lbf._cookieother = 1;
Lbf._cookiejingyin = 0;
Lbf._cookiesbc = 1;
Lbf._cookieNumber = {};
Lbf._gunqiuVisible = 0;
Lbf._gunqiuDx = 0;
Lbf._gunqiuBz = 0;
Lbf._wLogin = null;
Lbf.cookieNumberSet = function (name, value) {
    var arr = [], cookie = Lbf._cookieNumber;
    cookie[name] = value;
    for (var key in cookie) { arr.push(key + '=' + cookie[key]); }
    Lcookie.set('Lbf_number', arr.join(';'), 1000);
};
Lbf.matchTypeTd = function (tr, index) {
    var x = 0;
    switch (Lsys.matchType) {
        case 1:
        case 2:
            if (index > 3) {
                x = 2;
                switch (index) {
                    case 4: return tr.cells[4].childNodes[0]; break;
                    case 6: return tr.cells[4].childNodes[2]; break;
                }
            }
            break;
        case 3:
            x = -1; break;
    }
    return tr.cells[index - x];
};
Lbf.appendElement = function (html) {
    var hdiv = Lbf._hdiv, div = document.createElement('div');
    if (!hdiv) { hdiv = Lbf._hdiv = $('wFlyDiv'); }
    div.innerHTML = html;
    hdiv.appendChild(div);
};
Lbf.setCkMore = function () {
    var cookie = Lbf._cookieNumber;
    Lbf._gunqiuBz = Lcookie.value(cookie, 'gq_bz', 1);
    Lbf._gunqiuDx = Lcookie.value(cookie, 'gq_dx', 1);
    Lbf._gunqiuVisible = Lbf._gunqiuDx || Lbf._gunqiuBz;
    $('wGqoBz').checked = Lbf._gunqiuBz ? true : false;
    $('wGqoDx').checked = Lbf._gunqiuDx ? true : false;
    var name = Lcookie.value(cookie, '#ts' + Lsys.matchType, '') || (Lpar.isTable || Lsys.matchType == 2 ? 'dtable' : 'dline');
    Lbf.tablestyle(name, true);
    var obj = $('tstyle_' + name); if (obj) { obj.checked = true; }
    Lbf._cookieother = Lsys.matchType == 1 ? Lcookie.value(cookie, 'more1', 0) : Lcookie.value(cookie, 'more', 1);
    var v = Lbf._cookiejingyin = Lcookie.value(cookie, 'jy', 0);
    $('wCkJingyin').checked = v ? true : false;
    /*红黄牌/先开球/角球数/备注 =0 不开启,=1开启*/
    if (Lbf._cookieother == 1) {
        $('wCkMoreInfo0').checked = $('wCkMoreInfo').checked = true;
    } else {
        $('wCkMoreInfo0').checked = $('wCkMoreInfo').checked = false;
    }
};
Lbf.setSwitchInfo = function (prec1, prec2, txt) {
    var info = Lbf._switchInfo;
    if (!info) { info = Lbf._switchInfo = { panel: $('wSwitchInfo'), text: $('wsiText'), prec: $('wsiPrec'), prec1: 0, prec2: 0, hide: true }; }
    if (info.hide) { Ltransparent.begin(info.panel, 98); info.hide = false; }
    if (txt) { info.text.innerHTML = txt; }
    info.prec.innerHTML = prec1 + '%';
    if (prec1 == 100) {
        info.hide = true;
        Lsys.newTimeout('hidePrec', setTimeout(Ltransparent.end, 300));
    } else if (prec2 > prec1) {
        info.prec1 = prec1;
        info.prec2 = prec2;
        Lsys.newTimeout('setPrec', setTimeout(Lbf.setSwitchPrec, 70));
    }
};
Lbf.setSwitchPrec = function () {
    var info = Lbf._switchInfo;
    info.prec.innerHTML = ++info.prec1 + '%';
    if (info.prec1 < info.prec2) { Lsys.newTimeout('setPrec', setTimeout(Lbf.setSwitchPrec, 70)); }
};
Lbf.formatForumUri = function (txt) { return txt.replace(/{bbsuri}/gi, Lpar.uriBbs); };
Lbf.loadMymatch = function (id, name, ids) {
    Lsys.userid = id;
    Lsys.username = name;
    var d = Lsys.mymatch = ids ? ids.split(',') : [], h = Lbf._collhash;
    for (var i in d) { h[d[i]] = true; }
    d = [];
    for (var id in h) { d.push(id); }
    Lsys.mymatch = d;
    if (!Lbf._isdatainit) { return; } /*还未加载*/
    Lbf._isdatainit = false;
    if (Lsys.stop || !Lbf._tbody) { return; } /*正在运行中*/
    /*已经加载完毕*/
    Lbf.datamatchcheck();
};
Lbf.setLogin = function (userkey) {
    if (userkey) { Lsys.userid = 0; Lsys.mymatch = []; if (!Lsys.stop) { Lbf.Collclear(true); } }
    Lbf._wLogin = $('matchselect');
    Lbf.collhistory(true);
    if (!Lbf._wLogin) { return; }
    var o = $('id-collico'); o && (o.innerHTML = '<a href="' + Lpar.uriBbs + 'member.php?mod=register.php" target="_blank">注册</a> <span style="color:green;">|</span> <a onclick="Lbf.idusernamefocus(this)">登录</a> 保存关注赛事');
    var txt = '';
    txt += '<form id="wLoginForm" action="{bbsuri}api.php?mod=sync&act=login" method="post" target="hideframe"><input type="hidden" value="' + Lpar.uriLive + 'ajax.aspx?action=login&id={0}&name={1}&key={2}&ids={3}" name="loginpath" /><input type="hidden" name="cookietime" value="2592000"  /><table border="0" cellpadding="0" cellspacing="1"><tr><td>用户名：</td><td><input type="text" class="loginTxt" name="username" maxlength="20" id="id-username" /></td><td> 密码：</td><td><input type="password" class="loginTxt" name="password" /></td><td><input type="submit" value="登录" class="loginBt" /></td><td class="tGray">';
    txt += '<a href="{bbsuri}member.php?mod=register.php" target="_blank">注册</a><span class="sfont">|</span><a href="{bbsuri}" target="_blank">进入社区</a></td></tr></table>';
    txt += '</form>';
    if (!userkey){ Lbase.createJsFile('wLoginStatus', Lbf.formatForumUri('{bbsuri}api.php?mod=sync&act=statusinfo&rnd=' + Math.random()), true, true);}
    Lbf._wLogin.innerHTML = Lbf.formatForumUri(txt);
};
Lbf.setLoginOk = function (id, name, userkey, myids, isset) {
    name = decodeURIComponent(name);
    isset && (Lbf._tempcoll = Lbf.Collcookie());
    Lbf.loadMymatch(id, name, myids);
    Lbf._loginbox && (Lbf._loginbox.style.display = 'none');
    if (!Lbf._wLogin) { Lbf.collhistory(false); return; }
    Lsys.usernamecoll = '<b style="color:green;">hi,<a target="_blank" href="' + Lpar.uriBbs + 'home.php?mod=space&amp;view=admin">' + name + '</a></b> ' + Lbf.collhistory() + ' 当前关注';
    var o = $('id-collico'); o && (o.innerHTML = Lsys.usernamecoll);
    var arr = [];
    arr.push('<div id="wLoginStatus">欢迎<a href="{bbsuri}home.php?mod=spacecp&ac=profile"  target="_blank"><b>' + name + '</b></a><span class="sfont" style="position:relative;">');
    arr.push('<ul styles="visiblity:hidden;" id="wForumMenu" onmouseover="this.style.visibility=\'visible\'" onmouseout="this.style.visibility=\'hidden\'">');
    arr.push('<li><a href="{bbsuri}home.php?mod=space&amp;view=admin"  target="_blank">我的主页</a></li>');
    arr.push('<li><a href="{bbsuri}home.php?mod=space&amp;do=thread&amp;view=me" target="_blank">我的主题</a></li>');
    arr.push('<li><a href="{bbsuri}home.php?mod=space&amp;do=thread&amp;view=me&amp;type=reply" target="_blank">我的帖子</a></li>');
    arr.push('<li><a href="{bbsuri}search.php?mod=forum&amp;adv=yes" target="_blank">我的精华</a></li>');
    arr.push('<li><a href="{bbsuri}home.php?mod=space&uid='+id+'&do=profile" target="_blank">我的资料</a></li>');
    arr.push('<li><a href="{bbsuri}home.php?mod=space&amp;do=favorite&amp;view=me" target="_blank">我的收藏</a></li>');
    arr.push('<li><a onclick="Lbf.collopen(\'' + Link.mycoll + '\')">我的关注</a></li>');
    arr.push('<li><a href="' + Lpar.uriBbs + 'home.php?mod=space&amp;do=friend" target="_blank">我的好友</a></li>');
    arr.push('</ul>');
    arr.push('|</span><a id="aForumEdit" onmouseover="$(\'wForumMenu\').style.visibility=\'visible\'" href="{bbsuri}home.php?mod=space&amp;view=admin" target="_blank">我的主页</a><span class="sfont">|</span><a href="{bbsuri}home.php?mod=spacecp&ac=profile" target="_blank">个人设置</a><span class="sfont">|</span><a href="{bbsuri}" target="_blank">进入社区</a><span class="sfont">|</span><a onclick="Lbf.setLogin(\'' + userkey + '\');" href="{bbsuri}api.php?mod=sync&act=logout&userkey=' + userkey + '" target="hideframe">安全退出</a></div>');
    isset && Lsys.loginref && (arr.push('<iframe src="' + Lsys.loginref + '?rnd=' + Math.random() + '" frameborder="0" style="border:none;width:2px;height:2px;" scrolling="no"></iframe>'));
    Lbf._wLogin.innerHTML = Lbf.formatForumUri(arr.join(''));
};
Lbf.runInit = function () {
    Lflash.write("test", "ok");
    var istrue = Lflash.read("test") == "ok";
    if (Lbf._runcount++ > 30 || istrue) {
        Lcookie.flash = istrue;
        Lbf.tryInit(istrue);
    } else {
        setTimeout(Lbf.runInit, 200);
    }
};
Lbf.init = function () { page_init(); Lflash.imReady(); Lbf.runInit(); };
Lbf.refcolor = function () { var cookie = Lbf._cookieNumber = Lcookie.keys('Lbf_number'), n = Lcookie.value(cookie, '#pkcolor', ''); n && (Lbf.pkcolor(n, true)); };
Lbf.tryInit = function (foo) {
    Lbf.setLogin();
    Lsys.init();
    Lnet.init();
    var arr = Lbf._arrstatus;
    arr[0] = ",推遲,推迟,Defer".split(",");
    arr[1] = ",中斷,中断,Pause".split(",");
    arr[2] = ",腰斬,腰斩,Cut".split(",");
    arr[3] = ",<font color=green>待定</font>,<font color=green>待定</font>,<font color=green>Undecided</font>".split(",");
    arr[4] = ",<font color=green>取</font>,<font color=green>取</font>,<font color=green>Cancel</font>".split(",");
    arr[5] = ",<font color=green>金</font>,<font color=green>金</font>,<font color=green>Gold</font>".split(",");
    arr[13] = ",<b>完</b>,<b>完</b>,<b>Ft</b>".split(",");
    arr[14] = ",未,未,W".split(",");
    arr[15] = ",上,上,1st".split(",");
    arr[16] = ",<font color=blue>中</font>,<font color=blue>中</font>,<font color=blue>HT</font>".split(",");
    arr[17] = ",下,下,2nd".split(",");
    arr[18] = ",加,加,Extra".split(",");
    arr[19] = ",加,加,Extra".split(",");
    arr[20] = ",加,加,Extra".split(",");
    arr[21] = ",點,点,Pen".split(",");
    arr[22] = ",全,全,Finished".split(",");
    arr[23] = ",换,换,ANL".split(",");
    var cookie = Lbf._cookieNumber = Lcookie.keys('Lbf_number');
    Lbf._cookiepki = Lcookie.value(cookie, 'pk', 1); /*让球盘口 =1 中文,=2数字*/
    Lbf._cookielan = Lsys.lan || Lcookie.value(cookie, 'lan', 1); /*语言 =1繁体 ,=2简体,=3 英文*/
    Lbf._cookiepm = Lcookie.value(cookie, 'pm', 1); /*排名 =0 不开启,=1开启*/
    Lbf._cookiesound = Lcookie.value(cookie, 'sound', 0); /*声音*/
    Lbf._cookierqs = Lcookie.value(cookie, 'rqs', 1); /* 入球声音*/
    Lbf._ckCredSound = Lcookie.value(cookie, 'hps', 1); /*红牌声音*/
    Lbf._cookierqw = Lcookie.value(cookie, 'rqw', 1); /*入球提示窗*/
    Lbf._ckCredWindow = Lcookie.value(cookie, 'hpw', 1); /*红牌提示窗*/
    Lbf._cookiewinp = Lcookie.value(cookie, 'winp', 0); /*弹窗位置*/
    Lbf._cookiesbc = Lcookie.value(cookie, 'sbczs', 1); /*上半场指数是否显示 =1 显示 =0 不显示*/
    Lbf._ckGunQiuView = Lcookie.value(cookie, 'gqzs', 1); /*滚球指数*/
    Lbf._cookiehideids = Lcookie.get('Lbf_hideid', ''); /*隐藏赛事*/
    var name = '';
    name = Lcookie.value(cookie, '#fs', 'small'); if (name) { Lbf.fontsize(name, true); }
    name = Lcookie.value(cookie, '#ps', ''); if (name) { Lbf.pageStyle(name, true); }
    $('wRqs').checked = Lbf._cookierqs == 1;
    $('wHps').checked = Lbf._ckCredSound == 1;
    $('wRqw').checked = Lbf._cookierqw == 1;
    $('wHpw').checked = Lbf._ckCredWindow == 1;
    $('selwp').options[Lbf._cookiewinp].selected = true;
    $('selsound').options[Lbf._cookiesound].selected = true;
    $('lan_' + Lbf._cookielan).checked = true;
    $('alan_' + Lbf._cookielan).className = "red";
    $('wCkGunQiu').checked = Lbf._ckGunQiuView ? true : false;
    if (Lbf._cookiepki == 1) { $('pkfg0').checked = true; $ } else { ('pkfg1').checked = true; }
    if (Lbf._cookiesbc == 1) { $('sbczs').checked = $('sbczs2').checked = true; } else { $('sbczs').checked = $('sbczs2').checked = false; }
    if (!document.onmouseover) { document.onmouseover = Lbf.showpop; }
    Lnet.start();
    //window.onbeforeunload = function () { Lcookie.remove('Lbf_hideid'); };
    if (Lsys.matchType != 3) { Lbf._countryId = parseInt(Lsearch.getPar('country') || 0); }
    Lbf._wPk = $('pk1');
    Lbf._wPkType = $('typeid1');
    Lbf._labGunQiu = $('wLabGunQiu');
    Lbf._labMoreInfo = $('wLabMoreInfo');
    Lbf._labSelect = $('wLabSelect');
    Lbf._divLottery = $('wLottery');
    Lbf._detail = $('wFlyDetail');
    //Lbf._wLs = $('wLs');
    var oddswindow = Lbf._odds = $('wFlyOdds');
    oddswindow.onmouseover = Lbf.cacelHideOdds;
    oddswindow.onmouseout = Lbf.hideOdds;
    var poplayer = Lbf._poplayer = $('wFlyPop');
    poplayer.onmouseover = Lbf.poplayershow;
    poplayer.onmouseout = Lbf.poplayerhide;
    poplayer.onmouseup = Lsys.poplayerMouseUp;
    if (document.all) {
        Lbf.appendElement(Lbf.getSwf('checkonline.swf'));
        Lsys.setTitle();
        setInterval("_countJs = _countFlash;", Lsys.refInter);
    }
    Lbf.appendElement('<iframe name="hideframe" style="width:200px;height:200px;overflow:hidden;" frameborder="1"></iframe>');
    Lbf.appendElement('<img src="/i/star.gif" /><img src="/i/bgcoll.gif" /><img src="/i/wfoFeng.gif" /><img src="/i/iszd.gif" /><img src="/i/point2.gif" />');
    Lsys.loadData();
    if (document.all && Lpar.iekillerror) { Lbase.event(window, 'onerror', Lsys.killError); }
    var wph = $('wPkHistroy');
    if (wph) {
        arr = '平手,受平手,平手/半球,受让 平手/半球,半球,受让 半球,半球/一球,受让 半球/一球,一球,受一球,一球/球半,受一球/球半,球半,受球半,球半/两球,受球半/两球,两球,受两球,两球/两球半,受两球/两球半,两球半,受两球半,两球半/三球,受两球半/三球,三球,受三球,三球/三球半,受三球/三球半,三球半 ,受三球半,三球半/四球,受三球半/四球,四球,受四球'.split(',');
        var div = document.createElement('div'), index = 1, typex = false, a;
        for (var i = 0, l = arr.length; i < l; i++) {
            a = document.createElement('a');
            a.onclick = Lbf.pkhistory;
            a.innerHTML = arr[i];
            a._index = index;
            a._type = typex ? 5 : 4;
            if (typex) { index++; }
            typex = !typex;
            div.appendChild(a);
        }
        div.appendChild(document.createElement('a'));
        div.appendChild(document.createElement('a'));
        wph.appendChild(div);
    }
    Lbase.event(window, 'onscroll', Lbf.adFixed);
    Lbase.event(window, 'onresize', Lbf.adFixed);
    Lbf._loadAd = true;
};
Lbf.matchTimeUpdate = function (id, ks2) {
    var t = ks2.split(","), date = new Date(t[0], t[1], t[2], t[3], t[4], t[5]);
    Lbf._hashtime[id] = date;
    return date;
};
Lbf.getAndSetTime = function (d) {
    var t = d.ks2.split(","), dt = d.ks3 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]);
    return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' ' + dt.getHours() + ':' + dt.getMinutes();
};
Lbf.getSwf = function (fn) {
    return '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="25" height="16"><param name="movie" value="' + fn + '"><param name="quality" value="height"><param name="wmode" value="transparent" /><embed src="' + fn + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="22" height="16"></embed></object>';
};
Lbf.tablestyle = function (name, skip) {
    $('wLive').className = name;
    if (skip) { return; }
    Lbf.cookieNumberSet('#ts' + Lsys.matchType, name);
};
Lbf.pkcolor = function (color, skip) {
    var c2 = Lsys.matchType == 2 && color == '#080' ? '#000' : color;
    var cs = document.createStyleSheet, txt = '.d-sbs,.d-gqsbs{ color:' + c2 + ';}';
    if (cs) {
        cs = document.createStyleSheet();
        cs.cssText = txt;
    } else {
        cs = $('_pkcolor');
        if (!cs) { cs = document.createElement('style'); cs.id = '_pkcolor'; cs.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(cs); }
        cs.innerHTML = txt;
    }
    if (skip) { return; }
    Lbf.cookieNumberSet('#pkcolor', color);
}
Lbf.fontsize = function (name, skip) {
    if (name == 'small') {
        $('tfont_small_2').checked = $('tfont_small').checked = true;
    } else {
        $('tfont_big_2').checked = $('tfont_big').checked = true;
    }
    $('dm').className = 'ma ' + name;
    if (skip) { return; }
    Lbf.cookieNumberSet('#fs', name);
};
Lbf.printf = function (vals) {
    if (vals == undefined || vals == '') { return '' }
    vals = vals.toString();
    var cmd = vals.split(".");
    if (cmd.length > 1) {
        for (var i = 0, l = (Lsys.iorpoint - cmd[1].length); i < l; i++) { vals += "0"; }
    } else {
        vals += ".";
        for (var i = 0; i < Lsys.iorpoint; i++) { vals += "0"; }
    }
    return vals;
};
Lbf.updatetime_get = function (key, dt) {
    var str = '', x = parseInt((new Date() - dt - Lsys.time) / 60000) + Lbf._arr_smtj[key];
    if (x > Lbf._arr_smtd1[key]) {
        str = Lbf._arr_smtd2[key];
    } else if (x < Lbf._arr_smtd3[key]) {
        str = Lbf._arr_smtd3[key];
    } else {
        str = x;
    }
    return str;
}
Lbf.updatetime_tr = function (tr, key, dt) {
    var str = Lbf.updatetime_get(key, dt), cellIndex = 2;
    switch (Lsys.matchType) {
        case 3: cellIndex = 3; break;
    }
    var td = tr.cells[cellIndex];
    if (td && (!td._hstr || td._hstr != str)) {
        td.innerHTML = '<span>' + str + '<em>&nbsp;</em></span>';
        td._hstr = str;
    }
};
Lbf.updatetime = function () {
    if (Lsys.stop) { return; }
    var tr, key, updateCount = 0, count = 0;
    for (var id in Lbf._hashtime) {
        tr = Lbf._hashtr[id];
        if (!tr || !tr._data) { continue; }
        key = tr._data.status;
        if (key == 1 || key == 3) {
            Lbf.updatetime_tr(tr, key, Lbf._hashtime[id]);
            updateCount++;
        }
        count++;
    }
};
Lbf.loadmatch = function () {
    var x, arr = [], k = 1, type = Lbf._cookielan == 3 ? 3 : 5, i = 0, match = Lmatch._match, d;
    arr.push('<table cellpadding="0" cellspacing="4" class="tableList" id="wdlTable">');
    for (var key in match) {
        x = k % type;
        d = match[key];
        if (x == 1) { arr.push('<tr>'); }
        arr.push('<td><input type="checkbox" value="' + key + '" checked="checked" /></td><td><div style="background-color:' + d.bgcolor + ';"');
        arr.push('>&nbsp;</div></td><td>' + d.name + '</td>');
        if (x == 0) { arr.push('</tr>'); }
        k++;
        i++;
    }
    if ((i - 1) % type != 0) {
        x = type - ((i - 1) % type);
        for (var j = 1; j < x; j++) {
            arr.push('<td colspan="3">&nbsp;</td>');
        }
        arr.push('</tr>');
    }
    arr.push('</table>');
    var div = $("wDialogLeague");
    div.innerHTML = arr.join("");
    var ins = div.getElementsByTagName('input'), ck;
    for (var i = 0, l = ins.length; i < l; i++) { ck = ins[i]; ck.onclick = Lbf.matchselect; }
};
Lbf.formatPk = function (pk, type) {
    var arr;
    if (typeof type == 'object') { arr = type; } else { arr = type == 'rq' ? Lbf._arrrqpk : Lbf._arrdxpk; }
    if (pk < 0) { return '<span class="red">受</span>' + arr[parseInt(pk.toString().substr(1))]; } else { return arr[pk]; }
};
Lbf.loadpk = function () {
    var x, arrpk = Lmatch._pk, arr = [], pk;
    arr.push('<table cellpadding="0" cellspacing="4" class="tableList" id="wdpkTable"  ondblclick="Lsys.printerror()">');
    for (var i = 0, l = arrpk.length; i < l; i++) {
        x = i % 5;
        pk = arrpk[i];
        if (x == 0) { arr.push('<tr>'); }
        arr.push('<td><input type="checkbox" value="' + pk + '" checked="checked" /></td><td class="wdpkName">' + Lbf.formatPk(pk, 'rq') + '</td>');
        if (x == 4) { arr.push('</tr>'); }
    }
    if ((i - 1) % 5 != 4) {
        x = 5 - ((i - 1) % 5)
        for (var j = 1; j < x; j++) { arr.push('<td colspan="2">&nbsp;</td>'); }
        arr.push('</tr>');
    }
    arr.push('</table>');
    var wPK = $("wDialogPK");
    wPK.innerHTML = arr.join("");
    var ins = wPK.getElementsByTagName('input'), ck;
    for (var i = 0, l = ins.length; i < l; i++) { ck = ins[i]; ck.onclick = Lbf.pkselect; }
};
Lbf.loadCountry = function () {
    var x = 0, i = 0, objCountry = Lmatch._country, arr = [];
    arr.push('<table cellpadding="0" cellspacing="4" class="tableList" id="wdcTable">');
    for (var key in objCountry) {
        x = i++ % 5;
        if (x == 0) { arr.push('<tr>'); }
        arr.push('<td><input type="checkbox" value="' + key + '" ' + (Lbf._countryId == key ? '' : 'checked="checked"') + ' /></td><td>' + objCountry[key] + '</td>');
        if (x == 4) { arr.push('</tr>'); }
    }
    if ((i - 1) % 5 != 4) {
        x = 5 - ((i - 1) % 5)
        for (var j = 1; j < x; j++) { arr.push('<td colspan="2">&nbsp;</td>'); }
        arr.push('</tr>');
    }
    arr.push('</table>');
    var div = $('wDialogCountry');
    div.innerHTML = arr.join("");
    var ins = div.getElementsByTagName('input'), ck;
    for (var i = 0, l = ins.length; i < l; i++) { ck = ins[i]; ck.onclick = Lbf.countrySelect; }
    if (Lbf._countryId) { Lbf.unSelByCountry(); }
};
Lbf.getMore = function (tr) {
    var t2 = tr.nextSibling;
    if (!t2) { return null; }
    var c = t2.className;
    return c == 'mo2' ? t2 : null;
};
Lbf.trMore = function (tr, create) {
    var temptr = tr.nextSibling;
    if (temptr) {
        if (temptr.className == 'mo2') { return temptr; } else if (!create) { return null; }
        create = 1;
    } else {
        if (!create) { return null; }
        create = 2;
    }
    var newtr,td = document.createElement('td');
    td.colSpan = Lsys.colspan;
    if (create == 1) { newtr = tr.parentNode.insertRow(tr.rowIndex); } else { newtr = document.createElement('tr'); tr.parentNode.appendChild(newtr); }
    newtr.className = 'mo2';
    newtr.ismore = true;
    newtr.appendChild(td);
    return newtr;
};
Lbf.pkhistory = function () {
    Lbf._wPk.value = this._index;
    Lbf._wPkType.value = this._type;
    Lbf._wPk.parentNode.submit();
};
Lbf.hideDetail = function () { Lbf._detail.style.visibility = 'hidden'; };
Lbf.viewDetail = function (evt) {
    var detail = Lbf._detail,md;
    if (!Lbf._isshow) { return; }
    var a = [], td = this, tr = td.parentNode, id = tr.id, d = tr._data, arr = Lbf._hashdetail[id];
    a.push('<div class="flyHead"><code>' + (d.pm1 || '') + '</code> ' + d.t1);
    a.push(' <span class="vs">' + (d.status == undefined || d.staus == 0 || d.status == -14 ? '-' : ((d.s1 || 0) + '-' + (d.s2 || 0))) + '</span> ' + d.t2);
    a.push(' <code>' + (d.pm2 || '') + '</code></div>');
    if (arr && td.innerHTML != '-') {
        a.push('<table border="0" cellspacing="0" cellpadding="0" class="wfdTable">');
        a.push('<colgroup><col width="7%" /><col width="33%" /><col width="20%" /><col width="33%" /><col width="7%" /></colgroup>');
        a.push(' <tbody>');
        for (var i = 0, l = arr.length; i < l; i++) {
            md = arr[i].split(',');
            switch (md[0]) {
                case 'x':
                    a.push('<tr><td class="' + Lbf._arrjq[md[1]] + '">&nbsp;</td><td>' + (md[3] || '&nbsp;') + '</td><td class="tc red">[' + md[2] + '\']</td><td>&nbsp;</td><td>&nbsp;</td></tr>');
                    break;
                case 'y':
                    a.push('<tr><td>&nbsp;</td><td>&nbsp;</td><td class="tc red">[' + md[2] + '\']</td><td>' + (md[3] || '&nbsp;') + '</td><td class="wfdIco ' + Lbf._arrjq[md[1]] + '">&nbsp;</td></tr>');
                    break;
            }
        }
        a.push('</tbody>');
        a.push('</table>');
    }
    a.push( Lbf.getTvs(d) );
    detail.innerHTML = a.join("");
    var cus = Lposition.offset(td);
    if (!detail._w) { detail._w = detail.clientWidth / 2 - td.clientWidth / 2; }
    detail.style.top = (cus.y + td.clientHeight) + 'px';
    detail.style.left = (cus.x - detail._w) + 'px';
    detail.style.visibility = 'visible';
};
Lbf.numberThree = function (a, b) {
    if (a == b || b == undefined) { return 0; }
    return a > b ? 1 : 2;
};
Lbf.voCss = function (a, a1, b, b1, pk, pk1, ispk) {
    var ca = [0, 0, 0];
    ca[0] = Lbf.numberThree(a, a1);
    ca[1] = ispk ? (pk == pk1 || pk1 == undefined ? 0 : 1) : Lbf.numberThree(pk, pk1);
    ca[2] = Lbf.numberThree(b, b1);
    return ca;
};
Lbf.cancelGunQiuColor = function () {
    if (!Lbf._viewOddsId || !Lbf._ckGunQiuView || Lbf._viewGunQiuId != Lbf._viewOddsId) { return; }
    var table = Lbf._odds.getElementsByTagName('table')[1];
    if (!table) { return; }
    var rows = table.rows, td;
    for (var i = 1, l = rows.length; i < l; i++) {
        for (var i0 = 1; i0 < 4; i0++) {
            td = rows[i].cells[i0];
            switch (td.className) {
                case 'wfoBgA wfoSmall':
                case 'wfoBgA wfoSmall wfoFeng':
                case 'wfoBgA':
                case 'wfoBgA wfoFeng':
                    continue; break;
            }
            td.className = 'wfoBgA' + (i0 == 2 ? ' wfoSmall' : '');
        }
        if (i == 3) { i = 5; }
    }
};
Lbf.convertOdds = function (d) {
    if (!Lsys.isConvert || d._ior) { return; }
    var x = ['rq1', 'rq2', 'hRq1', 'hRq2', 'dx1', 'dx2', 'hDx1', 'hDx2', 'zdRq1', 'zdRq2', 'zdhRq1', 'zdhRq2', 'zdDx1', 'zdDx2', 'zdhDx1', 'zdhDx2'];
    for (var i = 0, l = x.length; i < l; i++) {
        if (d['ior_' + x[i]]) { continue; }
        Lchange.otherIor(d, x[i], x[++i]);
    }
    d._ior = true;
};
Lbf.viewOdds = function (tr) {
    Lsys.delTimeout('outCancelGunQiuColor');
    var match = tr._match, d = tr._data;
    if (!match) {
        Lsys.newLog('显示赔率窗口时 match 为空(id=' + tr.id + ',lsid=' + d.lsid + ')');
        return;
    }
    Lbf._viewOddsId = tr.id;
    Lbf._viewGunQiuId = null;
    var a = [];
    a.push('<table border="0" class="wfoHead" cellpadding="0" cellspacing="0"><tr><td>');
    var s = match.link ? ('<a href="' + Link.matchinfo + '?id=' + tr.id + '&area=a1" target="_blank">' + match.name + '</a>') : match.name;
    a.push('<div class="wfoMatch" style="background-color:' + match.bgcolor + ';border-color:' + match.bgcolor + ';">' + s + '</div></td>');
    a.push('<td class="wfoName" style="text-align:right;">');
    if (d.pm1) { a.push('<code>[' + d.pm1 + ']</code>'); }
    if (d.hyellow) { a.push('<span class="cYellow"><i>' + d.hyellow + '</i></span>'); }
    if (d.hred) { a.push('<span class="cRed"><i>' + d.hred + '</i></span>'); }
    a.push('<b>' + d.t1 + '</b></td>');
    a.push('<td class="wfoMatchVs"><div style="width:40px;">');
    if (!d.status) {
        a.push('-');
    } else {
        a.push((d.s1 || 0) + '-' + (d.s2 || 0));
    }
    a.push('</div></td><td class="wfoName"><b>' + d.t2 + '</b>');
    if (d.gred) { a.push('<span class="cRed"><i>' + d.gred + '</i></span>'); }
    if (d.gyellow) { a.push('<span class="cYellow"><i>' + d.gyellow + '</i></span>'); }
    if (d.pm2) { a.push('<code>[' + d.pm2 + ']</code>'); }
    a.push('</td>');
    a.push('<td class="wfoHeadRight"><div style="width:80px;">' + Lsys.coname + '指数</div></td></tr></table>');
    if (!Lmatch._odds) {
        a.push('<div class="noData">正在加载数据...</div>');
        Lbf._odds.innerHTML = a.join("");
        Lsys.newTimeout('outViewOdds', setTimeout(function () { Lbf.viewOdds(tr) }, 1000));
        return;
    }
    var ad = Lad._ads['wFLYTXTAD-pl']; ad && (ad = ad[0]);
    var adTxt0 = ad ? ('广告：<a style="color:red;" href="' + ad.uri + '" target="_blank">' + ad.html + '</a>') : '';
    var odds = Lmatch._odds[tr.id] || {};
    if (d.rq1 === undefined && d.zdRq1 === undefined && d.bzz === undefined && d.zdBzz === undefined) {
        adTxt0 && (a.push('<div class="adForOdds2">' + adTxt0 + '</div>'));
        a.push('<div class="noData">暂时没有数据</div>');
        Lbf._odds.innerHTML = a.join("");
        return;
    }
    var adTxt1 = ad ? ('<tr><td colspan="10" class="adForOdds">' + adTxt0 + '</td></tr>') : '', arr = [];
    var tr1 = '<tr><th>&nbsp;</th><td>#0</td></tr>', tr2 = '<tr><th>#0</th><td>#1</td><td>#2</td><td>#3</td></tr>';
    var trTable = '<table class="wfoTable" cellpadding="0" cellspacing="1">';
    var bgClass = '', css1 = Lbf._arrpksj, css2 = Lbf._arrpkfb, cssDefault, cssArr = [], isFeng = false, cssIndex = 0, arrIndex = 0;
    /*0:封,1:不封*/
    function feng(v) { isFeng = v == 0; }
    function asscss() {
        if (cssIndex > 2) { cssIndex = 0; arrIndex++; }
        var index = cssArr[arrIndex][cssIndex++];
        var css = (cssIndex == 2 && arrIndex != 1 && arrIndex != 4) ? css2[index] : css1[index];
        if (!css) { css = cssDefault; }
        if (cssIndex == 2) { if (arrIndex != 1 && arrIndex != 4) { css += ' wfoSmall'; } }
        if (isFeng) { css += ' wfoFeng'; }
        return css;
    }
    if (Lbf._ckGunQiuView && (d.zdRq1 || d.zdhRq1 || d.zdDx1 || d.zdhDx1 || d.zdBzz || d.zdhBzz)) {
        /*滚球*/
        arrIndex = cssIndex = 0;
        cssArr = [];
        cssArr.push(Lbf.voCss(d.zdRq1, d.b_zdRq1, d.zdRq2, d.b_zdRq2, d.zdRqpk, d.b_zdRqpk, true));
        cssArr.push(Lbf.voCss(d.zdBzz, d.b_zdBzz, d.zdBzk, d.b_zdBzk, d.zdBzh, d.b_zdBzh));
        cssArr.push(Lbf.voCss(d.zdDx1, d.b_zdDx1, d.zdDx2, d.b_zdDx2, d.zdDxpk, d.b_zdDxpk, true));
        cssArr.push(Lbf.voCss(d.zdhRq1, d.b_zdhRq1, d.zdhRq2, d.b_zdhRq2, d.zdhRqpk, d.b_zdhRqpk, true));
        cssArr.push(Lbf.voCss(d.zdhBzz, d.b_zdhBzz, d.zdhBzk, d.b_zdhBzk, d.zdhBzh, d.b_zdhBzh));
        cssArr.push(Lbf.voCss(d.zdhDx1, d.b_zdhDx1, d.zdhDx2, d.b_zdhDx2, d.zdhDxpk, d.b_zdhDxpk, true));
        cssDefault = 'wfoBgA';
        bgClass = 'A';
        arr.push([bgClass, '滚球指数']);
        feng(d.zdrqS);
        arr.push([bgClass, [d.zdRq1, asscss()], [Lbf.formatPk(d.zdRqpk, 'rq'), asscss()], [d.zdRq2, asscss()]]);
        feng(d.zdbzS);
        arr.push([bgClass, [d.zdBzz, asscss()], [d.zdBzh, asscss()], [d.zdBzk, asscss()]]);
        feng(d.zddxS);
        arr.push([bgClass, [d.zdDx1, asscss()], [Lbf.formatPk(d.zdDxpk, 'dx'), asscss()], [d.zdDx2, asscss()]]);
        arr.push([bgClass, '滚球上半场']);
        feng(d.zdhrqS);
        arr.push([bgClass, [d.zdhRq1, asscss()], [Lbf.formatPk(d.zdhRqpk, 'rq'), asscss()], [d.zdhRq2, asscss()]]);
        feng(d.zdhbzS);
        arr.push([bgClass, [d.zdhBzz, asscss()], [d.zdhBzh, asscss()], [d.zdhBzk, asscss()]]);
        feng(d.zdhdxS);
        arr.push([bgClass, [d.zdhDx1, asscss()], [Lbf.formatPk(d.zdhDxpk, 'dx'), asscss()], [d.zdhDx2, asscss()]]);
        Lbf._odds.style.width = '490px';
        Lsys.newTimeout('outCancelGunQiuColor', setTimeout(Lbf.cancelGunQiuColor, 20000));
        Lbf._viewGunQiuId = tr.id;
    } else {
        Lbf._odds.style.width = '425px';
    }
    /*即时*/
    isFeng = false;
    arrIndex = cssIndex = 0;
    cssArr = [];
    cssArr.push(Lbf.voCss(d.rq1, odds.a, d.rq2, odds.b, d.rqpk, odds.c, true));
    cssArr.push(Lbf.voCss(d.bzz, odds.a2, d.bzk, odds.b2, d.bzh, odds.c2));
    cssArr.push(Lbf.voCss(d.dx1, odds.a1, d.dx2, odds.b1, d.dxpk, odds.c1, true));
    cssArr.push(Lbf.voCss(d.hRq1, odds.a3, d.hRq2, odds.b3, d.hRqpk, odds.c3, true));
    cssArr.push(Lbf.voCss(d.hBzz, odds.a5, d.hBzk, odds.b5, d.hBzh, odds.c5));
    cssArr.push(Lbf.voCss(d.hDx1, odds.a4, d.hDx2, odds.b4, d.hDxpk, odds.c4, true));
    cssDefault = 'wfoBgB';
    bgClass = 'B';
    arr.push([bgClass, '即时指数(全场)']);
    arr.push([bgClass, [d.rq1, asscss()], [Lbf.formatPk(d.rqpk, 'rq'), asscss()], [d.rq2, asscss()]]);
    arr.push([bgClass, [d.bzz, asscss()], [d.bzh, asscss()], [d.bzk, asscss()]]);
    arr.push([bgClass, [d.dx1, asscss()], [Lbf.formatPk(d.dxpk, 'dx'), asscss()], [d.dx2, asscss()]]);
    arr.push([bgClass, '即时指数(上半场)']);
    arr.push([bgClass, [d.hRq1, asscss()], [Lbf.formatPk(d.hRqpk, 'rq'), asscss()], [d.hRq2, asscss()]]);
    arr.push([bgClass, [d.hBzz, asscss()], [d.hBzh, asscss()], [d.hBzk, asscss()]]);
    arr.push([bgClass, [d.hDx1, asscss()], [Lbf.formatPk(d.hDxpk, 'dx'), asscss()], [d.hDx2, asscss()]]);

    /*初盘*/
    bgClass = 'C';
    arr.push([bgClass, '初盘指数(全场)']);
    var x1 = [], x2 = [],x3 = ['&nbsp;', '亚', '欧', '大', '&nbsp;', '亚', '欧', '大'],k1 = 0;
    if (Lsys.isConvert && !odds._cpior) {
        Lchange.otherIor(odds, 'a', 'b');
        Lchange.otherIor(odds, 'a1', 'b1');
        Lchange.otherIor(odds, 'a3', 'b3');
        Lchange.otherIor(odds, 'a4', 'b4');
        odds._cpior = 1;
    }
    var klist = [[0, Lbf._arrrqpk], [2], [1, Lbf._arrdxpk], [3, Lbf._arrrqpk], [5], [4, Lbf._arrdxpk]],klist2 = ['a', 'c', 'b'],key = '';
    for (var i = 0, l = klist.length; i < l; i++) {
        if (i == 3) { arr.push([bgClass, '初盘指数(上半场)']); }
        x1 = [bgClass];
        k1 = klist[i];
        for (var i0 = 0, l0 = klist2.length; i0 < l0; i0++) {
            key = klist2[i0] + (k1[0] || '');
            if (i0 == 1 && k1[1]) {
                x1.push(Lbf.formatPk(odds[key], k1[1]));
            } else {
                x1.push(odds[key]);
            }
        }
        arr.push(x1);
    }

    x1 = [];
    x1.push(trTable);
    var iscol = false, iscla = false, isskip = false, v = '';
    for (var x = 0, y = 8; x < y; x++) {
        if (x == 4) {
            isAppendAd = false;
            if (!Lbf._cookiesbc || Lsys.cid == 2 || !(d.hRqpk || d.zdhRqpk)) { x1.push(adTxt1); break; }
            if (!Lbf._ckGunQiuView && !d.hRqpk) { x1.push(adTxt1); break; }
            if (adTxt0) {
                x1.push('<tr><td colspan="10" class="adForOdds">' + adTxt0 + '</td></tr>');
            } else {
                x1.push('<tr><td colspan="10" class="wfoSpace">&nbsp;</td></tr>');
            }

        }
        x1.push('<tr><th>' + x3[x] + '</th>');
        iscol = (x == 0 || x == 4);
        iscla = (x == 1 || x == 5);
        isskip = true;
        for (var i = x, l = arr.length; i < l; i += 8) {
            x2 = arr[i];
            for (var i0 = 1, l0 = x2.length; i0 < l0; i0++) {
                v = x2[i0];
                x1.push('<td' + (iscol ? ' colspan="3"' : '') + ' class="');
                if (typeof v == 'object') {
                    x1.push(v[1]);
                    v = v[0];
                } else {
                    x1.push('wfoBg' + x2[0]);
                }
                x1.push('">');
                if (v == 'undefined' || v == undefined || v == '' || v == ' ') {
                    v = '&nbsp;';
                } else if ((i0 != 2 && x != 0 && x != 4) || (i0 == 2 && (x == 2 || x == 6))) {
                    v = Lbf.printf(v);
                } else if (v == '0') {
                    v = '&nbsp;';
                }
                if (iscla) {
                    x1.push('<div class="wfoTdWidth' + i0 + '">' + v + '</div>');
                } else {
                    x1.push(v);
                }
                x1.push('</td>');
            }
        }
        x1.push('</tr>');
    }
    x1.push('</table>');
    a.push(x1.join(''));

    var b = ['<div class="wfoMenu">'];
    if (d.rq1) { b.push('<a onclick=\'Lbf.opol({0},1)\'>全场</a>'); }
    if (d.vDs2) { b.push('<a onclick=\'Lbf.opol2({0},1)\'>②</a>'); }
    if (d.hRqpk) { b.push('<a  onclick="Lbf.opol({0},2,\'b2\')">上半场</a>'); }
    if (d.zdRq1) { b.push('<a onclick=\'Lbf.opolzd({0},3)\'>滚球</a>'); }
    if (d.vZd2) { b.push('<a onclick=\'Lbf.opolzd2({0},3)\'>②</a>'); }
    if (d.zdhRq1) { b.push('<a onclick=\'Lbf.opolzd({0},4)\'>滚球半场</a>'); }
    b.push('　');
    if (d.vBd) { b.push('<a  onclick="Lbf.opbd({0})">波胆</a>'); }
    if (d.vBqc) { b.push('<a  onclick="Lbf.opbqc({0})">半全场</a>'); }
    if (d.vRqs) { b.push('<a onclick="Lbf.oprqs({0})">入球数</a>'); }
    if (d.dsd || d.dss) { b.push('<a  onclick="Lbf.opds({0})">单双</a>'); }
    b.push('</div>');
    var txt = b.join('').replace(/\{0\}/g, tr.id);
    a.push(txt);
    Lbf._odds.innerHTML = a.join("");
};
Lbf.getstatus = function (k) { return k + 14; };
Lbf.dNameBf = function (d) {
    var namebf = "<span class='red'>" + (d.hs1 || 0) + "-" + (d.hs2 || 0) + "</span>";
    var status = d.status || 0;
    switch (status) {
        case 0:
            var s1 = d.weather;
            var s2 = d.template;
            namebf = ""
            if (s1 && s2) {
                namebf = "<img src='i/w/" + s1 + ".gif' h0=" + s1 + "  myalt='" + s2 + "' />";
            }
            s1 = d.tv;
            if (s1) {
                s2 = s1.replace(/\s+/g, "^br");
                namebf += "<img src='i/tv4.gif'  myalt='" + s2 + "' />";
            }
            if (namebf == "") { namebf = "-"; }
            break;
        case 1:
        case -11:
        case -14:
            namebf = "-"
            break;
    }
    return namebf;
};
Lbf.getTvs = function (d) {
    var s1 = d.weather, s2 = d.template, namebf = "";
    if (s1 && s2) {
        namebf = "<div class='tvsp tvtxts'>天气：<img align=absmiddle width=11 height=11 src='i/w/" + s1 + ".gif' /> " + s2+'</div>';
    }
    s1 = d.tv;
    if (s1) {
        s2 = s1.replace(/\<br\>/gi, "　");
        namebf += "<div class='tvtxts'>频道：<img align=absmiddle width=11 height=11 src='i/tv4.gif' /> " + s2 + '</div>';
    }
    return namebf;
};
Lbf.analycolumnking = function (id, d) {
    var name1 = d.s1 || 0, name2 = d.s2 || 0, status = d.status || 0, bfcss = "blue", isupdate = false, s1, s2, zcInfo = '&nbsp;';
    Lbf.convertOdds(d);
    var namebf = Lbf.dNameBf(d);
    switch (status) {
        case 0:
            name1 = name2 = "-";
            break;
        case 1:
            isupdate = true;
            break;
        case -1:
            bfcss = "red";
            if (name1 > name2) {
                zcInfo = 3;
            } else if (name1 < name2) {
                zcInfo = 0;
            } else {
                zcInfo = 1;
            }
            d._wanchang = true;
            break;
        case -11:
        case -14:
            name1 = name2 = "-"
            break;
        case 3:
            isupdate = true;
            break;
    }
    if (isupdate) {
        isupdate = '<span>' + Lbf.updatetime_get(status, Lbf.matchTimeUpdate(id, d.ks2)) + '<em>&nbsp;</em></span>';
    } else {
        isupdate = Lbf._arrstatus[Lbf.getstatus(status)][Lbf._cookielan];
    }
    var pkid = d.rqpk || 0, pkuri = '';
    if (Lsys.matchType == 2) {
        pkuri += "<a onclick='Lbf.opanalysis(this)'>析</a>";
    } else {
        pkuri += (d.nid == "1") ? "<a class='red' onclick='Lbf.opzs(this)'>资</a>" : "<b></b>";
        pkuri += "<a onclick='Lbf.opanalysis(this)'>析</a><a onclick='Lbf.opasia(this)'>亚</a><a onclick='Lbf.opop(this)'>欧</a>";
    }
    if (pkid == 0) {
        pkid = "vs";
        pkuri += "<b></b>";
    } else {
        pkid = Lbf.formatPk(pkid, 'rq');
        pkuri += Lbf.opping(d);
    }
    /*主队*/
    var q1 = "<code>" + (d.pm1 ? "[" + d.pm1 + "]" : "") + "</code>";
    q1 += d.hyellow ? '<span class="cYellow"><i>' + d.hyellow + '</i></span>' : '';
    q1 += d.hred ? '<span class="cRed"><i>' + d.hred + "</i></span>" : "";
    q1 += "<a onclick='Lbf.oppanlu(this)'>" + d.t1 + "</a>";

    /*客队*/
    var q2 = "<a onclick='Lbf.oppanlu(this)'>" + d.t2 + "</a>";
    q2 += d.gred ? '<span class="cRed"><i>' + d.gred + "</i></span>" : "";
    q2 += d.gyellow ? '<span class="cYellow"><i>' + d.gyellow + "</i></span>" : "";
    q2 += "<code>" + (d.pm2 ? "[" + d.pm2 + "]" : "") + "</code>";

    /*进球列表*/
    if (d.detail) {
        Lbf._hashdetail[id] = d.detail.replace(/\\\'/g, '\'').split('|');
    }
    return { "pkid": pkid, "pkuri": pkuri, "isupdate": isupdate, "bfcss": bfcss, "name1": name1, "name2": name2, "namebf": namebf, "queue1": q1, "queue2": q2, "zcinfo": zcInfo };
}
Lbf.isOtherInfo = function () { return Lbf._cookieother == 1 && Lsys.matchType != 3; };
Lbf.getVsGqValue = function (isTag, d, nS, nsTxt, n1, n2, name, pk) {
    var v = '', css = '', skip = false;
    if (Lbf.isPlaying(d)) { v = d[n1]; }
    if (v) { /*正在比赛，并且有滚球数据*/
        css = isTag ? 'green' : ' class="green"';
        if (d[nS] == 0) { v = nsTxt ? '封' : '&nbsp;'; skip = true; }
    } else {
        v = d[n2]; css = '';
    }
    if (!skip && pk) { v = Lbf.formatPk(v || 0, pk); skip = true; }
    if (!skip) { v = Lbf.printf(v); }
    v = v || '&nbsp;';
    if (isTag) {
        var tag = document.createElement(name);
        tag.innerHTML = v;
        tag.style.display = 'none';
        if (css) { tag.className = css; }
        return tag;
    } else {
        return '<' + name + css + '>' + v + '</' + name + '>';
    }
};
Lbf.dataRefBgClass = function () {
    var rows = Lbf._tbody.rows, tr, trf = false;
    for (var i = 0, l = rows.length; i < l; i++) {
        tr = rows[i];
        if (!tr.id || tr.hide) { continue; }
        if (trf) { Lsearch.cssInsert(tr, 'dataBg1'); } else { Lsearch.cssDel(tr, 'dataBg1'); }
        trf = !trf;
    }
};
Lbf.isPlaying = function (d) {    /*0 未开赛，-1 完场*/return !(d.status == -1 || d['zdRq1'] == undefined); };
Lbf.notStart = function (d) {    /*0 未开赛，-1 完场*/return !d.status; };
Lbf.arrGunQiuNameList = { 'bz': ['zdBzz', 'zdBzk', 'zdBzh', 'bzz', 'bzk', 'bzh'], 'dx': ['zdDx1', 'zdDx2', 'zdDxpk', 'dx1', 'dx2', 'dxpk'] };
Lbf.isHaveData = function (d, type) {
    var arrName = Lbf.arrGunQiuNameList[type], beginIndex = Lbf.isPlaying(d) ? 0 : 3;
    for (var i = beginIndex, l = arrName.length; i < l; i++) { if (d[arrName[i]]) { return true; } }
    return false;
};
Lbf.getGunQiuData = function (d, isTag, type) {
    switch (type) {
        case 'rq1': return Lbf.getVsGqValue(isTag, d, 'zdrqS', false, 'zdRq1', 'rq1', 'h4');
        case 'rq2': return Lbf.getVsGqValue(isTag, d, 'zdrqS', false, 'zdRq2', 'rq2', 'h4');
        case 'rq3': return Lbf.getVsGqValue(isTag, d, 'zdrqS', true, 'zdRqpk', 'rqpk', 'h4', Lbf._arrrqpk);
        case 'bz1': return Lbf.getVsGqValue(isTag, d, 'zdbzS', false, 'zdBzz', 'bzz', 'h5');
        case 'bz2': return Lbf.getVsGqValue(isTag, d, 'zdbzS', false, 'zdBzk', 'bzk', 'h5');
        case 'bz3': return Lbf.getVsGqValue(isTag, d, 'zdbzS', true, 'zdBzh', 'bzh', 'h5');
        case 'dx1': return Lbf.getVsGqValue(isTag, d, 'zddxS', false, 'zdDx1', 'dx1', 'h6');
        case 'dx2': return Lbf.getVsGqValue(isTag, d, 'zddxS', false, 'zdDx2', 'dx2', 'h6');
        case 'dx3': return Lbf.getVsGqValue(isTag, d, 'zddxS', true, 'zdDxpk', 'dxpk', 'h6', Lbf._arrdxpk);
    }
    return null;
};
Lbf.datainit = function () {
    var i, d, data = Lmatch._data, collkey = Lbf.Collcookie(), colline;
    Lbf._isdatainit = true;
    for (i = 0; d = data[i]; ) { d._index = i++; }
    Lbf._maxline = i;
    if (!Lsys.collskip && collkey) {
        collkey = ',' + collkey + ',';
        var htemp = {}, hcoll = [];
        for (i = 0; d = data[i++]; ) {
            if (collkey.indexOf(',' + d.id.toString() + ',') == -1) { d._colltop = false; continue; }
            d._colltop = true;
            hcoll.push(d);
            data.splice(--i, 1);
            htemp[d.id] = true;
        }
        if (hcoll.length > 0) {
            for (i = 0; d = data[i++]; ) { hcoll.push(d); }
            data = Lmatch._data = hcoll;
            colline = '<tr class="Collline"><td id="Collline" colspan="' + Lsys.colspan + '">&nbsp;</td></tr>';
        }
    }
    return colline;
};
Lbf.datamatchcheck = function () {
    if (Lbf._isdatainit) { return; }
    var ids = Lbf.Collcookie(), arr = Lsys.mymatch;
    if (arr.length > 0) {
        Lbf.Colladd(null, arr, true);
    } else if (ids) {
        var h = {}, id;
        for (var i = 0, l = arr.length; i < l; i++) { id = arr[i]; if (!h[id]) { h[id] = true; } }
        var a = ids.split(','); for (var i = 0, l = a.length; i < l; i++) { id = a[i]; if (!h[id]) { h[id] = true; } }
        arr = [];
        for (id in h) { arr.push(id); }
        Lsys.mymatch = arr;
    }
    ids && (Lbf.Collupdate());
};
Lbf.dataclose = function (d) {
    if (Lsys.collskip) { return 'x'; }
    if (d._colltop) {
        return "<a title='取消关注' class='Coll_down'><span class='Collstar' title='取消关注'>&nbsp;</span>-</a><a title='隐藏' href='javascript:;' class='none'>x</a>";
    } else {
        return '<a title="添加关注" class="Coll_up">+</a><a title="隐藏" href="javascript:;" class="Coll_close">x</a>';
    }
};
Lbf.collopen = function (link, mode) {
    var icoll = $('ids-coll'); if (!icoll) { return; }
    icoll.value = Lbf.Collcookie();
    var f = $('formconn');
    f.action = link + '?uid=' + Lsys.userid + '&mode=' + (mode || '');
    f.submit();
};
Lbf.collhistory = function (hide) {
    var arr = 'sc-colla,sg-colla'.split(','), istrue = $('ids-coll') && Lsys.userid;
    for (var i = 0, id; id = arr[i++]; ) {
        f = $(id); if (f) { !f._href && (f._href = f.href); f.target = istrue ? '' : '_blank'; f.href = istrue ? ('javascript:Lbf.collopen(\'' + f._href + '\');') : f._href; }
    }
    if (hide != undefined) {
        var f = $('a-Concern'); if (f) { f.style.visibility = hide ? 'hidden' : 'visible'; }
        return;
    }
    return '<a id="a-Concern" style="visibility:' + (Lsys.userid ? 'visible' : 'hidden') + '" onclick="Lbf.collopen(\'' + Link.mycoll + '\',\'\');">历史关注</a>';
};
Lbf.idusernamefocus = function (o) {
    var lbox = Lbf._loginbox;
    if (!lbox) {
        lbox = Lbf._loginbox = document.createElement('div');
        lbox.className = 'fbox';
        lbox.innerHTML = Lbf.formatForumUri('<h3><span onclick="Lbf.closefbox(this);" class="close">x</span>登录</h3><form action="{bbsuri}api.php?mod=sync&act=login" method="post" target="hideframe"><ul class="Flogin"><li><input type="hidden" value="' + Lpar.uriLive + 'ajax.aspx?action=login&id={0}&name={1}&key={2}&ids={3}" name="loginpath" /><label>用户名：</label><input type="text" class="Flogintxt" name="username" maxlength="20" id="id-username" /></li><li><label>密　码：</label><input type="password" class="Flogintxt" name="password" /> <a href="{bbsuri}member.php?mod=register.php" target="_blank" style="font-weight:normal;">忘记密码？</a></li><li><label>&nbsp;</label><input type="submit" value="立即登录" class="loginBt" /> <a href="{bbsuri}member.php?mod=register.php" target="_blank">免费注册</a></li></ul></form>');
        var live = $('wLive');
        live.insertBefore(lbox, live.childNodes[0]);
    }
    lbox.style.display = 'block';

};
Lbf.initBf = function () {
    Lbf._labSelect.style.display = Lsys.matchType != 3 ? 'inline' : 'none';
    Lbf._labGunQiu.style.display = 'none';
    Lbf._labMoreInfo.style.display = 'none';
    Lbf._divLottery.style.display = 'none';
    if (Lbf._wLs) { Lbf._wLs.style.display = 'none'; }
    Lbf.refcolor();
    Lbf.initpktype();
    Lbf._stopAd = false;
    Lbf._arrZc = [];
    Lbf._hashtr = [];
    Lbf.goalsHide();
    Lbf.hideDetail();
    Lbf.hiddenOdds();
    Lbf._hashtime = {};
    Lbf._objGoals = {};
    Lbf._objRedCard = {};
    Lbf._objMoveBottom = {};
    Lbf._objPkClass = {};
    Lbf._objGunQiu = {};
    Lsys.date = Lmatch.date;
    Lbf.setCkMore();
    Lsys.isnet = false;
    /*加载比分 s*/
    var h = [], mtypeName = '选', queueName = '<td style="width:19%"><div style="width:116px;">';
    h.push('<tr class="dataThead">');
    switch (Lsys.matchType) {
        case 3:
            h.push('<td style="width:2%"><div style="width:16px;">序</div></td><td><div style="width:66px;">联赛</div></td>');
            queueName = '<td style="width:18%"><div style="width:110px;">';
            mtypeName = '彩';
            break;
        default:
            h.push('<td style="width:11%"><div style="width:66px;">' + Lsys.date + '</div></td>');
            break;
    }

    h.push('<td style="width:5%"><div style="width:32px;">时间</div></td><td style="width:5%"><div style="width:32px;">状态</div></td>');
    switch (Lsys.matchType) {
        case 1:
            h.push('<td style="width:25%"><div style="width:155px;">主场球队</div></td>');
            h.push('<td style="width:9%"><div style="width:64px;">比分</div></td>');
            h.push('<td style="width:25%"><div style="width:155px;">客场球队</div></td>');
            h.push('<td style="width:5%"><div style="width:30px;">半场</div></td>');
            h.push('<td style="width:12%"><div style="width:75px;">数据</div></td>');
            break;
        case 2:
            h.push('<td style="width:18%"><div style="width:110px;">主场球队</div></td>');
            h.push('<td style="width:8%"><div style="width:44px;">比分</div></td>');
            h.push('<td style="width:18%"><div style="width:110px;">客场球队</div></td>');
            h.push('<td style="width:4%"><div style="width:28px;">半场</div></td>');
            h.push('<td style="width:6%"><div style="width:39px;">指数</div></td>');
            h.push('<td style="width:12%"><div style="width:71px;">' + Lsys.coname + '</div></td>');
            h.push('<td style="width:6%"><div style="width:39px;">指数</div></td>');
            h.push('<td style="width:5%"><div style="width:28px;">数据</div></td>');
            break;
        default:
            h.push(queueName + '主场球队</div></td>');
            h.push('<td style="width:4%"><div style="width:24px;">比</div></td>');
            h.push('<td style="width:15%"><div style="width:92px;">' + Lsys.coname + '</div></td>');
            h.push('<td style="width:4%"><div style="width:24px;">分</div></td>');
            h.push(queueName + '客场球队</div></td>');
            h.push('<td style="width:5%"><div style="width:30px;">半场</div></td>');
            h.push('<td style="width:11%"><div style="width:70px;">数据</div></td>');
            break;
    }
    h.push('<td style="width:3%"><div style="width:16px;">' + mtypeName + '</td></td></tr>');
    var headTxt = h.join(''), cskip = Lsys.collskip;
    h = [];
    !cskip && (h.push('<ul class="Coll"><li class="Collico" id="id-collico">' + (Lsys.userid ? Lsys.usernamecoll : '<a href="' + Lpar.uriBbs + 'member.php?mod=register.php" target="_blank">注册</a>  <span style="color:green;">|</span> <a onclick="Lbf.idusernamefocus(this)">登录</a> 保存关注赛事') + '</li><li style="position:relative;"><div id="Colltip" class="Colltip"></div><input type="text" id="Colltext" class="Colltext" title="输入球队名，赛事名称添加关注" value="输入球队名，赛事名称添加关注" onclick="Lbf.Collclick(this,true)" onkeydown="Lbf.Collkeydown(this,event)" /></li><li><button onclick="Lbf.Colladd()" class="Colladd">添加关注</button></li><li class="Colllink"><a onclick="Lbf.Collclear()">清除当前关注</a></li></ul>'));
    h.push('<form method="post" id="formconn" name="Concern" target="_blank" action="result7.asp"><input type="hidden" name="ids" id="ids-coll" /></form><table cellpadding="0" cellspacing="0" border="0" class="d" id="wMyTable"><thead>');
    h.push(headTxt);
    h.push('</thead><tbody id="wMyData" ' + (cskip ? 'class="CollNo"' : '') + '>');
    var id, t, i, arrupdate = [], hcoll = [], colline = Lbf.datainit(), data = Lmatch._data, ishide = !Lbf.isOtherInfo();
    var ck, d, match, showDx, showBz, matchLink = '', index = 0, rcount = 0, isFeng = false, zcInfoBottom = '';
    var isOther = !Lbf._countryId && Lsys.matchType != 3 && Lmatch.otherinfo != '';
    for (i = 0; d = data[i]; i++) {
        if (!d.id) {
            if (Lsys.matchType == 3) {
                index = 0;
                if (zcInfoBottom) { h.push('<tr><td class="zcInfoTop" colspan="' + Lsys.colspan + '">' + zcInfoBottom + '</td></tr>'); }
                if (i > 0) { h.push(headTxt); }
                h.push('<tr class="zcInfo"><td class="zcInfoTop" colspan="' + Lsys.colspan + '">胜负彩<b> ' + d.qs + ' </b>期　　　　开售：' + d.ks + '　　　　停售：' + d.ts + '</td></tr>');
                d._zcIndex = i;
                Lbf._arrZc.push(d);
                zcInfoBottom = d.kj;
            }
            continue;
        }

        id = d.id;
        match = Lmatch._match[d.lsid];
        if (!match) { Lsys.newLog('初始化加载数据时 match 为空（id=' + id + ',lsid=' + d.lsid + '）'); continue; }

        if (isOther && !d._colltop && d.status == -1) {
            isOther = false;
            h.push('<tr class="moreList" ><td colspan="' + Lsys.colspan + '">' + Lmatch.otherinfo + '</td></tr>');
        }
        if (colline && !d._colltop) { h.push(colline); colline = ''; }

        ck = Lbf.analycolumnking(id, d);
        h.push("<tr dindex='" + i + "' id='" + id + "'");
        if (Lbf._countryId) { h.push(" style='display:none;'"); }
        h.push('>');
        if (Lsys.matchType == 3) {
            h.push('<td>' + ++index + '</td>');
        }
        var smore = Lbf.trMoreInfo(d);
        matchLink = match.link ? ('<a href="' + Link.matchinfo + '?id=' + id + '&area=a1" target="_blank">' + match.name + '</a>') : match.name;
        h.push("<td class='d-name' bgcolor='" + match.bgcolor + "'>" + matchLink + "</td>");
        h.push("<td class='d-time'" + (Lsys.showtime ? ' isfly="1" myalt="开赛时间：' + Lbf.getAndSetTime(d) + '"' : '') + ">" + d.ks1 + "</td>");
        h.push("<td class='d-st" + (d.iszd ? " iszd" : "") + "'>" + ck.isupdate + "</td>");
        h.push("<td class='d-home'>" + ck.queue1 + "</td>");
        switch (Lsys.matchType) {
            case 1:
            case 2:
                h.push("<td class='d-bf " + ck.bfcss + "'>" + (ck.name1 == '-' ? '<b></b>-<b></b>' : ('<b>' + ck.name1 + '</b>-<b>' + ck.name2)) + "</b></td>");
                break;
            default:
                h.push("<td class='d-bf " + ck.bfcss + "'>" + ck.name1 + "</td>");
                h.push("<td class='d-sbs'>" + ck.pkid + "</td>");
                h.push("<td class='d-bf " + ck.bfcss + "'>" + ck.name2 + "</td>");
                break;
        }
        h.push("<td class='d-away'>" + ck.queue2 + "</td>");
        h.push("<td class='d-half'>" + ck.namebf + "</td>");
        switch (Lsys.matchType) {
            case 2:
                h.push("<td class='d-gqzs'>" + Lbf.getGunQiuData(d, false, 'rq1'));
                showBz = Lbf._gunqiuBz && Lbf.isHaveData(d, 'bz');
                showDx = Lbf._gunqiuDx && Lbf.isHaveData(d, 'dx');
                if (showBz) { h.push(Lbf.getGunQiuData(d, false, 'bz1')); }
                if (showDx) { h.push(Lbf.getGunQiuData(d, false, 'dx1')); }
                if (showBz || showDx) {
                    d._gqzs = true;
                }
                h.push("</td>");
                h.push("<td class='d-gqsbs'>" + Lbf.getGunQiuData(d, false, 'rq3'));
                if (showBz) { h.push(Lbf.getGunQiuData(d, false, 'bz3')); }
                if (showDx) { h.push(Lbf.getGunQiuData(d, false, 'dx3')); }
                h.push("</td>");
                h.push("<td class='d-gqzs'>" + Lbf.getGunQiuData(d, false, 'rq2'));
                if (showBz) { h.push(Lbf.getGunQiuData(d, false, 'bz2')); }
                if (showDx) { h.push(Lbf.getGunQiuData(d, false, 'dx2')); }
                h.push("</td>");
                break;
        }
        h.push("<td class='d-analy'>" + ck.pkuri + "</td>");
        if (Lsys.matchType == 3) {
            h.push("<td class='d-zcinfo' bgcolor='" + match.bgcolor + "'>" + ck.zcinfo + "</td>");
        } else {
            h.push("<td class='d-close' bgcolor='" + match.bgcolor + "'>" + Lbf.dataclose(d) + '</td>');
        }
        h.push("</tr>");
        if (smore) {
            h.push("<tr class='mo2' ");
            if (ishide || Lbf._countryId) { h.push("style='display:none;'"); }
            h.push('><td colspan="' + Lsys.colspan + '">' + smore + '</td></tr>');
        }
        rcount++;
    }
    if (zcInfoBottom) {
        h.push('<tr><td class="zcInfoTop" colspan="' + Lsys.colspan + '">' + zcInfoBottom + '</td></tr>');
    }
    if (rcount == 0) {
        h.push('<tr><td colspan="' + Lsys.colspan + '">暂无赛事</td></tr>');
        Lbf.waitReload();
    } else {
        Lmatch.noMatch = false;
        isOther && (h.push('<tr class="moreList" ><td colspan="' + Lsys.colspan + '">' + Lmatch.otherinfo + '</td></tr>'));
    }
    h.push('</tbody></table>');
    $("wLive").innerHTML = h.join("");
    Lnet.start();
    Lsys.newTimeout('loadBfData', setTimeout(Lbf.load, 500));
};
Lbf.setGunQiuData = function (tr, d) {
    var arrData = [], showBz = Lbf._gunqiuBz && Lbf.isHaveData(d, 'bz'), showDx = Lbf._gunqiuDx && Lbf.isHaveData(d, 'dx'), h = [];
    h.push(Lbf.getGunQiuData(d, false, 'rq1'));
    if (showBz) { h.push(Lbf.getGunQiuData(d, false, 'bz1')); }
    if (showDx) { h.push(Lbf.getGunQiuData(d, false, 'dx1')); }
    if (showBz || showDx) {
        d._gqzs = true;
        Lsearch.cssInsert(tr, 'tr-gunqiu')
    }
    arrData.push(h.join(''));
    h = [];
    h.push(Lbf.getGunQiuData(d, false, 'rq3'));
    if (showBz) { h.push(Lbf.getGunQiuData(d, false, 'bz3')); }
    if (showDx) { h.push(Lbf.getGunQiuData(d, false, 'dx3')); }
    arrData.push(h.join(''));
    h = [];
    h.push(Lbf.getGunQiuData(d, false, 'rq2'));
    if (showBz) { h.push(Lbf.getGunQiuData(d, false, 'bz2')); }
    if (showDx) { h.push(Lbf.getGunQiuData(d, false, 'dx2')); }
    arrData.push(h.join(''));
    return arrData;
};
Lbf.sort_numeric = function (a, b) {
    var aa = parseFloat(a._rowindex), bb = parseFloat(b._rowindex);
    aa = isNaN(aa) ? 0 : aa;
    bb = isNaN(bb) ? 0 : bb;
    return aa - bb;
};
Lbf.sort_index = function (a, b) {
    var aa = parseFloat(a._index), bb = parseFloat(b._index);
    aa = isNaN(aa) ? 0 : aa;
    bb = isNaN(bb) ? 0 : bb;
    return aa - bb;
};
Lbf.autoSetPl = function (id, type, a, b, c) {
    var dv = (a == undefined || b == undefined || c == undefined) ? '"*"' : '';
    function format(value) { return dv || value; }
    return '"' + id + '_' + type + '":{a:' + format(a) + ',b:' + format(b) + ',c:' + format(c) + '}';
};
Lbf.loadBf = function () {
    if (Lsys.stop || Lmatch.noMatch) { return; }
    var url = Lsys.formatUri(Lsys.pathBf);
    Lajax.send('loadBf', Lbf.updateBf, url);
};
Lbf.random = function (i) { return parseInt(i * Math.random()); };
Lbf._txtUpdateBf = '';
Lbf.updateBf = function (txt, sysArea) {
    Lnet.start();
    if (Lsys.stop || Lsys.area != sysArea) { return; }
    if (!txt || txt == ' ' || txt == '0!') { return; }
    if (txt == '1!' || txt == '2!' || txt == '3!') {
        if (Lbf._txtUpdateBf == txt) { return; }
        Lbf._txtUpdateBf = txt;
    }
    if (txt == '3!') {
        Lsys.newTimeout('pageReload', setTimeout(Lsys.pageReload, Lbf.random(15000)));
        return;
    }
    if (txt == '1!' || txt == '2!') {
        if (Lsys.matchType != 3) {
            if (txt == '2!') {
                Lbf._loadmatchcount = 0;
                var wf = $('wls_frame');
                if (wf) { wf.src = Lsys.loadframematch(); }
            }
            Lsys.newTimeout('2!load', setTimeout(Lbf.reloadmatchinfo, Lbf.random(20000)));
        }
        return;
    }
    var temps = null;
    try {
        temps = eval('({' + txt + '})');
        clearTimeout(Lnet._outId0);
        Lnet._outId0 = 0;
        if (!temps) { return; }
    } catch (ex) {
        Lnet.start2();
        Lsys.newLog('更新比分数据源错误：\r\n' + txt);
        return;
    }
    if (temps.lu2 != -1 && temps.lu && Lnet.isTimeout(temps.lu, true)) { Lnet.test(); return; } else { Lnet.autohide(); }
    var txtrep = temps.lu ? (txt.replace(',lu:' + temps.lu, '').replace('lu:' + temps.lu, '')) : txt;
    if (!txtrep || Lbf._txtUpdateBf == txtrep) { return; }
    Lbf._txtUpdateBf = txtrep;
    var s1c, s2c, matchNum = 0, h = [], hp1c, hp2c, d = {}, nd = new Date(), tr, tr2, istimechange = 0, lan = Lbf._cookielan, status = Lbf._arrstatus;
    var isot = Lbf.isOtherInfo(), td, tdTime, tdStatus, tdHome, tdB, tdF, tdGuest, tdHalf, match, tempId = 0, uu = {};
    var objR = { 'hred': true, 'gred': false }, objY = { 'hyellow': true, 'gyellow': false };
    var isMove, isExec, bfNullStr = (Lsys.matchType == 1 || Lsys.matchType == 2) ? '' : '-', isPlay = false, statusChange = false;
    var arrmove = [], arrwaitmove = [];
    function dataCompare(name, defval) {
        var newValue = uu[name];
        var oldValue = d[name];
        if (newValue != undefined && newValue != oldValue) {
            d[name] = newValue;
            return !(oldValue == undefined && !newValue);
        }
        if (oldValue == undefined && defval != undefined) { d[name] = defval; }
        return false;
    };
    for (var id in temps) {
        uu = temps[id];
        tr = Lbf._hashtr[id];
        if (!tr) { continue; }
        d = tr._data;
        match = tr._match;
        if (!match) { Lsys.newLog('更新比分时 match 为空(id=' + id + ',lsid=' + d.lsid + ')'); continue; }
        tdTime = Lbf.matchTypeTd(tr, 1);
        tdStatus = Lbf.matchTypeTd(tr, 2); ;
        tdHome = Lbf.matchTypeTd(tr, 3); ;
        tdB = Lbf.matchTypeTd(tr, 4);
        tdF = Lbf.matchTypeTd(tr, 6);
        tdGuest = Lbf.matchTypeTd(tr, 7);
        tdHalf = Lbf.matchTypeTd(tr, 8);

        if (dataCompare('ks1')) { istimechange++; tdTime.innerHTML = d.ks1; }
        if (dataCompare('ks2')) { Lbf.matchTimeUpdate(id, d.ks2); }
        statusChange = dataCompare('status');
        isPlay = Lbf.isPlaying(d);
        d.hs1 = uu.hs1 || 0;
        d.hs2 = uu.hs2 || 0;
        s1c = s2c = false;
        if (dataCompare('s1', 0)) {
            s1c = true;
            tdHome.className = "d-home d-teamjqch";
        }
        if (dataCompare('s2', 0)) {
            s2c = true;
            tdGuest.className = "d-away d-teamjqch";
        }
        isExec = false;
        isMove = false;
        if (statusChange) {
            switch (d.status) {
                case 0:
                    isExec = true;
                    break;
                case 1:
                case 3:
                    /*开赛了*/
                    var date = Lbf._hashtime[id];
                    if (!date) { date = Lbf.matchTimeUpdate(id, d.ks2); }
                    Lbf.updatetime_tr(tr, d.status, date);
                    break;
                case -11:
                    isExec = true;
                    isMove = true;
                    tdB.style.color = tdF.style.color = "blue";
                    arrmove.push(id);
                case 2:
                case 4:
                case 5:
                case 6:
                case 7:
                    isExec = true;
                    break;
                case -1:
                    isExec = true
                    isMove = true;
                    tdB.style.color = tdF.style.color = "red";
                    arrwaitmove.push(id);
                    d._wanchang = true;
                    break;
                default:
                    isExec = true;
                    isMove = true;
                    tdB.style.color = tdF.style.color = "red";
                    arrmove.push(id);
                    break;
            }
            if (isExec) {
                delete Lbf._hashtime[id];
                tdStatus.innerHTML = status[Lbf.getstatus(d.status)][lan];
            }
            if (isMove) {
                switch (Lsys.matchType) {
                    case 1:
                    case 2:
                        tr.cells[4].className = 'd-bf red';
                        break;
                }
                if (Lsys.matchType == 2) {
                    var arrData = Lbf.setGunQiuData(tr, d);
                    tr.cells[7].innerHTML = arrData[0];
                    tr.cells[8].innerHTML = arrData[1];
                    tr.cells[9].innerHTML = arrData[2];
                    d._zdRq1 = true;
                    d._zdBzz = true;
                    d._zdDx1 = true;

                }
            }
        }
        if (isPlay && !isMove && Lsys.matchType == 2 && !d._wanchang) {
            if (d.zdRq1 && !d._zdRq1) { d._zdRq1 = true; Lbf.updateGunQiu('green', tr, d, 'h4', d.zdrqS, [d.zdRq1, d.zdRqpk, d.zdRq2], Lbf.voCss(d.zdRq1, d.b_zdRq1, d.zdRq2, d.b_zdRq2, d.zdRqpk, d.b_zdRqpk, true), Lbf._arrrqpk, true); }
            if (d.zdBzz && !d._zdBzz) { d._zdBzz = true; Lbf.updateGunQiu('green', tr, d, 'h5', d.zdbzS, [d.zdBzz, d.zdBzh, d.zdBzk], Lbf.voCss(d.zdBzz, d.b_zdBzz, d.zdBzk, d.b_zdBzk, d.zdBzh, d.b_zdBzh), null, true); }
            if (d.zdDx1 && !d._zdDx1) { d._zdDx1 = true; Lbf.updateGunQiu('green', tr, d, 'h6', d.zddxS, [d.zdDx1, d.zdDxpk, d.zdDx2], Lbf.voCss(d.zdDx1, d.b_zdDx1, d.zdDx2, d.b_zdDx2, d.zdDxpk, d.b_zdDxpk, true), Lbf._arrdxpk, true); }
        }
        isExec = true;
        switch (d.status) {
            case 0:
                tdB.innerHTML = tdF.innerHTML = bfNullStr;
                isExec = false;
                break;
            case -14:
                tdB.innerHTML = tdF.innerHTML = bfNullStr;
                tdHalf.innerHTML = '-';
                isExec = false;
                break;
            case -11:
                tdHalf.innerHTML = '-';
                break;
            case 2:
                tdHalf.innerHTML = d.hs1 + '-' + d.hs2;
                tdHalf.style.color = 'red';
                break;
        }
        if (isExec) {
            tdB.innerHTML = d.s1;
            tdF.innerHTML = d.s2;
            if (s1c) { tdB.style.color = "red"; }
            if (s2c) { tdF.style.color = "red"; }
        }
        var numCorner = 0;
        if (dataCompare('xkq')) { numCorner = 1; }
        if (dataCompare('corner1')) { numCorner = 1; }
        if (dataCompare('corner2')) { numCorner = 1; }
        if (dataCompare('hCorner1')) { numCorner = 1; }
        if (dataCompare('hCorner2')) { numCorner = 1; }
        if (dataCompare('zhrs')) { numCorner = 1; }
        if (dataCompare('khrs')) { numCorner = 1; }
        if (dataCompare('zyws')) { numCorner = 1; }
        if (dataCompare('kyws')) { numCorner = 1; }
        if (dataCompare('f_jq')) { numCorner = 1; }
        if (dataCompare('l_jq')) { numCorner = 1; }
        if (dataCompare('f_hp')) { numCorner = 1; }
        if (dataCompare('l_hp')) { numCorner = 1; }
        if (dataCompare('f_hr')) { numCorner = 1; }
        if (dataCompare('l_hr')) { numCorner = 1; }
        if (dataCompare('f_yw')) { numCorner = 1; }
        if (dataCompare('l_yw')) { numCorner = 1; }
        if (dataCompare('zb')) { numCorner = 1; }
        if ((dataCompare('info') || numCorner || Lbf.isHalfVisible(d))) {
            tr2 = Lbf.trMore(tr, true);
            tr2.cells[0].innerHTML = Lbf.trMoreInfo(d);
            tr2.style.display = d._more && isot && !tr.hide ? '' : 'none';
        }
        hp1c = uu.hred != 0 && d.hred != uu.hred;
        hp2c = uu.gred != 0 && d.gred != uu.gred;
        for (var key in objR) {
            if (dataCompare(key)) {
                td = key == 'hred' ? tdHome : tdGuest;
                Lbf.setRedYellow(td, objR[key], 'cardred', uu[key] || '');
                if (isPlay && (key == 'hred' ? hp1c : hp2c)) {
                    Lbf.setQueueName(td, 'd-teamhpch');
                    Lbf.playRedSound(tr);
                    var name = key + ',' + tr.id;
                    Lbf._objRedCard[name] = Lbf._outIndex++;
                    tr[name] = td._queueName;
                    Lsys.newTimeout('resetRedCard' + name, setTimeout(Lbf.resetRedCard, 60000));
                }
            }
        }
        for (var key in objY) {
            if (dataCompare(key)) {
                td = key == 'hyellow' ? tdHome : tdGuest;
                Lbf.setRedYellow(td, objY[key], 'cardyellow', uu[key] || '');
            }
        }
        if (tr.hide) { continue; }
        var pkid = d.rqpk || 0;
        pkid = pkid == 0 ? 'vs' : Lbf.formatPk(pkid, 'rq');
        if (Lbf._ckCredWindow == 1 && (hp1c || hp2c)) {
            h.push('<tr><td colspan="6" style="line-height:26px;text-align:left;"><span style="padding:2px 4px;margin-right:6px;color:white; font-weight:normal;');
            h.push('background-color:' + match.bgcolor + ';">' + match.name);
            h.push('</span> 红牌提示</td></tr>');
            h.push('<tr><td style="text-align:center; font-size:15px">' + tdStatus.innerHTML + '</td>');
            h.push((hp1c ? '<td style="background-color:#FF0000;color:#FFFFFF;">' : '<td>') + d.t1);
            h.push('</td><td style="color:blue;font-weight:bold;font-size:16px;">' + d.s1 + ' </td> <td class="d-sbs">' + pkid);
            h.push('</td><td style="color:blue;font-weight:bold;font-size:16px;">' + d.s2 + '</td>');
            h.push((hp2c ? '<td style="background-color:#FF0000;color:#FFFFFF;">' : '<td>') + d.t2 + '</td>');
            h.push('</tr>');
            matchNum++;
        }
        if (s1c || s2c) {
            Lbf.playGoalsSound(tr);
            if (Lbf._cookierqw == 1) {
                var s1, s2, ht = d.t1, gt = d.t2;
                if (s1c) {
                    ht = '<font color="red">' + ht + '</font>';
                    s1 = '<b style="color:red">' + d.s1 + '</b>';
                    s2 = '<b style="color:blue">' + d.s2 + '</b>';
                }
                if (s2c) {
                    gt = '<font color="red">' + gt + '<font>';
                    s1 = '<b style="color:blue">' + d.s1 + '</b>';
                    s2 = '<b style="color:red">' + d.s2 + '</b>';
                }
                h.push('<tr><td colspan="6" style="line-height:26px;text-align:left;"><span style="padding:2px 4px;color:white;font-weight:normal;background-color:');
                h.push(match.bgcolor + ';">' + match.name + '</span></td></tr>');
                h.push('<tr><td style="text-align:right;">' + (tdStatus.innerHTML.toString().toLowerCase().replace('<em>', '<em style="background:url(../i/point2.gif) no-repeat 0 0; padding-left:5px; line-height:8px;">')) + '</td><td>' + ht + '</td><td>' + s1);
                h.push('</td><td class="d-sbs">' + pkid + '</td><td>' + s2 + '</td><td>' + gt + '</td></tr>');
                matchNum++;
            }
        }
    }
    if (matchNum) {
        h.push('</table>');
        txt = '';
        txt += '<table  border="0" cellpadding="4" cellspacing="0" class="goalsForIeRedraw" style="font-size:14px;background-color:white;text-align:center; border:none;width:417px;">';
        txt += h.join("");
        Lbf.goals(txt, matchNum);
    }
    arrmove.length && (Lbf.moveToBottom(arrmove));
    if (arrwaitmove.length) {
        Lbf._objMoveBottom[arrwaitmove.join(',')] = Lbf._outIndex++;
        Lsys.newTimeout('mtbw' + arrwaitmove[0], setTimeout(Lbf.moveToBottomWait, 22000));
    }
};
Lbf.getMinKey = function (obj) {
    var min, minKey, kv;
    for (var key in obj) { kv = obj[key]; if (kv < min || min == undefined) { min = kv; minKey = key; } }
    if (!minKey) { return null; }
    delete obj[minKey];
    return minKey;
};
Lbf.resetGunQiu = function () {
    var minKey = Lbf.getMinKey(Lbf._objGunQiu);
    if (!minKey) { return; }
    var arr = minKey.split('_'),tr = Lbf._hashtr[arr[0]];
    if (!tr) { return; }
    var tagName = arr[1];
    Lsys.endTimeout('updateGunQiu' + minKey);
    var tags = tr.getElementsByTagName(tagName);
    if (tags.length < 1) { return; }
    var l = tags.length, tag;
    if (l > 3) { l = 3; }
    for (var i = 0; i < l; i++) { tag = tags[i]; if (tag._css != undefined) { tag.className = tag._css; } }
};
Lbf.resetPkClass = function () {
    var id = Lbf.getMinKey(Lbf._objPkClass);
    if (!id) { return; }
    Lsys.endTimeout('resetPkClass' + id);
    var tr = Lbf._hashtr[id];
    if (!tr) { return; }
    var xrq = Lbf.getTdRqpk(tr);
    if (xrq) { xrq.className = Lsys.matchType == 2 ? '' : 'd-sbs'; }
};
Lbf.updateGunQiu = function (hcss, tr, d, name, isFeng, arrValue, arrIndex, arrPk, isexit) {
    var tags = tr.getElementsByTagName(name), tag, css, index, cells = tr.cells, td, visible = false;
    switch (name) {
        case 'h5': visible = Lbf._gunqiuBz && Lbf.isHaveData(d, 'bz'); break;
        case 'h6': visible = Lbf._gunqiuDx && Lbf.isHaveData(d, 'dx'); break;
    }
    if (tags.length < 1) {
        var tagBzs = null;
        var isInsert = false;
        if (name == 'h5') {
            tagBzs = tr.getElementsByTagName('h6');
            isInsert = tagBzs.length > 0;
        }
        if (visible) { Lsearch.cssInsert(tr, 'tr-gunqiu'); }
        for (var i = 0; i < 3; i++) {
            tag = document.createElement(name);
            tag.style.display = visible ? '' : 'none';
            td = cells[i + 7];
            if (isInsert) { td.insertBefore(tag, tagBzs[i]); } else { td.appendChild(tag); }
        }
        tags = tr.getElementsByTagName(name);
        visible = false;
    } else {
        tag = tags[0];
        if (tag.style.display != 'none') { visible = false; }
    }
    var css1 = Lbf._arrpksj, css2 = Lbf._arrpkfb;
    d['_feng' + name] = isFeng;
    isFeng = !isFeng;
    if (isFeng) { arrValue = ['&nbsp;', '封', '&nbsp;']; }
    for (var i = 0, l = tags.length; i < l; i++) {
        tag = tags[i];
        tag._css = hcss;
        if (isFeng) {
            tag.innerHTML = arrValue[i];
            tag.className = hcss;
        } else {
            index = arrIndex[i];
            css = (i != 1 || name == 'h5') ? css1[index] : css2[index];
            tag.innerHTML = (i == 1 && arrPk) ? Lbf.formatPk(arrValue[i] || 0, arrPk) : Lbf.printf(arrValue[i] || '');
            tag.className = css || hcss;
        }
        if (visible) { tag.style.display = ''; }
    }
    if (isexit || isFeng) { return; }
    name = tr.id + '_' + name;
    Lbf._objGunQiu[name] = Lbf._outIndex++;
    Lsys.newTimeout('updateGunQiu' + name, setTimeout(Lbf.resetGunQiu, 20000));
};
Lbf._objDsZd = {
    2: [true, 'rq1', 'rq2', 'rqpk'], /*赔率变化*/
    5: [true, 'hRq1', 'hRq2', 'hRqpk'], /*上半让球*/
    13: [false, 'bzz', 'bzk', 'bzh'], /*标准*/
    17: [false, 'hBzz', 'hBzk', 'hBzh'], /*上半标准*/
    7: [true, 'dx1', 'dx2', 'dxpk'], /*大小*/
    10: [true, 'hDx1', 'hDx2', 'hDxpk'], /*上半标准*/

    3: [true, 'zdRq1', 'zdRq2', 'zdRqpk', 'zdrqS', 'gq_gqrq'], /*让球*/
    6: [true, 'zdhRq1', 'zdhRq2', 'zdhRqpk', 'zdhrqS'], /*上半让球走地*/
    19: [false, 'zdBzz', 'zdBzk', 'zdBzh', 'zdbzS', 'gq_gqop'], /*标准*/
    20: [false, 'zdhBzz', 'zdhBzk', 'zdhBzh', 'zdhbzS'], /*走地上半标准*/
    9: [true, 'zdDx1', 'zdDx2', 'zdDxpk', 'zddxS', 'gq_gqdx'], /*大小*/
    12: [true, 'zdhDx1', 'zdhDx2', 'zdhDxpk', 'zdhdxS']/*上半大小走地*/
};
Lbf._objGq = {
    2: 'h4',
    13: 'h5',
    7: 'h6',
    3: 'h4',
    19: 'h5',
    9: 'h6'
};
Lbf.getTdRqpk = function (tr) {
    switch (Lsys.matchType) {
        case 1: /*精简*/
            return tr.cells[4];
        case 2: /*滚球*/
            return tr.cells[8].childNodes[0];
        case 3: /*足彩*/
            return tr.cells[6];
        default:
            return tr.cells[5];
    }
};
Lbf._repeatodds = '';
Lbf.updatePl = function (txt, sysArea) {
    if (Lsys.stop || Lsys.area != sysArea) { return; }
    if (!txt || Lbf._repeatodds == txt || txt == ' ') { return; }
    Lbf._repeatodds = txt;
    var pls = null;
    try {
        pls = eval('({' + txt + '})');
        if (!pls) {
            return;
        }
    } catch (ex) {
        Lsys.newLog('更新赔率数据源错误：\r\n' + txt);
        return;
    }
    var tr, d, cellIndex, pl = {}, isGunQiu = Lsys.matchType == 2, isFeng = false, isLoadPl = false, arrName = ['', 'a', 'b', 'c'], arrNew = [0, 0, 0], type, id, arr = [], data = [], refTr = null, key, tagName = '', isSet = false, isColorBlack = false, isColorGreen = false, compCount = 0, newValue;
    for (var key in pls) {
        pl = pls[key];
        arr = key.split('_');
        id = parseInt(arr[0]);
        type = parseInt(arr[1]);
        tr = Lbf._hashtr[id];
        if (!tr) {
            continue;
        }
        d = tr._data;
        if (pl.iszd && !tr.iszd) { tr.iszd = 1; Lbf.matchTypeTd(tr, 2).className = 'd-st iszd'; }
        isFeng = false;
        tagName = '';
        isSet = false;
        isColorBlack = false;
        isColorGreen = false;
        switch (type) {
            case 0:
                continue;
            case 1: /*让球*/
            case 2:
                if (pl.c != d.rqpk) {
                    if (!d.rqpk) { isLoadPl = true; }
                    d.rqpk = pl.c;
                    var xrq = Lbf.getTdRqpk(tr);
                    if (xrq) {
                        xrq.innerHTML = Lbf.formatPk(pl.c, 'rq');
                        xrq.className = "d-pkchange";
                        Lbf._objPkClass[tr.id] = Lbf._outIndex++;
                        Lsys.newTimeout('resetPkClass' + tr.id, setTimeout(Lbf.resetPkClass, 60000));
                    }
                }
                type = 2;
                isSet = true;
                isColorBlack = true;
                break;
            case 4: /*上半让球*/
            case 5:
                if (!d.hRqpk) { isLoadPl = true; }
                type = 5;
                break;
            case 8: /*大小*/
            case 7:
                type = 7;
                isSet = true;
                isColorBlack = true;
                break;
            case 11: /*上半大小*/
            case 10:
                type = 10;
                break;
            case 14: /*标准*/
            case 13:
                if (!d.bzz) { isLoadPl = true; }
                type = 13;
                isSet = true;
                isColorBlack = true;
                break;
            case 18: /*上半标准*/
            case 17:
                if (!d.hBzz) { isLoadPl = true; }
                type = 17;
                break;
            /*----滚球部分----  */ 
            case 3: /*让球*/
            case 19: /*标准*/
            case 9: /*大小*/
                isSet = true;
                isColorGreen = true;
            case 6: /*上半让球*/
            case 20: /*上半标准*/
            case 12: /*上半大小*/
                isFeng = true;
                break;
            default:
                continue;
        }
        if (isGunQiu && isSet) { tagName = Lbf._objGq[type]; }
        data = Lbf._objDsZd[type];
        if (!data || d._wanchang) {
            continue;
        }
        var isPlay = Lbf.isPlaying(d);
        if (Lbf._viewOddsId == id) { refTr = tr; }
        if (isFeng) {
            d[data[4]] = pl.a == 0 ? 0 : 1; /* 0:封,1:不封*/
            if (pl.a == 0) {
                if (tagName) {
                    Lbf.updateGunQiu('green', tr, d, tagName, 0, '封');
                }
                continue;
            }
        }
        compCount = 0;
        for (var i = 1; i < 4; i++) {
            key = data[i];
            newValue = pl[arrName[i]];
            if (d[key] != undefined) { d['b_' + key] = d[key]; }
            if (d[key] == newValue) { compCount++; } else { d[key] = newValue; }
        }
        if (compCount == 3 && d['_feng' + tagName] == d[data[4]]) {
            continue;
        }
        if (Lsys.isConvert && data[0]) {
            d['ior_' + data[1]] = true; /*标记这个数据已经转换*/
            Lchange.otherIor(d, data[1], data[2]);
        }
        if (tagName) {
            if (isPlay && isColorGreen) { /*正在比赛 && 数据是滚球*/
                if (tagName == 'h4') {
                    Lbf.updateGunQiu('green', tr, d, 'h4', d.zdrqS, [d.zdRq1, d.zdRqpk, d.zdRq2], Lbf.voCss(d.zdRq1, d.b_zdRq1, d.zdRq2, d.b_zdRq2, d.zdRqpk, d.b_zdRqpk, true), Lbf._arrrqpk);
                } else if (Lbf._gunqiuVisible) {
                    if (tagName == 'h5') {
                        Lbf.updateGunQiu('green', tr, d, 'h5', d.zdbzS, [d.zdBzz, d.zdBzh, d.zdBzk], Lbf.voCss(d.zdBzz, d.b_zdBzz, d.zdBzk, d.b_zdBzk, d.zdBzh, d.b_zdBzh));
                    } else {
                        Lbf.updateGunQiu('green', tr, d, 'h6', d.zddxS, [d.zdDx1, d.zdDxpk, d.zdDx2], Lbf.voCss(d.zdDx1, d.b_zdDx1, d.zdDx2, d.b_zdDx2, d.zdDxpk, d.b_zdDxpk, true), Lbf._arrdxpk);
                    }
                }
            } else if (!isPlay && isColorBlack) { /*没有开赛 && 不是滚球数据*/
                if (tagName == 'h4') {
                    Lbf.updateGunQiu('', tr, d, 'h4', true, [d.rq1, d.rqpk, d.rq2], Lbf.voCss(d.rq1, d.b_rq1, d.rq2, d.b_rq2, d.rqpk, d.b_rqpk, true), Lbf._arrrqpk);
                } else if (Lbf._gunqiuVisible) {
                    if (tagName == 'h5') {
                        Lbf.updateGunQiu('', tr, d, 'h5', true, [d.bzz, d.bzh, d.bzk], Lbf.voCss(d.bzz, d.b_bzz, d.bzk, d.b_bzk, d.bzh, d.b_bzh));
                    } else {
                        Lbf.updateGunQiu('', tr, d, 'h6', true, [d.dx1, d.dxpk, d.dx2], Lbf.voCss(d.dx1, d.b_dx1, d.dx2, d.b_dx2, d.dxpk, d.b_dxpk, true), Lbf._arrdxpk);
                    }
                }
            }
        }
    }
    if (refTr) { Lbf.viewOdds(refTr); }
    if (isLoadPl) { Lsys.newTimeout('reloadPlInit', window.setTimeout(Lbf.reloadPlInit, Lbf.random(5000))); }
};

Lbf.trMoreInfo = function (d) {
    var smore = '';
    if (d.xkq == 1) { smore += d.t1 + '[先开球] '; } else if (d.xkq == 2) { smore += d.t2 + '[先开球] '; }
    if (d.corner1 > 0 || d.corner2 > 0) {
        smore += '全场角球数[' + (d.corner1 || 0) + '-' + (d.corner2 || 0) + ']';
        if (Lbf.isHalfVisible(d)) { smore += (smore ? ',' : '') + '  半场角球数[' + (d.hCorner1 || 0) + '-' + (d.hCorner2 || 0) + '] '; }
    }
    if (d.zhrs || d.khrs) { smore += (smore ? ',' : '') + ' 换人数[' + (d.zhrs || 0) + '-' + (d.khrs || 0) + ']'; }
    if (d.zyws || d.kyws) { smore += (smore ? ',' : '') + ' 越位数[' + (d.zyws || 0) + '-' + (d.kyws || 0) + ']'; }
    if (d.zb) {
        if ((!Lsys.isnet || d._netad) && Lpar.netlink && !d._colltop && d.zb.toLowerCase().indexOf('[網絡直播]</a>') != -1) {
            d.zb += Lpar.netlink;
            d._netad = true;
            Lsys.isnet = true;
        }
        smore += d.zb;
    }
    var arr = [];
    if (d.f_jq) { arr.push(' 第一個角球[' + (d.f_jq == 1 ? d.t1 : d.t2) + ']'); }
    if (d.l_jq) { arr.push(' 最后一个角球[' + (d.l_jq == 1 ? d.t1 : d.t2) + ']'); }
    if (d.f_hp) { arr.push(' 第一張黃牌[' + (d.f_hp == 1 ? d.t1 : d.t2) + ']'); }
    if (d.l_hp) { arr.push(' 最后一张黄牌[' + (d.l_hp == 1 ? d.t1 : d.t2) + ']'); }
    if (arr.length > 0) { smore += (smore ? '<br>' : '') + arr.join(''); }
    arr = [];
    if (d.f_hr) { arr.push(' 第一个換人[' + (d.f_hr == 1 ? d.t1 : d.t2) + ']'); }
    if (d.l_hr) { arr.push(' 最后一个換人[' + (d.l_hr == 1 ? d.t1 : d.t2) + ']'); }
    if (d.f_yw) { arr.push(' 第一个越位[' + (d.f_yw == 1 ? d.t1 : d.t2) + ']'); }
    if (d.l_yw) { arr.push(' 最后一个越位[' + (d.l_yw == 1 ? d.t1 : d.t2) + ']'); }
    if (arr.length > 0) { smore += (smore ? '<br>' : '') + arr.join(''); }
    if (d.info) { smore += (smore ? '<br>' : '') + d.info; }
    if (smore) { d._more = true; }
    return smore;
};
Lbf.viewHistoryBox = function () { var box = $('shistory'); if (box) { box.style.visibility = 'visible'; } };
Lbf.load = function () {
    Lbf.setSwitchInfo(95, 99);
    Lbf.render();
    Lbf.loadcomplute();
    Lbf.datamatchcheck();
};
Lbf.render = function () {
    var tableLive = $('wMyTable');
    tableLive.onmouseup = Lbf.selend;
    tableLive.onmousedown = Lbf.selstart;
    Lbf._tbody = $('wMyData');
    var rows = Lbf._tbody.rows, l = rows.length, tr, td, cell, css;
    function tdBindBf(td) {
        td.onmouseout = Lbf.hideDetail;
        td.onmouseover = Lbf.viewDetail;
        td.onclick = Lbf.opdl;
    }
    function tdBindOdds(td) {
        td.onmouseover = Lbf.showOdds;
        td.onmousemove = Lbf.moveOdds;
        td.onmouseout = Lbf.hideOdds;
        td.onclick = Lbf.opol;
    }
    var index = 0, tdi, ds, d, hcoll = Lbf._collhash, rowindex = 0, cskip = Lsys.collskip, isAddSkip = Lsys.matchType == 3 ? 1 : 0;
    for (var i = 0; i < l; i++) {
        tr = rows[i];
        if (!tr.id) {
            css = tr.className;
            if (Lsys.matchType == 3 && css == 'zcInfo') {
                index++;
            } else {
                switch (css) {
                    case 'moreList': tr._moreList = true; break;
                    case 'Collline': tr._Collline = true; break;
                }
            }
            continue;
        }
        index = parseInt(tr.getAttribute('dindex'));
        d = tr._data = Lmatch._data[index];
        tr._match = Lmatch._match[d.lsid];
        Lbf._hashtr[tr.id] = tr;
        cell = tr.cells;
        tdBindBf(cell[4 + isAddSkip]);
        switch (Lsys.matchType) {
            case 1: tdi = 8; break;
            case 2:
                if (d._gqzs) { Lsearch.cssInsert(tr, 'tr-gunqiu'); }
                tdBindOdds(cell[8]);
                tdi = 11;
                break;
            default:
                tdBindOdds(cell[5 + isAddSkip]);
                tdBindBf(cell[6 + isAddSkip]);
                tdi = 10;
                break;
        }
        if (isAddSkip) { continue; }
        td = cell[tdi];
        if (cskip) {
            td.onclick = Lbf.hidematch;
        } else {
            ds = td.getElementsByTagName('a');
            if (ds.length < 1) { continue; }
            ds[0].onclick = d._colltop ? Lbf.Collremovematch : Lbf.Colladdmatch;
            ds[1].onclick = Lbf.hidematch;
            tr._colla = ds;
            if (d._colltop) { hcoll[d.id] = tr; tr._colltop = true; }
        }
    }
    if (Lsys.matchType == 3) {
        Lbf._divLottery.style.display = 'block';
        Lbf.tryLottery();
    }
    Lsys.newTimeout('render_hide', setTimeout(Lbf.hidemorematch, 500));
    if (Lbf._loadAd) {
        Lsys.newTimeout('Lad_load', setTimeout(Lad.load, 100));
    } else {
        Lsys.newTimeout('noAd_dataRef', setTimeout(Lbf.dataRefBgClass, 100));
    }

    Lbf._labGunQiu.style.display = Lsys.matchType == 2 ? 'inline' : 'none';
    Lbf._labMoreInfo.style.display = Lsys.matchType != 3 ? 'inline' : 'none';
    if (Lbf._firstLoad) { return; }
    Lbf._firstLoad = true;
    setTimeout(Lbf.viewHistoryBox, 500);
    setInterval(Lbf.updatetime, 3000);
    setInterval(Lbf.loadDetail, 10000);
    setInterval(Lbf.loadBf, Lsys.refInter);
    setInterval(Lbf.loadPlDs, Lsys.refInter);
    setInterval(Lsys.setTitle, 1000);
};
Lbf.tryLottery = function () { if (window.Lottery) { Lottery.loaddata(); } else { Lsys.newTimeout('tryLottery', setTimeout(Lbf.tryLottery, 1000)); } };
Lbf.rowBindIndex = function () {
    var rows = Lbf._tbody.rows, tr, i, index = 0, d;
    for (i = 0; tr = rows[i++]; ) {
        if (!tr.id) { continue; }
        d = tr._data;
        tr._index = d._index;
    }
};
Lbf.loadcomplute = function () {
    Lbf.rowBindIndex();
    Lbf.loadmatch();
    Lbf.loadpk();
    Lbf.collhistory();
    Lbf.loadCountry();
    Lbf.ssort();
    Lbf.loadLeagueList();
    Lbf.setSwitchInfo(100, 0, Lsys.name + '加载完成');
    Lsys.stop = false;
};
Lbf.loadDetail = function () { if (Lsys.stop) { return; } var url = Lsys.formatUri(Lsys.pathDetail); Lajax.send('loadDetail', Lbf.updateDetail, url); };
Lbf._txtDetail = '';
Lbf.updateDetail = function (txt, sysArea) {
    if (Lsys.stop || Lsys.area != sysArea) { return; }
    if (!txt || Lbf._txtDetail == txt) { return; }
    Lbf._txtDetail = txt;
    var arr = txt.split("!");
    for (var i = 0, l = arr.length; i < l; i++) {
        var d = arr[i].split('|'), a = [];
        for (var i0 = 1, l0 = d.length; i0 < l0; i0++) { a.push(d[i0]); }
        Lbf._hashdetail[d[0]] = a;
    }
};
Lbf.hiddenOdds = function () { Lbf._odds.style.visibility = 'hidden'; Lbf._viewOddsId = null; Lbf._viewOddsInfo = false; };
Lbf.cacelHideOdds = function () { Lsys.delTimeout('showOdds'); };
Lbf.hideOdds = function () { Lsys.newTimeout('showOdds', setTimeout(Lbf.hiddenOdds, 200)); };
Lbf.showOdds = function (e) {
    if (!Lbf._isshow) { return; }
    Lbf.cacelHideOdds();
    var td = this, odds = Lbf._odds, isVisible = Lbf._viewOddsInfo;
    Lbf.viewOdds(td.parentNode);
    if (Lsys.matchType != 2 && isVisible) { return; }
    var cus = Lposition.offset(td), x = 0;
    switch (Lsys.matchType) {
        case 2: x = cus.x - Lbf._odds.clientWidth + 5; break;
        default: x = cus.x + td.clientWidth - 38; break;
    }
    odds.style.left = x + 'px';
    if (isVisible) { return; }
    var cur = Lposition.cursor(e);
    odds.style.top = (cur.y - 5) + 'px';
    odds.style.visibility = 'visible';
    Lbf._viewOddsInfo = true;
};
Lbf.moveOdds = function (e) { Lbf._odds.style.top = (Lposition.cursorY(e) - 5) + 'px'; };
Lbf.leagueinit = function () { var tbody = $('dleaguebody'); };
Lbf.poplayershow = function () { Lsys.delTimeout('poptid'); Lbf._poplayer.style.visibility = "visible"; };
Lbf.poplayerhide = function () { Lsys.newTimeout('poptid', setTimeout(Lbf.poplayerclose, 200)); };
Lbf.poplayerclose = function () { Lbf._poplayer.style.visibility = "hidden"; };
Lbf.showpop = function (e) {
    var o;
    if (e) { o = e.target; } else { e = window.event; o = e.srcElement; }
    if (!o.init) {
        var alt = o.getAttribute('myalt');
        if (alt) { o.pop = alt; o.removeAttribute('myalt'); o.isfly = o.getAttribute('isfly') == '1'; }
        o.init = true;
    }
    if (o.pop != Lbf._spop) {
        Lbf._spop = o.pop;
        if (Lbf._spop) {
            Lbf.poplayershow();
            var mos = Lposition.cursor(e);
            var cus = Lposition.offset(o);
            var player = Lbf._poplayer;
            player.innerHTML = Lbf._spop.replace(/\^br/g, "<br />");
            if (o.isfly) {
                player.style.cssText += ';left:' + (cus.x + o.clientWidth) + 'px;top:' + cus.y + 'px;';
            } else {
                player.style.left = (mos.x - player.clientWidth / 2) + "px";
                player.style.top = (cus.y - player.clientHeight) + 'px';
            }
            player.pop = Lbf._spop;
        } else {
            Lbf.poplayerhide();
        }
    } else if (o.pop) {
        Lsys.delTimeout('poptid');
    }
};
Lbf.selstart = function () { Lbf._isshow = false; };
Lbf.selend = function () { Lbf._isshow = true; }
Lbf.closecal = function () { try { if (calendar.isopen) { calendar.hide(); }; } catch (ex) { } };
Lbf.pageStyle = function (name, skip) {
    switch (name) {
        case 'red': case 'blue': case 'black': case 'yellow': case 'gray': case 'wood': case 'green': break;
        default: name = 'blue'; break;
    }
    var css = $('cssstyle'); if (!css) { return; }
    css.href = 'c/' + name + '.css';
    if (skip) { return; }
    Lbf.cookieNumberSet('#ps', name);
}
Lbf.initpktype = function () {
    if (Lbf._cookiepki == 1) {
        switch (Lsys.matchType) {
            case 2:
                Lbf._arrrqpk = '无开盘,平手,平/半,半球,半/一,一球,一/球半,球半,球半/二,二球,二/二球半,二球半,二球半/三,三球,三/三球半,三球半,三球半/四,四球,四/四球半,四球半,四球半/五,五球,五/五球半,五球半,五球半/六,六球,六/六球半,六球半,六球半/七,七球,七/七球半,七球半,七球半/八,八球,八/八球半,八球半,八球半/九,九球,九/九球半,九球半,九球半/十,十球,十球/十球半,十球半,十球半/十一,十一球,十一/十一球半,十一球半,十一球半/十二,十二球,十二/十二球半,十二球半,十二球半/十三,十三球,十三/十三球半,十三球半,十三球半/十四,十四球,十四/十四球半,十四球半,十四球半/十五,十五球,十五/十五球半,十五球半,十五球半/十六,十六球,十六/十六球半,十六球半,十六球半/十七,十七球,十七/十七球半,十七球半,十七球半/十八,十八球,十八/十八球半,十八球半,十八球半/十九,十九球,十九/十九球半,十九球半,十九球半/二十,二十球,'.split(',');
                break;
            default:
                Lbf._arrrqpk = '无开盘,平手,平手/半球,半球,半球/一球,一球,一球/球半,球半,球半/两球,两球,两球/两球半,两球半,两球半/三球,三球,三球/三球半,三球半,三球半/四球,四球,四球/四球半,四球半,四球半/五球,五球,五球/五球半,五球半,五球半/六球,六球,六球/六球半,六球半,六球半/七球,七球,七球/七球半,七球半,七球半/八球,八球,八球/八球半,八球半,八球半/九球,九球,九/九球半,九球半,九球半/十,十球,十/十球半,十球半,十球半/十一球,十一球,十一球/十一球半,十一球半,十一球半/十二球,十二球,十二球/十二球半,十二球半,十二球半/十三球,十三球,十三球/十三球半,十三球半,十三球半/十四球,十四球,十四球/十四球半,十四球半,十四球半/十五球,十五球,十五球/十五球半,十五球半,十五球半/十六球,十六球,十六球/十六球半,十六球半,十六球半/十七球,十七球,十七球/十七球半,十七球半,十七球半/十八球,十八球,十八球/十八球半,十八球半,十八球半/十九球,十九球,十九球/十九球半,十九球半,十九球半/二十球,二十球,'.split(',');
                break;
        }
    } else {
        Lbf._arrrqpk = '无开盘,0,0/0.5,0.5,0.5/1,1,1/1.5,1.5,1.5/2,2,2/2.5,2.5,2.5/3,3,3/3.5,3.5,3.5/4,4,4/4.5,4.5,4.5/5,5,5/5.5,5.5,5.5/6,6,6/6.5,6.5,6.5/7,7,7/7.5,7.5,7.5/8,8,8/8.5,8.5,8.5/9,9,9/9.5,9.5,9.5/10,10,10/10.5,10.5,10.5/11,11,11/11.5,11.5,11.5/12,12,12/12.5,12.5,12.5/13,13,13/13.5,13.5,13.5/14,14,14/14.5,14.5,14.5/15,15,15/15.5,15.5,15.5/16,16,16/16.5,16.5,16.5/17,17,17/17.5,17.5,17.5/18,18,18/18.5,18.5,18.5/19,19,19/19.5,19.5,19.5/20,,,,'.split(',');
    }
};
Lbf.schange = function (obj, url, count, dvalue) {
    var v = obj.options[obj.selectedIndex].value;
    if (!v) { return; }
    var arr = v.split(',');
    if (arr.length < count) { arr[arr.length] = dvalue; }
    var l = arr.length;
    for (var i = 0; i < l; i++) { url = url.replace('{' + i + '}', arr[i]); }
    window.open(url);
};
Lbf.closefbox = function (obj) {
    while (obj) {
        if (obj.className.indexOf('fbox') != -1) { obj.style.display = 'none'; break; }
        obj = obj.parentNode;
    }
    Lbf.closecal();
};
Lbf.openfbox = function (name, yadd, y) {
    var obj = $(name); if (!obj) { return; }
    if (Lbf._currentfobx && obj != Lbf._currentfobx) { Lbf._currentfobx.style.display = 'none'; }
    Lbf._currentfobx = obj;
    obj.style.display = 'block';
    if (y) { obj.style.top = yadd + (y + obj.clientHeight) + 'px'; }
    Lbf.closecal();
};
Lbf.netsel = function (disp) {
    var box = Lbf._wNetSelBox;
    if (!box) { box = Lbf._wNetSelBox = $('wNetSelBox'); }
    box.style.visibility = disp ? 'visible' : 'hidden';
};
Lbf.objposition = function (o) { return { st: document.body.scrollTop, sw: document.body.clientWidth, sh: document.body.clientHeight, w: o.clientWidth || 488 }; };
Lbf.goalsPosition = function (o, h) {
    var g = Lbf.objposition(o), x = 0, y = 0, right = undefined, b = undefined;
    g.h = h;
    switch (parseInt(Lbf._cookiewinp)) {
        case 0: /*正上方*/x = (g.sw - g.w) / 2; break;
        case 1: /*正下方*/x = (g.sw - g.w) / 2; y = g.sh; b = 0; break;
        case 2: /*正左方*/y = (g.sh) / 2; break;
        case 3: /*正右方*/y = (g.sh) / 2; right = 0; break;
        case 4: /*左上角*/break;
        case 5: /*右上角*/right = 0; break;
        case 6: /*左下角*/y = g.sh; b = 0; break;
        case 7: /*右下角*/right = 0; y = g.sh; b = 0; break;
    }
    return { "x": x, "y": y, "b": b, "right": right };
}
Lbf.goalsHide = function () {
    if (!Lbf._goal) { return; }
    if (document.all) { Lbf.goalsForIe(false); } else { Lbf._goal.tip.style.visibility = 'hidden'; }
};
Lbf.openpage = function (url) { window.open(url); }
Lbf.goals = function (txt, matchNum) {
    if (Lsys.stop) { return; }
    Lsys.newTimeout('outGoals', setTimeout(Lbf.goalsHide, 30000));
    var goal = Lbf._goal;
    if (!goal) {
        goal = Lbf._goal = {};
        goal.tip = $('wGoals');
        goal.tip.onclick = Lbf.goalsHide;
        goal.txt = $('wGoalsText');
        goal.box = $('wGoalsBox');
        goal.iframe = $('wGoalsIframe');
    }
    var ad = Lad._ads['wFLYTXTAD-jq']; ad && (ad = ad[0]);
    ad && (txt += '<center style="height:22px;line-height:22px;overflow:hidden;font-weight:bold;">广告：<a style="color:red;">' + ad.html + '</a></center>');
    goal.txt.innerHTML = txt || '';
    var h = goal.box.clientHeight - (matchNum > 1 ? Lpar.goal1 : Lpar.goal2), g = Lbf.goalsPosition(goal.tip, h), t = goal.tip;
    h -= 8;
    if (document.all) {
        Lbf.goalsForIe(txt, g.x, g.y, g.right, h, matchNum);
        return;
    } else {
        if (g.right != undefined) {
            t.style.right = g.right + 'px';
            t.style.left = '';
        } else {
            t.style.left = g.x + 'px';
        }
        if (g.b != undefined) {
            t.style.bottom = g.b + 'px';
            t.style.top = '';
        } else {
            t.style.top = g.y > h / 2 ? (g.y - h / 2) : g.y + 'px';
        }
    }
    t.style.visibility = 'visible';
    t.style.height = goal.iframe.style.height = h + 'px';
};
Lbf.goalsForIeRedraw = function () {
    var popup = Lbf._goalsPopup;
    if (popup._run) { try { if (popup.window.show) { popup.window.show(popup._x, popup._y, 488, popup._h); Lbf._outGoals6 = setTimeout(Lbf.goalsForIeRedraw, 200); } } catch (ex) { } }
};
Lbf.goalsForIe = function (txt, x, y, r, h, matchNum) {
    clearTimeout(Lbf._outGoals6);
    var popup = Lbf._goalsPopup;
    if (!popup) { popup = Lbf._goalsPopup = {}; popup.window = window.createPopup(); }
    if (txt) {
        popup.window.document.body.innerHTML = '<div style="width:488px; font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px; text-align:left; padding:0; border:none;visibility:visible; background-color:#0055AA;height:' + h + 'px;" onclick="parent.Lbf.goalsHide();" ><iframe id="wGoalsIframe" scrolling="no" frameborder="0" style="position:absolute; z-index:1; width:488px;height:' + h + 'px;background-color:white;"></iframe><div class="box" id="wGoalsBox" style="padding:8px; cursor:pointer;position:absolute; z-index:2; width:488px;background-color:#0055AA;border:solid 1px #8e9c9c;"><div id="wGoalsText" style="border:solid 1px #8e9c9c; background-color:#fffffe; padding:8px;">' + txt + '</div><div style="text-align:right; line-height:24px; font-size:13px; text-transform:uppercase; color:#ffffff;">' + Lpar.poptxt + '</div></div></div>';
        popup._x = r != undefined ? document.body.clientWidth - 488 - 1 : (x || 0);
        popup._y = y || 0;
        popup._h = h + (matchNum > 1 ? matchNum * 9 : 12);
        popup._run = true;
        Lbf.goalsForIeRedraw();
        Lbase.event(popup.window.document.body, 'onunload', Lbf.goalsForIeRedraw);
        Lbf._outGoals6 = setTimeout(Lbf.goalsForIeRedraw, 200);
    } else {
        popup._run = false;
        popup.window.hide();
    }
};
Lbf.play = function () { return false; };
Lbf._plIsLoad = false;
Lbf._matchIsLoad = false;
Lbf.play2 = function () {
    var a1 = Lbf._plIsLoad, a2 = Lbf._matchIsLoad;
    if (!a1 || !a2) { return; }
    if (Lbf._loadmatchcount > 1 && Lmatch._data.length < 1) { Lbf.waitReload(); return; }
    Lbf.setSwitchInfo(80, 95);
    Lbf.initBf();
};
Lbf.loadPlInitCall = function (txt) {
    if (Lsys.tryEval(txt)==0) {
        Lbf._plIsLoad = true;
        Lbf.play2();
    } else {
        Lsys.newTimeout('loadPlInitCall', setTimeout(Lbf.loadPlInit, 100));
    }
};
Lbf.reloadPlInitCall = function (txt) {
    if (Lsys.tryEval(txt) > 0) {
        Lsys.newTimeout('reloadPlInitCall', setTimeout(Lbf.reloadPlInit, 100));
    }
};
Lbf.loadMatchInitCall = function (txt) {
    var errorLine = Lsys.tryEval(txt);
    if (errorLine < 2) {
        var match = Lmatch._match, arr = [], objCountry = Lmatch._country = {}, index = 0, countryid = 0;
        for (var key in match) {
            arr = match[key];
            countryid = arr[5];
            objCountry[countryid] = arr[2];
            match[key] = { id: key, name: arr[0], bgcolor: arr[1], countryId: countryid, link: arr[3] == 1, type: arr[4], _rowindex: arr[6] };
        }
        Lbf._matchIsLoad = true;
        Lbf.play2();
        if (errorLine && Lbf._tryLMIC < 2) {
            Lsys.newTimeout('ReloadPlInitCall', setTimeout(Lbf.reloadmatchinfo, Lbf.random(5000)));
            Lbf._tryLMIC++;
        }
    } else {
        Lsys.uidInit();
        Lsys.newTimeout('loadMatchInitCall', setTimeout(Lbf.loadMatchInit, 100));
    }
};
Lbf.reloadPlInit = function () { Lbf._plIsLoad = false; var name = 'wJsReMatchOdds', uri = Lsys.formatUri(Lsys.pathPlInit); Lajax.send(name, Lbf.reloadPlInitCall, uri); };
Lbf.loadPlInit = function () {Lbf._plIsLoad =false; var name = 'wJsMatchOdds', uri = Lsys.formatUri(Lsys.pathPlInit); Lajax.send(name, Lbf.loadPlInitCall, uri); };
Lbf.loadMatchInit = function () { Lbf._matchIsLoad = false; var name = 'wJsMatchInfo', uri = Lsys.formatUri(Lsys.arrlan[Lbf._cookielan]); Lajax.send(name, Lbf.loadMatchInitCall, uri); };
Lbf.loadmatchinfo = function (isHand) {
    if (isHand == true) {
        Lbf.setSwitchInfo(1, 80);
        if (Lsys.matchType == 3) { Lbase.createJsFile('wJsZcInfo', 'j/Lottery.js', true); }
    }
    Lbf._loadmatchcount++;
    Lbf.loadPlInit();
    Lbf.loadMatchInit();
};
Lbf.reloadmatchinfo = function () {
    if (Lsys.stop) { return; }
    Lbf._loadmatchcount = 0;
    Lbf.loadmatchinfo();
};
Lbf.waitReload = function () {
    Lmatch.noMatch = true;
    var n = 'noMatchReload';
    if (Lsys.getTimeout(n)) {
        Lsys.delTimeout(n);
        setTimeout(Lbf.reloadmatchinfo, 1);
    } else {
        Lsys.newTimeout(n, setTimeout(Lbf.reloadmatchinfo, Lbf.random(30000)));
    }
};
Lbf.loadPlDs = function () {
    if (Lsys.stop || Lmatch.noMatch) { return; }
    var url = Lsys.formatUri(Lsys.pathPlDs);
    Lajax.send('loadPlDs0', Lbf.updatePl, url);
    if (Lsys.matchType != 3 && Lsys.pathPlZd) {
        var url = Lsys.formatUri(Lsys.pathPlZd);
        Lajax.send('loadPlDs1', Lbf.updatePl, url);
    }
};
Lbf.setRedYellow = function (td, isHome, name, txt) {
    var o = td[name];
    if (!o) {
        var tags = td.getElementsByTagName('span'), cardred, cardyellow, span = tags[0];
        if (span) { if (span.className == 'cRed') { cardred = span; } else { cardyellow = tags[1]; } }
        if (isHome) { /*yellow,red*/
            var a = td.getElementsByTagName('a')[0];
            if (!cardred) {
                cardred = document.createElement('span');
                td.insertBefore(cardred, a);
            }
            if (!cardyellow) {
                cardyellow = document.createElement('span');
                td.insertBefore(cardyellow, cardred);
            }
        } else { /*red,yellow*/
            var code = td.getElementsByTagName('code')[0];
            if (!code) {
                if (!cardred) {
                    cardred = document.createElement('span');
                    td.appendChild(cardred);
                }
                if (!cardyellow) {
                    cardyellow = document.createElement('span');
                    td.appendChild(cardyellow);
                }
            } else {
                if (!cardred) {
                    cardred = document.createElement('span');
                    td.insertBefore(cardred, code);
                }
                if (!cardyellow) {
                    cardyellow = document.createElement('span');
                    td.insertBefore(cardyellow, code);
                }
            }
        }
        cardred.className = 'cRed';
        cardyellow.className = 'cYellow';
        td.cardred = cardred;
        td.cardyellow = cardyellow;
        o = td[name]
    }
    o.innerHTML = txt ? ('<i>' + txt + '</i>') : '';
};
Lbf.setQueueName = function (td, css) {
    var o = td._queueName;
    if (!o) { o = td._queueName = td.getElementsByTagName('a')[0]; }
    if (css != undefined) { o.className = css }
};
Lbf.ie6aOver = function () { this.className = 'hover'; };
Lbf.ie6aOut = function () { this.className = ''; };
Lbf.ainit = function () {
    var as = document.getElementsByTagName('a'), a;
    for (var i = 0, l = as.length; i < l; i++) {
        a = as[i];
        if (a.href || a.onmouseover || a.onmouseout || a.className) { continue; }
        a.onmouseover = Lbf.ie6aOver;
        a.onmouseout = Lbf.ie6aOut;
    }
};
Lbf.shidecount = function (count, skipsave) {
    $("hiddencount").innerHTML = Lbf._hidecount = count;
    var s = Lbase.keys(Lbf._hashhide).join(",") || '';
    !skipsave && (Lcookie.set('Lbf_hideid', s));
    Lbf._cookiehideids = s;
    Lad.txtListBind();
};
Lbf.hidemorematch = function () {
    var d = Lbf._cookiehideids.split(','), k = 0, count = d.length, tr, tr2, id;
    if (count < 1) { return; }
    for (var i = 0; i < count; i++) {
        id = d[i];
        if (!id) { continue; }
        tr = Lbf._hashtr[id];
        if (!tr) { continue; }
        Lbf._hashhide[tr.id] = null;
        tr.hide = true;
        tr.style.display = 'none';
        tr2 = Lbf.trMore(tr);
        if (tr2) { tr2.style.display = 'none'; }
        k++;
    }
    Lbf.shidecount(k);
};
Lbf.setShangBanView = function () {
    $('sbczs').checked = $('sbczs2').checked = Lbf._cookiesbc ? false : true;
    Lbf._cookiesbc = Lbf._cookiesbc ? 0 : 1;
    Lbf.cookieNumberSet('sbczs', Lbf._cookiesbc);
};
Lbf.setGunQiuView = function () {
    $('wCkGunQiu').checked = Lbf._ckGunQiuView ? false : true;
    Lbf._ckGunQiuView = Lbf._ckGunQiuView ? 0 : 1;
    Lbf.cookieNumberSet('gqzs', Lbf._ckGunQiuView);
};
Lbf.slanguage = function (n) {
    if (Lbf._cookielan == n) { return; }
    $('lan_' + Lbf._cookielan).checked = false;
    $('alan_' + Lbf._cookielan).className = "";
    $('lan_' + n).checked = true;
    $('alan_' + n).className = "red";
    Lbf._cookielan = n;
    Lbf.cookieNumberSet('lan', n);
    var txt = '';
    switch (n) {
        case 1: txt = '繁体'; break;
        case 2: txt = '简体'; break;
        case 3: txt = 'English'; break;
    }
    Lsys.initTimeout();
    Lbf.setSwitchInfo(0, 0, '正在加载' + Lsys.name + '（' + txt + '）...');
    Lsys.loadData();
};
Lbf.sotherinfo = function () {
    var disp = Lbf._cookieother ? 'none' : '',tr, tr2, rows = Lbf._tbody.rows;
    for (var i = 0, l = rows.length; i < l; i++) {
        tr = rows[i];
        if (tr.id && !tr.hide && tr._data._more) {
            tr2 = Lbf.trMore(tr);
            if (tr2) { tr2.style.display = disp; }
        }
    }
    $('wCkMoreInfo0').checked = $('wCkMoreInfo').checked = Lbf._cookieother ? false : true;
    Lbf._cookieother = Lbf._cookieother ? 0 : 1;
    Lbf.cookieNumberSet(Lsys.matchType == 1 ? 'more1' : 'more', Lbf._cookieother);
};
Lbf.sjingyin = function () {
    var v = Lbf._cookiejingyin = Lbf._cookiejingyin ? 0 : 1;
    $('wCkJingyin').checked = v ? true : false;
    Lbf.cookieNumberSet('jy', v);
};
Lbf.getGoalsSound = function (clear) {
    var div = Lbf._wHideGoalsSound;
    if (!div) { div = Lbf._wHideGoalsSound = $('wHideGoalsSound'); }
    if (clear || !div._sound) {
        div._sound = Lbf.getSwf('i/f/sound-' + Lbf._arrsound[Lbf._cookiesound] + '.swf?rnd=' + Math.random());
        if (clear && !Lbf._cookiejingyin) { div.innerHTML = div._sound; Lsys.setTitle(); }
    }
    return div._sound;
};
Lbf.setGoalsSound = function (v) {
    if (v == '' || Lbf._cookiesound == v) { return; }
    Lbf._cookiesound = v;
    Lbf.cookieNumberSet('sound', v);
    Lbf.getGoalsSound(true);
};
Lbf.playGoalsSound = function (tr) {
    Lbf._objGoals[tr.id] = Lbf._outIndex++;
    Lsys.newTimeout('resetGoals' + tr.id, setTimeout(Lbf.resetGoals, 120000));
    if (Lbf._cookierqs == 1 && !Lbf._cookiejingyin) {
        Lbf.matchTypeTd(tr, 8).innerHTML = Lbf.getSwf('i/f/sound-' + Lbf._arrsound[Lbf._cookiesound] + '.swf?rnd=' + Math.random());
        Lsys.setTitle();
    }
};
Lbf.playRedSound = function (tr) {
    if (Lbf._ckCredSound == 1 && !tr.hide && !Lbf._cookiejingyin) {
        var div = Lbf._wHideRedSound;
        if (!div) { div = Lbf._wHideRedSound = $('wHideRedSound'); }
        div.innerHTML = Lbf.getSwf('i/f/red.swf?rnd=' + Math.random());
        Lsys.setTitle();
    }
};
Lbf.stipwinpos = function (n) { Lbf._cookiewinp = parseInt(n); Lbf.cookieNumberSet('winp', n); };
Lbf.ssort = function () {
    var on = Lbf._cookiepm == 0, visible = on ? "none" : "", v = Lbf._tbody.getElementsByTagName("code");
    $('wQdpm').checked = on ? false : true;
    $('qdpm2').innerHTML = on ? '开启球队排名' : '关闭球队排名';
    for (var i = 0, l = v.length; i < l; i++) { v[i].style.display = visible; }
};
Lbf.sortClick = function (o) { Lbf._cookiepm = Lbf._cookiepm == 1 ? 0 : 1; Lbf.cookieNumberSet('pm', Lbf._cookiepm); Lbf.ssort(); };
Lbf.sredwin = function (o) { Lbf.cookieNumberSet('hpw', Lbf._ckCredWindow = o.checked ? 1 : 0); };
Lbf.sinwin = function (o) { Lbf.cookieNumberSet('rqw', Lbf._cookierqw = o.checked ? 1 : 0); };
Lbf.sredsound = function (o) { Lbf.cookieNumberSet('hps', Lbf._ckCredSound = o.checked ? 1 : 0); };
Lbf.sinsound = function (o) { Lbf.cookieNumberSet('rqs', Lbf._cookierqs = o.checked ? 1 : 0); };
Lbf.spktype = function (id) {
    if (Lbf._cookiepki == id || Lsys.matchType == 1) { return; }
    Lbf._cookiepki = id;
    Lbf.initpktype();
    Lbf.cookieNumberSet('pk', id);
    var cellIndex = 5, oo, ischild = Lsys.matchType == 2 ? true : false;
    switch (Lsys.matchType) {
        case 2: cellIndex = 8; break;
        case 3: cellIndex = 6; break;
    }
    var tr, rows = Lbf._tbody.rows;
    for (var i = 0, l = rows.length; i < l; i++) {
        tr = rows[i];
        if (tr._data && tr._data.rqpk != undefined) {
            oo = tr.cells[cellIndex];
            if (ischild) { oo = oo.childNodes[0]; }
            oo.innerHTML = Lbf.formatPk(tr._data.rqpk, 'rq');
        }
    }
};
Lbf.isHalfVisible = function (d) {
    var s = d.status || 0, istrue = true;
    s < -1 || s === 0 || s === 1 && (istrue = false);
    return istrue;
};
Lbf.resetGoals = function () {
    if (Lsys.stop) { return; }
    var id = Lbf.getMinKey(Lbf._objGoals);
    if (!id) { return; }
    Lsys.endTimeout('resetGoals' + id);
    var tr = Lbf._hashtr[id];
    if (!tr) { return; }
    var d = tr._data, par = d.status || 0, tdHome = Lbf.matchTypeTd(tr, 3), tdB = Lbf.matchTypeTd(tr, 4), tdF = Lbf.matchTypeTd(tr, 6);
    var tdGuest = Lbf.matchTypeTd(tr, 7), tdHalf = Lbf.matchTypeTd(tr, 8);
    if (!tdHome) { return; }
    try {
        tdHome.className = "d-home";
        tdGuest.className = "d-away";
        if (par == 0) {
            tdB.innerHTML = tdF.innerHTML = ((Lsys.matchType == 1 || Lsys.matchType == 2) ? '' : '-');
        } else if (par != -1) {
            tdB.style.color = tdF.style.color = "blue";
        }
        var txt = Lbf.isHalfVisible(d) ? ("<span class='red'>" + (d.hs1 || 0) + "-" + (d.hs2 || 0) + "</span>") : '-';
        tdHalf.innerHTML = txt;
    } catch (ex) { }
};
Lbf.resetRedCard = function () {
    var key = Lbf.getMinKey(Lbf._objRedCard);
    if (!key) { return; }
    var arr = key.split(','), id = arr[1], tr = Lbf._hashtr[id];
    if (tr && tr[key]) { tr[key].className = ''; }
    Lsys.endTimeout('resetRedCard' + key);
};
Lbf.smatchstatus = function (n) {
    /*按比赛状态显示  n =1 进行中,=2已完场,=3 未开赛*/
    var k = 0, tr, tr2, status, isor = Lbf.isOtherInfo(), d, rows = Lbf._tbody.rows;
    for (var i = 0, l = rows.length; i < l; i++) {
        tr = rows[i];
        if (!tr.id) { continue; }
        tr2 = Lbf.trMore(tr);
        if (tr2) { i++; }
        d = tr._data;
        status = d.status || 0;
        if (n == 1 && status > 0 || n == 2 && status == -1 || n == 3 && status == 0) {
            tr.style.display = '';
            tr.hide = false;
            if (isor && tr2 && d._more) {
                tr2.style.display = "";
            }
        } else {
            tr.style.display = "none";
            if (tr2) { tr2.style.display = "none" }
            tr.hide = true;
            k++;
        }
    }
    Lbf.shidecount(k);
};
Lbf.hidematch = function () {
    var tr = Lsys.collskip ? this.parentNode : this.parentNode.parentNode;
    tr.style.display = 'none';
    tr.hide = true;
    var tr2 = Lbf.trMore(tr);
    if (tr2) { tr2.style.display = 'none'; }
    Lbf._hashhide[tr.id] = null;
    Lbf.shidecount(++Lbf._hidecount);
};
Lbf._movecount = -1;
Lbf._movearr = [];
Lbf.moveToBottom = function (arrid) {
    if (arrid) {
        Lbf._movearr = Lbf._movearr.concat(arrid);
        if (Lbf._movecount === -1) { Lbf._movecount = 0; setTimeout(function () { Lbf.moveToBottom(); }, 1000); }
    } else {
        if (Lbf._movecount < 10) {
            Lbf._movecount++;
            setTimeout(function () { Lbf.moveToBottom(); }, 1000);
        } else {
            Lbf._movecount = -1;
            var l = Lbf._movearr.length;
            if (l > 0) { Lbf.moveToBottomExec(Lbf._movearr); if (l === Lbf._movearr.length) { Lbf._movearr = []; } else { Lbf._movearr.splice(0, l); } }
        }
    }
};
Lbf.moveToBottomExec = function (arrid) {
    if (Lsys.stop || Lsys.matchType === 3) { return; }
    var d, i, tr, id, tr2, x, y, line = $('Collline'), tbody = Lbf._tbody, doc = document.createDocumentFragment(), doctop = document.createDocumentFragment();
    for (i = 0; id = arrid[i++]; ) {
        tr = Lbf._hashtr[id];
        if (!tr) { continue; }
        d = tr._data;
        if (d) { d.zdrqS = 0; d.zdhrqS = 0; d.zdbzS = 0; d.zdhbzS = 0; d.zddxS = 0; d.zdhdxS = 0; }
        tr._index = ++Lbf._maxline;
        tr2 = Lbf.trMore(tr);
        if (line && tr._colltop) {
            doctop.appendChild(tr);
            tr2 && (doctop.appendChild(tr2));
            x = true;
        } else {
            doc.appendChild(tr);
            tr2 && (doc.appendChild(tr2));
            y = true;
        }
    }
    x && (tbody.insertBefore(doctop, line.parentNode));
    y && (tbody.appendChild(doc));
    Lad.txtListBind();
};
Lbf.moveToBottomWait = function () {
    var ids = Lbf.getMinKey(Lbf._objMoveBottom);
    if (!ids) { return; }
    var arr = ids.split(',');
    Lsys.endTimeout('mtbw' + arr[0]);
    Lbf.moveToBottom(arr);
};
Lbf.filterTr = function (par, d, tr) {
    var dv;
    switch (par.type) {
        case 1: dv = tr._match[par.action]; break;
        default: dv = d[par.action]; break;
    }
    if (dv == undefined) { dv = par.dv; }
    return dv;
};
Lbf.unselbyxid = function (xid, par, skipcookie) {
    var arr = $(xid).getElementsByTagName("input"), k = 0, count = 0, ck, hash = {}, d, isot = Lbf.isOtherInfo();
    for (var i = 0, l = arr.length; i < l; i++) {
        ck = arr[i];
        if (ck.checked) { hash[par.action + ck.value] = 1; count++; }
        ck.checked = !ck.checked;
    }
    var tr, tr2, id, vi, rows = Lbf._tbody.rows, isall = count == arr.length;
    if (isall) { vi = ck.checked ? '' : 'none'; }
    Lbf._hashhide = {};
    for (var i = 0, l = rows.length; i < l; i++) {
        tr = rows[i];
        if (!tr.id) { continue; }
        tr2 = Lbf.trMore(tr);
        if (tr2) { i++; }
        d = tr._data;
        if (!isall) { vi = hash[par.action + Lbf.filterTr(par, d, tr)] ? 'none' : ''; }
        tr.style.display = vi;
        if (vi) {
            k++;
            Lbf._hashhide[tr.id] = null;
            if (tr2) { tr2.style.display = vi; }
            tr.hide = true;
        } else {
            if (isot && d._more) { if (tr2) { tr2.style.display = vi; } }
            tr.hide = false;
        }
    }
    Lbf.shidecount(k, skipcookie);
};
Lbf.unselbypk = function () { Lbf.unselbyxid("wdpkTable", { action: 'rqpk', type: 0, dv: 0 }); };
Lbf.unselbymatch = function () { Lbf.unselbyxid("wdlTable", { action: 'lsid', type: 0 }); };
Lbf.unSelByCountry = function () { Lbf.unselbyxid('wdcTable', { action: 'countryId', type: 1 }, true); };
Lbf.selectbyxid = function (ck, key, par) {
    var tr, tr2, isot = Lbf.isOtherInfo(), vi = ck.checked ? '' : 'none', k = Lbf._hidecount, rows = Lbf._tbody.rows, d, v;
    for (var i = 0, l = rows.length; i < l; i++) {
        tr = rows[i];
        if (!tr.id) { continue; }
        if (Lbf.trMore(tr)) { i++; }
        d = tr._data;
        if (Lbf.filterTr(par, d, tr) != key) { continue; }
        tr.style.display = vi;
        tr2 = Lbf.trMore(tr);
        if (vi) {
            k++;
            Lbf._hashhide[tr.id] = null;
            if (tr2) { tr2.style.display = vi; }
            tr.hide = true;
        } else {
            k--;
            delete Lbf._hashhide[tr.id];
            if (isot && d._more) { if (tr2) { tr2.style.display = vi; } }
            tr.hide = false;
        }
    }
    Lbf.shidecount(k);
};
Lbf.matchselect = function () { Lbf.selectbyxid(this, this.value, { action: 'lsid', type: 0 }); };
Lbf.pkselect = function () { Lbf.selectbyxid(this, this.value, { action: 'rqpk', type: 0, dv: 0 }); };
Lbf.countrySelect = function () { Lbf.selectbyxid(this, this.value, { action: 'countryId', type: 1 }); };
Lbf.showallmatch = function () {
    if (Lsys.stop) { return; }
    var arrck = ['wdlTable', 'wdpkTable', 'wdcTable'];
    for (var j = 0, l = arrck.length; j < l; j++) {
        var cks = $(arrck[j]);
        if (!cks) { continue; }
        cks = cks.getElementsByTagName("input");
        for (var i = 0, l2 = cks.length; i < l2; i++) { cks[i].checked = true; }
    }
    var isot = Lbf.isOtherInfo(), tr, tr2, rows = Lbf._tbody.rows;
    for (var i = 0, l = rows.length; i < l; i++) {
        tr = rows[i];
        if (!tr.id) { continue; }
        tr.style.display = '';
        tr.hide = false;
        tr2 = Lbf.trMore(tr);
        if (tr2) { i++; }
        if (!isot || !tr._data._more) { continue; }
        tr2 && (tr2.style.display = '');
    }
    Lbf._hashhide = {};
    Lbf.shidecount(0);
};
Lbf.setGunQiuOption = function (ck, type) {
    var v = ck.checked ? 1 : 0, tagName = '', xType = '';
    if (type == 'dx') {
        Lbf._gunqiuDx = v;
        tagName = 'h6';
        xType = 'bz';
    } else {
        type = 'bz';
        Lbf._gunqiuBz = v;
        tagName = 'h5';
        xType = 'dx';
    }
    if (Lbf._gunqiuDx || Lbf._gunqiuBz) { Lbf._gunqiuVisible = true; }
    Lbf.cookieNumberSet('gq_' + type, v);
    var disp = v ? '' : 'none', rows = Lbf._tbody.rows, tr, td, cells, d, tags, isCss = false, xValue = null;
    function hideTags() {
        tags = tr.getElementsByTagName(tagName);
        if (tags) {
            var sDisplay = disp;
            var isHide = false;
            if (v) {
                if (!Lbf.isHaveData(d, type)) {
                    sDisplay = 'none';
                    isHide = true;
                }
            } else { isHide = true; }
            d['hgq_' + type] = isHide;
            xValue = d['hgq_' + xType];
            for (var i = 0, l = tags.length; i < l; i++) { tags[i].style.display = sDisplay; }
            if (isHide && (xValue || xValue == undefined)) { Lsearch.cssDel(tr, 'tr-gunqiu'); } else { Lsearch.cssInsert(tr, 'tr-gunqiu'); }
            return l > 0;
        } else {
            return false;
        }
    }
    var isDx, isBz;
    for (var i = 0, l = rows.length; i < l; i++) {
        tr = rows[i];
        if (!tr.id) { continue; }
        d = tr._data;
        if (hideTags()) { continue; }
        isBz = tr.getElementsByTagName('h5').length == 0;
        isDx = tr.getElementsByTagName('h6').length == 0;
        cells = tr.cells;
        td = cells[7];
        if (isBz) { td.appendChild(Lbf.getGunQiuData(d, true, 'bz1')); }
        if (isDx) { td.appendChild(Lbf.getGunQiuData(d, true, 'dx1')); }
        td = cells[8];
        if (isBz) { td.appendChild(Lbf.getGunQiuData(d, true, 'bz3')); }
        if (isDx) { td.appendChild(Lbf.getGunQiuData(d, true, 'dx3')); }
        td = cells[9];
        if (isBz) { td.appendChild(Lbf.getGunQiuData(d, true, 'bz2')); }
        if (isDx) { td.appendChild(Lbf.getGunQiuData(d, true, 'dx2')); }
        hideTags();
    }
};
Lbf.loadLeagueList = function () {};
Lbf.ListFilter = function (arr, o, isopen, maxline) {
    var list = document.createElement('div'), templist = [], li, libold, selectLi, lastKey, liedit, aret = false, value = '', txt = '', resultInput = o, arrList = {}, _run = true, _isedit = false, _outhide, _outeditout;
    function lieditOutWait() { _isedit = false; }
    function lieditOut() { clearTimeout(_outeditout); _outeditout = setTimeout(lieditOutWait, 0); }
    function lieditOver() { clearTimeout(_outeditout); _isedit = true; selectLi.className = 'sel'; }
    function hideWait() { if (_isedit) { return; } _run && (list.style.visibility = 'hidden'); liedit && (liedit.style.visibility = 'hidden'); }
    function hide() { clearTimeout(_outhide); _outhide = setTimeout(hideWait, 500); }
    function visible() { clearTimeout(_outhide); list.style.visibility = 'visible'; }
    function setcss() {
        if (_isedit) { return; }
        selectLi && (selectLi.className = '');
        this.className = 'sel'; selectLi = this;
        if (liedit) {
            liedit.style.visibility = 'visible';
            Lposition.offset(this, this, liedit, false, this.clientWidth - liedit.clientWidth - 7, -this.clientHeight - 4);
        }
    }
    function cancelcss() { !_isedit && (this.className = ''); }
    function returnvalueByValue(obj) { if (!obj) { return; } obj._value && (resultInput.value = obj._value); hideWait(); }
    function returnvalue() { returnvalueByValue(this); }
    list.className = 'listFilter';
    list.onmouseout = hide;
    list.onmouseover = visible;
    document.body.insertBefore(list, document.body.childNodes[0]);
    function newdoc() { return document.createDocumentFragment(); }
    function init(arrPower) {
        list.innerHTML = '';
        var obj, doc = newdoc();
        for (var key in arrPower) {
            li = document.createElement('div');
            obj = arrPower[key];
            if (typeof obj == 'object') {
                txt = obj.value;
                li._id = obj.id;
            } else {
                txt = obj;
            }
            li.innerHTML = li._value = txt;
            li.onmouseover = setcss;
            li.onmouseout = cancelcss;
            li.onclick = returnvalue;
            li._isdata = true;
            doc.appendChild(li);
            arrList[txt.toString().toLowerCase()] = li;
        }
        list.appendChild(doc);
    }
    init(arr);
    function setheight() { if (maxline && list.childNodes.length > maxline) { list.style.height = maxline * 20 + 'px'; } else { list.style.height = 'auto'; } }
    function open(temp, oo, js) {
        oo && (resultInput = o = oo);
        Lposition.offset(o, o, list);
        list.style.width = o.clientWidth + 2 + 'px';
        var li, i = 0;
        if (templist.length > 0) {
            var doc = newdoc(), div;
            for (i = 0; div = templist[i++]; ) { doc.appendChild(div); }
            list.appendChild(doc);
        }
        libold && (libold.style.fontWeight = '');
        if (o.value) { libold = arrList[o.value.toString().toLowerCase()]; libold && (libold.style.fontWeight = 'bold'); }
        selectLi && (selectLi.className = 'sel');
        visible();
        setheight();
    }
    function filter(temp, oo) {
        oo && (o = oo);
        var v = o.value.toString().replace(/\s+/gi, '').toLowerCase();
        if (v == lastKey) { return; }
        lastKey = v;
        var li, doc = newdoc();
        var re = null;
        var re2 = '<b>$1</b>';
        if (v) {
            try {
                re = new RegExp('(' + v + ')', "gi");
            } catch (ex) {
                re = v;
                re2 = '<b>' + v + '</b>';
            }
        }
        if (selectLi) { selectLi.className = ''; selectLi = null; }
        list.innerHTML = '';
        for (var key in arrList) {
            if (key.indexOf(v) == -1) { continue; }
            li = arrList[key];
            li.innerHTML = re ? li._value.replace(re, re2) : li._value;
            doc.appendChild(li);
            !selectLi && (selectLi = li);
        }
        list.appendChild(doc);
        aret = false;
        selectLi && (selectLi.className = 'sel');
        visible();
        setheight();
    }
    function select(e) {
        if (!selectLi) { return; }
        !e && (e = window.event);
        var li;
        switch (e.keyCode) {
            case 38: case 37:
                if (!aret) { aret = true; return; }
                li = selectLi.previousSibling;
                while (li && li.style.display) { li = li.previousSibling; }
                break;
            case 40: case 39:
                if (!aret) { aret = true; return; }
                li = selectLi.nextSibling;
                while (li && li.style.display) { li = li.nextSibling; }
                break;
            case 13:
                if (!aret) { aret = true; return; }
                selectLi && (returnvalueByValue(selectLi));
                break;
            default:
                break;
        }
        if (!li || li == selectLi || !li._isdata) { return; }
        li.className = 'sel';
        selectLi.className = '';
        selectLi = li;
        setheight();
        visible();
    }
    function change() { var li = arrList[resultInput.value]; if (!li) { returnvalueByValue(null); } };
    function stop() { _run = false; };
    function run() { _run = true; };
    Lbase.event(o, 'onchange', change);
    Lbase.event(o, 'onclick', open);
    Lbase.event(o, 'onkeyup', filter);
    Lbase.event(o, 'onkeydown', select);
    Lbase.event(o, 'onmouseout', hideWait);
    isopen && (open());
}
Lbf.Collupdate = function () {
    if (!Lsys.userid) { return; }
    var ids = Lbf.Collcookie(), uri = Lpar.uriBbs + 'api.php?mod=sync&act=updatematches&uid=' + Lsys.userid + '&ids=' + ids;
    Lbase.createJsFile('scriptCollupdate', uri, false, false);
};
Lbf.Collcookie = function (o) {
    var h = [], id, key = 'Lcoll';
    if (o) {
        for (id in o) { h.push(id); }
        Lcookie.set(key, h.join(','), 1000);
        if (Lsys.userid) { Lsys.mymatch = h; }
    } else {
        if (Lsys.userid) { h = Lsys.mymatch; return h.join(','); }
        return Lcookie.get(key, '');
    }
};
Lbf.Colltiphide = function () { var tip = $('Colltip'); tip && (tip.style.visibility = 'hidden'); };
Lbf.Colltipinsert = function (txt, cap) {
    var tip = $('Colltip'); if (!tip) { return; }
    clearTimeout(tip._outid);
    tip.innerHTML = txt;
    tip.style.visibility = 'visible';
    tip._outid = setTimeout(Lbf.Colltiphide, cap || 2000);
};
Lbf.Collinsert = function (tr, skip) {
    var a, d = document, tbody = Lbf._tbody, rows = tbody.rows, line = $('Collline'), td, ftr, ftr = rows[0], cola = tr._colla, h = Lbf._collhash, ntr, i, index = tr._index, tr2 = Lbf.getMore(tr), doc = d.createDocumentFragment();
    line && (line = line.parentNode);
    function insert(t) { if (ftr) { tbody.insertBefore(t, ftr); } else { tbody.appendChild(t); } ftr = t; }
    tr._colltop = true;
    if (!line) {
        line = d.createElement('tr'); td = d.createElement('td'); td.id = 'Collline'; line.className = 'Collline'; td.colSpan = Lsys.colspan; td.innerHTML = '&nbsp;'; line.appendChild(td); insert(line);
    } else {
        if (line._hide) { line.style.display = ''; line._hide = false; }
    }
    if (!skip) {
        ftr = line;
        for (i = 0; ntr = rows[i++]; ) {
            if (!ntr.id) { continue; }
            if (!ntr._colltop) { break; }
            if (ntr._data.status == -1 || index < ntr._index) { ftr = ntr; break; }
        }
        doc.appendChild(tr);
        tr2 && (doc.appendChild(tr2));
        insert(doc);
    }
    h[tr.id] = tr;
    Lbf.Collcookie(h);
    a = cola[0];
    a.className = 'Coll_down';
    a.innerHTML = '<span class="Collstar"  title="取消关注">&nbsp;</span>-';
    a.title = '取消关注';
    a.onclick = Lbf.Collremovematch;
    a = cola[1];
    a.className = 'none';
    if (skip) { return; }
    Lad.txtListBind();
    Lbf.Collupdate();
};
Lbf.Colladdmatch = function () { Lbf.Collinsert(this.parentNode.parentNode); Lbf.Colltipinsert('添加了一场赛事关注'); };
Lbf.Collremove = function (tr, skip) {
    var a, cola = tr._colla, tbody = tr.parentNode, ntr, i, rows = Lbf._tbody.rows, index = tr._index, h = Lbf._collhash, x;
    tr._colltop = false;
    a = cola[0];
    a.className = 'Coll_up';
    a.innerHTML = '+';
    a.title = '添加关注';
    a.onclick = Lbf.Colladdmatch;
    a = cola[1];
    a.className = 'Coll_close';
    delete h[tr.id];
    Lbf.Collcookie(h);
    if (skip) { return; }
    var doc = document.createDocumentFragment(), tr2 = Lbf.getMore(tr), ishide = false;
    for (i = 0; ntr = rows[i++]; ) { if (ntr.id && !ntr._colltop && index < ntr._index) { break; } }
    doc.appendChild(tr);
    tr2 && (doc.appendChild(tr2));
    if (ntr) { tbody.insertBefore(doc, ntr); } else { tbody.appendChild(doc); }
    i = 0; for (i = 0; ntr = rows[i++]; ) { if (ntr.id) { ishide = !ntr._colltop; break; } }
    if (ishide) { var line = $('Collline'); if (line) { line = line.parentNode; line.style.display = 'none'; line._hide = true; } }
    Lad.txtListBind();
    Lbf.Collupdate();
};
Lbf.Collremovematch = function () { Lbf.Collremove(this.parentNode.parentNode); Lbf.Colltipinsert('取消了一场赛事关注'); };
Lbf.Collclear = function (ismem) {
    var coltxt = $('Colltext'), tbody = Lbf._tbody, rows = tbody.rows, h = Lbf._collhash, id, tr, trm, trminsert, htr = Lbf._hashtr, remove = Lbf.Collremove, count = 0, skip, doc = document.createDocumentFragment(), xtr = [], i, tr2, trmore = Lbf.getMore, ishave, nh = {};
    if (!h || !coltxt) { return; }
    Lbf.Colltipinsert('正在取消，请稍候...');
    for (id in h) { htr[id] && (count++); }
    skip = count > 1;
    for (id in h) {
        tr = htr[id]; if (!tr) { nh[id] = null; continue; }
        remove(tr, skip); ishave = true;
    }
    !ismem && (Lbf.Collcookie(Lbf._collhash = nh));
    if (skip && ishave) {
        for (i = 0; tr = rows[i++]; ) {
            if (tr.id) { xtr.push(tr); } else if (!trm && tr._moreList) { trm = tr; }
        }
        xtr.sort(Lbf.sort_index);
        for (i = 0; tr = xtr[i++]; ) { if (!tr._colltop && tr._data.status <0) { trminsert = tr; break; } }
        for (i = 0; tr = xtr[i++]; ) {
            tr2 = trmore(tr);
            doc.appendChild(tr);
            tr2 && (doc.appendChild(tr2));
        }
        if (trm) {
            if (trminsert) { doc.insertBefore(trm, trminsert); trm.style.display = ''; } else { doc.appendChild(trm);}
        }
        tbody.appendChild(doc);
        Lad.txtListBind();
    }
    var line = $('Collline'); line && (line = line.parentNode);
    if (line) { line.style.display = 'none'; line._hide = true; }
    Lbf.Colltipinsert('取消了所有当前赛事关注');
    !ismem && (Lbf.Collupdate());
    coltxt.value = '';
};
Lbf.Colladd = function (z1, h, skip) {
    var itxt = $('Colltext'); if (!itxt) { return; } if (!h && (itxt.value == itxt.title || !itxt.value)) { Lbf.Colltipinsert('请输入球队名或赛事名称'); itxt.focus(); return; }
    var tbody = Lbf._tbody, rows = tbody.rows, i, tr, td, colls, h2 = [], doc = document.createDocumentFragment(), mt = Lbf.matchTypeTd, ntr, ie = document.all, okey = key = itxt.value.toString().toLowerCase(), arrkey = [], i, j, l, k, count = 0, insert = Lbf.Collinsert, tr2, trmore = Lbf.getMore, htr = Lbf._hashtr;
    Lbf.Colltipinsert('正在搜索，请稍候...');
    arrkey = key.split('|');
    if (key.indexOf(' ') != -1) { arrkey = key.split(/\s+/gi); }
    if (key.indexOf('、') != -1) { arrkey = key.split('、'); }
    if (key.indexOf('，') != -1) { arrkey = key.split('，'); }
    if (key.indexOf(',') != -1) { arrkey = key.split(','); }
    k = arrkey.length;
    function exists(v) { if (v.toString().toLowerCase().indexOf(key) != -1) { h.push(tr); count++; return true; } else { return false; } }
    if (h) {
        var nh = [];
        for (var i = 0, l = h.length; i < l; i++) {
            id = h[i]; if (!id) { continue; }
            tr = htr[id]; if (!tr) { continue; }
            nh.push(tr); count++;
        }
        h = nh;
        if (h.length < 1) { return; }
    } else {
        h = [];
        for (i = 0; tr = rows[i++]; ) {
            if (!tr.id || tr.hide || tr._colltop) { continue; }
            for (j = 0; j < k; j++) {
                key = arrkey[j]; if (!key) { continue; }
                if (exists(tr._match['name'])) { break; }
                if (exists(tr._data['t1'])) { break; }
                if (exists(tr._data['t2'])) { break; }
            }
        }
    }
    if (count > 1) {
        for (i = 0; tr = h[i++]; ) { insert(tr, true); }
        h = [], h2 = [];
        for (i = 0; tr = rows[i++]; ) { h.push(tr); }
        for (i = 0; tr = h[i++]; ) {
            if (!tr.id) { continue; }
            if (!tr._colltop) { continue; }
            h2.push(tr);
        }
        h2.sort(Lbf.sort_index);
        for (i = 0; tr = h2[i++]; ) {
            tr2 = trmore(tr);
            doc.appendChild(tr);
            tr2 && (doc.appendChild(tr2));
        }
        tbody.insertBefore(doc, rows[0]);
        Lad.txtListBind();
        !skip && (Lbf.Collupdate());
    } else if (count > 0) {
        insert(h[0], false);
    }
    Lbf.Colltipinsert(count ? '共有' + count + '场赛事添加关注。' : '没有与 <b>' + okey + '</b> 相关的赛事，或已添加关注', 6000);
};
Lbf.Collclick = function (o, isopen) {
    o.value == o.title && (o.value = '');
    if (Lsys.stop) { return; }
    var tbody = Lbf._tbody, rows = tbody.rows, i, tr, td, mt = Lbf.matchTypeTd, ie = document.all, d = [], obj = {}, key;
    function gtd(v) { obj[v.toString().replace(/\s+/gi, '').toLowerCase()] = 1; }
    for (i = 0; tr = rows[i++]; ) { if (tr.id) { gtd(tr._match['name']); gtd(tr._data['t1']); gtd(tr._data['t2']); } }
    for (key in obj) { d.push(key); }
    o.onclick = null;
    d.sort();
    Lbf.ListFilter(d, o, isopen, 15);
};
Lbf.Collkeydown = function (o, evt) {
    evt = evt ? evt : (window.event ? window.event : null);
    if (evt.keyCode != 13) { return; }
    setTimeout(Lbf.Colladd, 0);
};
Lbf.trid = function (o) { while (o.parentNode && o.nodeName != 'TR') { o = o.parentNode; } return o.id; };
Lbf.adFixed = function () { Lsys.newTimeout('outAdFixed', setTimeout(Lbf.adFixedScroll, 100)); };
Lbf.adFixedScroll = function () {
    if (!Lad._haveLoad) { return; }
    var ad = Lbf._wAdFixed;
    if (!ad) {
        ad = Lbf._wAdFixed = {};
        ad.top = $('wAdFixed');
        ad.bottom = $('wAdFlyBottomBox');
        ad.flyRight = $('wAdFlyRight');
        ad.bottom._h = 380 + 10;
    }
    var top = document.body.scrollTop, mtop = ad.top._yy;
    !mtop && (ad.top._yy = mtop = Lposition.offset(ad.top).y);
    if (!document.all) {
        var css = (top > mtop) ? 'adFixed2' : 'adFixed';
        if (ad.top.className != css) { ad.top.className = css; }
        return;
    }
    var y = top > mtop ? top : mtop, w = document.body.clientWidth;
    if (y != ad.top._y) { ad.top.style.top = y + 'px'; ad.top._y = y; }
    y = top + document.body.clientHeight - ad.bottom._h;
    if (y != ad.bottom._y) { ad.bottom.style.top = y + 'px'; ad.bottom._y = y; }
    if (Lnet._run && Lnet._netTest) { Lnet._netTest.style.top = (top + 150) + 'px'; }
    if (w != ad.flyRight._w) { ad.flyRight.style.left = (w - ad.flyRight.clientWidth - 1) + 'px'; ad.flyRight._w = w; }
};
Lbf.autoheight = function (h) {
    alert(h);
};
/*tt browser*/
var _countJs = 0,_countFlash = 0;
function checkpageonline() {
    var k = ++_countFlash - _countJs;
    if (k > 1) {
        Lbf.updatetime();
        Lbf.loadDetail();
        Lbf.loadBf();
        Lbf.loadPlDs();
    }
}
