var _currentSportId = 1; var tabRow; /** Created by: Michael Synovic on: 01/12/2003 This is a Javascript implementation of the Java Hashtable object. Contructor(s): Hashtable() Creates a new, empty hashtable Method(s): void clear() Clears this hashtable so that it contains no keys. boolean containsKey(String key) Tests if the specified object is a key in this hashtable. boolean containsValue(Object value) Returns true if this Hashtable maps one or more keys to this value. Object get(String key) Returns the value to which the specified key is mapped in this hashtable. boolean isEmpty() Tests if this hashtable maps no keys to values. Array keys() Returns an array of the keys in this hashtable. void put(String key, Object value) Maps the specified key to the specified value in this hashtable. A NullPointerException is thrown is the key or value is null. Object remove(String key) Removes the key (and its corresponding value) from this hashtable. Returns the value of the key that was removed int size() Returns the number of keys in this hashtable. String toString() Returns a string representation of this Hashtable object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space). Array values() Returns a array view of the values contained in this Hashtable. */ function Hashtable(){ this.clear = hashtable_clear; this.containsKey = hashtable_containsKey; this.containsValue = hashtable_containsValue; this.get = hashtable_get; this.isEmpty = hashtable_isEmpty; this.keys = hashtable_keys; this.put = hashtable_put; this.remove = hashtable_remove; this.size = hashtable_size; this.toString = hashtable_toString; this.values = hashtable_values; this.hashtable = new Array(); } /*=======Private methods for internal use only========*/ function hashtable_clear(){ this.hashtable = new Array(); } function hashtable_containsKey(key){ var exists = false; for (var i in this.hashtable) { if (i == key && this.hashtable[i] != null) { exists = true; break; } } return exists; } function hashtable_containsValue(value){ var contains = false; if (value != null) { for (var i in this.hashtable) { if (this.hashtable[i] == value) { contains = true; break; } } } return contains; } function hashtable_get(key){ return this.hashtable[key]; } function hashtable_isEmpty(){ return (parseInt(this.size()) == 0) ? true : false; } function hashtable_keys(){ var keys = new Array(); for (var i in this.hashtable) { if (this.hashtable[i] != null) keys.push(i); } return keys; } function hashtable_put(key, value){ if (key == null || value == null) { throw "NullPointerException {" + key + "},{" + value + "}"; }else{ this.hashtable[key] = value; } } function hashtable_remove(key){ var rtn = this.hashtable[key]; this.hashtable[key] = null; return rtn; } function hashtable_size(){ var size = 0; for (var i in this.hashtable) { if (this.hashtable[i] != null) size ++; } return size; } function hashtable_toString(){ var result = ""; for (var i in this.hashtable) { if (this.hashtable[i] != null) result += "{" + i + "},{" + this.hashtable[i] + "}\n"; } return result; } function hashtable_values(){ var values = new Array(); for (var i in this.hashtable) { if (this.hashtable[i] != null) values.push(this.hashtable[i]); } return values; } var objItems = new Hashtable(); var objUpdatedItems = new Hashtable(); var objTabs = new Hashtable(); var objSB = new Hashtable(); var lastSmartMoneyPopup; var objAlerts = new Hashtable(); function HighlightColumn(column, bookId) { cells = document.getElementsByTagName("TD"); for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) { var cell = cells[cellIndex]; if (cell) { var idx = cell.getAttribute('idx'); var previousColor = cell.getAttribute('previousColor'); if (idx == bookId && cell.style.backgroundColor != "magenta") { cell.setAttribute('previousColor', cell.style.backgroundColor); cell.style.backgroundColor = "magenta"; } else { if (previousColor) { cell.style.backgroundColor = previousColor; } } } } } function clearchanges() { for (var i in objItems.hashtable) { if (objItems.hashtable[i] != null) { var oTime = objUpdatedItems.get(i); if (oTime != null) window.clearTimeout(oTime); var o = objItems.get(i); if (o != null) { o.style.color = "#000000"; o.style.backgroundColor = o.parentNode.style.backgroundColor; } } } for (var index in objTabs.hashtable) { if (objTabs.hashtable[index] != null) { var o = objTabs.get(index); o.style.color='#999999'; o.style.fontWeight = 'normal'; } } objTabs = new Hashtable(); for (var index in objSB.hashtable) { if (objSB.hashtable[index] != null) { var o = objSB.get(index); o.setAttribute('className','HeadOrange'); o.setAttribute('class','HeadOrange'); } } objSB = new Hashtable(); } function clearTab() { for (var i in objItems.hashtable) { var gridId = i.split("|") ; if (gridId[0]=='liveOddsTable' + _currentSportId) { if (objItems.hashtable[i] != null) { var oTime = objUpdatedItems.get(i); if (oTime != null) window.clearTimeout(oTime); var o = objItems.get(i); if (o != null) { o.style.color = "#000000"; o.style.backgroundColor = o.parentNode.style.backgroundColor; } } } } for (var i in objSB.hashtable) { var gridId = i.split("|") ; if (gridId[0]=='liveOddsTable' + _currentSportId) { if (objSB.hashtable[i] != null) { var o = objSB.get(i); o.setAttribute('className','HeadOrange'); o.setAttribute('class','HeadOrange'); } } } var key = 'ft' + _currentSportId; if (objTabs.hashtable[key] != null) { var o = objTabs.get(key); o.style.color='#999999'; o.style.fontWeight = 'normal'; } objTabs.remove(key); } function setitem(gridTable, rowid, cellid, itemid, itemtext) { setitemdetails(gridTable, rowid, cellid, itemid, itemtext, '#FF0000'); } function checkTabHighlight(gridTable) { if (!gridTable) return; var key = gridTable.id.replace('liveOddsTable', 'ft'); var o = objTabs.get(key); if (!o) { o = document.getElementById(key); o.style.color='red'; o.style.fontWeight = 'bold'; objTabs.put(key, o); } } function checkSBHighlight(gridTable, sportsbook) { try{ if (!gridTable) return; var sbKey = sportsbook.replace('sb', 'sbh'); if (sbKey == sportsbook) return; var key = gridTable.id + '|' + sbKey; var o = objItems.get(key); if (o != null) return; var rows = getRow(gridTable, 'header'); var row; if (!rows) return; for (var i = 0; i < rows.length; i++) { var newKey = key + '|' + i; row = rows[i]; var o = getCell(row, sbKey); if (o) { o.setAttribute('className','HeadOrangeChanged'); o.setAttribute('class','HeadOrangeChanged'); objSB.put(newKey, o); } } } catch (e) {debugger;} } function setitemdetails(gridTable, rowid, cellid, itemid, itemtext, color) { var key = (gridTable.id + rowid + cellid + itemid); var o = getitem(gridTable, rowid, cellid, itemid); if (o != null) { if (trim(o.innerHTML) != trim(itemtext) && itemtext != 'n/a') { o.innerHTML = itemtext; if (itemtext != ' ') { o.style.color = '#FFFFFF'; o.style.backgroundColor = color; // light red setTimeoutInfo("setitemold(" + gridTable.id + ",'" + rowid + "','" + cellid + "','"+ itemid + "','#FFCC99','#000000',false)", 30000, key); checkSBHighlight(gridTable, cellid); checkTabHighlight(gridTable); } } } } function setTimeoutInfo(functionName, timeout, key) { var o = objUpdatedItems.get(key) if (o) window.clearTimeout(o); objUpdatedItems.put(key, window.setTimeout(functionName , timeout)); } function getRow(gridTable, rowid) { if (BrowserDetect.browser == 'Explorer') { return gridTable.rows[rowid]; } else { var rows = gridTable.getElementsByTagName("tr"); if (!rows) return; for (var i = 0; i < rows.length; i++) { row = rows[i]; if (row.id == rowid) { return row; } } } } function getCell(row, cellid) { if (BrowserDetect.browser == 'Explorer') { return row.cells[cellid]; } else { var cells = row.getElementsByTagName("td"); if (!cells) return; for (var i = 0; i < cells.length; i++) { var cell = cells[i]; if (cell.id == cellid) { return cell; } } } } function getitem(gridTable, rowid, cellid, itemid) { if (gridTable == null) return null; var key = gridTable.id + '|' + rowid + '|' + cellid + '|' + itemid; var o = objItems.get(key); if (o != null) return o; row = getRow(gridTable, rowid); if (row) { cell = getCell(row,cellid); if (!cell) return; var oSpans = cell.getElementsByTagName("span"); if (!oSpans) return; for (var i = 0; i < oSpans.length; i++) { o = oSpans[i]; if (o.id == itemid) { objItems.put(key, o); return o; } } } return; } function getimageitem(gridTable, rowid, cellid, itemid) { if (gridTable == null) return null; var key = gridTable.id + '|' + rowid + '|' + cellid + '|' + itemid; var o = objItems.get(key); if (o != null) return o; row = getRow(gridTable, rowid); if (row) { cell = getCell(row,cellid); if (!cell) return; var oSpans = cell.getElementsByTagName("img"); for (var i = 0; i < oSpans.length; i++) { o = oSpans[i]; if (o.id == itemid) { objItems.put(key, o); return o; } } } return; } function setitemold(gridTable, rowid, cellid, itemid, backColor, foreColor, clear) { var key = (gridTable.id + rowid + cellid + itemid); var o = getitem(gridTable, rowid, cellid, itemid); if (o != null) { o.style.color = foreColor; o.style.backgroundColor = backColor; if (!clear) // light blue setTimeoutInfo("setitemold(" + gridTable.id + ",'" + rowid + "','" + cellid + "','"+ itemid + "','#FFFF66','#000000',true)" , 30000, key); } } function showEventChanged(id) { var o = document.getElementById(id); if (o != null) { o.style.display=''; } } function setimage(gridTable, rowid, cellid, itemid, imageName) { var o = getimageitem(gridTable, rowid, cellid, itemid); if (o != null) { o.src = '/images/' + imageName + '.gif'; } } function clearitemcolor(gridTable, rowid, cellid, itemid) { } function setitemred(gridTable, rowid, cellid, itemid, itemtext) { var o = getitem(gridTable, rowid, cellid, itemid); if (o != null) { if (o.innerHTML != itemtext) { o.innerHTML = itemtext; o.style.color = "#FF3333"; } } } function settimescore(gridTable, rowid, time1, time2, period1, period2) { settimescorebase(gridTable, rowid, time1, time2, period1, period2, "#FF0000"); var key = (gridTable.id + rowid + 'time'); setTimeoutInfo("settimescore2(" + gridTable.id + ",'" + rowid + "','" + time1 + "','"+ time2 + "','"+ period1 + "','" + period2 + "')" , 30000, key); } function settimescore2(gridTable, rowid, time1, time2, period1, period2) { var key = (gridTable.id + rowid + 'time2'); settimescorecolor(gridTable, rowid, "#ff0000", "#FFA07A"); setTimeoutInfo("settimescore3(" + gridTable.id + ",'" + rowid + "','" + time1 + "','"+ time2 + "','"+ period1 + "','" + period2 + "')" , 30000, key);; } function settimescore3(gridTable, rowid, time1, time2, period1, period2) { var key = (gridTable.id + rowid + 'time3'); settimescorecolor(gridTable, rowid, "#ffa07a", "#8470FF"); } function settimescorecolor(gridTable, rowid, prevColor, newColor) { if (gridTable == null) return null; row = getRow(gridTable, rowid); checkTabHighlight(gridTable); if (row) { cell = getCell(row, "timebox"); if (cell) { var oSpans = cell.getElementsByTagName("span"); for (var i = 0; i < oSpans.length; i++) { var o = oSpans[i]; switch (o.id) { case "time1": if (o.style.backgroundColor == prevColor) o.style.backgroundColor = newColor; break; case "time2": if (o.style.backgroundColor == prevColor) o.style.backgroundColor = newColor; break; } } } } } function settimescorebase(gridTable, rowid, time1, time2, period1, period2, cellColor) { if (gridTable == null) return null; row = getRow(gridTable, rowid); if (row) { cell = getCell(row, "timebox"); if (cell) { if (cellColor == "") cellColor = row.style.backgroundColor; var oSpans = cell.getElementsByTagName("span"); for (var i = 0; i < oSpans.length; i++) { var o = oSpans[i]; switch (o.id) { case "time1": if (o.innerHTML != time1) { if (o.innerHTML != "") o.style.backgroundColor = cellColor; o.innerHTML = time1; } break; case "time2": if (o.innerHTML != time2) { if (o.innerHTML != "") o.style.backgroundColor = cellColor; o.innerHTML = time2; } break; case "period1": if (o.innerHTML != period1) o.innerHTML = period1; break; case "period2": if (o.innerHTML != period2) o.innerHTML = period2; if (trim(period2).length > 0) { backColor = ""; if (period2 == "FINAL") backColor = "#BBDDFF"; else if (period2.toUpperCase().indexOf("HALF") > -1) backColor = "#339999"; else backColor = "#FF9999"; setBackground(row, backColor); } break; } } } } } function smalert(sportid, sb, vdate, vnss, detail) { var x; var y; var key = "last_sm_alert|" + sb + "|" + vdate + "|" + vnss + "|"; var o = objAlerts.get(key); if (o != null) return; objAlerts.put(key, ""); x = (screen.width / 2 - 370); y = (screen.height / 2 - 150); window.open("/smpopup2.aspx?sport_id=" + sportid + "&v_date=" + vdate + "&v_nss=" + vnss + "&sb=" + sb + "&detail=" + detail, "smPopup" + vnss, "top=" + y + ",left=" + x + ",height=300,width=740,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function steamalert(sportid, vnss, playid) { var x; var y; var key = "last_steam_alert|" + playid; var o = objAlerts.get(key); if (o != null) return; objAlerts.put(key, ""); x = (screen.width / 2 - 370); y = (screen.height / 2 - 150); window.open("/steampopup.aspx?play_id=" + playid + "&sport_id=" + sportid + "&v_nss=" + vnss , "stmPopup" + vnss, "top=" + y + ",left=" + x + ",height=300,width=740,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function popupBestBets() { var x; var y; lasttime = document.body.getAttribute("bestbets_popup"); if (lasttime != null) { return; } document.body.setAttribute("bestbets_popup", new Date().toString()); x = (screen.width / 2 - 370); y = (screen.height / 2 - 200); window.open("/bestbetpopup.aspx" , "bestbet", "top=" + y + ",left=" + x + ",height=400,width=740,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function smteam(gridTable, rowid, on) { if (gridTable == null) return null; row = getRwow(gridTable, rowid); if (row) { cell = getCell(row, "teambox"); if (!cell) return; if (on == 0) { cell2 = getCell(row, "timebox"); if (!cell) return; cell.style.backgroundColor = cell2.style.backgroundColor; } else { cell.style.backgroundColor = "#66FF66"; } } } //compact, stand-alone version of trim() function trim(sVal) { sTrimmed = ""; for (i = 0; i < sVal.length; i++) { if (sVal.charAt(i) != " " && sVal.charAt(i) != "\f" && sVal.charAt(i) != "\n" && sVal.charAt(i) != "\r" && sVal.charAt(i) != "\t") { sTrimmed = sTrimmed + sVal.charAt(i); } } return sTrimmed; } function setBackground(tableRow, color) { tableRow.style.backgroundColor = color; //for (var i = 0; i < tableRow.cells.length; i++) { // setColor(tableRow.cells(i), color); //} } function setColor(object, color) { var previousColor = object.getAttribute('previousColor'); if (previousColor) object.setAttribute('previousColor', color); else object.style.backgroundColor = color; } function popupInjuries(sportId) { var x; var y; x = (screen.width / 2 - 300); y = (screen.height / 2 - 200); var key = "popupInjuries|" + sportId; var o = objAlerts.get(key); if (o != null) return; objAlerts.put(key, ""); window.open("injurypopup.asp?sport_id=" + sportId, "injuryPopup" + sportId, "top=" + y + ",left=" + x + ",height=400,width=600,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function popupLineWatcher() { var x; var y; x = (screen.width / 2 - 300); y = (screen.height / 2 - 200); window.open("/LineWatcherPopup.aspx?s=-1", "lineWatcherPopup", "top=" + y + ",left=" + x + ",height=400,width=600,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function popupArbPlay(t) { var x; var y; x = (screen.width / 2 - 250); y = (screen.height / 2 - 300); window.open("/SurebetsPopup.aspx?s=-1&t=" + t, "surebetsPopup", "top=" + y + ",left=" + x + ",height=500,width=800,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function popupMopPlay(t) { var x; var y; x = (screen.width / 2 - 250); y = (screen.height / 2 - 200); window.open("/MopPopup.aspx?s=-1&t=" + t, "mopPopup", "top=" + y + ",left=" + x + ",height=400,width=550,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function popupWeather(t) { var x; var y; x = (screen.width / 2 - 250); y = (screen.height / 2 - 200); window.open("/WeatherPopup.aspx?s=-1&t=" + t, "weatherPopup", "top=" + y + ",left=" + x + ",height=800,width=550,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function popup(t) { var x; var y; x = (screen.width / 2 - 250); y = (screen.height / 2 - 200); window.open("/popup.aspx?t=" + t, "popup", "top=" + y + ",left=" + x + ",height=300,width=550,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no", true); } function ShowOdds(sender, sportId) { if (_currentSportId != "0") { // Hide the current grid. div = document.getElementById('divSport' + _currentSportId); if (div != null) { div.style.display = 'none'; } // Set the previous tab background if (!tabRow) { tabRow = document.getElementById(initialClientId); SetCellImage(tabRow.rows[0].cells[0], 'images/tabs/tab_left_gray.gif'); tabRow.style.background = 'url(images/tabs/tab_bg_gray.gif)'; SetCellImage(tabRow.rows[0].cells[2], 'images/tabs/tab_right_gray.gif'); } else { SetCellImage(tabRow.cells[0], 'images/tabs/tab_left_gray.gif'); tabRow.parentNode.parentNode.style.background = 'url(images/tabs/tab_bg_gray.gif)'; SetCellImage(tabRow.cells[2], 'images/tabs/tab_right_gray.gif'); } } // Show the newly selected grid. div = document.getElementById('divSport' + sportId); tabRow = sender.parentNode.parentNode.parentNode; SetCellImage(tabRow.cells[0], 'images/tabs/tab_left.gif'); tabRow.parentNode.parentNode.style.background = 'url(images/tabs/tab_bg.gif)'; SetCellImage(tabRow.cells[2], 'images/tabs/tab_right.gif'); if (div != null) { div.style.display = ''; _currentSportId = sportId; } } function getScrollX() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfX = document.documentElement.scrollLeft; } return scrOfX; } function getScrollY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; } return scrOfY; } function SetCellImage(cell, image) { var oImages = cell.getElementsByTagName("img"); if (!oImages) return; if (oImages.length > 0) { oImages[0].src = image; } } function getInnerHeight() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return myHeight; } function getInnerWidth() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return myWidth; } var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i