'; } else { signupPromoTop = ''; signupContainerTop = ''; } if(typeof signupPromoBottom !== 'undefined' && signupPromoBottom !== ''){ signupContainerBottom = ''; } else { signupPromoBottom = ''; signupContainerBottom = ''; } function preroll_signup_top_handler(){ trackEvent('Preroll Signup Clicked', 'Preroll Signup Top', document.title); } function preroll_signup_bottom_handler(){ trackEvent('Preroll Signup Clicked', 'Preroll Signup Bottom', document.title); } '; } else { signupPromoTop = ''; signupContainerTop = ''; } if (typeof signupPromoBottom !== 'undefined' && signupPromoBottom !== '') { signupContainerBottom = ''; } else { signupPromoBottom = ''; signupContainerBottom = ''; } function preroll_signup_top_handler() { trackEvent('Preroll Signup Clicked', 'Preroll Signup Top', document.title); } function preroll_signup_bottom_handler() { trackEvent('Preroll Signup Clicked', 'Preroll Signup Bottom', document.title); } // we will define this varialbe signUpURLABTest in experiments.js var cmg_upg_days_limit = 180; var user_dst = window.location.pathname; user_dst = user_dst.replace("/", ""); if (window.location.host !== 'cmatgame.local') { if (typeof signUpURL === 'undefined' || signUpURL === '') { signUpURL = '/signup/b2df5a33?origin=' + user_dst; } else { signUpURL = signUpURL + '?origin=' + user_dst; } } else if (typeof signUpURLABTest === "undefined" || signUpURLABTest === null) { signUpURL = 'https://' + window.location.hostname + '/signup/b2df5a33?origin=' + user_dst; } else { signUpURL = signUpURLABTest; } function subscription_promo_handler() { if (typeof freeTrialUser !== 'undefined' && freeTrialUser) { trackEvent('Premium Subscription ' + subscriberLeg, 'Subscription overlay clicked', userPlayedGames); trackGoalVirtualPV('/virtual/subscription-overlay-click'); } return; } function subscriptionSignUpUrl() { var user_played_games = ''; var zeroFreeGamesLeftUsers = localStorage.getItem("zeroFreeGamesLeftUsers"); if (typeof userPlayedGames !== 'undefined' && userPlayedGames) { user_played_games = "upg=" + userPlayedGames; } else { user_played_games = "upg=0"; } if (zeroFreeGamesLeftUsers !== null && user_played_games !== '') { user_played_games = user_played_games + '&zfg=' + zeroFreeGamesLeftUsers; } else if (zeroFreeGamesLeftUsers !== null) { user_played_games = 'zfg=' + zeroFreeGamesLeftUsers; } if (typeof signUpURL !== 'undefined' && signUpURL !== null && signUpURL.indexOf('upg') === -1) { if (signUpURL.indexOf('?random_true') > -1) { signUpURL = signUpURL.replace('?random_true', ''); } if (signUpURL.indexOf('?') > -1) { signUpURL = signUpURL + '&' + user_played_games; } else { signUpURL = signUpURL + '?' + user_played_games; } } } function removePrerollAndDisplayGame() { //console.log('remove ad swf'); if (isRemoveAdSwfJWPLayer) { //remove preroll only once console.log('ad swf player already removed'); } else { console.log('removeAdSwfJWPLayer called'); // destroys video player completely if (typeof Bolt !== 'undefined') { Bolt.removeVideo('cmg-player', true); } jQuery("#my-content").css("opacity", "1"); if(typeof intervalId != "undefined") { clearInterval(intervalId); } jQuery("#afg_container").remove(); jQuery("#afg_preloader").remove(); jQuery("#continue-container").remove(); if (!drupalSettings.cmatgame.swfembed) { console.log('removeAdSwfJWPLayer: html5 game'); //html5 game game width, game height and game type game_width = jQuery("#html5game").attr("width"); game_height = jQuery("#html5game").attr("height"); game_type = "html5"; // IE Detection and Version grabbing ie = false; var html5_game_url = jQuery("#html5game").attr("src"); var swf_game_url = jQuery("#swfgame").attr("src"); if (typeof swf_game_url !== 'undefined') { if (!checkIfFlashIsEnabled()) { //console.log('flash is undefined'); flashDetectionMessage(); } } if (typeof swf_game_url !== 'undefined' && swf_game_url.indexOf("//") === 0) { swf_game_url = window.location.protocol + swf_game_url; } else if (typeof swf_game_url !== 'undefined' && swf_game_url.indexOf("//") > 0) { swf_game_url = swf_game_url.replace("http:", window.location.protocol); } if (typeof html5_game_url !== 'undefined' && html5_game_url.indexOf("//") === 0) { html5_game_url = window.location.protocol + html5_game_url; } else if (typeof html5_game_url !== 'undefined' && html5_game_url.indexOf("//") > 0) { html5_game_url = html5_game_url.replace("http:", window.location.protocol); } if (navigator.appName == "Microsoft Internet Explorer") { ie = true; var ua = navigator.userAgent; var re = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"); if (re.exec(ua) != null) { ieVersion = parseInt(RegExp.$1) } } if (ie && ieVersion Hey, you're using an older web browser that can't play HTML5 games like this one.
Please switch to another browser or just enjoy a different Coolmath game!' + 'div>
Get a new Internet Explorer browser from Microsoft
Please switch to another browser or just enjoy a different Coolmath game!' + 'div>
Get a new Internet Explorer browser from Microsoft
' + gameInstructions.innerHTML; } } isRemoveAdSwfJWPLayer = true; } } } } function cmatgame_premium_subscription_game_display() { var cmatgame_subscriber = getCookie('cmg_sx'); var validSubscriber = false; if (typeof cmatgame_subscriber !== 'undefined' && cmatgame_subscriber !== null) { validSubscriber = true; } if (typeof subscribeNowAlienClass === 'undefined' || subscribeNowAlienClass === null || subscribeNowAlienClass === '') { // if (drupalSettings.cmatgame.isSubscriptionActive == false) { // subscribeNowAlienClass = "subscribe-now-alien-subscribe"; // } else { // subscribeNowAlienClass = "subscribe-now-alien-signup"; // } } freeGamesExceeded = true; //display Ads to anonymous users the time from 7am to 13pm, display ads to anonymous users from 13pm to 11:59pm and 00 to 7am only if the user is not from New York city //TODO -->Need to add day of the week for school hours logic, day 0) { userFreeGameList = userFreeGameList.concat(freeGameNid); } else { userFreeGameList = [freeGameNid]; } localStorage.setItem("userPlayedGames", userPlayedGames); sessionStorage.setItem("userFreeGameList", JSON.stringify(userFreeGameList)); } else { freeGamesExceeded = true; } //console.log("Number of games user has played "+ userPlayedGames ); var validReferer = false; var validGameSession = false; if (userFreeGameList.indexOf(freeGameNid) > -1) { validGameSession = true; } if (ref.match("google.com") !== null || ref.match("yahoo.com") !== null || ref.match("bing.com") !== null) { validReferer = true; } subscriptionSignUpUrl(); if (!validReferer && userPlayedGames >= freeGameLimit && !validGameSession) { //subscription paywall //block anonymous users for New York City from 0-7am and 13pm to 11:59pm console.log("Free games limit exceeded and referer is not google"); clearInterval(intervalId); jQuery("#afg_container").remove(); jQuery(".title-instructions").remove(); jQuery(".body-instructions").remove(); var alreadySubscriberText = '
Already a Subscriber? Login
Please Sign up to keep playing
PLEASE SUBSCRIBE NOW TO KEEP PLAYING
The World's Best Collection of Games For Logic, Reasoning & Fun. Subscribe Now' + alreadySubscriberText + '
Instructions
Use the mouse to control your Chess pieces. Your objective is to capture your opponent's pieces from the board and get a checkmate, where the King can be captured and the opponent is unable to prevent the King from being captured with their next move.
Continued here: