function openGame(gameId, options){ var gameInfo = Game[gameId]; if (typeof(gameInfo) != "undefined") { var width = 810, height = 610; if (gameInfo.width != '') { width = eval(gameInfo.width); height = eval(gameInfo.height); } else { width = gameInfo.gameWidth; height = gameInfo.gameHeight; } if(gameInfo.resizable=='yes') { var gameAspect = width/height; var screenAspect = screen.width/screen.height; if (gameAspect > screenAspect) { width = screen.width * 0.8; height = width / gameAspect; } else { height = screen.height * 0.8; width = height * gameAspect; } } if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; var name = gameInfo.name; name = name.split("!").join(""); name = name.split(":").join(""); var baseURL = 'http://www.betfred.com/common/gamesroom/InitiateGamesRoom.ashx?language=UK'; // if baseURL is not defined set it to ''. If there is if ( typeof(options)!="undefined" && typeof(options.baseURL) != "undefined" && options.baseURL != null ) { baseURL = options.baseURL; } if(baseURL.indexOf("?")>=0) baseURL = baseURL + "&"; else baseURL = baseURL + "?"; var language = 'ENG'; if(typeof(options)!="undefined" && typeof(options.language)!= 'undefined' && options.language!="") language = options.language; var format = ""; if(typeof(options)!="undefined" && typeof(options.format)!= 'undefined' && options.format!="") format = "&format=" + options.format; var site = ""; if(typeof(options)!="undefined" && typeof(options.site)!= 'undefined' && options.site!="") site = "&host=" + options.site; if(typeof(options)=="undefined" || (options.sessionId=='' || typeof(options.sessionId)=="undefined")) window.open(baseURL+'game=' + gameId + '&host='+ site + format, name, 'location=no,menubar=no,resizable=' + (gameInfo.resizable) + ',scrollbars=no,toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); else { var mode=(options.mode=='' || typeof(options.mode)=="undefined")?'':'&mode='+options.mode; window.open(baseURL+'game=' + gameId + site + '&sessionid=' + options.sessionId + mode + format, name, 'location=no,menubar=no,resizable=' + (gameInfo.resizable) + ',scrollbars=no,toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); } } } function openLobby(sessionId){ var width = 750, height = 800; if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; var isDebug = false; if(sessionId!="") window.open('../Applets/Lobby/index.jsp?sessionid='+ sessionId , "Lobby", 'location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); else window.open('../Applets/Lobby/index.jsp', "Lobby", 'location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); return false; } function openHelp(gameId, sessionId, language) { var gameInfo = Game[gameId]; var lang = "ENG"; if (typeof language!= "undefined") { lang = language; } var sessionIdUrl = ""; if (typeof(sessionId) != "undefined") { sessionIdUrl = "&sessionid=" + sessionId; } if (typeof(gameInfo) != "undefined") { var width = 481, height = 610; if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var scrolls = "no"; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; if (gameId.indexOf ("CGS") == 0 ) { scrolls = "yes"; width = 416; } var name = gameInfo.name; name = name.split("!").join(""); name = name.split(":").join(""); window.open('http://fingames.betfred.com/GameFramework/Help/help.jsp?game=' + gameId + '&language=' + lang + sessionIdUrl, name + 'help', 'location=no,menubar=no,resizable=no,scrollbars=' + scrolls + ',toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); } return false; } function openGamesHistory (game,sessionid, language) { var width = 810, height = 610; if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; var isDebug = false; if (typeof debug != 'undefined') { isDebug = (true == debug); } window.open('http://fingames.betfred.com/GameFramework/History/history.jsp?game='+game+'&sessionid='+sessionid+'&language='+language, 'GamesHistory', 'location=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); } function openGamesResult(game, sessionid, language) { if(language.indexOf("|") != -1) language = language.substring(0, language.indexOf("|")); var url = "../GameFramework/Applets/GameHistory/Games/Pool42/pool42results.jsp?language=" + language + "&sessionid="+sessionid+"&game="+game; var width = 810, height = 610; if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; var isDebug = false; if (typeof debug != 'undefined') { isDebug = (true == debug); } window.open(url, 'GamesResult', 'location=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); } function openGamesStats(game, sessionid, language) { if(language.indexOf("|") != -1) language = language.substring(0, language.indexOf("|")); var url = "../GameFramework/Applets/GameHistory/Games/Pool42/pool42draws.jsp?language=" + language + "&sessionid="+sessionid+"&game="+game; var width = 810, height = 610; if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; var isDebug = false; if (typeof debug != 'undefined') { isDebug = (true == debug); } window.open(url, 'GamesStats', 'location=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); } function openStandaloneKeepAlive(sessionid){ if(typeof sessionid != "undefined" && sessionid != "") parent.frames["keepalive"].location.href = "http://fingames.betfred.com/GameFramework/standalonekeepalive.jsp?sessionid="+sessionid+ "&rad="+Math.random(); } function reopenGame (gameId, options) { var gameInfo = Game[gameId]; if (typeof(gameInfo) != "undefined") { var width = 810, height = 610; if (gameInfo.width != '') { width = eval(gameInfo.width); height = eval(gameInfo.height); } else { width = gameInfo.gameWidth; height = gameInfo.gameHeight; } if (gameInfo.resizable=='yes') { var gameAspect = width/height; var screenAspect = screen.width/screen.height; if (gameAspect > screenAspect) { width = screen.width * 0.8; height = width / gameAspect; } else { height = screen.height * 0.8; width = height * gameAspect; } } if (document.all) { var xMax = screen.width, yMax = screen.height; } else { if (document.layers) { var xMax = window.outerWidth, yMax = window.outerHeight; } else { var xMax = 1024, yMax=768; } } var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; var name = gameInfo.name; name = name.split("!").join(""); name = name.split(":").join(""); var baseURL = 'http://www.betfred.com/common/gamesroom/InitiateGamesRoom.ashx?language=UK'; // if baseURL is not defined set it to ''. If there is if (typeof(options)!="undefined" && typeof(options.baseURL) != "undefined" && options.baseURL != null) { baseURL = options.baseURL; } var language = 'ENG'; if (typeof(options)!="undefined" && typeof(options.language)!= 'undefined' && options.language!="") { language = options.language; } var format = ""; if (typeof(options)!="undefined" && typeof(options.format)!= 'undefined' && options.format!="") { format = "&format=" + options.format; } if (typeof(options)=="undefined" || (options.sessionId=='' || typeof(options.sessionId)=="undefined")) { var gameURL = baseURL; gameURL += '&game='; gameURL += gameId; gameURL += format; location.href = gameURL; if(format!="&format=embedded") window.resizeTo(width, height+64); } else { var mode=(options.mode=='' || typeof(options.mode)=="undefined")?'':'&mode='+options.mode; var gameURL = baseURL; gameURL += '&game='; gameURL += gameId; gameURL += '&sessionid='; gameURL += options.sessionId; gameURL += mode; gameURL += format; location.href = gameURL; if(format!="&format=embedded") window.resizeTo(width, height+64); } } } function openBonusHistory(sessionId) { var width = 800, height = 700; if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var scrolls = "yes"; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; window.open('GamesPromotions/bonushistory.jsp?offerid=CURRENT&sessionid='+sessionId, 'bonusHistory', 'location=no,menubar=no,resizable=yes,scrollbars=' + scrolls + ',toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); return false; } function openLPConversion(sessionId) { var width = 481, height = 500; if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var scrolls = "no"; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; window.open('GamesPromotions/loyaltypointsconversion.jsp?sessionid='+sessionId, 'bonusHistory', 'location=no,menubar=no,resizable=yes,scrollbars=' + scrolls + ',toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); return false; } function openBonusOffers() { var width = 600, height = 610; if (document.all) var xMax = screen.width, yMax = screen.height; else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight; else var xMax = 1024, yMax=768; var scrolls = "yes"; var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2; window.open('GamesPromotions/availableoffers.jsp', 'bonusHistory', 'location=no,menubar=no,resizable=yes,scrollbars=' + scrolls + ',toolbar=no,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset,true).focus(); return false; }