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://es.betfred.com/finsoft/sections/commongames/initiategamesroom.asp'; // if baseURL is not defined set it to ''. If there is if ( options.baseURL != undefined && options.baseURL != null ) { baseURL = options.baseURL; } var language = 'ENG'; if(options.language!= '' && typeof(options.language)!="undefined") language = options.language; if(options.sessionId=='' || typeof(options.sessionId)=="undefined") window.open(baseURL+'?game=' + gameId , 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 + '&sessionid=' + options.sessionId + mode , 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, language){ var gameInfo = Game[gameId]; var lang = "ENG"; if(typeof language!= "undefined") lang = language; 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.es.betfred.com/GameFramework/Help/help.jsp?game=' + gameId + '&language=' + lang, 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.es.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.es.betfred.com/GameFramework/standalonekeepalive.jsp?sessionid="+sessionid+ "&rad="+Math.random(); }