function showHtml(obj, html) {
obj.innerHTML = html;
}
var sbOddsChangeHttp = zXmlHttp.createRequest();
var ch_goalName = "";
//------------>>websocket
var temp_txt = "";
function WsBegin(isReconnect) {
try {
ch_goalName = "ch_goal" + Config.companyID + "_xml";
var options = { channels: ["change_xml", ch_goalName] };
return wsHelper.connectWs(options, isReconnect);
}
catch (e) {
console.log(e);
return false;
}
}
function ReceiveMsg(event) {
var data = event.detail.data;
if (data instanceof Blob) {
var reader = new FileReader();
reader.readAsArrayBuffer(data, "utf-8");
reader.onload = function () {
var str = pako.inflate(reader.result, {
to: "string"
})
if (str != temp_txt) {
temp_txt = str;
var jsonObj = JSON.parse(str);
/* console.log(jsonObj);*/
if (!!jsonObj.change_xml) {
var bfarr = jsonObj.change_xml.split('!');
refreshChange(bfarr)
}
if (ch_goalName in jsonObj) {
var oddsarr = jsonObj[ch_goalName].split('!');
showodds2(oddsarr, 0, true);
}
}
}
}
else {
console.log(data);
}
}
function SocketClose(event) {
//如果重连超过一定次数或者不是正常的,改用轮询
if (window.wsHelper.options.reConnect >= window.wsHelper.options.maxReconNum || !window.wsHelper.options.normal) {
window.clearTimeout(getoddsxmlTimer);
getoddsxmlTimer = window.setTimeout("getoddsxml()", 3000);
window.clearTimeout(loadbfChange);
loadbfChange = window.setTimeout("gettime()", 2000);
window.clearTimeout(loadCheck);
loadCheck = window.setTimeout("check()", 30000);
}
}
function WsRun() {
window.removeEventListener('ws-message', ReceiveMsg);
window.addEventListener('ws-message', ReceiveMsg);
window.removeEventListener('ws-close', SocketClose);
window.addEventListener('ws-close', SocketClose);
}
//----------------<<
//----------->>sb滚球
function getsbxml() {
try {
if (get_ifShow_odds()) {
if (Config.companyID == "3")
sbOddsChangeHttp.open("get", "data/ch_sbOdds.xml?" + Date.parse(new Date()), true);
else
sbOddsChangeHttp.open("get", "data/ch_runOdds_" + Config.companyID + ".xml?" + Date.parse(new Date()), true);
sbOddsChangeHttp.onreadystatechange = sboddsrefresh;
sbOddsChangeHttp.send(null);
}
} catch (e) { }
window.setTimeout("getsbxml()", 5000);
}
function sboddsrefresh() {
if (sbOddsChangeHttp.readyState != 4 || (sbOddsChangeHttp.status != 200 && sbOddsChangeHttp.status != 0)) return;
if (oldXML == sbOddsChangeHttp.responseText) return
oldXML = sbOddsChangeHttp.responseText;
var arr, matchState = 0;
var goal, home, away;
//亚指
if (sbOddsChangeHttp.responseText == null || sbOddsChangeHttp.responseText == "") return;
if (!get_ifShow_odds()) return;
obj = document.getElementById("ffOddsDetail"); //全场走势表格
var old = obj.attributes["odds"].value.split(","); //matchid,state,goal,home,away,standard,homewin,guestwin,totalscore,home,away
var tr1 = obj.rows[1];
matchState = parseInt(old[1]);
var root = sbOddsChangeHttp.responseXML.documentElement.childNodes[0]; //让球
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,goal,home,away,state
if (parseInt(old[0]) == parseInt(arr[0])) {
if (matchState == 0 && parseInt(arr[4]) > 0) return;
if (old[2] == arr[1] && old[3] == arr[2] && old[4] == arr[3]) break;
goal = arr[1];
home = arr[2];
away = arr[3];
for (var j = 2; j <= 3; j++) {
if (old[j + 1] != "")
arr[j] = getChangeStrDiv(arr[j], old[j + 1]);
}
tr1.cells[1].innerHTML = arr[2];
tr1.cells[2].innerHTML = Goal2GoalCn(arr[1]);
tr1.cells[3].innerHTML = arr[3];
old[2] = goal;
old[3] = home;
old[4] = away;
old[0] = arr[0];
break;
}
}
root = sbOddsChangeHttp.responseXML.documentElement.childNodes[1]; //欧指
var tr2 = obj.rows[2];
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,homewin,standard,guestwin
if (parseInt(old[0]) == parseInt(arr[0])) {// && matchState == 0
if (old[6] == arr[1] && old[5] == arr[2] && old[7] == arr[3]) break;
goal = arr[2];
home = arr[1];
away = arr[3];
if (old[6] != "")
arr[1] = getChangeStrDiv(arr[1], old[6]);
if (old[7] != "")
arr[3] = getChangeStrDiv(arr[3], old[7]);
tr2.cells[1].innerHTML = arr[1];
tr2.cells[2].innerHTML = arr[2];
tr2.cells[3].innerHTML = arr[3];
old[5] = goal;
old[6] = home;
old[7] = away;
old[0] = arr[0];
break;
}
}
root = sbOddsChangeHttp.responseXML.documentElement.childNodes[2]; //大小
var tr3 = obj.rows[3];
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,totalscore,home,away
if (parseInt(old[0]) == parseInt(arr[0])) {
if (old[8] == arr[1] && old[9] == arr[2] && old[10] == arr[3]) break;
goal = arr[1];
home = arr[2];
away = arr[3];
if (old[9] != "")
arr[2] = getChangeStrDiv(arr[2], old[9]);
if (old[10] != "")
arr[3] = getChangeStrDiv(arr[3], old[10]);
tr3.cells[1].innerHTML = arr[2];
tr3.cells[2].innerHTML = Goal2GoalCn2(arr[1]);
tr3.cells[3].innerHTML = arr[3];
old[8] = goal;
old[9] = home;
old[10] = away;
old[0] = arr[0];
break;
}
}
var obj2 = document.getElementById("fhOddsDetail"); //半场走势表格
var oldHalf = obj2.attributes["odds"].value.split(","); //matchid,goal,home,away,totalscore,home,away,homewin,standoff,guestwin
var tr4 = obj2.rows[1];
root = sbOddsChangeHttp.responseXML.documentElement.childNodes[3]; //半场让球
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,goal,home,away
if (parseInt(old[0]) == parseInt(arr[0])) {
if (oldHalf[1] == arr[1] && oldHalf[2] == arr[2] && oldHalf[3] == arr[3]) break;
home = arr[2];
goal = arr[1];
away = arr[3];
if (oldHalf[2] != "")
arr[2] = getChangeStrDiv(arr[2], oldHalf[2]);
if (oldHalf[3] != "")
arr[3] = getChangeStrDiv(arr[3], oldHalf[3]);
tr4.cells[1].innerHTML = arr[2];
tr4.cells[2].innerHTML = Goal2GoalCn(arr[1]);
tr4.cells[3].innerHTML = arr[3];
oldHalf[2] = home;
oldHalf[1] = goal;
oldHalf[3] = away;
old[0] = arr[0];
break;
}
}
root = sbOddsChangeHttp.responseXML.documentElement.childNodes[4]; //半场大小
var tr5 = obj2.rows[3];
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,totalscore,home,away
if (parseInt(old[0]) == parseInt(arr[0])) {
if (oldHalf[4] == arr[1] && oldHalf[5] == arr[2] && oldHalf[6] == arr[3]) break;
home = arr[2];
goal = arr[1];
away = arr[3];
if (oldHalf[5] != "")
arr[2] = getChangeStrDiv(arr[2], oldHalf[5]);
if (oldHalf[6] != "")
arr[3] = getChangeStrDiv(arr[3], oldHalf[6]);
tr5.cells[1].innerHTML = arr[2];
tr5.cells[2].innerHTML = Goal2GoalCn2(arr[1]);
tr5.cells[3].innerHTML = arr[3];
oldHalf[5] = home;
oldHalf[4] = goal;
oldHalf[6] = away;
old[0] = arr[0];
break;
}
}
root = sbOddsChangeHttp.responseXML.documentElement.childNodes[5]; //半场欧指
var tr6 = obj2.rows[2];
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,totalscore,home,away
if (parseInt(old[0]) == parseInt(arr[0])) {
if (oldHalf[7] == arr[1] && oldHalf[8] == arr[2] && oldHalf[9] == arr[3]) break;
home = arr[2];
goal = arr[1];
away = arr[3];
if (oldHalf[7] != "")
arr[2] = getChangeStrDiv(arr[2], oldHalf[7]);
if (oldHalf[8] != "")
arr[3] = getChangeStrDiv(arr[3], oldHalf[8]);
tr6.cells[1].innerHTML = arr[2];
tr6.cells[2].innerHTML = arr[1];
tr6.cells[3].innerHTML = arr[3];
oldHalf[8] = home;
oldHalf[7] = goal;
oldHalf[9] = away;
old[0] = arr[0];
break;
}
}
}
function restoreSbOddsColor() {
if (!get_ifShow_odds()) return;
obj = document.getElementById("ffOddsDetail");
for (var i = 1; i < obj.rows.length - 1; i++) {
tr.cells[1].innerHTML = tr.cells[1].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
tr.cells[2].innerHTML = tr.cells[2].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
tr.cells[3].innerHTML = tr.cells[3].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
}
obj = document.getElementById("fhOddsDetail");
for (var i = 1; i < obj.rows.length - 1; i++) {
tr.cells[1].innerHTML = tr.cells[1].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
tr.cells[2].innerHTML = tr.cells[2].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
tr.cells[3].innerHTML = tr.cells[3].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
}
}
function get_ifShow_odds() {
return $("#sbOddsDetail").is(':visible') && !!document.getElementById("ffScoreDetail"); //判断是否有显示SB详情走势浮动窗口
}
function loadSbOddsCallback(obj, event) {
if (Config.showSbOddsDetail == 0) return;
var i = obj.attributes["aLoc"].value;
if (get_ifShow_odds()) return;
var scheduleId = A[i][0];
if (typeof (sData[scheduleId]) == "undefined")
return;
var cid = Config.companyID;
var width = 515;
var hasRunning = true;
var homeTeam = A[i][4 + Config.language];
var guestTeam = A[i][7 + Config.language];
var sclassArr = B[A[i][1]];
var sclassName = sclassArr[1 + Config.language];
if (sclassArr[7] !== "") {
sclassName = "" + sclassName + " ";
}
var hOrder = A[i][20];
var gOrder = A[i][21];
var strScore = "VS";
var matchState = parseInt(A[i][12]);
if (matchState > 0 || matchState == -1) {
if (matchState == -1)
strScore = "" + A[i][13] + " - " + A[i][14] + " ";
else
strScore = "" + A[i][13] + " - " + A[i][14] + " ";
}
var html = new Array();
var strGoals;
var arrOdds = sData[scheduleId];
if (typeof (arrOdds[0][6]) == "undefined" || arrOdds[0][6] == "" || matchState==-1) {
width = 406;
hasRunning = false;
}
// html.push('');
html.push('
');
html.push('');
html.push('' + sclassName + ' ');
html.push('' + (hOrder != "" ? '[' + hOrder + ' ] ' : '') + '' + homeTeam + ' ');
html.push('' + strScore + ' ');
html.push('' + guestTeam + ' ' + (gOrder != "" ? '[' + gOrder + ' ] ' : '') + ' ');
html.push(' ');
html.push('
');
strGoals = scheduleId + "," + matchState + ",";
if (matchState > 0 || matchState == -1)//让,标准,大
strGoals += (typeof (arrOdds[0][7]) == "undefined" ? '' : arrOdds[0][7]) + "," + (typeof (arrOdds[0][6]) == "undefined" ? '' : arrOdds[0][6]) + "," + (typeof (arrOdds[0][8]) == "undefined" ? '' : arrOdds[0][8]) + "," + (typeof (arrOdds[1][7]) == "undefined" ? '' : arrOdds[1][7]) + "," + (typeof (arrOdds[1][6]) == "undefined" ? '' : arrOdds[1][6]) + "," + (typeof (arrOdds[1][8]) == "undefined" ? '' : arrOdds[1][8]) + "," + (typeof (arrOdds[2][7]) == "undefined" ? '' : arrOdds[2][7]) + "," + (typeof (arrOdds[2][6]) == "undefined" ? '' : arrOdds[2][6]) + "," + (typeof (arrOdds[2][8]) == "undefined" ? '' : arrOdds[2][8]);
else
strGoals += (typeof (arrOdds[0][4]) == "undefined" ? '' : arrOdds[0][4]) + "," + (typeof (arrOdds[0][3]) == "undefined" ? '' : arrOdds[0][3]) + "," + (typeof (arrOdds[0][5]) == "undefined" ? '' : arrOdds[0][5]) + "," + (typeof (arrOdds[1][4]) == "undefined" ? '' : arrOdds[1][4]) + "," + (typeof (arrOdds[1][3]) == "undefined" ? '' : arrOdds[1][3]) + "," + (typeof (arrOdds[1][5]) == "undefined" ? '' : arrOdds[1][5]) + "," + (typeof (arrOdds[2][4]) == "undefined" ? '' : arrOdds[2][4]) + "," + (typeof (arrOdds[2][3]) == "undefined" ? '' : arrOdds[2][3]) + "," + (typeof (arrOdds[2][5]) == "undefined" ? '' : arrOdds[2][5]);
html.push('
');
html.push('');
html.push(' ');
if (hasRunning)
html.push('现(全场) ');
html.push('即(全场) ');
html.push('初(全场) ');
html.push(' ');
html.push('');
html.push('亚 走势 ');
if (hasRunning) {
html.push('' + changeData(arrOdds[0][6]) + ' ');
html.push('' + Goal2GoalCn(arrOdds[0][7]) + ' ');
html.push('' + changeData(arrOdds[0][8]) + ' ');
}
html.push('' + getStrDiv(arrOdds[0][3], arrOdds[0][0]) + ' ');
html.push('' + getStrDiv2(arrOdds[0][4], arrOdds[0][1], 1) + ' ');
html.push('' + getStrDiv(arrOdds[0][5], arrOdds[0][2]) + ' ');
html.push('' + (typeof (arrOdds[0][0]) == "undefined" ? ' ' : changeData(arrOdds[0][0])) + ' ');
html.push('' + Goal2GoalCn(arrOdds[0][1]) + ' ');
html.push('' + (typeof (arrOdds[0][2]) == "undefined" ? ' ' : changeData(arrOdds[0][2])) + ' ');
html.push(' ');
html.push('');
html.push('欧 走势 ');
if (hasRunning) {
html.push('' + (typeof (arrOdds[1][6]) == "undefined" ? ' ' : changeData(arrOdds[1][6])) + ' ');
html.push('' + (typeof (arrOdds[1][7]) == "undefined" ? ' ' : changeData(arrOdds[1][7])) + ' ');
html.push('' + (typeof (arrOdds[1][8]) == "undefined" ? ' ' : changeData(arrOdds[1][8])) + ' ');
}
html.push('' + getStrDiv(arrOdds[1][3], arrOdds[1][0]) + ' ');
html.push('' + (typeof (arrOdds[1][4]) == "undefined" ? ' ' : getStrDiv(arrOdds[1][4], arrOdds[1][1])) + ' ');
html.push('' + getStrDiv(arrOdds[1][5], arrOdds[1][2]) + ' ');
html.push('' + (typeof (arrOdds[1][0]) == "undefined" ? ' ' : changeData(arrOdds[1][0])) + ' ');
html.push('' + (typeof (arrOdds[1][1]) == "undefined" ? ' ' : changeData(arrOdds[1][1])) + ' ');
html.push('' + (typeof (arrOdds[1][2]) == "undefined" ? ' ' : changeData(arrOdds[1][2])) + ' ');
html.push(' ');
html.push('');
html.push('大 走势 ');
if (hasRunning) {
html.push('' + (typeof (arrOdds[2][6]) == "undefined" ? ' ' : changeData(arrOdds[2][6])) + ' ');
html.push('' + (typeof (arrOdds[2][7]) == "undefined" ? ' ' : Goal2GoalCn2(arrOdds[2][7])) + ' ');
html.push('' + (typeof (arrOdds[2][8]) == "undefined" ? ' ' : changeData(arrOdds[2][8])) + ' ');
}
html.push('' + getStrDiv(arrOdds[2][3], arrOdds[2][0]) + ' ');
html.push('' + (typeof (arrOdds[2][4]) == "undefined" ? ' ' : getStrDiv2(arrOdds[2][4], arrOdds[2][1], 2)) + ' ');
html.push('' + getStrDiv(arrOdds[2][5], arrOdds[2][2]) + ' ');
html.push('' + (typeof (arrOdds[2][0]) == "undefined" ? ' ' : changeData(arrOdds[2][0])) + ' ');
html.push('' + (typeof (arrOdds[2][1]) == "undefined" ? ' ' : Goal2GoalCn2(arrOdds[2][1])) + ' ');
html.push('' + (typeof (arrOdds[2][2]) == "undefined" ? ' ' : changeData(arrOdds[2][2])) + ' ');
html.push(' ');
html.push('
');
if (matchState > 0 || matchState == -1)//让,大,标准
strGoals = (typeof (arrOdds[3][7]) == "undefined" ? '' : arrOdds[3][7]) + "," + (typeof (arrOdds[3][6]) == "undefined" ? '' : arrOdds[3][6]) + "," + (typeof (arrOdds[3][8]) == "undefined" ? '' : arrOdds[3][8]) + "," + (typeof (arrOdds[4][7]) == "undefined" ? '' : arrOdds[4][7]) + "," + (typeof (arrOdds[4][6]) == "undefined" ? '' : arrOdds[4][6]) + "," + (typeof (arrOdds[4][8]) == "undefined" ? '' : arrOdds[4][8]) + "," + (typeof (arrOdds[5][7]) == "undefined" ? '' : arrOdds[5][7]) + "," + (typeof (arrOdds[5][6]) == "undefined" ? '' : arrOdds[5][6]) + "," + (typeof (arrOdds[5][8]) == "undefined" ? '' : arrOdds[5][8]);
else
strGoals = (typeof (arrOdds[3][4]) == "undefined" ? '' : arrOdds[3][4]) + "," + (typeof (arrOdds[3][3]) == "undefined" ? '' : arrOdds[3][3]) + "," + (typeof (arrOdds[3][5]) == "undefined" ? '' : arrOdds[3][5]) + "," + (typeof (arrOdds[4][4]) == "undefined" ? '' : arrOdds[4][4]) + "," + (typeof (arrOdds[4][3]) == "undefined" ? '' : arrOdds[4][3]) + "," + (typeof (arrOdds[4][5]) == "undefined" ? '' : arrOdds[4][5]) + "," + (typeof (arrOdds[5][4]) == "undefined" ? '' : arrOdds[5][4]) + "," + (typeof (arrOdds[5][3]) == "undefined" ? '' : arrOdds[5][3]) + "," + (typeof (arrOdds[5][5]) == "undefined" ? '' : arrOdds[5][5]);
html.push('
');
html.push('');
html.push('');
if (typeof (getSbAd1) === "function")
html.push(getSbAd1((hasRunning ? "515px" : "406px")));
html.push(' ');
html.push('
');
html.push('
');
html.push(' ');
html.push(' ');
if (hasRunning)
html.push('现(上半场) ');
html.push('即(上半场) ');
html.push('初(上半场) ');
html.push(' ');
html.push('');
var noData = typeof (arrOdds[3][0]) === "undefined";
html.push('亚' + (noData ? '' : '走势 ') + ' ');
if (hasRunning) {
typeof (arrOdds[3][6]) === "undefined";
html.push('' + (noData ? ' ' : changeData(arrOdds[3][6])) + ' ');
html.push('' + Goal2GoalCn(arrOdds[3][7]) + ' ');
html.push('' + (noData ? ' ' : changeData(arrOdds[3][8])) + ' ');
}
html.push('' + getStrDiv(arrOdds[3][3], arrOdds[3][0]) + ' ');
html.push('' + getStrDiv2(arrOdds[3][4], arrOdds[3][1], 1) + ' ');
html.push('' + getStrDiv(arrOdds[3][5], arrOdds[3][2]) + ' ');
html.push('' + (typeof (arrOdds[3][0]) == "undefined" || typeof (arrOdds[3][4]) == "undefined" ? ' ' : changeData(arrOdds[3][0])) + ' ');
html.push('' + (typeof (arrOdds[3][1]) == "undefined" || typeof (arrOdds[3][4]) == "undefined" ? ' ' : Goal2GoalCn(arrOdds[3][1])) + ' ');
html.push('' + (typeof (arrOdds[3][2]) == "undefined" || typeof (arrOdds[3][4]) == "undefined" ? ' ' : changeData(arrOdds[3][2])) + ' ');
html.push(' ');
html.push(' ');
noData = typeof (arrOdds[5][0]) === "undefined";
html.push('欧' + (noData ? '' : '走势 ') + ' ');
if (hasRunning) {
typeof (arrOdds[5][6]) === "undefined";
html.push('' + (noData ? ' ' : changeData(arrOdds[5][6])) + ' ');
html.push('' + (noData ? ' ' : changeData(arrOdds[5][7])) + ' ');
html.push('' + (noData ? ' ' : changeData(arrOdds[5][8])) + ' ');
}
html.push('' + getStrDiv(arrOdds[5][3], arrOdds[5][0]) + ' ');
html.push('' + (typeof (arrOdds[5][4]) == "undefined" ? ' ' : getStrDiv(arrOdds[5][4], arrOdds[5][1])) + ' ');
html.push('' + getStrDiv(arrOdds[5][5], arrOdds[5][2]) + ' ');
html.push('' + (typeof (arrOdds[5][0]) == "undefined" || typeof (arrOdds[5][4]) == "undefined" ? ' ' : changeData(arrOdds[5][0])) + ' ');
html.push('' + (typeof (arrOdds[5][1]) == "undefined" || typeof (arrOdds[5][4]) == "undefined" ? ' ' : changeData(arrOdds[5][1])) + ' ');
html.push('' + (typeof (arrOdds[5][2]) == "undefined" || typeof (arrOdds[5][4]) == "undefined" ? ' ' : changeData(arrOdds[5][2])) + ' ');
html.push(' ');
html.push('');
noData = typeof (arrOdds[4][0]) === "undefined";
html.push('大' + (noData ? '' : '走势 ') + ' ');
if (hasRunning) {
typeof (arrOdds[4][6]) === "undefined";
html.push('' + (noData ? ' ' : changeData(arrOdds[4][6])) + ' ');
html.push('' + (noData ? ' ' : Goal2GoalCn2(arrOdds[4][7])) + ' ');
html.push('' + (noData ? ' ' : changeData(arrOdds[4][8])) + ' ');
}
html.push('' + getStrDiv(arrOdds[4][3], arrOdds[4][0]) + ' ');
html.push('' + (typeof (arrOdds[4][4]) == "undefined" ? ' ' : getStrDiv2(arrOdds[4][4], arrOdds[4][1], 2)) + ' ');
html.push('' + getStrDiv(arrOdds[4][5], arrOdds[4][2]) + ' ');
html.push('' + (typeof (arrOdds[4][0]) == "undefined" || typeof (arrOdds[4][4]) == "undefined" ? ' ' : changeData(arrOdds[4][0])) + ' ');
html.push('' + (typeof (arrOdds[4][1]) == "undefined" || typeof (arrOdds[4][4]) == "undefined" ? ' ' : Goal2GoalCn2(arrOdds[4][1])) + ' ');
html.push('' + (typeof (arrOdds[4][2]) == "undefined" || typeof (arrOdds[4][4]) == "undefined" ? ' ' : changeData(arrOdds[4][2])) + ' ');
html.push(' ');
html.push('
');
// html.push("
");
var obj = document.getElementById('sbOddsDetail');
var pos = getElementPos("sound");
if (hasRunning)
obj.style.left = (document.body.clientWidth / 2 - 270) + "px";
else
obj.style.left = (document.body.clientWidth / 2 - 160) + "px";
// }
var scrollTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
if (scrollTop == 0) {
if (event.clientY - pos.y < 247)
obj.style.top = (scrollTop + event.clientY) + "px";
else
obj.style.top = (event.clientY - 230) + "px";
}
else {
if (event.clientY < obj.clientHeight)
obj.style.top = (scrollTop + event.clientY) + "px";
else
obj.style.top = (scrollTop + event.clientY - 230) + "px";
}
//-230
obj.innerHTML = html.join("");
$(obj).show();
}
function showOddsDetail(obj, event) {
if (Math.floor((new Date() - loadSbDetailTime) / 600) > 60) {
LoadSbDetailFile(function () {
loadSbOddsCallback(obj, event)
});
}
else {
loadSbOddsCallback(obj, event)
}
}
function getChangeStrDiv(odds1, odds2) {
var retVal;
if (typeof (odds1) == "undefined" || odds1 == "")
return "";
if (parseFloat(odds1) > parseFloat(odds2))
retVal = '' + odds1 + '
';
else if (parseFloat(odds1) < parseFloat(odds2))
retVal = '' + odds1 + '
';
else
retVal = odds1;
return retVal;
}
function hiddenSbDetail() {
$('#sbOddsDetail').hide();
}
function hiddendetail() {
$('#winScore').hide();
}
//------------<<
//------------->>角球
$(function () {
$(".livetab").mouseenter(function (e) {
var tObj = $(this);
if (tObj.attr("id") == "sbOddsCorner")
cornerObj.show();
else tObj.show();
}).mouseleave(function () {
var tObj = $(this);
if (tObj.attr("id") == "sbOddsCorner")
cornerObj.hidden();
else tObj.hide();
});
});
var cornerObj = new CornerType();
var sCornerData = new Object();
function showCorner(obj, event) {
if (Config.ifShowCorn == 1)
cornerObj.showData(obj, event);
}
function hiddenCorner() {
cornerObj.hidden();
}
window.setTimeout(function () { cornerObj.load(); }, 1000);
function CornerType() {
var layerID = "sbOddsCorner";
var layerNode = document.getElementById(layerID);
var dataNode = document.createElement("div");
document.body.appendChild(dataNode);
var loadSbCornerTime = new Date();
var ifShowCorner = false;
var oldCorner = "";
var showCornerCont = 0;
this.load = function (func) {
loadSbCornerTime = new Date();
$.ajax({
url: "data/sbCorner.js?r=007" + Date.parse(loadSbCornerTime),
type: 'Get',
datatype: 'script',
success: function () {
if (typeof (func) == "function")
func();
}
});
}
this.hidden = function () {
if (ifShowCorner) {
ifShowCorner = false;
oldCorner = "";
showCornerCont = 0;
$(layerNode).hide();
}
}
this.show = function () {
if (!ifShowCorner) {
ifShowCorner = true;
}
$(layerNode).show();
}
this.showData = function (obj, event) {
if (showCornerCont > 0) return;
var _this = this;
if (Math.floor((new Date() - loadSbCornerTime) / 600) > 50) {
this.load(function () {
_this.showDataCallback(obj, event);
});
}
else {
_this.showDataCallback(obj, event);
}
}
this.showDataCallback = function (obj, event) {
var i = parseInt(obj.attributes["aLoc"].value);
var data = A[i];
var scheduleId = data[0];
var homeTeamID = data[2];
var guestTeamID = data[3];
var language = Config.language;
var homeTeam = data[4 + language];
var guestTeam = data[7 + language];
var sclassName = B[data[1]][1 + language];
var hOrder = "";
var gOrder = "";
var matchState = parseInt(data[12]);
var html = new Array();
if (typeof (sCornerData[scheduleId]) == "undefined")
return;
var strGoals = "";
var arrOdds = sCornerData[scheduleId].split('^');
var arrCornerLetGoal = arrOdds[0].split(',');
var arrCornerTotal = arrOdds[1].split(',');
var arrCornerCount = arrOdds[2].split(',');
var arrDetail = null;
if (typeof (arrOdds[3]) != "undefined")
arrDetail = arrOdds[3].split(';');
strGoals = scheduleId + "," + homeTeamID + "," + guestTeamID + "," + matchState + ",";
for (var j = 3; j < 6; j++) {
strGoals += (typeof (arrCornerLetGoal[j]) == "undefined" ? '' : arrCornerLetGoal[j]) + ","
}
for (var j = 3; j < 6; j++) {
strGoals += (typeof (arrCornerTotal[j]) == "undefined" ? '' : arrCornerTotal[j]) + ","
}
for (var j = 0; j < 4; j++) {
strGoals += (typeof (arrCornerCount[j]) == "undefined" ? '' : arrCornerCount[j]) + ","
}
if (arrDetail != null && arrDetail[0] != "") {
var arr = arrDetail[arrDetail.length - 1].split(',');
strGoals += arr[0] + ',' + arr[1];
}
else
strGoals += ',';
var beginHeight = 60;
var isShow = (typeof (arrCornerLetGoal[0]) != "undefined" && arrCornerLetGoal[0] != "") || (typeof (arrCornerTotal[0]) != "undefined" && arrCornerTotal[0] != "");
html.push('角球数据
');
html.push('' + homeTeam + ' ' + guestTeam + '
');
var goalIsShow = (isShow ? "" : "none");
beginHeight += (isShow ? 66 : 0);
html.push('');
html.push('
');
html.push('
让分 大小
');
html.push('
');
html.push('' + (typeof (arrCornerLetGoal[0]) == "undefined" ? " " : changeData(arrCornerLetGoal[0])) + ' ');
html.push('' + (typeof (arrCornerLetGoal[0]) == "undefined" ? " " : arrCornerLetGoal[1]) + ' ');
html.push('' + (typeof (arrCornerLetGoal[0]) == "undefined" ? " " : changeData(arrCornerLetGoal[2])) + ' ');
html.push('初指 ');
html.push('' + (typeof (arrCornerTotal[0]) == "undefined" ? " " : changeData(arrCornerTotal[0])) + ' ');
html.push('' + (typeof (arrCornerTotal[0]) == "undefined" ? " " : arrCornerTotal[1]) + ' ');
html.push('' + (typeof (arrCornerTotal[0]) == "undefined" ? " " : changeData(arrCornerTotal[2])) + ' ');
html.push(' ');
html.push('' + (typeof (arrCornerLetGoal[3]) == "undefined" ? " " : getStrDiv(arrCornerLetGoal[3], arrCornerLetGoal[0])) + ' ' + (typeof (arrCornerLetGoal[4]) == "undefined" ? " " : arrCornerLetGoal[4]) + ' ');
html.push('' + (typeof (arrCornerLetGoal[5]) == "undefined" ? " " : getStrDiv(arrCornerLetGoal[5], arrCornerLetGoal[2])) + ' ');
html.push('即时 ' + (typeof (arrCornerTotal[3]) == "undefined" ? " " : getStrDiv(arrCornerTotal[3], arrCornerTotal[0])) + ' ' + (typeof (arrCornerTotal[4]) == "undefined" ? " " : arrCornerTotal[4]) + ' ');
html.push('' + (typeof (arrCornerTotal[5]) == "undefined" ? " " : getStrDiv(arrCornerTotal[5], arrCornerTotal[2])) + ' ');
html.push(' ');
html.push('
');
isShow = (data[36] == 1 && matchState != 0);
var cornerIsShow = (isShow ? "" : "none");
beginHeight += (isShow ? 44 : 0);
html.push('');
html.push("
角球事件
");
html.push('
');
html.push('');
html.push('' + (typeof (arrCornerCount[0]) == "undefined" ? " " : arrCornerCount[0]) + ' ');
html.push('全场 ');
html.push('' + (typeof (arrCornerCount[1]) == "undefined" ? " " : arrCornerCount[1]) + ' ');
html.push(' ');
html.push('');
html.push('' + (typeof (arrCornerCount[2]) == "undefined" ? " " : arrCornerCount[2]) + ' ');
html.push('半场 ');
html.push('' + (typeof (arrCornerCount[3]) == "undefined" ? " " : arrCornerCount[3]) + ' ');
html.push(' ');
if (arrDetail != null && arrDetail[0] != "") {
for (var j = 0; j < arrDetail.length; j++) {
var arr = arrDetail[j].split(',');
html.push('');
html.push('' + (homeTeamID == arr[0] ? '第' + (j + 1) + '个角球 ' : ' ') + ' ');
html.push('' + arr[1] + '\' ');
html.push('' + (guestTeamID == arr[0] ? '第' + (j + 1) + '个角球 ' : ' ') + ' ');
html.push(' ');
}
}
html.push("
");
var pos = getElementPos("sound");
var contentHeight = (cornerIsShow == "none" ? 0 : beginHeight + (arrDetail != null && arrDetail[0] != "" ? arrDetail.length * 18 : 0));
layerNode.style.left = (document.body.clientWidth / 2 - 325) + "px";
var scrollTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
var postPk = getElementPos("tr1_" + scheduleId);
var oddsY = postPk.y - scrollTop;
if (scrollTop == 0) {
if (event.clientY - pos.y < contentHeight)
layerNode.style.top = postPk.y + "px";
else
layerNode.style.top = (oddsY - contentHeight + 10) + "px";
}
else {
if (event.clientY < layerNode.clientHeight)
layerNode.style.top = postPk.y + "px";
else
layerNode.style.top = (postPk.y - contentHeight + 10) + "px";
}
if (goalIsShow == "none" && cornerIsShow == "none") {
html = [];
html.push("");
layerNode.style.left = (document.body.clientWidth / 2 - 90) + "px"
}
layerNode.innerHTML = html.join("");
ifShowCorner = 1;
this.show();
showCornerCont++;
}
}
//---------------<<
function Getdifftime() {
$.ajax({
url: "/time.shtml",
type: 'GET',
cache: false,
success: function (data) {
var t = new Date(data.substr(0, 4), parseInt(data.substr(4, 2)) - 1, data.substr(6, 2), data.substr(8, 2), data.substr(10, 2), data.substr(12, 2));
difftime = parseInt((new Date()).getTime() - t.getTime());
}
});
}
var filterHelper = new FilterHelper();
var loaded = 0, LoadTime = 0, nofityTimer, matchType = -1, runtimeTimer, getoddsxmlTimer, LoadLiveFileTimer, loadbfChange, loadCheck;
var difftime = 0;
Getdifftime();
var loadDetailFileTime = new Date();
var loadpanluFileTime = new Date();
var oldOddsXML;
var lastUpdateTime, oldUpdateTime = "", oldXML = "";
var lastUpdateFileTime = 0;
var oXmlHttp = zXmlHttp.createRequest();
var needSound = false;
var orderby = "time";
var oldLetBig = 0; //判断让球 大小是否有切换
var strCompanyID = ",3,23,24,31,";
var concernIds = getCookie("concernIds").split(",");
if (concernIds[0] === "")
concernIds.splice(0, 1);
var flashScheduleIDs = "";
var jcIdList = "", idList = "";
var topSclassIds = [67];
var topSchedules = [];
function GetXml(url, doSuccess) {
$.ajax({ url: url, type: 'get', async: true, dataType: 'XML', success: doSuccess });
}
function GetTxt(url, doSuccess) {
$.ajax({ url: url, type: 'get', async: true, dataType: 'text', success: doSuccess });
}
function getXmlChildNodes_Text(childNodes, index) {
return childNodes.length > index ? childNodes[index][document.all && parseInt(ieNum) < 10 ? "text" : "textContent"] : "";
}
function SetTopSclass(tempA) {
var newTempA = [];
var index = 0;
if (!!tempA) {
for (var i = 0; i < tempA.length; i++) {
var tempId = B[tempA[i][1]][0];
if (topSclassIds.indexOf(tempId) < 0) {
newTempA.push(tempA[i]);
}
else {
topSchedules.push(tempA[i][0]);
newTempA.splice(index, 0, tempA[i]);
index++;
}
}
}
A = newTempA;
}
function ShowBf() {
$("#hiddencount").html(0);
loaded = 0;
SetTopSclass(A);
SortData();
var ifSortByLeague = orderby == "league";
if (ifSortByLeague) {
$("#conditionBtn").hide();
MakeTableOrderByLeague();
document.getElementById("li_league").style.display = "none";
document.getElementById("li_time").style.display = "";
}
else {
$("#conditionBtn").show();
MakeTable();
document.getElementById("li_league").style.display = "";
document.getElementById("li_time").style.display = "none";
}
$.when(showRecommend()).done(function (arr) {
$.each(arr, function (i, one) { one.show() });
});
//联赛/杯赛名列表
makeMyLeague();
setTimeout(function () {
filterHelper.linkData();
//国家列表
makeMyCountry();
//让球选择/查询
makeGoalTable(oldLetBig); //让球
filterHelper.initHtml(!ifSortByLeague);
}, 500);
GetXml("/data/goal" + Config.companyID + ".xml?" + Date.parse(new Date()), function (data) {
idList = getXmlChildNodes_Text(data.documentElement.childNodes, 1);
showodds(false, data);
jcIdList = getXmlChildNodes_Text(data.documentElement.childNodes, 2);
});
if (!WsBegin(true)) {
window.clearTimeout(getoddsxmlTimer);
getoddsxmlTimer = window.setTimeout("getoddsxml()", 3000);
window.clearTimeout(loadbfChange);
loadbfChange = window.setTimeout("gettime()", 2000);
window.clearTimeout(loadCheck);
loadCheck = window.setTimeout("check()", 30000);
}
else {
WsRun();
}
window.clearTimeout(runtimeTimer);
runtimeTimer = window.setTimeout("setMatchTime()", 1000);
if (Config.rank == 1) ShowTeamRank();
if (Config.explain == 0) ShowExplain();
document.getElementById("scoreLoading").style.display = "none";
window.setTimeout("showLeagueList(1)", 500);
if (flashScheduleIDs != "") {
window.setTimeout("openFlash(" + flashScheduleIDs + ")", 500);
}
}
function SortData() {
if (concernIds.length == 0)
return;
var temp = [];
var tempCount = matchcount;
for (var i = 0; i < tempCount && concernIds.length > temp.length; i++) {
if (concernIds.contains(A[i][0])) {
temp.push(A[i]);
A.splice(i, 1);
tempCount--;
i--;
}
}
if (temp.length > 0) {
A = temp.concat(A);
}
}
function MakeTable() {
var state, bg = "", hh = 0;
var H_redcard, G_redcard, H_yellow, G_yellow;
var html = new Array();
var isCreateTr = false;
html.push(" ");
var advertTool = new Advert(matchcount, 15);
var cid = Config.companyID;
var ifAlias = Config.ifAlias;
var lang = Config.language;
for (var i = 0; i < matchcount; i++) {
try {
var data = A[i];
var schID = data[0];
var sclassArr = B[data[1]];
var sclassId = sclassArr[0];
var hn = getTeamName(ifAlias, data[4 + lang], typeof (T) == "undefined" ? "" : T[data[2] + "_3"]);
var gn = getTeamName(ifAlias, data[7 + lang], typeof (T) == "undefined" ? "" : T[data[3] + "_3"]);
sclassArr[8]++;
var ifConcern = concernIds.contains(schID);
if (!isCreateTr && !ifConcern) {
html.push("选 " + matchdate + " 时间 状态 主队 比分 客队 角/半 动画 数据 走势 走 ");
isCreateTr = true;
}
var match_corner = "";
state = parseInt(data[12]);
switch (state) {
case 0:
if (data[23] == "1") match_score = "阵容"; else match_score = "-";
match_half = "-";
match_corner = "-";
break;
case 1:
match_score = data[13] + "-" + data[14];
match_half = "-";
match_corner = data[34] + "-" + data[35];
break;
case -11:
case -14:
match_score = "";
match_half = "";
match_corner = "";
break;
default:
match_score = data[13] + "-" + data[14];
if (data[15] == null) data[15] = "";
if (data[16] == null) data[16] = "";
match_half = data[15] + "-" + data[16];
match_corner = data[34] + "-" + data[35];
break;
}
if (data[17] != "0") H_redcard = " "; else H_redcard = "";
if (data[18] != "0") G_redcard = " "; else G_redcard = "";
if (data[19] != "0") H_yellow = " "; else H_yellow = "";
if (data[20] != "0") G_yellow = " "; else G_yellow = "";
if (bg != "ts1") bg = "ts1"; else bg = "ts2";
var classx = "";
if (classx == "none") hh++;
html.push("");
html.push(" ");
var sName = sclassArr[1 + lang];
if (sclassArr[7] != "")
html.push("" + sName + " ");
else
html.push("" + sName + " ");
html.push("" + data[10] + (!!data[38] ? " 补" + data[38] + "' " : "") + " ");
if (state == "-1")
classx2 = "td_scoreR";
else
classx2 = "td_score";
var classx3 = (state == "0" || state == "-1" ? "black" : "blue");
html.push("" + state_ch[state + 14].split(",")[lang] + " ");
html.push("" + H_yellow + " " + H_redcard + " " + hn + " ");
html.push("" + match_score + " ");
html.push("" + gn + " " + G_redcard + " " + G_yellow + " ");
html.push("" + match_corner + " " + match_half + " " + " ");
html.push("");
var isShowFlash = data[37] == 1;
if (isShowFlash) {
if (flashScheduleIDs != "" && parseInt(flashScheduleIDs) == schID)
html.push(" ");
else
html.push(" ");
}
html.push(" ");
html.push("析 亚 欧 ");
html.push("荐 ");
if ((data[41] == "1" || data[42] == "1") && sclassId != 8 && sclassId != 842) {
html.push(" ");
}
html.push(" ");
html.push(" ");
html.push(" ");
html.push(" ");
if (!ifConcern)
html.push(" ");
else
html.push(" ");
data[27] = removeTV(data[27], sclassId, sName);
if (data[27] + data[32] == "" || classx == "none") classx = "none"; else classx = "";
if (isShowFlash)
html.push(" ");
html.push("");
if (A[i][39] != "")
html.push(" " + A[i][39 + (Config.language == 1 ? 1 : 0)] + " ");
else
html.push(" ");
var strExplain = showExplain(data[32], hn, gn);
if (strExplain + data[27] != "")
html.push("" + showExplain(data[32], hn, gn) + (data[32] != "" && data[27] != "" ? " " + data[27] : data[27] != "" ? data[27] : "") + " ");
else
html.push(" ");
html.push(" ");
if (!ifConcern) {
advertTool.Show(html, i);
}
} catch (e) { }
}
advertTool.ShowRemain(html);
html.push("
")
document.getElementById("ScoreDiv").innerHTML = html.join("");
document.getElementById("hiddencount").innerHTML = hh;
$(".bts .p_concern").show();
}
function MakeTableOrderByLeague() {
var state, bg = "", hh = 0;
var leagueIndex = -1, oldLeagueIndex = -1;
var H_redcard, G_redcard, H_yellow, G_yellow;
var html = new Array();
html.push("");
html.push("选 时间 状态 主队 比分 客队 角/半 动画 数据 走势 走 ");
var advertTool = new Advert(matchcount, 13);
var cid = Config.companyID;
var ifAlias = Config.ifAlias;
var lang = Config.language;
for (var i = 0; i < matchcount; i++) {
try {
var data = A[i];
var schID = data[0];
var sclassArr = B[data[1]];
var sclassId = sclassArr[0];
var hn = getTeamName(ifAlias, data[4 + lang], typeof (T) == "undefined" ? "" : T[data[2] + "_3"]);
var gn = getTeamName(ifAlias, data[7 + lang], typeof (T) == "undefined" ? "" : T[data[3] + "_3"]);
leagueIndex = data[1];
sclassArr[8]++;
var match_corner = "";
state = parseInt(data[12]);
switch (state) {
case 0:
if (data[23] == "1") match_score = "阵容"; else match_score = "-";
match_half = "-";
match_corner = "-";
break;
case 1:
match_score = data[13] + "-" + data[14];
match_half = "-";
match_corner = data[34] + "-" + data[35];
break;
case -11:
case -14:
match_score = "";
match_half = "";
match_corner = "";
break;
default:
match_score = data[13] + "-" + data[14];
if (data[15] == null) data[15] = "";
if (data[16] == null) data[16] = "";
match_half = data[15] + "-" + data[16];
match_corner = data[34] + "-" + data[35];
break;
}
if (data[17] != "0") H_redcard = " "; else H_redcard = "";
if (data[18] != "0") G_redcard = " "; else G_redcard = "";
if (data[19] != "0") H_yellow = " "; else H_yellow = "";
if (data[20] != "0") G_yellow = " "; else G_yellow = "";
if (bg != "ts1") bg = "ts1"; else bg = "ts2";
var classx = "";
if (classx == "none") hh++;
if (oldLeagueIndex != leagueIndex) {
oldLeagueIndex = leagueIndex;
html.push("");
if (sclassArr[7] != "")
html.push("");
else
html.push(" ");
html.push(sclassArr[1 + lang] + " ");
html.push(" ");
}
html.push("");
html.push(" ");
html.push(" ");
html.push("" + data[10] + (!!data[38] ? " 补" + data[38] + "' " : "") + " ");
if (state == "-1")
classx2 = "td_scoreR";
else
classx2 = "td_score";
var classx3 = (state == "0" || state == "-1" ? "black" : "blue");
html.push("" + state_ch[state + 14].split(",")[lang] + " ");
html.push("" + H_yellow + " " + H_redcard + " " + hn + " ");
html.push("" + match_score + " ");
html.push("" + gn + " " + G_redcard + " " + G_yellow + " ");
html.push("" + match_corner + " " + match_half + " " + " ");
html.push("");
var isShowFlash = data[37] == 1;
if (isShowFlash) {
if (flashScheduleIDs != "" && parseInt(flashScheduleIDs) == schID)
html.push(" ");
else
html.push(" ");
}
html.push(" ")
html.push("析 亚 欧 ");
html.push("荐 ");
if ((data[41] == "1" || data[42] == "1") && sclassId != 8 && sclassId != 842) {
html.push(" ");
}
html.push(" ");
html.push(" ");
html.push(" ");
html.push(" ");
data[27] = removeTV(data[27], sclassId, sclassArr[1 + lang]);
if (data[27] + data[32] == "" || classx == "none") classx = "none"; else classx = "";
html.push("" + showExplain(data[32], hn, gn) + (data[32] != "" && data[27] != "" ? " " + data[27] : data[27] != "" ? data[27] : "") + " ");
if (isShowFlash)
html.push(" ");
advertTool.Show(html, i);
} catch (e) { }
}
advertTool.ShowRemain(html);
html.push("
")
document.getElementById("ScoreDiv").innerHTML = html.join("");
document.getElementById("hiddencount").innerHTML = hh;
$(".bts .p_concern").hide();
}
function makeMyLeague() {
var SclassArr = pySegSort(B, false, 1);
var hotHtml = new Array();
var normalHtml = new Array();
var navHtml = new Array();
hotHtml.push('热门
');
hotHtml.push('');
navHtml.push('')
normalHtml.push('' + tempLetter + '
');
normalHtml.push('");
navHtml.push(" ");
$("#leagueSel").html(navHtml.join("") + hotHtml.join("") + normalHtml.join(""));
}
function makeMyCountry() {
function cutStr(str, len) {
var str_length = 0;
var str_len = 0;
var str_cut = "";
var str_len = str.length;
for (var i = 0; i < str_len; i++) {
var a = str.charAt(i);
str_length++;
if (escape(a).length > 4) {
str_length++;
}
if (str_length <= len)
str_cut = str_cut.concat(a);
if (str_length >= len) {
return str_cut;
}
}
return str;
}
var countryArr = pySegSort(C, false, 1);
//国家列表
var countryHtml = new Array();
var navHtml = new Array();
navHtml.push('');
for (var i = 0; i < countryArr.length; i++) {
var group = countryArr[i];
var tempLetter = "";
if (group.data.length > 0) {
for (var j = 0; j < group.data.length; j++) {
var oneCountry = group.data[j];
if (tempLetter != group.letter.toUpperCase()) {
tempLetter = group.letter.toUpperCase();
countryHtml.push(' ')
countryHtml.push('' + tempLetter + '
');
countryHtml.push('");
document.getElementById("countryList").innerHTML = navHtml.join("") + countryHtml.join("");
}
function showodds(needSleep, xmlNode) //是否需显示一场之后暂停一会
{
try {
var root = xmlNode.documentElement.childNodes[0];
if (root.childNodes.length == 0) return;
needSound = false;
var oddsarr = [];
for (var i = 0; i < root.childNodes.length; i++) {
oddsarr.push(getXmlChildNodes_Text(root.childNodes, i));
}
if (oddsarr.length > 0) {
showodds2(oddsarr, 0, true);
}
} catch (e) { }
}
function showodds2(oddsArr, i, needSleep) {
try {
var odds = new Array();
odds = oddsArr[i];
var D = odds.split(",");
var tr = document.getElementById("tr1_" + D[0]);
if (tr != null) {
var oldOdds = tr.attributes["odds"].value;
var matchIndex = tr.attributes["index"].value;
var oldD = oldOdds.split(",");
var hg = 0, eu = 0, ou = 0;//1主,2走,3客
var matchState = A[matchIndex][12];
try {
if (matchState == -1) {
var hscore = parseInt(A[matchIndex][13]);
var gscore = parseInt(A[matchIndex][14]);
if (hscore - gscore > D[2]) hg = 1;
else if (hscore - gscore < D[2]) hg = 3;
else hg = 2;
if (hscore - gscore > 0) eu = 1;
else if (hscore - gscore < 0) eu = 3;
else eu = 2;
if (hscore + gscore > D[10]) ou = 1;
else if (hscore + gscore < D[10]) ou = 3;
else ou = 2;
}
}
catch(e) { }
if (oldOdds !== odds || oldD.length != D.length) {
var ifChange = false;
var arr = [[2, Goal2GoalCn], 3, 4, 6, 7, 8, [10, Goal2GoalCn2], 11, 12]
for (var j = 0; j < arr.length; j++) {
var one = arr[j];
var fuc = null, index = one;
if (one instanceof Array) {
index = one[0];
fuc = one[1];
}
if (index >= D.Length)
break;
var oldV = oldD[index], v = D[index];
if (typeof fuc === "function")
v = fuc(v);
if (oldV != D[index] && typeof oldV !== "undefined" && oldV != "") {
if (D[index] > oldV)
v = "" + v + " ";
else v = "" + v + " ";
ifChange = true;
}
D[index] = v;
}
if (ifChange) {
window.setTimeout("restoreOddsColor(" + D[0] + ")", 30000);
if (Config.oddsSound == 1) {
if (tr.style.display != "none") needSound = true;
}
}
var ifeng_yp = D[14] != "0", ifeng_op = D[15] != "0", ifeng_dx = D[16] != "0";
var tmp = "";
if (Config.yp == 1) tmp += "" + (ifeng_yp ? " " : D[3]) + "
";
if (Config.op == 1) tmp += "" + (ifeng_op ? " " : D[6]) + "
";
if (Config.dx == 1) tmp += "" + (ifeng_dx ? " " : D[11]) + "
";
tr.cells[10].innerHTML = tmp;
tmp = "";
if (Config.yp == 1) tmp += "" + (ifeng_yp ? "封" : D[2]) + "
";
if (Config.op == 1) tmp += "" + (ifeng_op ? "封" : D[7]) + "
";
if (Config.dx == 1) tmp += "" + (ifeng_dx ? "封" : D[10]) + "
";
tr.cells[11].innerHTML = tmp;
tmp = "";
if (Config.yp == 1) tmp += "" + (ifeng_yp ? " " : D[4]) + "
";
if (Config.op == 1) tmp += "" + (ifeng_op ? " " : D[8]) + "
";
if (Config.dx == 1) tmp += "" + (ifeng_dx ? " " : D[12]) + "
";
tr.cells[12].innerHTML = tmp;
tmp = "";
//var isRun = document.getElementById("time_" + D[0]).innerHTML != "";
var isRun = matchState > 0;
var zoudiLink = isRun ? "/matchdetail/" + D[0] + ".html" : "/Odds/3in1Odds.aspx?id=" + D[0] + "&companyid=" + Config.companyID + "&l=" + Config.language;
if (D[13] == "1") tmp = " " + (isRun ? " " : "") + " ";
if (D[13] == "2") tmp = " ";
tr.cells[13].getElementsByTagName('span').item(0).innerHTML = tmp;
tr.attributes["odds"].value = odds;
}
}
} catch (e) { }
i++;
if (i < oddsArr.length) {
if (needSleep) setTimeout(function () { showodds2(oddsArr, i, true); }, 5);
else showodds2(oddsArr, i, needSleep);
}
else
if (needSound) audioHelper.play("oddsFlashSound");
}
function getoddsxml() {
GetXml("/data/ch_goal" + Config.companyID + ".xml?" + Date.parse(new Date()), function (data) {
var dataTxt = $(data).text();
if (typeof oldOddsXML != "undefined" && dataTxt == oldOddsXML)
return;
oldOddsXML = dataTxt;
showodds(true, data);
});
getoddsxmlTimer = window.setTimeout("getoddsxml()", 3000);
}
function PlayeddsSound(matchid) {
if (Config.oddsSound == 1) {
if (document.getElementById("tr1_" + matchid).style.display != "none") {
audioHelper.play("oddsFlashSound");
}
}
window.setTimeout("restoreOddsColor(" + matchid + ")", 30000);
}
function restoreOddsColor(matchid) {
var tr = document.getElementById("tr1_" + matchid);
if (tr == null) return;
tr.cells[10].innerHTML = tr.cells[10].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
tr.cells[11].innerHTML = tr.cells[11].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
tr.cells[12].innerHTML = tr.cells[12].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, "");
}
function gettime() {
try {
LoadTime = (LoadTime + 1) % 60;
if (LoadTime == 0)
oXmlHttp.open("get", "data/change2.xml?" + Date.parse(new Date()), true);
else
oXmlHttp.open("get", "data/change.xml?" + Date.parse(new Date()), true);
oXmlHttp.onreadystatechange = refresh;
oXmlHttp.send(null);
}
catch (e) { }
window.setTimeout("gettime()", 2000);
}
function refresh() {
if (oXmlHttp.readyState != 4 || (oXmlHttp.status != 200 && oXmlHttp.status != 0)) return;
lastUpdateTime = new Date();
var root = oXmlHttp.responseXML.documentElement;
if (oldXML == "" || oldXML == oXmlHttp.responseText) {
oldXML = oXmlHttp.responseText;
return;
}
oldXML = oXmlHttp.responseText;
if (root.attributes[0].value != "0") {
window.setTimeout("LoadLiveFile()", Math.floor(20000 * Math.random()));
return;
}
var bfdata = [];
for (var i = 0; i < root.childNodes.length; i++) {
bfdata.push(getXmlChildNodes_Text(root.childNodes, i));
}
refreshChange(bfdata);
}
function refreshChange(bfArr) {
try {
var D = new Array();
var matchindex, score1change, score2change, scorechange;
var goTime, hometeam, guestteam, sclassname, score1, score2, tr;
var matchNum = 0;
var winStr = "";
var poptype = 1;
var notify = "";
var ifShow_odds = get_ifShow_odds(); //判断是否有显示SB详情走势浮动窗口
var lang = Config.language;
for (var i = 0; i < bfArr.length; i++) {
D = bfArr[i].split("^");//0:ID,1:state,2:score1,3:score2,4:half1,5:half2,6:card1,7:card2,8:time1,9:time2,10:explain,11:lineup
D[1] = parseInt(D[1]);
tr = document.getElementById("tr1_" + D[0]);
if (tr == null) continue;
matchindex = tr.attributes["index"].value;
var data = A[matchindex];
var sclassArr = B[data[1]];
var sclassId = sclassArr[0];
var sName = sclassArr[1 + lang];
score1change = false;
if (data[13] != D[2]) {
data[13] = D[2];
score1change = true;
tr.cells[4].style.backgroundColor = "#bbbb22";
}
score2change = false;
if (data[14] != D[3]) {
data[14] = D[3];
score2change = true;
tr.cells[6].style.backgroundColor = "#bbbb22";
}
scorechange = score1change || score2change;
//角球
if (data[34] != D[16]) {
data[34] = D[16];
}
if (data[35] != D[17]) {
data[35] = D[17];
}
data[36] = D[18];
document.getElementById("corner_" + D[0]).style.display = (data[36] == "1" ? "" : "none");
//附加说明改时变了'
D[10] = removeTV(D[10], sclassId, sName);
if (data[27] != D[10] || data[32] != D[15] || data[39] != D[19]) {
data[27] = D[10];
data[32] = D[15];
data[39] = D[19];
data[40] = D[20];
var objVarExplain = document.getElementById("varexplain_" + D[0]);
var objExplain = document.getElementById("explain_" + D[0]);
if (!!data[39]) {
objVarExplain.className = "var";
objVarExplain.innerHTML = " " + data[39 + lang] + " ";
}
else {
objVarExplain.innerHTML = "";
objVarExplain.className = "";
}
var ex = showExplain(D[15], data[4 + lang], data[7 + lang]) + D[10];
if (ex != "") {
objExplain.className = "var";
objExplain.innerHTML = ex;
}
else {
objExplain.className = "";
objExplain.innerHTML = "";
}
//document.getElementById("other_" + D[0]).innerHTML = ex;
if (D[10] + D[15] + D[19] == "")
document.getElementById("tr2_" + D[0]).style.display = "none";
else if (filterHelper.ifShowSchByID(D[0]))
document.getElementById("tr2_" + D[0]).style.display = "";
}
if (Config.redcard == 1 && (D[6] != data[17] || D[7] != data[18]) && tr.style.display != "none") {
hometeam = data[4 + lang].replace("(中) ", "(中)").substring(0, 7);
guestteam = data[7 + lang].substring(0, 7);
sclassname = B[data[1]][1 + lang];
if (D[6] != data[17]) {
hometeam = "" + hometeam + " ";
}
if (D[7] != data[18]) {
guestteam = "" + guestteam + " ";
}
matchNum = matchNum + 1;
if (matchNum > 1) {
winStr += '
';
}
winStr += '
红牌 ' + tr.cells[3].innerHTML + '
' + hometeam + (D[6] == "0" ? "" : " ") + ' vs ' + guestteam + (D[7] == "0" ? "" : " ") + ' ';
poptype = 2;
}//redcardChange
if (Config.redSound == 1 && (D[6] != data[17] || D[7] != data[18]) && tr.style.display != "none") {
audioHelper.play("Sound_Red"); //红牌变化提示音
}
//红牌变化了
if (D[6] != data[17]) {
data[17] = D[6];
if (D[6] == "0")
document.getElementById("redcard1_" + D[0]).innerHTML = "";
else
document.getElementById("redcard1_" + D[0]).innerHTML = " ";
if (Config.redcard == 1) tr.cells[4].style.backgroundColor = "#ff8888";
window.setTimeout("timecolors(" + D[0] + "," + matchindex + ")", 12000);
}
if (D[7] != data[18]) {
data[18] = D[7];
if (D[7] == "0")
document.getElementById("redcard2_" + D[0]).innerHTML = "";
else
document.getElementById("redcard2_" + D[0]).innerHTML = " ";
if (Config.redcard == 1) tr.cells[6].style.backgroundColor = "#ff8888";
window.setTimeout("timecolors(" + D[0] + "," + matchindex + ")", 12000);
}
//黄牌变化了
if (D[12] != data[19]) {
data[19] = D[12];
if (D[12] == "0")
document.getElementById("yellow1_" + D[0]).innerHTML = "";
else
document.getElementById("yellow1_" + D[0]).innerHTML = " ";
}
if (D[13] != data[20]) {
data[20] = D[13];
if (D[13] == "0")
document.getElementById("yellow2_" + D[0]).innerHTML = "";
else
document.getElementById("yellow2_" + D[0]).innerHTML = " ";
}
//开赛
//if (data[10] != D[8]) tr.cells[2].innerHTML = D[8];
//开赛 or 补时
if (data[38] != D[21] || data[10] != D[8]) {
data[38] = D[21];
tr.cells[2].innerHTML = data[10] + (!!data[38] ? " 补" + data[38] + "' " : "")
}
data[10] = D[8];
data[11] = D[9];
//半场比分
data[15] = D[4];
data[16] = D[5];
//补时
if (!!D[21] && data[38] != D[21]) {
data[38] = D[21];
tr.cells[2].innerHTML = data[10] + (!!data[38] ? " 补" + data[38] + "' " : "")
}
//状态
if (data[12] != D[1]) {
var oldState = data[12];
data[12] = D[1];
//if (oldState > 3 || data[12] > 3 || oldState < 0)
// console.log(D[0] + ":" + oldState + "->" + data[12]+"("+new Date()+")" );
switch (data[12]) {
case 0:
tr.cells[3].innerHTML = "";
break;
case 1:
var t = data[11].split(",");
var t2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]);
goTime = Math.floor((new Date() - t2 - difftime) / 60000);
if (goTime > 45) goTime = "45+" + ((goTime - 45) > 15 ? 15 : (goTime - 45));
if (goTime < 1) goTime = "1";
tr.cells[3].innerHTML = goTime + " ";
break;
case 2:
case 4:
case 5:
case -11:
tr.cells[3].innerHTML = state_ch[parseInt(D[1]) + 14].split(",")[lang];
break;
case 3:
var t = data[11].split(",");
var t2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]);
goTime = Math.floor((new Date() - t2 - difftime) / 60000) + 46;
if (goTime > 90) goTime = "90+" + ((goTime - 90) > 15 ? 15 : (goTime - 90));
if (goTime < 46) goTime = "46";
tr.cells[3].innerHTML = goTime + " ";
break;
case -1:
tr.cells[3].innerHTML = state_ch[parseInt(D[1]) + 14].split(",")[lang];
tr.cells[5].style.color = "red";
var concerns = getCookie("concernIds");
if (concerns.indexOf(D[0]) == -1) {
window.setTimeout("MoveToBottom(" + D[0] + ")", 25000);
}
break;
default:
tr.cells[3].innerHTML = state_ch[parseInt(D[1]) + 14].split(",")[lang];
MoveToBottom(D[0]);
break;
}
}
//score
switch (data[12]) {
case 0:
if (D[11] == "1")
tr.cells[5].innerHTML = "阵容";
else
tr.cells[5].innerHTML = "-";
break;
case 1:
tr.cells[5].innerHTML = data[13] + "-" + data[14];
showHtml(document.getElementById("corner_" + D[0]), data[34] + "-" + data[35]);
break;
case -11:
case -14:
tr.cells[5].innerHTML = "-";
showHtml(document.getElementById("half_" + D[0]), "-");
showHtml(document.getElementById("corner_" + D[0]), "-");
break;
default: //2 3 -1 -12 -13
tr.cells[5].innerHTML = data[13] + "-" + data[14];
var halfNode = document.getElementById("half_" + D[0]);
if (showHtml(halfNode, data[15] + "-" + data[16]))
halfNode.style.color = "red";
showHtml(document.getElementById("corner_" + D[0]), data[34] + "-" + data[35]);
break;
}
if (ifShow_odds) {
var objScore = document.getElementById("ffScoreDetail");
var sid = objScore.attributes["sid"].value;
if (parseInt(sid) == parseInt(data[0])) {
objScore.innerHTML = "" + data[13] + " - " + data[14] + " ";
}
}
if (scorechange) {
ShowFlash(D[0], matchindex);
if (tr.style.display != "none") {
hometeam = data[4 + lang].replace("(中) ", "(中)").substring(0, 7);
guestteam = data[7 + lang].substring(0, 7);
sclassname = B[data[1]][1 + lang];
if (score1change) {
hometeam = "" + hometeam + " ";
score1 = "" + D[2] + " ";
score2 = "" + D[3] + " ";
}
if (score2change) {
guestteam = "" + guestteam + " ";
score1 = "" + D[2] + " ";
score2 = "" + D[3] + " ";
}
window.clearTimeout(nofityTimer);
notify += sclassname + ":" + hometeam + " " + score1 + "-" + score2 + " " + guestteam + " ";
if (matchNum > 2) {
notify += " ";
}
nofityTimer = window.setTimeout("clearNotify()", 20000);
if (Config.winLocation >= 0 && parseInt(D[1]) >= -1) {
matchNum = matchNum + 1;
if (matchNum > 1) {
winStr += '
';
}
winStr += '
' + sclassname + ' ' + tr.cells[3].innerHTML + ' ' + Goal2GoalCn(data[25]) + '
' + hometeam + ' ' + score1 + '-' + score2 + ' ' + guestteam + '
'
poptype = 1;
}
}
}//scorechange
}
if (matchNum > 0) {
ShowCHWindow2(poptype, winStr, matchNum);
document.getElementById("notify").innerHTML = notify;
}
} catch (e) { }
}
function ShowFlash(id, n) {
try {
if (Config.sound >= 0 && A[n][12] >= -1 && document.getElementById("tr1_" + id).style.display != "none")
audioHelper.play("flashsound");
}
catch (e) { }
window.setTimeout("timecolors(" + id + ")", 30000);
}
function timecolors(matchid) {
try {
var tr = document.getElementById("tr1_" + matchid);
tr.cells[4].style.backgroundColor = "";
tr.cells[6].style.backgroundColor = "";
}
catch (e) { }
}
function clearNotify() {
document.getElementById("notify").innerHTML = "";
}
function ShowAllMatch() {
filterHelper.initValue();
filterHelper.matchType = 0;
filterHelper.save();
filterHelper.initHtml();
$("#liZC1,#liZC2,#liZC3").css("color", "#333");
$("#liZC").css("color", "#333").removeClass("selected");
showPopupBox('filterBox', true);
}
//'按比赛状态显示
function ShowMatchByMatchState(obj, n) {
$(obj).addClass("on").siblings().removeClass("on");
filterHelper.updateStateKind(n);
filterHelper.UpdateLetters();
}
function SetMatchType(m) {
filterHelper.updateMatchType(m);
filterHelper.UpdateLetters();
}
function hidematch(i) {
filterHelper.updateSch(A[i][0]);
}
function seletcAllLeague() {
$(".group li:visible :checkbox").each(function (i, v) {
var thisObj = $(this);
if (!thisObj.is(":checked")) {
thisObj.attr('checked', true);
CheckLeague2(thisObj.val());
}
});
}
function SelectOtherLeague() {
$(".group li:visible :checkbox").each(function (i, v) {
var thisObj = $(this);
var newCheck = !thisObj.is(":checked");
thisObj.attr('checked', newCheck);
CheckLeague2(thisObj.val());
});
}
function CheckLeague(i) {
var cb = $("#checkboxleague_" + i);
var ischeck = cb.is(":checked");
cb.attr("checked", !ischeck);
if (!ischeck) cb.parent().addClass("on");
else cb.parent().removeClass("on");
filterHelper.updateSclass(i, !ischeck);
}
function CheckLeague2(i) {
var cb = $("#checkboxleague_" + i);
var ischeck = cb.is(":checked");
if (ischeck) cb.parent().addClass("on");
else cb.parent().removeClass("on");
filterHelper.updateSclass(i, ischeck);
}
function CloseLeague(i) {
document.getElementById("checkboxleague_" + i).checked = false;
CheckLeague2(i);
$(".Leaguestitle#tr_" + i).hide();
}
function HiddenLeague(i, b) {
document.getElementById("checkboxleague_" + i).checked = b;
CheckLeague2(i);
}
function seletcAllCountry() {
$("#countryList li:visible :checkbox").each(function (i, v) {
var thisObj = $(this);
if (!thisObj.is(":checked")) {
thisObj.attr('checked', true);
CheckCountry2(thisObj.val());
}
});
filterHelper.UpdateLetters();
}
function SelectOtherCountry() {
$("#countryList li:visible :checkbox").each(function (i, v) {
var thisObj = $(this);
var newCheck = !thisObj.is(":checked");
thisObj.attr('checked', newCheck);
CheckCountry2(thisObj.val());
});
filterHelper.UpdateLetters();
}
function CheckCountry(id) {
var cb = $("#checkboxcountry_" + id);
var ischeck = cb.is(":checked");
cb.attr("checked", !ischeck);
if (!ischeck) cb.parent().addClass("on");
else cb.parent().removeClass("on");
filterHelper.updateCountry(id, !ischeck);
filterHelper.UpdateLetters();
}
function CheckCountry2(id) {
var cb = $("#checkboxcountry_" + id);
var ischeck = cb.is(":checked");
if (ischeck) cb.parent().addClass("on");
else cb.parent().removeClass("on");
filterHelper.updateCountry(id, ischeck);
}
function MoveToBottom(m) {
try {
if (topSchedules.indexOf(parseInt(m)) < 0) {
var dom = document.getElementById("tr1_" + m).parentElement;
dom.insertAdjacentElement("BeforeEnd", document.getElementById("tr1_" + m));
dom.insertAdjacentElement("BeforeEnd", document.getElementById("tr2_" + m));
if (!!document.getElementById("tr3_" + m))
dom.insertAdjacentElement("BeforeEnd", document.getElementById("tr3_" + m));
changeTxtAdLocation();
}
} catch (e) { }
}
function setOrderby(a) {
orderby = a
writeCookie("orderby", orderby);
LoadLiveFile();
showPopupBox("filterBox", true);
}
//更新比赛进行的时间
function setMatchTime() {
for (var i = 0; i < matchcount; i++) {
try {
if (A[i][1] == -1) continue;
var goTime = -1;
if (A[i][12] == "1") { //上半场
var t = A[i][11].split(",");
var t2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]);
goTime = Math.floor((new Date() - t2 - difftime) / 60000);
if (goTime > 45) goTime = "45+" + ((goTime - 45) > 15 ? 15 : (goTime - 45));
if (goTime < 1) goTime = "1";
document.getElementById("time_" + A[i][0]).innerHTML = goTime + " ";
}
if (A[i][12] == "3") { //下半场
var t = A[i][11].split(",");
var t2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]);
goTime = Math.floor((new Date() - t2 - difftime) / 60000) + 46;
if (goTime > 90) goTime = "90+" + ((goTime - 90) > 15 ? 15 : (goTime - 90));
if (goTime < 46) goTime = "46";
document.getElementById("time_" + A[i][0]).innerHTML = goTime + " ";
}
if (goTime > -1 && flashScheduleIDs == A[i][0])
setStatusTimeLine(goTime, A[i][12], A[i][0]);
} catch (e) { }
}
runtimeTimer = window.setTimeout("setMatchTime()", 30000);
}
function LoadDetailCallback(n, event) {
var matchArr = A[n];
var schID = matchArr[0];
if (Config.detail == 0) return;
if (matchArr[12] == "0") return;
var resultName = ["先开球", "第一个角球", "第一张黄牌", "射门", "射正", "犯规", "角球", "角球(加时)", "任意球", "越位", "乌龙球数", "黄牌", "黄牌数(加时)", "红牌", "控球时间", "头球", "救球", "守门员出击", "丟球", "成功抢断", "阻截", "长传", "短传", "助攻", "成功传中", "第一个换人", "最后换人", "第一个越位", "最后越位", "换人数", "最后角球", "最后黄牌", "换人数(加时)", " 越位(加时)", "射门不中", "中柱", "头球成功", "射门被挡", "铲球", "过人", "界外球", "传球", "传球成功率","进攻","危险进攻"]
var language = Config.language;
var homeTeam = matchArr[language + 4];
var guestTeam = matchArr[language + 7];
var detailNum = 0;
var techNum = 0;
try {
var R = new Array();
var temp = "";
var hasChange = false;
for (var i = 0; i < rq.length; i++) {
R = rq[i].split('^');
if (R[0] != schID) continue;
if (!hasChange && R[2] == '11') hasChange = true;
var pN = language == 1 ? R[4] : (R[6] != '' ? R[6] : R[4]);
var showDetailName = R[2] == '11' ? pN.replace('↑', ' ').replace('↓', ' ') : pN;
if (R[1] == "1")
temp += "" + R[3] + (R[10] == 0 ? "" : "+" + R[10]) + "' " + showDetailName + " ";
else
temp += "" + R[3] + (R[10] == 0 ? "" : "+" + R[10]) + "' " + showDetailName + " ";
detailNum++;
}
var html = "";
html += "初指参考:" + Goal2GoalCn(matchArr[25]) + " ";
html += "时间 " + homeTeam + (!matchArr[21] ? "" : "[" + matchArr[21] + "]") + " " + guestTeam + (!matchArr[22]?"":"[" + matchArr[22] + "]")+" ";
html += temp;
html += "
";
var technicCount = ""; //技术统计
for (var i = 0; i < tc.length; i++) {
R = tc[i].split('^');
if (R[0] == schID) {
technicCount = R[1];
break;
}
}
var bgcolor1 = "#FFFFFF";
var bgcolor2 = "#F0F0FF";
var regex = new RegExp("\\*", "g");
var tempTechHtml = "";
var arrTc = technicCount.replace(regex, " ").split(';');
var useTecList = ",3,4,44,14,";
for (var j = 0; j < arrTc.length; j++) {
if (arrTc[j] == '' || parseInt(arrTc[j].split(',')[0]) > 44) continue;
if (useTecList.indexOf(',' + arrTc[j].split(',')[0] + ',') == -1) continue;
tempTechHtml += "";
tempTechHtml += "" + arrTc[j].split(',')[1] + " ";
tempTechHtml += "" + resultName[parseInt(arrTc[j].split(',')[0])] + " ";
tempTechHtml += "" + arrTc[j].split(',')[2] + " ";
techNum++;
}
if (techNum > 0) {
html += "";
html += "技术统计 ";
html += tempTechHtml;
}
if (j > 0)
html += "
";
var obj = document.getElementById('winScore');
obj.style.left = (document.body.clientWidth / 2 - (location.href.indexOf("old") != -1 ? 199 : 255)) + "px";
var trid = "tr1_" + schID;
obj.style.top = getElementPos(trid).y + document.getElementById(trid).offsetHeight + "px";
obj.innerHTML = html;
obj.style.display = "";
} catch (e) { }
}
function showdetail(n, event) {
if (typeof (rq) == "undefined" || Math.floor((new Date() - loadDetailFileTime) / 600) > 60) {
LoadDetailFile(function () {
LoadDetailCallback(n, event);
});
}
else {
LoadDetailCallback(n, event);
}
}
function getPageHeight() {
var pageHeight = window.innerHeight;
if (typeof pageWindth != "number") {
if (document.compatMode == "CSS1Compat") {
pageHeight = document.documentElement.clientHeight;
}
else {
pageHeight = document.body.clientHeight;
}
}
return pageHeight;
}
function loadPanluCallback(n, event) {
try {
var html = [], bg = "";
var bigNum = 0, victoryNum = 0, singleNum = 0, j = 0, win1;
var win = 0, standoff = 0;
var countInfo = "";
html.push("");
html.push("");
html.push("赛事 ");
html.push("时间 ");
html.push("主场球队 ");
html.push("比分 ");
html.push("客场球队 ");
html.push("半场 ");
html.push("让球 ");
html.push("盘路 ");
html.push("胜负 ");
html.push("大小 ");
html.push("单双 ");
html.push(" ");
var scheduleId = A[n][0];
for (var i = 0; i < p.length; i++) {
var b = p[i];
if (!(b[3] == A[n][2] && b[4] == A[n][3] || b[4] == A[n][2] && b[3] == A[n][3])) continue;
if (b[7] == null) b[7] = "";
if (b[8] == null) b[8] = "";
bg = (bg == "ts1") ? "ts2" : "ts1";
html.push("");
html.push("" + b[0] + " ");
html.push("" + b[2] + " ");
if (b[3] == A[n][2]) //主场
{
html.push("" + A[n][4 + Config.language] + " ");
html.push("" + b[5] + "-" + b[6] + " ");
html.push("" + A[n][7 + Config.language] + " ");
html.push("" + b[7] + "-" + b[8] + " ");
html.push("" + Goal2GoalCn(b[9]) + " ");
if (b[5] - b[9] > b[6]) { html.push("赢 "); win++; }
if (b[5] - b[9] == b[6]) { html.push("走 "); standoff++ }
if (b[5] - b[9] < b[6]) html.push("输 ");
if (b[5] > b[6]) html.push("胜 ");
if (b[5] == b[6]) html.push("平 ");
if (b[5] < b[6]) html.push("负 ");
if (b[5] > b[6]) victoryNum++;
}
else //客场
{
html.push("" + A[n][7 + Config.language] + " ");
html.push("" + b[5] + "-" + b[6] + " ");
html.push("" + A[n][4 + Config.language] + " ");
html.push("" + b[7] + "-" + b[8] + " ");
html.push("" + Goal2GoalCn(b[9]) + " ");
if (b[5] - b[9] < b[6]) { html.push("赢 "); win++; }
if (b[5] - b[9] == b[6]) { html.push("走 "); standoff++ }
if (b[5] - b[9] > b[6]) html.push("输 ");
if (b[5] < b[6]) html.push("胜 ");
if (b[5] == b[6]) html.push("平 ");
if (b[5] > b[6]) html.push("负 ");
if (b[5] < b[6]) victoryNum++;
}
if (b[5] + b[6] > 2.5) {
html.push("大 ");
bigNum++;
}
else
html.push("小 ");
if ((b[5] + b[6]) % 2 == 1) {
html.push("单 ");
singleNum++;
}
else
html.push("双 ");
html.push(" ");
j++;
}
if (j > 0) {
if (j - standoff > 0)
win1 = Math.round(win / (j - standoff) * 1000) / 10;
else
win1 = "0";
html.push("最近[ " + j + " ]场, 胜率:" + Math.round(victoryNum / j * 1000) / 10 + "% 让胜率:" + win1 + "% 大球:" + Math.round(bigNum / j * 1000) / 10 + "% 单:" + Math.round(singleNum / j * 1000) / 10 + "% ");
}
html.push("
");
var obj = document.getElementById('winScore');
var postPk = getElementPos("tr1_" + scheduleId);
var contentHeight = j * 20;
var scrollTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
var oddsY = postPk.y - scrollTop;
if (scrollTop == 0) {
var pos = getElementPos("sound");
if (event.clientY - pos.y < contentHeight)
obj.style.top = postPk.y + "px";
else
obj.style.top = (oddsY - contentHeight + 10) + "px";
}
else {
if (event.clientY < obj.clientHeight)
obj.style.top = postPk.y + "px";
else
obj.style.top = (postPk.y - contentHeight + 10) + "px";
}
obj.style.left = (document.body.clientWidth / 2 - 455) + "px";
if (j == 0) {
document.getElementById('winScore').style.left = (document.body.clientWidth / 2 - 50) + "px";
html = [];
html.push("无对战记录
");
}
document.getElementById("winScore").innerHTML = html.join("");
$("#winScore").show();
} catch (e) { }
}
function showpaulu(n, event) {
if (Config.vs == 0) return;
if (typeof (p) == "undefined" || Math.floor((new Date() - loadpanluFileTime) / 600) > 60) {
LoadPanluFile(function () {
loadPanluCallback(n, event);
});
}
else {
loadPanluCallback(n, event);
}
}
function check() {
if (oldUpdateTime == lastUpdateTime && oldUpdateTime != "") {
if (confirm("由于程序忙,或其他网络问题,你已经和服务器断开连接超过 5 分钟,是否要重新连接观看比分?")) window.location.reload();
}
oldUpdateTime = lastUpdateTime;
window.setTimeout("check()", 300000);
}
function LoadLiveFile() {
function loadLive() {
var allDate = document.getElementById("allDate");
var s = document.createElement("script");
s.type = "text/javascript";
if (orderby == "league")
s.src = "data/bf1.js?" + Date.parse(new Date());
else
s.src = "data/bf.js?" + Date.parse(new Date());
allDate.removeChild(allDate.firstChild);
allDate.appendChild(s, "script");
window.clearTimeout(LoadLiveFileTimer);
LoadLiveFileTimer = window.setTimeout("LoadLiveFile()", 3600 * 1000);
}
if (Config.ifAlias)
LoadAliasFile(function () { loadLive() });
else
loadLive()
}
function LoadDetailFile(func) {
loadDetailFileTime = new Date();
$.ajax({
url: "/data/detail.js?" + Date.parse(new Date()),
type: 'Get',
cache: false,
datatype: 'script',
mimeType: "application/javascript; charset=GB2312",
success: function () {
if (typeof (func) == "function")
func();
}
});
}
function LoadPanluFile(func) {
loadpanluFileTime = new Date();
$.ajax({
url: "/data/panlu.js?" + Date.parse(new Date()),
type: 'Get',
cache: false,
datatype: 'script',
mimeType: "application/javascript; charset=GB2312",
success: function () {
if (typeof (func) == "function")
func();
}
});
}
function LoadAliasFile(func) {
$.ajax({
url: "data/alias2.js?" + parseInt(Date.parse(new Date()) / (1000 * 60 * 60)),
type: 'Get',
datatype: 'script',
success: function () {
if (typeof (func) == "function")
func();
}
});
}
function LoadSbDetailFile(func) {
if (strCompanyID.indexOf("," + Config.companyID + ",") != -1) {
loadSbDetailTime = new Date();
var _url = "";
if (Config.companyID == "3")
_url = "data/sbOddsData.js?" + Date.parse(new Date());
else
_url = "data/runOddsData_" + Config.companyID + ".js?" + Date.parse(new Date());
$.ajax({
url: _url,
type: 'Get',
datatype: 'script',
success: function () {
if (typeof (func) == "function")
func();
}
});
}
}
function SetLanguage(l) {
var oName = "alias";
if (l == oName) {
if (Config.ifAlias)
return;
$("#Language" + Config.language).removeClass("selected");
Config.ifAlias = 1;
Config.language = 0;
} else {
if (Config.ifAlias) {
$("#Language" + oName).removeClass("selected");
Config.ifAlias = 0;
}
else if (Config.language == l)
return;
$("#Language" + Config.language).removeClass("selected");
Config.language = l;
}
$("#Language" + l).addClass("selected");
LoadLiveFile();
Config.writeCookie();
}
function showOrHideGoalSel(companyID) {
if (companyID == 3)
$(".selGoal").show();
else {
$(".selGoal").hide();
checkGoalInput(1);
}
}
function SetCompany(id) {
$("#selCompany").val(id);
Config.companyID = id;
showOrHideGoalSel(id);
sData = new Object();
LoadSbDetailFile();
LoadLiveFile();
Config.writeCookie();
}
$("#selCompany").change(function () {
var companyId = $("#selCompany").val();
SetCompany(companyId);
})
function CheckSound() {
if (document.getElementById("soundCheck").checked)
Config.sound = parseInt(document.getElementById("sound").value);
else Config.sound = -1;
audioHelper.init("flashsound", flash_sound[Config.sound]);
Config.writeCookie();
audioHelper.play("flashsound");
}
function CheckWindow() {
if (document.getElementById("windowCheck").checked) Config.winLocation = parseInt(document.getElementById("winLocation").value)
else Config.winLocation = -1;
Config.writeCookie();
}
function CheckExplain() {
if (document.getElementById("explain").checked) Config.explain = 1;
else Config.explain = 0;
Config.writeCookie();
ShowExplain();
}
function ShowExplain() {
var value = "none";
if (Config.explain == 1) value = "";
for (var i = 0; i < matchcount; i++)
if (A[i][1] != -1 && A[i][27] + A[i][32] != "") document.getElementById("tr2_" + A[i][0]).style.display = value;
}
function CheckTeamRank() {
if (document.getElementById("rank").checked) Config.rank = 1;
else Config.rank = 0;
Config.writeCookie();
ShowTeamRank();
}
function ShowTeamRank() {
for (var i = 0; i < matchcount; i++) {
if (A[i][1] == -1) continue;
if (A[i][21] != "") document.getElementById("horder_" + A[i][0]).innerHTML = (Config.rank == 1 ? "[" + A[i][21] + "] " : "");
if (A[i][22] != "") document.getElementById("gorder_" + A[i][0]).innerHTML = (Config.rank == 1 ? "[" + A[i][22] + "] " : "");
}
}
function CheckFunction(obj) {
if (document.getElementById(obj).checked) eval("Config." + obj + "=1");
else eval("Config." + obj + "=0");
Config.writeCookie();
if (obj == "yp" || obj == "op" || obj == "dx") {
LoadLiveFile();
}
if (obj == "redSound" && document.getElementById(obj).checked) {
audioHelper.play("Sound_Red");
}
if (obj == "oddsSound") {
audioHelper.play("oddsFlashSound");
}
}
function changeFontSize(obj, size) {
Config.fontsize = size;
document.getElementById(obj).style.fontSize = size + "px";
Config.writeCookie();
}
//赛程赛果
function ChangeSchedule(id, t) {
var script = document.getElementById("scriptScsg");
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "//info.8bo8.com/AjaxLeague.aspx?SclassID=" + id + "&SclassType=" + (t == 1 ? "s" : "c") + "&v=" + Date.parse(new Date());
script.removeChild(script.firstChild);
script.appendChild(s, "script");
}
function ChangeSchedule2(id, t, groupid) {
var script = document.getElementById("scriptScsg");
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "//info.8bo8.com/AjaxLeague.aspx?SclassID=" + id + "&SclassType=" + (t == 1 ? "s" : "c") + "&SubSclassID=" + groupid + "&v=" + Date.parse(new Date());
script.removeChild(script.firstChild);
script.appendChild(s, "script");
}
//积分
function ChangeScore(file) {
var script = document.getElementById("scriptScore");
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "//info.8bo8.com/IndexPage/score/" + file + ".js?" + Date.parse(new Date());
script.removeChild(script.firstChild);
script.appendChild(s, "script");
}
function ChangeJS(sclassID, kind) {
sclassID2 = sclassID;
kind2 = kind;
ChangeSchedule(sclassID, kind);
}
function showLeagueList(type) {
if (type == 1) {
var leaguehtml = new Array();
leaguehtml.push("");
var c = -1;
for (var i = 0; i < sclasscount; i++) {
if (B[i][8] > 0 && B[i][7] != "") {
if (++c % 10 == 0) leaguehtml.push("");
leaguehtml.push("" + B[i][1 + Config.language] + " ");
if (c % 10 == 9) leaguehtml.push(" ");
if (c == 0) ChangeJS(B[i][0], B[i][6]);
}
}
leaguehtml.push("
");
document.getElementById("leagueList").innerHTML = leaguehtml.join("");
document.getElementById("leagueList").style.display = "";
document.getElementById("hotLeague").style.display = "none";
document.getElementById("hotCup").style.display = "none";
document.getElementById("LeagueKind1").className = "m_on";
document.getElementById("LeagueKind2").className = "m_off";
document.getElementById("LeagueKind3").className = "m_off";
}
if (type == 2) {
document.getElementById("leagueList").style.display = "none";
document.getElementById("hotLeague").style.display = "";
document.getElementById("hotCup").style.display = "none";
document.getElementById("LeagueKind1").className = "m_off";
document.getElementById("LeagueKind2").className = "m_on";
document.getElementById("LeagueKind3").className = "m_off";
ChangeJS(36, 1);
}
if (type == 3) {
document.getElementById("leagueList").style.display = "none";
document.getElementById("hotLeague").style.display = "none";
document.getElementById("hotCup").style.display = "";
document.getElementById("LeagueKind1").className = "m_off";
document.getElementById("LeagueKind2").className = "m_off";
document.getElementById("LeagueKind3").className = "m_on";
ChangeJS(75, 2);
}
}
function SetLevel(m) {
if (filterHelper.oddsLevel == m)
m = -1;
$("#liZC1,#liZC2,#liZC3,#liZC").css("color", "#333");
if (m > 0)
$("#liZC" + m).css("color", "red");
else {
$("#liZC").css("color", m > -1 ? "red" : "#333");
}
if (m > -1)
$("#liZC").addClass("selected");
else $("#liZC").removeClass("selected");
filterHelper.updateOddsLevel(m);
SetJcNo(m);
filterHelper.UpdateLetters();
}
function SetJcNo(m) {
var txtUrl = "";
if (m == 3) {
txtUrl = "Schedule_0_3.txt";
}
else if (m == 2) {
txtUrl = "Schedule_0_4.txt";
}
else if (m == 1) {
txtUrl = "Schedule_0_2.txt";
}
if (m == 1 || m == 2 || m == 3) {
GetTxt("/data/" + txtUrl + "?t=" + Date.parse(new Date()), function (data) {
var arr = data.split("$$");
if (arr.length >= 2 && !!arr[1]) {
var sches = arr[2].split("!");
for (var i = 0; i < sches.length; i++) {
if (!!sches[i]) {
var items = sches[i].split("^");
$("#jc_" + items[0]).html(" " + items[16]);
}
}
}
});
}
else {
for (var i = 0; i < A.length; i++) {
$("#jc_" + A[i][0]).text('');
}
}
}
function makeGoalTable(t) {
document.getElementById("selectGoals_div").style.display = "";
var sC = (Config.language == 1 ? "沒開" : "没开");
function showGoal(goal, hashObj, t) {
if (!!goal) {
var goalObj = hashObj.get(goal);
var ifShow = filterHelper.ifFromHash((t == 0 ? filterHelper.hashLetgoal : filterHelper.hashTotalgoal), goal);
var str = '
';
var strGoal = (goal == "NaN" ? sC : (t == 0 ? Goal2GoalCn(goal).replace("受", "* ") : Goal2GoalCn2(goal)));
return str + '' + strGoal + '[' + goalObj.length + '] ';
}
else return "";
}
var str = '';
if (t == 0 || t == 1) {
var hashObj = (t == 0 ? filterHelper.letGoal : filterHelper.totalGoal);
var arrKey = hashObj.keys().sort();
for (var i = 0; i < arrKey.length; i++) {
str += '';
str += showGoal(arrKey[i], hashObj, t);
str += '' + (arrKey[i] != sC ? '' + (Config.language == 1 ? "同初指" : "同初指") + ' ' : '') + ' ';
str += '' + (arrKey[i] != sC ? '' + (Config.language == 1 ? "同終指" : "同终指") + ' ' : '') + ' ';
str += '' + (arrKey[i] != sC ? '' + (Config.language == 1 ? "初指終指相同" : "初指终指相同") + ' ' : '') + ' ';
str += ' ';
}
}
else {
var i = 0;
var hasData = false;
var hashLetGoal = filterHelper.letGoal, hashTotalGoal = filterHelper.totalGoal;
var lKey = hashLetGoal.keys().sort();
var tKey = hashTotalGoal.keys().sort();
do {
var html = showGoal(lKey[i], hashLetGoal, 0) + showGoal(tKey[i], hashTotalGoal, 1);
if (hasData = (html.length > 0)) {
str += '';
str += html;
str += ' ';
}
i++;
}
while (hasData);
}
str += '
';
document.getElementById("goalTable").innerHTML = str;
oldLetBig = t;
}
function showOrHiddenSche(arrValue, ifShow) {
var schID = arrValue[0];
if ($("#tr1_" + schID).is(":visible") != ifShow) {
var doms = $("#tr1_" + schID + (arrValue[27] + arrValue[32] != "" ? ",#tr2_" + schID : "") + (flashScheduleIDs != "" && parseInt(flashScheduleIDs) == arrValue[0] && flashData.scheduleList.items.length > 0 ? ",#tr3_" + schID : ""));
(ifShow ? doms.show() : doms.hide());
return true;
} else return false;
}
function checkGoalInput(t1) {
$("#goalTable input:checkbox[name=goalType]").each(function (i) {
var node = this;
var value = filterHelper.getGoalValue(node.value);
var t = $(node).attr("data-type");
var oldChecked = node.checked;
if (t1 == 1)
node.checked = true; //全选
else if (t1 == 2)
node.checked = !oldChecked; //反选
if (oldChecked != node.checked) {
if (t == 0)
filterHelper.updateLetgoal(value, node.checked);
else
filterHelper.updateTotalgoal(value, node.checked);
}
});
}
function hiddenGoalData(node) {
var value = node.value;
var isShow = node.checked;
var t = $(node).attr("data-type");
if (t == 0)
filterHelper.updateLetgoal(value, isShow);
else
filterHelper.updateTotalgoal(value, isShow);
}
function addConcern(matchIndex) {
var schid = A[matchIndex][0];
if (concernIds.contains(schid))
return;
concernIds.push(schid);
writeCookie("concernIds", concernIds);
var tr = document.getElementById("tr1_" + A[matchIndex][0]);
tr.cells[14].innerHTML = tr.cells[14].innerHTML.replace("addConcern", "deleteConcern").replace("setTopOff", "setTopOn").replace("添加", "取消");
var TTime = new Date();
var isChange = false;
var nt2 = getMatchTime(A[matchIndex]);;
for (var i = 1; i < matchcount; i++) {
if (concernIds.contains(A[i][0])) {
if (A[i][13] > 0) {
var ot2 = getMatchTime(A[i]);
if (ot2 > nt2) {
isChange = true;
MovePlace(A[i][0], A[matchIndex][0]);
break;
}
}
}
}
if (!isChange)
MovePlace(0, A[matchIndex][0]);
}
function deleteConcern(matchIndex) {
var schid = A[matchIndex][0];
if (!concernIds.contains(schid)) return;
var i = 0;
for (; i < concernIds.length; i++) {
if (concernIds[i] == schid)
break;
}
doDeleteOneConcern(matchIndex);
concernIds.splice(i, 1);
writeCookie("concernIds", concernIds);
}
function deleteAllConcern() {
if (!!concernIds && concernIds.length>0) {
for (var i = 0; i < concernIds.length; i++) {
var schid = concernIds[i];
var trobj = $("#tr1_" + schid);
var matchIndex = trobj.attr("index");
doDeleteOneConcern(matchIndex);
}
concernIds = [];
writeCookie("concernIds", concernIds);
}
}
function doDeleteOneConcern(matchIndex) {
var tr = document.getElementById("tr1_" + A[matchIndex][0]);
var conTdObj = $(tr).find("td.Concern");
if (conTdObj.length > 0)
conTdObj[0].innerHTML = conTdObj[0].innerHTML.replace("deleteConcern", "addConcern").replace("setTopOn", "setTopOff").replace("取消", "添加");
var TTime = new Date();
var isChange = false;
var nt2 = getMatchTime(A[matchIndex]);
var matchState = A[matchIndex][12];
var schid = A[matchIndex][0]
var sameStateID = -1;
for (var i = 0; i < matchcount; i++) {
var tempSchid = A[i][0];
var tempState = A[i][12];
if (tempSchid < 1 || concernIds.contains(tempSchid))
continue;
if ((matchState == 0 && tempState == 0) || matchState * tempState > 0) {
sameStateID = tempSchid;
var tempTime = getMatchTime(A[i]);
isChange = tempTime > nt2 || (tempTime - nt2 == 0 && i > matchIndex);
}
else if (sameStateID < 0 && matchState > tempState)
isChange = true;
if (isChange) {
MovePlace(tempSchid, schid);
break;
}
}
if (!isChange) {
if (sameStateID == -1)
MovePlace(-1, schid, "BeforeEnd");
else MovePlace(sameStateID, schid, "afterEnd");
}
}
$("#DivLeague").on("click", ".top", function () {
var thisObj = $(this);
var sclassID = parseInt(thisObj.parents("li").find("[type=checkbox]").val());
var hasTop = thisObj.hasClass("on");
for (var i = 0; i < matchcount; i++) {
var tempSclassID = A[i][1];
if (sclassID == tempSclassID) {
if (hasTop)
deleteConcern(i);
else addConcern(i);
}
}
if (hasTop) {
thisObj.removeClass("on");
}
else {
thisObj.addClass("on");
}
stopBubble();
});
function removeSclassConcern() {//取消联赛置顶
var arr = concernIds;
for (var i = 0; i < arr.length; i++) {
var schID = arr[i];
var v = filterHelper.schs.get(schID);
if (typeof (v) == "undefined")
continue;
doDeleteOneConcern(v.index);
}
$(".top.on").removeClass("on");
concernIds = [];
writeCookie("concernIds", concernIds);
}
function getMatchTime(match) {
var dt = match[10].split(":");
var nt = match[11].split(",");
var reTime = new Date(nt[0], nt[1], nt[2], dt[0], dt[1], 0);
if (match[12] != 0) {
if (reTime > new Date())
reTime.setDate(reTime.getDate() - 1);
if (reTime > new Date())
reTime.setFullYear(reTime.getFullYear() - 1);
}
return reTime;
}
function MovePlace(newPos, oldPos, sWhere) {
try {
if (typeof (sWhere) === "undefined")
sWhere = "BeforeBegin";
var oEle = null;
if (newPos == 0) {
oEle = document.getElementById("tr_" + newPos);
}
else if (newPos > 0) {
oEle = document.getElementById("tr1_" + newPos);
}
else if (newPos == -1) {
oEle = document.getElementById("tr_0").parentElement;
}
if (oEle != null) {
var arr = [document.getElementById("tr1_" + oldPos), document.getElementById("tr2_" + oldPos)];
if (!!document.getElementById("tr3_" + oldPos))
arr.push(document.getElementById("tr3_" + oldPos));
if (sWhere.toLowerCase().indexOf("after") == 0)
arr.reverse();
for (var i = 0; i < arr.length; i++)
oEle.insertAdjacentElement(sWhere, arr[i]);
}
changeTxtAdLocation();
}
catch (e) {
}
}
//竞猜推荐
function showRecommend() {
var defer = $.Deferred();
$.ajax({
type: "GET", url: "/data/GetRecommend.aspx", dataType: "json", async: true, cache: true, success: function (data) {
var arr = new Array();
for (var i = 0; i < data.length; i++) {
var node = $("#recommend_" + data[i]);
if (node.length > 0 && node.is(':hidden')) { //如果node是隐藏的则显示node元素,否则隐藏
arr.push(node);
}
}
defer.resolve(arr);
}
});
return defer.promise();
}
$("#conditionBtn").click(function () {
filterHelper.getConfition(function () {
var titleCn = new Array("连胜场次", "连负场次", "连续让球胜", "连续让球负", "连续大球", "连续小球", "近20场让胜率", "近20场让负率", "近20场大球率", "近20场小球率");
var titleBig = new Array("連勝場次", "連負場次", "連續讓球勝", "連續讓球負", "連續大球", "連續小球", "近20場讓勝率", "近20場讓負率", "近20場大球率", "近20場小球率");
var numTtitle = new Array("3~4", "5~6", "7+");
var perTitle = new Array("60~65", "65~70", "75+");
var title = Config.language == 1 ? titleBig : titleCn;
var choiseNum = 0;
var conditionHtml = "";
for (var i = 0; i < title.length; i++) {
var subTitle = i < 6 ? numTtitle : perTitle;
conditionHtml += '';
conditionHtml += '' + title[i] + ' ';
for (var j = 0; j < subTitle.length; j++) {
var className = "condition";
var id = i + "_" + j;
var arr = filterHelper.conditionHash.get(id);
if (arr.length > 0) {
var temNum = 0;
$(arr).each(function (i, v) {
if (v.ifShowNotCondition && v.sclass.ifShow && v.country.ifShow) temNum++;
});
if (temNum > 0) {
className += " btn";
if (filterHelper.selCondition != "" && filterHelper.selCondition == id) {
className += " on";
choiseNum = temNum;
}
}
}
conditionHtml += '' + subTitle[j] + ' ';
}
conditionHtml += '
';
}
$("#filterList").html(conditionHtml);
$("#conditionNum").html("[" + choiseNum + "]");
showPopupBox("filterBox");
});
});
$("#filterBox").on("click", ".btn", function () {
var _this = $(this);
if (!_this.hasClass("on")) {
$("#filterList .btn.on").removeClass("on");
_this.addClass("on");
var arr = filterHelper.conditionHash.get(_this.attr("data-condition"));
var temNum = 0;
$(arr).each(function (i, v) {
if (v.ifShowNotCondition && v.sclass.ifShow && v.country.ifShow) temNum++;
});
$("#conditionNum").html("[" + temNum + "]");
}
else {
_this.removeClass("on");
$("#conditionNum").html("[0]");
}
});
$("#filterBox .ok").click(function () {
var selObj = $("#filterList .btn.on");
var selCondition = "";
if (selObj.length > 0)
selCondition = selObj.attr("data-condition");
filterHelper.updateCondition(selCondition);
showPopupBox("filterBox", true);
});
function showPopupBox(popName, ifHide) {
if (ifHide) {
MM_showHideLayers(popName, '', 'hide');
if (popName == "DivLeague" || popName == "DivCountry") {
offkeyCode();
}
}
else {
var pops = ["filterBox", "DivLeague", "DivCountry", "goalDiv", "DivFunction"];
if ($.inArray(popName, pops) > -1) {
var arr = [];
$(pops).each(function (i, v) {
arr.push(v, "", popName == v ? "show" : "hide");
});
MM_showHideLayers.apply(null, arr);
if (popName == "DivLeague" || popName == "DivCountry") {
bindkeyCode(popName);
}
}
else {
MM_showHideLayers(popName, '', 'show');
}
}
}
function setPureScore() {
writeCookie("is2in1", "0");
location.href = "index.aspx";
}
writeCookie("is2in1", "1")
Config.getCookie("2in1");
if (Config.companyID != 1 && Config.companyID != 3 && Config.companyID != 4 && Config.companyID != 8 && Config.companyID != 12 && Config.companyID != 17 && Config.companyID != 23 && Config.companyID != 24 && Config.companyID != 31) Config.companyID = 3;
$("#selCompany").val(Config.companyID);
showOrHideGoalSel(Config.companyID);
orderby = getCookie("orderby");
if (!orderby) orderby = "time";
audioHelper.init("flashsound", flash_sound[Config.sound]);
audioHelper.init("oddsFlashSound", flash_sound[4]);
audioHelper.init("Sound_Red", flash_sound[5]);
if (Config.fontsize != 12 && Config.fontsize > 0) document.getElementById("ScoreDiv").style.fontSize = Config.fontsize + "px";
$("#cb_ifShowCorn").click(function () {
Config.ifShowCorn = this.checked ? 1 : 0;
Config.writeCookie();
});
var flashJs = "glflash2.js";
if (Config.IsIE) {
flashJs = "glflash.js";
}
$.getScript("/script/" + flashJs);
$(document).ready(
function () {
LoadLiveFile();
}
)
function changeTxtAdLocation() {
if (filterHelper.needChangeSchNum > 0)
return;
var trs = $("#table_live tr:visible");
var lastIndex = 0;
var arr = [];
var arrAd = [];
var lastObj = null;
trs.each(function (i, v) {
var thisObj = $(v);
if (thisObj.hasClass("Leaguestitle"))
return;
if (lastObj == null) {
if (thisObj.hasClass("ki1"))
lastObj = thisObj;
return;
}
if (thisObj.hasClass("showTxtAd"))
arrAd.push(thisObj);
else {
if (typeof (thisObj.attr("index")) !== "undefined" && !lastObj.hasClass("ki1"))
arr.push(lastObj);
lastObj = thisObj;
}
});
if (lastObj != null && !lastObj.hasClass("ki1"))
arr.push(lastObj);
var advertTool = new Advert(arr.length, 0);
var adIndex = 0;
for (var i = 0; i < arr.length; i++) {
var html = [];
advertTool.Show(html, i);
if (html.length > 0)
arrAd[adIndex++].insertAfter(arr[i]);
}
if (lastObj != null)
while (adIndex < arrAd.length) {
arrAd[adIndex++].insertAfter(lastObj);
}
}