var gameInfoArray = { 'xc_americanroulette':{'name': 'American Roulette', 'w': '850', 'h': '600'}, 'xc_atlantisdiveslots':{'name': 'Atlantis Dive Slots', 'w': '850', 'h': '600'}, 'xc_aztecslots':{'name': 'Aztec Slots', 'w': '850', 'h': '600'}, 'xc_baccarat':{'name': 'Baccarat', 'w': '850', 'h': '600'}, 'xc_blackjack':{'name': 'Blackjack', 'w': '850', 'h': '600'}, 'xc_blackjack_s':{'name': 'Blackjack Surrender', 'w': '850', 'h': '600'}, 'xc_card_wars':{'name': 'Card Wars', 'w': '850', 'h': '600'}, 'xc_caribbeanstud':{'name': 'Caribbean Poker', 'w': '850', 'h': '600'}, 'xc_hold_em':{'name': 'Casino Hold\'Em', 'w': '850', 'h': '600'}, 'xc_wildchinaslots':{'name': 'China MegaWild Slots', 'w': '850', 'h': '600'}, 'xc_cleopatratreasureslots':{'name': 'Cleopatra Slots ', 'w': '850', 'h': '600'}, 'xc_coliseum':{'name': 'Coliseum', 'w': '850', 'h': '600'}, 'xc_craps':{'name': 'Craps', 'w': '850', 'h': '600'}, 'xc_deuceswild4l':{'name': 'Deuces Wild 4 Line', 'w': '850', 'h': '600'}, 'xc_deuceswild':{'name': 'Deuces Wild Video Poker', 'w': '850', 'h': '600'}, 'xc_euroulette':{'name': 'European Roulette', 'w': '850', 'h': '600'}, 'xc_freakyfruitsslots':{'name': 'Freaky Fruits Slots', 'w': '850', 'h': '600'}, 'xc_jacksorbetter':{'name': 'Jacks or Better Video Poker', 'w': '850', 'h': '600'}, 'xc_jokerwild':{'name': 'Joker Wild Video Poker', 'w': '850', 'h': '600'}, 'xc_keno':{'name': 'Keno', 'w': '850', 'h': '600'}, 'xc_letitride':{'name': 'Let Them Ride', 'w': '850', 'h': '600'}, 'xc_mexicoslots':{'name': 'Mexico Slots', 'w': '850', 'h': '600'}, 'mp_baccarat':{'name': 'Multiplayer Baccarat', 'w': '850', 'h': '600'}, 'mp_blackjack':{'name': 'Multiplayer blackjack', 'w': '850', 'h': '600'}, 'mp_euroulette':{'name': 'Multiplayer Roulette', 'w': '850', 'h': '600'}, 'xc_mysticslots':{'name': 'Mystic Slots', 'w': '850', 'h': '600'}, 'xc_olympicslots':{'name': 'Olympic Slots', 'w': '850', 'h': '600'}, 'xc_paigowpoker':{'name': 'Pai Gow Poker', 'w': '850', 'h': '600'}, 'xc_partynightslots':{'name': 'Party Night Slots', 'w': '850', 'h': '600'}, 'xc_pirateslots':{'name': 'Pirate Slots', 'w': '850', 'h': '600'}, 'xc_sic_bo':{'name': 'Sic Bo', 'w': '850', 'h': '600'}, 'xc_spintheworldslots':{'name': 'Spin the world ', 'w': '850', 'h': '600'}, 'xc_poker_three':{'name': 'Three Card Poker', 'w': '850', 'h': '600'}, 'XG_BNW':{'name': 'Black And White', 'w': '750', 'h': '487'}, 'XG_SHILO':{'name': 'Bonus Cards', 'w': '700', 'h': '440'}, 'XG_HOR':{'name': 'Derby', 'w': '750', 'h': '475'}, 'XG_VGR':{'name': 'Greyhounds Park', 'w': '750', 'h': '435'}, 'XG_LOTTO_SMC':{'name': 'Instant Lotto', 'w': '750', 'h': '600'}, 'XG_ALEX_SMC':{'name': 'Jackpot 7', 'w': '750', 'h': '585'}, 'XG_WOF':{'name': 'Lucky Wheel', 'w': '750', 'h': '520'}, 'XG_PNLT':{'name': 'Penalty Shootout', 'w': '755', 'h': '420'}, 'XG_HPSHOT':{'name': 'Potshot', 'w': '700', 'h': '515'}, 'XG_ROLLUP':{'name': 'Rollup', 'w': '700', 'h': '500'}, 'XG_PSHOT':{'name': 'Soccer Shot', 'w': '700', 'h': '535'}, 'mp_ah':{'name': 'Air Hockey', 'w': '850', 'h': '600'}, 'mp_a2d':{'name': 'Archipelago', 'w': '850', 'h': '600'}, 'mp_bs':{'name': 'Battle Ships', 'w': '850', 'h': '600'}, 'mp_ch':{'name': 'Dino Checkers', 'w': '850', 'h': '600'}, 'mp_fool':{'name': 'Fool', 'w': '850', 'h': '600'}, 'mp_t3':{'name': 'Tic-tac-Toe', 'w': '850', 'h': '600'}, 'mp_totem':{'name': 'Totem Quest', 'w': '850', 'h': '600'} , 'XCasino': {'name': 'Lobby', 'w': 850, 'h': 600}}; var gameHelpLinks = { 'xc_freakyfruitsslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/crazy_slots_rules.html', 'xc_deuceswild4l': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/deuces_wild_rules.html', 'xc_americanroulette': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/roulette_am_rules.html', 'xc_aztecslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/aztec_slots_rules.html', 'xc_baccarat': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/baccarat_rules.html', 'xc_blackjack': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/bj_rules.html', 'xc_blackjack_s': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/bj_surrender_rules.html', 'xc_card_wars': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/card_wars_rules.html', 'xc_caribbeanstud': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/carib_poker_rules.html', 'xc_hold_em': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/casinoholdem_rules.html', 'xc_wildchinaslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/china_slots_rules.html', 'xc_cleopatratreasureslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/cleopatra_slots_rules.html', 'xc_craps': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/craps_rules.html', 'xc_deuceswild': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/deuces_wild_rules.html', 'xc_euroulette': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/roulette_rules.html', 'xc_fruitsaladjackpotslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/fruit_salad_rules.html', 'xc_jacksorbetter': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/jacks_better_rules.html', 'xc_jokerwild': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/joker_wild_rules.html', 'xc_keno': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/keno_rules.html', 'xc_letitride': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/let_them_ride_rules.html', 'xc_mexicoslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/mexican_slot_rules.html', 'xc_mysticslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/mystic_slots_rules.html', 'xc_olympicslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/olympic_slots_rules.html', 'xc_partynightslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/partyslots_rules.html', 'xc_pirateslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/pirat_slot_rules.html', 'xc_poker_three': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/poker_three_rules.html', 'xc_spintheworldslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/world_slots_rules.html', 'xc_atlantisdiveslots': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/atlantida_slots_rules.html', 'xc_coliseum': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/coliseum_poker_rules.html', 'xc_paigowpoker': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/paigow_rules.html', 'xc_sic_bo': 'http://demo3.ctxm.com/casino/client/application/backend/rules/en/sicbo_rules.html', 'XG_BNW': 'help/xg_help/en/bnw.htm', 'XG_SHILO': 'help/xg_help/en/bonus_cards.htm', 'XG_HOR': 'help/xg_help/en/derby_horses.htm', 'XG_VGR': 'help/xg_help/en/greyhounds.htm', 'XG_LOTTO7': 'help/xg_help/en/lotto7.htm', 'XG_ALEX': 'help/xg_help/en/alex.htm', 'XG_WOF': 'help/xg_help/en/wof.htm', 'XG_PNLT': 'help/xg_help/en/penalty_shootout.htm', 'XG_PBPOKER': 'help/xg_help/en/pokerbet.htm', 'XG_HPSHOT': 'help/xg_help/en/potshot.htm', 'XG_ROLLUP': 'help/xg_help/en/rollup.htm', 'XG_PSHOT': 'help/xg_help/en/soccer_potshot.htm' }; var labelMaximize = 'maximize'; var labelMinimize = 'normal size'; // 0 - normal // 1 - maximized // 2 - new window var gameLauncherMode = 0; var currentGameCode = false; var currentGamePlay = false; var gameLauncherWindow; function hideOptionalBlocks() { var ftg = document.getElementById('featured_game_list'); if(ftg) ftg.style.display = 'none'; } function hideAllOptionalBlocks() { hideOptionalBlocks(); var opt_w = document.getElementById('optional_widgets'); var gw = document.getElementById('game_widgets'); if(opt_w) opt_w.style.display = 'none'; if(gw) gw.style.display = 'none'; document.getElementById('game_widgets').style.display = 'block'; var gwx = document.getElementById('game_widgets_x'); if(gwx) gwx.style.display = 'block'; } function showAllOptionalBlocks() { document.getElementById('optional_widgets').style.display = 'block'; document.getElementById('featured_game_list').style.display = 'block'; document.getElementById('game_widgets').style.display = 'none'; var gwx = document.getElementById('game_widgets_x'); if(gwx) gwx.style.display = 'none'; } function openHelpForGame(id) { var x = Math.round(Math.abs((screen.availWidth - 800) / 2)); var y = Math.round(Math.abs((screen.availHeight - 640) / 2)); window.open(gameHelpLinks[id], 'help_popup', 'width=800, height=640, left=' + x + ', top=' + y + ', location=no, menubar=no, location=no, status=no, toolbar=no, scrollbars=yes, resizable=yes'); return false; } function openGame(id, type, norelaunch) { currentGameCode = id; currentGamePlay = type; var launchURL; // Open money play if(type == 1) { launchURL = 'gameLauncher.html?id=' + id; } // Open fun play else { launchURL = 'playForFun.html?id=' + id; } if(gameLauncherWindow) gameLauncherWindow.close(); var isArcade = false; var oldLauncherMode = gameLauncherMode; var btn_maximize = document.getElementById('btn_maximize'); if(id.indexOf('mp_') == 0) { if(gameLauncherMode == 0) gameLauncherMode = 1; isArcade = true; if(btn_maximize) btn_maximize.style.display = 'none'; } else { if(btn_maximize) btn_maximize.style.display = 'block'; } switch(gameLauncherMode) { case 0: showAllOptionalBlocks(); hideOptionalBlocks(); document.getElementById('game_buttons').className = ''; var glTag = document.getElementById('game_launcher'); glTag.style.width = '673px'; glTag.style.height = '509px'; if(window.isIE6) glTag.style.left = '0px'; else glTag.style.left = '247px'; glTag.style.display = 'block'; var bnt_help = document.getElementById('game_bnt_help'); if(gameHelpLinks[id] && gameHelpLinks[id].length > 0) { bnt_help.parentNode.style.display = 'block'; bnt_help.href = gameHelpLinks[id]; bnt_help.gameId = id; } else { bnt_help.parentNode.style.display = 'none'; } var glIframe = glTag.getElementsByTagName('iframe')[0]; glIframe.style.width = '673px'; glIframe.style.height = '509px'; var miniGames = document.getElementById('mini_games'); if(miniGames) { miniGames.style.display = 'block'; document.getElementById('optional_widgets').insertBefore(miniGames, document.getElementById('jackpot_widget')); document.getElementById('footer').style.marginTop = '10px'; } if(gameInfoArray[id]) document.getElementById('game_btn_name').innerHTML = gameInfoArray[id].name; if(norelaunch != 1) glIframe.src = launchURL + '&mode=0'; break; case 1: gameLauncherMode = oldLauncherMode; hideAllOptionalBlocks(); document.getElementById('game_buttons').className = 'game_buttons_long'; document.getElementById('game_widgets').style.top = '965px'; var glTag = document.getElementById('game_launcher'); glTag.style.width = '929px'; glTag.style.height = '675px'; if(window.isIE6) glTag.style.left = '-245px'; else glTag.style.left = '0px'; //glTag.style.left = '0px'; glTag.style.display = 'block'; var bnt_help = document.getElementById('game_bnt_help'); if(gameHelpLinks[id] && gameHelpLinks[id].length > 0) { bnt_help.parentNode.style.display = 'block'; bnt_help.href = gameHelpLinks[id]; bnt_help.gameId = id; } else { bnt_help.parentNode.style.display = 'none'; } var glIframe = glTag.getElementsByTagName('iframe')[0]; glIframe.style.width = '929px'; glIframe.style.height = '675px'; var miniGames = document.getElementById('mini_games'); if(miniGames) { miniGames.style.display = 'block'; document.getElementById('game_widgets').insertBefore(miniGames, document.getElementById('game_widgets').getElementsByTagName('*')[0]); document.getElementById('footer').style.marginTop = '250px'; } if(gameInfoArray[id]) document.getElementById('game_btn_name').innerHTML = gameInfoArray[id].name; if(norelaunch != 1) glIframe.src = launchURL + '&mode=1'; break; case 2: showAllOptionalBlocks(); var glTag = document.getElementById('game_launcher'); glTag.style.display = 'none'; var glIframe = glTag.getElementsByTagName('iframe')[0]; glIframe.src = 'about:blank'; var w = gameInfoArray[id] ? gameInfoArray[id].w : 860; var h = gameInfoArray[id] ? gameInfoArray[id].h : 600; gameLauncherWindow = window.open(launchURL + '&mode=', 'xc_launcher', 'width=' + w + ', height=' + h + ', location=no, menubar=no, location=no, status=no, toolbar=no, scrollbars=yes, resizable=yes'); if(gameLauncherWindow) gameLauncherWindow.focus(); gameLauncherMode = 0; break; } //alert("opening game: "+id+" in "+(type == 1 ? 'real' : 'fun') +" mode."); } function switchLauncherMode(targetTag) { switch(gameLauncherMode) { case 0: gameLauncherMode = 1; openGame(currentGameCode, currentGamePlay, 1); targetTag.innerHTML = labelMinimize; break; case 1: gameLauncherMode = 0; openGame(currentGameCode, currentGamePlay, 1); targetTag.innerHTML = labelMaximize; break; } } function switchLauncherToWindow() { gameLauncherMode = 2; openGame(currentGameCode, currentGamePlay); }