var ctspan; var ctime; var autorefresh = true; var startTime,endTime; var errorShown = false; var numberOfErrors =0; var gridTable3; function setupClock() { gridTable3 = window.document.getElementById('liveOddsTable3'); // Start a simple clock task that updates a div once per second var task = { run: function(){ Ext.fly('utime').update(new Date().format('hh:mm:ss tt')); }, interval: 1000 //1 second } var runner = new Ext.util.TaskRunner(); } function getPopups() { } function OnFailedOdds(error, userContext, methodName) { if (numberOfErrors < 10) { numberOfErrors+=1; window.setTimeout("getServerUpdates()", 5000); } else { alert("We were unable to update the live odds page. The typical reason for this is you have lost your internet connection or your session has expired."); document.location="/live-odds.aspx"; } } function OnFailed(error, userContext, methodName) { if (!errorShown) { errorShown = true; return; } } function getServerUpdates() { SportsInsights.SportsInsightsWS.GetChanges('Updates', OnRequestComplete, OnFailedOdds ); // asynchronous call } function OnPopupsRequestComplete(result) { if (result != null) { eval(result); } window.setTimeout("getPopups()", 30000); } // This method will be called after the method has been executed // and the result has been sent to the client. function OnRequestComplete(result) { if (result != null) { eval(result); } window.setTimeout("getServerUpdates()", 5000); } function setCtime(strTime) { if (ctspan != null) { strTime = "Last Updated: " + strTime; ctspan.innerHTML = strTime; } }