function PartnerLogin() { //The following method will perform a polling on the client to see when the authentication cookie has been created. // When the cookie is there, the user details will be fetched and stored in the UserUtils object. var tickInterval = 2000; var numOfTicks = 240; UA.UserUtils.DoLogIn(tickInterval, numOfTicks, ReTestLogin); } function omRefreshPage() { var sURL = unescape(window.location.pathname); window.location.href = sURL; } function PartnerLogout() { UA.UserUtils.DoLogOut(); UA.User.prototype.LogOff(); omRefreshPage(); } function PartnerSignup() { UA.UserUtils.DoRegister(); } function ReTestLogin(stat) { if (stat) omRefreshPage(); } function InitializePageData(stat) { if (stat == true) doForLoggedIn(); } function RunGame(sku) { try { var oGameObj = new ActiveXObject("Odyssey.OdysseyActiveX.1"); oGameObj.launchGame(sku); } catch(Exception) {} } var ODCAXinstalled function IsODCInstalled() { try { if (ODCAXinstalled == -1 || ODCAXinstalled == 1) return ODCAXinstalled if (typeof (ActiveXObject("Odyssey.OdysseyActiveX.1")) != 'object') { ODCAXinstalled = -1 } else { ODCAXinstalled = 1 } return ODCAXinstalled; } catch(Exception) { return -1; } } function IsGameInstalled(sku) { try { var oGameObj = new ActiveXObject("Odyssey.OdysseyActiveX.1"); if (typeof(oGameObj) != 'object') return false; var skuTemp = oGameObj.FirstGameSKU; do { if (sku == skuTemp) { return true; } skuTemp = oGameObj.NextGameSKU; } while (oGameObj.HasMoreGames()); } catch(Exception) { } return false; } function omDownloadOrPlay(url, sku, gameName, imgUrl) { if (IsGameInstalled(sku)) { RunGame(sku); } else { var dlmExists = false; if (gameName != '' && imgUrl != '') { dlmExists = downloadGame(gameName,url, imgUrl); } if (!dlmExists) location.href = url; } } function downloadGame(gameName,exeUrl,imgUrl) { var exeUrlDL = exeUrl; if (exeUrlDL.indexOf('http://') < 0) { exeUrlDL = 'http://' + document.location.host + exeUrl; } var imgUrlDL = imgUrl; if (imgUrlDL.indexOf('http://') < 0) { imgUrlDL = 'http://' + document.location.host + imgUrlDL; } try { var Downloader = new ActiveXObject('OberonDownloader.Ax'); if (Downloader != null) { Downloader.AlwaysOnTop = false; Downloader.ChannelLogoUrl = 'http://' + document.location.host + '/graphics///images/channelLogo.gif'; Downloader.DownloadGame( gameName, exeUrlDL, '',imgUrlDL); return true; } else { return false; } } catch (e) { return false; } } function ChangeLinksToLogin() { for (var i=0; i< document.links.length; i++) { var currLink = document.links[i]; if (currLink.href.indexOf('javascript:omDownloadOrPlay') == 0 && (currLink.className == "oberonNavM" || currLink.className == "nfreedownload")) { if (UA.User.prototype.IsLoggedOn()) { currLink.style.display = "inline"; } else { currLink.style.display = "none"; } } else if (currLink.className.indexOf("omSignup") == 0) { if (UA.User.prototype.IsLoggedOn()) { currLink.style.display = "none"; } else { currLink.style.display = "inline"; } } else if (currLink.className == "gmpDlTtl") { if (UA.User.prototype.IsLoggedOn()) currLink.style.display = "inline"; else currLink.style.display = "none"; } else if (currLink.className == "gmpDlTtlSignup") { if (UA.User.prototype.IsLoggedOn()) { currLink.style.display = "none"; } else { currLink.style.display = "inline"; } } } }