var _themeColor = "#00407d"; //站点主题色 function timeToText(t2, type) { type = type || 0; var fmts = [ "dd-MM-yyyy hh:mm",/*0*/ "dd-MM-yyyy",/*1*/ "dd-MM",/*2*/ "hh:mm",/*3*/ "t2 dd",/*4*/ "dd-MM hh:mm",/*5*/ "dd-MM-yy",/*6*/ "yyyy",/*7*/ "t2.dd",/*8*/ "dd-MM,yyyy hh:mm"/*9*/, "dd-MM-yyyy hh:mm",/*10*/ "dd-MM
hh:mm",/*11*/ ]; return dateFtt(fmts[type] || fmts[0], t2); } function dateToTime(time) { var tReg = /(\d{4})-(\d{1,2})-(\d{1,2})([\s\d\:]*)/; if (tReg.test(time)) { var arr = time.match(tReg); return arr[3] + "-" + arr[2] + "-" + arr[1] + arr[4]; } tReg = /(\d{4})\/(\d{1,2})\/(\d{1,2})([\s\d\:]*)/; if (tReg.test(time)) { var arr = time.match(tReg); return arr[3] + "-" + arr[2] + "-" + arr[1] + arr[4]; } tReg = /^(\d{1,2})-(\d{1,2})([\s\d\:]*)/; if (tReg.test(time)) { var arr = time.match(tReg); return arr[2] + "-" + arr[1] + arr[3]; } return time; } soccerInPage = { prefix: "football/", isSummary: function (id, home, guest, isSelf) { if (typeof (checkInpageVersion) == "function" && checkInpageVersion(id, home, guest, isSelf) == 1) { return true; } return false; }, formatinfo: function (home, guest, sclass) { var str = _livescoreWebDomain + this.prefix + (sclass + " " + home + " vs " + guest).replace(/\s/g, "-").replace(/[\?,\#,\&,\/,\%]/g, "").replace(/\.$/, "").toLowerCase(); return str; }, detail: function (id, home, guest, sclass, isSelf) { if (!this.isSummary(id, home, guest, isSelf)) { var url = this.formatinfo(home, guest, sclass) + "/live-" + id; window.open(url); } }, analysis: function (id, home, guest, sclass, isSelf) { if (!this.isSummary(id, home, guest, isSelf)) { var url = this.formatinfo(home, guest, sclass) + "/h2h-" + id; window.open(url); } }, oddscomp: function (id, cid, home, guest, sclass, isSelf) { if (!this.isSummary(id, home, guest, isSelf)) { var url = this.formatinfo(home, guest, sclass) + "/oddscomp-" + id; if (cid) url += "?cid=" + cid; else if (typeof (selectCompanyId) != "undefined") url += "?cid=" + selectCompanyId; window.open(url); } }, } function checkInpageVersion(id, hn, gn, isSelf) { if (Config.isSummaryInpage()) { window.open(_livescoreWebDomain + "football/" + (hn + "-vs-" + gn).replace(/\s/g, "-").toLowerCase() + "/summary-" + id, isSelf ? "_self" : ""); return 1; } return 0; };