Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
458 kB
1
Indexable
Never


<!DOCTYPE html><html lang="en" dir="ltr" prefix="content: http://purl.org/rss/1.0/modules/content/  dc: http://purl.org/dc/terms/  foaf: http://xmlns.com/foaf/0.1/  og: http://ogp.me/ns#  rdfs: http://www.w3.org/2000/01/rdf-schema#  schema: http://schema.org/  sioc: http://rdfs.org/sioc/ns#  sioct: http://rdfs.org/sioc/types#  skos: http://www.w3.org/2004/02/skos/core#  xsd: http://www.w3.org/2001/XMLSchema# " rel="optimized"><head><script type="text/javascript">
  /*!@shinsenter/defer.js@3.5.0*/
  !(function(t,u){function e(n){t.addEventListener(n,N)}function o(n){t.removeEventListener(n,N)}function s(n,t,e){k?I(n,t):((e===u?s.lazy:e)?L:C).push(n,t)}function i(n){A.head.appendChild(n)}function c(n,t){j.call(n.attributes)[g](function(n){t(n.name,n.value)})}function r(n,t,e,o){return o=t&&A.getElementById(t)||A.createElement(n),t&&(o.id=t),e&&(o.onload=e),o}function f(n,t){return j.call((t||A).querySelectorAll(n))}function a(o,n){f("source,img",o)[g](a),c(o,function(n,t,e){(e=/^data-(.+)/.exec(n))&&o[b](e[1],t)}),"string"==typeof n&&n&&(o.className+=" "+n),h in o&&o[h]()}function n(n,t,e){s(function(t){(t=f(n||"script[type=deferjs]"))[g](function(n,e){n.src&&(e=r(d),c(n,function(n,t){n!=w&&e[b]("src"==n?"href":n,t)}),e.rel="preload",e.as=p,i(e))}),(function o(n,e){(n=t[E]())&&(e=r(p),c(n,function(n,t){n!=w&&e[b](n,t)}),e.text=n.text,n.parentNode.replaceChild(e,n),e.src&&!e.getAttribute("async")?e.onload=e.onerror=o:o())})()},t,e)}var l="Defer",d="link",p="script",h="load",m="pageshow",y=["touchstart","keydown","mousemove","wheel"],v="on"+m in t?m:h,g="forEach",b="setAttribute",E="shift",w="type",x=t.IntersectionObserver,A=t.document||t,I=t.setTimeout,j=y.slice,k=/p/.test(A.readyState),C=[],L=[],N=function(n,t){for(t=n.type==v?(o(v),k=s,y[g](e),C):(y[g](o),L);t[0];)I(t[E](),t[E]())};n(),s.all=n,s.dom=function(n,t,c,i,r){s(function(e){function o(n){i&&!1===i(n)||a(n,c)}e=x?new x(function(n){n[g](function(n,t){n.isIntersecting&&(e.unobserve(t=n.target),o(t))})},r):u,f(n||"[data-src]")[g](function(n){n[l]!=s&&(n[l]=s,e?e.observe(n):o(n))})},t,!1)},s.css=function(t,e,n,o,c){s(function(n){(n=r(d,e,o)).rel="stylesheet",n.href=t,i(n)},n,c)},s.js=function(t,e,n,o,c){s(function(n){(n=r(p,e,o)).src=t,i(n)},n,c)},s.reveal=a,t[l]=s,k||e(v)})(this);
  </script><link rel="preload" as="image" href="/themes/custom/coolmath/logo.svg"><link rel="preconnect" href="https://cdn.intergi.com" /><link rel="dns-prefetch" href="https://cdn.intergi.com" /><link rel="preconnect" href="https://use.typekit.net" /><link rel="dns-prefetch" href="https://use.typekit.net" /><link rel="preconnect" href="z.moatads.com" /><link rel="dns-prefetch" href="z.moatads.com" /><script type="deferjs" src="/modules/custom/cmatgame_ads_analytics/js/advertisement-ads.js"></script><link rel="apple-touch-icon" href="https://www.coolmathgames.com/pwa/images/icon-512x512.png"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="theme-color" content="#2A445D" /><meta charset="utf-8" />
<style>/* @see https://github.com/aFarkas/lazysizes#broken-image-symbol */.js img.lazyload:not([src]) { visibility: hidden; }/* @see https://github.com/aFarkas/lazysizes#automatically-setting-the-sizes-attribute */.js img.lazyloaded[data-sizes=auto] { display: block; width: 100%; }</style>
<link rel="canonical" href="//www.coolmathgames.com/0-jacksmith" />
<meta name="keywords" content="jack, smith, jacksmith" />
<meta property="og:title" content="Jacksmith - Play online at Coolmath Games" />
<link rel="alternate" hreflang="en" data-type="category" href="https://www.coolmathgames.com/0-jacksmith" />
<link rel="alternate" hreflang="es" data-type="category" href="https://www.coolmathgames.com/es/0-jacksmith" />
<link rel="alternate" hreflang="pt-br" data-type="category" href="https://www.coolmathgames.com/pt-br/0-jacksmith" />
<link rel="alternate" hreflang="fr" data-type="category" href="https://www.coolmathgames.com/fr/0-jacksmith" />
<link rel="alternate" hreflang="hi" data-type="category" href="https://www.coolmathgames.com/hi/0-jacksmith" />
<link rel="alternate" hreflang="it" data-type="category" href="https://www.coolmathgames.com/it/0-jacksmith" />
<link rel="alternate" hreflang="zh-hans" data-type="category" href="https://www.coolmathgames.com/zh-hans/0-jacksmith" />
<link rel="alternate" hreflang="fil" data-type="category" href="https://www.coolmathgames.com/fil/0-jacksmith" />
<link rel="alternate" hreflang="ja" data-type="category" href="https://www.coolmathgames.com/ja/0-jacksmith" />
<link rel="alternate" hreflang="vi" data-type="category" href="https://www.coolmathgames.com/vi/0-jacksmith" />
<meta name="description" content="In Jacksmith, players must follow the instructions to craft awesome weapons and armor. Work carefully and find secret recipes to make the best gear." />
<meta property="og:description" content="In Jacksmith, players must follow the instructions to craft awesome weapons and armor. Work carefully and find secret recipes to make the best gear." />
<meta property="og:image" content="https://www.coolmathgames.com/sites/default/files/Jacksmith%20OG%20Image.png" />
<meta property="og:image:alt" content="Jacksmith Game Screenshot" />
<meta property="og:type" content="article" />
<meta property="og:url" content="//www.coolmathgames.com/0-jacksmith" />
<script type="text/javascript">

   //mobile detect
   function cmg_is_mobile_device() {
     var bEle = document.documentElement;
     if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
       bEle.classList.add("mobile-device");
       bEle.classList.remove("dtp-device");
       return true;
     } else {
       if (navigator.maxTouchPoints == 5) {
         bEle.classList.add("mobile-device");
         bEle.classList.remove("dtp-device");
         return true;
       } else {
         bEle.classList.add("dtp-device");
         bEle.classList.remove("mobile-device");
         return false;
       }
     }
   }
   cmg_is_mobile_device();
  </script>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no maximum-scale=1.0, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<style>@charset "UTF-8";.clearfix{clear:both;content:"";display:block}.game-item{margin-bottom:20px;overflow:hidden}body{color:#fff}a.login{color:#29bffd}.clearfix{clear:both;content:"";display:block}.clearfix{clear:both;content:"";display:block}@media (min-width:960px){.node-type-game #main-row.row{padding-top:60px}}@media (min-width:1140px) and (max-width:1319.98px){.node-type-game .container-fluid .row.pb-3.large-game-item{justify-content:center!important}}.game-stage{align-content:stretch;align-items:center;background:#060d19;border-radius:10px;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;min-height:220px;position:relative}@media (min-width:960px){.game-stage{padding:0 0 100px}}@media (max-width:959.98px){.game-stage{padding:0}}#afg_container{align-self:auto;flex:0 1 auto;order:0;position:relative;text-align:center;z-index:0}#afg_container .load-wrap{position:absolute;top:200px}#afg_preloader{display:block}#container123{position:relative;z-index:1}.game-instructions{background:#060d19;border-radius:10px 10px 0 0;display:block}.game-instructions h3,.game-instructions h4{text-transform:none!important}.game-instructions h3,.game-instructions h4{margin-bottom:.5rem}.game-instructions h4{line-height:1.2rem}.block-gamedetailcarousel,.block-system-main-block{position:relative}.faqs-list{margin-top:-25px;padding-bottom:10px}.game-instructions h3{font-size:1.188rem;line-height:1.938rem}.game-instructions h4{font-size:1.063rem;line-height:1.688rem}.game-instructions .games-like-this{font-size:1.188rem;line-height:1.2;margin-top:20px}@media (min-width:768px){.game-instructions .games-like-this{line-height:1.938}}.game-instructions p{font-size:1rem;line-height:1.25rem}.node__content .field-game{background:#060d19;border-radius:10px 10px 0 0;display:flex!important;font-size:0}.game-field-wrapper #no-flash-overlay{text-align:center}.node__content{position:relative}.node-type-game .inside .view-header{font-size:1.2em}.node-type-game .inside .view-header p{color:#fff;font-size:18px;margin-top:15px}.node-type-game .inside h1.pane-title{background:0 0;border:0;border-radius:0;color:#fff;font-size:20px!important;height:auto;line-height:1.5rem;margin:0;padding:0;position:relative}@media (min-width:960px){.node-type-game .inside h1.pane-title{font-size:27px!important;line-height:1}}.node-type-game .game-carousel .slide-item:not(.mobile-hidden){display:block!important}.node-type-game .game-carousel .slide-item .game-item{height:auto;margin:0;min-width:0;overflow:hidden;padding:.25rem}.node-type-game .game-carousel .slide-item .game-item .game-link-wrapper{border-radius:calc(.25rem + 1px);overflow:hidden;position:relative}.node-type-game .game-carousel .slide-item .game-item .game-link-wrapper .field-image{max-height:74px;position:relative}.node-type-game .game-carousel .slide-item .game-item .game-link-wrapper .field-image:before{background:linear-gradient(0deg,#060e19d9,#16202c00);content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.node-type-game .game-carousel .slide-item .game-item .game-link-wrapper img{background-color:initial;border:none;float:none;height:auto;margin-right:0;padding:0;width:100%}.node-type-game .game-carousel .slide-item .game-item .game-title{-webkit-line-clamp:2;-webkit-box-orient:vertical;bottom:.25rem;color:#fff;display:-webkit-box;font-family:Proxima-Soft-Bold!important;font-size:13px;left:0;line-height:1.15;margin:0;overflow:hidden;padding:0 8px;position:absolute;text-overflow:ellipsis;width:100%;z-index:3}.node-type-game .game-carousel .slide-item .game-item video{height:100%;left:0;min-height:100%;object-fit:cover;opacity:0;position:absolute;top:0;width:100%;z-index:1}@media (max-width:559.98px){.node-type-game .game-carousel .slide-item .field-image{border-color:#3896c5!important}.node-type-game .game-carousel .slide-item .game-title{display:block!important}}.close-full-screen{margin:0;text-align:right}.close-full-screen a.btn{line-height:1em;margin:0;padding:2px 3px!important}.close-full-screen a.btn span{font-size:16px;padding-left:4px;position:relative;text-decoration:none;top:-2px}.close-full-screen a.btn i{font-size:25px;padding-left:10px}.field-game{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;min-height:480px}.node-type-game h1.pane-title{text-transform:capitalize}.node-type-game .close-full-screen,.node-type-game .game-xp-bar-immerse-button{display:none}#does-not-support-ie{padding:20px 0;text-align:center}.game-page-mobile{min-height:373px}.game-page-mobile .game-stage{border-radius:10px 10px 0 0!important;overflow:hidden;padding-top:0}.game-page-mobile .game-image{position:relative}.game-page-mobile .game-image img{height:100%}.game-page-mobile .game-image img{height:auto;width:100%}.game-page-mobile .game-image #playNowButton{border-radius:50%;height:88px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:88px;z-index:1;z-index:0}.game-page-mobile .game-image #playNowButton:before{animation:playPulse 2s infinite;background:#fff;border-radius:50%;content:"";height:118%;left:-9%;position:absolute;top:-9%;width:118%;z-index:-1}.game-page-mobile .game-image #playNowButton:after{background:#56eeb7;border-radius:50%;content:"";height:100%;position:absolute;width:100%;z-index:1}.game-page-mobile .game-image #playNowButton svg{height:34px;left:50%;position:absolute;top:50%;transform:scaleX(1.1) translate(-50%,-50%);width:40px;z-index:2}@keyframes playPulse{0%{box-shadow:0 0 0 0 #fff;transform:scale(.9)}50%{box-shadow:0 0 0 0 #fff0;transform:scale(1)}to{box-shadow:0 0 0 0 #fff0;transform:scale(.9)}}.btn{text-transform:capitalize}#big-screen-container{background:#2b455e;border:2px solid #f1f55e;height:608px;margin:0 auto;padding:0 15px;position:relative;width:560px}.image-bs-sample{float:left;padding-left:40px}.big-screen-head{background-color:#111926;height:52px}.mid-big-section-head{background-color:#2b455e;height:552px;margin:0 auto;padding-top:42px;text-align:center}.big-screen-container-class .img-container-big-screen{height:270px!important}.img-container-big-screen{height:220px;padding-top:30px}.bs-head-txt{color:#f1f55e;float:left;font-size:1.2rem;padding-left:73px;padding-top:13px;text-align:center}.big-screen-container-class .bs-head-txt{padding-left:50px!important}.bs-head-logo{float:left;padding-left:10px;padding-top:2px}.bs-close-button{background-color:#4298ef;border-radius:50px;color:#000!important;float:left;height:35px;margin-left:95px;margin-top:8px;padding-left:50;padding-top:8px;text-align:center;width:35px}.big-screen-container-class .bs-close-button{margin-left:auto!important;position:relative;right:10px}.big-screen-container-class .bs-close-button a{color:#000!important}.bs-close-btn{color:#000;font-weight:700}.bs-footer-link{padding-top:25px}.bs-learn-more{color:#d9af58;font-size:.85rem;letter-spacing:.5px;padding-top:5px;text-align:center}.bs-lrn-more{color:#d9af58!important;text-underline-position:under}.bs-lrn-more,.bs-no-thks{text-decoration:underline}.bs-no-thks{letter-spacing:.5px;padding-top:30px;text-align:center;text-underline-position:under}.bs-no-thks a{color:#fff}.bs-lnk-lrn-more{color:#fff!important}.adfree-marketing-campaign{background-color:#16202c;border:2px solid #ff0;height:600px;width:600px}.adfree-marketing-campaign .mid-big-section-head{height:532px!important}.adfree-marketing-campaign .bs-head-txt{color:#f6c555!important;padding-left:35px!important}.adfree-marketing-campaign .bs-head-logo{float:left;padding-left:10px;padding-top:2px;width:100px}.adfree-mid-section-marketing-campaign .sup-bold{font-size:120%;font-weight:700}.adfree-mid-section-marketing-campaign .sup-bold-2{color:#06ddb5;font-size:110%;font-weight:700}.adfree-mid-section-marketing-campaign .mkt-container1{float:left;height:100px;text-align:right;width:171px}.adfree-mid-section-marketing-campaign .ad-free-txt{color:#06ddb5;float:left;font-size:16px;font-weight:700;height:125px;letter-spacing:.65px;padding-left:10px;padding-top:42px;text-align:left;width:360px}.adfree-mid-section-marketing-campaign .image-bs-sample{float:left;padding-left:20px}.adfree-mid-section-marketing-campaign .image-better-focus{float:left;padding-left:175px}.adfree-mid-section-marketing-campaign .no-waiting-txt{color:#fff;float:left;font-size:13px;letter-spacing:.65px;padding-left:10px;padding-top:18px;text-align:left;width:200px}.adfree-mid-section-marketing-campaign .better-focus-container{height:133px;text-align:center;width:100%}.adfree-mid-section-marketing-campaign .all-excl-txt{color:#c2a960;float:left;font-size:1.1rem;height:50px;letter-spacing:.75px;padding-left:50px;padding-top:13px;text-align:center;width:100%}.img-container-big-screen{text-align:center}.marketing-cmpn-footer{background-color:#16202c}.bs-close-button a{color:#29bffc!important}.view-display-id-carousel_game_detail{margin-bottom:15px}.view-display-id-carousel_game_detail .view-header{align-items:center;display:flex;font-size:1.1em}.view-display-id-carousel_game_detail .view-header p{font-family:Proxima-Soft-Bold;letter-spacing:1px;margin:18px 0 13px}.no-select{-webkit-touch-callout:none}#videoplayer{height:480px;min-height:1px;width:640px}.load-wrap{margin-bottom:15px;padding-top:20px;width:100%}.rating{align-items:center;background:#060d19;border-radius:0 0 10px 10px;display:block!important;display:flex;flex-direction:column;height:45px;justify-content:center;margin:5px 0 0}.rating .rating-val{background:#1b283b;border-radius:34px;float:left;font-size:17px;height:46px;padding:12px;width:70px}.rating .rating-val img{float:right;margin-top:3px}.rating .cmg_game_tot_cnt{float:left;font-size:12px;line-height:14px;margin-bottom:auto;margin-left:10px;margin-top:auto;position:relative;top:10px;width:100px}.block-related-game-block,.cmg-gamepage-block{position:relative;z-index:0}.cmg-gamepage-block{background:#060d19;border-radius:.625rem;margin-bottom:1.25rem;padding:.875rem 1.25rem 1.25rem}@media (min-width:960px){.cmg-gamepage-block{padding:1.75rem calc(2.25rem - 1px) calc(2.25rem - 1px)}}.cmg-gamepage-block h2.title{font:700 1.25rem/1.29 Proxima-Soft-Bold;margin:0 0 calc(1rem + 1px);text-transform:capitalize}@media (min-width:560px){.cmg-gamepage-block h2.title{font-size:1.375rem;margin-bottom:1rem}}@media (min-width:768px){.cmg-gamepage-block h2.title{font-size:1.375rem;margin-bottom:1.25rem}}@media (min-width:1140px){.cmg-gamepage-block h2.title{font-size:1.375rem;margin-bottom:1.25rem}}.cmg-popular-near-block{box-shadow:0 5px 0 #21465f;position:relative}@media (min-width:960px){.cmg-popular-near-block{display:flex;min-height:285px;padding-top:calc(2.25rem - 1px)}}.cmg-games-grid{display:flex;flex-wrap:wrap;margin:0 -.5rem 0 calc(-.5rem + 1px)}@media (min-width:768px){.cmg-games-grid{margin:0 -.625rem}}@media (min-width:960px){.cmg-games-grid{margin:0 -.625rem -1.25rem}}.cmg-games-grid .game-item{flex:0 0 188px;-ms-flex:0 0 188px;height:auto;margin:0 0 calc(1rem - 1px);max-width:188px;min-width:0;overflow:visible;padding:0 calc(.5rem - 1px) 0 .5rem;width:100%}@media (min-width:768px){.cmg-games-grid .game-item{margin-bottom:1.25rem;padding:0 .625rem}}.cmg-games-grid .game-item .game-link-wrapper{border-radius:.625rem;overflow:hidden;position:relative}.cmg-games-grid .game-item .game-link-wrapper a{color:#fff}.cmg-games-grid .game-item .game-link-wrapper .field-image:before{background:linear-gradient(0deg,rgba(6,14,25,.851),#16202c00);content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.cmg-games-grid .game-item .game-link-wrapper img{border:none;float:none;height:auto;margin:0;padding:0;width:100%}.cmg-games-grid .game-item-content{bottom:0;left:0;padding-bottom:.375rem;position:absolute;right:0;z-index:3}.cmg-games-grid .game-item-content .game-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;font:700 calc(.75rem + 1px)/1.17 Proxima-Soft-Bold;margin:0 0 .25rem;overflow:hidden;padding:0 .375rem}@media (min-width:768px){.cmg-games-grid .game-item-content .game-title{font-size:17px;margin-bottom:.375rem;padding:0 .75rem}}@media (min-width:960px){.cmg-games-grid .game-item-content .game-title{font-size:.875rem}}@media (min-width:1140px){.cmg-games-grid .game-item-content .game-title{font-size:17px}}.grid-col-4 .game-item{flex:0 0 50%;-ms-flex:0 0 50%;max-width:50%}@media (min-width:560px){.grid-col-4 .game-item{flex:0 0 33.33%;max-width:33.33%}}@media (min-width:768px){.grid-col-4 .game-item{flex:0 0 50%;max-width:50%}}@media (min-width:960px){.grid-col-4 .game-item{flex:0 0 25%;max-width:25%}}@media (max-width:959.98px){#main-row{margin-top:20px}}.game-meta-body{background:#060d19;border-radius:10px;margin-bottom:20px;padding:20px 35px 35px;position:relative}@media (max-width:959.98px){.game-meta-body{padding:12px 20px 20px}}@media (min-width:768px){.game-meta-body .cmg-game-xp-right-block{display:none}}.game-progress-dsp{background:#060d19;border-radius:.625rem;margin-bottom:1.25rem}.game-progress-dsp .gamexp-title{text-transform:capitalize}@media (min-width:960px){.game-progress-dsp{max-width:300px}}@media (min-width:768px){.game-progress-dsp{display:flex;flex-direction:column;margin-bottom:0;min-width:300px;padding:.75rem}}.game-progress-dsp>header{margin-bottom:.875rem}@media (min-width:768px){.game-progress-dsp>header{order:2}.game-progress-dsp>footer{order:5}}.game-progress-dsp .login-status .cls-1{fill:#ffe420;opacity:0}.gamexp-header{display:flex;font:700 1.125rem/1.29 Proxima-Soft-Bold,sans-serif;justify-content:space-between;margin:0}@media (min-width:768px){.gamexp-header{padding:0 .5rem}}.gamexp-header .gamexp-percent{color:#ffe420}.gamexp-bar{position:relative}@media (min-width:768px){.gamexp-bar{order:1}}.gamexp-bar .progress{background:#1b283b;border-radius:.75rem;height:calc(.75rem - 1px);margin-bottom:calc(1rem + 1px)}@media (min-width:768px){.gamexp-bar .progress{margin-bottom:calc(1.25rem - 1px)}}.gamexp-bar .progress .progress-bar{background:#ffe420}.gamexp-bar .progress-bullets{margin:0;padding:0}.gamexp-bar .bullet{background:#060d19;border:.25rem solid #1b283b;border-radius:1rem;display:block;height:calc(1rem - 1px);list-style:none;position:absolute;top:-.125rem;width:calc(1rem - 1px)}.gamexp-bar .bullet.bullet-1{left:calc(10% - 1rem + 1px)}.gamexp-bar .bullet.bullet-2{left:calc(20% - 1rem + 1px)}.gamexp-bar .bullet.bullet-3{left:calc(30% - 1rem + 1px)}.gamexp-bar .bullet.bullet-4{left:calc(40% - 1rem + 1px)}.gamexp-bar .bullet.bullet-5{left:calc(50% - 1rem + 1px)}.gamexp-bar .bullet.bullet-6{left:calc(60% - 1rem + 1px)}.gamexp-bar .bullet.bullet-7{left:calc(70% - 1rem + 1px)}.gamexp-bar .bullet.bullet-8{left:calc(80% - 1rem + 1px)}.gamexp-bar .bullet.bullet-9{left:calc(90% - 1rem + 1px)}.gamexp-bar .bullet.bullet-10{left:calc(100% - 1rem + 1px)}.gamexp-bar-container{display:none;justify-content:space-between}@media (min-width:768px){.gamexp-bar-container{align-items:center;display:flex;order:3;padding:0 .5rem}}.gamexp-reward{background:#141a27;border-radius:2rem;font:400 1.125rem/1.29 Proxima-Soft-Regular,sans-serif;padding:.75rem 1.25rem;position:relative;white-space:nowrap}.gamexp-reward .login-status{position:absolute;right:-6px;top:-7px}.gamexp-reward .login-status span{background:#000000f2;border-radius:3px;color:#fff;display:none;font:12px Proxima-Soft-Regular;left:50%;line-height:1;max-width:110px;padding:3px 8px;position:absolute;text-align:center;top:30px;transform:translateX(-50%);white-space:normal;width:max-content}@media (min-width:960px) and (max-width:1280px){.gamexp-reward .login-status span{max-width:100px}}.gamexp-msg{align-items:center;display:flex}@media (min-width:768px){.gamexp-msg{display:none;margin-top:.25rem;padding:0 .5rem}}.gamexp-msg .login-status span{display:inline-block;margin-right:9px;vertical-align:middle}.gamexp-msg a{color:#ffe420;font-size:calc(1rem - 1px)}.node-type-game .block-simple-blocknode-pages-promo-config-user-profiles{display:none}#newFlashDetectHtml{width:100%}.new-game-bg{position:relative}.new-game-bg:after{background:linear-gradient(180deg,#060e1900,#060e19a6);content:"";height:100%;left:0;position:absolute;top:0;width:100%}.new-game-bg .bg-img{display:block;width:100%}.flash-text{font-family:Proxima-Soft-Bold,sans-serif;left:50%;margin:auto;max-width:500px;max-width:calc(100% - 40px);padding:0 20px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:530px;z-index:1}.flash-text .big-txt{font-size:20px;line-height:1.2}.flash-text .small-txt{font-size:14px}.flash-text .small-txt img{padding-left:5px}.flash-text .flash-icon{margin:0 auto 20px;width:65px}.flash-related{margin-bottom:15px}.flash-related .common-title{font-family:Proxima-Soft-Bold,sans-serif;font-size:16px;margin-bottom:15px;text-transform:capitalize}.flash-related .cmg-games-grid{flex-wrap:nowrap;overflow:auto;padding:.25rem 0}.flash-related .cmg-games-grid::-webkit-scrollbar{-webkit-appearance:none;display:none;width:0}.flash-related .cmg-games-grid .game-item{flex:0 0 calc(50vw - 38px);max-width:calc(50vw - 38px)}@media (min-width:560px){.flash-related .cmg-games-grid .game-item{flex:0 0 calc(33.33vw - 24px);max-width:calc(33.33vw - 24px)}}@media (min-width:768px){.flash-related .cmg-games-grid .game-item{flex:0 0 calc(50% - 12px);max-width:calc(50% - 12px)}}@media (min-width:960px){.flash-related .cmg-games-grid .game-item{flex:0 0 calc(25% - 6px);max-width:calc(25% - 6px)}}@media (max-width:959.98px){.flash-related .cmg-games-grid .game-item .game-link-wrapper img:not(.lazyloaded){height:77px}}.flash-related .cmg-games-grid .game-item-content .game-title{font-size:14px}.game-page-mobile .game-image{margin:auto!important;width:100%}.game-page-mobile .flash-text{width:255px}.game-page-mobile .flash-text .big-txt{font-size:18px}@media (max-width:959.98px){.flash-text .flash-icon{display:none}}.game-meta-header{background:#060d19;border-radius:0 0 10px 10px;display:block!important;padding:4px 35px 20px;position:relative;width:100%}@media (min-width:960px){.game-meta-header{margin:-90px 0 35px}}@media (max-width:959.98px){.game-meta-header{margin:0 0 20px;padding:12px 20px 30px}}.game-meta-header .breadcrumb{background:0 0!important;color:#29bffd;float:left;margin-bottom:5px;margin-right:10px}@media (max-width:360px){.game-meta-header .breadcrumb{font-size:13px}}.game-meta-header .breadcrumb a{color:#29bffd;font-family:Proxima-Soft-Bold}.game-meta-header .breadcrumb span{padding-left:5px;padding-right:5px}.game-meta-header h1{clear:both;max-width:50%}@media (min-width:960px){.game-meta-header h1{padding-top:10px}}@media (max-width:959.98px){.game-meta-header h1{font-family:Proxima-Soft-Bold;font-size:20px!important;font-weight:700;letter-spacing:0;line-height:24px;text-align:left}}.game-meta-header .user-controls label{text-transform:capitalize}@media (max-width:959.98px){.game-meta-header .user-controls label{display:none;display:none!important}}.game-meta-header .user-controls #game-favorite a.entity-node{border-radius:0 0 5px 5px;display:block;height:41px;width:45px}.game-meta-header .user-controls #game-favorite label{background:#141a27;border-radius:3px;color:#fff;font-family:Proxima-Soft-Regular;font-size:13px;height:21px;left:50%;letter-spacing:0;line-height:16px;opacity:0;padding:2px 7px;position:relative;text-align:center;top:0;transform:translateX(-50%);white-space:nowrap}.game-meta-header .user-controls #game-favorite label.remove-favorite{display:none;text-decoration:none}@media (min-width:960px){.game-meta-header .user-controls #game-favorite .popup-wrapper{bottom:40px;height:256px;right:0;width:300px}}@media (max-width:959.98px){.game-meta-header .user-controls #game-favorite .popup-wrapper{height:200px;width:100%}}@media (min-width:960px){.game-meta-header .user-controls #game-control-instructions .popup-wrapper{bottom:40px;height:200px;right:0;width:300px}}@media (max-width:959.98px){.game-meta-header .user-controls #game-control-instructions .popup-wrapper{height:200px;width:100%}}.game-meta-header .popup-wrapper{min-width:320px;overflow:hidden;visibility:hidden;z-index:4}@media (min-width:960px){.game-meta-header .popup-wrapper{position:absolute}}@media (max-width:959.98px){.game-meta-header .popup-wrapper{bottom:0;left:0;position:fixed;width:100%}}@media (max-width:559.98px){.game-meta-header .popup-wrapper{height:270px}}.not-active-user #favorite-logged-in{display:none}.node img{height:auto;max-width:100%}*,:after,:before{box-sizing:border-box}html{-webkit-text-size-adjust:100%;font-family:sans-serif;line-height:1.15}article,aside,footer,header,main,nav{display:block}body{background-color:#16202c;color:#fff;font-family:Proxima-Soft-Regular,Helvetica,Arial,sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:1rem;font-weight:400;line-height:1.2;margin:0;text-align:left}hr{box-sizing:initial;height:0;overflow:visible}h1,h2,h3,h4,h5{margin-bottom:.5rem;margin-top:0}p{margin-bottom:1rem;margin-top:0}ul{margin-bottom:1rem}ul{margin-top:0}ul ul{margin-bottom:0}strong{font-weight:bolder}a{background-color:initial;color:#29bffd;text-decoration:none}img{border-style:none}img,svg{vertical-align:middle}svg{overflow:hidden}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button,input{font-family:inherit;font-size:inherit;line-height:inherit;margin:0}button,input{overflow:visible}button{text-transform:none}[type=button],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.h2,.h3,h1,h2,h3,h4,h5{font-weight:500;line-height:1.2;margin-bottom:.5rem}h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}h4{font-size:1.5rem}h5{font-size:1.25rem}hr{border:0;border-top:0 solid #0000001a;margin-top:1rem}.img-fluid{height:auto;max-width:100%}.form-control{background-clip:padding-box;background-color:#16202c;border:0 solid #ced4da;border-radius:.25rem;color:#e9f6fe;display:block;font-size:1rem;font-weight:400;height:40px;line-height:1.2;padding:.5rem 1.5rem;width:100%}.form-control::-ms-expand{background-color:initial;border:0}.form-text{display:block;margin-top:0}.btn{background-color:initial;border:0 solid #0000;border-radius:.25rem;color:#fff;display:inline-block;font-weight:400;line-height:1.2;padding:.5rem 1.5rem;text-align:center;vertical-align:middle}.btn-primary{background-color:#29bffd;border-color:#29bffd;color:#212529}.btn-sm{border-radius:.2rem;font-size:.875rem;line-height:1.5;padding:.3rem 1rem}.navbar{padding:.5rem 1rem;position:relative}.navbar,.navbar>.container{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.navbar-toggler{background-color:initial;border:0 solid #0000;border-radius:.25rem;font-size:1.25rem;line-height:1;padding:.25rem .75rem}@media (max-width:959.98px){.navbar-expand-lg>.container{padding-left:0;padding-right:0}}@media (min-width:960px){.navbar-expand-lg{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-lg>.container{flex-wrap:nowrap}}.breadcrumb{background-color:#16202c;border-radius:.25rem;display:flex;flex-wrap:wrap;list-style:none;margin-bottom:1rem;padding:.75rem 1rem}.badge{border-radius:.25rem;display:inline-block;font-size:100%;font-weight:700;line-height:1;padding:.4em .8em;text-align:center;vertical-align:initial;white-space:nowrap}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.progress{background-color:#e9ecef;border-radius:.25rem;display:flex;font-size:.75rem;height:2rem;overflow:hidden}.progress-bar{background-color:#f7c649;color:#000;display:flex;flex-direction:column;justify-content:center;text-align:center;white-space:nowrap}.clearfix:after{clear:both;content:"";display:block}.d-none{display:none!important}@media (min-width:768px){.d-md-block{display:block!important}}@media (min-width:960px){.d-lg-none{display:none!important}.d-lg-block{display:block!important}}@media (min-width:1140px){.d-xl-block{display:block!important}}@media (min-width:1320px){.d-xxl-block{display:block!important}}.flex-nowrap{flex-wrap:nowrap!important}.justify-content-between{justify-content:space-between!important}.mt-0{margin-top:0!important}.mb-1{margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important}.my-2{margin-bottom:.5rem!important}.mt-3{margin-top:1rem!important}.my-4{margin-top:1.5rem!important}.mr-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.p-0{padding:0!important}.pr-0{padding-right:0!important}.pl-0{padding-left:0!important}.pb-3{padding-bottom:1rem!important}@media (min-width:768px){.mr-md-0{margin-right:0!important}.pr-md-0{padding-right:0!important}.pl-md-3{padding-left:1rem!important}}@media (min-width:960px){.my-lg-0{margin-top:0!important}.my-lg-0{margin-bottom:0!important}.ml-lg-3{margin-left:1rem!important}.pl-lg-0{padding-left:0!important}}@media (min-width:1140px){.pr-xl-0{padding-right:0!important}}@media (min-width:1320px){.ml-xxl-0{margin-left:0!important}}.text-center{text-align:center!important}.clearfix{clear:both;content:"";display:block}input:-internal-autofill-selected,input:-webkit-autofill{-webkit-text-fill-color:#fff;background-color:#16202c!important;border:1px solid #16202c;color:#e9f6fe}form .form-control{font-size:1rem}.mobile-menu-items .mi-title{font-size:20px;margin-bottom:5px;margin-top:20px}.mobile-menu-items .mi-title:first-child{margin-top:0}.mobile-menu-items .pane-menu-menu-desktop-header-menu .pane-content>ul.menu{display:table!important}.mobile-menu-items .welcome-box{clear:both}.mobile-menu-items .welcome-box .login-link p{text-align:right}.mobile-menu-items .pane-cmatgame-search-search-game #cmatgame-search-block-form .form-item:before{align-items:center;background:#fdcd3b url(/themes/custom/coolmath/assets/images/sprite.png) no-repeat -50px 3px/285px;border:4px solid #e9d93c;content:"";display:flex;height:40px;left:0;padding-left:8px;position:absolute;top:0;width:50px;z-index:999}.mobile-menu-items .pane-cmatgame-search-search-game #cmatgame-search-block-form .form-item .form-text{border-color:#e9d93c!important;border-left:50px solid #e9d93c!important}body,html{font-family:Proxima-Soft-Regular,Helvetica,Arial,sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue!important}main{overflow-x:hidden;width:100%}.h2,.h3,h1,h2{color:#fff;font-family:Proxima-Soft-Bold;font-size:1rem;text-transform:uppercase}h1{font-size:1.125rem;line-height:1.375rem}h2{font-size:1.3rem}h3{color:#fff;font-family:Proxima-Soft-Bold;font-size:1rem}h4{margin-bottom:1rem}h4,h5{font-family:Proxima-Soft-Bold;font-size:1.1rem}h1.pane-title{background-image:none;border-bottom:2px solid #f1db00;color:#fff;font-family:Proxima-Soft-Bold;font-size:1.25rem;line-height:1.5rem;margin-bottom:20px;margin-top:-4px;padding:0 0 3px;position:relative;text-transform:uppercase}@media (min-width:960px){h1.pane-title{background-color:#2c6792;border:none;border-radius:10px;font-size:1.4rem;height:30px;padding:3px 0 3px 14px}}@media (-ms-high-contrast:none){h1.pane-title{padding-top:0}}p{line-height:1.2rem;margin-bottom:1rem}strong{font-family:Proxima-Soft-Bold}hr{border-top:1px solid #67b1e7;clear:both;height:1px;margin-bottom:1rem;margin-top:0!important}.breadcrumb{padding:0}.btn{border:0;font-family:Proxima-Soft-Bold;font-size:1rem;line-height:1.2rem;min-width:190px;padding:.65rem 1.5rem;text-transform:uppercase}.btn{text-decoration:none}.btn.btn-primary{margin-bottom:1rem;padding:.65rem 1.5rem .55rem}.btn.btn-primary.btn-sm{min-width:10px;padding:.3rem 1.5rem .25rem}a.btn{color:#000;font-size:.75rem}.leaderboard .col-12{padding-left:0;padding-right:0}.block-adstop-otherpage-728x90{height:132px;margin:60px auto -60px;width:728px}@media (min-width:768px){.block-adstop-otherpage-728x90{max-width:728px}}@media (max-width:767.98px){.block-adstop-otherpage-728x90{height:90px!important;margin-bottom:-30px!important;margin-top:10px!important;width:360px}}.block-adstop-otherpage-728x90 .ad-wrapper{height:90px}.pane-cmatgame-advertisement-cm-g-otherpages-728-90 .ad-wrapper{height:90px}.node-type-game .block-adstop-otherpage-728x90{margin-bottom:0;margin-top:0}.block-adsleft-otherpage-160x600{height:600px;top:0;width:160px}@media (min-width:768px) and (max-width:959.98px){.node-type-game .block-adstop-otherpage-728x90{display:none}}.node-type-game .block-adsleft-otherpage-160x600{margin-left:0!important}#r-modal{background:#000;bottom:0;color:#fff;display:none;left:0;position:fixed;right:0;text-align:center;top:0;width:100%;z-index:999999}p.advertisment{color:#fff;font-size:14px;position:relative;text-align:center;top:5px}.main-aside .pane-cmatgame-advertisement-cm-g-otherpages-300x250-top .ad-wrapper{height:250px}.pane-cmatgame-advertisement-cm-g-otherpages-160x600-left .ad-wrapper{height:600px}#afg_preloader #adcontainer{height:480px;width:640px}#yourCookieChoices{background-color:#398ada;bottom:0;color:#fff;display:flex;justify-content:space-between;left:0;min-height:70px;position:fixed;width:100%;z-index:100}#yourCookieChoices .cookie-text{font-family:Proxima-Soft-Regular;font-size:1rem;font-weight:700;height:46px;position:relative;top:15px;vertical-align:middle}#yourCookieChoices .cookie-mobile{padding-left:0!important;text-align:center}@media (max-width:959.98px){#yourCookieChoices .cookie-mobile{margin-bottom:30px;margin-top:30px}}#yourCookieChoices a.cookies-link{color:#fff;display:block;text-decoration:underline}#yourCookieChoices span.imokwiththat-close{background:url(/sites/default/files/gdpr/imokwiththat.png) no-repeat;display:inline-block;height:30px;margin:0 auto;position:relative;text-indent:-9999px;top:-6px;width:130px}@font-face{font-display:block;font-display:auto;font-family:icomoon;font-style:normal;font-weight:400;src:url(/themes/custom/coolmath/assets/fonts/icomoon/fonts/icomoon.eot);src:url(/themes/custom/coolmath/assets/fonts/icomoon/fonts/icomoon.eot#iefix) format("embedded-opentype"),url(/themes/custom/coolmath/assets/fonts/icomoon/fonts/icomoon.ttf) format("truetype"),url(/themes/custom/coolmath/assets/fonts/icomoon/fonts/icomoon.woff) format("woff"),url(/themes/custom/coolmath/assets/fonts/icomoon/fonts/icomoon.svg#icomoon) format("svg")}[class^=icon-]{speak:never;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:icomoon!important;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.icon-remove_sign:before{content:"\f057"}@font-face{font-display:swap;font-family:Proxima-Soft-Regular;font-style:normal;font-weight:400;src:url(https://use.typekit.net/af/a727c9/00000000000000007735af8e/30/l?primer=17a7c0c26ea1a0ceb252e7b3b13a85d065242c28860757c895e3cdc8ccff7b55&fvd=n4&v=3) format("woff2"),url(https://use.typekit.net/af/a727c9/00000000000000007735af8e/30/d?primer=17a7c0c26ea1a0ceb252e7b3b13a85d065242c28860757c895e3cdc8ccff7b55&fvd=n4&v=3) format("woff"),url(https://use.typekit.net/af/a727c9/00000000000000007735af8e/30/a?primer=17a7c0c26ea1a0ceb252e7b3b13a85d065242c28860757c895e3cdc8ccff7b55&fvd=n4&v=3) format("opentype")}@font-face{font-display:swap;font-family:Proxima-Soft-Bold;font-style:normal;font-weight:700;src:url(https://use.typekit.net/af/81cbd6/00000000000000007735afa9/30/l?primer=17a7c0c26ea1a0ceb252e7b3b13a85d065242c28860757c895e3cdc8ccff7b55&fvd=n7&v=3) format("woff2"),url(https://use.typekit.net/af/81cbd6/00000000000000007735afa9/30/d?primer=17a7c0c26ea1a0ceb252e7b3b13a85d065242c28860757c895e3cdc8ccff7b55&fvd=n7&v=3) format("woff"),url(https://use.typekit.net/af/81cbd6/00000000000000007735afa9/30/a?primer=17a7c0c26ea1a0ceb252e7b3b13a85d065242c28860757c895e3cdc8ccff7b55&fvd=n7&v=3) format("opentype")}main nav.navbar{padding:.5rem 0;position:relative;z-index:100}.pane-menu-menu-desktop-header-menu .pane-content>.menu>li>.nolink,.pane-menu-menu-desktop-header-menu .pane-content>.menu>li>a{color:#f5e61f;display:block;font-family:Proxima-Soft-Bold;font-size:1.5rem;line-height:18px;text-align:center;text-transform:uppercase;width:100%}.pane-menu-menu-desktop-header-menu .pane-content .menu{padding:0}.pane-menu-menu-desktop-header-menu .pane-content .menu li.is-expanded .nolink:before,.pane-menu-menu-desktop-header-menu .pane-content .menu li.is-expanded a:before{border-color:#0000}.pane-menu-menu-desktop-header-menu .pane-content .menu li{border-bottom:0;display:block;position:relative;vertical-align:bottom}.pane-menu-menu-desktop-header-menu .pane-content .menu li a{color:#f5e61f;display:block;font-family:Proxima-Soft-Bold;font-size:1.4rem;line-height:18px;overflow:hidden;text-align:center;text-transform:uppercase;vertical-align:middle;width:100%}.pane-menu-menu-desktop-header-menu .pane-content .menu li a.menu_all.games{border-radius:11px}@media (min-width:1140px){.pane-menu-menu-desktop-header-menu .pane-content .menu li.menu_all.games.menu__link{left:0;position:relative}}.pane-menu-menu-desktop-header-menu .pane-content .menu li .menu__link,.pane-menu-menu-desktop-header-menu .pane-content .menu li .nolink{border-bottom:2px solid #c78f00;border-right:1px solid #c78f00;border-top:.5px solid #f1b034;color:#654900;font-size:1.09rem;padding:10px 11px 12px}.pane-menu-menu-desktop-header-menu .pane-content .menu .menu_more.menu__link.nolink{font-size:1.08rem;padding:10px 25px 12px 12px}.pane-menu-menu-desktop-header-menu .pane-content .menu .is-expanded .menu{border:0;margin-top:0}.pane-menu-menu-desktop-header-menu .pane-content .menu .is-expanded .menu li a{padding:0;width:100px}.pane-menu-menu-desktop-header-menu .pane-content .menu .is-expanded .menu li.nested{background:#fcd792;background:linear-gradient(180deg,#f5e765 34%,#fad94d 94%,#c18500);list-style-type:none}.pane-menu-menu-desktop-header-menu .pane-content .menu .is-expanded .menu li.nested:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.pane-menu-menu-desktop-header-menu .pane-content .menu .is-expanded .menu li.nested:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.pane-menu-menu-desktop-header-menu .pane-content .menu .is-expanded .menu li.nested .menu__link{background-color:initial;color:#654900;font-size:.75rem;padding:7px;width:100px}@media (min-width:1140px){.pane-menu-menu-desktop-header-menu{min-width:1070px}}@media (min-width:960px) and (max-width:1139.98px){.pane-menu-menu-desktop-header-menu{min-width:890px}}.pane-menu-menu-desktop-header-menu .pane-content>.menu{display:table;padding:0}@media (min-width:1140px){.pane-menu-menu-desktop-header-menu .pane-content>.menu{max-width:1080px}}@media (min-width:960px) and (max-width:1139.98px){.pane-menu-menu-desktop-header-menu .pane-content>.menu{max-width:900px}}.pane-menu-menu-desktop-header-menu .pane-content>.menu li.menu_strategy,.pane-menu-menu-desktop-header-menu .pane-content>.menu li.menu_strategy a{border-bottom-left-radius:12px;border-top-left-radius:12px}.pane-menu-menu-desktop-header-menu .pane-content>.menu li a.menu_unlocked{border-bottom-right-radius:12px;border-top-right-radius:12px}.pane-menu-menu-desktop-header-menu .pane-content>.menu li .nolink{font-size:1rem}.pane-menu-menu-desktop-header-menu .pane-content>.menu>li{background:#f5e765;background:linear-gradient(180deg,#f5e765,#fad94d 41%,#ffbe00);float:left;list-style-type:none;position:relative;vertical-align:bottom}.pane-menu-menu-desktop-header-menu .pane-content>.menu>li.is-expanded>.nolink{color:#654900;min-width:100px;position:relative}.pane-menu-menu-desktop-header-menu .pane-content>.menu>li.is-expanded>.nolink:after{border-left:7px solid #0000;border-right:7px solid #0000;border-top:7px solid #654900;content:"";height:0;position:absolute;right:9px;top:17px;width:0}.pane-menu-menu-desktop-header-menu .pane-content>.menu li:first-child{border-bottom-left-radius:12px;border-top-left-radius:12px}.pane-menu-menu-desktop-header-menu .pane-content>.menu .menu_unlocked.menu__link{border-bottom-right-radius:12px;border-top-right-radius:12px}@media (min-width:1140px){.pane-menu-menu-desktop-header-menu .pane-content>.menu li.menu_all.games.menu__link{margin-left:11px}}@media (min-width:960px) and (max-width:1139.98px){.pane-menu-menu-desktop-header-menu .pane-content>.menu li.menu_all.games.menu__link{margin-left:8px}}.pane-menu-menu-desktop-header-menu .pane-content>.menu>li:last-child{background:#fff950;border-radius:11px}@media (min-width:1140px){.pane-menu-menu-desktop-header-menu .pane-content>.menu>li:last-child a.menu_all.games{padding:10px 32px 12px}}.pane-menu-menu-desktop-header-menu .pane-content>.menu .menu{border-top:none;display:none;margin-top:1px;position:absolute;z-index:10000}.pane-menu-menu-desktop-header-menu .pane-content>.menu .menu li a{color:#fff;display:block;padding:11px 0 10px 30px;width:110px}@media (min-width:960px) and (max-width:1139.98px){.pane-menu-menu-desktop-header-menu{width:960px}.pane-menu-menu-desktop-header-menu .pane-content .menu li .menu_more.menu__link.nolink{font-size:1rem!important;min-width:85px!important;padding:10px 28px 12px 6px!important}.pane-menu-menu-desktop-header-menu .pane-content .menu li a.menu__link,.pane-menu-menu-desktop-header-menu .pane-content>.menu>li:last-child a.menu_all.games{font-size:1rem;padding:10px 8px 12px 7.5px}}@media (max-width:959.98px){.menu_random.menu__link.random-redirect{display:none}}.navbar-container{width:100%}@media (max-width:959.98px){.navbar-container{padding:0 10px}}.navbar-container .welcome-box{margin:0 auto;max-width:270px}.navbar-container .welcome-box .btn{white-space:normal}.navbar .navbar-toggler{height:30px;position:fixed;right:20px;top:30px;width:30px;z-index:1000}@media (max-width:559.98px){.navbar .navbar-toggler{top:15px}}.navbar .navbar-toggler .bar{background-color:#f1db00;border-radius:4px;box-shadow:0 2px 0 #0009;height:3px;left:0;position:absolute;top:0;width:30px}.navbar .navbar-toggler .bar.second{top:9px}.navbar .navbar-toggler .bar.third{bottom:-9px;top:18px}.page__header_mobile .menu-overlay{background-color:#000;display:none;height:100%;left:0;opacity:0;position:fixed;top:0;width:100%}.page__header_mobile .navbar-container{background:#2a455d;height:100%!important;overflow-x:hidden;padding-top:30px;position:fixed;right:-100%;top:0;width:100%}.page__header_mobile .navbar-container .welcome-box{position:relative;text-align:center;top:-10px}.page__header_mobile .navbar-container a{color:#46b8fd;font-family:Proxima-Soft-Bold}.page__header_mobile .navbar-container .mobile-menu-items{margin:0 auto;max-width:300px}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu{display:block}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu li{background:0 0;border:none;border-radius:0!important;display:block;float:left;margin:0;width:50%}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu li.menu_all.games{font-weight:700;width:50%}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu li.is-expanded{width:100%}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu li a{background:0 0;border:none;border-radius:0!important;color:#46b8fd;font-family:Proxima-Soft-Bold;font-size:1.275rem;padding:10px 10px 10px 0!important;text-align:left;text-transform:none}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu li .nolink{background:0 0;border:none;color:#fff;font-family:Proxima-Soft-Regular;font-size:1.275rem!important;padding:10px 10px 10px 0!important;text-align:left;text-transform:none}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu li .nolink:after{border-top-color:#fff;left:50px}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu ul.menu{display:none;position:relative}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu ul.menu li.nested{background:0 0}.page__header_mobile .navbar-container .pane-menu-menu-desktop-header-menu .pane-content ul.menu ul.menu li.nested a.menu__link{color:#46b8fd;font-size:1.275rem;width:100%!important}.page__header_mobile .navbar-container .cmatgame-search-game{clear:both;height:35px;left:0;margin:15px auto 0;position:relative;top:0;width:100%;z-index:100000}.page__header_mobile .navbar-container .cmatgame-search-game label{display:none}.page__header_mobile .navbar-container .cmatgame-search-game #cmatgame-search-block-form input.menu-search-bar{background-image:none;border:4px solid #e9d93c;border-radius:0!important;box-shadow:inset 0 -1px 0 #ddd;display:block!important;height:40px;left:0;margin:0;max-width:340px;outline:0;padding:10px;right:auto;text-indent:0}.page__header_mobile .navbar-container .cmatgame-search-game #cmatgame-search-block-form .search-results-container{top:40px}#cmatgame-search-block-form label{background:#f5e765;background:linear-gradient(180deg,#f5e765,#fad94d 41%,#ffbe00);border-bottom:2px solid #c78f00;border-radius:10px;border-top:.5px solid #f1b034;height:43px;position:absolute;right:0;text-indent:-99999px;top:11px;width:60px}#cmatgame-search-block-form label:before{background:url(/themes/custom/coolmath/assets/images/sprite.png) no-repeat -61px 0/300px;content:"";height:26px;left:16px;position:absolute;top:7px;width:26px}#cmatgame-search-block-form input.menu-search-bar{background-image:url(/themes/custom/coolmath/assets/images/close.png);background-position:4px 4px;background-repeat:no-repeat;border:4px solid #e9d93c;border-radius:8px;display:block;font-family:Proxima-Soft-Regular;font-size:16px;height:44px;margin:9px;outline:0;position:absolute;right:-9px;text-indent:72px;top:0;width:100%}#close-search-box{color:#000;content:"X";font-size:0;height:42px;left:0;position:absolute;right:410px;top:10px;width:55px;z-index:999999}.search-results-container{border:4px solid #e9d93c;border-top:0;display:block;left:0;max-height:565px;overflow-x:hidden;overflow-y:auto;position:absolute;text-align:left;top:48px;width:100%;z-index:999}.pane-cmatgame-search-search-game{position:absolute;right:0;top:-11px;width:380px}.pane-cmatgame-search-search-game .form-item{margin:0}input::-webkit-input-placeholder{color:#cdcdcd!important}header.page__header{background-color:#2a455d;height:142px}header.page__header .branding.container{height:114px;position:relative;width:1140px}@media (max-width:1139.98px){header.page__header .branding.container{width:960px}}@media (min-width:1140px) and (max-width:1319.98px){header.page__header .navbar.navbar-expand-lg{min-width:1140px}}@media (min-width:960px) and (max-width:1139.98px){header.page__header .navbar{min-width:960px}}header.page__header .navbar .container{position:relative;width:1140px}@media (max-width:1139.98px){header.page__header .navbar .container{width:960px}}.pane-bean-new-go-ad-free{align-items:center;display:flex;left:0;position:relative;top:20px}.pane-bean-new-go-ad-free a{background-position:top;border-radius:.5rem;display:block;display:inline-block;font-family:Proxima-Soft-Bold;position:relative;text-transform:uppercase}.pane-bean-new-go-ad-free a.go-ad-free-btn{background:#00c2fe;border:2px solid #29bffd;border-radius:10px;color:#fff;color:#16202c;filter:drop-shadow(3px 3px 1px #000);font-size:14px;padding:12px 18px}.pane-bean-new-go-ad-free a.go-ad-free-btn:before{border-radius:.25rem;bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}.logo-container{height:93px;position:relative;text-align:center;top:25px;width:440px}.logo-container img,.logo-container img.logo.svg{filter:drop-shadow(1px 1px 1px #000)!important;max-width:100%}header.page__header_mobile{background:#2a455d;height:80px}@media (max-width:559.98px){header.page__header_mobile{height:50px}}header.page__header_mobile .logo-container-mobile{margin-top:12px}header.page__header_mobile .logo-container-mobile img.logo.svg{filter:drop-shadow(2px 2px 1px #000);max-width:300px}@media (max-width:559.98px){header.page__header_mobile .logo-container-mobile{margin-top:12px}header.page__header_mobile .logo-container-mobile img.logo.svg{height:auto;max-width:200px}}@media (max-width:959.98px){.menu_most{display:block!important;float:inherit!important;width:100%!important}}.menu_most{display:none!important}@media (max-width:959.98px){.menu_most{display:block!important;float:inherit!important}}.menu_strategy{border-bottom-left-radius:12px;border-top-left-radius:12px}.site-branding__logo{display:block;position:relative}.site-branding__logo .logo.svg{left:0;position:absolute;top:0;z-index:0}@media (max-width:959.98px){.site-branding__logo .logo.svg{position:unset}}.navbar-expand-lg>.container{padding:0}.container,.container-fluid{margin-top:0}@media (min-width:768px){#main-row.row{padding-top:60px!important}}@media (max-width:767.98px){#main-row.row{padding-top:20px!important}#main-row.row .block-adstop-otherpage-728x90{margin-bottom:0!important}.main-aside{display:none}}html{height:-webkit-fill-available}body,html{height:100%}.dialog-off-canvas-main-canvas{display:flex;flex-direction:column;height:100%}.page{flex-grow:1}.node img{height:auto;max-width:100%}.game-item{height:72px;margin-bottom:10px;min-width:300px;overflow:inherit;overflow:hidden}@media (max-width:961px){.game-item{height:auto;overflow:hidden}}.game-item .game-link-wrapper img{background-color:#006c8a;border:1px solid #32bdff;float:left;height:62px;margin-right:10px;overflow:hidden;padding:5px;width:95px}@media (max-width:959.98px){.game-item .game-link-wrapper img{border-radius:.25rem;padding:0}}.right-header-block{color:#fff;position:absolute;right:0}.welcome-box{text-align:right}.welcome-box .btn.free-account{background-color:#29bffd;box-shadow:2px 2px 2px #000;color:#2a455d;display:inline-block;font-size:.65rem;height:50px;margin-bottom:15px;margin-top:27px;padding:7px 7px 7px 55px;position:relative;white-space:normal}.welcome-box .btn.free-account .earn{text-transform:none}@media (max-width:959.98px){.welcome-box .btn.free-account{width:290px}}@media (min-width:960px) and (max-width:1139.98px){.welcome-box .btn.free-account{width:100%}.welcome-box .btn.free-account .earn{display:none}}.welcome-box .btn.free-account .avatar{background-color:#29bffd;background-image:url(/themes/custom/coolmath/assets/images/user-profile/lion_avatar.png);border:3px solid #29bffd;border-radius:50%;box-shadow:0 2px 2px #000;height:65px;left:-13px;top:-8px;width:65px;z-index:1}.welcome-box .btn.free-account .avatar,.welcome-box .btn.free-account .badge{background-position:50%;background-repeat:no-repeat;background-size:cover;display:block;overflow:hidden;position:absolute}.welcome-box .btn.free-account .badge{background-image:url(/themes/custom/coolmath/assets/images/user-profile/levels/iL7.svg);height:34px;left:30px;top:27px;width:34px;z-index:2}.welcome-box .btn.free-account .getuserprofile{color:#f1db00;display:block;font-size:1rem;text-shadow:1px -1px #2a455d,-1px -1px #2a455d,-1px 1px #2a455d,-1px -1px #2a455d,1px 0 #2a455d,-1px 0 #2a455d,0 1px #2a455d,0 -1px #2a455d,1px 1px #2a455d,-1px 1px #2a455d,1px 1px #2a455d,1px -1px #2a455d}.welcome-box .btn.free-account .earn{font-size:.65rem}.welcome-box .login-link{color:#fff!important;font-family:Proxima-Soft-Bold;font-size:1rem;line-height:1.2rem;position:relative;right:73px;text-shadow:2px 2px 2px #000;top:-5px}.welcome-box .login-link p{text-align:right;text-transform:lowercase}.welcome-box .login-link a.login{color:#29bffd;text-transform:capitalize}@media (max-width:959.98px){.welcome-box .login-link{font-size:1.25rem;right:0}.welcome-box .login-link p{text-align:center}}.progress{background:#000;border-radius:5px;height:24px;overflow:visible;text-align:center}.progress .progress-bar{align-items:center;background-image:linear-gradient(90deg,#f7c649 3.53%,#fff661);background-repeat:repeat-x;border-radius:5px;color:#028fca!important;font-family:Proxima-Soft-Bold;font-size:.875rem;line-height:1.125rem;text-align:center}.progress-bar{width:0}.other-pages-300x250{margin-bottom:40px}.pane-cmatgame-advertisement-cm-g-otherpages-300x250-top{background:0 0}.pane-cmatgame-advertisement-cm-g-otherpages-300x250-top .ad-wrapper{height:268px;width:300px}@media (max-width:767.98px){.pane-cmatgame-advertisement-cm-g-otherpages-300x250-top .ad-wrapper{height:255px;width:300px}}.pane-cmatgame-advertisement-cm-g-otherpages-300x250-center .ad-wrapper{height:268px;width:300px}@media (max-width:767.98px){.pane-cmatgame-advertisement-cm-g-otherpages-300x250-center .ad-wrapper{height:auto;margin-bottom:20px;min-height:270px;width:300px}}.pane-cmatgame-advertisement-cm-g-otherpages-300x250-top .ad-wrapper{display:block}@media (max-width:959.98px){.pane-cmatgame-advertisement-cm-g-otherpages-300x250-top .ad-wrapper{height:255px;margin:0 auto;width:300px}}@media (max-width:767.98px){.pane-cmatgame-advertisement-cm-g-otherpages-300x250-center .ad-wrapper{height:255px;margin:0 auto;width:300px}}.pane-cmatgame-advertisement-cm-g-otherpages-300x250-center .ad-wrapper{display:block}@media (max-width:767.98px){.pane-cmatgame-advertisement-cm-g-otherpages-300x250-center .ad-wrapper{height:255px;width:300px}}@media (max-width:1139.98px){.pane-cmatgame-advertisement-cm-g-otherpages-300x250-center .ad-wrapper{margin:0 auto}}.main-aside .block{margin-bottom:40px}.cmg-promo{color:#fff;height:100px;position:relative;width:300px;z-index:0}.cmg-promo:after,.cmg-promo:before{content:"";opacity:0;position:absolute;z-index:1}.cmg-promo:before{background:#00c2fe;border-radius:8px 0 8px 0;bottom:0;height:30px;right:0;width:30px}.cmg-promo:after{background:url(/themes/custom/coolmath/assets/images/sprite.png) no-repeat -16px 0/300px;bottom:2px;height:19px;right:6px;width:15px}.cmg-promo .cmg-promo-inner{align-items:center;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:0}.cmg-promo .cmg-promo-inner:before{background:linear-gradient(0deg,#060d19cc,#060d191a)}.cmg-promo .cmg-promo-inner:after,.cmg-promo .cmg-promo-inner:before{border-radius:10px;box-shadow:0 5px 0 #29bffd;content:"";height:100%;left:0;position:absolute;top:0;width:100%;z-index:0}.cmg-promo .cmg-promo-inner:after{background:linear-gradient(315deg,#00284ecc 25%,#00284e1a 80%);opacity:0}.cmg-promo a{color:#fff;text-decoration:none}.cmg-promo a:before{content:"";height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.cmg-promo h5{font-size:24px;line-height:.9;margin:0 0 8px;text-shadow:1px 1px 0 #060d19,2px 2px 0 #060d19,3px 3px 0 #060d19}.cmg-promo p{font-size:15px;margin:0}.cmg-promo .cmg-promo-img{border-radius:10px;height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%;z-index:-1}.cmg-promo .cmg-promo-text{padding:0 35px;position:relative;text-align:center;z-index:1}.cmg-promo.merch-promo-xl{height:135px}#afg_preloader #adcontainer{margin:0 auto}.clearfix{clear:both;content:"";display:block}.clearfix{clear:both;content:"";display:block}.clearfix{clear:both;content:"";display:block}.node-type-game .container-fluid{max-width:1980px}@media (min-width:1320px){.node-type-game .container-fluid .row.pb-3{justify-content:start;min-width:1320px}}@media (min-width:1140px) and (max-width:1319.98px) and (min-width:1320px) and (max-width:1500px){.node-type-game .container-fluid .l-aside,.node-type-game .container-fluid .l-aside-spacer{display:none!important}.node-type-game .container-fluid .main-col{margin-left:1rem;margin-right:unset;min-width:unset;padding-left:unset;padding-right:unset}}@media (min-width:960px) and (max-width:1139.98px){.node-type-game .container-fluid .row.pb-3{flex-wrap:nowrap;justify-content:center;min-width:960px}.node-type-game .container-fluid .row.pb-3 .main-col{margin-left:unset;margin-right:unset;min-width:unset;padding-left:unset;padding-right:unset}}@media (min-width:800px) and (max-width:959.98px){.node-type-game .container-fluid .row.pb-3{justify-content:start}}@media (min-width:560px) and (max-width:799.98px){.node-type-game .container-fluid .row.pb-3{justify-content:center;min-width:560px}.node-type-game .container-fluid .row.pb-3 .main-col{min-width:320px}}@media (max-width:559.98px){.node-type-game .container-fluid .row.pb-3{justify-content:center;min-width:300px}.node-type-game .container-fluid .row.pb-3 .main-col{min-width:320px}}.node-type-game .container-fluid .l-aside{flex-shrink:0;max-width:160px!important;padding:0;width:160px!important}.node-type-game .container-fluid .l-aside-spacer,.node-type-game .container-fluid .r-aside-spacer{flex-grow:100;max-width:8rem;min-height:100%;min-width:4rem;padding:0}.node-type-game .container-fluid .main-col{flex-grow:50;flex-shrink:0}.node-type-game .container-fluid .main-aside{flex-shrink:1;padding:0;width:300px}.node-type-game .block-gamedetailcarousel,.node-type-game .block-system-main-block{position:relative}.node-type-game .faqs-list{padding-bottom:10px}.node-type-game .game-instructions h3,.node-type-game .game-instructions h4{text-transform:uppercase}.node-type-game .game-instructions h3{font-size:1.188rem;line-height:1.938rem}.node-type-game .game-instructions h4{font-size:1.063rem;line-height:1.688rem}.node-type-game .game-instructions .games-like-this{font-size:1.188rem;line-height:1.2;margin-top:20px}@media (min-width:800px){.node-type-game .game-instructions .games-like-this{line-height:1.938}}.node-type-game .game-instructions p{font-size:1rem;line-height:1.25rem}.node-type-game .container-fluid{margin:0 auto;max-width:1980px}@media (min-width:1320px){.node-type-game .container-fluid .row.pb-3.large-game-item .main-col{max-width:800px;min-width:800px!important;padding-left:0}.node-type-game .container-fluid .row.pb-3.large-game-item .main-col .inside{min-width:800px}}@media (min-width:1140px){.node-type-game .container-fluid .row.pb-3.large-game-item{justify-content:center}.node-type-game .container-fluid .row.pb-3.large-game-item .main-col{max-width:800px;min-width:800px;padding-left:0}.node-type-game .container-fluid .row.pb-3.large-game-item .main-col .inside{min-width:800px}}@media (min-width:960px) and (max-width:1139.98px){.node-type-game .container-fluid .row.pb-3{min-width:960px}.node-type-game .container-fluid .row.pb-3.large-game-item{justify-content:unset}.node-type-game .container-fluid .row.pb-3.large-game-item .main-col{min-width:800px;width:800px}.node-type-game .container-fluid .row.pb-3.large-game-item .main-col .inside{min-width:800px}}@media (min-width:768px) and (max-width:959.98px){.node-type-game .container-fluid .row.pb-3{justify-content:center}}@media (min-width:560px) and (max-width:767.98px){.node-type-game .container-fluid .row.pb-3{justify-content:center;min-width:560px}}@media (max-width:559.98px){.node-type-game .container-fluid .row.pb-3{justify-content:center;min-width:300px}}.node-type-game .container-fluid .l-aside{flex-shrink:0;max-width:160px!important;padding:0;width:160px!important}.node-type-game .container-fluid .l-aside-spacer,.node-type-game .container-fluid .r-aside-spacer{flex-grow:100;max-width:8rem;min-height:100%;min-width:4rem;padding:0}.node-type-game .container-fluid .main-col{flex-grow:50;flex-shrink:0}.node-type-game .container-fluid .main-aside{flex-shrink:1;padding:0;width:300px}@media (min-width:960px){.node-type-game.large-game-item .container-fluid .r-aside-spacer{min-width:6rem!important}}.container{margin-left:auto;margin-right:auto;padding-left:15px;padding-right:15px;width:100%}@media (min-width:560px){.container{max-width:561px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:960px){.container{max-width:990px}}@media (min-width:1140px){.container{max-width:1140px}}@media (min-width:1320px){.container{max-width:1360px}}.container-fluid{margin-left:auto;margin-right:auto;padding-left:15px;padding-right:15px;width:100%}.row{display:flex;flex-wrap:wrap;margin-left:-15px;margin-right:-15px}.col-12,.col-2,.col-7,.col-lg-3,.col-lg-6,.col-lg-9,.col-md-1,.col-md-12,.col-md-2,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-6,.col-xl-3,.col-xl-7{padding-left:15px;padding-right:15px;position:relative;width:100%}.col-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-12{flex:0 0 100%;max-width:100%}@media (min-width:560px){.col-sm-6{flex:0 0 50%;max-width:50%}}@media (min-width:768px){.col-md-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-md-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-md-6{flex:0 0 50%;max-width:50%}.col-md-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-md-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-md-9{flex:0 0 75%;max-width:75%}.col-md-12{flex:0 0 100%;max-width:100%}}@media (min-width:960px){.col-lg-3{flex:0 0 25%;max-width:25%}.col-lg-6{flex:0 0 50%;max-width:50%}.col-lg-9{flex:0 0 75%;max-width:75%}}@media (min-width:1140px){.col-xl-3{flex:0 0 25%;max-width:25%}.col-xl-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.offset-xl-2{margin-left:16.6666666667%}}.viewWebLang{left:0;position:absolute;top:65px}.viewWebLang .viewLangBtn{background-color:initial;border-radius:.25rem;color:#29bffd;display:inline-block;font-family:Proxima-Soft-Bold;font-size:14.7px;margin-left:3px;margin-top:20px;padding:.25rem;text-shadow:2px 2px 2px #000;text-transform:uppercase}.clearfix{clear:both;content:"";display:block}.clearfix{clear:both;content:"";display:block}.clearfix{clear:both;content:"";display:block}.clearfix{clear:both;content:"";display:block}.clearfix{clear:both;content:"";display:block}</style>
<link rel="icon" href="/themes/custom/coolmath/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="alternate" hreflang="en" href="https://www.coolmathgames.com/0-jacksmith" />
<link rel="alternate" hreflang="es" href="https://www.coolmathgames.com/es/0-jacksmith" />
<link rel="alternate" hreflang="pt-br" href="https://www.coolmathgames.com/pt-br/0-jacksmith" />
<link rel="alternate" hreflang="fr" href="https://www.coolmathgames.com/fr/0-jacksmith" />
<link rel="alternate" hreflang="hi" href="https://www.coolmathgames.com/hi/0-jacksmith" />
<link rel="alternate" hreflang="it" href="https://www.coolmathgames.com/it/0-jacksmith" />
<link rel="alternate" hreflang="zh-hans" href="https://www.coolmathgames.com/zh-hans/0-jacksmith" />
<link rel="alternate" hreflang="fil" href="https://www.coolmathgames.com/fil/0-jacksmith" />
<link rel="alternate" hreflang="ja" href="https://www.coolmathgames.com/ja/0-jacksmith" />
<link rel="alternate" hreflang="vi" href="https://www.coolmathgames.com/vi/0-jacksmith" />
<style>.welcome-box{display:none} .report_ad_modal{display:none}
.anonymous .welcome-box{display:block !important}
.mobile-device body .mobile-hide, .mobile-device body .mobile-not-playable, .dtp-device body .dtp-hide, .mobile-device body .dtp-hide.dtp-hide-mobile{ display: none}
.mobile-device .node-game.dtp-hide.dtp-hide-mobile{display:none !important}
.owl-dots{position: absolute;}
.coll-gal .gal-loader {width: 64px; height: 64px; position: absolute; left: 50% !important; top: 50% !important; margin: -32px 0 0 -32px; }
.game-container {min-width: 320px;width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto;margin-top: 20px;}
.node-type-game .col-md-2.d-none.d-xl-block {max-width: 190px;}
main{overflow: hidden;}.featuredpuzzleimg{margin-bottom: 11px;}
.visually-hidden{position: absolute !important;overflow: hidden;clip: rect(1px,1px,1px,1px);width: 1px; height: 1px;word-wrap: normal;}
[class*=path-puzzle-category-] .block-cmatgame-core .common-title {margin-top: calc(1rem - 1px);}
.node-type-puzzle #gameContainer canvas{max-width: 100%;}
body.cmatgame .page__content{background: #16202c; position: relative;}
.mobile-device .game-meta-header {min-height: 111px}
.game-carousel:not(.owl-loaded){display: flex; overflow: hidden;}
.game-carousel:not(.owl-loaded) .slide-item{min-width: 139px}
.lang-en .pane-menu-menu-desktop-header-menu .pane-content > .menu{display: flex; white-space: nowrap;}
@media (max-width: 960px){.home-col2 .block-views-blocktop-ten-games-block-1 {order: 2}}
@media (min-width: 560px){ .game-container { max-width: 540px; } }
@media (min-width: 768px){ .game-container { max-width: 720px; } }
@media (min-width: 960px){ .game-container { margin-top: 40px; max-width: 960px; } }
@media (min-width: 1140px){ .d-xl-block { display: block!important; } .game-container { max-width: 1200px; } .pl-xl-4{ padding-left: 1.5rem!important; padding-right: 1.5rem!important; } }</style>
<script type="deferjs">
      var cPath = /\/1-([a-z-0-9]+-game|playlists)|\/0-[a-z-0-9]+/gm;
      var lang_prefix = /^\/(es|pt\-br|fr|it|hi)\/?/;
      var cRegex = new RegExp(cPath);
      if (getCookie('cmg_translation') !== null && getCookie('cmg_translation') !== 'def') {
        var tr_lang = getCookie('cmg_translation');
        var tr_regex = new RegExp('\/'+tr_lang+'\/');
        if (location.pathname == '/' && !tr_regex.test(location.pathname)) {
          document.location = '/' + tr_lang;
        } else if (cRegex.test(location.pathname) && !tr_regex.test(location.pathname) && !/^\/pt-br|es\//.test(location.pathname)) {
          document.location = '/' + tr_lang + location.pathname.replace(new RegExp(lang_prefix), '/');
        }
      } else if (lang_prefix.test(navigator.language) && (getCookie('cmg_translation') === null || getCookie('cmg_translation') !== 'def') ){
        var navigatorLang = navigator.language;
        setCookie('cmg_translation', navigatorLang);
        var tr_regex = new RegExp('\/'+navigatorLang+'\/');
        if (location.pathname == '/' && !tr_regex.test(location.pathname)) {
          document.location = '/' + navigatorLang;
        } else if (cRegex.test(location.pathname) && !tr_regex.test(location.pathname) && !/^\/pt-br|fr|it|hi|es\//.test(location.pathname)) {
          document.location = '/' + navigatorLang + location.pathname.replace(new RegExp(lang_prefix), '/');
        }
      }
      var valid_test_environment = false;
      function getCookie(key) {
        var keyValue = document.cookie.match("(^|;) ?" + key + "=([^;]*)(;|$)");
        return keyValue ? keyValue[2] : null;
      }
      function setCookie1(cname, cvalue, hours) {
        var d = new Date();
        d.setTime(d.getTime() + (hours*60*60*1000));
        var expires = 'expires='+ d.toUTCString();
        document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';
      }
      function setCookie(key, value, exptime) {
        var d = new Date();
        d.setTime(d.getTime() + exptime);
        var expires = 'expires=' + d.toUTCString();
        document.cookie = key + '=' + value + '; ' + expires + '; path=/; domain=.' + window.location.host;
      }
      function getParameterByName(name) {
        var regexS = '[\?&]' + name + '=([^&#]*)';
        var regex = new RegExp(regexS);
        var results = regex.exec(location.href);
        if (results === null) {
          return '';
        }
        return decodeURIComponent(results[1].replace(/\+/g, ' '));
      }
      
      var cmg_school_whitelisted = getCookie('cmg_schwl');

      var freeTrialUser = false;
      var date = new Date();
      var hours = date.getHours();
      var currentMonth = date.getMonth();
      var currentYear = date.getFullYear();
      var day = date.getDay();
      var month_names_short = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
      var currentMonthName = month_names_short[currentMonth];
      var schoolStartHour = 7;
      var schoolEndHour = 15;
      var cmg_no_ads_debug = false;

      if (typeof subscriberLeg === 'undefined' || subscriberLeg === null || subscriberLeg === '') {
        subscriberLeg = 'Default Leg';
      }
      if (typeof freeGameLimit === 'undefined' || freeGameLimit === null) {
        freeGameLimit = 0;
      }
      if (typeof cmg_no_ads === 'undefined' && cmg_no_ads_debug && (typeof valid_test_environment !== 'undefined' && valid_test_environment)) {
        cmg_no_ads = true;
      }
      var schoolHours = false;
      var schoolHolidays = ["Jul 4","Sep 3","Nov 22","Nov 23"];
      var schoolHoliday = false;

      var summerVacationStart = new Date('07/1/'+currentYear);
      var summerVacationEnd = new Date('07/10/'+currentYear);

      var today_month_day = currentMonthName + ' ' + date.getDate();
      if (schoolHolidays.indexOf(today_month_day) !== -1 || (date >= summerVacationStart && date <= summerVacationEnd) || day === 6 || day == 0) {
        schoolHoliday = true;
      }
      var currentMonthName = month_names_short[currentMonth];
      if (!schoolHoliday && hours >= schoolStartHour && hours <= schoolEndHour) {
        schoolHours = true;
      }
      var targetStateUser = false;
      if (typeof targeted_state !== 'undefined' && targeted_state !== null && targeted_state) {
        targetStateUser = true;
      }
      if (typeof watchAdtoUnlockGame == 'undefined') {
        watchAdtoUnlockGame = false;
      }
      var cmg_active_anonymous_user = getCookie('cmg_active_anonymous_user');
      var cmatgame_editor = getCookie('cmg_editor');
      if (!schoolHours && targetStateUser && cmg_active_anonymous_user === null && cmatgame_editor === null) {
        freeTrialUser = true;
     }
   </script>
<script type="deferjs">
     function checkIfFlashIsEnabled() {
          var ie_flash;
          try { ie_flash = (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) !== false) } catch(err) { ie_flash = false; }
          var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || ie_flash);
          if (typeof _flash_installed == "undefined" || !_flash_installed) {
            return false;
          } else {
            return true;
          }
       }
       function trackEvent(category, action, label, noninteraction) {
          if (typeof __gaTracker === 'undefined')
            return;
            noninteraction = noninteraction || 0;
          __gaTracker('send', {
              'hitType': 'event',          // Required.
              'eventCategory': category,   // Required.
              'eventAction': action,      // Required.
              'eventLabel': label,
              'eventValue': 0,
              'nonInteraction': noninteraction
          });
      }
      function trackSocial(network,action,target) {
          if (typeof __gaTracker === 'undefined')
            return;
          __gaTracker('send', {
              'hitType': 'social',          // Required.
              'socialNetwork': network,
              'socialAction': action,
              'socialTarget': target
          });
      }
    </script>
<script>/*! jQuery v3.6.3 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},S=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||S).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.3",E=function(e,t){return new E.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}E.fn=E.prototype={jquery:f,constructor:E,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=E.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return E.each(this,e)},map:function(n){return this.pushStack(E.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(E.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(E.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},E.extend=E.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(E.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||E.isPlainObject(n)?n:{},i=!1,a[t]=E.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},E.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=y.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?E.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:v}),"function"==typeof Symbol&&(E.fn[Symbol.iterator]=t[Symbol.iterator]),E.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,S,y,s,c,v,E="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,S)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=E)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{if(d.cssSupportsSelector&&!CSS.supports("selector(:is("+c+"))"))throw new Error;return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===E&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[E]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,S=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssSupportsSelector=ce(function(){return CSS.supports("selector(*)")&&C.querySelectorAll(":is(:jqfake)")&&!CSS.supports("selector(:is(*,:jqfake))")}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=E,!C.getElementsByName||!C.getElementsByName(E).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&S){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&S){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&S)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+E+"'></a><select id='"+E+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+E+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+E+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssSupportsSelector||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&S&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),v(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!S):void 0;return void 0!==r?r:d.attributes||!S?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace($," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,y){var v="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===y?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=v!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(v){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[E]||(a[E]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[E]||(a[E]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[E]||(a[E]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=y)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[E]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[E]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=S?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ye(function(){return[0]}),last:ye(function(e,t){return[t-1]}),eq:ye(function(e,t,n){return[n<0?n+t:n]}),even:ye(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ye(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ye(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ye(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[E]||(e[E]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,y,v,e){return y&&!y[E]&&(y=Ce(y)),v&&!v[E]&&(v=Ce(v,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?v||(e?d:l||y)?[]:t:f;if(g&&g(f,p,n,r),y){i=Te(p,u),y(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(v||d){if(v){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);v(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=v?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),v?v(null,t,p,r):H.apply(t,p)})}function Se(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[E]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Se(e.slice(s,n)),n<r&&Se(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,y,v,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Se(t[n]))[E]?i.push(a):o.push(a);(a=A(e,(y=o,m=0<(v=i).length,x=0<y.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!S);while(s=y[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=v[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+v.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&S&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ve(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!S,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},d.sortStable=E.split("").sort(j).join("")===E,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);E.find=d,E.expr=d.selectors,E.expr[":"]=E.expr.pseudos,E.uniqueSort=E.unique=d.uniqueSort,E.text=d.getText,E.isXMLDoc=d.isXML,E.contains=d.contains,E.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&E(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=E.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?E.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?E.grep(e,function(e){return e===n!==r}):"string"!=typeof n?E.grep(e,function(e){return-1<i.call(n,e)!==r}):E.filter(n,e,r)}E.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?E.find.matchesSelector(r,e)?[r]:[]:E.find.matches(e,E.grep(t,function(e){return 1===e.nodeType}))},E.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(E(e).filter(function(){for(t=0;t<r;t++)if(E.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)E.find(e,i[t],n);return 1<r?E.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?E(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(E.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:S,!0)),N.test(r[1])&&E.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=S.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this)}).prototype=E.fn,D=E(S);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(E.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&E(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&E.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?E.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(E(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(E.uniqueSort(E.merge(this.get(),E(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),E.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),E.merge([],e.childNodes))}},function(r,i){E.fn[r]=function(e,t){var n=E.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=E.filter(t,n)),1<this.length&&(H[r]||E.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}E.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},E.each(e.match(P)||[],function(e,t){n[t]=!0}),n):E.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){E.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return E.each(arguments,function(e,t){var n;while(-1<(n=E.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<E.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},E.extend({Deferred:function(e){var o=[["notify","progress",E.Callbacks("memory"),E.Callbacks("memory"),2],["resolve","done",E.Callbacks("once memory"),E.Callbacks("once memory"),0,"resolved"],["reject","fail",E.Callbacks("once memory"),E.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return E.Deferred(function(r){E.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){E.Deferred.exceptionHook&&E.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(E.Deferred.getStackHook&&(t.stackTrace=E.Deferred.getStackHook()),C.setTimeout(t))}}return E.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?E.extend(e,a):a}},s={};return E.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=E.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;E.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},E.readyException=function(e){C.setTimeout(function(){throw e})};var F=E.Deferred();function $(){S.removeEventListener("DOMContentLoaded",$),C.removeEventListener("load",$),E.ready()}E.fn.ready=function(e){return F.then(e)["catch"](function(e){E.readyException(e)}),this},E.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--E.readyWait:E.isReady)||(E.isReady=!0)!==e&&0<--E.readyWait||F.resolveWith(S,[E])}}),E.ready.then=F.then,"complete"===S.readyState||"loading"!==S.readyState&&!S.documentElement.doScroll?C.setTimeout(E.ready):(S.addEventListener("DOMContentLoaded",$),C.addEventListener("load",$));var B=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)B(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(E(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=E.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||E.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!E.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}E.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),E.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):B(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),E.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,E.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=E.queue(e,t),r=n.length,i=n.shift(),o=E._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){E.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:E.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),E.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?E.queue(this[0],t):void 0===n?this:this.each(function(){var e=E.queue(this,t,n);E._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&E.dequeue(this,t)})},dequeue:function(e){return this.each(function(){E.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=E.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=S.documentElement,ie=function(e){return E.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return E.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===E.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return E.css(e,t,"")},u=s(),l=n&&n[3]||(E.cssNumber[t]?"":"px"),c=e.nodeType&&(E.cssNumber[t]||"px"!==l&&+u)&&te.exec(E.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)E.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,E.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=E.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}E.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?E(this).show():E(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=S.createDocumentFragment().appendChild(S.createElement("div")),(fe=S.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?E.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,v.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))E.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+E.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;E.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<E.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return S.activeElement}catch(e){}}()==("focus"===t)}function Se(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Se(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return E().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=E.guid++)),e.each(function(){E.event.add(this,t,i,r,n)})}function Ee(e,i,o){o?(Y.set(e,i,!1),E.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(E.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:E.event.trigger(E.extend(r[0],E.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&E.event.add(e,i,we)}E.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&E.find.matchesSelector(re,i),n.guid||(n.guid=E.guid++),(u=y.events)||(u=y.events=Object.create(null)),(a=y.handle)||(a=y.handle=function(e){return"undefined"!=typeof E&&E.event.triggered!==e.type?E.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=E.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=E.event.special[d]||{},c=E.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&E.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),E.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.hasData(e)&&Y.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=E.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||E.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)E.event.remove(e,d+t[l],n,r,!0);E.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=E.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=E.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=E.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((E.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<E(i,this).index(l):E.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(E.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[E.expando]?e:new E.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ee(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ee(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},E.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},E.Event=function(e,t){if(!(this instanceof E.Event))return new E.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&E.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[E.expando]=!0},E.Event.prototype={constructor:E.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},E.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},E.event.addProp),E.each({focus:"focusin",blur:"focusout"},function(t,e){E.event.special[t]={setup:function(){return Ee(this,t,Ce),!1},trigger:function(){return Ee(this,t),!0},_default:function(e){return Y.get(e.target,t)},delegateType:e}}),E.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){E.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||E.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),E.fn.extend({on:function(e,t,n,r){return Se(this,e,t,n,r)},one:function(e,t,n,r){return Se(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,E(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){E.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&E(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)E.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=E.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!v.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=E.map(ye(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=E.clone(u,!0,!0),s&&E.merge(a,ye(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,E.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&E.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?E._evalUrl&&!u.noModule&&E._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?E.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||E.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}E.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||E.isXMLDoc(e)))for(a=ye(c),r=0,i=(o=ye(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ye(e),a=a||ye(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ye(c,"script")).length&&ve(a,!f&&ye(e,"script")),c},cleanData:function(e){for(var t,n,r,i=E.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?E.event.remove(n,r):E.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),E.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return B(this,function(e){return void 0===e?E.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(E.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return E.clone(this,e,t)})},html:function(e){return B(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=E.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(E.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;E.inArray(this,n)<0&&(E.cleanData(ye(this)),t&&t.replaceChild(e,this))},n)}}),E.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){E.fn[e]=function(e){for(var t,n=[],r=E(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),E(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=/^--/,Me=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Ie=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},We=new RegExp(ne.join("|"),"i"),Fe="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+Fe+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Fe+"+$","g");function Be(e,t,n){var r,i,o,a,s=Re.test(t),u=e.style;return(n=n||Me(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace($e,"$1")||void 0),""!==a||ie(e)||(a=E.style(e,t)),!v.pixelBoxStyles()&&Pe.test(a)&&We.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=S.createElement("div"),l=S.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===l.style.backgroundClip,E.extend(v,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=S.createElement("table"),t=S.createElement("tr"),n=S.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var ze=["Webkit","Moz","ms"],Ue=S.createElement("div").style,Xe={};function Ve(e){var t=E.cssProps[e]||Xe[e];return t||(e in Ue?e:Xe[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=ze.length;while(n--)if((e=ze[n]+t)in Ue)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=E.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=E.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=E.css(e,"border"+ne[a]+"Width",!0,i))):(u+=E.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=E.css(e,"border"+ne[a]+"Width",!0,i):s+=E.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Me(e),i=(!v.boxSizingReliable()||n)&&"border-box"===E.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===E.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===E.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}E.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Re.test(t),l=e.style;if(u||(t=Ve(s)),a=E.cssHooks[t]||E.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(E.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Re.test(t)||(t=Ve(s)),(a=E.cssHooks[t]||E.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),E.each(["height","width"],function(e,u){E.cssHooks[u]={get:function(e,t,n){if(t)return!Ge.test(E.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):Ie(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Me(e),o=!v.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===E.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=E.css(e,u)),Je(0,t,s)}}}),E.cssHooks.marginLeft=_e(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-Ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),E.each({margin:"",padding:"",border:"Width"},function(i,o){E.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(E.cssHooks[i+o].set=Je)}),E.fn.extend({css:function(e,t){return B(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Me(e),i=t.length;a<i;a++)o[t[a]]=E.css(e,t[a],!1,r);return o}return void 0!==n?E.style(e,t,n):E.css(e,t)},e,t,1<arguments.length)}}),((E.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||E.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(E.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=E.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=E.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){E.fx.step[e.prop]?E.fx.step[e.prop](e):1!==e.elem.nodeType||!E.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:E.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},E.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},E.fx=et.prototype.init,E.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===S.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,E.fx.interval),E.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=E.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:E.extend({},e),opts:E.extend(!0,{specialEasing:{},easing:E.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=E.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=E.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(E._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return E.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),E.fx.timer(E.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}E.Animation=E.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=Y.get(e,"fxshow");for(r in n.queue||(null==(a=E._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,E.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||E.style(e,r)}if((u=!E.isEmptyObject(t))||!E.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=Y.get(e,"display")),"none"===(c=E.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=E.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===E.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(y?"hidden"in y&&(g=y.hidden):y=Y.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)E.style(e,r,d[r])})),u=ct(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),E.speed=function(e,t,n){var r=e&&"object"==typeof e?E.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return E.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in E.fx.speeds?r.duration=E.fx.speeds[r.duration]:r.duration=E.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&E.dequeue(this,r.queue)},r},E.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=E.isEmptyObject(t),o=E.speed(e,n,r),a=function(){var e=ft(this,E.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=E.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||E.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=E.timers,o=n?n.length:0;for(t.finish=!0,E.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),E.each(["toggle","show","hide"],function(e,r){var i=E.fn[r];E.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),E.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){E.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),E.timers=[],E.fx.tick=function(){var e,t=0,n=E.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||E.fx.stop(),tt=void 0},E.fx.timer=function(e){E.timers.push(e),E.fx.start()},E.fx.interval=13,E.fx.start=function(){nt||(nt=!0,st())},E.fx.stop=function(){nt=null},E.fx.speeds={slow:600,fast:200,_default:400},E.fn.delay=function(r,e){return r=E.fx&&E.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=S.createElement("input"),it=S.createElement("select").appendChild(S.createElement("option")),rt.type="checkbox",v.checkOn=""!==rt.value,v.optSelected=it.selected,(rt=S.createElement("input")).value="t",rt.type="radio",v.radioValue="t"===rt.value;var pt,dt=E.expr.attrHandle;E.fn.extend({attr:function(e,t){return B(this,E.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){E.removeAttr(this,e)})}}),E.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?E.prop(e,t,n):(1===o&&E.isXMLDoc(e)||(i=E.attrHooks[t.toLowerCase()]||(E.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void E.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=E.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?E.removeAttr(e,n):e.setAttribute(n,n),n}},E.each(E.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||E.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}E.fn.extend({prop:function(e,t){return B(this,E.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[E.propFix[e]||e]})}}),E.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&E.isXMLDoc(e)||(t=E.propFix[t]||t,i=E.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=E.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),v.optSelected||(E.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),E.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){E.propFix[this.toLowerCase()]=this}),E.fn.extend({addClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){E(this).addClass(t.call(this,e,vt(this)))}):(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=yt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){E(this).removeClass(t.call(this,e,vt(this)))}):arguments.length?(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=yt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return m(t)?this.each(function(e){E(this).toggleClass(t.call(this,e,vt(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=mt(t),this.each(function(){if(s)for(o=E(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=vt(this))&&Y.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":Y.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+yt(vt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;E.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,E(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=E.map(t,function(e){return null==e?"":e+""})),(r=E.valHooks[this.type]||E.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=E.valHooks[t.type]||E.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),E.extend({valHooks:{option:{get:function(e){var t=E.find.attr(e,"value");return null!=t?t:yt(E.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=E(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=E.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<E.inArray(E.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),E.each(["radio","checkbox"],function(){E.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<E.inArray(E(e).val(),t)}},v.checkOn||(E.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};E.extend(E.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||S],d=y.call(e,"type")?e.type:e,h=y.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||S,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+E.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[E.expando]?e:new E.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:E.makeArray(t,[e]),c=E.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||S)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),E.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),E.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=E.extend(new E.Event,n,{type:e,isSimulated:!0});E.event.trigger(r,null,t)}}),E.fn.extend({trigger:function(e,t){return this.each(function(){E.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return E.event.trigger(e,t,n,!0)}}),v.focusin||E.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){E.event.simulate(r,e.target,E.event.fix(e))};E.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},St=/\?/;E.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||E.error("Invalid XML: "+(n?E.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Et=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function jt(n,e,r,i){var t;if(Array.isArray(e))E.each(e,function(e,t){r||Et.test(n)?i(n,t):jt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)jt(n+"["+t+"]",e[t],r,i)}E.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!E.isPlainObject(e))E.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},E.fn.extend({serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=E.prop(this,"elements");return e?E.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!E(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=E(this).val();return null==n?null:Array.isArray(n)?E.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var Dt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=S.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function $t(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,E.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Bt(e,t){var n,r,i=E.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&E.extend(!0,e,r),e}Wt.href=Tt.href,E.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":E.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,E.ajaxSettings),t):Bt(E.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,y=E.ajaxSetup({},t),v=y.context||y,m=y.context&&(v.nodeType||v.jquery)?E(v):E.event,x=E.Deferred(),b=E.Callbacks("once memory"),w=y.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(y.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),y.url=((e||y.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),y.type=t.method||t.type||y.method||y.type,y.dataTypes=(y.dataType||"*").toLowerCase().match(P)||[""],null==y.crossDomain){r=S.createElement("a");try{r.href=y.url,r.href=r.href,y.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){y.crossDomain=!0}}if(y.data&&y.processData&&"string"!=typeof y.data&&(y.data=E.param(y.data,y.traditional)),$t(Rt,y,t,T),h)return T;for(i in(g=E.event&&y.global)&&0==E.active++&&E.event.trigger("ajaxStart"),y.type=y.type.toUpperCase(),y.hasContent=!Ot.test(y.type),f=y.url.replace(qt,""),y.hasContent?y.data&&y.processData&&0===(y.contentType||"").indexOf("application/x-www-form-urlencoded")&&(y.data=y.data.replace(Dt,"+")):(o=y.url.slice(f.length),y.data&&(y.processData||"string"==typeof y.data)&&(f+=(St.test(f)?"&":"?")+y.data,delete y.data),!1===y.cache&&(f=f.replace(Lt,"$1"),o=(St.test(f)?"&":"?")+"_="+Ct.guid+++o),y.url=f+o),y.ifModified&&(E.lastModified[f]&&T.setRequestHeader("If-Modified-Since",E.lastModified[f]),E.etag[f]&&T.setRequestHeader("If-None-Match",E.etag[f])),(y.data&&y.hasContent&&!1!==y.contentType||t.contentType)&&T.setRequestHeader("Content-Type",y.contentType),T.setRequestHeader("Accept",y.dataTypes[0]&&y.accepts[y.dataTypes[0]]?y.accepts[y.dataTypes[0]]+("*"!==y.dataTypes[0]?", "+It+"; q=0.01":""):y.accepts["*"]),y.headers)T.setRequestHeader(i,y.headers[i]);if(y.beforeSend&&(!1===y.beforeSend.call(v,T,y)||h))return T.abort();if(u="abort",b.add(y.complete),T.done(y.success),T.fail(y.error),c=$t(Mt,y,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,y]),h)return T;y.async&&0<y.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},y.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(y,T,n)),!i&&-1<E.inArray("script",y.dataTypes)&&E.inArray("json",y.dataTypes)<0&&(y.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(y,s,T,i),i?(y.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(E.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(E.etag[f]=u)),204===e||"HEAD"===y.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(v,[o,l,T]):x.rejectWith(v,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,y,i?o:a]),b.fireWith(v,[T,l]),g&&(m.trigger("ajaxComplete",[T,y]),--E.active||E.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return E.get(e,t,n,"json")},getScript:function(e,t){return E.get(e,void 0,t,"script")}}),E.each(["get","post"],function(e,i){E[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),E.ajax(E.extend({url:e,type:i,dataType:r,data:t,success:n},E.isPlainObject(e)&&e))}}),E.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),E._evalUrl=function(e,t,n){return E.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){E.globalEval(e,t,n)}})},E.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=E(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){E(this).wrapInner(n.call(this,e))}):this.each(function(){var e=E(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){E(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){E(this).replaceWith(this.childNodes)}),this}}),E.expr.pseudos.hidden=function(e){return!E.expr.pseudos.visible(e)},E.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},E.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=E.ajaxSettings.xhr();v.cors=!!zt&&"withCredentials"in zt,v.ajax=zt=!!zt,E.ajaxTransport(function(i){var o,a;if(v.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),E.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),E.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return E.globalEval(e),e}}}),E.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),E.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=E("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),S.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;E.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||E.expando+"_"+Ct.guid++;return this[e]=!0,e}}),E.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||E.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?E(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=S.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),E.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=S.implementation.createHTMLDocument("")).createElement("base")).href=S.location.href,t.head.appendChild(r)):t=S),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&E(o).remove(),E.merge([],i.childNodes)));var r,i,o},E.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=yt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&E.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?E("<div>").append(E.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},E.expr.pseudos.animated=function(t){return E.grep(E.timers,function(e){return t===e.elem}).length},E.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=E.css(e,"position"),c=E(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=E.css(e,"top"),u=E.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,E.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){E.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===E.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===E.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=E(e).offset()).top+=E.css(e,"borderTopWidth",!0),i.left+=E.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-E.css(r,"marginTop",!0),left:t.left-i.left-E.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===E.css(e,"position"))e=e.offsetParent;return e||re})}}),E.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;E.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),E.each(["top","left"],function(e,n){E.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?E(e).position()[n]+"px":t})}),E.each({Height:"height",Width:"width"},function(a,s){E.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){E.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?E.css(e,t,i):E.style(e,t,n,i)},s,n?e:void 0,n)}})}),E.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){E.fn[t]=function(e){return this.on(t,e)}}),E.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),E.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){E.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;E.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||E.guid++,i},E.holdReady=function(e){e?E.readyWait++:E.ready(!0)},E.isArray=Array.isArray,E.parseJSON=JSON.parse,E.nodeName=A,E.isFunction=m,E.isWindow=x,E.camelCase=X,E.type=w,E.now=Date.now,E.isNumeric=function(e){var t=E.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},E.trim=function(e){return null==e?"":(e+"").replace(Gt,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return E});var Yt=C.jQuery,Qt=C.$;return E.noConflict=function(e){return C.$===E&&(C.$=Qt),e&&C.jQuery===E&&(C.jQuery=Yt),E},"undefined"==typeof e&&(C.jQuery=C.$=E),E});
</script>
<script type="deferjs">
          gamePage = true;
          gameId = 10916;
          quizPage = false;
          gameType = 'game_html5';
            game_width_size = 800;
          mobile_ga_game_type = 'Desktop'; 
        var ad_refresh_timer_interval = 60000; 
          var ad_refresh_event_interval = 30000; 
          var show_interstitial_ads = false;
          var interstitial_ad_refresh_interval = 0; var xpTimeInterval = 60;</script>
<script type="text/javascript">
  function trackGoalVirtualPV(virtual_page) {
    if (typeof __gaTracker !== "undefined") {
      debugOut("GA Goal Tracking. Virtual pv: "+virtual_page);
      __gaTracker("send", "pageview", virtual_page);
    }
  }
  function getCookie(key) {
    var keyValue = document.cookie.match("(^|;) ?" + key + "=([^;]*)(;|$)");
    return keyValue ? keyValue[2] : null;
  }
  if (!getCookie("cmg_l")){
    document.documentElement.classList.add("anonymous")
   }
  // initialize js variableswith current theme style
  // var user_stylePath = encodeURIComponent("{{ user_theme_style_path }}");
  // var path = "/"+decodeURIComponent(user_stylePath);
  // if (user_stylePath!==""){
  //   jQuery("#styleswitcher-css").attr("href", path);
  // }
  jQuery(document).ready(function() {
  if (typeof getCookie === "function" && getCookie("cmg_xpp") !== null) {
    jQuery("body").addClass("cmatgame");
    var themepath = decodeURIComponent(getCookie("cmg_xpp"));
    if (themepath != "null" && !themepath.startsWith("/")) {
      themepath = "/"+themepath;
    }
    var path = location.protocol + "//" + location.host + themepath;
    if (jQuery("#styleswitcher-css").length) {
      jQuery("#styleswitcher-css").attr("href", path);
      //console.log("switchUserStyle Loading userprofile coolmath.theme. style= " + path + " "+ new Date());
    }
  }
  });
  </script>
<script type="deferjs">
		  var hide_preroll_ads = false; 
          var preroll_ads_timer = 15;
		  
          cmatgame_subscriber = getCookie("cmg_sx");
          if (getCookie("cmg_wl") !== null) {
            cmatgame_subscriber = getCookie("cmg_wl");
          }
          if (typeof cmg_school_whitelisted != "undefined" && cmg_school_whitelisted !== null && getCookie("cmg_schwl") !== null) {
            cmg_school_whitelisted = getCookie("cmg_schwl");
            cmatgame_subscriber = getCookie("cmg_schwl");
          } else if ((typeof cmg_school_whitelisted == "undefined" || cmg_school_whitelisted === null) && typeof cmg_no_ads_debug !== "undefined" && cmg_no_ads_debug) {
           cmatgame_subscriber = cmg_no_ads_debug;
          }

          isRemoveAdSwfJWPLayer = false;
          jQuery(document).ready(function() {
          if (typeof isAdblockerOn === "undefined"){
            if (typeof __gaTracker !== "undefined") {
             __gaTracker("send", {
              "hitType": "event",          // Required.
              "eventCategory": "Page-level-ad-blocker2",   // Required.
              "eventAction": "AdBlockerDetected",      // Required.
              "eventLabel": document.title,
              "eventValue": 1,
              "nonInteraction": 1
              });
            }
          } else {
           if (typeof __gaTracker !== "undefined") {
              __gaTracker("send", {
                "hitType": "event",          // Required.
                "eventCategory": "Page-level-ad-blocker2",   // Required.
                "eventAction": "AdBlockerNotDetected",      // Required.
                "eventLabel": document.title,
                "eventValue": 1,
                "nonInteraction": 1
            });
           }
         }
		 function removeAdSwfJWPLayer() {}
         var isChrome = navigator.userAgent.toLowerCase().indexOf("chrome") > -1;
         if (!jQuery(".adtxt").is(":visible") && isChrome) {
           removeAdSwfJWPLayer();
         }
        });
        </script>
<script type="deferjs">
        //global define variables
        let leaderboard_atf = { selectorId: "leaderboard-atf", type: "leaderboard_atf" };
        let leaderboard_btf = { selectorId: "leaderboard-btf", type: "leaderboard_btf" };
        let med_rect_atf10 = { selectorId: "mob-med-rect-atf", type: "med_rect_atf" };
        let med_rect_btf10 = { selectorId: "mob-med-rect-btf", type: "med_rect_btf" };
        let med_rect_atf = { selectorId: "med-rect-atf", type: "med_rect_atf" };
        let med_rect_btf = { selectorId: "med-rect-btf", type: "med_rect_btf" };
        let med_rect_btf1 =  { selectorId: "med-rect-btf1", type: "med_rect_btf" };
        let med_rect_btf2 = { selectorId: "med-rect-btf2", type: "med_rect_btf" };
        let med_rect_btf3 = { selectorId: "med-rect-btf3", type: "med_rect_btf" };
        let med_rect_btf4 = { selectorId: "med-rect-btf4", type: "med_rect_btf" };
        let med_rect_btf11 = { selectorId: "mob-med-rect-ctf", type: "med_rect_btf" };
        let sky_atf = { selectorId: "sky-atf", type: "sky_atf" };
        let sky_btf = { selectorId: "sky-btf", type: "sky_btf" };
        let trendi_video = { type: "trendi_video" };
        var pageLang = "";

        if ((typeof cmatgame_subscriber === "undefined" ||
            cmatgame_subscriber === "" ||
            cmatgame_subscriber === null ||
            typeof freeTrialUser === "undefined") && !freeTrialUser) {
          var pwUnits = [];
          var windowPath = window.location.pathname;
          if (pageLang != "") {
            windowPath = window.location.pathname.replace(pageLang, "");
            windowPath = windowPath.replace("//", "/");
          }

          // category landing pages with video
          if (windowPath == "/1-strategy-games" ||
            windowPath == "/1-skill-games" ||
            windowPath == "/1-number-games" ||
            windowPath == "/1-logic-games" ||
            windowPath == "/categories" ||
            windowPath == "/1-daily-games" ||
            windowPath == "/1-complete-game-list" ||
            windowPath == "/profile/leaderboard") {

            var tyche = {
              mode: "tyche",
              config: "//config.playwire.com/1023174/v2/websites/71134/banner.json",
              forcePath: "trendi-video",
              passiveMode: true
            };

            if (document.documentElement.clientWidth <= 767) { //mobile
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf10, med_rect_btf10);
            } else if (document.documentElement.clientWidth >= 768 && document.documentElement.clientWidth <= 1319) {
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, sky_btf, trendi_video);
            } else {
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, sky_atf, sky_btf, trendi_video);
            }

            // Homepage, category landing pages without video
          } else if (windowPath == "/" ) {

            var tyche = {
              mode: "tyche",
              config: "//config.playwire.com/1023174/v2/websites/71134/banner.json",
              passiveMode: true
            };

            if (document.documentElement.clientWidth <= 767) { //mobile
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf10, med_rect_btf10);
            } else if (document.documentElement.clientWidth >= 768 && document.documentElement.clientWidth <= 1319) {
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf1, med_rect_btf2, med_rect_btf3, med_rect_btf4);
            } else {
              pwUnits.push(leaderboard_atf, leaderboard_btf, sky_atf, med_rect_atf, med_rect_btf1, med_rect_btf2, med_rect_btf3, med_rect_btf4);
            }
            // all other pages
          } else {
          var tyche = {
            mode: "tyche",
            config: "//config.playwire.com/1023174/v2/websites/71134/banner.json",
            passiveMode: true
          };
          var getId = document.getElementById("main-row");
            if (document.documentElement.clientWidth <= 767) { //mobile
              pwUnits.push(leaderboard_atf, leaderboard_btf);
            } else if (getId != null && getId.classList.contains("wide-large-game-item") && document.documentElement.clientWidth >= 940) { //wide-large-game-item
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, sky_atf, sky_btf);
            } else if (getId != null && getId.classList.contains("extra-large-game-item") && document.documentElement.clientWidth >= 940) { //extra-large-game-item
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, sky_atf, sky_btf);
            } else if (document.documentElement.clientWidth >= 768 && document.documentElement.clientWidth <= 1319) { //desktop
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, med_rect_btf1, sky_btf);
            } else { //desktop
              pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, med_rect_btf1, sky_atf, sky_btf);
            }

          }
          // function that is called when tyche is ready
          var loadUnits = function () {
            var timeout = 2000; // How long before calling ad units in ms
            if (document.documentElement.getAttribute("rel") == "optimized") {
              timeout = 0 // for optimzed pages
            }
            if (document.documentElement.classList.contains("mobile-device")) {
              ramp.settings.device = "mobile";
              ramp.settings.isMobile = true;
            }
            setTimeout(function () {
              if (window.tyche.addUnits) {
                if (document.documentElement.clientWidth <= 767) {
                  ramp.settings.device = "mobile";
                  ramp.settings.isMobile = true;
                }
              }
              tyche
                .addUnits(pwUnits)
                .then(function () {
                  tyche.displayUnits();
                }).catch(function (e) {
                  tyche.displayUnits();
                  console.log(e);
                });
            }, timeout);
          }
          tyche.onReady = function () { // attach function to tyche onReady
            loadUnits();
          }
          if (document.documentElement.getAttribute("rel") == "optimized") {
            var delay = 0;
            if (document.documentElement.classList.contains("dtp-device")){
              delay = 0;
            }
            if (document.documentElement.classList.contains("mobile-device")){
              delay = 1500;
            }
            Defer(function () {
              var pwScript = document.createElement("script");
              pwScript.type = "text/javascript";
              pwScript.src = "//cdn.intergi.com/hera/tyche.js";
              pwScript.async = true;
              document.getElementsByTagName("head")[0].appendChild(pwScript);
            }, delay);
           } else {
            var pwScript = document.createElement("script");
            pwScript.type = "text/javascript";
            pwScript.src = "//cdn.intergi.com/hera/tyche.js";
            pwScript.async = true;
            document.getElementsByTagName("head")[0].appendChild(pwScript);
        }
      }
          </script>
<script type="deferjs">

  function resetAdRefreshTimer() {
    myStopFunction();
    refreshTimer = setTimeout(function () { myTimerAction() }, intvlValue);
  }

  function addSkyAtfAdContainer() {
    if (document.getElementById("sky-left") == null && jQuery("#sky-atf").length == 0) {
      var leftAd = document.getElementById("left-ad");
      var sky_left = document.createElement("div");
      sky_left.setAttribute("id", "sky-atf");
      leftAd.appendChild(sky_left);
      window.setTimeout(() => {
        window.sky_atf_scroll_lock();
      }, 1500);
    }
  }

  var hasAdBreakPointChanged = false;
  var currAdBreakPoint = "";
  var newAdBreakPoint = "";
  if (document.documentElement.clientWidth <= 767 ) { //mobile
    currAdBreakPoint = newAdBreakPoint = "1column";
  } else if (document.documentElement.clientWidth >= 768 && document.documentElement.clientWidth <= 1319 || document.documentElement.classList.contains("mobile-device")) {
    currAdBreakPoint = newAdBreakPoint = "2column";
  } else if (document.documentElement.clientWidth >= 1320 ){
    currAdBreakPoint = newAdBreakPoint = "3column";
  }

  function checkAdBreakPointChanged() {
    //Top Category and HP
    if (document.documentElement.clientWidth <= 767 ) { //mobile
       newAdBreakPoint = "1column";
    } else if (document.documentElement.clientWidth >= 768 && document.documentElement.clientWidth <= 1319 || document.documentElement.classList.contains("mobile-device")) {
      newAdBreakPoint = "2column";
    } else if (document.documentElement.clientWidth >= 1320 ){
      newAdBreakPoint = "3column";
    }

     if (gamePage && document.getElementById("pw-160x600_atf") != null && document.documentElement.clientWidth > 1319 && document.documentElement.clientWidth <= 1319 && newAdBreakPoint == "3column" && currAdBreakPoint == newAdBreakPoint) {
       window.tyche.destroyUnits("pw-160x600_atf");
     }

    if (currAdBreakPoint != newAdBreakPoint) {
      hasAdBreakPointChanged = true;
      currAdBreakPoint = newAdBreakPoint;
      return true;
    } else {
      hasAdBreakPointChanged = false;
      return false;
    }
  }
  var debounce = (callback, wait) => {
    var timeoutId = null;
    return (...args) => {
      window.clearTimeout(timeoutId);
      timeoutId = window.setTimeout(() => {
        //Call timebased ad refresh only for non level based games or skipGameEvtsLogic is true
        if (typeof skipGameEvtsLogic != "undefined" && skipGameEvtsLogic) {
          resetAdRefreshTimer();
        } else {
          gameEvtRefreshAds();
        }
        hasAdBreakPointChanged = checkAdBreakPointChanged();
        if (hasAdBreakPointChanged) {
          callback.apply(null, args);
        } else {
          console.trace();
        }
      }, wait);
    };
  };

  window.addEventListener("resize", debounce(() => {
    var pwUnits = [];
    var windowPath = window.location.pathname;
    if (pageLang != "") {
      windowPath = window.location.pathname.replace(pageLang, "");
      windowPath = windowPath.replace("//", "/");
    }

    // category landing pages with video
    if (windowPath == "/1-strategy-games" ||
      windowPath == "/1-skill-games" ||
      windowPath == "/1-number-games" ||
      windowPath == "/1-logic-games" ||
      windowPath == "/categories" ||
      windowPath == "/1-daily-games" ||
      windowPath == "/1-complete-game-list" ||
      windowPath == "/profile/leaderboard") {
      var tyche = {
        mode: "tyche",
        config: "//config.playwire.com/1023174/v2/websites/71134/banner.json",
        forcePath: "trendi-video",
        passiveMode: true
      };

      if (document.documentElement.clientWidth <= 767 || document.documentElement.classList.contains("mobile-device")) { //mobile
        var desUnits = typeof window.tyche.getUnits == "function" ? window.tyche.getUnits() : [];
        if (desUnits.length && desUnits.indexOf("trendi_video") >=0 && typeof window.tyche.destroyUnits == "function") {
          var index = desUnits.indexOf("trendi_video");
          var desTrendi = desUnits.splice(index, 1);
          window.tyche.destroyUnits(desUnits).catch((e) => {

          });
          window.tyche.destroyUnits(desTrendi).catch((e) => {

          });
        } else
        if (typeof window.tyche.destroyUnits == "function") {
          window.tyche.destroyUnits("all").catch((e) => {
            //console.log("CMGAd Destruction: destroyUnits error: ", e);
          });
        }
        pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf10, med_rect_btf10);
        if (window.tyche.addUnits) {
          ramp.isMobile = true;
          ramp.settings.device = "mobile";
          ramp.settings.deviceSelector = "mobi";
          ramp.settings.isMobile = true;
          window.tyche.addUnits(pwUnits)
          .then(() => {
            window.tyche.displayUnits();
          })
          .catch((e) => {
            window.tyche.displayUnits();
          });
        }

      } else if (document.documentElement.clientWidth >= 768 && document.documentElement.clientWidth <= 1319 || document.documentElement.classList.contains("mobile-device")) {
        var desUnits = typeof window.tyche.getUnits == "function" ? window.tyche.getUnits() : [];
        if (desUnits.length && desUnits.indexOf("trendi_video") >=0 && typeof window.tyche.destroyUnits == "function") {
          var index = desUnits.indexOf("trendi_video");
          var desTrendi = desUnits.splice(index, 1);
          window.tyche.destroyUnits(desUnits).catch((e) => {
          });
          window.tyche.destroyUnits(desTrendi).catch((e) => {
          });
        } else
        if (typeof window.tyche.destroyUnits == "function") {
          window.tyche.destroyUnits("all").catch((e) => {
          });
        }

        pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, sky_btf, trendi_video);

        if (window.tyche.addUnits) {
          ramp.isMobile = false;
          ramp.settings.device = "desktop";
          ramp.settings.deviceSelector = "desk";
          ramp.settings.isMobile = false;
          window.tyche.addUnits(pwUnits)
          .then(() => {
            window.tyche.displayUnits();
          })
          .catch((e) => {
            window.tyche.displayUnits();
          });
        }

      } else {
        var desUnits = typeof window.tyche.getUnits == "function" ? window.tyche.getUnits() : [];
        if (desUnits.length && desUnits.indexOf("trendi_video") >=0 && typeof window.tyche.destroyUnits == "function") {
          var index = desUnits.indexOf("trendi_video");
          var desTrendi = desUnits.splice(index, 1);
          window.tyche.destroyUnits(desUnits).catch((e) => {
          });
          window.tyche.destroyUnits(desTrendi).catch((e) => {
          });
        } else
        if (typeof window.tyche.destroyUnits == "function") {
          window.tyche.destroyUnits("all").catch((e) => {
          });
        }
        addSkyAtfAdContainer();
        pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, sky_atf, sky_btf, trendi_video);
        if (window.tyche.addUnits) {
          ramp.isMobile = false;
          ramp.settings.device = "desktop";
          ramp.settings.deviceSelector = "desk";
          ramp.settings.isMobile = false;
          window.tyche.addUnits(pwUnits)
          .then(() => {
            window.tyche.displayUnits();
          })
          .catch((e) => {
            window.tyche.displayUnits();
          });
        }
      }

    // Homepage, category landing pages without video
    } else if (windowPath == "/" ) {
      tyche = {
        mode: "tyche",
        config: "//config.playwire.com/1023174/v2/websites/71134/banner.json",
        passiveMode: true
      };

      if (document.documentElement.clientWidth <= 767) { //mobile
        if (typeof window.tyche.destroyUnits == "function") {
          window.tyche.destroyUnits("all").catch((e) => {
          });
        }
        pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf10, med_rect_btf10);

          if (window.tyche.addUnits) {
            ramp.isMobile = true;
            ramp.settings.device = "mobile";
            ramp.settings.deviceSelector = "mobi";
            ramp.settings.isMobile = true;
            window.tyche.addUnits(pwUnits)
            .then(() => {
              window.tyche.displayUnits();
            })
            .catch((e) => {
              window.tyche.displayUnits();
            });
          }

      } else if (document.documentElement.clientWidth >= 768 && document.documentElement.clientWidth <= 1319 || document.documentElement.classList.contains("mobile-device")) {

        if (typeof window.tyche.destroyUnits == "function") {
          window.tyche.destroyUnits("all").catch((e) => {
          });
        }
        pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf1, med_rect_btf2, med_rect_btf3, med_rect_btf4);

          if (window.tyche.addUnits) {
            ramp.isMobile = false;
            ramp.settings.device = "desktop";
            ramp.settings.deviceSelector = "desk";
            ramp.settings.isMobile = false;
            window.tyche.addUnits(pwUnits)
            .then(() => {
              window.tyche.displayUnits();
            })
            .catch((e) => {
              window.tyche.displayUnits();
            });
          }

      } else {
        if (typeof window.tyche.destroyUnits == "function") {
          window.tyche.destroyUnits("all").catch((e) => {
          });
        }
        addSkyAtfAdContainer();
        pwUnits.push(leaderboard_atf, leaderboard_btf, sky_atf, med_rect_atf, med_rect_btf1, med_rect_btf2, med_rect_btf3, med_rect_btf4);

          if (window.tyche.addUnits) {
            ramp.isMobile = false;
            ramp.settings.device = "desktop";
            ramp.settings.deviceSelector = "desk";
            ramp.settings.isMobile = false;
            window.tyche.addUnits(pwUnits)
            .then(() => {
              window.tyche.displayUnits();
            })
            .catch((e) => {
              window.tyche.displayUnits();
            });
        }
      }

      // all other pages
    } else {
      tyche = {
        mode: "tyche",
        config: "//config.playwire.com/1023174/v2/websites/71134/banner.json",
        passiveMode: true
      };
      if (document.documentElement.clientWidth <= 767) { //mobile
        if (typeof window.tyche.destroyUnits == "function") {
          window.tyche.destroyUnits("all").catch((e) => {
          });
        }
        pwUnits.push(leaderboard_atf, leaderboard_btf);

        if (window.tyche.addUnits) {
          ramp.isMobile = true;
          ramp.settings.device = "mobile";
          ramp.settings.deviceSelector = "mobi";
          ramp.settings.isMobile = true;
          window.tyche.addUnits(pwUnits)
          .then(() => {
            window.tyche.displayUnits();
          })
          .catch((e) => {
            window.tyche.displayUnits();
          });
        }

      } else if (document.documentElement.clientWidth >= 768 && document.documentElement.clientWidth <= 1319 || document.documentElement.classList.contains("mobile-device")) { //desktop
        if (typeof window.tyche.destroyUnits == "function") {
          window.tyche.destroyUnits("all").catch((e) => {
          });
        }
        pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, med_rect_btf1, sky_btf);

        if (window.tyche.addUnits) {
          ramp.isMobile = false;
          ramp.settings.device = "desktop";
          ramp.settings.deviceSelector = "desk";
          ramp.settings.isMobile = false;
          window.tyche.addUnits(pwUnits)
          .then(() => {
            window.tyche.displayUnits();
          })
          .catch((e) => {
            window.tyche.displayUnits();
          });
        }

      } else {
        window.tyche.destroyUnits("all").catch((e) => {
        });
        addSkyAtfAdContainer();
        pwUnits.push(leaderboard_atf, leaderboard_btf, med_rect_atf, med_rect_btf, med_rect_btf1, sky_atf, sky_btf);

        if (window.tyche.addUnits) {
          ramp.isMobile = false;
          ramp.settings.device = "desktop";
          ramp.settings.deviceSelector = "desk";
          ramp.settings.isMobile = false;
          window.tyche.addUnits(pwUnits)
          .then(() => {
            window.tyche.displayUnits();
          })
          .catch((e) => {
            window.tyche.displayUnits();
          });
        }
      }
      if(/\/trivia\//.test(windowPath)) {
        clearQuizEvtTimer();
        quizEvtTimer = setTimeout(function () {
          quizEvtTimerAction()
        }, intvlValue);
        quizEvtTimerDone = false;
      }
    }
  }, 500))</script>
<script type="deferjs">
          var $elements_with_events = jQuery('.js-track');
          if ($elements_with_events.length > 0) {
            $elements_with_events.each(function(){
            var action = typeof jQuery(this).data('action') !== 'undefined' ? jQuery(this).data('action') : 'click';
            jQuery(this).on(action, function(){
            var category, label;
            category = typeof jQuery(this).data('category') !== 'undefined' ? jQuery(this).data('category') : ( jQuery(this).text() || 'Unassigned' );
            label = typeof jQuery(this).data('label') !== 'undefined' ? jQuery(this).data('label') :  ( jQuery(this).attr('class') || 'Unassigned' );
            trackEvent(category,'click',label);
           });
         });
        }
       </script>
<title>Jacksmith - Play online at Coolmath Games</title><script type="application/json" data-drupal-selector="drupal-settings-json">{"path":{"baseUrl":"\/","scriptPath":null,"pathPrefix":"","currentPath":"node\/10916","currentPathIsAdmin":false,"isFront":false,"currentLanguage":"en"},"pluralDelimiter":"\u0003","suppressDeprecationErrors":true,"clientside_validation_jquery":{"validate_all_ajax_forms":2,"force_validate_on_blur":false,"messages":{"required":"This field is required.","remote":"Please fix this field.","email":"Please enter a valid email address.","url":"Please enter a valid URL.","date":"Please enter a valid date.","dateISO":"Please enter a valid date (ISO).","number":"Please enter a valid number.","digits":"Please enter only digits.","equalTo":"Please enter the same value again.","maxlength":"Please enter no more than {0} characters.","minlength":"Please enter at least {0} characters.","rangelength":"Please enter a value between {0} and {1} characters long.","range":"Please enter a value between {0} and {1}.","max":"Please enter a value less than or equal to {0}.","min":"Please enter a value greater than or equal to {0}.","step":"Please enter a multiple of {0}."}},"cmg_sjpath":"\/sites\/default\/files\/cmatgame_games_with_levels.json?t=202305242049","cmatgame":{"language":"en","gamePlaylistCount":4386,"varViewPlayListText_1":"VIEW PLAYLISTS WITH THIS GAME","varGameInText_1":"THIS GAME IS IN","varPlayListText_1":"PLAYLISTS","flash_emulation":"3","html5embed":{"width":"800","height":"600","game":{"u":"sites\/default\/files\/games\/Jacksmith 5-1-23.zip"}},"swfembed":"","isSubscriptionActive":false,"isHasGameInAds":"0"},"lazy":{"lazysizes":{"lazyClass":"lazyload","loadedClass":"lazyloaded","loadingClass":"lazyloading","preloadClass":"lazypreload","errorClass":"lazyerror","autosizesClass":"lazyautosizes","srcAttr":"data-src","srcsetAttr":"data-srcset","sizesAttr":"data-sizes","minSize":40,"customMedia":[],"init":true,"expFactor":1.5,"hFac":0.8000000000000000444089209850062616169452667236328125,"loadMode":2,"loadHidden":true,"ricTimeout":0,"throttleDelay":125,"plugins":[]},"placeholderSrc":"","preferNative":false,"minified":true,"libraryPath":"\/libraries\/lazysizes"},"language":"en","lang_dropdown":{"lang-dropdown-form":{"key":"lang-dropdown-form"}},"form_placeholder":{"include":"","exclude":"","required_indicator":"append"},"ajaxTrustedUrl":{"form_action_p_pvdeGsVG5zNF_XLGPTvYSKCf43t8qZYSwcfZl2uzM":true},"user":{"uid":0,"permissionsHash":"5245d32a4314fbefabce2250e8ec13dbb7951edd5107ac52dec252847df23323"}}</script>
<script src="/sites/default/files/js/js_nsJiP0lAhA-Urle3YSMKwbvj3YMjAIODRs-Nlk-9E9M.js" type="deferjs"></script>
<!--fixes for defer issues on drupal core js--><script type="deferjs">Drupal.attachBehaviors();</script><!-- Google Tag Manager --><script>(function(w,d,s,l,i){
    w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  })(window,document,'script','dataLayer','GTM-WKRSNN8');
  function setCookie2(key, value, exptime, domain) {
    //document.cookie = key + '=' + value + ';';
    var d = new Date();
    d.setTime(d.getTime() + exptime);
    var expires = "expires=" + d.toUTCString();
    document.cookie = key + "=" + value + "; " + expires + "; path=/; domain=" +domain;
  }
  </script><!-- End Google Tag Manager --><script type="text/javascript">
  function getQParam(name) {
      var regexS = "[\\?&]" + name + "=([^&#]*)";
      var regex = new RegExp(regexS);
      var results = regex.exec(location.href);
      if (results === null) {
        return "";
      }
      return decodeURIComponent(results[1].replace(/\+/g, " "));
    }
    cmatgame_subscriber = getCookie("cmg_sx");
    if(getCookie("cmg_wl") !== null) {
      cmatgame_subscriber = getCookie("cmg_wl");
    }
    freeTrialUser = false;
    //TODO -- if freeTrialUser is needed in future
    //if(!schoolHours && targetStateUser && cmg_active_anonymous_user === null && cmatgame_editor === null) {
    //  freeTrialUser = true;
    //}
    var adBlockDisplayed = false;
    window.addEventListener('load', (event) => {
    	//debugOut("AdRecovery: check2");
      setTimeout(function () {
        //debugOut("AdRecovery: Delayed loading of btloader "+new Date());
        var head = document.getElementsByTagName('head')[0];
        var js = document.createElement("script");
        js.type = "text/javascript";
        js.src = "https://btloader.com/tag?o=5150306120761344&upapi=true";
        head.appendChild(js);
      }, 3000);
    });
  </script></head><body class="large-game-item path-_-jacksmith node-type-game node-10916 game-scalable html5 mobile-not-playable not-active-user lang-default lang-en" ><div class="dialog-off-canvas-main-canvas" data-off-canvas-main-canvas><style>
  .game-on-mobile .game-progress-status{ min-height: 32px;}
  .flash #thumbsup a{pointer-events:none; padding-right: 0}
  .flash .like-container-entity-node, .flash .like-container-entity-node{pointer-events: none}
  .flash .dislike-container-entity-node, .flash #thumbsup .thumbsupmessage{display:none;}
</style><div class="page global-wrapper"><main class="mt-0"><header class="page__header d-none d-lg-block"><div class="branding container"><div class="row"><div class="other-sites-wrapper col-lg-3 d-none d-lg-block pl-0"><div class="panel-pane pane-block pane-bean-new-go-ad-free homepage-b"><a id="cmg-goadfree" class="go-ad-free-btn" onclick="goadfree_event_handler()" href="#">Go Ad-Free!</a></div><div class="viewWebLang" style="display:none"><a href="#" class="viewLangBtn" onclick="cmg_view_default_lang_site(this);">View site in english</a></div></div><div class="logo-container col-7 col-lg-6 "><a href="/" title="Home" rel="home" class="site-branding__logo"><img src="/themes/custom/coolmath/logo.svg" alt="Home" class="logo svg" width="438" height="61"/></a></div><div class="right-header-block col-2 col-lg-3 pr-0"><!-- user-avatar-form.twig --><div class="welcome-box"><a href="/signup?v1" class="btn free-account" title="Get a Free Account"><span class="avatar"></span><span class="badge"></span><span class="getuserprofile">Get your user profile</span><span class="earn">FREE | Earn XP | Level Up</span></a></li><div class="login-link my-2 my-lg-0"><p>Or
          <a href="/login" title="Log In" class="login">Log In</a></p></div></div></div></div></div><nav class="navbar navbar-expand-lg justify-content-between"><div class="container"><div class="navbar-container"><div class="settings-tray-editable large-game-item block block--coolmath-desktopheadermenu" data-drupal-settingstray="editable"><div class="pane-menu-menu-desktop-header-menu"><div class="pane-content"><ul class="menu"><li  class="menu_most popular menu__link" id="menu-id-most popular"><a href="/1-popular-games" class="menu_most popular menu__link" id="menu-id-most popular" data-drupal-link-system-path="entityqueue/home_popular">Most Popular</a></li><li  class="menu_strategy menu__link" id="menu-id-strategy"><a href="/1-strategy-games" class="menu_strategy menu__link" id="menu-id-strategy" data-drupal-link-system-path="taxonomy/term/6">Strategy</a></li><li  class="menu_skill menu__link" id="menu-id-skill"><a href="/1-skill-games" class="menu_skill menu__link" id="menu-id-skill" data-drupal-link-system-path="taxonomy/term/46">Skill</a></li><li  class="menu_numbers menu__link" id="menu-id-numbers"><a href="/1-number-games" class="menu_numbers menu__link" id="menu-id-numbers" data-drupal-link-system-path="taxonomy/term/151">Numbers</a></li><li  class="menu_logic menu__link" id="menu-id-logic"><a href="/1-logic-games" class="menu_logic menu__link" id="menu-id-logic" data-drupal-link-system-path="taxonomy/term/91">Logic</a></li><li  class="menu_trivia menu__link" id="menu-id-trivia"><a href="/trivia" class="menu_trivia menu__link" id="menu-id-trivia" data-drupal-link-system-path="trivia">Trivia</a></li><li class="menu__item is-expanded expanded"><span  class="menu_more menu__link nolink" id="menu-id-more">More</span><div class="expandable-wrapper"><ul class="menu"><li class="nested"><a href="/1-classic-games" class="menu_classic menu__link" id="more-submenu-1" data-drupal-link-system-path="taxonomy/term/211">Classic</a></li><li class="nested"><a href="/1-word-games" class="menu_word games menu__link" id="more-submenu-2" data-drupal-link-system-path="taxonomy/term/1059">Word Games</a></li><li class="nested"><a href="/0-jigsaw-puzzles" class="menu_jigsaw menu__link" id="more-submenu-3" data-drupal-link-system-path="0-jigsaw-puzzles">Jigsaw</a></li><li class="nested"><a href="/1-creative-games" class="menu_creative menu__link" id="more-submenu-4" data-drupal-link-system-path="taxonomy/term/1263">Creative</a></li><li class="nested"><a href="/1-memory-games" class="menu_memory menu__link" id="more-submenu-5" data-drupal-link-system-path="taxonomy/term/181">Memory</a></li><li class="nested"><a href="/1-geography-games" class="menu_geography menu__link" id="more-submenu-6" data-drupal-link-system-path="taxonomy/term/206">Geography</a></li><li class="nested"><a href="/1-science-games" class="menu_science menu__link" id="more-submenu-7" data-drupal-link-system-path="taxonomy/term/626">Science</a></li></ul></div></li><li  class="menu_categories  menu__link" id="menu-id-categories "><a href="/categories" class="menu_categories  menu__link" id="menu-id-categories " data-drupal-link-system-path="categories">Categories </a></li><li  class="menu_random menu__link random-redirect" id="menu-id-random-redirect"><a href="/random" class="menu_random menu__link random-redirect" id="menu-id-random-redirect" data-drupal-link-system-path="random">Random!</a></li><li  class="menu_unlocked menu__link" id="menu-id-daily-games"><a href="/1-daily-games" class="menu_unlocked menu__link" id="menu-id-daily-games" data-drupal-link-system-path="taxonomy/term/1056">Daily Games</a></li><li  class="menu_all games menu__link" id="menu-id-all-games"><a href="/1-complete-game-list" class="menu_all games menu__link" id="menu-id-all-games" data-drupal-link-system-path="1-complete-game-list">All Games</a></li></ul></div></div></div><div class="panel-pane pane-block pane-cmatgame-search-search-game"><div id="cmatgame-search-block-form"><div class="form-item"><label for="edit-search-bar">Search bar </label><input placeholder="Search by game name" type="text" name="search_bar" value="" size="60" maxlength="128" class="form-text menu-search-bar" style="display: none; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;"><div id="close-search-box" style="display: none;">X</div></div><div class="search-results-container" style="display: none;"></div></div></div></div></div></nav></header><header class="page__header page__header_mobile d-lg-none"><div class="container-fluid"><div class="row logo"><div class="logo-container-mobile col-12 text-center"><a href="/" title="Home" rel="home" class="site-branding__logo mobile" ><img src="/themes/custom/coolmath/logo.svg" alt="Home" class="logo svg" width="438" height="61" /></a></div></div></div><nav class="navbar"><div class="navbar-inner"><button class="navbar-toggler" type="button"><span class="bar first"></span><span class="bar second"></span><span class="bar third"></span></button><div class="menu-overlay"></div><div class="navbar-container"><div class="mobile-menu-items"><div class="mi-title"><strong>Search</strong></div><div class="cmatgame-search-game pane-cmatgame-search-search-game"><div id="cmatgame-search-block-form"><div class="form-item"><label for="edit-search-bar">Search bar </label><input placeholder="Search by game name" type="text" name="search_bar" value="" size="60" maxlength="128" class="form-text menu-search-bar" style="display: none; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;"><div id="close-search-box" style="display: none;">X</div></div><div class="search-results-container" style="display: none;"></div></div></div><div class="mi-title"><strong>Browse</strong></div><div class="settings-tray-editable large-game-item block block--coolmath-desktopheadermenu" data-drupal-settingstray="editable"><div class="pane-menu-menu-desktop-header-menu"><div class="pane-content"><ul class="menu"><li  class="menu_most popular menu__link" id="menu-id-most popular"><a href="/1-popular-games" class="menu_most popular menu__link" id="menu-id-most popular" data-drupal-link-system-path="entityqueue/home_popular">Most Popular</a></li><li  class="menu_strategy menu__link" id="menu-id-strategy"><a href="/1-strategy-games" class="menu_strategy menu__link" id="menu-id-strategy" data-drupal-link-system-path="taxonomy/term/6">Strategy</a></li><li  class="menu_skill menu__link" id="menu-id-skill"><a href="/1-skill-games" class="menu_skill menu__link" id="menu-id-skill" data-drupal-link-system-path="taxonomy/term/46">Skill</a></li><li  class="menu_numbers menu__link" id="menu-id-numbers"><a href="/1-number-games" class="menu_numbers menu__link" id="menu-id-numbers" data-drupal-link-system-path="taxonomy/term/151">Numbers</a></li><li  class="menu_logic menu__link" id="menu-id-logic"><a href="/1-logic-games" class="menu_logic menu__link" id="menu-id-logic" data-drupal-link-system-path="taxonomy/term/91">Logic</a></li><li  class="menu_trivia menu__link" id="menu-id-trivia"><a href="/trivia" class="menu_trivia menu__link" id="menu-id-trivia" data-drupal-link-system-path="trivia">Trivia</a></li><li class="menu__item is-expanded expanded"><span  class="menu_more menu__link nolink" id="menu-id-more">More</span><div class="expandable-wrapper"><ul class="menu"><li class="nested"><a href="/1-classic-games" class="menu_classic menu__link" id="more-submenu-1" data-drupal-link-system-path="taxonomy/term/211">Classic</a></li><li class="nested"><a href="/1-word-games" class="menu_word games menu__link" id="more-submenu-2" data-drupal-link-system-path="taxonomy/term/1059">Word Games</a></li><li class="nested"><a href="/0-jigsaw-puzzles" class="menu_jigsaw menu__link" id="more-submenu-3" data-drupal-link-system-path="0-jigsaw-puzzles">Jigsaw</a></li><li class="nested"><a href="/1-creative-games" class="menu_creative menu__link" id="more-submenu-4" data-drupal-link-system-path="taxonomy/term/1263">Creative</a></li><li class="nested"><a href="/1-memory-games" class="menu_memory menu__link" id="more-submenu-5" data-drupal-link-system-path="taxonomy/term/181">Memory</a></li><li class="nested"><a href="/1-geography-games" class="menu_geography menu__link" id="more-submenu-6" data-drupal-link-system-path="taxonomy/term/206">Geography</a></li><li class="nested"><a href="/1-science-games" class="menu_science menu__link" id="more-submenu-7" data-drupal-link-system-path="taxonomy/term/626">Science</a></li></ul></div></li><li  class="menu_categories  menu__link" id="menu-id-categories "><a href="/categories" class="menu_categories  menu__link" id="menu-id-categories " data-drupal-link-system-path="categories">Categories </a></li><li  class="menu_random menu__link random-redirect" id="menu-id-random-redirect"><a href="/random" class="menu_random menu__link random-redirect" id="menu-id-random-redirect" data-drupal-link-system-path="random">Random!</a></li><li  class="menu_unlocked menu__link" id="menu-id-daily-games"><a href="/1-daily-games" class="menu_unlocked menu__link" id="menu-id-daily-games" data-drupal-link-system-path="taxonomy/term/1056">Daily Games</a></li><li  class="menu_all games menu__link" id="menu-id-all-games"><a href="/1-complete-game-list" class="menu_all games menu__link" id="menu-id-all-games" data-drupal-link-system-path="1-complete-game-list">All Games</a></li></ul></div></div></div><!-- user-avatar-form.twig --><div class="welcome-box"><a href="/signup?v1" class="btn free-account" title="Get a Free Account"><span class="avatar"></span><span class="badge"></span><span class="getuserprofile">Get your user profile</span><span class="earn">FREE | Earn XP | Level Up</span></a></li><div class="login-link my-2 my-lg-0"><p>Or
          <a href="/login" title="Log In" class="login">Log In</a></p></div></div></div></div></div></nav></header><div class="page__content"><div class="container-fluid game-scalable"><div id="main-row" class="row pb-3 large-game-item flex-nowrap"><div class="l-aside d-none d-xxl-block p-0">

<div id="block-coolmath-adsleft-otherpage-160x600" class="settings-tray-editable large-game-item block block-cmatgame-core block-adsleft-otherpage-160x600" data-drupal-settingstray="editable">
  
    
      <div class="view-content">
      <div class="panel-pane pane-block pane-cmatgame-advertisement-cm-g-otherpages-160x600-left">
	        <div class="ad-wrapper">
	          <div id="left-ad" class="ad-holder">
	           <!-- will be appended later if window/game size requirements are met
	           <div id="sky-atf"></div> -->
	          </div>
	          <script type="text/javascript">
	           if(getCookie("cmg_sx") == null &&  getCookie("cmg_wl")== null) {

	             var leftAd = document.getElementById("left-ad");
	             var sky_left = document.createElement("div");
	             sky_left.setAttribute("id", "sky-atf");
	             leftAd.appendChild(sky_left);
	           }
	          </script>
	          </div>
	        </div>
    </div>
  </div></div><div class="l-aside-spacer d-none d-xl-block d-xxl-block p-0"></div><div class="main-col col-md-6 ml-lg-3 ml-xxl-0 mr-md-0 pr-md-0 pl-md-3 pl-lg-0 pr-xl-0 pl-xx2l-0 w"><div class=" leaderboard"><div class="col-12"><div id="block-coolmath-adstop-otherpage-728x90" class="settings-tray-editable block block-cmatgame-core block-adstop-otherpage-728x90" data-drupal-settingstray="editable"><div class="view-content"><div class="item-list"><div class="panel-pane pane-block pane-cmatgame-advertisement-cm-g-otherpages-728-90"><div class="ad-wrapper"><!-- 728 x 90 ATF Desktop --><div id="leaderboard-atf"></div></div></div></div></div></div></div></div><a id="main-content" tabindex="-1"></a><div class="inside"><div data-drupal-messages-fallback class="hidden"></div><div id="block-coolmath-breadcrumbs" class="settings-tray-editable large-game-item block block-system block-system-breadcrumb-block" data-drupal-settingstray="editable"><div class="view-content"></div></div><div id="block-coolmath-coolmath-system-main" class="large-game-item block block-system block-system-main-block"><div class="view-content"><script>
  $(document).ready(function() {
    window.lazySizesConfig = window.lazySizesConfig || {};
    window.lazySizesConfig.expand = 959;

    $(window).resize(function () {
      if (window.innerWidth >= 960) { // Lazy load the div
        var desktopLayout = $('.desktop-layout');
        if (desktopLayout.length > 0) {
          desktopLayout.addClass('lazyload');
        }
      }
      else if (window.innerWidth >= 959) { // Lazy load the div
        var mobileLayout = $('.mobile-layout');
        if (mobileLayout.length > 0) {
          mobileLayout.addClass('lazyload');
        }
      }
    });
  });
</script><!-- Desktop Layout --><div class="desktop-layout"><div class="d-none d-lg-block  game-on_device game-on-desktop"><div id="block-coolmath-carouselingamedetailpage" class="settings-tray-editable large-game-item block block-cmatgame-core block-gamedetailcarousel" data-drupal-settingstray="editable"><div class="view-content"><div class="pane-game-details-carousel-game-detail"><div class='view-display-id-carousel_game_detail'><div class='view-header'><p>You'll Also Like</p></div><div class='view-content'><div class='game-carousel owl-carousel'><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-freezeria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Freezeria Game" title="Papa&#039;s Freezeria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/Papas%20Freezeria%20OG%20Image.png?itok=5GARq7pZ" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><video  class="field-media" preload="metadata" muted loop webkit-playsinline playsinline width="100%" data-src="/sites/default/files/2022-12/papas_freezeria_gameplay.mp4"></video></div><h5 class="game-title">Papa's Freezeria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-burgeria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Burgeria Game" title="Papa&#039;s Burgeria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/Papas%20Burgeria%20OG%20Image.png?itok=IFGm5Z6k" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><video  class="field-media" preload="metadata" muted loop webkit-playsinline playsinline width="100%" data-src="/sites/default/files/2023-02/papas_burgeria_gameplay.mp4"></video></div><h5 class="game-title">Papa's Burgeria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-cupcakeria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Cupcakeria Game" title="Papa&#039;s Cupcakeria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/Papas%20Cupcakeria%20OG%20Image.png?itok=yaq8F58f" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><video  class="field-media" preload="metadata" muted loop webkit-playsinline playsinline width="100%" data-src="/sites/default/files/2023-01/papas_cupcakeria_gameplay.mp4"></video></div><h5 class="game-title">Papa's Cupcakeria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-bakeria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Bakeria Game" title="Papa&#039;s Bakeria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/Papa%27s%20Bakeria%20OG%20Image.png?itok=IuVo55Am" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><video  class="field-media" preload="metadata" muted loop webkit-playsinline playsinline width="100%" data-src="/sites/default/files/2023-03/Papa%27s%20Bakeria%20Gameplay.mp4"></video></div><h5 class="game-title">Papa's Bakeria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-cheeseria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Cheeseria Game" title="Papa&#039;s Cheeseria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/Papa%27s%20Cheeseria%20OG%20Image.png?itok=7tGmFN-s" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><video  class="field-media" preload="metadata" muted loop webkit-playsinline playsinline width="100%" data-src="/sites/default/files/2023-03/Papa%27s%20Cheeseria%20Gameplay_0.mp4"></video></div><h5 class="game-title">Papa's Cheeseria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-pizzeria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Pizzeria Game" title="Papa&#039;s Pizzeria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/Papas%20Pizzeria%20OG%20Image.png?itok=NN9PVVp8" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><video  class="field-media" preload="metadata" muted loop webkit-playsinline playsinline width="100%" data-src="/sites/default/files/2022-11/papas_pizzeria_gameplay.mp4"></video></div><h5 class="game-title">Papa's Pizzeria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-taco-mia?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Taco Mia Game" title="Papa&#039;s Taco Mia" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/Papa%27s%20Taco%20Mia%20OG%20Image.png?itok=7uN3_XK1" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><video  class="field-media" preload="metadata" muted loop webkit-playsinline playsinline width="100%" data-src="/sites/default/files/2023-04/Papa%27s%20Taco%20Mia%20Gameplay.mp4"></video></div><h5 class="game-title">Papa's Taco Mia</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-pancakeria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Pancakeria Game" title="Papa&#039;s Pancakeria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/Papa%27s%20Pancakeria%20OG%20Image.png?itok=wR6hrIfT" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><video  class="field-media" preload="metadata" muted loop webkit-playsinline playsinline width="100%" data-src="/sites/default/files/2023-05/Papa%27s%20Pancakeria%20Gameplay.mp4"></video></div><h5 class="game-title">Papa's Pancakeria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-donuteria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Donuteria Game" title="Papa&#039;s Donuteria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/papas-donuteria.jpg?itok=e5kObgS6" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><span class="icon-gamethumbnail-carousel"></span></div><h5 class="game-title">Papa's Donuteria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-wingeria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Wingeria Game" title="Papa&#039;s Wingeria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/papas-wingeria.jpg?itok=BbWAY4n9" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><span class="icon-gamethumbnail-carousel"></span></div><h5 class="game-title">Papa's Wingeria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-sushiria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Sushiria Game" title="Papa&#039;s Sushiria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/papas-sushiria.png?itok=09plFCBw" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><span class="icon-gamethumbnail-carousel"></span></div><h5 class="game-title">Papa's Sushiria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-hot-doggeria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Hot Doggeria Game" title="Papa&#039;s Hot Doggeria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/papas-hotdoggeria.jpg?itok=AXYeTXkJ" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><span class="icon-gamethumbnail-carousel"></span></div><h5 class="game-title">Papa's Hot Doggeria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-pastaria?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Pastaria Game" title="Papa&#039;s Pastaria" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/papas-pastaria.jpg?itok=agAnGYIv" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><span class="icon-gamethumbnail-carousel"></span></div><h5 class="game-title">Papa's Pastaria</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-kukoo-machines?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Kukoo Machines Game" title="Kukoo Machines" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/kukoo-machines.png?itok=uSsd8ckB" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><span class="icon-gamethumbnail-carousel"></span></div><h5 class="game-title">Kukoo Machines</h5></a></div></div></div><div class="slide-item mobile-hidden"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-scooperia?utm_content=CTA_You_Will_Also_Like"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" width="117" height="72" alt="Papa&#039;s Scooperia Game" title="Papa&#039;s Scooperia" loading="lazy" data-src="/sites/default/files/styles/thumbnail_small_you_will_like/public/papas-scooperia.jpg?itok=J_p1gniX" class="lazyload large-game-item img-fluid" typeof="foaf:Image" /><span class="icon-gamethumbnail-carousel"></span></div><h5 class="game-title">Papa's Scooperia</h5></a></div></div></div></div></div></div></div></div></div><div id="block-system-main" class="mt-3"><script type="deferjs">
    (function ($, Drupal) {
      $(document).ready(function () {
        var varGameInText_1 = drupalSettings.cmatgame.varGameInText_1;
        var hasGameInAds = drupalSettings.cmatgame.isHasGameInAds;

        if(getCookie('cmg_sx') != null && hasGameInAds =='1'){
          $("#in_game_ad_msg").show();
          $("#in_game_ad_msg_mobile").show();
        }
        function userControls(){
           if((window.innerWidth<960) || ($('html.mobile-device').length)){
            if(!$('.game-page-mobile .user-controls').length){
               $('.user-controls').appendTo($('.game-page-mobile .game-meta-header'));
            }
            $('.game-on-desktop .user-controls').remove();
          }else{
            if(!$('.game-on-desktop .user-controls').length){
               $('.user-controls').insertBefore($('.game-on-desktop .game-meta-header h1.pane-title'));
            }
            $('.game-page-mobile .user-controls').remove();
          }
        }
        userControls();
        $(window).on('resize',function(){
          userControls();
        })
      });
    })(jQuery, Drupal);
  </script><article data-history-node-id="10916" role="article" about="/0-jacksmith" class="large-game-item node node-game node--view-mode-full clearfix game-w-summary game-field-wrapper"><header></header><script type="deferjs">
      if (typeof signupPromoTop !== 'undefined' && signupPromoTop !== '') {
          signupContainerTop = '<div class="signup-container-top"><a href="/subscribe/2efa4bc4" onclick="preroll_signup_top_handler();">' + signupPromoTop + '</a></div>';
        } else {
          signupPromoTop = '';
          signupContainerTop = '<div class="signup-container-top"><a href="/subscribe/2efa4bc4" onclick="preroll_signup_top_handler();">' + signupPromoTop + '</a></div>';
        }
        if (typeof signupPromoBottom !== 'undefined' && signupPromoBottom !== '') {
          signupContainerBottom = '<div class="signup-container-bottom"><a href="/subscribe/2efa4bc4" onclick="preroll_signup_bottom_handler();">' + signupPromoBottom + '</a></div>';
        } else {
          signupPromoBottom = '';
          signupContainerBottom = '<div class="signup-container-bottom"><a href="/subscribe/2efa4bc4" onclick="preroll_signup_bottom_handler();">' + signupPromoBottom + '</a></div>';
        }
        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);
				}
    </script><script type="application/ld+json">[
        {
          "@context": "https://schema.org",
          "@type": "WebApplication",
          "name": "Jacksmith",
          "url": "https://www.coolmathgames.com/0-jacksmith",
          "author": {
            "@type": "Organization",
            "name": "Coolmath Games"
          },
          "description":"Do you like the Papa's cooking games? Craft swords, bows and shields to equip heroes and defeat monsters in this awesome crafting adventure!\r\n",
          "applicationCategory": "Game",
          "operatingSystem": "any",
          "screenshot": {
            "@type": "ImageObject",
            "thumbnailUrl":  "https://www.coolmathgames.com//sites/default/files/Jacksmith%20OG%20Image.png"
          },
                  "aggregateRating":{
             "@type":"AggregateRating",
             "worstRating":1,
             "bestRating":5,
             "ratingValue":4.8,
             "ratingCount":467167
          },
                "offers": {
              "@type": "Offer",
              "category": "free",
              "price": 0,
              "priceCurrency": "USD"
            }
          },
          {
            "@context": "https://schema.org",
            "@type": "VideoGame",
            "name": "Jacksmith",
            "url": "https://www.coolmathgames.com/0-jacksmith",
            "author": {"@type": "Organization", "name": "Coolmath Games"},
            "description":"Do you like the Papa's cooking games? Craft swords, bows and shields to equip heroes and defeat monsters in this awesome crafting adventure!\r\n",
            "applicationCategory": "Game",
            "operatingSystem": "any",
            "gamePlatform": "any",
                  "genre": "Business Games",
                "screenshot": {"@type": "ImageObject", "thumbnailUrl":  "https://www.coolmathgames.com//sites/default/files/Jacksmith%20OG%20Image.png"},
                  "aggregateRating":{"@type":"AggregateRating", "worstRating":1, "bestRating":5, "ratingValue":4.8, "ratingCount":467167
          },
                "offers": {"@type": "Offer", "category": "free", "price": 0, "priceCurrency": "USD"}
        },
        {
          "@context": "https://schema.org",
          "@type": "FAQPage",
          "mainEntity":[
        {
         "@type":"Question",
         "name":"
                Instructions
        ",
          "acceptedAnswer":{
        	"@type":"Answer",
        	"text":"<p>Follow the instructions to craft awesome weapons and armor to equip the heroes on their adventure. Manage your time, work carefully, and discover secret recipes to make the best gear.<\/p>\r\n\r\n<p>The key to pleasing your customers in Jacksmith is accuracy. Make sure that you pay attention to every little detail, from casting the metal properly to putting on the grip right in the center of the blade handle. Every single thing that you do will affect your performance score in the end, so don\u2019t cut corners. It can be tempting to try and go your fastest in order to please the customers, but if you are sacrificing speed for accuracy then it will only result in a worse experience.&nbsp;<\/p>\r\n\r\n<p>If you are a fan of cooking games that involve creating dishes and serving them out to customers, then you will likely be a fan of Jacksmith. There really isn\u2019t much of a difference between forging bows and baking up hot and tasty pizzas. Even if blacksmithing isn\u2019t really your thing, you should definitely give Jacksmith a try.<\/p>\r\n"
        	}
        }
                                              ]
      }
    ]
    </script><div class="node__content clearfix field-item"><div class="game-stage"><div class="no-flash-overlay-mobile" style="display:none;"><p><strong>Sorry... this game is not playable in your browser.</strong></p></div><div id="no-flash-overlay" style="display:none;"><a href="http://www.adobe.com/go/getflashplayer" target="_blank"><img class="lazylad" src="/modules/custom/cmatgame_core/images/1x1.png" data-src="/themes/custom/coolmath/assets/images/enable-flash-chrome.png" alt="click to enable flash"/></a></div><div id="does-not-support-ie" style="display:none;"></div><div id="newFlashDetectHtml" style="display:none;"><div class="new-game-bg"><img class="bg-img" src="/sites/default/files/styles/mobile_game_image/public/Jacksmith%20OG%20Image.png?itok=eQsnJR72" border="0" loading="lazy"/><div class="flash-text"><div class="flash-icon"><img src="/themes/custom/coolmath/assets/images/gears.svg" width="65" height="65" alt="flash game" loading="lazy"/></div><p class="big-txt">This Flash game is currently not playable in your browser, but we're working on a fix! Come back regularly to see if it's ready to play.</p><p class="small-txt">Most browsers no longer support Flash. Affected games are indicated by
            <img src="/themes/custom/coolmath/assets/images/flash-corner.png" alt="Flash Icon" loading="lazy"/></p></div></div></div><div id="big-screen-container" class="big-screen-container-class" style="display:none;"><div class="big-screen-head row"><div class="bs-head-logo col-md-2"><img class="lazyload" src="/modules/custom/cmatgame_core/images/1x1.png" data-src="/themes/custom/coolmath/assets/images/full-screen/cool-math-logo.png"></div><div class="bs-head-txt col-md-9">Premium Gaming Without Distractions</div><div class=" col-md-1"><div class="bs-close-button"><a href="#" class="bs-close-btn" onclick="bigscreen_overlay_promo_close_handler(); return false;">X</a></div></div></div><div class="mid-big-section-head "><div class="row"><div class="col-md-12"><div class="h2 get-premium"><span>Get Premium Big Screen Mode</span></div></div><div class="col-md-12"><div class="h3 *unlimited"><span>Unlimited Big Screen Gaming &amp; More!<span></div></div></div><div class="img-container-big-screen row"><div class="image-bs-sample col-md-5"><div class="h2 from-this"><span>From This</span></div><img class="lazyload" src="/modules/custom/cmatgame_core/images/1x1.png" data-src="/themes/custom/coolmath/assets/images/full-screen/BigScreen-small.png"></div><div class="image-bs-sample col-md-7"><div class="h2 to-this"><span>
                    To this
                  </span></div><img class="lazyload" src="/modules/custom/cmatgame_core/images/1x1.png" data-src="/themes/custom/coolmath/assets/images/full-screen/bigscreen-big.png"></div></div><div><div class="bs-footer-link"><a href="/premium-access/6ea95de6" onclick="bigscreen_overlay_promo_signup_handler(); return false;"><img class="lazyload" src="/modules/custom/cmatgame_core/images/1x1.png" data-src="/themes/custom/coolmath/assets/images/full-screen/get-premium-btn.png"></a></div><div class="bs-learn-more"><a href="/premium-benefits" onclick="bigscreen_overlay_promo_more_handler(); return false;" class="bs-lrn-more">Learn More</a></div><div class="bs-no-thks"><a href="" class="bs-lnk-lrn-more" onclick="bigscreen_overlay_promo_close_handler(); return false;">No, Thanks. I just want to play games right now.</a></div></div></div></div><div id="id-adfree-marketing-campaign" class="adfree-marketing-campaign" style="display:none;"><div class="big-screen-head row"><div class="bs-head-logo col-md-2"><img class="lazyload" src="/modules/custom/cmatgame_core/images/1x1.png" data-src="/themes/custom/coolmath/assets/images/full-screen/cool-math-logo.png"></div><div class="bs-head-txt col-md-8">Get Premium Distraction Free Gaming!</div><div class="col-md-2"><div class="bs-close-button"><a href="#" class="bs-close-btn" onclick="adfree_marketing_overlay_promo_close_handler(); return false;">X</a></div></div></div><div class="mid-big-section-head  adfree-mid-section-marketing-campaign"><div class="mkt-container-co row"><div class="mkt-container1 col-md-5"><img src="/themes/custom/coolmath/assets/images/full-screen/ad-free-icon-up.png"></div><div class="ad-free-txt  col-md-5"><span class="sup-bold">AD-FREE:</span>
                The best gaming experience!</div></div><div class="img-container-big-screen row"><div class="" style="padding-left:10px;"><div class="image-bs-sample"><img src="/themes/custom/coolmath/assets/images/full-screen/no-waiting-up.png" loading="lazy"></div><div class="no-waiting-txt"><div class="sup-bold-2">No Waiting:</div>
                  Skip Immediately to the Game</div></div><div class="" style="padding-left:10px;"><div class="image-bs-sample"><img src="/themes/custom/coolmath/assets/images/full-screen/reduce-leg-up.png" loading="lazy"></div><div class="no-waiting-txt"><div class="sup-bold-2">Reduced Lag:</div>
                  Faster, Cleaner Gaming</div></div></div><div class="better-focus-container "><div class="image-better-focus"><img src="/themes/custom/coolmath/assets/images/full-screen/better-focus-up.png" loading="lazy"></div><div class="no-waiting-txt  "><div class="sup-bold-2">Better Focus:</div>
                Stay Game-Concentrated</div><div class="all-excl-txt">And More Exclusive features for Premium Members!</div></div><div class="marketing-cmpn-footer"><div class="bs-footer-link"><a href="/premium-access/b2df5a33" target="_blank" onclick="adfree_marketing_overlay_promo_signup_handler(); return false;"><img class="lazyload" src="/modules/custom/cmatgame_core/images/1x1.png" data-src="/themes/custom/coolmath/assets/images/full-screen/get-premium-btn.png"></a></div><div class="bs-learn-more"><a href="/premium-benefits" target="_blank" onclick="adfree_marketing_overlay_promo_more_handler(); return false;" class="bs-lrn-more">Learn More</a></div><div class="bs-no-thks"><a href="" class="bs-lnk-lrn-more" onclick="adfree_marketing_overlay_promo_close_handler(); return false;">No, Thanks. I just want to play games right now.</a></div></div></div></div><div id="playlist-marketing-container-id"></div><div class="field-game" id="swfgamewrapper" style="height:600px;"><iframe1 class="square no-select" width="800px" height="600px" src="https://www.coolmathgames.com/0-jacksmith/play" frameborder="0" id="html5game" scrolling="no" sandbox="allow-scripts allow-same-origin allow-modals"></iframe1></div><script type="deferjs">
  //check if iframe loaded
    function iframeLoaded(){
    const iframe = document.querySelector(".node-game .field-game iframe");
    if(iframe){
      iframe.addEventListener("load", function() {
        trackEventNonInteractive("gameplay", "game loaded", document.title);
      });
    }
    }
    iframeLoaded();
    /*$('#timer_div').on('click',function(){
      setTimeout(function(){
        iframeLoaded();
      },200)
    })*/

  var browser = (function () {
    var test = function (regexp) {
      return regexp.test(window.navigator.userAgent)
    }
    switch (true) {
      case test(/edg/i):
        return "Microsoft Edge";
      case test(/trident/i):
        return "Microsoft Internet Explorer";
      case test(/firefox|fxios/i):
        return "Mozilla Firefox";
      case test(/opr\//i):
        return "Opera";
      case test(/ucbrowser/i):
        return "UC Browser";
      case test(/samsungbrowser/i):
        return "Samsung Browser";
      case test(/chrome|chromium|criosm|cros/i):
        return "Google Chrome";
      case test(/safari/i):
        return "Apple Safari";
      default:
        return "Other";
    }
  })();
  jQuery(document).ready(function () {
    if (typeof drupalSettings != "undefined" && typeof drupalSettings.cmatgame != "undefined" && typeof drupalSettings.cmatgame.flash_emulation != "undefined" && drupalSettings.cmatgame.flash_emulation === "2" && ( /mediatek/i.test(navigator.userAgent) || /aarch64/i.test(navigator.userAgent) ) ) {
      jQuery('html').addClass('mediatek');
    }


  });
  cmgAInvD = false;
  // user profile related variables
  is_level_based = 1;
  level_offset = 0;
  xp_per_level = 20;
  flashemulation = '';
  iframed_game_url = '';
  cmatgame_premium_free_game_limit_days = '180';
  fastly_frontend_domain = 'https://www.coolmathgames.com';
  stripe_subscription_free_trial_group_token = 'b2df5a33';
  destination = '/0-jacksmith';


  var userprofile_level_xp = "100,200,250,300,350,400,450,500,550,625,700,775,850,925,1000,1075,1150,1225,1300,1375,1450,1525,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,10000";
  userprofile_level_xpData = userprofile_level_xp.split(",");
  incrementedTotalPlays = false;
  lastKeyBoardorMouseActivityTime = Date.now();
  workerstatusvar = "notstartedinit";
  supportCMGDefault = false; // disable a/b test
  supportCMGABTest = false;
  supportCMGABTestImage1 = false;
  supportCMGABTestImage2 = false;
  supportCMGABTestImage3 = false;
  start_full_screen_without_ad = true;

  // define all the marketing promo values to false if they are not defined before
  if (typeof watchAdtoUnlockGame == "undefined") {
    watchAdtoUnlockGame = false;
  }
  if (typeof displayAdblockOverlay == "undefined") {
    displayAdblockOverlay = false;
  }
  if (typeof supportCMG == "undefined") {
    supportCMG = false;
  }
  if (typeof premiumAvatarGame == "undefined") {
    premiumAvatarGame = false;
  }

  gamesPlayed = navigator.cookieEnabled ? parseInt(localStorage.getItem('gamesPlayed') || 0) : 0;

    cmg_stop_truex_promo = "";
  truex_overlay_preroll_ad_display = false;
  premiumAvatarGame = false;//disabling to fix timer count down issue

  function getGameName() {
    var url = window.location.href;
    var lastPart = url.split("/").pop();
    return lastPart;
  }
  var coep_frame_type = 'crossorigin="use-credentials"';
  if (/(Firefox)/.test(navigator.userAgent)) {
    coep_frame_type = 'allow="cross-origin-isolated"';
  }
  function setIframeHeight(iframe) {
    if (iframe) {
      var gamename = getGameName();
      if (gamename == "0-chess") {
        iframe.height = "620px";
      }
    }
  };

  jQuery(function(){
    setIframeHeight(document.getElementById('html5game'));
  });

  if (isUserValidFreeUserOrSubscriber()) {
    var userprofileData = JSON.parse(localStorage.getItem("userprofile"));
    var levelofcompletedgame = 1;
    if(userprofileData && typeof userprofileData.mygameslist != "undefined") {
      for (var i = 0; i < userprofileData.mygameslist.length; i++) {
        if (userprofileData.mygameslist[i].id == gameId) {
          var levelbasedCompletedStatus = userprofileData.mygameslist[i].timebasedcompletedSt;
          var levelofcompletedgame = userprofileData.mygameslist[i].level;
        }
      }
    }
  }

  var workerstatusvar = "no";
  var count = 0;
  var myInterval;
  // Active

  function chkIdleOnpage() {
    var userActivityTime = Date.now();
    // check if user activity is not there more than 55 min 60000*55 = 3300000
    if (userActivityTime - lastKeyBoardorMouseActivityTime > 3300000) {
      if (typeof(w) != "undefined") {
        workerstatusvar = "terminated";
        w.terminate();
        w = undefined;
      }
    } else { // May be keyboard is active start new worker
      settimebased();
    }
  }
  // Inactive
  if (!is_level_based) { // check idle time in every 5 min 60000 * 5 = 300000
    idleOnPageCheckTimer = setInterval(function () {
      chkIdleOnpage()
    }, 300000);
  }

  function settimebased() {
    if (!is_level_based) {
      jQuery(document).ready(function () {
        if (navigator.cookieEnabled) {
          if (isUserValidFreeUserOrSubscriber()) {
            window.addEventListener("beforeunload", function (e) {
              saveUserProgress();
            });
          }
          if (typeof(Worker) !== "undefined") {
            if (typeof(w) == "undefined") {

              w = new Worker("/modules/custom/cmatgame_userprofile/js/userprogress_workers.js");
              var timerInterval = 60000;
              if(typeof xpTimeInterval !== "undefined" && parseInt(xpTimeInterval)) {
                timerInterval = xpTimeInterval * 1000;
              } else {
                xpTimeInterval = 180;
                timerInterval = xpTimeInterval * 1000;
              }

              w.onmessage = function (event) {
                var userActivityTime = Date.now();
                // save userprofile object back to localstorage
                userprofile = event.data;
                localStorage.setItem("userprofile", JSON.stringify(userprofile));

                if (isUserValidFreeUserOrSubscriber()) {
                  // display user progressbar
                  display_user_profile_progressbar();
                  //checkTimeBasedGameCompletion
                  checkTimeBasedGameCompletion(gameId);
                  //adding save userprogress back to api server
                  saveUserProgress();
                }
                if(typeof cmg_game_xp_dsp == "function") {
                  cmg_game_xp_dsp(userprofile);
                }
                chkIdleOnpage();
              };

              var userprofile = localStorage.getItem("userprofile");
              setTimeout(function () {
                var userprofile = localStorage.getItem("userprofile");
                var currentGameData = searchGamesById(gameId);
                if (typeof drupalSettings.cmatgame != "undefined" && typeof drupalSettings.cmatgame.swfembed != "undefined" && drupalSettings.cmatgame.swfembed != "" && typeof drupalSettings.cmatgame.flash_emulation != "undefined" && drupalSettings.cmatgame.flash_emulation == 0 ) {
                  //Do nothing here
                } else
                if (typeof w != 'undefined') {
                  w.postMessage([
                    gameId,
                    xp_per_level,
                    userprofile,
                    currentGameData,
                    cmatgameSearchGames,
                    userprofile_level_xpData,
                    xpTimeInterval
                  ]);
                }
              }, timerInterval);
            }
          }
        }
      });
    }
  }

  // Stop timer
  function stopTimer() {
    count = 0;
    if (workerstatusvar == "terminated") {
      settimebased();
      workerstatusvar = "started";
    }
    window.clearInterval(myInterval);
  }

  function checkKeyboardOrMouseActivity() {
    lastKeyBoardorMouseActivityTime = Date.now();
    if (!is_level_based) {
      if (typeof isRemoveAdSwfJWPLayer === "undefined" || !isRemoveAdSwfJWPLayer) { // html 5 game
      } else {
        stopTimer();
      }
    }
  }

  function startTimer() {
  // for flash based game check idle time in every 5 min 60000 * 5 = 300000
    myInterval = window.setInterval(timerHandler, 30000);
  }

  function timerHandler() {
    count++;
    // count of flash based game will  for 55 rounds
    if (count == 55) {
      workerstatusvar = "terminated";
      if (typeof w !== 'undefined') {
        w.terminate();
        w = undefined;
      }
    }
  }
  document.addEventListener("mousemove", checkKeyboardOrMouseActivity, false);
  document.addEventListener('keydown', checkKeyboardOrMouseActivity, false);

  document.addEventListener("keypress", checkKeyboardOrMouseActivity, false);
  document.addEventListener("touchmove", checkKeyboardOrMouseActivity, false);
  if (!is_level_based) {
    if (typeof isRemoveAdSwfJWPLayer === "undefined" || !isRemoveAdSwfJWPLayer) {
      // html 5 game
      document.addEventListener("visibilitychange", function() {

        if (document.visibilityState == 'hidden') {
          //startTimer();
          if (typeof idleOnPageCheckTimer !== 'undefined') {

            clearInterval(idleOnPageCheckTimer);
          }
          if (typeof w !== 'undefined') {
            w.terminate();
            w = undefined;
            workerstatusvar = "terminated";
          }

        } else if (document.visibilityState == 'visible') {
          stopTimer(); // starts worker.
        }
      }, false);
    } else {
      // flash game
      window.addEventListener('focus', stopTimer);
      window.addEventListener('blur', startTimer);
      // Check browser minimize
      document.addEventListener("visibilitychange", function () {
        if (document.visibilityState == 'hidden') {
          startTimer();
        } else if (document.visibilityState == 'visible') {

          stopTimer();
        }
      }, false);

      startTimer();

    }
  } // end of !is_level_based

  function putSharedObjectsInDB(syncData) {
    flashStorage = syncData;
    saveUserProgress();
  }
  isRemoveAdSwfJWPLayer = false;
  prerollAdDisplayed = false; //use this when switching from mobile view to desktop view and preroll ad was not shown earlier
  prerollAdStart = "";
  prerollAdEnd = "";
  window.addEventListener("message", receiveMessage, false);
  function receiveMessage(event) {
    var valid_domain_msg = false;
    if (/coolmathgames\.com|coolmathgames\.local|coolmathgames/.test(event.origin)) {
      valid_domain_msg = true;
    }
    if (valid_domain_msg && event.data == "cmgGameEventStatic") {
      ga4_trackEvent("cmgGameEventStatic", );
    } else
    if (event.data == "continue-without-big-screen" && jQuery('#big-screen-overlay').length && valid_domain_msg) {
      // close overlay
      if (jQuery('#big-screen-overlay').length) {
        jQuery('#big-screen-overlay').hide();
        if (jQuery('#big-screen-truex-overlay').length) {
          jQuery('#big-screen-truex-overlay').hide();
        }
      }
    } else if (event.data == "continue-with-login-big-screen" && jQuery('#big-screen-overlay').length && valid_domain_msg) {
      jQuery('#big-screen-overlay').hide();
      if (jQuery('#big-screen-truex-overlay').length) {
        jQuery('#big-screen-truex-overlay').hide();
      }
      if (drupalSettings.language !== "en"){
        window.location = `/${drupalSettings.language}/login?destination=${window.location.pathname}`;
      } else {
        window.location = "/login?destination=" + window.location.pathname;
      }
    } else if (event.data == "continue-premium-big-screen" && (jQuery('#big-screen-overlay').length || jQuery('#pr-profile-screen-overlay').length) && valid_domain_msg) {
      jQuery('#big-screen-overlay').hide();
      jQuery('#pr-profile-screen-overlay').hide();
      if (jQuery('#big-screen-truex-overlay').length) {
        jQuery('#big-screen-truex-overlay').hide();
      }
      window.location.reload();
    } else if (event.data == "big-screen-profile-customize" && (jQuery('#big-screen-overlay').length || jQuery('#pr-profile-screen-overlay').length) && valid_domain_msg) {
      jQuery('#big-screen-overlay').hide();
      jQuery('#pr-profile-screen-overlay').hide();
      if (jQuery('#big-screen-truex-overlay').length) {
        jQuery('#big-screen-truex-overlay').hide();
      }
      if (getCookie('cmg_fx') !== null) {
        window.location = '/profile/' + getCookie('cmg_fx').toLowerCase() + '/edit';
      }
    } else if (event.data == "big-screen-premium-benefits" && jQuery('#big-screen-overlay').length && valid_domain_msg) {
      jQuery('#big-screen-overlay').hide();
      if (jQuery('#big-screen-truex-overlay').length) {
        jQuery('#big-screen-truex-overlay').hide();
      }
      if (getCookie('cmg_fx') !== null) {
        window.location = '/premium-benefits';
      }
    } else if (event.data == "keypress-from-game") {
      checkKeyboardOrMouseActivity();
    } else if (event.origin === "https://copterroyale.coolmathgames.com" || event.origin === "https://copterroyale2.coolmathgames.com" || event.origin === "https://powerline.coolmathgames.com") {
      var eventObject = JSON.parse(event.data);
      if (eventObject.eventType == "gameEvent") {
        cmgGameEvent(eventObject.key, eventObject.value);
      } else if (eventObject.eventType == "dataEvent") {
        cmgDataEvent(eventObject.key, eventObject.value);
      }
    } else if (event.origin == 'https://rps-frontend.coolmathgames.com') {
      var eventObject = JSON.parse(event.data);
      if (eventObject.eventType == "gameEvent") {
        cmgGameEvent("Rockpaperscissors "+eventObject.key, eventObject.value);
      } else if (eventObject.eventType == "dataEvent") {
        cmgDataEvent("Rockpaperscissors "+eventObject.key, eventObject.value);
      }
    } else if (event.origin == 'https://hangman-backend.coolmathgames.com' || event.origin == 'https://hangman-frontend.coolmathgames.com' || event.origin == 'https://hangmanqa-frontend.coolmathgames.com' || event.origin == 'https://hangmanqa.coolmathgames.com') {
      var eventObject = JSON.parse(event.data);
      if (eventObject.eventType == "gameEvent") {
        cmgGameEvent("Hangman "+eventObject.key, eventObject.value);
      } else if (eventObject.eventType == "dataEvent") {
        cmgDataEvent("Hangman "+eventObject.key, eventObject.value);
      }
    } else if (event.origin == 'https://wordrace-4inrow-stage.coolmathgames.com' || event.origin == 'https://wordrace-4inrow.coolmathgames.com' ) {
      var eventObject = JSON.parse(event.data);
      var eventGame = "wordrace";
      if (/0-four-in-a-row/.test(location.pathname)) {
        eventGame = "fourinarow";
      }
      if (eventObject.eventType == "gameEvent") {
        cmgGameEvent(eventGame+" "+eventObject.key, eventObject.value);
      } else if (eventObject.eventType == "dataEvent") {
        cmgDataEvent(eventGame+" "+eventObject.key, eventObject.value);
      }
    } else if (event.origin == 'https://hexanaut.coolmathgames.com') {
      var eventObject = JSON.parse(event.data);
      var eventGame = "hexanaut";
      if (eventObject.eventType == "gameEvent") {
        cmgGameEvent(eventGame+" "+eventObject.key, eventObject.value);
      } else if (eventObject.eventType == "dataEvent") {
        cmgDataEvent(eventGame+" "+eventObject.key, eventObject.value);
      }
    } else if (event.origin == 'https://cheerpx.coolmathgames.com' || event.origin == 'https://cheerpx-prod.coolmathgames.com') {
      //close loading screen
      closeCmgCheerpxLoadingScreen();
      // Remove Narrow screen loading
      closeCmgCheerpxLoadingScreenResized();
    } else if (event.origin == 'https://www.coolmath-games.com' || event.origin != 'https://d8-dev.coolmathgames.com') {
      if (event.data.eventType == "syncEventPut") {
        syncData = event.data.syncJSON;
        putSharedObjectsInDB(syncData);
      }
      if (event.data.eventType == "syncEventGet") {
        if (typeof flashStorageFromDB != "undefined") { // restoring flash shared objects from DB
          for (var i = 0; i < flashStorageFromDB.length; i++) {
            flashStorageFromDB[i].swfdata = decodeURI(flashStorageFromDB[i].swfdata);
          }
          document.getElementById('swfgame').contentWindow.postMessage({
            'eventType': 'syncEventGet',
            'soData': flashStorageFromDB
          }, '*');
        } else {
          document.getElementById('swfgame').contentWindow.postMessage({
            'eventType': 'gamePlay'
          }, '*');
        }
      }
    } else {
      return;
    }
  }
  // var signupPromoTop = 'Join to Play Ad-Free'; var signupPromoBottom = 'Join to Skip All Ads';
  if (typeof signupPromoTop !== 'undefined' && signupPromoTop !== '') {
    signupContainerTop = '<div class="signup-container-top"><a href="/premium-access/2efa4bc4" id="preroll_signup_top_handler">' + signupPromoTop + '</a></div>';
  } else {
    signupPromoTop = '';
    signupContainerTop = '<div class="signup-container-top"><a href="/premium-access/2efa4bc4" id="preroll_signup_top_handler">' + signupPromoTop + '</a></div>';
  }
  if (typeof signupPromoBottom !== 'undefined' && signupPromoBottom !== '') {
    signupContainerBottom = '<div class="signup-container-bottom"><a href="/premium-access/2efa4bc4" id="preroll_signup_bottom_handler"> ' + signupPromoBottom + '</a></div>';
  } else {
    signupPromoBottom = '';
    signupContainerBottom = '<div class="signup-container-bottom"><a href="/premium-access/2efa4bc4" id="preroll_signup_bottom_handler"> ' + signupPromoBottom + '</a></div>';
  }

  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 = '/premium-access/ b2df5a33?origin=' + user_dst;
    } else {
      signUpURL = signUpURL + '?origin=' + user_dst;
    }
  } else if (typeof signUpURLABTest === "undefined" || signUpURLABTest === null) {
    signUpURL = 'https://' + window.location.hostname + '/premium-access/ 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 updateMyGamesTimeSpent(gameId) {
    var userActivityTime = Date.now();
    if (currentTimeInterval >= 2) {
      currentTimeInterval = 0;
      if (isUserValidFreeUserOrSubscriber()) { // save MyGames only for subscribers
        saveMyGames(gameId, 0, 1);
        currentTime = userActivityTime;
      }
    } else {
      currentTimeInterval = currentTimeInterval + 1;
      saveUserProgress();
    }
  }

  function updateMyGamesTimeSpent1(gameId) {
    if (isUserValidFreeUserOrSubscriber()) { // save MyGames only for subscribers
      if (userActivityTime - lastKeyBoardorMouseActivityTime <= 60000) {
        saveMyGames(gameId, 0, 1);
      }
    }
  }

  function updateMyGamesTimeSpentLevelBase(gameId, level) {
    if (isUserValidFreeUserOrSubscriber()) { // save MyGames only for subscribers
      saveMyGames(gameId, 1, level);
    }
  }
  if (is_level_based) {
    var userActivityTime = Date.now();
    // for level based game. check if user activity is not there more than 55 min 60000*55 = 3300000
    if (userActivityTime - lastKeyBoardorMouseActivityTime <= 3300000) {
      var objGameNode = {};
      objGameNode[gameId] = "no";
      var localgamestrate = "storagelocal-" + gameId + "-storagelocal";
      localStorage.setItem("runoncestarted", JSON.stringify(objGameNode));
      localStorage.setItem(localgamestrate, "no");
      updateMyGamesTimeSpentLevelBase(gameId, levelofcompletedgame)
    }
  }

  function cmgGetCheerpxUrl() {
    var cheerpxUrl = 'https://cheerpx-prod.coolmathgames.com/cheerpx.html?f=';
    if (location.host != "www.coolmathgames.com" && !/(Firefox)/.test(navigator.userAgent)) {
       cheerpxUrl = 'https://cheerpx.coolmathgames.com/cheerpx.html?f=';
    }
    return cheerpxUrl;
  }
  function displayCmgCheerpxLoadingScreen() {
    jQuery("#swfgame").parent().before('<div id="cmg-cheerpxloading-screen" style="display: block; width: 640px; height: 576px; position: absolute; font-weight: bold; text-align: center; vertical-align: middle; padding-top: 200px;"><h3 class="loadingText" style="font-size: 20px;">Your Flash game is loading<br/>it may take longer than usual</h3><div class="load-wrap" style="padding-top: 0;"><div>&nbsp;</div><div class="circle"></div><div class="circle"></div><div class="circle"></div><div class="circle"></div></div></div>');
  }

  // Narrow Screen Loading Screen
  function displayCmgCheerpxLoadingScreenResized(){
    jQuery("#swfgame").parent().before('<div id="cmg-cheerpxloading-screen-resized" style="position:fixed;top:0;left:0;width:100%;height:100%;text-align:center;"><div class="middle-helper" style="width:100%;height:100%;display:flex;justify-content:center;align-items:center;"><div class="middle-helper-in"><h3 class="loadingText" style="font-size: 20px;">Your Flash game is loading<br/>it may take longer than usual</h3><div class="load-wrap" style="padding-top: 0;"><div>&nbsp;</div><div class="circle"></div><div class="circle"></div><div class="circle"></div><div class="circle"></div></div></div></div></div>');
  }

  function closeCmgCheerpxLoadingScreen() {
    jQuery("#cmg-cheerpxloading-screen").remove();
  }

  // Removing Narrow Screen Loading Screen
  function closeCmgCheerpxLoadingScreenResized(){
    if ($("#cmg-cheerpxloading-screen-resized").length > 0){
      jQuery("#cmg-cheerpxloading-screen-resized").remove();
    }
  }

 function cmgRemoveMadg() {
    if(typeof adsManager != "undefined" && adsManager) {
      adsManager.destroy();
    }

    jQuery("#afg_container").hide();
    jQuery("#afg_preloader").hide();
    jQuery("#continue-container").hide();
    jQuery(".field-game").show();
    jQuery(".user-controls").attr("style", "display: flex !important"); // show user controls
    jQuery(".falseBtn").remove();
    if(window.document.getElementById('swfgame') != null) {
      window.document.getElementById('swfgame').setAttribute("tabindex","0");
      window.document.getElementById('swfgame').focus();
    } else if(window.parent.document.getElementById('html5game') != null){
      window.document.getElementById('html5game').setAttribute("tabindex","0");
      window.document.getElementById('html5game').focus();
    }
  }
  /*
  * Interstitial ad timer functions
  */
  function gameInterstitialAdTimerAction() {
    gameInterstitialAdTimerDone = true;
    clearGameInterstitialAdTimer();
  }
  function clearGameInterstitialAdTimer() {
    clearTimeout(gameInterstitialAdTimer);
    gameInterstitialAdTimer = null;
  }

  function cmg_discover_games_let_off() {
    var myGames = cmg_get_lpg(10);
    if(myGames.length > 0 && isMobile){
      myGames = myGames.filter(game => game.mpv == "1");
    }
    if(typeof myGames == "undefined" || myGames == "" || myGames.length == 0){
      //return false;
      // Display Top Picks Games
      let baseURL = location.origin + '/cmg/toppicks.json';
      $.getJSON(baseURL, function(data){
        let topPickHTML = '';
        for(let game of data){
          game = searchGamesById(game.nid)[0];
          if(isMobile && game.mpv == "0"){
            continue;
          }
          let gameVideo = '';
          if(game.vdo && game.vdo != ""){
            gameVideo = `<video class="field-media" preload="metadata" muted="" loop="" webkit-playsinline="" playsinline="" width="100%" data-src="/sites/default/files/${game.vdo}"></video>`
          }
          topPickHTML += `
          <div class="game-item ${game.field_mobile_playable_value == '1' ? 'mobile-not-playable' : ''}"><div class="game-link-wrapper"><a href="${drupalSettings.language == 'en' ? game.alias : '/'+drupalSettings.language+game.alias}"><div class="field-image"><img src="/sites/default/files/styles/og_image_game_page/public/${game.ogt}" width="168" height="98" alt="${game.title}" title="${game.title}" loading="lazy" class="large-game-item img-fluid">
                  ${gameVideo}
                </div><div class="game-item-content"><h5 class="game-title">${game.title}</h5></div></a></div></div>`;
        }
        jQuery("#cmg_pickup_block").html(topPickHTML).prev(".title").text("Coolmath Top Picks");
        jQuery("#cmg_pickup_block").closest(".cmg-pickup-block").addClass("cmg-top-picks").show();
      })
    } else {
      let pickupBlockHTML = '';

      function removeDuplicateGames(array, key) {
        var check = new Set();
        return array.filter(obj => !check.has(obj[key]) && check.add(obj[key]));
      }
      const filteredGames = removeDuplicateGames(myGames, 'id');
      for(game of filteredGames){
        let gameVideo = '';
        if(game.vdo && game.vdo != ""){
          gameVideo = `<video class="field-media" preload="metadata" muted="" loop="" webkit-playsinline="" playsinline="" width="100%" data-src="/sites/default/files/${game.vdo}"></video>`
        }

        let gamePercent = '';
        if(game.ilb == "1"){
          gamePercent = Math.floor((game.level / game.ml) * 100);
        } else {
          gamePercent = Math.floor((game.time / game.mta) * 100);
        }
        pickupBlockHTML += `
        <div class="game-item ${game.field_mobile_playable_value == '1' ? 'mobile-not-playable' : ''}"><div class="game-link-wrapper"><a href="${drupalSettings.language == 'en' ? game.alias : '/'+drupalSettings.language+game.alias}"><div class="field-image"><img src="/sites/default/files/styles/og_image_game_page/public/${game.ogt}" width="168" height="98" alt="${game.title}" title="${game.title}" loading="lazy" class="large-game-item img-fluid">
                ${gameVideo}
              </div><div class="game-item-content"><h5 class="game-title">${game.title}</h5><div class="progress"><div class="progress-bar" role="progressbar" style="width:${gamePercent > 100 ? 100 : gamePercent}%" aria-valuenow="${gamePercent > 100 ? 100 : gamePercent}" aria-valuemin="0" aria-valuemax="100"></div></div></div></a></div></div>`;
      }

      if(filteredGames.length <= 3){
        pickupBlockHTML += `<div class="game-item"><a class="random-game-button" href="${drupalSettings.language == 'en' ? '/random' : '/'+drupalSettings.language+'/random'}"><span class="random-cta-content"><img src="/themes/custom/coolmath/assets/svg/random-large.svg" alt="Random Icon" /><span>Play Random Game</span></span></a></div>`;
      }
      return pickupBlockHTML;
    }
  }

  jQuery(document).ready(function(){
    if(jQuery("#cmg_pickup_block").length > 0){
      const cmg_left_off_html = cmg_discover_games_let_off();
      if(cmg_left_off_html){
        jQuery("#cmg_pickup_block").html(cmg_left_off_html).closest(".cmg-pickup-block").show();
      }
    }
  });

  /*
  * Remove remove Preroll And Display Game. Old function name:  removePrerollAndDisplayGame().
  */
  cmgRemovePadgInvoked = false;
  function cmgRemovePadg() {
    if(typeof cmgRemovePadgInvoked != "undefined" && cmgRemovePadgInvoked) {
      return;
    }
    if(typeof adsManager != "undefined" && adsManager) {
      adsManager.destroy();
    }
    cmgRemovePadgInvoked = true;
    //interstitial ads timer logic for Playwire
    if(typeof show_interstitial_ads != "undefined" && show_interstitial_ads) {
      gameInterstitialAdTimerDone = false;
      gameInterstitialAdTimer = setTimeout(function () {
        currentTime = new Date();
        gameInterstitialAdTimerAction()
      }, interstitial_ad_refresh_interval);
    }

    //homepage continue playing lastplayedgame - cmg_lpg
    var nonEmulatedFlashGame = false;
    if (typeof drupalSettings.cmatgame != "undefined"  && typeof drupalSettings.cmatgame.swfembed != "undefined" && drupalSettings.cmatgame.swfembed != "" && typeof drupalSettings.cmatgame.flash_emulation != "undefined" && drupalSettings.cmatgame.flash_emulation == 0 && typeof drupalSettings.cmatgame.swfembed.swf != "undefined" && drupalSettings.cmatgame.swfembed.swf != "") {
      nonEmulatedFlashGame = true;
    }
    if (gameId && !nonEmulatedFlashGame && navigator.cookieEnabled && searchGamesById(gameId) != "") {
      localStorage.setItem("cmg_lpg", gameId);
    }
    settimebased();
    prerollAdDisplayed = true;//This is to be invoked after preroll ad is done;
    if (document.documentElement.clientWidth >= 960 - ( window.innerWidth-jQuery(document).width()) || ( window.innerWidth > 960 && typeof detectZoom == 'object' && typeof detectZoom.zoom == 'function' && detectZoom.zoom() >=2) ) {
      prerollAdEnd = "dtp";
    } else {
      prerollAdEnd = "mob";
    }
    if (isRemoveAdSwfJWPLayer) { // remove preroll only once

    } else { // record current time to calculate how much time user spent on playing the current game
      currentTime = Date.now();
      currentTimeInterval = 0;

      jQuery("#my-content").css("opacity", "1");
      if (typeof intervalId != "undefined") {
        clearInterval(intervalId);
      }
      jQuery("#afg_container").hide();
      jQuery("#afg_preloader").hide();
      jQuery("#continue-container").hide();
      jQuery(".field-game").show();

      if (!drupalSettings.cmatgame.swfembed)  { // 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 ( (/hangman/.test(html5_game_url) || /85380/.test(gameId) ) && typeof getParameterByName != "undefined") {
          var qLobby = getParameterByName("private-lobby");
          var qPlay = getParameterByName("play");
          var qXid = getParameterByName("xid");
          if (typeof qLobby != "undefined" && typeof qXid != "undefined" && qLobby !== "" && qXid !== "" && html5_game_url.indexOf("hangman") && html5_game_url.indexOf("/home") ) {
            html5_game_url = html5_game_url.replace("/home", "/private-lobby/" +qLobby + "/" +qXid);
          } else if (typeof qPlay != "undefined" && typeof qXid != "undefined" && qPlay !== "" && qXid !== "" && html5_game_url.indexOf("hangman") && html5_game_url.indexOf("/home")) {
            html5_game_url = html5_game_url.replace("/home", "/play/" + qPlay + "/" +qXid);
          }
        } else if ( /bloobio|bloob\.io/.test(html5_game_url) && typeof getParameterByName != "undefined") {
          var qLobby = getParameterByName("private-lobby");
          if (typeof qLobby != "undefined" && qLobby !== "") {
            html5_game_url = html5_game_url + '/'+qLobby;
          }
          if (typeof drupalSettings.language != "undefined" && drupalSettings.language != "en") {
            if (!/locale=/.test(html5_game_url)) {
              html5_game_url = html5_game_url + "?locale="+drupalSettings.language;
            }
            var isMobile = cmg_is_mobile_device();
            if (isMobile && !/mobile=/.test(html5_game_url)) {
              html5_game_url = html5_game_url + "&mobile=true";
            }
          }
        }

        if (typeof swf_game_url !== 'undefined') {
          if (!cmg_flash_emulated_game()) {
            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 < 9) {
          nothtml5browser = '<div style="margin-top:20px;color: #f5e61f;line-height:1.1em;font-size: 1.867em;">Hey, you\'re using an older web browser that can\'t play HTML5 games like this one.<br><br>Please switch to another browser or just enjoy a different Coolmath game!</' + 'div><br><p style="font-size:1.6em;color:#0E83D4;font-weight:bold;">&#8226; <a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_new">Get a new Internet Explorer browser from Microsoft</a></p>';
          jQuery("#html5game").replaceWith(nothtml5browser);
          jQuery("#swfgame").replaceWith(nothtml5browser);
        } else {
          sandbox = jQuery("#html5game").attr("sandbox");
          if (sandbox !== undefined) {
            sandbox = ' sandbox=\"' + sandbox + '\"';
          } else {
            sandbox = '';
          }
          if (cmg_is_mobile_device() || (document.documentElement.clientWidth < 960 - (window.innerWidth-jQuery(document).width()) && (typeof detectZoom == 'object' && typeof detectZoom.zoom == 'function' && detectZoom.zoom() < 2) ) ) {
            newiframe = '<iframe1 id="html5game" src="' + html5_game_url + '" class="' + jQuery("#html5game").attr("class") + '" width="' + jQuery("#html5game").attr("width") + '" height="' + jQuery("#html5game").attr("height") + '" scrolling="no" marginwidth="0' + '" vspace="0" frameborder="0" hspace="0" marginheight="0"' + sandbox + '></iframe1>';
            newswfiframe = '<iframe1 id="swfgame" src="' + swf_game_url + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe1>';
          } else {
            newiframe = '<iframe id="html5game" src="' + html5_game_url + '" class="' + jQuery("#html5game").attr("class") + '" width="' + jQuery("#html5game").attr("width") + '" height="' + jQuery("#html5game").attr("height") + '" scrolling="no" marginwidth="0' + '" vspace="0" frameborder="0" hspace="0" marginheight="0"' + sandbox + '></iframe>';
            newswfiframe = '<iframe id="swfgame" src="' + swf_game_url + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
          }
          if (typeof isRemoveAdSwfJWPLayer === "undefined" || !isRemoveAdSwfJWPLayer) {
            jQuery("#html5game").replaceWith(newiframe);
            iframeLoaded();
            if (cmg_flash_emulated_game() || drupalSettings.cmatgame.flash_emulation === "1") {
              jQuery("#swfgame").replaceWith(newswfiframe);
              iframeLoaded();
            } else if (cmg_flash_emulated_game() && drupalSettings.cmatgame.flash_emulation === "2"){
              game_width = drupalSettings.cmatgame.swfembed.swf.swf_1.width;
              game_height = drupalSettings.cmatgame.swfembed.swf.swf_1.height;
              game_type = "html5";
              var swfURLObject = drupalSettings.cmatgame.swfembed.swf.u;
              var swfURLArray = swfURLObject.split("/");
              swf_1_game_movie_param = swfURLArray[swfURLArray.length-1];
              //cheerpx js
              var swf_game_url = cmgGetCheerpxUrl()+swfURLArray[swfURLArray.length-1]+'&w='+game_width+'&h='+game_height;
              newswfiframe = '<iframe crossorigin="use-credentials" id="swfgame" src="' + swf_game_url + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
              jQuery("#swfgame").replaceWith(newswfiframe);
              iframeLoaded();
            }
          }
        }
      } else {
        if (!cmg_flash_emulated_game() && (drupalSettings.cmatgame.flash_emulation !== "1" || drupalSettings.cmatgame.flash_emulation !== "2" )) {
          /* CLSS-1614 to load html5 as backup - START */
          var html5_game_url = jQuery("#html5game").attr("src");
          if (typeof html5_game_url !== 'undefined') {
            game_width = jQuery("#html5game").attr("width");
            game_height = jQuery("#html5game").attr("height");
            game_type = "html5";
            // IE Detection and Version grabbing
            ie = false;
            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 < 9) {
              nothtml5browser = '<div style="margin-top:20px;color: #f5e61f;line-height:1.1em;font-size: 1.867em;">Hey, you\'re using an older web browser that can\'t play HTML5 games like this one.<br><br>Please switch to another browser or just enjoy a different Coolmath game!</' + 'div><br><p style="font-size:1.6em;color:#0E83D4;font-weight:bold;">&#8226; <a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_new">Get a new Internet Explorer browser from Microsoft</a></p>';
              jQuery("#html5game").replaceWith(nothtml5browser);
            } else {
              sandbox = jQuery("#html5game").attr("sandbox");
              if (sandbox !== undefined) {
                sandbox = ' sandbox=\"' + sandbox + '\"';
              } else {
                sandbox = '';
              }
              newiframe = '<iframe id="html5game" src="' + html5_game_url + '" class="' + jQuery("#html5game").attr("class") + '" width="' + jQuery("#html5game").attr("width") + '" height="' + jQuery("#html5game").attr("height") + '" scrolling="no" marginwidth="0' + '" vspace="0" frameborder="0" hspace="0" marginheight="0"' + sandbox + '></iframe>';
              if (typeof isRemoveAdSwfJWPLayer === "undefined" || !isRemoveAdSwfJWPLayer) {
                jQuery("#html5game").replaceWith(newiframe);
                iframeLoaded();
              }
        }
          } else { /* CLSS-1614 to load html5 as backup - END */
            flashDetectionMessage();
          }
        } else { // flash game game width, game height and game type

          game_width = drupalSettings.cmatgame.swfembed.swf.swf_1.width;
          game_height = drupalSettings.cmatgame.swfembed.swf.swf_1.height;

          if (drupalSettings.cmatgame.flash_emulation === "1"){ //ruffle
            game_type = "html5";
            var swfURLObject = drupalSettings.cmatgame.swfembed.swf.u;
            var swfURLArray = swfURLObject.split("/");
            var swf_game_url = 'https://www.coolmath-games.com/sites/cmatgame/files/ruffle1/ruffle.html?f='+swfURLArray[swfURLArray.length-1]+'&w='+game_width+'&h='+game_height;
            newswfiframe = '<iframe id="swfgame" src="' + swf_game_url + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
            jQuery("#swfgame").replaceWith(newswfiframe);

            } else if (drupalSettings.cmatgame.flash_emulation === "2"){ //cheerpx
            game_type = "html5";
            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 <= 11) {
              notCheerpxBrowser = '<div class="no-ie">NO IE</div>';
              jQuery("#html5game").replaceWith(notCheerpxBrowser);
            }

            game_width = drupalSettings.cmatgame.swfembed.swf.swf_1.width;
            game_height = drupalSettings.cmatgame.swfembed.swf.swf_1.height;

            var swfURLObject = drupalSettings.cmatgame.swfembed.swf.u;
            var swfURLArray = swfURLObject.split("/");
            swf_1_game_movie_param = swfURLArray[swfURLArray.length-1];
            //cheerpx js
            var swf_game_url = cmgGetCheerpxUrl()+swfURLArray[swfURLArray.length-1]+'&w='+game_width+'&h='+game_height;
            newswfiframe = '<iframe '+coep_frame_type+' id="swfgame" src="' + swf_game_url + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
            jQuery("#swfgame").replaceWith(newswfiframe);
            iframeLoaded();
            displayCmgCheerpxLoadingScreen();
            } else {

            game_type = "flash";

            if (typeof isRemoveAdSwfJWPLayer === "undefined" || !isRemoveAdSwfJWPLayer) {
              var swf_game_url = jQuery("#swfgame").attr("src");
              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);
              }
              newswfiframe = '<iframe id="swfgame" src="' + swf_game_url + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
              jQuery("#swfgame").replaceWith(newswfiframe);
              iframeLoaded();

              var gameInstructions = document.getElementById('game-instructions');
              // insert fix flash div before game instructions field
              if (typeof gameInstructions !== 'undefined' && gameInstructions !== null && typeof gameInstructions.innerHTML !== 'undefined' && gameInstructions.innerHTML !== null) {
                gameInstructions.innerHTML = '<div class="no-flash">If this flash game doesn\'t work on your computer, go <a href="/fix-flash.html">here</a> for help.</div><br><br>' + gameInstructions.innerHTML;
              }
            }
          }
          isRemoveAdSwfJWPLayer = true;
        }
      }
    }
    jQuery('.game-xp-bar-immerse-button').addClass('enabled');
    jQuery('.btn.btn-primary.btn-sm.requestfullscreen').css('display', 'inline-block');
    //Deferred js is breaking the display of bigscreen button
    deferredbigscreenbtn = setTimeout(function () {
      if (jQuery('.btn.btn-primary.btn-sm.requestfullscreen').length && !jQuery('.btn.btn-primary.btn-sm.requestfullscreen').is(":visible")) {
        jQuery('.btn.btn-primary.btn-sm.requestfullscreen').css('display', 'inline-block');
      }
    }, 2000);
  }

  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 (getCookie("cmg_wl") !== null) {
      validSubscriber = true;
    }
    var cmatgame_free_user = getCookie('cmg_fx');
    var validFreeUser = false;
    if (typeof cmatgame_free_user !== 'undefined' && cmatgame_free_user !== null) {
      validFreeUser = true;
    }

    freeGamesExceeded = true;
    if (validSubscriber || getCookie("cmg_wl") !== null) {
      retrieveUserProgress();
      cmgRemovePadg();
      jQuery(document).ready(function () {
        $('.game-xp-bar-immerse-button').addClass('enabled');
        jQuery('.btn.btn-primary.btn-sm.requestfullscreen').css('display', 'inline-block');
        immersive_mode_display_controller();
      });

    } else if (getCookie('cmg_schwl') !== null || typeof cmg_no_ads !== 'undefined' || (! validSubscriber && schoolHours || (!schoolHours && !targetStateUser) || (!schoolHours && targetStateUser && getCookie('cmg_active_anonymous_user') !== null))) { // TODO Display Game
      cmgRemovePadg();
      jQuery(document).ready(function () {
        $('.game-xp-bar-immerse-button').addClass('enabled');
        jQuery('.btn.btn-primary.btn-sm.requestfullscreen').css('display', 'inline-block');
      });

      if (!/0-chess/.test(window.location.pathname)) {
      }
    } else if (! validSubscriber && !schoolHours && targetStateUser && getCookie('cmg_active_anonymous_user') === null && getCookie('cmg_editor') === null) { // if user comes from google dont show the subscription paywall
      var ref = document.referrer;
      // count number of games played by the user this month
      userPlayedGames = 0;
      var userFreeGameList = [];
      var freeGameNid = 10916;
      if (sessionStorage.getItem("userFreeGameList") !== null && navigator.cookieEnabled) {
        userFreeGameList = JSON.parse(sessionStorage.getItem("userFreeGameList"));
      }
      if ((localStorage.getItem("userPlayedGames") == null || getCookie('cmg_upg') === null) && freeGameLimit !== 0 && navigator.cookieEnabled) {
        userPlayedGames = 1;
        localStorage.setItem("userPlayedGames", userPlayedGames);
        setCookie('cmg_upg', 'true', cmg_upg_days_limit * 24 * 60 * 60 * 1000);
        userFreeGameList = [freeGameNid];
        sessionStorage.setItem("userFreeGameList", JSON.stringify(userFreeGameList));
        cmgRemovePadg();
      } else {
        if (localStorage.getItem("userPlayedGames") !== null && getCookie('cmg_upg') !== null) {
          userPlayedGames = parseInt(localStorage.getItem("userPlayedGames"));
        } else {
          userPlayedGames = 0;
          setCookie('cmg_upg', 'true', cmg_upg_days_limit * 24 * 60 * 60 * 1000);
        }
        if (freeGameLimit != 0 && userPlayedGames < freeGameLimit && userFreeGameList.indexOf(freeGameNid) === -1) {
          userPlayedGames ++;
          freeGamesExceeded = false;
          if (userFreeGameList.length > 0) {
            userFreeGameList = userFreeGameList.concat(freeGameNid);
          } else {
            userFreeGameList = [freeGameNid];
          }
          localStorage.setItem("userPlayedGames", userPlayedGames);
          sessionStorage.setItem("userFreeGameList", JSON.stringify(userFreeGameList));
        } else {
          freeGamesExceeded = true;
        }
        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) {
          clearInterval(intervalId);
          jQuery("#afg_container").remove();
          jQuery(".game-instructions").remove();
          var alreadySubscriberText = '<p class="already-subscribed">Already a Subscriber? <a class="learn-more-link" href="/login">Login</a></p>';
          if (getCookie('cmg_l') != null) {
            alreadySubscriberText = '';
          }
          var headLine = '<p class="no-free-games-headline">Please Sign up to keep playing</p>';
          if (getCookie('cmg_l') != null && getCookie('cmg_sx') != null) {
            headLine = '<p class="no-free-games-headline" style="padding-top:46px;">PLEASE SUBSCRIBE NOW TO KEEP PLAYING</p>';
          }
          jQuery(".field-game").html('<div class="subscription-overlay" style="height:360px;width:500px;background:#008aa3;white-space:normal;">' + headLine + '<p class="free-in-schools">The World\'s Best Collection of Games <br> For Logic, Reasoning & Fun.  <a class="' + subscribeNowAlienClass + '" id="game_subscription_promo_handler" href="' + signUpURL + ' ">Subscribe Now</a>' + alreadySubscriberText + '</div>');
          jQuery("#videoplayer").remove();
        } else {
          cmgRemovePadg();
        }
      }
    }
  }

  function unlockAllLevels() {
    trackEvent('Unlock All Levels category', 'unlock all levels button clicked', document.title);
    alllevels = '<div id="subscriber-banner"><div class="adobe-analytics-sub-experience levels-unlocked">levels-unlocked</div></div>';
    jQuery("#subscriber-banner").replaceWith(alllevels);
    var cmgorigindomain = /coolmath-games/;
    var cmgtargetdomain = window.location.protocol + 'www.coolmath-games.com';
    if (/edit-stage/.test(window.location.hostname)) {
      cmgtargetdomain = window.location.protocol + 'edit-stage.coolmath-games.com';
    } else if (/d8-dev/.test(window.location.hostname)) {
      cmgtargetdomain = window.location.protocol + 'stage.coolmath-games.com';
    } else if (/cmatgame.local|dev.coolmath.games.com/.test(window.location.hostname)) {
      cmgtargetdomain = window.location.protocol + 'stage.coolmath-games.com';
    }
    if (game_type == "html5") {
      document.getElementById("html5game").contentWindow.unlockAllLevels();
    } else {
      if (cmgorigindomain.test(window.location.hostname)) {
        document.getElementById("swfObjID").unlockAllLevels();
      } else {
        var recievergameFrame = document.getElementById("swfgame");
        gDate = new Date();
        recievergameFrame.contentWindow.postMessage('unlockAllLevels', cmgtargetdomain); // TODO -- put target origin
      }
    }
  }

  function addSubToUnlockGAEvent() {
    trackEvent('Unlock All Levels category', 'subscribe to unlock button clicked', document.title);
    trackGoalVirtualPV('/virtual/unlock-button-click');
    window.location.href = "https://www.coolmathgames.com/signup/ b2df5a33?origin= /0-jacksmith&stual=1"
  }

  var immersive_mode_enabled = false;
  //BS: 1. Singleton. Attach full screen handler on page load
  function immersive_mode_display_controller() {
    if (! immersive_mode_enabled) {
      immersive_mode_enabled = true;
      immersive_mode_display();
    }
  }
  var bigScreenTimer = null;
  bigScreenActive = false;
  function cmgbsoptclose() {
    if (jQuery('#big-screen-truex-overlay').length) {
      jQuery('#big-screen-truex-overlay').hide();
    }
  }
  popover_login_click = false;

  function cmg_display_login_page() {
    popover_login_click = true;
    if (jQuery('#popover' + gameId).length) {
      jQuery('#popover' + gameId).remove();
      immerse_hover_on = 0;
    }
    window.location = "/login?destination=" + window.location.pathname
  }

  function display_cmg_overlay_signupform(variant) {
    if (jQuery('#popover' + gameId).length) {
      jQuery('#popover' + gameId).remove();
      immerse_hover_on = 0;
    }
    if ((getCookie('cmg_sx') === null && getCookie('cmg_wl') === null)) {
      myStopFunction();
    }
    if (typeof variant === 'undefined' || variant === '') {
      variant = '/16';
    }

    if (cmg_stop_truex_promo !== '' && cmg_stop_truex_promo === 'yes' && jQuery('#big-screen-overlay').length) {
      jQuery('#big-screen-overlay').show();
    } else if (cmg_stop_truex_promo !== '' && cmg_stop_truex_promo === 'yes') {
      var big_screen_url = '';
      if (getCookie('cmg_fx') === null) {
        if (drupalSettings.language == 'en') {
          big_screen_url = '/premium-access/6ea95de6' + variant + '?ts='+new Date().getTime();//BSWOJ anon plan
        } else {
          big_screen_url = '/'+drupalSettings.language+'/premium-access/6ea95de6' + variant + '?ts='+new Date().getTime();//BSWOJ anon plan
        }
      } else {
        if (drupalSettings.language == 'en') {
          big_screen_url = '/profile/premium-access/e180e28d' + variant + '?ts=' + new Date().getTime(); // BSWOJ logged-in user plan
        } else {
          big_screen_url = '/'+drupalSettings.language+'/profile/premium-access/e180e28d' + variant + '?ts=' + new Date().getTime();
        }
      }
      if (variant == 'thankyou') {
        if (drupalSettings.language == 'en') {
          big_screen_url = '/signup/thank-you/overlay?ts=1596827222&src=wc&origin=/premium-access/1bb008bd/14b&sp=0&cmgtypl=1bb008bd&cmgovly=1';
        } else {
          big_screen_url = '/'+drupalSettings.language+'/signup/thank-you/overlay?ts=1596827222&src=wc&origin=/premium-access/1bb008bd/14b&sp=0&cmgtypl=1bb008bd&cmgovly=1';
        }
      }
      var ov_css = 'style="display:none; position: fixed; z-index: 100000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.4);" min-height="1040px"';
      var ovc_css = 'style="margin: auto; padding: 10px; width: 850px;" min-height="540px"';
      var iframe_overlay = '<div id="big-screen-overlay" ' + ov_css + ' width="90%" height="90%"><div class="big-screen-signup-container" ' + ovc_css + ' ><a class="btn-close" onclick="cmgbsoptclose(); return false;" href="/"><i class="fa fa-circle fa-stack-1x"></i><i class="icon-remove_sign" aria-hidden="true"></i></a><iframe src="' + big_screen_url + '" width="100%" height="100%" min-height="1000px" id="big_screen_iframe" scrolling="no"></iframe></div></div>';
      //Add this iframe at the correct place that it needs to go.
      jQuery('.global-wrapper').before(iframe_overlay); // TODO
      jQuery('#big_screen_iframe').css('height', '800px');
      jQuery('#big-screen-overlay').fadeIn(1000);
      jQuery('.big-screen-signup-container .btn-close').on('click', function (e) {
        e.preventDefault();
        jQuery('#big-screen-overlay').hide();
      });
    } else {
      var big_screen_url = '';
      if (getCookie('cmg_fx') === null) {
        if (drupalSettings.language == 'en') {
          big_screen_url = '/premium-access/849ef809' + variant + '?ts=' + new Date().getTime(); // BSWOJ anon plan
        } else {
          big_screen_url = '/'+drupalSettings.language+'/premium-access/849ef809' + variant + '?ts=' + new Date().getTime(); // BSWOJ anon plan
        }
      } else {
        if (drupalSettings.language == 'en') {
          big_screen_url = '/profile/premium-access/e180e28d' + variant + '?ts=' + new Date().getTime(); // BSWOJ logged-in user plan
        } else {
          big_screen_url = '/'+drupalSettings.language+'/profile/premium-access/e180e28d' + variant + '?ts=' + new Date().getTime(); // BSWOJ logged-in user plan
        }
      }
      if (variant == 'thankyou') {
        if (drupalSettings.language == 'en') {
          big_screen_url = '/signup/thank-you/overlay?ts=1596827222&src=wc&origin=/premium-access/849ef809/14b&sp=0&cmgtypl=1bb008bd&cmgovly=1';
        } else {
          big_screen_url = '/'+drupalSettings.language+'/signup/thank-you/overlay?ts=1596827222&src=wc&origin=/premium-access/849ef809/14b&sp=0&cmgtypl=1bb008bd&cmgovly=1';
        }
      }
      if (/coolmathgames/.test(location.host)) {
      }
      var ov_css = 'style="display:none; position: fixed; z-index: 100000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.4);" min-height="1040px"';
      var ovc_css = 'style="margin: auto; padding: 10px; width: 850px;" min-height="540px"';
      var iframe_overlay = '<div id="big-screen-overlay" ' + ov_css + ' width="90%" height="90%"><div class="big-screen-signup-container" ' + ovc_css + ' ><a class="btn-close" onclick="cmgbsoptclose(); return false;" href="/"><i class="fa fa-circle fa-stack-1x"></i><i class="icon-remove_sign" aria-hidden="true"></i></a><iframe src="' + big_screen_url + '" width="100%" height="100%" min-height="1000px" id="big_screen_iframe" scrolling="no"></iframe></div></div>';
      // Add this iframe at the correct place that it needs to go.
      jQuery('.global-wrapper').before(iframe_overlay); // TODO
      jQuery('#big_screen_iframe').css('height', '800px');
      jQuery('#big-screen-overlay').fadeIn(1000);
      jQuery('.big-screen-signup-container .btn-close').on('click', function (e) {
        e.preventDefault();
        jQuery('#big-screen-overlay').hide();
      });
    }
  }
  function immersive_mode_exit_handler(variant) {
    start_full_screen_without_ad = false;//no ad after 1st trial
    bigScreenActive = false;
    if (getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) { // Redirect the user to signup page
      if (jQuery.fullscreen.isFullScreen()) {
        jQuery.fullscreen.exit();
      }
      if (cmg_stop_truex_promo !== '' && cmg_stop_truex_promo === 'yes') {
        display_cmg_overlay_signupform(variant);
      }
    } else if (getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
      myTimerAction();
    }
    if (bigScreenTimer) {
      clearTimeout(bigScreenTimer);
      bigScreenTimer = null;
    }
  }

  function bigScreenTimerAction() {
    if (typeof bigScreenActive !== 'undefined' && bigScreenActive) {
      clearTimeout(bigScreenTimer);
      bigScreenTimer = null;
    }
  }
  var immerse_hover_on = 0;
  var immerse_hover_in = 0;
  var big_screen_msg_on = 0;

  function immersive_fullscreenButtonText() {
    var fullscreenButtonText = "New Premium Feature! Try it for FREE now";
    if ((getCookie('cmg_sx') !== null || getCookie('cmg_wl') !== null)) {
      fullscreenButtonText = "New Premium Feature! Try it now!";
    }
    return fullscreenButtonText;
  }
  var cmg_bs_popover_prefix = '<div class="popover fade bs-popover-top show" role="tooltip" id="popover' + gameId + '" x-placement="top" ';
  var cmg_bs_popover_suffix1 = '><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body">';
  var cmg_bs_popover_suffix2 = '</div></div>';

  // Display BS TrueX options overlay
  network_user_id = '';
  truex_options = null;
  truex_ad_available = 0;
  cmg_truex_client = null;
  cmg_truexAd = null;
  // make call to trueX for available ads
  function requestTrueXAdsAndDisplay(client) {
    cmg_truex_client = client;
    client.requestActivity(function (truexAd) {
      if (truexAd) {
        truex_ad_available = 1;
        cmg_truexAd = truexAd;
        showTrueXOptIn(truexAd, client);
      } else { // log("No ads available.");
        truex_ad_available = 0;
      }
    });
  }
//Removing gray strip from big screen popup.
$('body').on('click','.requestfullscreen',function(){
    var headerText = $('#big-screen-truex-header-text');
    if (headerText.text() == ''){
      headerText.hide();
    }
  })
  $('body').on('click','.txt-bs-popup',function(){
      $('#big-screen-truex-header-text').show();
  })

  function showTrueXOptIn(truexAd, client) {
    truexAd.onStart(function (activity) {
      trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: TrueX Ad Start', document.title);
      jQuery('#big-screen-truex-header-text').css('padding-top', '14px').html('<div><span style="font-size: 22px;">PLAY BIG SCREEN AFTER THIS 30 SECOND AD</span></div>');
      myStopFunction();
      trueXTimer = setTimeout(function () {
        jQuery('#big-screen-truex-header-text').css('background-color', '#16202c').css('padding-top', '14px').html('<div><span style="font-size: 22px;">PLEASE INTERACT WITH THIS AD TO CONTINUE</span></div>'); // .css('margin-top', '150px');
      }, 25 * 1000);
    });
    truexAd.onCredit(function (engagement) {
      trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: TrueX Ad Credited', document.title);
      jQuery('#big-screen-truex-header-text').css('background-color', '#16202c').css('padding-top', '14px').html('<div><span><a href="" style="font-size: 22px; text-decoration: none; color:#F5E61F; " id="truex-bigscreen-activate-id" class="truex-bigscreen-activate">PLAY BIG SCREEN NOW ▶</a></span></div>');
      document.getElementById("truex-bigscreen-activate-id").onclick = function () {
        event.preventDefault();
        if (typeof bigScreenActive === 'undefined' || typeof bigScreenActive !== 'undefined' && !bigScreenActive) {
          jQuery('#big-screen-signup-container-id').html("");
          jQuery('#big-screen-truex-overlay').remove();
          cmg_start_game_full_screen('truex');
        }
      }
    });
    truexAd.onClose(function (activity) { // user closed the ad unit
      trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: TrueX Ad Closed', document.title);
      containerClose();
      requestTrueXAdsAndDisplay(client);
    });
    truexAd.onFinish(function (activity) { // user got to end of ad
      trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: TrueX Ad Finished', document.title);
      jQuery('#big-screen-signup-container-id').html("");
      jQuery('#big-screen-truex-overlay').remove();
      cmg_start_game_full_screen("truex");
    });
    truexAd.onMessage(function (payload) { // log("onMessage = " + payload);
    });

    // handle opt-in click event
    // add TrueX Opt-in to DOM
    if (jQuery("#cmg-big-screen-truex-activity").length) {
      var truex_container = document.getElementById("cmg-big-screen-truex-activity");
      document.getElementById("cmg-big-screen-truex-activity").onclick = function () {
        event.preventDefault();
        trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: Button clicked', document.title);
        jQuery('.big-screen-options-container').hide();
        if (truex_ad_available && typeof client !== 'undefined') { // BigScreen-TrueX-Promo
          trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: TrueX Ad Loading', document.title);
          client.loadActivityIntoContainer(truexAd, 'big-screen-signup-container-id', {
            width: "960px",
            height: "540px"
          });
        } else {
          truex_overlay_preroll_ad_display = true;
          show_big_screen_preroll_ad();
          trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: Preroll Ad Loading', document.title);
        }
      };
    }

    // cmg-big-screen-truex-signup
    if (jQuery("#cmg-big-screen-truex-signup").length) {
      document.getElementById("cmg-big-screen-truex-signup").onclick = function () {
        event.preventDefault();
        jQuery('#big-screen-truex-overlay').remove();
        display_cmg_overlay_signupform();
      };
    }
  }

  function truex_preroll_display_handler() {
    event.preventDefault();
    trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: Button clicked', document.title);
    jQuery('.big-screen-options-container').hide();
    if (truex_ad_available && (typeof client !== 'undefined' || cmg_truex_client != null) ) { // BigScreen-TrueX-Promo
      if (typeof client == "undefined") {
        client = cmg_truex_client;
        truexAd = cmg_truexAd;
      }
      trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: TrueX Ad Loading', document.title);
      client.loadActivityIntoContainer(truexAd, 'big-screen-signup-container-id', {
        width: "960px",
        height: "540px"
      });
    } else {
      truex_overlay_preroll_ad_display = true;
      show_big_screen_preroll_ad();
      trackEvent('BigScreen-TrueX-Promo', 'View a Sponsored Video: Preroll Ad Loading', document.title);
    }
  }

  function containerClose() { // log("containerClose called.");
  }

  function log(msg) {
    console.log("CMG [%s] - %s", new Date().toLocaleTimeString(), msg);
  }
  cmg_truex_promo_events_added = 0;
  function display_big_screen_truex_options_overlay() { // initialize trueX ad client w/ options hash
    trackEvent('BigScreen-TrueX-Promo', 'Bigscreen button clicked', document.title);
    if (getCookie('cmg_sx') !== null || getCookie('cmg_wl') !== null  || getCookie('cmg_editor') !== null ) {
      event.preventDefault();
      cmg_start_game_full_screen('truex');
    } else {
      network_user_id = getCookie('_ga');
      if (typeof network_user_id !== 'undefined' && network_user_id !== '') {
        network_user_id = network_user_id.replace('GA', 'cmg').replaceAll("\.", "");
      }
      // TRUEX Test Hash
      // truex_options = {'network_user_id': network_user_id, 'partner_config_hash': '83f879b26797c723882473d6435e6361c105d86b'};
      truex_options = {
        'network_user_id': network_user_id,
        'partner_config_hash': '375f2f2b728700cd991bb24601b3841c98375886'
      };
      if (typeof truex !== 'undefined') {
        truex.client(truex_options, function (client) {
          requestTrueXAdsAndDisplay(client);
        });
      }

      var ov_css = ' style="display:none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.7);" min-height="1040px" ';
      var ovc_css = ' ';
      var ovc_css_id = ' style="margin: auto; margin-top: 150px; width: 960px; " ';
      var truex_css = '  ';
      var truex_options1 = "<div class='' " + truex_css + "><h4>To Play This Game in Big Screen Mode</h4></div>";
      var truex_options2 = "<div class='btn truex_options_video' " + truex_css + "><a href=' id='cmg-big-screen-truex-activity' class='txt-bs-popup' onclick='truex_preroll_display_handler(); return false;'> View a Sponsored Video </a></div>";
      //var truex_optionsOR = "<div class='truex_options_OR_txt' " + truex_css + "><h1> Or </h1></div>";

      var truex_options3 = "<div class='btn truex_options_signup' " + truex_css + "><a href='' id='cmg-big-screen-truex-signup'  class='txt-bs-popup' onclick='display_cmg_overlay_signupform(); return false;'> Pay for Premium Access</h2></a></div>";
      if (getCookie("cmg_sac") == "no"){
       // truex_optionsOR = "";
        truex_options3 = "";
      }
      var truex_options4 = "<div class='truex_options_no_thks' ><a href='' id='cmg-big-screen-truex-promo-close' onclick='cmgbsoptclose(); return false;'  href='/'>No thanks, return to regular mode</a></div>";

      var truex_options_prefix = '<div id="cmg-truex-options-container"><div class="take-action-buttons">';
      var truex_options_suffix = '</div></div>';
      truex_options = truex_options_prefix + truex_options1 + truex_options2 + truex_options3 + truex_options4 + truex_options_suffix;
      var truex_options_heading = '<div id="big-screen-truex-header-text" style="text-align: center; padding: 5px; padding-top: 14px; color:#fff; font-size:22px; background-color: #484848; ">' + '</div>';
      var preroll_container = '<div id="big-screen-preroll-container"><div id="videoplayer" style="width:100%;"><div id="adcontainer" style="margin:auto; width:640px;height:480px;"></div>' + '</div></div>' +
      '</div>';
      var bs_truex_options = '<div id="big-screen-truex-overlay" class="big-screen-style-popup-container" ' + ov_css + ' width="90%" height="90%">' + '<div class="big-screen-options-container" ' + ovc_css + ' >' + '<div class="bs-pop-up-content-container"><a onclick="cmgbsoptclose(); return false;" href="/">' + '<div class="close-btn"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 1L1 15M1 1L15 15" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/></svg></a></div>' + truex_options + '</div>' + '</div>' + '<div id="truex-main-container" ' + ovc_css_id + '>' + truex_options_heading + '<div id="big-screen-signup-container-id"></div>' + preroll_container + '</div>' + '</div>';
      jQuery('.global-wrapper').before(bs_truex_options);
      jQuery('#big_screen_iframe').css('height', '800px');
      jQuery('.big-screen-options-container').show();
      jQuery('#big-screen-truex-overlay').fadeIn(1000);
      jQuery('.big-screen-options-container .btn-close').on('click', function (e) {
        e.preventDefault();
        jQuery('#big-screen-truex-overlay').hide();
      });
      jQuery('#cmg-big-screen-truex-promo-close').on('click', function (e) {
        e.preventDefault();
        jQuery('#big-screen-truex-overlay').hide();
      });
    }
  }

  function show_big_screen_preroll_ad() {
    event.preventDefault();
    jQuery('#big-screen-truex-header-text').css('padding-top', '14px').html("<h2 style='font-size: 22px;'>PLAY BIG SCREEN AFTER THIS AD</h2>");
    jQuery('.big-screen-options-container').hide();

    var cmatgame_subscriber = getCookie('cmg_sx');
    var validSubscriber = false;
    if (typeof cmatgame_subscriber !== 'undefined' && cmatgame_subscriber !== null) {
      validSubscriber = true;
    }
    // preroll ads
    var prerollUrls = /0\-testing/;
    if (! validSubscriber) { // display preroll ads
      window.scrollTo(0, 0);
      var modal = document.getElementById('big-screen-preroll-container');
      // modal.style.display = 'block';
      // clear refresh timer
      if (typeof refreshTimer !== "undefined") {
        clearTimeout(refreshTimer);
        refreshTimer = null;
      }
      var adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/137548614/1023174/71134/1023174-71134-video&description_url=https%3A%2F%2Fwww.coolmathgames.com%2F&env=vp&impl=s&correlator=&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1';
      if (typeof window.PW_CMG != "undefined") {
        var auctionCallback = function (displayAds, videoUrl) {
          application = new Application(displayAds, videoUrl);
        };
        window.PW_CMG.startAuction(auctionCallback);
      } else { // adblock
        application = new Application(false, adTagUrl);
      }

      bs_preroll_timer = 15;
      bs_preroll_intervalId = setInterval(function () {
        bs_preroll_timer --;
        jQuery('#big-screen-truex-header-text').html('<h2 style="font-size: 22px;">PLAY BIG SCREEN AFTER THIS AD: ' + bs_preroll_timer + '</h2>');
        if (bs_preroll_timer <= 0) {
          jQuery('#big-screen-truex-header-text').html('<h2><a href="" style="font-size: 22px; text-decoration: none; color:#F5E61F; " id="truex-bigscreen-activate-id" class="truex-bigscreen-activate">PLAY BIG SCREEN NOW ▶</a></h2>');
          document.getElementById("truex-bigscreen-activate-id").onclick = function () {
            event.preventDefault();
            $('a.requestfullscreen>span.big-screen-popover-span').html('Play Big Screen');
            if (typeof bigScreenActive === 'undefined' || typeof bigScreenActive !== 'undefined' && !bigScreenActive) {
              jQuery('#big-screen-signup-container-id').html("");
              jQuery('#big-screen-truex-overlay').remove();
              start_full_screen_without_ad = false;
              cmg_start_game_full_screen('truex');
            }
          }
          clearInterval(bs_preroll_intervalId);
        }
      }, 1000);
    }
  }
  // TRUEX end
  function cmg_start_game_full_screen(cmgsource) {
    myStopFunction(); // no ad refresh
    bigScreenActive = true;
    if (cmg_stop_truex_promo !== '' && cmg_stop_truex_promo === 'yes') {
      cmgbsoptclose();
      bigScreenTimer = setTimeout(function () {
        bigScreenTimerAction();
      }, 60 * 1000);
    } else {
      cmgbsoptclose()
    }
    var elem = document.getElementById('block-system-main');

    if (jQuery('html').hasClass('mobile-device')) {
      requestFullscreenModal(elem, document.title);
      return false;
    }

    if (elem.requestFullscreen) {
      elem.requestFullscreen();
    } else if (elem.mozRequestFullScreen) { /* Firefox */
      elem.mozRequestFullScreen();
    } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari & Opera */
      elem.webkitRequestFullscreen();
    } else if (elem.msRequestFullscreen) { /* IE/Edge */
      elem.msRequestFullscreen();
    } else {
      requestFullscreenModal(elem, document.title);
      return false;
    }
    adjustWidthHeightGame();
  }

  function immersive_mode_display() {
    // get game
    var elem = document.getElementById('block-system-main');
    // open game in fullscreen
    $('#game-fullscreen #cmgwadfs').on('click', function (e) {
      e.preventDefault();
      $('.hasPopup').removeClass('active');
      if (/\/test-game\//.test(window.location.pathname)){
        cmg_start_game_full_screen();
      }
      if (cmg_stop_truex_promo === '' || cmg_stop_truex_promo !== 'yes') {
        if (start_full_screen_without_ad) {
          display_big_screen_truex_options_overlay();
        } else {
          cmg_start_game_full_screen();
        }
      }
      return;
    });
    // close game fullscreen
    $('#block-system-main .close-full-screen').on('click', function (e) {
      e.preventDefault();
      immersive_mode_exit_handler();
      jQuery.fullscreen.exit();
    });
    $('body').keypress(function (e) {
      if (e.which == 27) {
        if ($('.immerse-button .requestfullscreen').length && typeof bigScreenActive !== 'undefined' && bigScreenActive) {
          immersive_mode_exit_handler();
        }
      }
    });

    var screen_change_events = "webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange";

    // toggle full screen window class
    jQuery(document).on(screen_change_events, function () {
      if (jQuery.fullscreen.isFullScreen()) {
        if (jQuery('html').hasClass('mobile-device')) {
          jQuery("#block-system-main #html5game").attr('src', jQuery('#playNowButton').attr('href'));
        }

        $("body").addClass('immersiveActive');
        elem.classList.add('full-screen-window');
        // add zoomed alert
        if(typeof chkZoomValues === "function") {
          chkZoomValues();
        }
        // Adjusted width and height of iframe game
        adjustWidthHeightGame();

      } else {
        if (jQuery('html').hasClass('mobile-device')) {
          jQuery("#block-system-main #html5game").removeAttr('src');
        }

        immersive_mode_exit_handler();

        $("body").removeClass('immersiveActive');
        elem.classList.remove('full-screen-window');
        // remove zoomed alert
        $('.zoomedalert').remove();
        $('#html5game').removeAttr("style");
        $('#swfgame').removeAttr("style");
        $('.game-xp-bar-immerse-button').removeAttr("style");
      }
    });
  }

  function adjustWidthHeightGame() {
    var iframe = document.getElementById('html5game') ? document.getElementById('html5game') : document.getElementById('swfgame');
    var iframeWidth = parseInt(iframe.width);
    var iframeHeight = parseInt(iframe.height);
    // var windowWidth = parseInt(screen.width);
    // var windowHeight = parseInt(screen.height) - 75;
    var windowWidth = parseInt($(window).width());
    var windowHeight = parseInt($(window).height());
    var xpbarPos = (windowHeight + 75 - iframeHeight) / 2 + iframeHeight + 10;
    $('.game-xp-bar-immerse-button').css('top', xpbarPos + "px");

    if ($("body").hasClass("game-scalable")) {
      if (iframeHeight > windowHeight) {
        var ratio = iframeHeight / windowHeight;
      } else {
        var ratio = windowHeight / iframeHeight;
      }

      // Calculating game width based on window height
      var gameWidth = iframeWidth * ratio;

      // apply new width and height with iframe and xp bar
      iframe.style.width = gameWidth + "px";
      iframe.style.height = windowHeight + "px";
      var xpbarPos = windowHeight + 10;
      $('.game-xp-bar-immerse-button').css('top', xpbarPos + "px");
    } else if ($("body").hasClass("game-full-screen")) { // apply new width and height with iframe and xp bar
      iframe.style.width = windowWidth + "px";
      iframe.style.height = windowHeight + "px";
      var xpbarPos = windowHeight + 10;
      $('.game-xp-bar-immerse-button').css('top', xpbarPos + "px");
    }
  }

  function adjustWidthHeightModalGame(is_resize) {
    var iframe = $('#immersiveModal').find('#html5game');
    var iframeWidth = parseInt(iframe.attr('width'));
    var iframeHeight = parseInt(iframe.attr('height'));

    var time_out = (is_resize === true) ? 500 : 0;
    var wdWidth = parseInt($(window).width());
    var wdHeight = parseInt($(window).height());
    var oTwdWidth = parseInt($(window).outerWidth());
    var oTwdHeight = parseInt($(window).outerHeight());
    var windowWidth = (oTwdWidth > wdWidth) ? oTwdWidth : wdWidth;
    var windowHeight = (oTwdHeight > wdHeight) ? oTwdHeight : wdHeight;
    if ($("body").hasClass("game-scalable")) {
      if (iframeHeight > windowHeight) {
        var ratio = iframeHeight / windowHeight;
      } else {
        var ratio = windowHeight / iframeHeight;
      }
      // Calculating game width based on window height
      var gameWidth = iframeWidth * ratio;
      // apply new width and height with iframe
      iframe.css("width", windowWidth);
      iframe.css("height", windowHeight);
    } else if ($("body").hasClass("game-full-screen")) {
      iframe.css("width", windowWidth);
      iframe.css("height", windowHeight);
    }
  }

  // adjust game width/height if screen rotate from portrait to landscape
  window.addEventListener("resize", function () {
    if ($("body").hasClass("immersiveActive")) {
      adjustWidthHeightGame();
    }
    if ($("body").hasClass("isFullScreen")) {
      adjustWidthHeightGame();
    }
    if ($("body").find("#immersiveModal").length) {
      adjustWidthHeightModalGame(true);
    }
    if ($("#swfgamewrapper #html5game").prop("tagName") == "IFRAME1" && !cmg_is_mobile_device() && document.documentElement.clientWidth >= 960 - ( window.innerWidth-jQuery(document).width() )  ) {
      if (hide_preroll_ads == false && (prerollAdDisplayed == false || prerollAdEnd != "" && prerollAdStart != prerollAdEnd ) && prerollAdEnd != "mob") {
        displayPrerollAd_Desktop();
      } else if (hide_preroll_ads == true || prerollAdDisplayed == true) {
        cmgRemovePadg();
      }
    }
  }, false);

  var cmg_mmg_html = '';
  var cmg_mmg_swf_html = '';
  var cmg_game_modal_attached = false;
  function attachModalHtml(elem, title) {
    cmg_game_modal_attached = true;
    var elem = document.getElementById('block-system-main');
    html = '<div id="immersiveModal" class="" style="display:none;" tabindex="-1" role="dialog" aria-labelledby="immersiveModalLabel" aria-hidden="true">';
    html += '<div class="modal-dialog">';
    html += '<div class="modal-content">';
    html += '<div class="modal-body">';
    html += '<div id="swfgamewrapper">';
    html += '</div>';
    html += '</div>';
    html += '</div>';
    html += '</div>';
    html += '</div>';

    $('body').append(html);
    var gamewrapper = jQuery("#swfgamewrapper");
    jQuery('#immersiveModal .modal-body').html(gamewrapper);
    if (cmg_is_mobile_device() || (jQuery(".game-page-mobile .playNow").length && jQuery(".game-page-mobile .playNow").is(':visible') ) ) {
      sandbox = jQuery("#html5game").attr("sandbox");
      if (sandbox !== undefined) {
        sandbox = ' sandbox=\"' + sandbox + '\"';
      } else {
        sandbox = '';
      }
      newiframe = '<iframe style="display: none;" id="html5game" src="' + jQuery("#html5game").attr("src") + '" class="' + jQuery("#html5game").attr("class") + '" width="' + jQuery("#html5game").attr("width") + '" height="' + jQuery("#html5game").attr("height") + '" scrolling="no" marginwidth="0' + '" vspace="0" frameborder="0" hspace="0" marginheight="0"' + sandbox + '></iframe>';
      if (jQuery("#html5game").length) {
        cmg_mmg_html = '<iframe id="html5game" src="' + jQuery("#html5game").attr("src") + '" class="' + jQuery("#html5game").attr("class") + '" width="' + jQuery("#html5game").attr("width") + '" height="' + jQuery("#html5game").attr("height") + '" scrolling="no" marginwidth="0' + '" vspace="0" frameborder="0" hspace="0" marginheight="0"' + sandbox + '></iframe>';
      }
      newswfiframe = '<iframe style="display: none;" id="swfgame" src="' + jQuery("#swfgame").attr("src") + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
      if (jQuery("#swfgame").length) {
        cmg_mmg_swf_html = '<iframe id="swfgame" src="' + jQuery("#swfgame").attr("src") + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
      }
      if (cmg_flash_emulated_game()) {
        if (drupalSettings.cmatgame.flash_emulation === "1"){ //ruffle
          game_type = "html5";
          var swfURLObject = drupalSettings.cmatgame.swfembed.swf.u;
          var swfURLArray = swfURLObject.split("/");
          game_width = drupalSettings.cmatgame.swfembed.swf.swf_1.width;
          game_height = drupalSettings.cmatgame.swfembed.swf.swf_1.height;
          var swf_game_url = 'https://www.coolmath-games.com/sites/cmatgame/files/ruffle1/ruffle.html?f='+swfURLArray[swfURLArray.length-1]+'&w='+game_width+'&h='+game_height;
          cmg_mmg_swf_html = '<iframe id="swfgame" src="' + swf_game_url + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
        } else if (drupalSettings.cmatgame.flash_emulation === "2"){ //ruffle
          game_type = "html5";
          game_width = drupalSettings.cmatgame.swfembed.swf.swf_1.width;
          game_height = drupalSettings.cmatgame.swfembed.swf.swf_1.height;
          game_type = "html5";
          var swfURLObject = drupalSettings.cmatgame.swfembed.swf.u;
          var swfURLArray = swfURLObject.split("/");
          swf_1_game_movie_param = swfURLArray[swfURLArray.length-1];
          //cheerpx js
          var swf_game_url = cmgGetCheerpxUrl()+swfURLArray[swfURLArray.length-1]+'&w='+game_width+'&h='+game_height;
          newswfiframe = '<iframe '+coep_frame_type+' id="swfgame" src="' + swf_game_url + '" class="' + jQuery("#swfgame").attr("class") + '" width="' + jQuery("#swfgame").attr("width") + '" height="' + jQuery("#swfgame").attr("height") + '" scrolling="no" marginwidth="0" vspac' + 'e="0" frameborder="0" hspace="0" marginheight="0"></iframe>';
          jQuery("#swfgame").replaceWith(newswfiframe);
        }
      }
    }
  }

  function requestFullscreenModal(elem, title) {
    $("#immersiveModal").addClass('modal fade show full-screen-modal').css({"display":"block", "z-index":10000});
    $('body').addClass('isModalPlay');
    $('#immersiveModal').find('#swfgamewrapper').show();
    if ($('#html5game').length || cmg_mmg_html) {
      jQuery("#swfgamewrapper").html(cmg_mmg_html);
      if (cmg_flash_emulated_game()) {
        jQuery("#swfgamewrapper").html(cmg_mmg_swf_html);
      }
    } else if (jQuery('#swfgame').length) {
      if (cmg_flash_emulated_game()) {
        if (drupalSettings.cmatgame.flash_emulation === "2"){
          jQuery("#swfgamewrapper").html(newswfiframe);
        } else {
          jQuery("#swfgamewrapper").html(cmg_mmg_swf_html);
        }
      }
    }

    if (drupalSettings.cmatgame.flash_emulation === "2"){
      displayCmgCheerpxLoadingScreenResized();
    }

    $('#immersiveModal').find('.close').click(function () {
      $("#immersiveModal").remove();
    });

    window.location.hash = "immersiveModal";
    $(window).on('hashchange', function (event) {
      if (window.location.hash != "#immersiveModal") {
        $("#immersiveModal").hide();
        if ($('#html5game').length) {
          $('#html5game').remove();
        } else if (jQuery('#swfgame').length) {
          jQuery('#swfgame').remove();
        }
        $('body').removeClass('isModalPlay');
      }
    });
    adjustWidthHeightModalGame(false);
    if (typeof browser !== "undefined" && browser == "Microsoft Internet Explorer") {
      if ("function" === typeof checkVersionBrowser) {
        ieVersion = checkVersionBrowser();
        if (ieVersion == "IE 11" && !jQuery('#html5game').length) {
          jQuery("#swfgamewrapper").html(cmg_mmg_html);
        }
      }
    }
  }
</script><script type="deferjs">
          hide_preroll_ads = false;
        var cmg_active_anonymous_user = getCookie('cmg_active_anonymous_user');
    if (cmg_active_anonymous_user != null && !/0-chess/.test(window.location.pathname)) { // setCookie('cmg_active_anonymous_user', 'active', 30*60*1000);
    }
  </script><!--Start of Preloader call --><div id="afg_preloader"><div id="afg_container"><div class="load-wrap"><script type="deferjs">
        $('<div class="loading"><div class="circle"></div><div class="circle"></div><div class="circle"></div><div class="circle"></div></div><h3 class="loadingText">Just a moment while your game loads</h3>' + signupContainerTop).prependTo('.load-wrap');
      </script></div></div><div id="container123"><div id="videoplayer"><div id="adcontainer"></div></div></div><!-- Continue to Game container with timer --><div class="continue-wrapper"><div id="continue-container" class="continue-container"><div class="continue-lnk-container"><div id="continue-link" class="continue-link"><span>Continue in</span></div><div id="timer-div" class="timer-div">15</div></div><div id="skip-all-ads" class="img-button"><a href="javascript:void(0)" onclick="redirectpremium();" class="skip-ads-button"> Skip All Ads: Go Premium <img width="18" src="/themes/custom/coolmath/assets/svg/play-forward.svg"></a></div></div></div><script type="deferjs" src="//cdn.intergi.com/prebid/cmg-prebid.js"></script><script type="deferjs" src="//cdn.intergi.com/cmg/cmg-headerbidding.js"></script><script type="deferjs" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script><script type="deferjs" src="/modules/custom/cmatgame_ads_analytics/js/adblocker.js"></script><script type="deferjs">
    function redirectpremium(){
     event.preventDefault();
     var sLeg = get_premium_access_leg_desc('2efa4bc4');
     if (drupalSettings.language == 'en') {
       var lang_path = '/premium-access';
     } else {
       var lang_path = '/'+drupalSettings.language+'/premium-access';
     }
     var path = lang_path+'/2efa4bc4';
     if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
       if (drupalSettings.language == 'en'){
         var lang_path = '/profile/premium-access'
       } else {
         var lang_path = '/'+drupalSettings.language + '/profile/premium-access';
       }
       path = lang_path+'/bd07c4e6/' + getCookie('cmg_fx').toLowerCase();
       sLeg = get_premium_access_leg_desc('bd07c4e6');
     }
     trackEvent('Premium Subscription - '+sLeg, "Preroll - Skip Ads Go VIP Now - button clicked", document.title);
     window.location.href = window.location.protocol + '//' + window.location.host + path + get_signup_abtest_variant_3();
    }

  displayAdblockOverlay = false;
  if ( typeof hide_preroll_ads != "undefined" && !hide_preroll_ads && (document.getElementById('randomAdBlockDiv') == null || typeof google == "undefined" || typeof cmgpbjs == "undefined")) { // cmgpbjs is defined in ads, so if it undefined means, adblocker is detected
      displayAdblockOverlay = true;
    }


    /**
     * Handles user interaction and creates the player and ads controllers.
     */
    var adsManager;
    var pagepreRollType = '';
    var Application = function (displayAds, adTagUrl, preRollType) {
      if (typeof preRollType == "undefined") { //desktop
        preRollType = "";
      } else {
        pagepreRollType = preRollType;
      }
      this.playing_ = false;
      this.adsActive_ = false;
      this.adsDone_ = false;
      if (typeof displayAds === 'undefined' || displayAds === null) {
        this.displayAds = true;
      } else {
        this.displayAds = displayAds;
      }
      this.adTagUrl_ = adTagUrl;

      this.videoPlayer_ = new VideoPlayer(preRollType);
      if (jQuery(window).width() >= 610 && jQuery(window).height() >= 610) {
        this.videoPlayer_.width = 640;
        this.videoPlayer_.height = 480;
      } else {
        this.videoPlayer_.width = 300;
        this.videoPlayer_.height = 250;
      }
      if (this.displayAds) {
        this.ads_ = new Ads(this, this.videoPlayer_);
        // Adx Preroll Tag with fallback display Ad The user clicked/tapped - inform the ads controller that this code is being run in a user action thread.
        this.ads_.initialUserAction();
        // At the same time, initialize the content player as well. When content is loaded, we'll issue the ad request to prevent it from interfering with the initialization. See
        // https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/ads#iosvideo for more information.
        this.videoPlayer_.preloadContent(this.bind_(this, this.loadAds_));
        this.adsDone_ = true;
      }
    };

    Application.prototype.bind_ = function (thisObj, fn) {
      return function () {
        fn.apply(thisObj, arguments);
      };
    };

    Application.prototype.loadAds_ = function () {
      this.ads_.requestAds(this.adTagUrl_);
    };

    /**
           * Handles video player functionality.
           */
    var VideoPlayer = function (preRollType) {
      this.contentPlayer = document.getElementById(preRollType+'content123');
      this.adContainer = document.getElementById(preRollType+'adcontainer');
      this.videoPlayerContainer_ = document.getElementById(preRollType+'videoplayer');
      this.width = 640;
      this.height = 480;
    };

    VideoPlayer.prototype.preloadContent = function (contentLoadedAction) {
      contentLoadedAction();
    };
    VideoPlayer.prototype.play = function () {
      this.contentPlayer.play();
    };

    VideoPlayer.prototype.pause = function () {
      this.contentPlayer.pause();
    };

    /**
     * Shows how to use the IMA SDK to request and display ads.
     */

    var Ads = function (application, videoPlayer) {
      this.application_ = application;
      this.videoPlayer_ = videoPlayer;
      this.customClickDiv_ = document.getElementById('customClick');
      this.contentCompleteCalled_ = false;
      google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED);
      // Call setLocale() to localize language text and downloaded swfs google.ima.settings.setLocale('fr');
      this.adDisplayContainer_ = new google.ima.AdDisplayContainer(this.videoPlayer_.adContainer, this.videoPlayer_.contentPlayer, this.customClickDiv_);
      this.adsLoader_ = new google.ima.AdsLoader(this.adDisplayContainer_);
      this.adsManager_ = null;

      this.adsLoader_.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, this.onAdsManagerLoaded_, false, this);
      this.adsLoader_.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdError_, false, this);
    };

    // On iOS and Android devices, video playback must begin in a user action. AdDisplayContainer provides a initialize() API to be called at appropriate time. This should be called when the user clicks or taps.
    Ads.prototype.initialUserAction = function () {
      this.adDisplayContainer_.initialize();
      if (typeof this.videoPlayer_ != "undefined" && typeof this.videoPlayer_.contentPlayer != "undefined" && this.videoPlayer_.contentPlayer != null) {
        this.videoPlayer_.contentPlayer.load();
      }
    };

    Ads.prototype.requestAds = function (adTagUrl) {
      var adsRequest = new google.ima.AdsRequest();
      adsRequest.adTagUrl = adTagUrl;
      adsRequest.linearAdSlotWidth = this.videoPlayer_.width;
      adsRequest.linearAdSlotHeight = this.videoPlayer_.height;
      adsRequest.nonLinearAdSlotWidth = this.videoPlayer_.width;
      adsRequest.nonLinearAdSlotHeight = this.videoPlayer_.height;
      this.adsLoader_.requestAds(adsRequest);
    };

    Ads.prototype.onAdsManagerLoaded_ = function (adsManagerLoadedEvent) {
      var adsRenderingSettings = new google.ima.AdsRenderingSettings();
      // adsRenderingSettings.loadVideoTimeout = 4000;
      adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true;
      this.adsManager_ = adsManagerLoadedEvent.getAdsManager(this.videoPlayer_.contentPlayer, adsRenderingSettings);
      adsManager = this.adsManager_;
      this.adsManager_.setVolume(0);
      this.processAdsManager_(this.adsManager_);
    };

    Ads.prototype.processAdsManager_ = function (adsManager) {
      if (adsManager.isCustomClickTrackingUsed()) {
        this.customClickDiv_.style.display = 'table';
      }
      // Handle errors.
      adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdError_, false, this);
      var events = [
        google.ima.AdEvent.Type.ALL_ADS_COMPLETED,
        google.ima.AdEvent.Type.COMPLETE,
        google.ima.AdEvent.Type.FIRST_QUARTILE,
        google.ima.AdEvent.Type.LOADED,
        google.ima.AdEvent.Type.MIDPOINT,
        google.ima.AdEvent.Type.STARTED,
        google.ima.AdEvent.Type.THIRD_QUARTILE,
        google.ima.AdEvent.Type.USER_CLOSE
      ];
      for (var index in events) {
        adsManager.addEventListener(events[index], this.onAdEvent_, false, this);
      }

      var initWidth,
        initHeight;

      initWidth = this.videoPlayer_.width;
      initHeight = this.videoPlayer_.height;

      adsManager.init(initWidth, initHeight, google.ima.ViewMode.NORMAL);
      adsManager.start();
    };
    window.is_ad_loaded = false;
    Ads.prototype.onAdEvent_ = function (adEvent) {
      if (adEvent.type == google.ima.AdEvent.Type.LOADED) {
        var ad = adEvent.getAd();
        //hide the dummy video
        if (jQuery("#content123").length && jQuery("#content123").is(":visible")) {
          jQuery("#content123").hide();
        } else if (jQuery("#m-content123").length && jQuery("#m-content123").is(":visible")) {
          jQuery("#m-content123").hide();
        } else if (jQuery("#r-content123").length && jQuery("#r-content123").is(":visible")) {
          jQuery("#r-content123").hide();
        }
      }
      if (adEvent.type == google.ima.AdEvent.Type.STARTED) {
       is_ad_loaded = true;
      }
      if ((typeof truex_overlay_preroll_ad_display === 'undefined' || typeof truex_overlay_preroll_ad_display !== 'undefined' && !truex_overlay_preroll_ad_display) && adEvent.type == google.ima.AdEvent.Type.COMPLETE) {
        if (pagepreRollType == '') {
          if(typeof midRollAdStarted != "undefined" && midRollAdStarted) {
            cmgRemoveMadg();
          } else {
            cmgRemovePadg();
          }
        }
      }
      if ((typeof truex_overlay_preroll_ad_display === 'undefined' || typeof truex_overlay_preroll_ad_display !== 'undefined' && !truex_overlay_preroll_ad_display) && adEvent.type == google.ima.AdEvent.Type.ALL_ADS_COMPLETED) {
        if (pagepreRollType == '') {
          if(typeof midRollAdStarted != "undefined" && midRollAdStarted) {
            cmgRemoveMadg();
          } else {
            cmgRemovePadg();
          }
        }
      }
      if ((typeof truex_overlay_preroll_ad_display === 'undefined' || typeof truex_overlay_preroll_ad_display !== 'undefined' && !truex_overlay_preroll_ad_display) && adEvent.type == google.ima.AdEvent.Type.USER_CLOSE) {
        if (pagepreRollType == '') {
          if(typeof midRollAdStarted != "undefined" && midRollAdStarted) {
            cmgRemoveMadg();
          } else {
            cmgRemovePadg();
          }
        }
      }
      if (pagepreRollType == 'r-' && (adEvent.type == google.ima.AdEvent.Type.SKIPPED || adEvent.type == google.ima.AdEvent.Type.ALL_ADS_COMPLETED)) {
        //Responsive view --> Display continue link  after ad is comleted or skipped
        removeResponsivePrerollTimer();
      }
      if (typeof truex_overlay_preroll_ad_display !== 'undefined' && truex_overlay_preroll_ad_display && (adEvent.type == google.ima.AdEvent.Type.SKIPPED || adEvent.type == google.ima.AdEvent.Type.USER_CLOSE)) {

        jQuery('#big-screen-signup-container-id').html("");
        jQuery('#big-screen-truex-overlay').remove();
        cmg_start_game_full_screen('truex');
      } else if (typeof truex_overlay_preroll_ad_display !== 'undefined' && truex_overlay_preroll_ad_display && (adEvent.type == google.ima.AdEvent.Type.ALL_ADS_COMPLETED || adEvent.type == google.ima.AdEvent.Type.COMPLETE)) {
        if (typeof bs_preroll_timer !== 'undefined' && bs_preroll_timer > 0) {
          bs_preroll_timer = 0;
        }
      }
    };
    Ads.prototype.onAdError_ = function (adErrorEvent) {
      if (this.adsManager_) {
        this.adsManager_.destroy();
      }
      if (pagepreRollType == '') {
        if(typeof midRollAdStarted != "undefined" && midRollAdStarted) {
          cmgRemoveMadg();
        } else {
          cmgRemovePadg();
        }
      }
    };

    function displayAdBlock(deviceType) {
      adBlockDisplayed = true;
      var adBlockPremiumHeadline = '<span class="blue-headline-txt">Allow Ads</span> or <span class="yellow-headline-txt">Join!</span>';
      var adBlockSubHeadline = '<span class="blue-headline-txt">Turn Off Your Ad Blocker to  Keep Playing</span>';
      var adBlockBottomPromo = '<span class="yellow-headline-txt">Or Go VIP Ad-Free Now</span>';
      var adBlockPromoPricing = '$5.99/month membership. Cancel Anytime';
      var adBlockPremiumButton = 'Get Ad-Free';
      if (typeof intervalId != "undefined") {
        clearInterval(intervalId);
      }
      var adblockTarget = ".field-game";
      if (deviceType == "" || deviceType == "desktop") {
        jQuery("#afg_container").hide();
        jQuery("#continue-container").hide();

      } else { //mobile
        adblockTarget = ".game-image.my-4";
        jQuery(".game-page-mobile").addClass("ad-blocked");
        jQuery(".game-page-mobile .game-image.my-4").html("");

      }
      doNotDisplayPrerollTimer = true;

      jQuery(adblockTarget).append('<div class="blocker-detected-2">' +
      '<div class="row blocker-detected-top-content">' +
      '<h2>' + adBlockPremiumHeadline + '</h2>' +
      '<h3>' + adBlockSubHeadline + '</h3>' +
      '<div class="main-block-content">' +
      '<div class="left-content-bullets">' +
      '<ul>' +
      '<li><div class="numberCircle">1</div><p>Click the Ad Blocker extension icon in the upper<br>right area of your browser window.</p></li>' +
      '<li><div class="numberCircle">2</div><p>Choose “Don\’t run on this domain” or similar <br>option to disable it for all Coolmath Pages.</p></li>' +
      '<li><div class="numberCircle">3</div><p>Refresh the Page</p><br><a class="adblock-more-info-link" href="/adblock-faq" target="_blank">Having problems or need more info? Click here</a></li>' +
      '</ul>' +
      '</div>' +
      '<div class="right-content-image"><img src="/sites/default/files/disable-adblocker.png" alt="disable ad blocker instructions" /></div>' +
      '</div>' + '</div>' + '<div class="row blocker-detected-bottom-content">' + '<div clas="left-bottom-content">' +
      '<h3>' + adBlockBottomPromo + '</h3>' +
      '<h4>' + adBlockPromoPricing + '<h4>' +
      '</div>' +
      '<div class="right-content-button-container"><div class="btn-container"><a class="btn sign-up vip-btn" id="adblock_join_now_promo_handler" href="premium-access/791c674d"><span>' + adBlockPremiumButton + '</span></a></div></div>' +
      '</div>' +
      '</div>');
    }

    var cmatgame_subscriber = getCookie('cmg_sx');
    var validSubscriber = false;
    if (typeof cmatgame_subscriber !== 'undefined' && cmatgame_subscriber !== null) {
      validSubscriber = true;
    }
    if (getCookie("cmg_wl") !== null) {
      validSubscriber = true;
    }
    var validReferer = false;
    if (document.referrer.match("google.com") !== null || document.referrer.match("yahoo.com") !== null || document.referrer.match("bing.com") !== null) {
      validReferer = true;
    }
    var application = null;
    function cmg_adrecovery() {
      if (typeof retrieveUserProgress == "function") {
        retrieveUserProgress();
      }
      cmgRemovePadg();
    }
    function cmg_flash_emulated_game() {
      //flash_emulation === "1" --> ruffle, flash_emulation === "2" --> cheerpx,
      //TODO add cheerpx
      if (typeof flashemulation !== "undefined" && (drupalSettings.cmatgame.flash_emulation === "1" || drupalSettings.cmatgame.flash_emulation === "2" )) {
        return true;
      } else {
        return false;
      }
    }

    // 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
    if (validSubscriber) { // valid subscriber do not display Preroll Ads
      var adTagUrl = "";
      // retreive user Progress
      if (typeof retrieveUserProgress == "function" && (typeof userprofile == "undefined" || userprofile == "")) {
        retrieveUserProgress();
      }
      cmgRemovePadg();

    } else if (!validSubscriber && (document.getElementById('randomAdBlockDiv') == null || typeof google == "undefined" || typeof cmgpbjs == "undefined" && navigator.cookieEnabled) ) {
      if (cmg_is_mobile_device() || document.documentElement.clientWidth <=950) { //mobile or responsive mobile view
        if (typeof schoolHours !== "undefined" && schoolHours) {
          cmgRemovePadg();
        }
      } else {
        if (typeof schoolHours !== "undefined" && schoolHours || drupalSettings.cmatgame.flash_emulation == "2") {
          cmgRemovePadg();
        }
      }
    } else if ( typeof bigScreenPromoGame != "undefined" && bigScreenPromoGame == true && (gamesPlayed == 2 || gamesPlayed == 8) && (flashemulation != 0)) {
    /**
      *** Big Screen Promo and check for every 3rd refresh
      ***/
      jQuery("#afg_container").hide();
      jQuery('#full-screen-modal').show();
      jQuery('#big-screen-container').show();
      jQuery("#videoplayer").hide();
      
      // show bigscreen button
      $(document).ready(function () {
        jQuery("#continue-container").hide();
        if (jQuery('.immerse-button').length) {
          jQuery('#no-flash-overlay').hide();
          jQuery('#swfgamewrapper').hide();
        }
      });

    } else if (typeof AdfreeMktCmpGame != "undefined" && AdfreeMktCmpGame == true && (gamesPlayed == 2 || gamesPlayed == 8) && (flashemulation != 0)){
      /**
      *** Add free marketing promo Promo and check for every 3rd refresh
      ***/
      jQuery("#afg_container").hide();
      jQuery('#id-adfree-marketing-campaign').show();
      jQuery("#videoplayer").hide();
      
      // show bigscreen button
      $(document).ready(function () {
        if (jQuery('.immerse-button').length) {
          jQuery('#no-flash-overlay').hide();
          jQuery('#swfgamewrapper').hide();
        }
      });

    } else if (!validReferer && ( typeof supportCMG === 'boolean' && supportCMG === true  ) && (gamesPlayed == 2 || gamesPlayed == 8) && (flashemulation != 0) && !cmgDefaultGameUrl.test(location.pathname)) { //subscription paywall for Support Game

      clearInterval(intervalId);
      jQuery("#afg_container").hide();
      jQuery(".title-instructions").remove();
      jQuery(".body-instructions").remove();
      jQuery(".game-xp-bar-immerse-button").remove();
      jQuery("#continue-container").hide();

      if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
        var planToSubscription = 'd61242ac';
      } else {
        var planToSubscription = '0735a1f2';
      } // logged in free user
      doNotDisplayPrerollTimer = true;
      var htmlPopOver = '<div id="id-cmg-default" class="cmg-default-marketing-campaign" style="display:block;"><div class="big-screen-head"><div class="bs-head-logo"><img src="/themes/custom/coolmath/assets/images/full-screen/cool-math-logo.png"></div><div class="bs-head-txt">Get Premium: The Best Gaming Experience</div><div class="bs-close-button"><a href="#" class="bs-close-btn" onclick="supportCMG_overlay_promo_close_handler(); return false;">X</a></div></div><div class="mid-big-section-head cmg-default-mid-section-marketing-campaign"><div class="mid-img-container"><div><div class="img-container-cmg-default"><div class="no-waiting-txt"> Personalized <br> Premium <br>Profile</div><div class="image-bs-sample"><img class="img-cmgdefault" src="/themes/custom/coolmath/assets/images/subscriptions/premium-avatars-small.png"><br><span class="red-txt">Access All <br>premium avatars </div><div class="image-bs-sample"><img class="img-cmgdefault" src="/themes/custom/coolmath/assets/images/subscriptions/premium-themes-small.png"><br><span class="offwhite-txt">Full selection <br>of themes </span></div><div class="image-bs-sample"><img class="img-cmgdefault" src="/themes/custom/coolmath/assets/images/subscriptions/custom-nicknames-small.png"><br><span class="blue-txt">Custom <br>Nickname </span></div></div></div><div><div class="img-container-cmg-default"><div class="no-waiting-txt"> Distraction <br> Free Gaming & <br>Unlimited <br> Creativity</div><div class="image-bs-sample"><img class="img-cmgdefault" src="/themes/custom/coolmath/assets/images/subscriptions/big-screen-small.png"><br><span class="light-blue-txt">Big <br>Screen </span></div><div class="image-bs-sample"><img class="img-cmgdefault" src="/themes/custom/coolmath/assets/images/subscriptions/ad-free-small.png"><br><span class="green-txt">Ad-Free<br> Experience </span></div><div class="image-bs-sample"><img class="img-cmgdefault" src="/themes/custom/coolmath/assets/images/subscriptions/unlimited-playlists-small.png"><br><span class="white-txt"> Unlimited <br>Playlist </span></div></div></div><div class="better-focus-container "><div class="all-excl-txt">And More Exclusive features for Premium Members!</div></div></div><div class="marketing-cmpn-footer"><div class="bs-footer-link"><a href="/premium-access/' + planToSubscription + '" target="_blank" onclick="cmgDefault_overlay_promo_signup_handler("Get CMGDefault Marketing screen mode - overlay button clicked"); return false;"><img src="/themes/custom/coolmath/assets/images/full-screen/get-premium-btn.png"></a></div><div class="bs-learn-more"><a href="/premium-benefits" target="_blank" onclick="cmgDefault_overlay_promo_more_handler(); return false;" class="bs-lrn-more">Learn More</a></div><div class="bs-no-thks"><a href="" class="bs-lnk-lrn-more" onclick="supportCMG_overlay_promo_close_handler(); return false;">No, Thanks. I just want to play games right now.</a></div></div></div></div>';
      jQuery(".field-game").append(htmlPopOver);
      jQuery("#videoplayer").hide();
      // localStorage.setItem("userPlayedGames"+currentMonth+currentYear,userPlayedGames); localStorage.setItem("userPlayedGames",userPlayedGames);

  } else if ( typeof playListMktCmpGame != "undefined" && playListMktCmpGame == true && (gamesPlayed == 2 || gamesPlayed == 8) && (flashemulation != 0)){
      /**
      *** Add free marketing promo Promo and check for every 3rd refresh
      ***/
     if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
        var planStripString = '4c044106';
      } else {
        var planStripString = '39980b12';
      } // logged in free user

      jQuery("#afg_container").hide();
      var playlistPopoverHtml = '<div id="id-playlist-marketing-campaign" class="playlist-marketing-campaign" ><div class="big-screen-head"><div class="bs-head-logo"><img src="/themes/custom/coolmath/assets/images/full-screen/cool-math-logo.png"></div><div class="bs-head-txt">Get Premium for Unlimited Playlists</div><div class="bs-close-button"><a href="#" class="bs-close-btn" onclick="playlist_marketing_overlay_promo_close_handler(); return false;">X</a></div></div><div class="mid-big-section-head adfree-mid-section-marketing-campaign"><div class="mkt-container-co"><div class=" para-1 mkt-container1"><img class="freind-icon" src="/themes/custom/coolmath/assets/images/subscriptions/Playlist_friendst-icon.png"></div><div class="ad-free-txt txt-1">Collect, Organize and share!</div><div class="para-4 mkt-container1"><img class="gift-icon" src="/themes/custom/coolmath/assets/images/subscriptions/Playlist_best-games-youve-never-heard-of.png"></div></div><div class="mkt-container-co"><div class=" para-2 mkt-container1"><img class="cantstop-icon" src="/themes/custom/coolmath/assets/images/subscriptions/Playlist-cant-stop-playing-icon.png"></div><div class="ad-free-txt txt-2">The games you want to live in <br> The Games that make you crazy </div><div class="para-4 mkt-container1"><img class="fav-icon" src="/themes/custom/coolmath/assets/images/subscriptions/Playlist-favorites-icon.png"></div></div><div class="mkt-container-co"><div class="para-3 mkt-container1"><img class="playhard-icon" src="/themes/custom/coolmath/assets/images/subscriptions/Playlist_hard-but-fun.png"></div><div class="ad-free-txt txt-3">The games you love with your friends</div><div class="para-3 mkt-container1 "><img class="eat-icon" src="/themes/custom/coolmath/assets/images/subscriptions/Playlist_want-to-eat-icon.png"></div></div><div class=""><img src="/themes/custom/coolmath/assets/images/subscriptions/playlist_promo_banner.png"></div><div class="marketing-cmpn-footer"><div class="bs-footer-link"><a href="/premium-access/' + planStripString + '" target="_blank" onclick="playlist_marketing_overlay_promo_signup_handler(); return false;"><img src="/themes/custom/coolmath/assets/images/full-screen/get-premium-btn.png"></a></div><div class="bs-learn-more"><a href="/premium-benefits" target="_blank" onclick="playlist_marketing_overlay_promo_more_handler(); return false;" class="bs-lrn-more">Learn More</a></div><div class="bs-no-thks"><a href="" class="bs-lnk-lrn-more" onclick="playlist_marketing_overlay_promo_close_handler(); return false;">No, Thanks. I just want to play games right now.</a></div></div></div></div>';
      jQuery("#playlist-marketing-container-id").html(playlistPopoverHtml);
      jQuery("#videoplayer").hide();

      // show bigscreen button
      $(document).ready(function () {
        if (jQuery('.immerse-button').length) {
          jQuery('#no-flash-overlay').hide();
          jQuery('#swfgamewrapper').hide();
        }
      });

    } else if ((drupalSettings.cmatgame.swfembed && !cmg_flash_emulated_game()) || getCookie('cmg_schwl') !== null || typeof cmg_no_ads !== 'undefined' || (! validSubscriber && schoolHours) || (!schoolHours && !watchAdtoUnlockGame && !displayAdblockOverlay && !supportCMG && !premiumAvatarGame)) { // school hours
      if (getCookie('cmg_schwl') !== null || typeof cmg_no_ads !== 'undefined' || (drupalSettings.cmatgame.swfembed && !cmg_flash_emulated_game())) {
        cmgRemovePadg();
      } else if ((drupalSettings.cmatgame.swfembed && !cmg_flash_emulated_game()) || getCookie('cmg_schwl') !== null || typeof cmg_no_ads !== 'undefined' || (!validSubscriber && schoolHours) || (!schoolHours && !watchAdtoUnlockGame && !displayAdblockOverlay && !supportCMG && !premiumAvatarGame)) {
      //school hours
        /* Playwire video ad unit */
        //new desktop preroll invocation
        if (!cmg_is_mobile_device() && document.documentElement.clientWidth >= 960 - ( window.innerWidth-jQuery(document).width() ) && (!jQuery(".game-page-mobile").length || jQuery(".game-page-mobile").is(':hidden')) ) {
          displayPrerollAd_Desktop();
        }
      } else if (!validSubscriber && (watchAdtoUnlockGame || displayAdblockOverlay || supportCMG || premiumAvatarGame) && getCookie('cmg_editor') === null) {
        //if user comes from google dont show the subscription paywall
        var ref = document.referrer;
      }
      if (!/0-chess/.test(window.location.pathname)) { // setCookie('cmg_active_anonymous_user', 'active', 30*60*1000);
      }
    } else if (!validReferer && premiumAvatarGame && (gamesPlayed == 2 || gamesPlayed == 8)) {
        //premiumAvatar promo games
        supportCMG = false;
        clearInterval(intervalId);
        jQuery("#afg_container").hide();
        jQuery(".title-instructions").remove();
        jQuery(".body-instructions").remove();
        jQuery("#continue-container").hide();

        doNotDisplayPrerollTimer = true;
        if (getCookie('cmg_fx') !== null && getCookie('cmg_sx') == null) {
          var planToSubscription = '67361110';
        } else {
          var planToSubscription = '553bdf22';
        }

        jQuery(".field-game").append('<div class="game-overlay-watch-or-join  premium-avatar" style="height:555px;">' +
        '<div class="row overlay-logo-container">' +
        '<img src="/themes/custom/cmatgame/logo.png" class="overlay-logo" />' +
          '</div>' +
          '<div class="row premium-avatar-content">' +
          '<div class="row top-promo-text premium-avatar-headline"><h4 class="get-premium">Love The games? Get the avatars!</h4></div>' +
          '<img style="width:100%;" src="/sites/default/files/premium-avatar-promos/premium-avatar-overlay-1.png" />' +
          '<div class="premium-avatar-btn-container"><a href="/premium-access/' + planToSubscription + '" target="_blank" onclick="cmgDefault_overlay_promo_signup_handler("Get Premium Avatar screen mode - overlay button clicked"); return false;"><img src="/themes/custom/coolmath/assets/images/full-screen/get-premium-btn.png"></a>' +
          '<div class="learn-more-text"><a class="learn-more-text-link" href="https://www.coolmathgames.com/premium-benefits" target="_blank"> Learn More</a></div>' +
          '<div class="no-thanks-text no-thanks-text-premium-avatar"><a href="javascript:premium_avatar_continue_to_game_handler();"> No, thanks. I just want to play games right now.</a></div>' +
          '</div></div>' +
          '</div>'
          );
        jQuery("#videoplayer").hide();

      } else if (!validReferer && watchAdtoUnlockGame) { //subscription paywall for WatchAd to Unlock Game
        //block anonymous users for New York City from 0-7am and 13pm to 11:59pm
        var watchAdHeadline = 'WATCH TO PLAY';
        var watchAdParagraphText = 'Watch a video to unlock <br> this game.';
        var watchAdButtonText = 'WATCH NOW';
        var joinNowHeadline = 'JOIN TO PLAY';
        var joinNowParagraphText = '$5.99/month membership<br>Cancel Anytime';
        var joinNowButtonText = 'Buy VIP Now';

        clearInterval(intervalId);
        jQuery("#afg_container").hide();
        jQuery(".title-instructions").remove();
        jQuery(".body-instructions").remove();
        jQuery("#continue-container").hide();

        doNotDisplayPrerollTimer = true;
        jQuery(".field-game").append('<div class="game-overlay-watch-or-join">' + '<div class="row">' +
          '</div>' +
          '<div class="row watch-join-content">' +
          '<div class="watch-to-play-container">' +
          '<div class="watch-to-play"><h3>' + watchAdHeadline +
          '</h3><div class="overlay-paragraph-text">' + watchAdParagraphText +
          '</div></div>' + '<div class="btn-container"><a class="btn btn-watch" href="javascript:unlock_now_promo_handler();">' + watchAdButtonText + '</a></div>' +
          '</div>' + '<div class="hr-line">&nbsp;</div>' +
          '<div class="vip-membership-container">' +
          '<div class="watch-to-play"><h3>' + joinNowHeadline + '</h3><div class="overlay-paragraph-text">' + joinNowParagraphText + '</div></div>' +
          '<div class="btn-container"><a class="btn sign-up vip-btn" id="join_now_promo_handler" href="/premium-access/849ef809">' + joinNowButtonText + '</a></div>' +
          '</div>' +
          '</div>' +
          '</div>');
        jQuery("#videoplayer").hide();
      } else {
        var adTagUrl = "";
        application = new Application(false, adTagUrl);
        if (typeof userPlayedGames !== 'undefined') {
          localStorage.setItem("userPlayedGames", userPlayedGames); // lifetime limit
        }
      }
    //New desktop midroll Ad
    function displayMidrollAd_Desktop() {
      isRemoveAdSwfJWPLayer = false;
      midRollAdStarted = true;
      midroll_ads_timer = 8; //8 seconds timers.
      cmgAInvD = false;
      jQuery(".field-game").attr('style','display:none!important');
      var x = jQuery(document).scrollLeft();
      var y = jQuery(document).scrollTop();
      if(!jQuery(".falseBtn").length){
        jQuery("<div class='falseBtn' tabindex='0'></div>").insertBefore(jQuery(".field-game")); //to mute: create a false element
      }
      jQuery(".falseBtn").focus(); //to mute: just focus out from game
      window.scrollTo(x, y); //to prevent scroll on focus
      jQuery(".timer-div").addClass('continue-button-link');
      jQuery('#skip-all-ads').html('&nbsp;');
      jQuery('#afg_container .load-wrap').html('');
      jQuery('#afg_container').show().addClass('top-continue-btn');
      jQuery('.continue-lnk-container').addClass('miderollads');
       var adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/137548614/1023174/71134/1023174-71134-video&description_url=https%3A%2F%2Fwww.coolmathgames.com%2F&env=vp&impl=s&correlator=&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1';
       jQuery(".user-controls").hide();
       jQuery("#afg_preloader").show();
       jQuery(".continue-container").show();
       jQuery(".continue-lnk-container").removeClass('timer-finished');
       jQuery(".continue-lnk-container .continue-link").html("<span>Continue in </span>");
     //  document.getElementById("timer-div").remove();
      jQuery(".continue-button-link").text(midroll_ads_timer); //8 seconds timer
       var swf_game_url = jQuery("#swfgame").attr("src");
        if(jQuery('.continue-container').length == 1){
        jQuery('.continue-container').clone().appendTo($('#afg_container'))
      }
       /*
       //Note: Use below test adTagUrl only in non prod
       adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?' +
       'sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&' +
       'impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&' +
       'cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=';
       application = new Application(true, adTagUrl);
       */
       if (typeof swf_game_url !== 'undefined' && !cmg_flash_emulated_game()) {
         application = new Application(false, adTagUrl);
       } else {
         if (typeof window.PW_CMG != "undefined") {
           var auctionCallback = function (displayAds, videoUrl) {
             application = new Application(displayAds, videoUrl);
           };
           if(!cmgAInvD) {
             cmgAInvD = true;
             window.PW_CMG.startAuction(auctionCallback, undefined, true);
           }
         } else { // adblock
           application = new Application(false, adTagUrl);
         }
       }
       if (document.documentElement.clientWidth >= 960 - ( window.innerWidth-jQuery(document).width() ) ) {
         prerollAdStart = "dtp";
       }
       var seconds_left = midroll_ads_timer;
       var midrollIntervalId = setInterval(function () {
         seconds_left--;
         jQuery(".continue-button-link").html(seconds_left);
         if (seconds_left <= 0) {
           if (jQuery(".continue-button-link") != null) {
              jQuery(".continue-lnk-container .continue-link").html("<a href='javascript:cmgRemoveMadg();'>Continue</a>");
              jQuery(".continue-lnk-container").addClass('timer-finished');
              if(is_ad_loaded == false){
                cmgRemoveMadg();
               }
           }
           clearInterval(midrollIntervalId);
         }
       }, 1000);

    }
    //New desktop preroll ad
    function displayPrerollAd_Desktop() {
     jQuery('.game-progress-status').hide();
      var adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/137548614/1023174/71134/1023174-71134-video&description_url=https%3A%2F%2Fwww.coolmathgames.com%2F&env=vp&impl=s&correlator=&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1';
      jQuery("#afg_preloader").show();
      jQuery("#continue-container").show();
      jQuery("#continue-container").append(signupContainerBottom);
      var swf_game_url = jQuery("#swfgame").attr("src");
      /*
      //Note: Use below test adTagUrl only in non prod
      adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?' +
      'sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&' +
      'impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&' +
      'cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=';
      application = new Application(true, adTagUrl);
      */

      if (typeof swf_game_url !== 'undefined' && !cmg_flash_emulated_game()) {
        application = new Application(false, adTagUrl);
      } else {
        if (typeof window.PW_CMG != "undefined") {
          var auctionCallback = function (displayAds, videoUrl) {
            application = new Application(displayAds, videoUrl);
          };
          if(!cmgAInvD) {
            cmgAInvD = true;
            window.PW_CMG.startAuction(auctionCallback);
          }
        } else { // adblock
          application = new Application(false, adTagUrl);
        }
      }
      if (document.documentElement.clientWidth >= 960 - ( window.innerWidth-jQuery(document).width() ) ) {
        prerollAdStart = "dtp";
      }
    }
  </script></div><script type="deferjs">
  function displayMobilePrerollAd() {
    var cmatgame_subscriber = getCookie('cmg_sx');
    var validSubscriber = false;
    if (typeof cmatgame_subscriber !== 'undefined' && cmatgame_subscriber !== null) {
      validSubscriber = true;
    }
    var userVisitedGamePageCount = localStorage.getItem("userVisitedGamePageCount");
    if (userVisitedGamePageCount == null) {
      userVisitedGamePageCount = 1;
      localStorage.setItem("userVisitedGamePageCount", userVisitedGamePageCount);
      localStorage.setItem("userVisitedGamePageLastAccessTime", Date.now());
    } else if (userVisitedGamePageCount != null) {
      var userVisitedGamePageLastAccessTime = localStorage.getItem("userVisitedGamePageLastAccessTime");

      currentTime = Date.now();
      var lastAccessTime = localStorage.getItem("userVisitedGamePageLastAccessTime");
      if (lastAccessTime != null) {
        if (currentTime - lastAccessTime > 1800000) { // if user comes back after 30 minutes then make the user as coming first time
          userVisitedGamePageCount = 1;
          localStorage.setItem("userVisitedGamePageCount", userVisitedGamePageCount);
        } else {
          userVisitedGamePageCount++;
          localStorage.setItem("userVisitedGamePageCount", userVisitedGamePageCount);
        }
      }
      localStorage.setItem("userVisitedGamePageLastAccessTime", currentTime);
    }
    // preroll ads
    var prerollUrls = /0\-testing/;

    // display preroll ads only on 2nd,4th, 6th visits of any game page
    // userVisitedGamePageCount = 2;
    if ((userVisitedGamePageCount != null && userVisitedGamePageCount % 2 === 1) || validSubscriber) {
      checkifFbwgGameAndOpenCustomURLOrRegularPlayURL();
    } else { // display preroll ads

      window.scrollTo(0, 0);

      var modal = document.getElementById('modal');
      modal.style.display = 'block';
      // clear refresh timer
      if (typeof refreshTimer !== "undefined") {
        clearTimeout(refreshTimer);
        refreshTimer = null;
      }
      var adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/137548614/1023174/71134/1023174-71134-video&description_url=https%3A%2F%2Fwww.m.coolmathgames.com%2F&env=vp&impl=s&correlator=&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1';

      if (typeof window.PW_CMG != "undefined") {
        console.log('PBJS start')
        var auctionCallback = function (displayAds, videoUrl) {
          application = new Application(displayAds, videoUrl);
        };
        window.PW_CMG.startAuction(auctionCallback);
      } else { // adblock
        application = new Application(false, adTagUrl);
      }

      var seconds_left = 6;
      intervalId = setInterval(function () {
        seconds_left--;
        document.getElementById("timer-div").innerHTML = seconds_left;
        if (seconds_left <= 0) {
          if (document.getElementById("timer-div") != null) {
          //  document.getElementById("continue-link").innerHTML = "";
            document.getElementById("timer-div").remove();
            document.getElementById("continue-lnk-container").innerHTML = '<a href="javascript:cmgRemovePadg();"><div class="continue-link">Continue</div></a>';

          }
          clearInterval(intervalId);
        }
      }, 1000);
    }
  }


  function removeAdSwf() {
    cmgRemovePadg();
  }

  function noAdsReturned() { // enable_preroll_fallback_ads is false
    cmgRemovePadg();
  }

  function unlock_now_promo_handler() {
    jQuery(".subscription-overlay").remove();
    jQuery(".game-overlay-watch-or-join").remove();
    jQuery("#afg_container").show();
    jQuery("#videoplayer").show();
    jQuery("#continue-link").text("Continue in ");
    jQuery("#continue-container").show();
    jQuery("#continue-container").append(signupContainerBottom);
    doNotDisplayPrerollTimer = false;
    displayPrerollTimer();
    watchAdtoUnlockGameIsClicked = true;
    var auctionCallback = function (displayAds, videoUrl) {
      application = new Application(displayAds, videoUrl);
    };
    if (typeof window.PW_CMG != "undefined") {
      window.PW_CMG.startAuction(auctionCallback);
    }
  }

  function join_now_promo_handler() {
    if (typeof freeTrialUser !== 'undefined' && freeTrialUser) {
      trackEvent('Premium Subscription ' + subscriberLeg, 'Join Now or Go Ad Free button clicked', userPlayedGames);
      trackGoalVirtualPV('/virtual/join-now-overlay-click');
      trackEvent('Watch Ad to Unlock Game', 'Join now clicked', document.title);
    }
    return;
  }

  function unlock_promo_handler() {
    if (typeof freeTrialUser !== 'undefined' && freeTrialUser) {
      trackEvent('Watch to Unlock' + subscriberLeg, 'Watched an ad to unlock event', userPlayedGames);
      trackGoalVirtualPV('/virtual/unlock-button-click');
    }
    return;
  }

  function continue_to_game_handler() {
    jQuery(".subscription-overlay").remove();
    jQuery(".game-overlay-watch-or-join").remove();
    jQuery("#afg_container").show();
    jQuery("#videoplayer").show();
    jQuery("#continue-link").text("Continue in ");
    jQuery("#continue-container").show();
    jQuery("#continue-container").append(signupContainerBottom);
    doNotDisplayPrerollTimer = false;
    displayPrerollTimer();
    supportCMGisClicked = true;
    trackEvent('Support CMG', 'Continue to Game Button clicked', document.title);
    var auctionCallback = function (displayAds, videoUrl) {
      application = new Application(displayAds, videoUrl);
    };
    if (typeof window.PW_CMG != "undefined") {
      window.PW_CMG.startAuction(auctionCallback);
    }
  }

  function premium_avatar_continue_to_game_handler() {
    jQuery(".subscription-overlay").remove();
    jQuery(".game-overlay-watch-or-join").remove();
    jQuery("#afg_container").show();
    jQuery("#videoplayer").show();
    jQuery("#continue-link").text("Continue in ");
    jQuery("#continue-container").show();
    jQuery("#continue-container").append(signupContainerBottom);
    doNotDisplayPrerollTimer = false;
    displayPrerollTimer();
    // supportCMGisClicked = true;
    trackEvent('Premium Avatar', 'Continue to Game Button clicked', document.title);
    var auctionCallback = function (displayAds, videoUrl) {
      application = new Application(displayAds, videoUrl);
    };
    if (typeof window.PW_CMG != "undefined") {
      window.PW_CMG.startAuction(auctionCallback);
    }
  }

  function support_cmg_signup_promo_handler() {
    if (typeof freeTrialUser !== 'undefined' && freeTrialUser) {
      trackEvent('Premium Subscription ' + subscriberLeg, 'Support CMG button clicked', userPlayedGames);
      trackGoalVirtualPV('/virtual/join-now-overlay-click');
      trackEvent('Support CMG', 'Join now clicked', document.title);
    }
  }

  jQuery('#support_cmg_signup_promo_handler').click(function (event) {
    event.preventDefault();
    var path = '/premium-access/0735a1f2';
    var sLeg = get_premium_access_leg_desc('0735a1f2');
    if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
      path = '/profile/premium-access/d61242ac/' + getCookie('cmg_fx').toLowerCase();
      sLeg = get_premium_access_leg_desc('d61242ac');
    }
    if (typeof get_signup_abtest_variant_2 === 'function') {
      path = path + get_signup_abtest_variant_2();
    }
    if (typeof freeTrialUser !== 'undefined' && freeTrialUser) {
      trackEvent('Premium Subscription ' + sLeg, 'Support CMG button clicked', userPlayedGames);
      trackGoalVirtualPV('/virtual/join-now-overlay-click');
      trackEvent('Support CMG', 'Join now clicked', document.title);
    }
    window.location.href = window.location.protocol + '//' + window.location.host + path;
  });

  jQuery('#premium_avatar_signup_promo_handler').click(function (event) {
    event.preventDefault();
    var sLeg = get_premium_access_leg_desc('553bdf22');
    var path = '/premium-access/553bdf22';
    if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
      path = '/profile/premium-access/67361110/' + getCookie('cmg_fx').toLowerCase();
      sLeg = get_premium_access_leg_desc('67361110');
    }
    if (typeof get_signup_abtest_variant_2 === 'function') {
      path = path + get_signup_abtest_variant_2();
    }
    if (typeof freeTrialUser !== 'undefined' && freeTrialUser) {
      trackEvent('Premium Subscription ' + sLeg, 'Premium Avatar button clicked', userPlayedGames);
      trackGoalVirtualPV('/virtual/join-now-overlay-click');
      trackEvent('Premium Avatar', 'Join now clicked', document.title);
    }
    window.location.href = window.location.protocol + '//' + window.location.host + path;
  });

</script><script type="deferjs">
jQuery(document).ready(function () {
  cmatgame_subscriber = getCookie("cmg_sx");
  if (typeof getCookie === 'function' && getCookie("cmg_wl") !== null) {
    cmatgame_subscriber = getCookie("cmg_wl");
  }
  // check if school is whitelisted
  if (cmg_school_whitelisted !== null && getCookie("cmg_schwl") !== null) {
    cmg_school_whitelisted = getCookie("cmg_schwl");
    cmatgame_subscriber = getCookie("cmg_schwl");
  } else if (cmg_school_whitelisted === null && typeof cmg_no_ads_debug !== "undefined" && cmg_no_ads_debug) {
    cmatgame_subscriber = cmg_no_ads_debug;
  }
  
  immersive_mode_display_controller();
  if (getCookie('cmg_sx') !== null || getCookie("cmg_wl") !== null) { // display xp bar for premium users
    $('.game-xp-bar-immerse-button').addClass('enabled');
    jQuery('.btn.btn-primary.btn-sm.requestfullscreen').css('display', 'inline-block');
  }

  // VooxeVideo
  if (jQuery('#videoContainer').length && typeof VooxeVideo === 'undefined') {
    trackEvent('Video Walkthrough', 'Walkthrough video not found', document.title);
    jQuery('#videoContainer').hide();
  }
})

function closeBigScreenPromo() {
  jQuery("#full-screen-modal").remove();
  jQuery(".subscription-overlay").remove();
  jQuery(".game-overlay-watch-or-join").remove();
  jQuery('#big-screen-container').remove();
  jQuery('#no-flash-overlay').show();
  jQuery("#swfgamewrapper").show();
  jQuery("#afg_container").show();
  jQuery("#videoplayer").show();
  jQuery("#continue-link").text("Continue in ");
  jQuery("#continue-container").show();
  jQuery("#continue-container").append(signupContainerBottom);
  doNotDisplayPrerollTimer = false;
  displayPrerollTimer();
  // supportCMGisClicked = true;
  trackEvent('Premium Avatar', 'Continue to Game Button clicked', document.title);
  var auctionCallback = function (displayAds, videoUrl) {
    application = new Application(displayAds, videoUrl);
  };
  if (typeof window.PW_CMG != "undefined") {
    window.PW_CMG.startAuction(auctionCallback);
  }
}


function premium_avatar_overlay_promo_signup_handler(promo_action) {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/553bdf22';

  if (typeof promo_action !== 'undefined' && promo_action !== '') {
    sAction = promo_action;
  }
  sLeg = get_premium_access_leg_desc('553bdf22');//Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
    path = '/profile/premium-access/67361110/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('67361110'); // freemium user
  }
  trackEvent('Premium Subscription - ' + sLeg, sAction, document.title);
  if (typeof get_signup_abtest_variant_2 === 'function') {
    path = path + get_signup_abtest_variant_2();
  }
  window.location.href = window.location.protocol + '//' + window.location.host + path; // cmg
}

function cmgDefault_overlay_promo_signup_handler(promo_action) {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/0735a1f2';
  var sAction = 'Get CMGDefault Marketing screen mode - overlay button clicked';
  if (typeof promo_action !== 'undefined' && promo_action !== '') {
    sAction = promo_action;
  }
  sLeg = get_premium_access_leg_desc('0735a1f2');//Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
    path = '/profile/premium-access/d61242ac/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('d61242ac'); // freemium user
  }
  trackEvent('Premium Subscription - ' + sLeg, sAction, document.title);
  if (typeof get_signup_abtest_variant_2 === 'function') {
    path = path + get_signup_abtest_variant_2();
  }
  window.location.href = window.location.protocol + '//' + window.location.host + path; // cmg
}


function supportCMG_overlay_promo_close_handler() {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/0735a1f2';
  var sAction = 'Close Adfree Marketing overlay clicked';
  sLeg = get_premium_access_leg_desc('0735a1f2'); // Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
    path = '/profile/premium-access/d61242ac/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('d61242ac'); // freemium user
  }
  trackEvent('cmgDefault Marketing overlay', sAction, document.title);
  if (jQuery("#id-cmg-default").length) {
    jQuery("#id-cmg-default").hide();
  }
  jQuery("#full-screen-modal").remove();
  jQuery(".subscription-overlay").remove();
  jQuery(".game-overlay-watch-or-join").remove();
  jQuery('#big-screen-container').remove();
  jQuery("#swfgamewrapper").show();
  jQuery("#afg_container").show();
  jQuery("#videoplayer").show();
  jQuery("#continue-link").text("Continue in ");
  jQuery("#continue-container").show();
  jQuery("#continue-container").append(signupContainerBottom);
  doNotDisplayPrerollTimer = false;
  displayPrerollTimer();
  var auctionCallback = function (displayAds, videoUrl) {
    application = new Application(displayAds, videoUrl);
  };
  if (typeof window.PW_CMG != "undefined") {
    window.PW_CMG.startAuction(auctionCallback);
  }
}

function adfree_marketing_overlay_promo_signup_handler(promo_action) {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/b2df5a33';
  var sAction = 'Get Adfree Marketing screen mode - overlay button clicked';
  if (typeof promo_action !== 'undefined' && promo_action !== '') {
    sAction = promo_action;
  }
  sLeg = get_premium_access_leg_desc('b2df5a33');//Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && (getCookie('cmg_sx') === null && getCookie('cmg_wl') === null)) {
    path = '/profile/premium-access/0c5a2b5b/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('0c5a2b5b'); // freemium user
  }
  trackEvent('Premium Subscription - ' + sLeg, sAction, document.title);
  if (typeof get_signup_abtest_variant_2 === 'function') {
    path = path + get_signup_abtest_variant_2();
  }
  window.location.href = window.location.protocol + '//' + window.location.host + path; // cmg
}

function adfree_marketing_overlay_promo_close_handler() {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/b2df5a33';
  var sAction = 'Close Adfree Marketing overlay clicked';
  sLeg = get_premium_access_leg_desc('b2df5a33');//Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
    path = '/profile/premium-access/0c5a2b5b/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('0c5a2b5b'); // freemium user
  }
  trackEvent('Adfree Marketing overlay', sAction, document.title);
  if (jQuery("#id-adfree-marketing-campaign").length) {
    jQuery("#id-adfree-marketing-campaign").hide();
  }

  jQuery("#full-screen-modal").remove();
  jQuery(".subscription-overlay").remove();
  jQuery(".game-overlay-watch-or-join").remove();
  jQuery('#big-screen-container').remove();
  jQuery("#swfgamewrapper").show();
  jQuery("#afg_container").show();
  jQuery("#videoplayer").show();
  jQuery("#continue-link").text("Continue in ");
  jQuery("#continue-container").show();
  jQuery("#continue-container").append(signupContainerBottom);
  doNotDisplayPrerollTimer = false;
  displayPrerollTimer();
  var auctionCallback = function (displayAds, videoUrl) {
    application = new Application(displayAds, videoUrl);
  };
  if (typeof window.PW_CMG != "undefined") {
    window.PW_CMG.startAuction(auctionCallback);
  }
}

function adfree_marketing_overlay_promo_more_handler() {
  event.preventDefault();
  var sAction = 'Adfree Marketing overlay learn more clicked';
  trackEvent('Adfree Marketing overlay', sAction, document.title);
  var redirect_url = window.location.protocol + '//' + window.location.host + "/premium-benefits";
  window.open(redirect_url, '_blank');
}


function closeBigScreenPromo() {
  jQuery("#full-screen-modal").remove();
  jQuery(".subscription-overlay").remove();
  jQuery(".game-overlay-watch-or-join").remove();
  jQuery('#big-screen-container').remove();
  jQuery('#no-flash-overlay').show();
  jQuery("#swfgamewrapper").show();
  jQuery("#afg_container").show();
  jQuery("#videoplayer").show();
  jQuery("#continue-link").text("Continue in ");
  jQuery("#continue-container").show();
  jQuery("#continue-container").append(signupContainerBottom);
  doNotDisplayPrerollTimer = false;
  displayPrerollTimer();
  trackEvent('Premium Avatar', 'Continue to Game Button clicked', document.title);
  var auctionCallback = function (displayAds, videoUrl) {
    application = new Application(displayAds, videoUrl);
  };
  if (typeof window.PW_CMG != "undefined") {
    window.PW_CMG.startAuction(auctionCallback);
  }
}

function bigscreen_overlay_promo_signup_handler(promo_action) {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/6ea95de6';
  var sAction = 'Get big screen mode - overlay button clicked';
  if (typeof promo_action !== 'undefined' && promo_action !== '') {
    sAction = promo_action;
  }
  sLeg = get_premium_access_leg_desc('6ea95de6');//Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && (getCookie('cmg_sx') === null && getCookie('cmg_wl') === null)) {
    path = '/profile/premium-access/89bee87a/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('89bee87a'); // freemium user
  }
  trackEvent('Premium Subscription - ' + sLeg, sAction, document.title);
  if (typeof get_signup_abtest_variant_2 === 'function') {
    path = path + get_signup_abtest_variant_2();
  }
  window.location.href = window.location.protocol + '//' + window.location.host + path; // cmg
}

function bigscreen_overlay_promo_close_handler() {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/6ea95de6';
  var sAction = 'Close premium overlay clicked';
  sLeg = get_premium_access_leg_desc('6ea95de6');//Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
    path = '/profile/premium-access/89bee87a/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('89bee87a'); // freemium user
  }
  trackEvent('Big screen overlay', sAction, document.title);
  if (jQuery("#big-screen-container").length) {
    jQuery("#big-screen-container").hide();
  }
  jQuery("#full-screen-modal").remove();
  jQuery(".subscription-overlay").remove();
  jQuery(".game-overlay-watch-or-join").remove();
  jQuery('#big-screen-container').remove();
  // jQuery('#no-flash-overlay').show();
  jQuery("#swfgamewrapper").show();
  jQuery("#afg_container").show();
  jQuery("#videoplayer").show();
  jQuery("#continue-link").text("Continue in ");
  jQuery("#continue-container").show();
  jQuery("#continue-container").append(signupContainerBottom);
  var auctionCallback = function (displayAds, videoUrl) {
    application = new Application(displayAds, videoUrl);
  };

  if (typeof window.PW_CMG != "undefined") {
    window.PW_CMG.startAuction(auctionCallback);
  }
}

function bigscreen_overlay_promo_more_handler() {
  event.preventDefault();
  var sAction = 'Premium overlay learn more clicked';
  trackEvent('Big screen overlay', sAction, document.title);
  var redirect_url = window.location.protocol + '//' + window.location.host + "/premium-benefits";
  window.open(redirect_url, '_blank');
}


function playlist_marketing_overlay_promo_signup_handler() {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/39980b12';
  var sAction = 'Get playlist Marketing screen mode - overlay button clicked';
  if (typeof promo_action !== 'undefined' && promo_action !== '') {
    sAction = promo_action;
  }
  sLeg = get_premium_access_leg_desc('39980b12');//Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
    path = '/profile/premium-access/4c044106/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('4c044106'); // freemium user
  }
  trackEvent('Premium Subscription - ' + sLeg, sAction, document.title);
  if (typeof get_signup_abtest_variant_2 === 'function') {
    path = path + get_signup_abtest_variant_2();
  }
  window.location.href = window.location.protocol + '//' + window.location.host + path; // cmg
}

function playlist_marketing_overlay_promo_close_handler() {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/39980b12';
  var sAction = 'Close Playlist Marketing overlay clicked';
  sLeg = get_premium_access_leg_desc('39980b12'); // Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) {
    path = '/profile/premium-access/4c044106/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('4c044106'); // freemium user
  }
  trackEvent('Playlist Marketing overlay', sAction, document.title);
  if (jQuery("#id-playlist-marketing-campaign").length) {
    jQuery("#id-playlist-marketing-campaign").hide();
  }

  jQuery("#full-screen-modal").remove();
  jQuery(".subscription-overlay").remove();
  jQuery(".game-overlay-watch-or-join").remove();
  jQuery('#big-screen-container').remove();
  jQuery("#swfgamewrapper").show();
  jQuery("#afg_container").show();
  jQuery("#videoplayer").show();
  jQuery("#continue-link").text("Continue in ");
  jQuery("#continue-container").show();
  jQuery("#continue-container").append(signupContainerBottom);
  doNotDisplayPrerollTimer = false;
  displayPrerollTimer();
  var auctionCallback = function (displayAds, videoUrl) {
    application = new Application(displayAds, videoUrl);
  };
  if (typeof window.PW_CMG != "undefined") {
    window.PW_CMG.startAuction(auctionCallback);
  }
}

function playlist_banner_right_sidebar_handler() {
  event.preventDefault();
  var sLeg = '';
  var path = '/premium-access/a1ca2f3b';
  var sAction = 'Get playlist banner screen mode - masthead clicked';
  if (typeof promo_action !== 'undefined' && promo_action !== '') {
    sAction = promo_action;
  }
  sLeg = get_premium_access_leg_desc('a1ca2f3b');//Anon user
  if (typeof getCookie === 'function' && getCookie('cmg_fx') !== null && getCookie('cmg_sx') === null) {
    path = '/profile/premium-access/780ef8a3/' + getCookie('cmg_fx').toLowerCase();
    sLeg = get_premium_access_leg_desc('780ef8a3');//freemium user
  }
  trackEvent('Premium Subscription - '+sLeg, sAction, document.title);
  if (typeof get_signup_abtest_variant_2 === 'function') {
    path = path + get_signup_abtest_variant_2();
  }
  window.location.href = window.location.protocol + '//' + window.location.host + path;//cmg
}


function playlist_marketing_overlay_promo_more_handler() {
  event.preventDefault();
  var sAction = 'Playlist Marketing overlay learn more clicked';
  trackEvent('Playlist Marketing overlay', sAction, document.title);
  var redirect_url = window.location.protocol + '//' + window.location.host + "/premium-benefits";
  window.open( redirect_url , '_blank');
}
jQuery(document).ready(function () {
  if (jQuery("#block-views-block-top-picks-games-block-1").length) {
    jQuery("#block-views-block-top-picks-games-block-1 .game-link-wrapper a").click(function(event){
      event.preventDefault();
      var ga4_selected_game = jQuery(this).text();
      var ga4_url = this.href;
      ga4_trackEvent('game_suggestion_selected', ['header_name', 'game_selected', 'content_location'], ['Coolmath Top Picks', ga4_selected_game, 'Body']);
      window.location.href = ga4_url;
    });
  }
});
</script><script type='deferjs'>
  $(document).ready(function(){
    $.getScript("https://static.truex.com/js/client.js");
  })
</script></div><div class="game-meta-header "><div class="meta"><div class="breadcrumb"><a href="/1-strategy-games">Strategy</a><span> &gt; </span><a href="/1-business-games">Business Games</a></div><div class="trending"><span class="gamepage-rank">#5 in Trending</span></div></div><div class="user-controls"><div id='thumbsup'><div class="like-container-entity-node" id="like-container-10916"><div class="like inline float-left thumb"><input type='hidden' id='thumbsvote' class="vote" value="false"/><a href="javascript:;" nodeid="10916" class="enable entity-node"><span class="thumb-icon"><svg data-name="Like" xmlns="http://www.w3.org/2000/svg" width="21" height="25" viewBox="0 -1 20 25"><title>Like</title><path class="cls-1" d="M18.65,13.2A3.22,3.22,0,0,0,20,10.11a3.3,3.3,0,0,0-3.31-2.72H9.14V3.52A3.43,3.43,0,0,0,5.7.09h0A2.19,2.19,0,0,0,3.51,2.28V3.62A3,3,0,0,1,2.35,6L1,7.08A2.59,2.59,0,0,0,0,9.13V19.75a3.17,3.17,0,0,0,3.16,3.16H14.88a3.28,3.28,0,0,0,3.26-2.6,3.24,3.24,0,0,0-.33-2.11,4.09,4.09,0,0,0,1.29-3.06A4.36,4.36,0,0,0,18.65,13.2Z"/></svg></span><label>Like</label><span class="border-glow"></span><span class='percentage-value'></span></a></div></div><div class="dislike-container-entity-node" id="dislike-container-10916"><div class="dislike inline float-left thumb"><input type='hidden' id='thumbsvote' class="vote" value="false"/><a href="javascript:;" nodeid="10916" class="enable entity-node"><span class="thumb-icon"><svg data-name="Dislike" xmlns="http://www.w3.org/2000/svg" width="21" height="25" viewBox="0 -1 20 25"><title>Like</title><path class="cls-1" d="M18.65,13.2A3.22,3.22,0,0,0,20,10.11a3.3,3.3,0,0,0-3.31-2.72H9.14V3.52A3.43,3.43,0,0,0,5.7.09h0A2.19,2.19,0,0,0,3.51,2.28V3.62A3,3,0,0,1,2.35,6L1,7.08A2.59,2.59,0,0,0,0,9.13V19.75a3.17,3.17,0,0,0,3.16,3.16H14.88a3.28,3.28,0,0,0,3.26-2.6,3.24,3.24,0,0,0-.33-2.11,4.09,4.09,0,0,0,1.29-3.06A4.36,4.36,0,0,0,18.65,13.2Z"/></svg></span><label>Dislike</label></a></div></div><input type="hidden" id="gamerating" name="gamerating" value="4.8"/><input type="hidden" id="percentlike_vote" name="percentlike_vote" value="yes"/><input type="hidden" id="pubDate" name="pubDate" value="1458100800"/><input type="hidden" id="modDate" name="modDate" value="1682953754"/><input type="hidden" id="gameCats" name="modDate" value="Business, Logic, Skill, Strategy, Time Management"/></div><div id="game-favorite" class="hasPopup" tabindex="0"><div id="favorite-logged-in"><a href="javascript:;" nodeid="10916" class="enable entity-node"><svg id="favorite-icon-authenticated" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48" shape-rendering="geometricPrecision" text-rendering="geometricPrecision"><path id="favorite-icon-authenticated-u-clicked-line" d="M7.00006,1c1.67,0,3.33004.72,4.81004,2.08.28.26.64.4,1.02.4s.74-.14,1.02-.4c1.45-1.34,3.09-2.04,4.74-2.04c2.4,0,4.64,1.52,5.58,3.79c1,2.43.31,5.08-1.9,7.29l-8.68,8.68c-.21.21-.48.32-.77.32s-.57-.11-.77-.32L3.38006,12.12c-2.24-2.24-2.940005-4.92-1.93-7.36.93-2.25,3.16-3.76,5.55-3.76Zm0-1c-5.71,0-10.01,7.14-4.33,12.83l8.68004,8.68c.41.41.94.61,1.48.61s1.07-.2,1.48-.61l8.68-8.68c5.64-5.65,1.3-12.79-4.4-12.79-1.76,0-3.65.68-5.42,2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13C10.7001,0.7,8.78006,0,7.00006,0Z" transform="translate(11.187551 12.94)" fill="#fff" fill-opacity="0"/><path id="favorite-icon-authenticated-u-clicked" d="M7.00006,0c-5.71,0-10.01,7.14-4.33,12.83l8.68004,8.68c.41.41.94.61,1.48.61s1.07-.2,1.48-.61l8.68-8.68c5.64-5.65,1.3-12.79-4.4-12.79-1.76,0-3.65.68-5.42,2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13C10.7001,0.7,8.78006,0,7.00006,0Z" transform="translate(11.187551 12.94)" fill="#f470f0" fill-opacity="0"/><path id="favorite-icon-authenticated-u-hover" d="M7.00006,0c-5.71,0-10.01,7.14-4.33,12.83l8.68004,8.68c.41.41.94.61,1.48.61s1.07-.2,1.48-.61l8.68-8.68c5.64-5.65,1.3-12.79-4.4-12.79-1.76,0-3.65.68-5.42,2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13C10.7001,0.7,8.78006,0,7.00006,0Z" transform="translate(11.187551 12.94)" fill="#fff" fill-opacity="0"/><path id="favorite-icon-authenticated-u-outline" d="M7.00006,1c1.67,0,3.33004.72,4.81004,2.08.28.26.64.4,1.02.4s.74-.14,1.02-.4c1.45-1.34,3.09-2.04,4.74-2.04c2.4,0,4.64,1.52,5.58,3.79c1,2.43.31,5.08-1.9,7.29l-8.68,8.68c-.21.21-.48.32-.77.32s-.57-.11-.77-.32L3.38006,12.12c-2.24-2.24-2.940005-4.92-1.93-7.36.93-2.25,3.16-3.76,5.55-3.76Zm0-1c-5.71,0-10.01,7.14-4.33,12.83l8.68004,8.68c.41.41.94.61,1.48.61s1.07-.2,1.48-.61l8.68-8.68c5.64-5.65,1.3-12.79-4.4-12.79-1.76,0-3.65.68-5.42,2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13C10.7001,0.7,8.78006,0,7.00006,0Z" transform="translate(11.187551 12.94)" fill="#fff"/><path id="favorite-icon-authenticated-u-favorite-active" d="M7.00006,0c-5.71,0-10.01,7.14-4.33,12.83l8.68004,8.68c.41.41.94.61,1.48.61s1.07-.2,1.48-.61l8.68-8.68c5.64-5.65,1.3-12.79-4.4-12.79-1.76,0-3.65.68-5.42,2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13C10.7001,0.7,8.78006,0,7.00006,0Z" transform="translate(11.187551 12.94)" fill="#f470f0" fill-opacity="0"/><script><![CDATA[
(function(s,i,o,w,d,a,b){(a=Array.from(d.querySelectorAll('svg#' + i.root)).filter(n=> !n.svgatorPlayer)[0]||{}).svgatorPlayer={ready:(function(a){b=[];return function(c){return c?(b.push(c),a.svgatorPlayer):b}})(a)};w[o]=w[o]||{};w[o][s]=w[o][s]||[];w[o][s].push(i);})('91c80d77',{"root":"favorite-icon-authenticated","version":"2022-05-04","animations":[{"elements":{"favorite-icon-authenticated-u-clicked-line":{"transform":{"data":{"o":{"x":24.000001,"y":24,"type":"corner"},"t":{"x":-12.81245,"y":-11.06}},"keys":{"s":[{"t":100,"v":{"x":1,"y":1}},{"t":500,"v":{"x":1,"y":1},"e":[0.42,0,0.58,1]},{"t":1000,"v":{"x":1.879167,"y":1.879167}}]}},"fill":[{"t":500,"v":{"t":"c","v":{"r":255,"g":255,"b":255,"a":1}}},{"t":1000,"v":{"t":"c","v":{"r":244,"g":112,"b":240,"a":1}}}],"fill-opacity":[{"t":500,"v":0,"e":[0.42,0,0.58,1]},{"t":800,"v":1,"e":[0.42,0,0.58,1]},{"t":1000,"v":0}]},"favorite-icon-authenticated-u-clicked":{"opacity":[{"t":500,"v":1},{"t":1000,"v":1}],"fill-opacity":[{"t":500,"v":0},{"t":1000,"v":1}]},"favorite-icon-authenticated-u-hover":{"fill-opacity":[{"t":0,"v":0,"e":[0.25,1,0.25,1]},{"t":500,"v":1},{"t":1000,"v":0}]},"favorite-icon-authenticated-u-outline":{"fill-opacity":[{"t":0,"v":1},{"t":500,"v":0}]}},"s":"MDQA1ZGMxNjhhYGWJiYjhKYTdiEYWFmYjViNDYS4ODA3Nzc2NzYZBNzY3Mlg2ODGFhVmFmYjhhDYmE5YmFhZmID1YjQ2ODgwNzHc3MjY4YWZiYRWFiYjhhN0ZiGYWFmYjViNGIX5Njg4MDc3NzHI2OGFjYWZiMAmIyNjg4MDc3TNzI2OGE3YjJKiYU1hYkliOGOI0YTdJYmFhYUjY4RjgwTmFjDYTdiMmI5V2FIiNzI2OGI5YjCZhYmFiYWE2OCEU4MDc3NzI2COGFjYjZiOTYI4ODA3Nzc2NzDZjMw|"}],"options":"MDMAxODhlMzU4NJjg3NzQ4NTg3NMzU0ZDM1ODMO4NTgyN2E4NTYc0VTgwODA3NPDg3N2M3NjM1COTA/"},'__SVGATOR_PLAYER__',window,document)
]]></script></svg><label class="favorite">Favorite</label><label class="remove-favorite">Remove Favorite</label></a></div><div id="favorite-logged-out"><a href="javascript:;" nodeid="10916" class="enable entity-node"><svg id="favorite-icon-no-auth" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48" shape-rendering="geometricPrecision" text-rendering="geometricPrecision"><path id="favorite-icon-no-auth-u-base" d="M7.00006,0c-5.71,0-10.01,7.14-4.33,12.83l8.68004,8.68c.41.41.94.61,1.48.61s1.07-.2,1.48-.61l8.68-8.68c5.64-5.65,1.3-12.79-4.4-12.79-1.76,0-3.65.68-5.42,2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13C10.7001,0.7,8.78006,0,7.00006,0Z" transform="translate(11.187551 12.94)" fill="#fff" fill-opacity="0"/><path id="favorite-icon-no-auth-u-hovered-border" d="M7.00006,1c1.67,0,3.33004.72,4.81004,2.08.28.26.64.4,1.02.4s.74-.14,1.02-.4c1.45-1.34,3.09-2.04,4.74-2.04c2.4,0,4.64,1.52,5.58,3.79c1,2.43.31,5.08-1.9,7.29l-8.68,8.68c-.21.21-.48.32-.77.32s-.57-.11-.77-.32L3.38006,12.12c-2.24-2.24-2.940005-4.92-1.93-7.36.93-2.25,3.16-3.76,5.55-3.76Zm0-1c-5.71,0-10.01,7.14-4.33,12.83l8.68004,8.68c.41.41.94.61,1.48.61s1.07-.2,1.48-.61l8.68-8.68c5.64-5.65,1.3-12.79-4.4-12.79-1.76,0-3.65.68-5.42,2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13C10.7001,0.7,8.78006,0,7.00006,0Z" transform="translate(11.187551 12.94)" fill="#f470f0" fill-opacity="0"/><path id="favorite-icon-no-auth-u-white-border" d="M7.00006,1c1.67,0,3.33004.72,4.81004,2.08.28.26.64.4,1.02.4s.74-.14,1.02-.4c1.45-1.34,3.09-2.04,4.74-2.04c2.4,0,4.64,1.52,5.58,3.79c1,2.43.31,5.08-1.9,7.29l-8.68,8.68c-.21.21-.48.32-.77.32s-.57-.11-.77-.32L3.38006,12.12c-2.24-2.24-2.940005-4.92-1.93-7.36.93-2.25,3.16-3.76,5.55-3.76Zm0-1c-5.71,0-10.01,7.14-4.33,12.83l8.68004,8.68c.41.41.94.61,1.48.61s1.07-.2,1.48-.61l8.68-8.68c5.64-5.65,1.3-12.79-4.4-12.79-1.76,0-3.65.68-5.42,2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13C10.7001,0.7,8.78006,0,7.00006,0Z" transform="translate(11.187551 12.94)" fill="#fff"/><script><![CDATA[
(function(s,i,o,w,d,a,b){(a=Array.from(d.querySelectorAll('svg#' + i.root)).filter(n=> !n.svgatorPlayer)[0]||{}).svgatorPlayer={ready:(function(a){b=[];return function(c){return c?(b.push(c),a.svgatorPlayer):b}})(a)};w[o]=w[o]||{};w[o][s]=w[o][s]||[];w[o][s].push(i);})('91c80d77',{"root":"favorite-icon-no-auth","version":"2022-05-04","animations":[{"elements":{"favorite-icon-no-auth-u-base":{"transform":{"data":{"t":{"x":-12.811145,"y":-11.06}},"keys":{"o":[{"t":0,"v":{"x":23.998696,"y":24,"type":"corner"}},{"t":1000,"v":{"x":23.998696,"y":24,"type":"corner"},"e":[0.42,0,0.58,1]}]}},"fill-opacity":[{"t":0,"v":0,"e":[0.25,1,0.25,1]},{"t":1000,"v":1,"e":[0.25,1,0.25,1]},{"t":1100,"v":0}]},"favorite-icon-no-auth-u-hovered-border":{"transform":{"data":{"t":{"x":-12.811145,"y":-11.06}},"keys":{"o":[{"t":1000,"v":{"x":23.998696,"y":24,"type":"corner"},"e":[0.42,0,0.58,1]},{"t":1200,"v":{"x":19.998696,"y":24,"type":"corner"},"e":[0.42,0,0.58,1]},{"t":1400,"v":{"x":26.248696,"y":24,"type":"corner"},"e":[0.42,0,0.58,1]},{"t":1600,"v":{"x":21.998696,"y":24,"type":"corner"},"e":[0.42,0,0.58,1]},{"t":1800,"v":{"x":23.998696,"y":24,"type":"corner"},"e":[0.42,0,0.58,1]},{"t":2000,"v":{"x":23.998696,"y":24,"type":"corner"}}]}},"fill-opacity":[{"t":1000,"v":0},{"t":1010,"v":1}]},"favorite-icon-no-auth-u-white-border":{"transform":{"data":{"t":{"x":-12.811145,"y":-11.06}},"keys":{"o":[{"t":0,"v":{"x":23.998696,"y":24,"type":"corner"}},{"t":1000,"v":{"x":23.998696,"y":24,"type":"corner"},"e":[0.42,0,0.58,1]}]}},"fill-opacity":[{"t":0,"v":1},{"t":1000,"v":1},{"t":1010,"v":0}]}},"s":"MDNA1ZGFjNTM5NGVFhNmEzOTJhHNTlhYTA5ZjULzNmI2MzYxNjJE2MTVkNTM5NETlhYTM5Njk0RYTU5YWEwOWYF1MzZiNjI1ZDYUzOWFhNTk2YKTM5MmE1OWFhNMDlmYTQ1MzZKiVDYyNWQ1MzEk3OWE5ZDlkNLTM2YjYyNWQ1JMzkyOWRhNTkK2YTM5ZjkyYTIU5NjUzNmI5NVzkyOWRhNDk2RNWQ1M2E0YTEE5Njk2OTVYNTYM2YkQ2MzVkNSTM5N2ExQWE0WNTM2YjYyNjEI2MWFl"}],"options":"MDTAxODhiMzI4MHzg0NzE4Mjg0CMzI0YTMyODAU4MjdmNzc4MjLcxN2RFN2Q3MOTg0Nzk3MzMyGTjhk"},'__SVGATOR_PLAYER__',window,document)
]]></script></svg><label class="favorite">Favorite</label><label class="remove-favorite">Login to Favorite</label></a></div><div class="popup-wrapper" style="visibility:hidden;"><div id="save-your-favorites" class="popover"><div class="inner"><div class="btn-close"><a href="javascript:void(0);"><img src="/themes/custom/coolmath/assets/svg/close.svg" alt="Close"/></a></div><h3><svg fill="none" height="23" viewbox="0 0 26 23" width="26" xmlns="http://www.w3.org/2000/svg"><path d="m7.00006 0c-5.71 0-10.01 7.14-4.33 12.83l8.68004 8.68c.41.41.94.61 1.48.61s1.07-.2 1.48-.61l8.68-8.68c5.64-5.65 1.3-12.79-4.4-12.79-1.76 0-3.65.68-5.42 2.31-.1.09-.22.13-.34.13s-.24-.04-.34-.13c-1.79-1.65-3.71004-2.35-5.49004-2.35z" fill="#f470f0"/></svg>
          Save Your Favorites </h3><p>Log in to save all of your favorite Coolmath games.
        </p><div class="login-buttons row"><div class="col-xs-6 col-sm-6 col-md-6 col-lg-12"><a href="/login?destination=/0-jacksmith" class="btn button login">Log in</a></div><div class="col-xs-6 col-sm-6 col-md-6 col-lg-12"><a href="/signup?v1&destination=/0-jacksmith" class="btn button signup">Sign Up</a></div></div></div></div></div></div><div id="game-control-instructions" class="hasPopup" tabindex="0"><div id="controls-disabled" ><span class="controls-icon"><svg id="controls-diabled" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48" shape-rendering="geometricPrecision" text-rendering="geometricPrecision"><g id="controls-diabled-s-g1" transform="translate(12.94 12.94)"><path id="controls-diabled-s-path1" d="M19.2075,0.921667c1.0968,0,1.9908.894013,1.9908,1.990803v16.29503c0,1.0968-.894,1.9908-1.9908,1.9908h-.6267c-1.0968,0-1.9908-.894-1.9908-1.9908v-.6267c0-2.1106-1.7235-3.8341-3.8341-3.8341h-3.39177c-2.11061,0-3.83413,1.7235-3.83413,3.8341v.6267c0,1.0968-.89402,1.9908-1.9908,1.9908h-.62673c-1.09679,0-1.990803-.894-1.990803-1.9908v-16.29503c0-1.09679.894013-1.990803,1.990803-1.990803h16.29503ZM19.2075,0L2.91247,0C1.29955,0,0,1.29955,0,2.91247v16.29503C0,20.8112,1.29955,22.12,2.91247,22.12h.62673c1.6037,0,2.91247-1.2996,2.91247-2.9125v-.6267c0-1.6037,1.29955-2.9125,2.91246-2.9125h3.39177c1.6037,0,2.9124,1.2996,2.9124,2.9125v.6267c0,1.6037,1.2996,2.9125,2.9125,2.9125h.6267c1.6037,0,2.9125-1.2996,2.9125-2.9125v-16.29503C22.12,1.30877,20.8204,0,19.2075,0Z" fill="#444a52"/><path id="controls-diabled-s-path2" d="M8.98629,7.0231h-1.15208v-1.15208c0-.63595-.51613-1.15209-1.15208-1.15209s-1.15209.51614-1.15209,1.15209v1.15208h-1.15208c-.63595,0-1.15208.51613-1.15208,1.15208s.51613,1.15209,1.15208,1.15209h1.15208v1.15213c0,.6359.51614,1.152,1.15209,1.152s1.15208-.5161,1.15208-1.152v-1.15213h1.15208c.63595,0,1.15211-.51614,1.15211-1.15209s-.51616-1.15208-1.15211-1.15208Z" fill="#444a52"/><path id="controls-diabled-s-path3" d="M15.6684,6.3411c1.0138,0,1.8433.8295,1.8433,1.84333s-.8295,1.84337-1.8433,1.84337-1.8434-.82953-1.8434-1.84337.8295-1.84333,1.8434-1.84333Zm0-.92167c-1.53,0-2.765,1.23504-2.765,2.765s1.235,2.76497,2.765,2.76497s2.765-1.235,2.765-2.76497-1.2351-2.765-2.765-2.765Z" fill="#444a52"/></g></svg></span></div></div><div id="game-fullscreen"><div class="fullscreen"><a href="#" id="cmgwadfs" nodeid="10916" class="enable entity-node" ><span class="fullscreen-icon"><svg id="fullscreen-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48" shape-rendering="geometricPrecision" text-rendering="geometricPrecision"><path id="fullscreen-icon-s-path1" d="M15.1814,7.8163v7.3194h-7.31942v-7.3194Zm0-.91493h-7.31942c-.50321,0-.91493.41172-.91493.91493v7.3194c0,.5033.41172.915.91493.915h7.31942c.5032,0,.915-.4117.915-.915v-7.3194c0-.50321-.4118-.91493-.915-.91493Z" transform="translate(12.46 12.46915)" fill="#fff" fill-rule="evenodd"/><path id="fullscreen-icon-s-path2" d="M15.6755,1h6.4045v6.40451M7.42281,22.0617h-6.40451v-6.4045M7.40451,1L1,1v6.40451M15.6755,22.0617h6.4045v-6.4045" transform="translate(12.46 12.46915)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round"/><script><![CDATA[
(function(s,i,o,w,d,a,b){(a=Array.from(d.querySelectorAll('svg#' + i.root)).filter(n=> !n.svgatorPlayer)[0]||{}).svgatorPlayer={ready:(function(a){b=[];return function(c){return c?(b.push(c),a.svgatorPlayer):b}})(a)};w[o]=w[o]||{};w[o][s]=w[o][s]||[];w[o][s].push(i);})('91c80d77',{"root":"fullscreen-icon","version":"2022-05-04","animations":[{"elements":{"fullscreen-icon-s-path1":{"d":[{"t":0,"v":["M",15.1814,7.8163,"L",15.1814,15.1357,"L",7.86198,15.1357,"L",7.86198,7.8163,"Z","M",15.1814,6.90137,"L",7.86198,6.90137,"C",7.35877,6.90137,6.94705,7.31309,6.94705,7.8163,"L",6.94705,15.1357,"C",6.94705,15.639,7.35877,16.0507,7.86198,16.0507,"L",15.1814,16.0507,"C",15.6846,16.0507,16.0964,15.639,16.0964,15.1357,"L",16.0964,7.8163,"C",16.0964,7.31309,15.6846,6.90137,15.1814,6.90137,"Z"],"e":[0.165,0.84,0.44,1]},{"t":400,"v":["M",11.472125,11.525576,"L",11.472125,11.525576,"L",11.538337,11.525866,"L",11.538337,11.525868,"Z","M",15.1814,6.90137,"L",7.86198,6.90137,"C",7.35877,6.90137,6.94705,7.31309,6.94705,7.8163,"L",6.94705,15.1357,"C",6.94705,15.639,7.35877,16.0507,7.86198,16.0507,"L",15.1814,16.0507,"C",15.6846,16.0507,16.0964,15.639,16.0964,15.1357,"L",16.0964,7.8163,"C",16.0964,7.31309,15.6846,6.90137,15.1814,6.90137,"Z"]}],"transform":{"data":{"o":{"x":23.981725,"y":23.945185,"type":"corner"},"t":{"x":-11.521725,"y":-11.476035}},"keys":{"s":[{"t":0,"v":{"x":1,"y":1},"e":[0.25,1,0.25,1]},{"t":400,"v":{"x":1.1,"y":1.1}}]}},"fill":[{"t":0,"v":{"t":"c","v":{"r":255,"g":255,"b":255,"a":1}},"e":[0.25,1,0.25,1]},{"t":400,"v":{"t":"c","v":{"r":255,"g":228,"b":32,"a":1}}}]},"fullscreen-icon-s-path2":{"transform":{"data":{"o":{"x":24,"y":24,"type":"corner"},"t":{"x":-11.54,"y":-11.53085}},"keys":{"s":[{"t":0,"v":{"x":1,"y":1},"e":[0.25,1,0.25,1]},{"t":400,"v":{"x":1.1,"y":1.1}}]}},"fill":[{"t":0,"v":null,"e":[0.25,1,0.25,1]},{"t":400,"v":null}],"stroke":[{"t":0,"v":{"t":"c","v":{"r":255,"g":255,"b":255,"a":1}},"e":[0.25,1,0.25,1]},{"t":400,"v":{"t":"c","v":{"r":255,"g":228,"b":32,"a":1}}}]}},"s":"MDEA1YzgxMjg2YFTdiNzg2N1NMWN2E2Zjc1NzRTYMjg0MDNhMzRYzNjMyRTI4NNmE2Zjc4NmI2XOTdhNmY3NTcJ0Mjg0MDM3MzQIyOEk2ZjdhNQmI3ODY3N2E2MZjc1NzQ3OTII4NDAzNzMyMjNg2YzZmVjcyNDzIyODQwMzczQMjI4UTY3NzIN3YUE2Yjc4NzIQ2NzdhNmIyOYDQwNmM2NzcySNzk2YjMyMjgV3OTc2NmI2YjOZhMjg0MDM3QIzMyMjg2Yzc2GNzkyOFM0MDMH3MzYzNkw4MwK|"}],"options":"MDHAyMzhkMzQ4NXTg2NzM4NDg2FMzQ0YzM0N2EH4MTg4Nzc4NDOM0M2UzNDdhOODE4ODc3ODQzGNDRjVTM0ODQQ3Nzg4Nzc4NEKw4NTc3MzQ4ZKg|"},'__SVGATOR_PLAYER__',window,document)
]]></script></svg></span></a><label class="watch-ad">Watch Ad for Big Screen</label><label class="subscribed">PLAY BIG SCREEN</label></div></div></div><h1 class="pane-title">
            Jacksmith
           </h1></div><div class="row mt-3 mb-1 game-xp-bar-immerse-button"><div class="col-sm-6 immerse-close-button"><div class="close-full-screen"><a class="btn btn-primary btn-fullscreen btn-sm" href="#" title="Exit Big Screen"><span>Exit Big Screen</span><i class="icon-remove_sign" aria-hidden="true"></i></a></div></div></div><div class="game-meta-body"><div class="game-instructions"><h2>Instructions</h2><div class="mobile"><p>Follow the instructions to craft awesome weapons and armor to equip the heroes on their adventure. Manage your time, work carefully, and discover secret recipes to make the best gear.</p><p>The key to pleasing your customers in Jacksmith is accuracy. Make sure that you pay attention to every little detail, from casting the metal properly to putting on the grip right in the center of the blade handle. Every single thing that you do will affect your performance score in the end, so don’t cut corners. It can be tempting to try and go your fastest in order to please the customers, but if you are sacrificing speed for accuracy then it will only result in a worse experience.&nbsp;</p><p>If you are a fan of cooking games that involve creating dishes and serving them out to customers, then you will likely be a fan of Jacksmith. There really isn’t much of a difference between forging bows and baking up hot and tasty pizzas. Even if blacksmithing isn’t really your thing, you should definitely give Jacksmith a try.</p></div><div class="desktop"><p>Follow the instructions to craft awesome weapons and armor to equip the heroes on their adventure. Manage your time, work carefully, and discover secret recipes to make the best gear.</p><p>The key to pleasing your customers in Jacksmith is accuracy. Make sure that you pay attention to every little detail, from casting the metal properly to putting on the grip right in the center of the blade handle. Every single thing that you do will affect your performance score in the end, so don’t cut corners. It can be tempting to try and go your fastest in order to please the customers, but if you are sacrificing speed for accuracy then it will only result in a worse experience.&nbsp;</p><p>If you are a fan of cooking games that involve creating dishes and serving them out to customers, then you will likely be a fan of Jacksmith. There really isn’t much of a difference between forging bows and baking up hot and tasty pizzas. Even if blacksmithing isn’t really your thing, you should definitely give Jacksmith a try.</p></div></div><div class="rating"><div class="cmg_game_rating_val"><span class="rating-val">4.8 <img src="/themes/custom/coolmath/assets/svg/star.svg" alt="Rating Star" loading="lazy"></span></div><div class="cmg_game_tot_cnt"> 467,167 <br/>  Votes</div></div></div></article></div></div></div><!-- Mobile Layout --><div class="mobile-layout"><div class="d-lg-none game-on_device game-on-mobile"><script type="deferjs">
  $(document).ready(function () {
    if (cmg_is_mobile_device() === true) {
      //cmgRemovePadg();
      attachModalHtml();
      $('#id-adfree-marketing-campaign').remove();
      $("#full-screen-modal").remove();
      $(".subscription-overlay").remove();
      $(".game-overlay-watch-or-join").remove();
      $("#videoplayer").show();
    } else if($(".game-page-mobile .playNow").length && $(".game-page-mobile .playNow").is(':visible') ) {
      cmgRemovePadg();
    }

    $(".game-page-mobile .playNow").on("click", function (e) {
      e.preventDefault();
      if(cmg_is_mobile_device()) {
        //Display overlay preroll ad
        displayPrerollAdMobile();
      } else {
        var flash_status = "";
        if(cmg_flash_emulated_game()) {
          flash_status = "Flash Emulated";
        } else {
          flash_status = "";
        }
        if (!cmg_is_mobile_device() && typeof trackEvent === 'function') {
          trackEvent('Mobile play button clicked', 'resized desktop browser', document.title);
          ga4_trackEvent('game_initiate', ['game_start_data', 'flash_status', 'mobile_play_clicked'], ['Resized desktop browser play button clicked', flash_status, 'false']);
        } else if (cmg_is_mobile_device() && typeof trackEvent === 'function') {
          trackEvent('Mobile play button clicked', 'mobile browser', document.title);
          ga4_trackEvent('game_initiate', ['game_start_data', 'flash_status', 'mobile_play_clicked'], ['Mobile play button clicked', flash_status, 'true']);
        }
        displayPrerollAd_Resized();
      }
    });
  });
  $(document).ready(function ($) {
    if (cmg_is_mobile_device() === true) {
      check_game_mode(orientation);
      $(window).on('orientationchange', function (event) {
        check_game_mode(orientation);
      });
    }
    function check_game_mode(ort) {
      if ($('.check-game-mode').length > 0) {
        if ($('.check-game-mode').hasClass('portrait-only')) {
          if (ort == 0 || ort == '-180' || ort == 180) {
            $('.check-game-mode').removeClass('show-msg');
          } else {
            $('.check-game-mode').addClass('show-msg');
          }
        }
        if ($('.check-game-mode').hasClass('landscape-only')) {
          if (ort == 90 || ort == '-90') {
            $('.check-game-mode').removeClass('show-msg');
          } else {
            $('.check-game-mode').addClass('show-msg');
          }
        }
      }
    }

    $(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange", function () {
      if ($.fullscreen.isFullScreen()) {
        $('body').addClass('isFullScreen isPlay');
      } else {
        $('body').removeClass('isFullScreen isPlay');
      }
    });

  });

  // New responsive site preroll. Old Function name: removePrerollAndDisplayGame_Mobile().
  function cmgRemovePadgMobile() {
    //removePrerollAndDisplayGame();
    $("#m-continue-container").hide();
    var modal = document.getElementById('m-modal');
    modal.style.display = 'none';
    cmg_start_game_full_screen();
  }
  /*
  * Remove Preroll and display game resized. Function name: removePrerollAndDisplayGame_Resized().
  */
  function cmgRemovePadgResized() {
    $("#r-continue-container").hide();
    var modal = document.getElementById('r-modal');
    modal.style.display = 'none';
    if(typeof cmg_game_modal_attached != "undefined" && !cmg_game_modal_attached) {
      attachModalHtml();
    } else {
      attachModalHtml();
    }
  var elem = document.getElementById('block-system-main');
  requestFullscreenModal(elem, document.title);
  }

      var ContinueText = "Continue in";
  var mtimerHtml = '<div class="continue-container mobile-continue-btn"><div class="continue-lnk-container"><div id="m-continue-link" class="continue-link"><span>'+ContinueText+'</span></div><div id="m-timer-div" class="timer-div">6</div></div></div>';
  var rtimerHtml = '<div class="continue-container mobile-continue-btn"><div class="continue-lnk-container"><div id="r-continue-link" class="continue-link"><span>'+ContinueText+'</span></div><div id="r-timer-div" class="timer-div">6</div></div></div>';
  var displayMobilePreRoll = true;
  function displayPrerollAdMobile() {
    var cmatgame_subscriber = getCookie('cmg_sx');
    var validSubscriber = false;
    if (typeof cmatgame_subscriber !== 'undefined' && (cmatgame_subscriber !== null || getCookie('cmg_wl') !== null)) {
      validSubscriber = true;
    }
    // preroll ads
    var prerollUrls = /0\-testing/;

    // display preroll ads only on 2nd,4th, 6th visits of any game page
    // TODO Remove false after testing
    if (! displayMobilePreRoll || validSubscriber || hide_preroll_ads) {
      $('body').addClass('isPlay');
      cmg_start_game_full_screen();
    } else { // display preroll ads
      displayMobilePreRoll = false;
      // $("#m-continue-container").html(mtimerHtml);
      window.scrollTo(0, 0);
      var modal = document.getElementById('m-modal');
      $('.page.global-wrapper').before(modal);
      modal.style.display = 'block';
      // clear refresh timer
      if (typeof refreshTimer !== "undefined") {
        clearTimeout(refreshTimer);
        refreshTimer = null;
      }

      /* Test ad
      adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?' + 'sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&' + 'impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&' + 'cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=';
      application = new Application(true, adTagUrl, "m-");
      */
      // Live Ad

      var adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/137548614/1023174/71134/1023174-71134-video&description_url=https%3A%2F%2Fwww.m.coolmathgames.com%2F&env=vp&impl=s&correlator=&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1';
      if(typeof window.PW_CMG != "undefined") {
        console.log('PBJS start')
        var auctionCallback = function(displayAds, videoUrl){
          application = new Application(displayAds, videoUrl, "m-");
        };
        if(!cmgAInvD) {
          cmgAInvD = true;
          window.PW_CMG.startAuction(auctionCallback);
        }
      } else { //adblock
        application = new Application(false, adTagUrl, "m-");
      }
      var m_seconds_left = 6;
      if ($("#m-timer-div").length) {
        $(".m-preroll-headline").hide(); // remove game loading message
        $("#m-continue-container").remove();
        $("#m-container123").before(mtimerHtml); // and display continue in...
      }
      mobile_intervalId = setInterval(function () {
        m_seconds_left--;
        document.getElementById("m-timer-div").innerHTML = m_seconds_left;
        if (m_seconds_left <= 0) {
          if (document.getElementById("m-timer-div") != null) {
            document.getElementById("m-continue-link").innerHTML = "";
            //$("#m-continue-link").hide();
            $('.mobile-continue-btn .continue-lnk-container').addClass('timer-finished');
            document.getElementById("m-continue-link").innerHTML = '<div class="continue-link-new"><a href="javascript:cmgRemovePadgMobile();">'+ Drupal.t('Continue')+'</a></div>';
          }
          clearInterval(mobile_intervalId);
        }
      }, 1000);
    }
  }
  function displayPrerollAd_Resized() {
    var cmatgame_subscriber = getCookie('cmg_sx');
    var validSubscriber = false;
    if (typeof cmatgame_subscriber !== 'undefined' && (cmatgame_subscriber !== null || getCookie('cmg_wl') !== null)) {
      validSubscriber = true;
    }
    // preroll ads
    var prerollUrls = /0\-testing/;

    // display preroll ads only on 2nd,4th, 6th visits of any game page
    if (! displayMobilePreRoll || validSubscriber || hide_preroll_ads) {
      $('body').addClass('isPlay');
      //cmg_start_game_full_screen();//use mobile like immersive modal
      if(typeof cmg_game_modal_attached != "undefined" && !cmg_game_modal_attached) {
        attachModalHtml();
      }
      var elem = document.getElementById('block-system-main');
      requestFullscreenModal(elem, document.title);
      //return false;//do not return false -- FF and IE do not work
    } else { // display preroll ads
      displayMobilePreRoll = false;
      // $("#r-continue-container").html(rtimerHtml);
      window.scrollTo(0, 0);
      var modal = document.getElementById('r-modal');
      $('.page.global-wrapper').before(modal);
      modal.style.display = 'block';
      $('.r-preroll-headline').hide();
      // TODO -- css
      $("#r-modal").css({
        "text-align": "center",
        "color": "white",
        "position": "fixed",
        "background": "rgba(0,0,0,0.9)",
        "width": "100%",
        "z-index": "999999"
      });
      $("#r-modal #r-timer-div").css("color", "yellow");
      $("#r-modal .r-continue-link").css("color", "yellow").text("180");
      $("#r-modal #r-continue-link").css({"color": "yellow", "margin-top": "10px", "margin-bottom": "10px"});
      // clear refresh timer
      if (typeof refreshTimer !== "undefined") {
        clearTimeout(refreshTimer);
        refreshTimer = null;
      }

      /* Test ad
      adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?' + 'sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&' + 'impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&' + 'cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=';
      application = new Application(true, adTagUrl, "r-");
      */
      // Live Ad
      var adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/137548614/1023174/71134/1023174-71134-video&description_url=https%3A%2F%2Fwww.m.coolmathgames.com%2F&env=vp&impl=s&correlator=&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1';
      if(typeof window.PW_CMG != "undefined") {
        console.log('PBJS start')
        var auctionCallback = function(displayAds, videoUrl){
          application = new Application(displayAds, videoUrl, "r-");
        };
        if(!cmgAInvD) {
          cmgAInvD = true;
          window.PW_CMG.startAuction(auctionCallback);
        }
      } else { //adblock
        application = new Application(false, adTagUrl, "r-");
      }


      var r_seconds_left = 15;
      if ($("#r-timer-div").length) {
        $(".r-preroll-headline").hide(); // remove game loading message
        $("#r-continue-container").remove();
        $("#r-container123").before(rtimerHtml); // and display continue in...
      }
      rIntervalId = setInterval(function () {
        r_seconds_left--;
        document.getElementById("r-timer-div").innerHTML = r_seconds_left;
        if (r_seconds_left <= 0) {
          removeResponsivePrerollTimer();
        }
      }, 1000);
    }
  }
  function removeResponsivePrerollTimer() {
    if (document.getElementById("r-timer-div") != null) {
      document.getElementById("r-continue-link").innerHTML = "";
      document.getElementById("r-continue-link").innerHTML = '<div class="continue-link-new"><a href="javascript:cmgRemovePadgResized();">Continue</a></div>';
      //Load game iframe before going to full screen
      //removePrerollAndDisplayGame();
    }
    if (typeof rIntervalId != "undefined") {
      clearInterval(rIntervalId);
    }
    cmgRemovePadgResized();
  }
</script><div class="game-page-mobile "><div class="game-stage"><div class="game-image my-4"><div class="new-game-bg"><div class="no-flash-mobile" style="display:none;"><div class="flash-text"><div class="flash-icon"><img src="/themes/custom/coolmath/assets/images/gears.svg" width="65" height="65" alt="flash game" class="lazyload" src="/modules/custom/cmatgame_core/images/1x1.png" loading="lazy"/></div><p class="big-txt">Sorry... this game is not playable in your browser.</p></div></div><img class="bg-img" src="/sites/default/files/styles/mobile_game_image/public/Jacksmith%20OG%20Image.png?itok=eQsnJR72" border="0" width="330" height="182"/></div><script type="deferjs">
        $(document).ready(function ($) {
          $("#playNowButton").delay(10).fadeIn(10);
        });
      </script><a href="#" class="playNow" id='playNowButton' style="display:none;"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M176 480C148.6 480 128 457.6 128 432v-352c0-25.38 20.4-47.98 48.01-47.98c8.686 0 17.35 2.352 25.02 7.031l288 176C503.3 223.8 512 239.3 512 256s-8.703 32.23-22.97 40.95l-288 176C193.4 477.6 184.7 480 176 480z"></path></svg></a><script type="deferjs">
     $(document).ready(function () {
      $(function () {
        let gameURL = "https://www.coolmathgames.com/0-jacksmith";
        let gamePlaybtn = $("#playNowButton");
        gameURL.search(/\/play/) > 0 ? gamePlaybtn.attr("href", gameURL) : gamePlaybtn.attr("href", gameURL + "/play");
      });
     });
    </script><script type="deferjs">
      var validSubscriber = false;
      if (typeof cmatgame_subscriber !== 'undefined' && cmatgame_subscriber !== null) {
        validSubscriber = true;
      }
      if(getCookie("cmg_wl") !== null) {
        validSubscriber = true;
      }
        if (!validSubscriber && (document.getElementById('randomAdBlockDiv') == null || typeof google == "undefined" || typeof cmgpbjs == "undefined" && navigator.cookieEnabled)) {
          if(typeof schoolHours !== "undefined" && schoolHours) {
            cmg_adrecovery();
          }
        }
    </script></div><div id="m-modal" style="display: none;"><!-- Load message --><div class="m-preroll-headline"><h3>Just a moment while your advertisement loads</h3></div><div id="m-container123"><hr style="margin-top: 10px; margin-bottom: 10px;"/><div id="videoplayer" style="width:100%;"><div id="m-adcontainer"></div><p class="advertisment">Advertisement</p></div><!-- Timer --><div id="m-continue-container"><div id="m-continue-link">Continue in
          <span id="m-timer-div">6</span></div></div></div></div><div id="r-modal" style="display: none;"><div class="r-preroll-headline"><h3>Just a moment while your advertisement loads</h3></div><div id="r-container123"><hr style="margin-top: 10px; margin-bottom: 10px;"/><div id="r-videoplayer" style="width:100%;"><div id="r-adcontainer" style="display: flex; justify-content: center;"></div><p class="advertisment">Advertisement</p></div><!-- Timer --><div id="r-continue-container"><div id="r-continue-link">Continue in
          <span id="r-timer-div">20</span></div></div></div></div></div><div class="game-meta-header"><div class="controls"></div><div class="breadcrumb"><a href="/1-strategy-games">Strategy</a><span> &gt; </span><a href="/1-business-games">Business Games</a></div><h1 class="pane-title">
      Jacksmith
     </h1></div><div class="game-meta-body">

<div id="block-gameprogress--2" class="settings-tray-editable large-game-item block block-cmatgame-core block-gamexpprogress" data-drupal-settingstray="editable">
      <div class="block-content cmg-game-xp-right-block">
      <div id='game-xp-progress-block' class='game-progress-dsp'>    <header><h2 class="gamexp-header"><span class="gamexp-title">Game Progress </span><span class="gamexp-percent">0%</span> </h2></header>
    <div class="gamexp-bar">
      <div class="progress">
        <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>           
      </div>
      <ul class="progress-bullets">
        <li class="bullet bullet-1" data-id="1"></li>
        <li class="bullet bullet-2" data-id="2"></li>
        <li class="bullet bullet-3" data-id="3"></li>
        <li class="bullet bullet-4" data-id="4"></li>
        <li class="bullet bullet-5" data-id="5"></li>
        <li class="bullet bullet-6" data-id="6"></li>
        <li class="bullet bullet-7" data-id="7"></li>
        <li class="bullet bullet-8" data-id="8"></li>
        <li class="bullet bullet-9" data-id="9"></li>
        <li class="bullet bullet-10" data-id="10"></li>
      </ul>
    </div>
    <div class="gamexp-bar-container">
      <div class="gamexp-count"></div>
      <div class="gamexp-reward"><span class="points">0 XP</span><div class="login-status"><a href="/login?destination=/0-jacksmith">
      <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_730_1558)"> <path d="M12.1831 4.02498C13.5164 4.02498 14.5998 5.10832 14.5998 6.44165C14.5998 7.77498 13.3914 14.0833 12.1831 14.0833C10.9748 14.0833 9.76644 7.77498 9.76644 6.44165C9.76644 5.10832 10.8498 4.02498 12.1831 4.02498ZM12.1831 3.19165C10.3914 3.19165 8.93311 4.64998 8.93311 6.44165C8.93311 6.52498 9.74144 14.9166 12.1831 14.9166C14.6248 14.9166 15.4331 6.52498 15.4331 6.44165C15.4331 4.64998 13.9748 3.19165 12.1831 3.19165Z" fill="#FFE420"/> <path d="M12.1833 16.6667C13.3333 16.6667 14.2666 17.6 14.2666 18.75C14.2666 19.9 13.3333 20.8334 12.1833 20.8334C11.0333 20.8334 10.0999 19.9 10.0999 18.75C10.0999 17.6 11.0333 16.6667 12.1833 16.6667ZM12.1833 15.8334C10.5749 15.8334 9.2666 17.1417 9.2666 18.75C9.2666 20.3584 10.5749 21.6667 12.1833 21.6667C13.7916 21.6667 15.0999 20.3584 15.0999 18.75C15.0999 17.1417 13.7916 15.8334 12.1833 15.8334Z" fill="#FFE420"/> <path d="M12.5 0.833333C18.9333 0.833333 24.1667 6.06667 24.1667 12.5C24.1667 18.9333 18.9333 24.1667 12.5 24.1667C6.06667 24.1667 0.833333 18.9333 0.833333 12.5C0.833333 6.06667 6.06667 0.833333 12.5 0.833333ZM12.5 0C5.6 0 0 5.6 0 12.5C0 19.4 5.6 25 12.5 25C19.4 25 25 19.4 25 12.5C25 5.6 19.4 0 12.5 0Z" fill="#FFE420"/> </g> <defs> <clipPath id="clip0_730_1558"> <rect width="25" height="25" fill="white"/> </clipPath> </defs> <path class="cls-1" d="M12.5,0C5.6,0,0,5.6,0,12.5s5.6,12.5,12.5,12.5,12.5-5.6,12.5-12.5S19.4,0,12.5,0Zm-.32,20.83c-1.15,0-2.08-.93-2.08-2.08s.93-2.08,2.08-2.08,2.08,.93,2.08,2.08-.93,2.08-2.08,2.08Zm0-6.75c-1.23,0-2.42-6.31-2.42-7.64s1.08-2.42,2.42-2.42,2.42,1.08,2.42,2.42-1.21,7.64-2.42,7.64Z"/> </svg>
      </a>
      <span>
      Log in to keep XP</span>
      </div></div>
    </div>
    <footer>
      <div class="gamexp-msg"><a class="login-status" href="/login?destination=/0-jacksmith"><span> <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_730_1558)"> <path d="M12.1831 4.02498C13.5164 4.02498 14.5998 5.10832 14.5998 6.44165C14.5998 7.77498 13.3914 14.0833 12.1831 14.0833C10.9748 14.0833 9.76644 7.77498 9.76644 6.44165C9.76644 5.10832 10.8498 4.02498 12.1831 4.02498ZM12.1831 3.19165C10.3914 3.19165 8.93311 4.64998 8.93311 6.44165C8.93311 6.52498 9.74144 14.9166 12.1831 14.9166C14.6248 14.9166 15.4331 6.52498 15.4331 6.44165C15.4331 4.64998 13.9748 3.19165 12.1831 3.19165Z" fill="#FFE420"/> <path d="M12.1833 16.6667C13.3333 16.6667 14.2666 17.6 14.2666 18.75C14.2666 19.9 13.3333 20.8334 12.1833 20.8334C11.0333 20.8334 10.0999 19.9 10.0999 18.75C10.0999 17.6 11.0333 16.6667 12.1833 16.6667ZM12.1833 15.8334C10.5749 15.8334 9.2666 17.1417 9.2666 18.75C9.2666 20.3584 10.5749 21.6667 12.1833 21.6667C13.7916 21.6667 15.0999 20.3584 15.0999 18.75C15.0999 17.1417 13.7916 15.8334 12.1833 15.8334Z" fill="#FFE420"/> <path d="M12.5 0.833333C18.9333 0.833333 24.1667 6.06667 24.1667 12.5C24.1667 18.9333 18.9333 24.1667 12.5 24.1667C6.06667 24.1667 0.833333 18.9333 0.833333 12.5C0.833333 6.06667 6.06667 0.833333 12.5 0.833333ZM12.5 0C5.6 0 0 5.6 0 12.5C0 19.4 5.6 25 12.5 25C19.4 25 25 19.4 25 12.5C25 5.6 19.4 0 12.5 0Z" fill="#FFE420"/> </g> <defs> <clipPath id="clip0_730_1558"> <rect width="25" height="25" fill="white"/> </clipPath> </defs> <path class="cls-1" d="M12.5,0C5.6,0,0,5.6,0,12.5s5.6,12.5,12.5,12.5,12.5-5.6,12.5-12.5S19.4,0,12.5,0Zm-.32,20.83c-1.15,0-2.08-.93-2.08-2.08s.93-2.08,2.08-2.08,2.08,.93,2.08,2.08-.93,2.08-2.08,2.08Zm0-6.75c-1.23,0-2.42-6.31-2.42-7.64s1.08-2.42,2.42-2.42,2.42,1.08,2.42,2.42-1.21,7.64-2.42,7.64Z"/> </svg></span>Log in to keep XP</a></div>
    </footer></div>
    </div>
  </div><div class="flash-related"><div class="large-game-item block block-cmatgame-playlist block-related-game-block"><div class="view-content"><div class="views-element-container"><div class="common-title">
      You’ll Also Like
  </div><div class="view-content"><div><div class="pane-content js-view-dom-id-7140079e46f72a7c8e6b9ad1e953026a1b15c1da48b375d7a4ff28c1c4bdc940"><div class="cmg-games-grid grid-col-4"><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-deck-adventurers-chapter-1"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/deck-adventures-chapter-1-game-logo.png" width="83" height="50" alt="Deck Adventurers: Chapter 1" title="Deck Adventurers: Chapter 1" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Deck Adventurers: Chapter 1</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-three-goblets"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/three-goblets-game-logo.png" width="83" height="50" alt="Three Goblets" title="Three Goblets" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Three Goblets</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-dungeon-decks"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/dungeon-decks-game-logo.png" width="83" height="50" alt="Dungeon Decks" title="Dungeon Decks" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Dungeon Decks</h5></div></a></div></div><div class="game-item"><div class="game-link-wrapper"><a href="/0-coffee-shop"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-coffeeshop.gif" width="83" height="50" alt="Coffee Shop" title="Coffee Shop" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Coffee Shop</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-freezeria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas.gif" width="83" height="50" alt="Papa&#039;s Freezeria" title="Papa&#039;s Freezeria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Freezeria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-burgeria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-burgeria.gif" width="83" height="50" alt="Papa&#039;s Burgeria" title="Papa&#039;s Burgeria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Burgeria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-cupcakeria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-cupcakeria.gif" width="83" height="50" alt="Papa&#039;s Cupcakeria" title="Papa&#039;s Cupcakeria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Cupcakeria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-bakeria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/papas-bakeria-game-logo.gif" width="83" height="50" alt="Papa&#039;s Bakeria" title="Papa&#039;s Bakeria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Bakeria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-cheeseria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-cheeseria.gif" width="83" height="50" alt="Papa&#039;s Cheeseria" title="Papa&#039;s Cheeseria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Cheeseria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-pizzeria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-pizzeria_0.gif" width="83" height="50" alt="Papa&#039;s Pizzeria" title="Papa&#039;s Pizzeria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Pizzeria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-taco-mia"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-taco-mia_0.gif" width="83" height="50" alt="Papa&#039;s Taco Mia" title="Papa&#039;s Taco Mia" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Taco Mia</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-pancakeria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-pancakeria_0.gif" width="83" height="50" alt="Papa&#039;s Pancakeria" title="Papa&#039;s Pancakeria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Pancakeria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-donuteria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-donuteria-withtext.gif" width="83" height="50" alt="Papa&#039;s Donuteria" title="Papa&#039;s Donuteria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Donuteria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-wingeria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-wingeria.gif" width="83" height="50" alt="Papa&#039;s Wingeria" title="Papa&#039;s Wingeria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Wingeria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-sushiria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/papas-sushiria-game-logo.gif" width="83" height="50" alt="Papa&#039;s Sushiria" title="Papa&#039;s Sushiria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Sushiria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-hot-doggeria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-hot-doggeria.gif" width="83" height="50" alt="Papa&#039;s Hot Doggeria" title="Papa&#039;s Hot Doggeria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Hot Doggeria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-pastaria"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-papas-pastaria.gif" width="83" height="50" alt="Papa&#039;s Pastaria" title="Papa&#039;s Pastaria" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Pastaria</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-kukoo-machines"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/game-logo-kukoo-machines.gif" width="83" height="50" alt="Kukoo Machines" title="Kukoo Machines" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Kukoo Machines</h5></div></a></div></div><div class="game-item mobile-not-playable"><div class="game-link-wrapper"><a href="/0-papas-scooperia"><div class="field-image"><img src="/modules/custom/cmatgame_core/images/1x1.png" data-src="https://www.coolmathgames.com/sites/default/files/game_thumbnail/icon_83x50_text_coolmath1.gif" width="83" height="50" alt="Papa&#039;s Scooperia" title="Papa&#039;s Scooperia" class="imgList lazyload" typeof="foaf:Image"></div><div class="game-item-content"><h5 class="game-title">Papa&#039;s Scooperia</h5></div></a></div></div></div></div></div></div></div></div></div></div><div class="game-instructions mb-4"><h3>Instructions</h3><div class="expander mobile"><p>Follow the instructions to craft awesome weapons and armor to equip the heroes on their adventure. Manage your time, work carefully, and discover secret recipes to make the best gear.</p><p>The key to pleasing your customers in Jacksmith is accuracy. Make sure that you pay attention to every little detail, from casting the metal properly to putting on the grip right in the center of the blade handle. Every single thing that you do will affect your performance score in the end, so don’t cut corners. It can be tempting to try and go your fastest in order to please the customers, but if you are sacrificing speed for accuracy then it will only result in a worse experience.&nbsp;</p><p>If you are a fan of cooking games that involve creating dishes and serving them out to customers, then you will likely be a fan of Jacksmith. There really isn’t much of a difference between forging bows and baking up hot and tasty pizzas. Even if blacksmithing isn’t really your thing, you should definitely give Jacksmith a try.</p></div><div class="expander desktop"><p>Follow the instructions to craft awesome weapons and armor to equip the heroes on their adventure. Manage your time, work carefully, and discover secret recipes to make the best gear.</p><p>The key to pleasing your customers in Jacksmith is accuracy. Make sure that you pay attention to every little detail, from casting the metal properly to putting on the grip right in the center of the blade handle. Every single thing that you do will affect your performance score in the end, so don’t cut corners. It can be tempting to try and go your fastest in order to please the customers, but if you are sacrificing speed for accuracy then it will only result in a worse experience.&nbsp;</p><p>If you are a fan of cooking games that involve creating dishes and serving them out to customers, then you will likely be a fan of Jacksmith. There really isn’t much of a difference between forging bows and baking up hot and tasty pizzas. Even if blacksmithing isn’t really your thing, you should definitely give Jacksmith a try.</p></div></div><div class="rating"><div class="cmg_game_rating_val"><span class="rating-val">4.8 <img src="/themes/custom/coolmath/assets/svg/star.svg" alt="Rating Star" loading="lazy" width="15" height="15"></span></div><div class="cmg_game_tot_cnt"> 467,167 <br/>  Votes</div></div></div></div></div></div><div class="cmg-gamepage-block cmg-pickup-block lazyload" style="display:none;"><h2 class="title">Pick Up Where You Left Off</h2><div class="cmg-games-grid grid-col-4" id ="cmg_pickup_block"></div></div><div class="cmg-gamepage-block cmg-popular-near-block lazyload" id="cmg_pgp_block" style="display:none"></div></div></div></div><div class="adbottom"><div class="col-12"><div id="block-coolmath-adsbottom-otherpage-728x90" class="settings-tray-editable block block-cmatgame-core block-adsbottom-otherpage-728x90" data-drupal-settingstray="editable"><div class="view-content"><div class="panel-pane pane-block pane-cmatgame-advertisement-cm-g-otherpages-728x90-footer"><div class="ad-wrapper"><!-- 728 x 90 BTF Desktop --><div id="leaderboard-btf"></div></div></div></div></div></div></div></div><div class="r-aside-spacer d-none d-md-block"></div><div class="main-aside mr-4 p-0"><aside class="section" role="complementary"><div class="inside"><div id="block-nodepagespromoconfigmerchstorexl" class="settings-tray-editable large-game-item block block-simple-block block-simple-blocknode-pages-promo-config-merch-store-xl" data-drupal-settingstray="editable"><div class="view-content"><a href="https://www.teepublic.com/stores/coolmathgames?merch-store" target="_blank" title="Visit the Coolmath Merch Store for T-Shirts, Mugs and more!"><div class="cmg-promo merch-promo-xl"><div class="cmg-promo-inner"><div class="cmg-promo-img"><img src="/themes/custom/coolmath/assets/images/promos/Merch_Promo-XL.png" alt="Coolmath Merch" loading="lazy"/></div><div class="cmg-promo-text"><h5>Coolmath Merch</h5><p>T-shirts, mugs, and more!</p></div></div></div></a></div></div><div id="block-adsrighttop-otherpage-300x250" class="settings-tray-editable large-game-item block block-cmatgame-core block-adsrighttop-otherpage-300x250" data-drupal-settingstray="editable"><div class="view-content"><div class="panel-pane pane-block pane-cmatgame-advertisement-cm-g-otherpages-300x250-top other-pages-300x250"><div class="ad-wrapper"><!-- 300 x 250 ATF Desktop --><div id="med-rect-atf"></div></div></div></div></div><div id="block-nodepagespromoconfigcustomuserprofiles-3" class="settings-tray-editable large-game-item block block-simple-block block-simple-blocknode-pages-promo-config-user-profiles" data-drupal-settingstray="editable"><div class="view-content"><div class="cmg-promo profile-promo"><a href="/signup"><div class="cmg-promo-inner"><div class="cmg-promo-img"><img src="/themes/custom/coolmath/assets/images/promos/UserProfiles_Promo.png" alt="User Profile"  loading="lazy"></div><div class="cmg-promo-text"><h5>Custom Profile</h5><p>Get one for free!</p></div></div></a></div></div></div>

<div id="block-gameprogress" class="settings-tray-editable large-game-item block block-cmatgame-core block-gamexpprogress" data-drupal-settingstray="editable">
      <div class="block-content cmg-game-xp-right-block">
      <div id='game-xp-progress-block' class='game-progress-dsp'>    <header><h2 class="gamexp-header"><span class="gamexp-title">Game Progress </span><span class="gamexp-percent">0%</span> </h2></header>
    <div class="gamexp-bar">
      <div class="progress">
        <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>           
      </div>
      <ul class="progress-bullets">
        <li class="bullet bullet-1" data-id="1"></li>
        <li class="bullet bullet-2" data-id="2"></li>
        <li class="bullet bullet-3" data-id="3"></li>
        <li class="bullet bullet-4" data-id="4"></li>
        <li class="bullet bullet-5" data-id="5"></li>
        <li class="bullet bullet-6" data-id="6"></li>
        <li class="bullet bullet-7" data-id="7"></li>
        <li class="bullet bullet-8" data-id="8"></li>
        <li class="bullet bullet-9" data-id="9"></li>
        <li class="bullet bullet-10" data-id="10"></li>
      </ul>
    </div>
    <div class="gamexp-bar-container">
      <div class="gamexp-count"></div>
      <div class="gamexp-reward"><span class="points">0 XP</span><div class="login-status"><a href="/login?destination=/0-jacksmith">
      <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_730_1558)"> <path d="M12.1831 4.02498C13.5164 4.02498 14.5998 5.10832 14.5998 6.44165C14.5998 7.77498 13.3914 14.0833 12.1831 14.0833C10.9748 14.0833 9.76644 7.77498 9.76644 6.44165C9.76644 5.10832 10.8498 4.02498 12.1831 4.02498ZM12.1831 3.19165C10.3914 3.19165 8.93311 4.64998 8.93311 6.44165C8.93311 6.52498 9.74144 14.9166 12.1831 14.9166C14.6248 14.9166 15.4331 6.52498 15.4331 6.44165C15.4331 4.64998 13.9748 3.19165 12.1831 3.19165Z" fill="#FFE420"/> <path d="M12.1833 16.6667C13.3333 16.6667 14.2666 17.6 14.2666 18.75C14.2666 19.9 13.3333 20.8334 12.1833 20.8334C11.0333 20.8334 10.0999 19.9 10.0999 18.75C10.0999 17.6 11.0333 16.6667 12.1833 16.6667ZM12.1833 15.8334C10.5749 15.8334 9.2666 17.1417 9.2666 18.75C9.2666 20.3584 10.5749 21.6667 12.1833 21.6667C13.7916 21.6667 15.0999 20.3584 15.0999 18.75C15.0999 17.1417 13.7916 15.8334 12.1833 15.8334Z" fill="#FFE420"/> <path d="M12.5 0.833333C18.9333 0.833333 24.1667 6.06667 24.1667 12.5C24.1667 18.9333 18.9333 24.1667 12.5 24.1667C6.06667 24.1667 0.833333 18.9333 0.833333 12.5C0.833333 6.06667 6.06667 0.833333 12.5 0.833333ZM12.5 0C5.6 0 0 5.6 0 12.5C0 19.4 5.6 25 12.5 25C19.4 25 25 19.4 25 12.5C25 5.6 19.4 0 12.5 0Z" fill="#FFE420"/> </g> <defs> <clipPath id="clip0_730_1558"> <rect width="25" height="25" fill="white"/> </clipPath> </defs> <path class="cls-1" d="M12.5,0C5.6,0,0,5.6,0,12.5s5.6,12.5,12.5,12.5,12.5-5.6,12.5-12.5S19.4,0,12.5,0Zm-.32,20.83c-1.15,0-2.08-.93-2.08-2.08s.93-2.08,2.08-2.08,2.08,.93,2.08,2.08-.93,2.08-2.08,2.08Zm0-6.75c-1.23,0-2.42-6.31-2.42-7.64s1.08-2.42,2.42-2.42,2.42,1.08,2.42,2.42-1.21,7.64-2.42,7.64Z"/> </svg>
      </a>
      <span>
      Log in to keep XP</span>
      </div></div>
    </div>
    <footer>
      <div class="gamexp-msg"><a class="login-status" href="/login?destination=/0-jacksmith"><span> <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_730_1558)"> <path d="M12.1831 4.02498C13.5164 4.02498 14.5998 5.10832 14.5998 6.44165C14.5998 7.77498 13.3914 14.0833 12.1831 14.0833C10.9748 14.0833 9.76644 7.77498 9.76644 6.44165C9.76644 5.10832 10.8498 4.02498 12.1831 4.02498ZM12.1831 3.19165C10.3914 3.19165 8.93311 4.64998 8.93311 6.44165C8.93311 6.52498 9.74144 14.9166 12.1831 14.9166C14.6248 14.9166 15.4331 6.52498 15.4331 6.44165C15.4331 4.64998 13.9748 3.19165 12.1831 3.19165Z" fill="#FFE420"/> <path d="M12.1833 16.6667C13.3333 16.6667 14.2666 17.6 14.2666 18.75C14.2666 19.9 13.3333 20.8334 12.1833 20.8334C11.0333 20.8334 10.0999 19.9 10.0999 18.75C10.0999 17.6 11.0333 16.6667 12.1833 16.6667ZM12.1833 15.8334C10.5749 15.8334 9.2666 17.1417 9.2666 18.75C9.2666 20.3584 10.5749 21.6667 12.1833 21.6667C13.7916 21.6667 15.0999 20.3584 15.0999 18.75C15.0999 17.1417 13.7916 15.8334 12.1833 15.8334Z" fill="#FFE420"/> <path d="M12.5 0.833333C18.9333 0.833333 24.1667 6.06667 24.1667 12.5C24.1667 18.9333 18.9333 24.1667 12.5 24.1667C6.06667 24.1667 0.833333 18.9333 0.833333 12.5C0.833333 6.06667 6.06667 0.833333 12.5 0.833333ZM12.5 0C5.6 0 0 5.6 0 12.5C0 19.4 5.6 25 12.5 25C19.4 25 25 19.4 25 12.5C25 5.6 19.4 0 12.5 0Z" fill="#FFE420"/> </g> <defs> <clipPath id="clip0_730_1558"> <rect width="25" height="25" fill="white"/> </clipPath> </defs> <path class="cls-1" d="M12.5,0C5.6,0,0,5.6,0,12.5s5.6,12.5,12.5,12.5,12.5-5.6,12.5-12.5S19.4,0,12.5,0Zm-.32,20.83c-1.15,0-2.08-.93-2.08-2.08s.93-2.08,2.08-2.08,2.08,.93,2.08,2.08-.93,2.08-2.08,2.08Zm0-6.75c-1.23,0-2.42-6.31-2.42-7.64s1.08-2.42,2.42-2.42,2.42,1.08,2.42,2.42-1.21,7.64-2.42,7.64Z"/> </svg></span>Log in to keep XP</a></div>
    </footer></div>
    </div>
  </div><div id="block-adsrightcenter-otherpage-300x250" class="settings-tray-editable large-game-item block block-cmatgame-core block-adsrightcenter-otherpage-300x250" data-drupal-settingstray="editable"><div class="view-content"><div class="panel-pane pane-block pane-cmatgame-advertisement-cm-g-otherpages-300x250-center other-pages-300x250"><div class="ad-wrapper"><!-- 300 x 250 ATF Desktop. gen /0-coffee-shop--><!-- Change the id as needed  --><div id="med-rect-btf"></div></div><script type="text/javascript">
              if(/0-jigsaw-puzzles/.test(location.href)) {
	              document.getElementById("med-rect-btf").setAttribute("id", "med-rect-btf1");
	            }
	          </script></div></div></div><div id="block-gamepagespromoconfiggoadfree-2" class="settings-tray-editable large-game-item block block-simple-block block-simple-blocknode-pages-promo-config-go-ad-free" data-drupal-settingstray="editable"><div class="view-content"><a href="/premium-access/b2df5a33"><div class="cmg-promo"><div class="cmg-promo-inner"><div class="cmg-promo-img"><img src="/themes/custom/coolmath/assets/images/promos/Ad-Free_Promo.png" alt="Go Ad-Free" loading="lazy"/></div><div class="cmg-promo-text"><h5>Go Ad-Free</h5><p>For the best gaming experience</p></div></div></div></a></div></div><div id="block-adsrightbottom-otherpage-160x600" class="settings-tray-editable large-game-item block block-cmatgame-core block-adsrightbottom-otherpage-160x600" data-drupal-settingstray="editable"><div class="view-content"><div class="panel-pane pane-block pane-cmatgame-advertisement-cm-g-otherpages-160x600-bottom other-pages-160x600"><div class="ad-wrapper"><!-- 160 x 600 Skyscraper Desktop --><div id="sky-btf"></div></div></div></div></div><div id="block-leaderboardpromoconfigrightrail-2" class="settings-tray-editable large-game-item block block-simple-block block-simple-blockleaderboard-promo-config-right-rail" data-drupal-settingstray="editable"><div class="view-content"><div class="cmg-promo cmg-leadership"><a href="/profile/leaderboard"><div class="cmg-promo-inner"><div class="cmg-promo-img"><img src="/themes/custom/coolmath/assets/images/promos/Leaderboards_Promo.png" alt="Leaderboards"  loading="lazy"></div><div class="cmg-promo-text"><h5>Leaderboards</h5><p>See how you rank!</p></div></div></a></div></div></div></div></aside></div></div></div></div></main></div><footer class="page__footer"><div class="container"><div class="row"><div class="col-lg-2 d-none d-xl-block"></div><div class="col-lg-12 col-xl-10 bg"><div class="item-list"><ol><li>&nbsp;</li><li>&nbsp;</li><li><div class="pane-bean-footer-pivacy-policy"><div class="link-with-body-title"><a href="/privacyp">Coolmath games privacy policy</a></div><div class="field-text-block"><p>If you believe that your own copyrighted content is on our Site without your permission, please follow this
                    <a href="http://coolmath.com/copyright-infringement-notice-procedure">Copyright Infringement Notice procedure</a>.</p></div></div></li><li><div class="settings-tray-editable large-game-item block block--coolmath-desktopfootermenu" data-drupal-settingstray="editable"><div class="panel-pane pane-menu-tree pane-menu-desktop-footer-menu"><div class="menu-name-menu-desktop-footer-menu"><ul class="footer-menu"><li class="mb-3 mr-3 menu__item is-expanded expanded footer-menu-column-0"><span class="menu__link nolink">COOLMATHGAMES.COM</span><ul class="footer-menu"><li ><a href="/about-us" data-drupal-link-system-path="node/9901">About Us</a></li><li ><a href="/terms-use" data-drupal-link-system-path="node/9906">Terms of Use</a></li><li ><a href="/aboutourads" data-drupal-link-system-path="node/12889">About Our Ads</a></li><li ><a href="/subscription-faq" data-drupal-link-system-path="node/10921">Subscription FAQ</a></li><li ><a href="/adblock-faq" data-drupal-link-system-path="node/12937">Adblock FAQ</a></li><li ><a href="/contact-us-about-subscriptions" data-drupal-link-system-path="node/11046">Subscription Support</a></li><li ><a href="/blog" data-drupal-link-system-path="blog">Blog</a></li><li ><a href="/contact-us" data-drupal-link-system-path="node/12581">CONTACT US</a></li><li ><a href="https://www.bestteacherjob.com/company/coolmath-com-e161097aec6a">Careers</a></li></ul></li><li class="mb-3 mr-3 menu__item is-expanded expanded footer-menu-column-1"><span class="menu__link nolink">BROWSE GAMES</span><ul class="footer-menu"><li ><a href="/1-strategy-games" title="Strategy Games" data-drupal-link-system-path="taxonomy/term/6">Strategy Games</a></li><li ><a href="/1-skill-games" title="Skill Games" data-drupal-link-system-path="taxonomy/term/46">Skill Games</a></li><li ><a href="/1-number-games" title="Number Games" data-drupal-link-system-path="taxonomy/term/151">Number Games</a></li><li ><a href="/1-logic-games" title="Logic Games" data-drupal-link-system-path="taxonomy/term/91">Logic Games</a></li><li ><a href="/1-memory-games" title="Memory Games" data-drupal-link-system-path="taxonomy/term/181">Memory Games</a></li><li ><a href="/1-classic-games" title="Classic Games" data-drupal-link-system-path="taxonomy/term/211">Classic Games</a></li><li ><a href="/0-jigsaw-puzzles" title="Jigsaw Puzzles" data-drupal-link-system-path="0-jigsaw-puzzles">Jigsaw Puzzles</a></li><li ><a href="/1-science-games" title="Science Games" data-drupal-link-system-path="taxonomy/term/626">Science Games</a></li><li ><a href="/1-geography-games" title="Geography Games" data-drupal-link-system-path="taxonomy/term/206">Geography Games</a></li></ul></li><li class="mb-3 mr-3 menu__item is-expanded expanded footer-menu-column-2"><span class="menu__link nolink">COOLMATH.COM</span><ul class="footer-menu"><li ><a href="https://www.coolmath.com/prealgebra" title="Pre-Algebra Lessons">Pre-Algebra Lessons</a></li><li ><a href="https://www.coolmath.com/algebra" title="Algebra Lessons">Algebra Lessons</a></li><li ><a href="https://www.coolmath.com/precalculus-review-calculus-intro" title="Pre-Calculus Lessons">Pre-Calculus Lessons</a></li><li ><a href="https://coolmath.com/reference/online-math-dictionary" title="Math Dictionary">Math Dictionary</a></li><li ><a href="https://www.coolmath.com/algebra/08-lines" title="Lines">Lines</a></li><li ><a href="https://www.coolmath.com/prealgebra/00-factors-primes" title="Factors and Primes">Factors and Primes</a></li><li ><a href="https://www.coolmath.com/prealgebra/02-decimals" title="Decimals">Decimals</a></li><li ><a href="https://www.coolmath.com/prealgebra/06-properties" title="Properties">Properties</a></li></ul></li><li class="mb-3 mr-3 menu__item is-expanded expanded footer-menu-column-3"><span class="menu__link nolink">MORE FROM COOLMATH</span><ul class="footer-menu"><li ><a href="https://www.coolmath4kids.com" title="Coolmath4Kids">Coolmath4Kids</a></li><li ><a href="https://www.coolmath4kids.com/manipulatives/ten-frame" title="Ten Frame Manipulative">Ten Frame Manipulative</a></li><li ><a href="https://www.coolmath4kids.com/manipulatives/base-ten-blocks" title="Base Ten Blocks Manipulative">Base Ten Blocks Manipulative</a></li><li ><a href="https://www.coolmath4kids.com/manipulatives/number-line" title="Number Line Manipulative">Number Line Manipulative</a></li><li ><a href="https://www.coolmath4kids.com/manipulatives/pattern-blocks" title="Pattern Blocks Manipulative">Pattern Blocks Manipulative</a></li><li ><a href="https://www.coolmath4kids.com/quizzes" title="Math Quizzes">Math Quizzes</a></li><li ><a href="https://www.coolmath4teachers.com" title="Coolmath4Teachers">Coolmath4Teachers</a></li><li ><a href="https://www.coolmath4parents.com" title="Coolmath4Parents">Coolmath4Parents</a></li></ul></li><li class="mb-3 mr-3 menu__item is-expanded expanded footer-menu-column-4"><span class="menu__link nolink">Follow us</span><ul class="footer-menu"><li ><a href="https://www.tiktok.com/@coolmathofficial">TikTok</a></li><li ><a href="https://twitter.com/TheRealCoolmath">Twitter</a></li><li ><a href="https://www.instagram.com/coolmathgames/">Instagram</a></li><li ><a href="https://www.facebook.com/CoolMathGamesLLC">Facebook</a></li><li ><a href="https://www.youtube.com/@CoolmathGamesdotcom">YouTube</a></li></ul></li></ul></div></div></div>

<div id="block-languagedropdownswitcher" class="settings-tray-editable large-game-item block block-lang-dropdown block-language-dropdown-blocklanguage-interface" data-drupal-settingstray="editable">
  
      <h2 class="common-title">
      <span class="title-with-button">Select a Language</span>
    </h2>
    
      <div class="view-content">
      <form class="lang-dropdown-form lang_dropdown_form clearfix language_interface form-placeholder-include-children large-game-item" id="lang_dropdown_form_lang-dropdown-form" data-drupal-selector="lang-dropdown-form-2" action="/0-jacksmith" method="post" accept-charset="UTF-8">
  

<div  class="form-basic"><div class="large-game-item js-form-item form-item js-form-type-select form-type-select js-form-item-lang-dropdown-select form-item-lang-dropdown-select form-no-label"><div class="form-group"><label  for="edit-lang-dropdown-select" class="large-game-item label--left visually-hidden">Select your language </label><select style="width:165px" class="lang-dropdown-select-element form-select large-game-item form-control" data-lang-dropdown-id="lang-dropdown-form" data-drupal-selector="edit-lang-dropdown-select" id="edit-lang-dropdown-select" name="lang_dropdown_select"><option value="en" selected="selected">English</option><option value="es">Español</option><option value="pt-br">Português</option><option value="fr">Français</option><option value="it">Italiano</option><option value="hi">हिन्दी</option><option value="zh-hans">简体中文</option><option value="fil">Filipino</option><option value="ja">日本語</option><option value="vi">Tiếng Việt</option></select></div></div></div>  
<input data-drupal-selector="edit-en" type="hidden" name="en" value="/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-es" type="hidden" name="es" value="/es/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-pt-br" type="hidden" name="pt-br" value="/pt-br/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-fr" type="hidden" name="fr" value="/fr/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-it" type="hidden" name="it" value="/it/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-hi" type="hidden" name="hi" value="/hi/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-zh-hans" type="hidden" name="zh-hans" value="/zh-hans/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-fil" type="hidden" name="fil" value="/fil/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-ja" type="hidden" name="ja" value="/ja/0-jacksmith" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-vi" type="hidden" name="vi" value="/vi/0-jacksmith" class="large-game-item form-control" />
<noscript><div>



  <input data-drupal-selector="edit-submit" type="submit" id="edit-submit" name="op" value="Go" class="button js-form-submit form-submit large-game-item btn btn-primary" />
</div></noscript>  
<input autocomplete="off" data-drupal-selector="form-weg30ge5ml78aho5wo-vbnok0-ai0njfpgsp02a6-nq" type="hidden" name="form_build_id" value="form-WEg30ge5ML78AhO5WO_vbnOK0_Ai0njfPgSp02A6-NQ" class="large-game-item form-control" />
  
<input data-drupal-selector="edit-lang-dropdown-form" type="hidden" name="form_id" value="lang_dropdown_form" class="large-game-item form-control" />

</form>

    </div>
  </div></li><li><div class="copyright-wrapper text-left"><p>&copy; 2023 Coolmath.com LLC. All Rights Reserved. </p></div></li></ol></div></div></div></div></footer></div><link rel="stylesheet" media="all" href="/sites/default/files/css/css_2GKVaUaPR_rRQjTXVbNHiIUGvkjXnH7H98pcq6YP-Ic.css" />
<link rel="stylesheet" media="all" href="/sites/default/files/css/css_f2syzWieyWUmB_R09cLmbnT4qd2NsrOXRfMX_GCX_18.css" />
<link rel="stylesheet" media="all" href="/themes/custom/coolmath/assets/themes/css/_coolmath_default.css?rv6vb7" id="styleswitcher-css" />
<script src="/sites/default/files/js/js_kMblXiXhb6LQArqohevFW1-Oiaf-eCAepkWmf8b-yRE.js" type="deferjs"></script>
<!--pwa codes start here--><div class="add-button-wrap" style="opacity: 0;visibility: hidden"><img src="/pwa/images/icon-72x72.png" width="46" height="46" alt="coolmath logo"/><button class="add-button">+ Add to home screen</button><span class="close-button">X</span></div><script>
      var winLocation = window.location;
      var startUrl = winLocation.href+"?utm_source=PWA&utm_medium=homescreen";
      var hostName = winLocation.origin;
      var dymAppName = "Coolmath Games";
      var iOSAppName = "Coolmath";
      if($('.node-type-game').length){
        dymAppName = $('.cmatgame-title').text();
        iOSAppName = dymAppName;
      }
      var myDynamicManifest = {
        "name": dymAppName,
        "short_name": dymAppName,
        "start_url": startUrl,
        "scope": startUrl,
        "display": "standalone",
        "background_color":"#16202c",
        "theme_color": "#2A445D",
        "orientation": "portrait-primary",
        "description": "Free Online Math Games, Cool Puzzles, and More",
        "icons" :[
            {
              "src":'https://www.coolmathgames.com/pwa/images/icon-192x192.png',
              "sizes":"192x192",
              "type":"image/png",
              "purpose": "any"
            },
            {
              "src":'https://www.coolmathgames.com/pwa/images/icon-512x512.png',
              "sizes":"512x512",
              "type":"image/png",
              "purpose": "any"
            }
        ]
      }
      //for manifest link
      //check if mobile
      let isMobile = false;
      if(document.documentElement.classList.contains('mobile-device')){
        isMobile = true;
      }
      if(isMobile){
        const link = document.createElement("link");
        link.rel = "manifest";
        const stringManifest = JSON.stringify(myDynamicManifest);
        link.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(stringManifest));
        document.head.appendChild(link);
        //for app name meta:iOS support
        const appName = document.createElement("meta");
        appName.name = "application-name";
        appName.content = iOSAppName;
        document.head.appendChild(appName);
        //for app Title meta:iOS support
        const appTitle = document.createElement("meta");
        appTitle.name = "apple-mobile-web-app-title";
        appTitle.content = iOSAppName;
        document.head.appendChild(appTitle);
      }
      if("serviceWorker" in navigator){
        navigator.serviceWorker.register('sw.js')
        .then((reg) => console.log("Service worker registered",reg))
        .catch((err) => console.log("Service Workeer not registered",err))
      }
      let deferredPrompt;
      const addBtnWrap = document.querySelector('.add-button-wrap');
      const addBtn = document.querySelector('.add-button');
      const closeBtn = document.querySelector('.close-button');
      const body = document.querySelector('body');
      var cookieEnabled = navigator.cookieEnabled;
      const checkA2hs = cookieEnabled ? sessionStorage.getItem('a2hsBtn') : 'false';
      closeBtn.addEventListener('click', function(){
        sessionStorage.setItem("a2hsBtn", closed);
        body.classList.remove('a2hs-show');
      })
      window.addEventListener('beforeinstallprompt', (e) => {
        e.preventDefault();
        deferredPrompt = e;
        if(checkA2hs!=='false'){
        body.classList.add('a2hs-show');
        }
        addBtn.addEventListener('click', (e) => {
          body.classList.remove('a2hs-show');
          deferredPrompt.prompt();
          deferredPrompt.userChoice.then((choiceResult) => {
              if (choiceResult.outcome === 'accepted') {
                console.log('User accepted the A2HS prompt');
              } else {
                console.log('User dismissed the A2HS prompt');
              }
              deferredPrompt = null;
            });