var company = new Array(32);
company[1] = "澳门,澳門";
company[2] = "易胜博,易勝博";
company[3] = "皇冠,皇冠";
company[8] = "BET365,BET365";
company[9] = "韦德,韋德";
company[31] = "利记,利記";
var zXml = {
useActiveX: (typeof ActiveXObject != "undefined"),
useXmlHttp: (typeof XMLHttpRequest != "undefined")
};
zXml.ARR_XMLHTTP_VERS = ["MSXML2.XmlHttp.6.0", "MSXML2.XmlHttp.3.0"];
function zXmlHttp() { }
zXmlHttp.createRequest = function () {
if (zXml.useXmlHttp) return new XMLHttpRequest();
if (zXml.useActiveX) //IE < 7.0 = use ActiveX
{
if (!zXml.XMLHTTP_VER) {
for (var i = 0; i < zXml.ARR_XMLHTTP_VERS.length; i++) {
try {
new ActiveXObject(zXml.ARR_XMLHTTP_VERS[i]);
zXml.XMLHTTP_VER = zXml.ARR_XMLHTTP_VERS[i];
break;
} catch (oError) { }
}
}
if (zXml.XMLHTTP_VER) return new ActiveXObject(zXml.XMLHTTP_VER);
}
alert("Sorry,XML object unsupported by your computer,please setup XML object or change explorer.");
};
function Hashtable() {
this._hash = new Object();
this.add = function (key, value) {
if (typeof (key) != "undefined") {
this._hash[key] = typeof (value) == "undefined" ? null : value;
return true;
}
else
return false;
}
this.remove = function (key) { delete this._hash[key]; }
this.keys = function () {
var keys = new Array();
for (var key in this._hash) {
keys.push(key);
}
return keys;
}
this.count = function () { var i = 0; for (var k in this._hash) { i++; } return i; }
this.items = function (key) {
return this._hash[key];
}
this.contains = function (key) {
return typeof (this._hash[key]) != "undefined";
}
this.clear = function () { for (var k in this._hash) { delete this._hash[k]; } }
}
var hsOddsPostion = new Hashtable();
function BgColor(odds1, odds2) {
var bg = "normal";
if (odds1 < odds2) bg = "up";
if (odds1 > odds2) bg = "down";
return bg;
}
function TdBgColor(odds1, odds2) {
var bg = "";
if (odds1 < odds2) bg = "#ff8888";
if (odds1 > odds2) bg = "#88ff88";
return bg;
}
function TdBgColorOld(odds1, odds2) {
var bg = "";
if (odds1 < odds2) bg = "#FFB0B0";
if (odds1 > odds2) bg = "#00FF44";
return bg;
}
var multiSCIDList = "", concernId = "_";
var week = new Array("(日)", "(一)", "(二)", "(三)", "(四)", "(五)", "(六)");
var state_ch = new Array(56);
state_ch[0] = "推迟,推迟,Postponed";
state_ch[1] = "取消,取消,Cancel";
state_ch[2] = "中断,中断,Pause";
state_ch[3] = "待定,待定,Undecided";
state_ch[4] = "完,完,FT";
state_ch[5] = ",,";
state_ch[6] = "第1节,第1節,1st";
state_ch[7] = "第2节,第2節,2nd";
state_ch[8] = "第3节,第3節,3rd";
state_ch[9] = "第4节,第4節,4th";
state_ch[10] = "第1'OT,第1'OT,1'OT";
state_ch[11] = "第2'OT,第2'OT,2'OT";
state_ch[12] = "第3'OT,第3'OT,3'OT";
state_ch[15] = "上半场,下半場,1st";
state_ch[16] = "下半场,下半場,2nd";
state_ch[17] = "下半场,下半場,2nd";
state_ch[55] = "中场,中場,Half";
var riseColor = "#FFB0B0";
var fallColor = "#00FF44";
var changePkColor = "#D06666";
var matchType = 0;
if (pageType == 1 || pageType == 3) {
var strDataType = getCookie("datatype");
if (strDataType == null || strDataType == "") datatype = 2;
else
datatype = parseInt(strDataType);
if (pageType == 1) {
if (datatype == 2)
document.getElementById("SortBy2").className = "on btn";
else
document.getElementById("SortBy").className = "on btn";
}
else if (pageType == 3) {
if (datatype == 2)
document.getElementById("SortBy").value = (lang == 0 ? "按时间排序" : "按時間排序");
else
document.getElementById("SortBy").value = (lang == 0 ? "按联赛排序" : "按聯賽排序");
}
}
var countId = "1,2,5"; //有统计的联赛
var qbId = "[1],[5],[34],[2],[42],[10]"; //有情报的联赛
var nofityTimer = "";
var strDataList = "";
String.prototype.trim = function () {
return this.replace(/(^\s*)|(\s*$)/g, "");
}
function EuropeOdds2(ID) {
var theURL = 'http://nba.win007.com/1x2/oddslist/' + ID + '.htm';
window.open(theURL, '', '');
}
function AsianOdds2(ID) {
var theURL = 'http://nba.win007.com/odds/AsianOdds_n.aspx?id=' + ID;
window.open(theURL, '', '');
}
function AsianOdds3(ID, CId) {
var theURL = 'http://nba.win007.com/odds/Handicap.aspx?ScheId=' + ID + "&companyId=" + CId;
window.open(theURL, '', '');
}
function analysis2(ID) {
var theURL = 'http://nba.win007.com/analysis/' + ID + '.htm';
window.open(theURL, '', '');
}
function dxq2(ID) {
var theURL = 'http://nba.win007.com/odds/OverDown_n.aspx?ID=' + ID;
window.open(theURL, '', '');
}
function dxq3(ID, CId) {
var theURL = 'http://nba.win007.com/odds/OverDownChart.aspx?scheId=' + ID + "&companyId=" + CId;
window.open(theURL, '', '');
}
function qb2(ID) {
// window.open('http://article.win007.com/UserWeb/LiveBasketball.aspx?ID=' + ID, '', '');
window.open('http://guess2.win007.com/tuijian/lq/' + ID + '.html', '', '');
}
function oddsDetail2(ID, cId, num) {
num = typeof (num) != "undefined" ? num : 1;
window.open("http://nba.win007.com/odds/Handicap.aspx?ScheId=" + ID + "&companyId=" + cId + "&num=" + num, "", "");
}
function Panlu2(ID) {
var theURL = 'http://bf.win007.com/panlu2/' + ID + '.htm';
window.open(theURL, '', '');
}
//定义namespace
var _glodds = new Object();
//公共变量
_glodds.SplitDomain = "$";
_glodds.SplitRecord = ";";
_glodds.SplitColumn = ",";
//通用列表类
_glodds.List = function () {
this.items = new Array();
this.keys = new Object();
this.Add = function (key, value) {
if (typeof (key) != "undefined") {
var vv = typeof (value) == "undefined" ? null : value;
var idx = this.keys[key];
if (idx == null) {
idx = this.items.length;
this.keys[key] = idx;
}
this.items[idx] = vv;
}
}
this.Get = function (key) {
var idx = this.keys[key];
if (idx != null)
return this.items[idx];
return null;
}
this.Clear = function () {
for (var k in this.keys) {
delete this.keys[k];
}
delete this.keys;
this.keys = null;
this.keys = new Object();
for (var i = 0; i < this.items.length; i++) {
delete this.items(i);
}
delete this.items;
this.items = null;
this.items = new Array();
}
this.GetMaxNum = function (key) {
var num = 1;
var count = 0;
for (var k in this.keys) {
if (k.indexOf(key) != -1) {
var idx = this.keys[k];
if (idx != null) {
count++;
var item = this.items[idx];
var num2 = parseInt(item.num);
if (num2 > num)
num = num2;
}
else if (count > 0)
break;
}
}
return num;
}
this.getSumNum = function (key) {
var hsNum = new Hashtable2();
var sum = 0;
var count = 0;
for (var k in this.keys) {
if (k.indexOf(key) != -1) {
var arrK = k.split('_');
var companyID = arrK[1];
var idx = this.keys[k];
if (idx != null) {
var item = this.items[idx];
var num2 = parseInt(item.num);
if (hsNum.contains(companyID)) {
var num = parseInt(hsNum.items(companyID));
if (num < num2)
hsNum.add(companyID, num2);
}
else
hsNum.add(companyID, num2);
}
}
}
for (var j = 0; j < hsNum.keys().length; j++) {
count++;
sum += parseInt(hsNum.items(hsNum.keys()[j]));
}
return sum + (SelCompany.length - count);
}
}
//联赛项类
_glodds.League = function (infoStr) {//2,1,#446DAB,美国女子职业篮球联赛,美國女子職業籃球聯賽,WNBA
if (infoStr != '') {
var infoArr = infoStr.split(_glodds.SplitColumn);
this.lId = infoArr[0];
this.kind = infoArr[1]; //1:联赛;2:杯赛
this.color = infoArr[2];
this.cnName = infoArr[3];
//this.trName = infoArr[4];
// this.enName = infoArr[5];
this.matchNum = 0;
this.show = infoArr[4];
this.type = infoArr[5]; //2:二节;4:四节
this.showNum = 0;
this.getName = function () {
return this.cnName;
}
}
}
//比赛项类
_glodds.Match = function (infoStr) {
if (infoStr != '') {
var infoArr = infoStr.split(_glodds.SplitColumn); //102617,167,1315571400000,732,西班牙,西班牙,Spain,,2079,塞尔维亚,塞爾維亞,Serbia,,0,,,,0;
this.mId = infoArr[0].trim();
this.lId = infoArr[1].trim();
// this.time = new Date(parseInt(infoArr[2]));
this.time = AmountTimeDiff(infoArr[2]);
var d = AmountTimeDiff(infoArr[2]);
d.setTime(d.getTime() - 8 * 3600 * 1000); //方便当天4点后的显示到前一天的页面
this.t1Id = infoArr[3];
this.t1CnName = infoArr[4];
this.t1TrName = infoArr[5];
this.t1EnName = infoArr[6];
this.t1Position = infoArr[7] != "" ? "[" + infoArr[7] + "]" : "";
this.t2Id = infoArr[8];
this.t2CnName = infoArr[9];
this.t2TrName = infoArr[10];
this.t2EnName = infoArr[11];
this.t2Position = infoArr[12] != "" ? "[" + infoArr[12] + "]" : "";
this.state = infoArr[13] != "" ? infoArr[13] : "0";
this.homeScore = infoArr[14];
this.guestScore = infoArr[15];
this.tv = infoArr[16];
this.flag = "";
if (infoArr[17] == "1") this.flag = "(中)";
this.haslottery = infoArr[18];
this.getT1Name = function () {
if (lang == "2")
return this.t1EnName;
else if (lang == "1")
return this.t1TrName;
else
return this.t1CnName;
}
this.getT2Name = function () {
if (lang == "2")
return this.t2EnName;
else if (lang == "1")
return this.t2TrName;
else
return this.t2CnName;
}
}
}
//亚赔信息
_glodds.OddsAsian = function (infoStr) {
if (infoStr != '') {
var infoArr = infoStr.split(_glodds.SplitColumn); //100028,1,4.5,0.85,0.85,4.5,0.95,0.75,,,;
this.mId = infoArr[0].toString().trim();
this.cId = infoArr[1].trim();
this.goalF = infoArr[2];
this.homeF = infoArr[3];
this.awayF = infoArr[4];
this.goal = infoArr[5];//开场后停止更新
this.home = infoArr[6];
this.away = infoArr[7];
this.goalR = infoArr[8]; //滚球
this.homeR = infoArr[9];
this.awayR = infoArr[10];
this.num = infoArr[11]!=null ? infoArr[11] : 1;
this.maxNum = infoArr[12] != null ? infoArr[12] : 1;
this.zoudi = false;
}
}
//欧赔信息
_glodds.Odds1x2 = function (infoStr) {
if (infoStr != '') {
var infoArr = infoStr.split(_glodds.SplitColumn); //209092,8,0.5,0.95,0.95,0.5,1.025,0.875
this.mId = infoArr[0].trim();
this.cId = infoArr[1].trim();
this.hwF = infoArr[2];
this.awF = infoArr[3];
this.hw = infoArr[4];
this.aw = infoArr[5];
this.num = infoArr[6];
}
}
//大小赔率信息
_glodds.OddsOU = function (infoStr) {
if (infoStr != '') {
var infoArr = infoStr.split(_glodds.SplitColumn); //102643,12,161.5,0.909,0.909,160.5,1.00,0.80,,,
this.mId = infoArr[0].trim();
this.cId = infoArr[1].trim();
this.goalF = infoArr[2];
this.overF = infoArr[3];
this.underF = infoArr[4];
this.goal = infoArr[5];//开场后停止更新
this.over = infoArr[6];
this.under = infoArr[7];
this.goalR = infoArr[8];//滚球
this.overR = infoArr[9];
this.underR = infoArr[10];
this.num = infoArr[11]!=null ? infoArr[11] : 1;
}
}
var _oddsUitl = new Object();
var matchdata = new Object();
_oddsUitl.getDayStr = function (dt) {
return (dt.getMonth() + 1) + "-" + dt.getDate();
}
_oddsUitl.getTimeStr = function (dt) {
return dt.getHours() + ":" + (dt.getMinutes() < 10 ? "0" : "") + dt.getMinutes();
}
_oddsUitl.getOnlyDate = function (dt) {
return dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate();
}
_oddsUitl.getDtStr = function (dt) {
return (dt.getMonth() + 1) + "-" + dt.getDate() + " " + (dt.getHours() < 10 ? "0" : "") + dt.getHours() + ":" + (dt.getMinutes() < 10 ? "0" : "") + dt.getMinutes();
}
_oddsUitl.getDtStr2 = function (dt) {
return (dt.getHours() < 10 ? "0" : "") + dt.getDate() + "日" + (dt.getHours() < 10 ? "0" : "") + dt.getHours() + ":" + (dt.getMinutes() < 10 ? "0" : "") + dt.getMinutes();
}
_oddsUitl.getDateTimeStr = function (dt) {
return dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate() + " " + (dt.getHours() < 10 ? "0" : "") + dt.getHours() + ":" + (dt.getMinutes() < 10 ? "0" : "") + dt.getMinutes();
}
_oddsUitl.getDate = function (str) {
var p = str.split("-");
return new Date(p[0], parseInt(p[1], 10) - 1, p[2]);
}
function SetLevel(m) {
matchType = m;
LoadData();
}
function SetDataType(t) {
var oldType = datatype;
datatype = t;
if (datatype == 2) {
document.getElementById("SortBy").className = "btn";
document.getElementById("SortBy2").className = "on btn";
}
else {
document.getElementById("SortBy").className = "on btn";
document.getElementById("SortBy2").className = "btn";
}
writeCookie("datatype", datatype);
if (oldType != datatype)
LoadData();
}
var xml1 = zXmlHttp.createRequest();
var xmlBf = zXmlHttp.createRequest();
var oldXML = "", oldBfXML = "";
var isOld = window.location.href.toLocaleLowerCase().indexOf("odds.aspx") != -1;
function getxml() {
try {
xml1.open("get", (isOld ? "http://www.boqbf.com/nba/nbaodd_ch_oddsBsk.html" : "http://www.boqbf.com/nba/nbaodd_ch_oddsBsk_m.html") , true);
if (pageType == 3)
xml1.onreadystatechange = refreshOld;
else
xml1.onreadystatechange = refresh;
xml1.send(null);
} catch (e) { }
window.setTimeout("getxml()", 6000);
}
function refresh() {
if (xml1.readyState != 4 || (xml1.status != 200 && xml1.status != 0)) return;
if (oldXML == xml1.responseText) return
oldXML = xml1.responseText;
var arr;
var changeIDList = ",";
var playFlash = false;
//亚赔
var root = xml1.responseXML.documentElement.childNodes[0];
var playSound = false;
var numTd = "";
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(",");//matchid,companyid,goal,home,away,close,zoudi
if (strCompanyId.indexOf("," + arr[1] + ",") < 0) continue;
var tr = document.getElementById("odds_" + arr[0] + "_" + arr[1] + "_" + arr[5]);
if (tr == null) continue;
oddsItem = matchdata.Odds1List.Get(arr[0] + "_" + arr[1] + "_" + arr[5]);
if (oddsItem == null) { //开盘
if (parseInt(arr[5]) > 1) continue;//页面只自动添加主盘显示,其它盘刷新页面才显示
var tmp = arr[0] + "," + arr[1] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[5] + "," + arr[6];
oddsItem = new _glodds.OddsAsian(tmp);
matchdata.Odds1List.Add(oddsItem.mId + "_" + oddsItem.cId + "_" + oddsItem.num, oddsItem);
tr.cells[2].innerHTML = "
" + oddsItem.homeF + "
" + oddsItem.home + "
";
tr.cells[3].innerHTML = "" + oddsItem.goalF + "
" + oddsItem.goal + "
";
tr.cells[4].innerHTML = "" + oddsItem.awayF + "
" + oddsItem.away + "
";
tr.cells[0].innerHTML = company[arr[1]] + (oddsItem.zoudi == "True" ? "" : "");
if (changeIDList.indexOf("," + arr[0] + "_" + arr[1] + "_" + arr[5] + ",") < 0) changeIDList += arr[0] + "_" + arr[1] + "_" + arr[5] + ",";
}
if (oddsItem.goal != arr[2] || oddsItem.home != arr[3] || oddsItem.away != arr[4]) {
tr.cells[3].style.backgroundColor = TdBgColor(oddsItem.goal, arr[2]);
tr.cells[2].style.backgroundColor = TdBgColor(oddsItem.home, arr[3]);
tr.cells[4].style.backgroundColor = TdBgColor(oddsItem.away, arr[4]);
oddsItem.goal = arr[2];
oddsItem.home = arr[3];
oddsItem.away = arr[4];
tr.cells[2].innerHTML = "" + oddsItem.homeF + "
" + oddsItem.home + "
";
tr.cells[3].innerHTML = "" + oddsItem.goalF + "
" + oddsItem.goal + "
";
tr.cells[4].innerHTML = "" + oddsItem.awayF + "
" + oddsItem.away + "
";
if (changeIDList.indexOf("," + arr[0] + "_" + arr[1] + "_" + arr[5] + ",") < 0) changeIDList += arr[0] + "_" + arr[1] + "_" + arr[5] + ",";
}
if (soundCheck && playFlash == false && document.getElementById("table_" + arr[0]).style.display == "") playFlash = true;
}
//欧赔
root = xml1.responseXML.documentElement.childNodes[1];
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(",");//matchid,companyid,hw,st,gw
//if(!(arr[1] in SelCompany)) continue;
if (strCompanyId.indexOf("," + arr[1] + ",") < 0) continue;
var tr = document.getElementById("odds_" + arr[0] + "_" + arr[1] + "_1");
if (tr == null) continue;
oddsItem = matchdata.Odds2List.Get(arr[0] + "_" + arr[1]);
if (oddsItem == null) { //开盘
var tmp = arr[0] + "," + arr[1] + "," + arr[2] + "," + arr[3] + "," + arr[2] + "," + arr[3];
oddsItem = new _glodds.Odds1x2(tmp);
matchdata.Odds2List.Add(oddsItem.mId + "_" + oddsItem.cId, oddsItem);
tr.cells[5].innerHTML = "" + oddsItem.hwF + "
" + oddsItem.hw + "
";
tr.cells[6].innerHTML = "" + oddsItem.awF + "
" + oddsItem.aw + "
";
if (changeIDList.indexOf("," + arr[0] + "_" + arr[1] + ",") < 0) changeIDList += arr[0] + "_" + arr[1] + ",";
}
if (oddsItem.hw != arr[2] || oddsItem.gw != arr[3]) {
tr.cells[5].style.backgroundColor = TdBgColor(oddsItem.hw, arr[2]);
tr.cells[6].style.backgroundColor = TdBgColor(oddsItem.aw, arr[3]);
oddsItem.hw = arr[2];
oddsItem.aw = arr[3];
tr.cells[5].innerHTML = "" + oddsItem.hwF + "
" + oddsItem.hw + "
";
tr.cells[6].innerHTML = "" + oddsItem.awF + "
" + oddsItem.aw + "
";
if (changeIDList.indexOf("," + arr[0] + "_" + arr[1] + ",") < 0) changeIDList += arr[0] + "_" + arr[1] + ",";
}
if (soundCheck && playFlash == false && document.getElementById("table_" + arr[0]).style.display == "") playFlash = true;
}
//大小
root = xml1.responseXML.documentElement.childNodes[2];
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,companyid,goal,over,under
var cid = (parseInt(arr[1]) - 3);
//if(!(cid in SelCompany)) continue;
if (strCompanyId.indexOf("," + cid + ",") < 0) continue;
var tr = document.getElementById("odds_" + arr[0] + "_" + cid + "_" + arr[5]);
if (tr == null) continue;
oddsItem = matchdata.Odds3List.Get(arr[0] + "_" + cid + "_" + arr[5]);
if (oddsItem == null) { //开盘
if (parseInt(arr[5]) > 1) continue;//页面只自动添加主盘显示,其它盘刷新页面才显示
var tmp = arr[0] + "," + cid + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[5];
oddsItem = new _glodds.OddsOU(tmp);
matchdata.Odds3List.Add(oddsItem.mId + "_" + oddsItem.cId + "_" + oddsItem.num, oddsItem);
tr.cells[7].innerHTML = "" + oddsItem.overF + "
" + oddsItem.over + "
";
tr.cells[8].innerHTML = "" + oddsItem.goalF + "
" + oddsItem.goal + "
";
tr.cells[9].innerHTML = "" + oddsItem.underF + "
" + oddsItem.under + "
";
if (changeIDList.indexOf("," + arr[0] + "_" + cid + "_" + arr[5] + ",") < 0) changeIDList += arr[0] + "_" + cid + "_" + arr[5] + ",";
}
if (oddsItem.goal != arr[2] || oddsItem.over != arr[3] || oddsItem.under != arr[4]) {
tr.cells[7].style.backgroundColor = TdBgColor(oddsItem.over, arr[3]);
tr.cells[8].style.backgroundColor = TdBgColor(oddsItem.goal, arr[2]);
tr.cells[9].style.backgroundColor = TdBgColor(oddsItem.under, arr[4]);
oddsItem.goal = arr[2];
oddsItem.over = arr[3];
oddsItem.under = arr[4];
tr.cells[7].innerHTML = "" + oddsItem.overF + "
" + oddsItem.over + "
";
tr.cells[8].innerHTML = "" + oddsItem.goalF + "
" + oddsItem.goal + "
";
tr.cells[9].innerHTML = "" + oddsItem.underF + "
" + oddsItem.under + "
";
if (changeIDList.indexOf("," + arr[0] + "_" + cid + "_" + arr[5] + ",") < 0) changeIDList += arr[0] + "_" + cid + "_" + arr[5] + ",";
}
if (soundCheck && playFlash == false && document.getElementById("table_" + arr[0]).style.display == "") playFlash = true;
}
window.setTimeout("colors_water('" + changeIDList + "')", 30000);
if (playFlash) ShowFlash(0);
}
var flash_sound = Array(2);
flash_sound[0] = "images/oddssound.swf";
flash_sound[1] = "notify.swf";
flash_sound[2] = "images/sound.swf";
function ShowFlash(n) {
try {
var ieVersion = "-1";
var ua = navigator.userAgent.toLowerCase();
if (window.ActiveXObject)
ieVersion = ua.match(/msie ([\d.]+)/)[1];
if (parseFloat(ieVersion) > 0 && parseFloat(ieVersion) < 6)
document.getElementById("sound").innerHTML = "";
else
document.getElementById("sound").innerHTML = "";
}
catch (e) { };
}
function refreshOld() {
if (xml1.readyState != 4 || (xml1.status != 200 && xml1.status != 0)) return;
if (oldXML == xml1.responseText) return
oldXML = xml1.responseText;
var arr;
var changeIDList = ",";
var playFlash = false;
//亚赔
var root = xml1.responseXML.documentElement.childNodes[0];
var playSound = false;
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,companyid,goal,home,away,close,zoudi
if (strCompanyId.indexOf("," + arr[1] + ",") < 0) continue;
var tr = document.getElementById("tr_" + arr[0]);
var tr2 = document.getElementById("tr2_" + arr[0]);
var tr3 = document.getElementById("tr3_" + arr[0]);
if (tr == null || tr2 == null || tr3 == null) continue;
var postion = parseInt(hsOddsPostion.items(arr[1]));
oddsItem = matchdata.Odds1List.Get(arr[0] + "_" + arr[1]);
if (oddsItem == null) { //开盘
var tmp = arr[0] + "," + arr[1] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[5] + "," + arr[6];
oddsItem = new _glodds.OddsAsian(tmp);
matchdata.Odds1List.Add(oddsItem.mId + "_" + oddsItem.cId, oddsItem);
tr.cells[postion + 1].innerHTML = oddsItem.home;
tr2.cells[postion].innerHTML = "" + oddsItem.goal + "";
tr3.cells[postion].innerHTML = oddsItem.away;
if (changeIDList.indexOf("," + arr[0] + ",") < 0) changeIDList += arr[0] + ",";
}
if (oddsItem.goal != arr[2] || oddsItem.home != arr[3] || oddsItem.away != arr[4]) {
tr2.cells[postion].style.backgroundColor = TdBgColor(oddsItem.goal, arr[2]);
tr.cells[postion + 1].style.backgroundColor = TdBgColorOld(oddsItem.home, arr[3]);
tr3.cells[postion].style.backgroundColor = TdBgColorOld(oddsItem.away, arr[4]);
var strGoal = (oddsItem.goal < arr[2] ? "↑" : "") + arr[2] + (oddsItem.goal > arr[2] ? "↓" : "");
oddsItem.goal = arr[2];
oddsItem.home = arr[3];
oddsItem.away = arr[4];
tr.cells[postion + 1].innerHTML = oddsItem.home;
tr2.cells[postion].innerHTML = "" + strGoal + "";
tr3.cells[postion].innerHTML = oddsItem.away;
if (changeIDList.indexOf("," + arr[0] + ",") < 0) changeIDList += arr[0] + ",";
}
if (playFlash == false && tr.style.display == "") playFlash = true;
}
//大小
root = xml1.responseXML.documentElement.childNodes[2];
for (i = 0; i < root.childNodes.length; i++) {
arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,companyid,goal,over,under
var cid = (parseInt(arr[1]) - 3);
if (!(cid in SelCompany)) continue;
var tr = document.getElementById("tr_" + arr[0]);
var tr2 = document.getElementById("tr2_" + arr[0]);
var tr3 = document.getElementById("tr3_" + arr[0]);
if (tr == null || tr2 == null || tr3 == null) continue;
var postion = parseInt(hsOddsPostion.items(cid)) + 5;
oddsItem = matchdata.Odds3List.Get(arr[0] + "_" + cid);
if (oddsItem == null) { //开盘
var tmp = arr[0] + "," + cid + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4];
oddsItem = new _glodds.OddsOU(tmp);
matchdata.Odds3List.Add(oddsItem.mId + "_" + oddsItem.cId, oddsItem);
tr.cells[postion + 1].innerHTML = oddsItem.over;
tr2.cells[postion].innerHTML = "" + oddsItem.goal + "";
tr3.cells[postion].innerHTML = oddsItem.under;
if (changeIDList.indexOf("," + arr[0] + ",") < 0) changeIDList += arr[0] + ",";
}
if (oddsItem.goal != arr[2] || oddsItem.over != arr[3] || oddsItem.under != arr[4]) {
tr.cells[postion + 1].style.backgroundColor = TdBgColorOld(oddsItem.over, arr[3]);
tr2.cells[postion].style.backgroundColor = TdBgColor(oddsItem.goal, arr[2]);
tr3.cells[postion].style.backgroundColor = TdBgColorOld(oddsItem.under, arr[4]);
var strGoal = (oddsItem.goal < arr[2] ? "↑" : "") + arr[2] + (oddsItem.goal > arr[2] ? "↓" : "");
oddsItem.goal = arr[2];
oddsItem.over = arr[3];
oddsItem.under = arr[4];
tr.cells[postion + 1].innerHTML = oddsItem.over;
tr2.cells[postion].innerHTML = "" + strGoal + "";
tr3.cells[postion].innerHTML = oddsItem.under;
if (changeIDList.indexOf("," + arr[0] + ",") < 0) changeIDList += arr[0] + ","; //+ "_" + arr[1] +
}
if (soundCheck && playFlash == false && tr.style.display == "") playFlash = true;
}
window.setTimeout("colors_watgerOld('" + changeIDList + "')", 30000);
if (playFlash) ShowFlash(1);
}
function innerText(node) {
var innerTextArr = [];
var root = document.getElementById(node);
var getChild = function (node) {
var childs = node.childNodes;
for (var i = 0; i < childs.length; i++)
if (childs[i].nodeType == 3)
innerTextArr.push(childs[i].nodeValue);
else if (childs[i].nodeType == 1)
getChild(childs[i]);
}
getChild(root);
return innerTextArr;
}
function colors_water(IDList) {
var A = IDList.split(",");
var tr;
for (var i = 1; i < A.length - 1; i++) {
tr = document.getElementById("odds_" + A[i]);
if (tr == null) continue;
for (var j = 1; j <= 9; j++)
tr.cells[j].style.backgroundColor = "";
}
}
function colors_watgerOld(IDList) {
var A = IDList.split(",");
var tr, tr2, tr3;
for (var i = 1; i < A.length - 1; i++) {
tr = document.getElementById("tr_" + A[i]);
if (tr == null) continue;
tr2 = document.getElementById("tr2_" + A[i]);
tr3 = document.getElementById("tr3_" + A[i]);
for (var j = 1; j < 11; j++) {
tr.cells[j + 1].style.backgroundColor = "";
tr2.cells[j].style.backgroundColor = "";
tr2.cells[j].innerHTML = tr2.cells[j].innerHTML.replace("↑", "").replace("↓", "");
tr3.cells[j].style.backgroundColor = "";
}
}
}
function getbfxml() {
xmlBf.open("get", "http://www.boqbf.com/nba/nbaodd_change.html", true);
xmlBf.onreadystatechange = bfRefresh;
xmlBf.send(null);
window.setTimeout("getbfxml()", 6000);
}
function bfRefresh() {
if (xmlBf.readyState != 4 || (xmlBf.status != 200 && xmlBf.status != 0)) return;
if (oldBfXML == xmlBf.responseText || xmlBf.responseText == "") return
oldBfXML = xmlBf.responseText;
var root = xmlBf.responseXML.documentElement;
var D = new Array();
var matchindex, score1change, score2change, scorechange;
var goTime, hometeam, guestteam, sclassname, score1, score2, tr;
var matchNum = 0;
//var notify = document.getElementById("notify").innerHTML;
var tdNum = 4; //一般情况分四节
for (var i = 0; i < root.childNodes.length; i++) {
D = root.childNodes[i].childNodes[0].nodeValue.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
matchItem = matchdata.MatchList.Get(D[0]);
if (matchItem == null) continue;
leagueItem = matchdata.LeagueList.Get(matchItem.lId);
if (leagueItem.type == "4")
tdNum = 4; //分上下半场
else
tdNum = 2;
score1change = false;
if (matchItem.homeScore != D[3]) {
matchItem.homeScore = D[3];
score1change = true;
//document.getElementById("hs_" + matchItem.mId).innerHTML=D[3];
document.getElementById("home_" + matchItem.mId).style.backgroundColor = "yellow";
}
score2change = false;
if (matchItem.guestScore != D[4]) {
matchItem.guestScore = D[4];
score2change = true;
//document.getElementById("gs_" + matchItem.mId).innerHTML=D[4];
document.getElementById("guest_" + matchItem.mId).style.backgroundColor = "yellow";
}
scorechange = score1change || score2change;
if (scorechange)
document.getElementById("score_" + matchItem.mId).innerHTML = D[3] + "-" + D[4];
//开赛时间
//if(matchItem.time!=D[8]) document.getElementById("mt_"+ matchItem.mId).innerHTML=D[8];
//matchItem.time=D[8];
var t = D[9].split(",");
matchItem.time2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]);
//状态
if (matchItem.state != D[1]) {
matchItem.state = D[1];
switch (matchItem.state) {
case "0":
//document.getElementById("hs_" + matchItem.mId).innerHTML = "";
//document.getElementById("time_" + matchItem.mId).innerHTML = "";
//document.getElementById("gs_" + matchItem.mId).innerHTML = "";
document.getElementById("score_" + matchItem.mId).innerHTML = "VS";
break;
case "-1":
document.getElementById("time_" + matchItem.mId).innerHTML = state_ch[parseInt(D[1]) + 5].split(",")[lang];
window.setTimeout("MoveToBottom(" + D[0] + ")", 30000);
break;
default:
if (leagueItem.type == 2 && (D[1] == 1 || D[1] == 3)) //只分两节
document.getElementById("time_" + matchItem.mId).innerHTML = state_ch[parseInt(D[1]) + 14].split(",")[lang];
else
document.getElementById("time_" + matchItem.mId).innerHTML = state_ch[parseInt(D[1]) + 5].split(",")[lang];
break;
}
}
if (scorechange) {
// hometeam=matchItem.getT1Name();
// score1=D[2];
// score2=D[3];
// guestteam=matchItem.getT2Name();
// if(score1change){
// hometeam="" + matchItem.getT1Name() +"";
// score1 = "" + D[3] + "";
// }
// if(score2change){
// guestteam = "" + matchItem.getT2Name() + "";
// score2 = "" + D[4] + "";
// }
// window.clearTimeout(nofityTimer);
// if(notify=="") notify="得分提示:";
// notify+= hometeam + " " + score1 +"-" + score2 + " " +guestteam +" ";
// nofityTimer=window.setTimeout("clearNotify()",20000);
window.setTimeout("bfcolors_water('" + matchItem.mId + "')", 30000);
if (soundCheck) ShowFlash(2);
}
}
// if(notify!="") document.getElementById("notify").innerHTML=notify;
}
function clearNotify() {
document.getElementById("notify").innerHTML = "";
}
function bfcolors_water(ID) {
try {
document.getElementById("home_" + ID).style.backgroundColor = "";
document.getElementById("guest_" + ID).style.backgroundColor = "";
} catch (e) { }
}
function MoveToBottom(id) {
try {
//document.getElementById("table_" + id).parentElement.insertAdjacentElement("BeforeEnd",document.getElementById("table_" + id));
document.getElementById("table_" + id).style.display = "none";
} catch (e) { }
}
function CheckLeague(obj) {
if (obj.checked)
obj.parentElement.style.backgroundColor = "#ffeeee";
else
obj.parentElement.style.backgroundColor = "white";
}
function SelectAll(value) {
var i, inputs;
inputs = document.getElementById("league").getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type != "checkbox") continue;
inputs[i].checked = value;
if (inputs[i].checked) {
inputs[i].parentElement.style.backgroundColor = "#ffeeee";
}
else {
inputs[i].parentElement.style.backgroundColor = "white";
}
}
}
function SelectOK(t) {
var i, j, inputs;
var hh = 0;
inputs = document.getElementById("league").getElementsByTagName("input");
if (t == 1)
hiddenID = "_";
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type != "checkbox") continue;
if (inputs[i].checked) {
for (var j = 0; j < matchdata.MatchNum; j++) {
matchItem = matchdata.MatchList.items[j];
if (matchItem.lId == inputs[i].value) document.getElementById("table_" + matchItem.mId).style.display = "";
}
}
else {
for (var j = 0; j < matchdata.MatchNum; j++) {
matchItem = matchdata.MatchList.items[j];
if (matchItem.lId == inputs[i].value) {
document.getElementById("table_" + matchItem.mId).style.display = "none";
if (t == 1) {
hiddenID += matchItem.mId + "_";
hh++;
}
}
}
}
}
if (t == 1) {
if (hh == 0) hiddenID = "_";
writeCookie("Bet007Odds_hiddenID", hiddenID);
//document.getElementById("hiddenCount").innerHTML = hh;
}
}
function hidematch(id, t) {
document.getElementById("table_" + id).style.display = "none";
if (t == 1) {
//document.getElementById("hiddenCount").innerHTML = parseInt(document.getElementById("hiddenCount").innerHTML) + 1;
hiddenID += id + "_";
writeCookie("Bet007Odds_hiddenID", hiddenID);
}
}
function ShowAllMatch(t) {
SelectAll(true);
SelectOK(t);
}
function SelectCompany() {
var i, inputs;
var j = 0;
SelCompany = new Array();
strCompanyId = ",";
inputs = document.getElementById("companyList").getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox" && inputs[i].checked) {
SelCompany[j++] = inputs[i].value;
strCompanyId += inputs[i].value + ",";
}
}
writeCookie("company", strCompanyId.substring(1, strCompanyId.length - 1));
LoadData();
}
function DefaultCompany() {
strCompanyId = "1,2,3,8,9,31";
SelCompany = strCompanyId.split(",");
strCompanyId = "," + strCompanyId + ",";
writeCookie("company", "");
LoadData();
inputs = document.getElementById("companyList").getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type != "checkbox") continue;
inputs[i].checked = false;
if (strCompanyId.indexOf("," + inputs[i].value + ",") >= 0) inputs[i].checked = true;
}
for (var i = 0; i < SelCompany.length; i++)
document.getElementById("company" + SelCompany[i]).checked = true;
}
function changeToCn(l) {
if (l == 0) {
var name = location.href.substring(location.href.lastIndexOf("/") + 1);
var para = "";
var num = location.href.indexOf("?");
if (num > 0)
para = location.href.substring(num);
name = name.split('_')[0] + ".aspx" + para;
location.href = name;
}
}
function changeToBig(l) {
if (l == 1) {
var name = location.href.substring(location.href.lastIndexOf("/") + 1);
var para = "";
var num = location.href.indexOf("?");
if (num > 0)
para = location.href.substring(num);
if (name.indexOf('.') != -1)
name = name.split('.')[0] + "_big.aspx" + para;
else
name = "index_big.aspx";
location.href = name;
}
}
function showOrHiddenMulti(sID, companyID) {
var isShow = multiSCIDList.indexOf(sID + "_" + companyID) != -1;
if (isShow)
multiSCIDList = multiSCIDList.replace(sID + "_" + companyID + "_", "");
else
multiSCIDList += sID + "_" + companyID + "_";
isShow = !isShow;
var oddsItem, objTab;
oddsItem = matchdata.Odds1List.Get(sID + "_" + companyID + "_1");
if (oddsItem != null) {
if (oddsItem.maxNum <= 1) return;
objTab = document.getElementById("odds_" + sID);
for (var j = 0; j < objTab.rows.length; j++) {
var row = objTab.rows[j];
if (row.id.indexOf("_" + companyID + "_1") != -1) {
//row.cells[0].rowSpan = isShow ? oddsItem.maxNum : 1;
//row.cells[1].rowSpan = isShow ? oddsItem.maxNum : 1;
if (isShow)
row.cells[1].innerHTML = row.cells[1].innerHTML.replace("jia", "jian");
else
row.cells[1].innerHTML = row.cells[1].innerHTML.replace("jian", "jia");
row.style.backgroundColor = isShow ? "#f2f9fd" : "#fff";
for (var k = 2; k <= oddsItem.maxNum; k++) {
objTab.rows[j + k - 1].style.display = isShow ? "" : "none";
}
}
}
}
}
function addConcern(matchID, obj) {
//var cCount = document.getElementById("concernCount").innerHTML;
if (concernId.indexOf("_" + matchID + "_") == -1) concernId += matchID + "_";
else return;
writeCookie("Bet007BskOdds_concernId", concernId);
// cCount++;
//var tr = document.getElementById("tr1_" + A[matchIndex][0]);
obj.parentNode.innerHTML = obj.parentNode.innerHTML.replace("addConcern", "deleteConcern").replace("btn top", "btn top on").replace("添加", "取消");
var matchItem = matchdata.MatchList.Get(matchID);
var weight = getWeight(matchItem);
var isChange = false;
for (var i = 0; i < matchdata.MatchNum; i++) {
var matchItem2 = matchdata.MatchList.items[i];
if (concernId.indexOf("_" + matchItem2.mId + "_") != -1) {
if (getWeight(matchItem2) > weight) {
isChange = true;
MovePlace(matchItem2.mId, matchItem.mId, true);
break;
}
}
}
if (!isChange) {
var arrs = concernId.substr(0, concernId.length - 1).split('-');
MovePlace(arrs.length > 1 ? arrs[arrs.length - 1] : 0, matchItem.mId, true);
}
//document.getElementById("concernCount").innerHTML = cCount;
}
function deleteConcern(matchId, obj) {
if (concernId.indexOf("_" + matchId + "_") == -1) return;
// var tr = document.getElementById("tr1_" + A[matchIndex][0]);
obj.parentNode.innerHTML = obj.parentNode.innerHTML.replace("deleteConcern", "addConcern").replace("btn top on", "btn top").replace("取消", "添加");
var isChange = false;
var lastmId = matchdata.MatchList.items[0].mId;
var lastWeight = 0;
var matchItem = matchdata.MatchList.Get(matchId);
var curWeight = getWeight(matchItem);
for (var i = 0; i < matchdata.MatchNum; i++) {
var matchItem2 = matchdata.MatchList.items[i];
if (concernId.indexOf("_" + matchItem2.mId + "_") == -1 && hiddenID.indexOf("_" + matchItem2.mId + "_") == -1) {
var weight = getWeight(matchItem2);
if (weight < curWeight
&& (weight > lastWeight || lastWeight == 0)) {
isChange = true;
lastWeight = weight;
lastmId = matchItem2.mId;
}
//if (weight2 < weight) {
// isChange = true;
// MovePlace(matchItem2.mId, matchItem.mId, false);
// break;
//}
}
}
if (!isChange) MovePlace(0, matchItem.mId, false);
else MovePlace(lastmId, matchItem.mId, false);
concernId = concernId.replace("_" + matchId + "_", "_");
//var cCount = document.getElementById("concernCount").innerHTML;
writeCookie("Bet007BskOdds_concernId", concernId);
//cCount--;
//document.getElementById("concernCount").innerHTML = cCount;
}
function SortData() {
temp = new Array();
var j = 0;
temp[0] = ",";
var tempCount = matchDomain.length;
for (var i = 0; i < tempCount; i++) {
if (concernId.indexOf("_" + matchDomain[i].split(_glodds.SplitColumn)[0] + "_") != -1) {
temp[j] = matchDomain[i];
matchDomain.splice(i, 1);
tempCount--;
i--;
j++;
}
}
if (temp.length > 0) {
//document.getElementById("concernCount").innerHTML = temp.length - 1;
matchDomain = temp.concat(matchDomain);
}
}
function getWeight(matchItem) {
var state = parseInt(matchItem.state);
var ss = state > 0 ? 1 : state;
if (ss >= 0 || ss == -1) ss = ss + 50;
else {
ss = 40;// -10~-14 sort by time
}
var monthStr = matchItem.time.getMonth().toString();
var dayStr = matchItem.time.getDay().toString();
var hoursStr = matchItem.time.getHours().toString();
var minutesStr = matchItem.time.getMinutes().toString();
if (dayStr.length == 1) dayStr = "0" + dayStr;
if (monthStr.length == 1) monthStr = "0" + monthStr;
if (hoursStr.length == 1) hoursStr = "0" + hoursStr;
if (minutesStr.length == 1) minutesStr = "0" + minutesStr;
var yearInt = new Date().getFullYear() - matchItem.time.getFullYear();
var matchTime = yearInt + monthStr + dayStr + hoursStr + minutesStr;
return parseFloat(ss + (99999999 - parseInt(matchTime) + "." + (1000 - matchItem.oddsIndex)));
}
function MovePlace(newPos, oldPos, isadd) {
try {
if (newPos == 0)
document.getElementById("odds").insertAdjacentElement(isadd ? "afterBegin" : "BeforeEnd", document.getElementById("table_" + oldPos));
else
document.getElementById("table_" + newPos).insertAdjacentElement(isadd ? "afterEnd" : "BeforeBegin", document.getElementById("table_" + oldPos));
}
catch (e) {
}
}