var requirejs,require,define;!function(a){function b(a,b){return r.call(a,b)}function c(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=p.map,q=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,p.nodeIdCompat&&t.test(a[g])&&(a[g]=a[g].replace(t,"")),a=n.concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||q)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function d(b,c){return function(){return k.apply(a,s.call(arguments,0).concat([b,c]))}}function e(a){return function(b){return c(b,a)}}function f(a){return function(b){n[a]=b}}function g(c){if(b(o,c)){var d=o[c];delete o[c],q[c]=!0,j.apply(a,d)}if(!b(n,c)&&!b(q,c))throw new Error("No "+c);return n[c]}function h(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function i(a){return function(){return p&&p.config&&p.config[a]||{}}}var j,k,l,m,n={},o={},p={},q={},r=Object.prototype.hasOwnProperty,s=[].slice,t=/\.js$/;l=function(a,b){var d,f=h(a),i=f[0];return a=f[1],i&&(i=c(i,b),d=g(i)),i?a=d&&d.normalize?d.normalize(a,e(b)):c(a,b):(a=c(a,b),f=h(a),i=f[0],a=f[1],i&&(d=g(i))),{f:i?i+"!"+a:a,n:a,pr:i,p:d}},m={require:function(a){return d(a)},exports:function(a){var b=n[a];return"undefined"!=typeof b?b:n[a]={}},module:function(a){return{id:a,uri:"",exports:n[a],config:i(a)}}},j=function(c,e,h,i){var j,k,p,r,s,t,u=[],v=typeof h;if(i=i||c,"undefined"===v||"function"===v){for(e=!e.length&&h.length?["require","exports","module"]:e,s=0;s<e.length;s+=1)if(r=l(e[s],i),k=r.f,"require"===k)u[s]=m.require(c);else if("exports"===k)u[s]=m.exports(c),t=!0;else if("module"===k)j=u[s]=m.module(c);else if(b(n,k)||b(o,k)||b(q,k))u[s]=g(k);else{if(!r.p)throw new Error(c+" missing "+k);r.p.load(r.n,d(i,!0),f(k),{}),u[s]=n[k]}p=h?h.apply(n[c],u):void 0,c&&(j&&j.exports!==a&&j.exports!==n[c]?n[c]=j.exports:p===a&&t||(n[c]=p))}else c&&(n[c]=h)},requirejs=require=k=function(b,c,d,e,f){if("string"==typeof b)return m[b]?m[b](c):g(l(b,c).f);if(!b.splice){if(p=b,p.deps&&k(p.deps,p.callback),!c)return;c.splice?(b=c,c=d,d=null):b=a}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?j(a,b,c,d):setTimeout(function(){j(a,b,c,d)},4),k},k.config=function(a){return k(a)},requirejs._defined=n,define=function(a,c,d){c.splice||(d=c,c=[]),b(n,a)||b(o,a)||(o[a]=[a,c,d])},define.amd={jQuery:!0}}();
define("gamesound",[],function(){var e=function(e,t){var n=this,r=new Audio(e);this.soundobj=r,r.addEventListener("canplay",function(){t&&t(n)}),this.isPlaying=!1,this.play=function(){this.isPlaying&&(this.soundobj.pause(),this.soundobj.currentTime=0),this.isPlaying=!0,this.soundobj.play()},this.pause=function(){this.isPlaying=!1,this.soundobj.pause()},this.stop=function(){this.pause(),this.soundobj.currentTime=0}};return{create:function(t,n){return new e(t,n)}}}),define("sounds",["gamesound"],function(e){var t={},n={lvl_1:"audio/Nightsky.wav",lvl_2:"audio/Ocean.wav",lvl_3:"audio/Kitchen.wav",flip:"audio/FlipCard.wav",match:"audio/GetMatch.wav",mismatch:"audio/WrongLose.wav",click:"audio/NavClick.wav",win:"audio/WinLevel.wav"},r={},i=function(t,i){var s=n[t];r[t]=e.create(s,function(e){i&&i(e)})},s=function(e){r[e]?r[e].play():i(e,function(e){e.play()})},o=function(e){r[e]&&r[e].pause()},u=function(e){r[e]&&r[e].stop()};return t.click=function(){s("click")},t.flip=function(){s("flip")},
t.win=function(){s("win")},t.match=function(){s("match")},t.mismatch=function(){s("mismatch")},t.pause_level_sound=function(e){e=typeof e=="undefined"?game_level:e,e>0&&o("lvl_"+e)},t.play_level_sound=function(e){e=typeof e=="undefined"?game_level:e,e>0&&s("lvl_"+e)},t.stop_bg_sounds=function(){for(var e=1;e<=3;e++)u("lvl_"+e)},t.loadAll=function(){for(var e in n)i(e)},t}),define("help",[],function(){return function(e,t){var n=document.getElementById(e),r=document.getElementById(t+"dialog"),i=document.getElementById(t+"close"),s=document.getElementById(t+"title"),o=document.getElementById(t+"contents");n.addEventListener("click",function(){r.className="helpdialog shown"}),i.addEventListener("click",function(){r.className="helpdialog"})}}),define("license",[],function(){return function(e,t){var n=document.getElementById(e+"btnl"),r=document.getElementById(e+"btnq"),i=document.getElementById(e+"page"),s=document.getElementById(t),o=document.getElementById(e+"text"),u=document.getElementById
(e+"scroll"),a;n.onclick=function(){var e=2,t=0,n=1e3;u.style.top="0px",s.style.display="none",i.style.display="block";var r=u.clientHeight-o.clientHeight;a=setInterval(function(){var i=(new Date).getTime(),s=t==0?20:i-t;t=i,n-=s;if(n>0)return;var o=Math.abs(parseInt(u.style.top))+s/40*e;o>0?u.style.top=-1*o+"px":u.style.top="0px",o>=r?(n=5e3,e=-20):o<=0&&(n=5e3,e=2)},40)},r.onclick=function(){s.style.display="block",i.style.display="none",clearInterval(a)}}});if(!window.af||typeof e!="function"){var e=function(t){"use strict";function p(e,t){return typeof t=="number"&&!c[e.toLowerCase()]?t+"px":t}function d(e,t,n){var i=r.createDocumentFragment();if(n){for(var s=e.length-1;s>=0;s--)i.insertBefore(e[s],i.firstChild);t.insertBefore(i,t.firstChild)}else{for(var o=0;o<e.length;o++)i.appendChild(e[o]);t.appendChild(i)}i=null}function v(e){return e in o?o[e]:o[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function m(e){for(var t=0;t<e.length;t++)e.indexOf(e[t])!==t&&(e.splice(t,1),t--);return e}function g
(e,t){var r=[];if(e==n)return r;for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&r.push(e);return r}function w(e,t){try{return t.querySelectorAll(e)}catch(n){return[]}}function E(e,t){e=e.trim();if(e[0]==="#"&&e.indexOf(".")===-1&&e.indexOf(",")===-1&&e.indexOf(" ")===-1&&e.indexOf(">")===-1)t===r?S(t.getElementById(e.replace("#","")),this):S(w(e,t),this);else if(e[0]==="<"&&e[e.length-1]===">"||e.indexOf("<")!==-1&&e.indexOf(">")!==-1){var n=r.createElement("div");h?MSApp.execUnsafeLocalFunction(function(){n.innerHTML=e.trim()}):n.innerHTML=e.trim(),S(n.childNodes,this)}else S(w(e,t),this);return this}function S(e,t){if(!e)return;if(e.nodeType){t[t.length++]=e;return}for(var n=0,r=e.length;n<r;n++)t[t.length++]=e[n]}function x(){}function T(e,n){e.os={},e.os.webkit=n.match(/WebKit\/([\d.]+)/)?!0:!1,e.os.android=n.match(/(Android)\s+([\d.]+)/)||n.match(/Silk-Accelerated/)?!0:!1,e.os.androidICS=e.os.android&&n.match(/(Android)\s4/)?!0:!1,e.os.ipad=n.match(/(iPad).*OS\s([\d_]+)/)?!0:!1,e.os.
iphone=!e.os.ipad&&n.match(/(iPhone\sOS)\s([\d_]+)/)?!0:!1,e.os.ios7=(e.os.ipad||e.os.iphone)&&n.match(/7_/)||(e.os.ipad||e.os.iphone)&&n.match(/8_/)?!0:!1,e.os.webos=n.match(/(webOS|hpwOS)[\s\/]([\d.]+)/)?!0:!1,e.os.touchpad=e.os.webos&&n.match(/TouchPad/)?!0:!1,e.os.ios=e.os.ipad||e.os.iphone,e.os.playbook=n.match(/PlayBook/)?!0:!1,e.os.blackberry10=n.match(/BB10/)?!0:!1,e.os.blackberry=e.os.playbook||e.os.blackberry10||n.match(/BlackBerry/)?!0:!1,e.os.chrome=n.match(/Chrome/)?!0:!1,e.os.opera=n.match(/Opera/)?!0:!1,e.os.fennec=n.match(/fennec/i)?!0:n.match(/Firefox/)?!0:!1,e.os.ie=n.match(/MSIE 10.0/i)||n.match(/Trident\/7/i)?!0:!1,e.os.ieTouch=e.os.ie&&n.toLowerCase().match(/touch/i)?!0:!1,e.os.tizen=n.match(/Tizen/i)?!0:!1,e.os.supportsTouch=t.DocumentTouch&&r instanceof t.DocumentTouch||"ontouchstart"in t,e.os.kindle=n.match(/Silk-Accelerated/)?!0:!1,e.feat={};var i=r.documentElement.getElementsByTagName("head")[0];e.feat.nativeTouchScroll=typeof i.style["-webkit-overflow-scrolling"
]!="undefined"&&(e.os.ios||e.os.blackberry10),e.feat.cssPrefix=e.os.webkit?"Webkit":e.os.fennec?"Moz":e.os.ie?"ms":e.os.opera?"O":"",e.feat.cssTransformStart=e.os.opera?"(":"3d(",e.feat.cssTransformEnd=e.os.opera?")":",0)",e.os.android&&!e.os.webkit&&(e.os.android=!1);var s=["Webkit","Moz","ms","O"];for(var o=0;o<s.length;o++)r.documentElement.style[s[o]+"Transform"]===""&&(e.feat.cssPrefix=s[o])}function k(e){return e._afmid||(e._afmid=C++)}function L(e,t,n,r){t=A(t);if(t.ns)var i=O(t.ns);return(N[k(e)]||[]).filter(function(e){return e&&(!t.e||e.e===t.e)&&(!t.ns||i.test(e.ns))&&(!n||e.fn===n||typeof e.fn=="function"&&typeof n=="function"&&e.fn===n)&&(!r||e.sel===r)})}function A(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function O(e){return new RegExp("(?:^| )"+e.replace(" "," .* ?")+"(?: |$)")}function M(e,t,n){b.isObject(e)?b.each(e,n):e.split(/\s/).forEach(function(e){n(e,t)})}function _(e,t,n,r,i){var s=k(e),o=N[s]||(N[s]=[]);M(t,n,function(t,n){var s=
i&&i(n,t),u=s||n,a=function(t){if(t.ns){var n=O(t.ns);if(!n.test(f.ns))return}var r=u.apply(e,[t].concat(t.data));return r===!1&&t.preventDefault(),r},f=b.extend(A(t),{fn:n,proxy:a,sel:r,del:s,i:o.length});o.push(f),e.addEventListener(f.e,a,!1)})}function D(e,t,n,r){var i=k(e);M(t||"",n,function(t,n){L(e,t,n,r).forEach(function(t){delete N[i][t.i],e.removeEventListener(t.e,t.proxy,!1)})})}function j(e){var t=b.extend({originalEvent:e},e);return b.each(B,function(n,r){t[n]=function(){this[r]=P;if(n==="stopImmediatePropagation"||n==="stopPropagation"){e.cancelBubble=!0;if(!e[n])return}return e[n].apply(e,arguments)},t[r]=H}),t}function F(e,t,n,r,i){_(e,t,n,r,function(t){return function(n){var s,o=b(n.target).closest(r,e).get(0);if(o)return s=b.extend(j(n),{currentTarget:o,liveFired:e,delegateTarget:e,data:i}),t.apply(o,[s].concat([].slice.call(arguments,1)))}})}function I(e,t){if(t&&e.dispatchEvent){var n=b.Event("destroy",{bubbles:!1});e.dispatchEvent(n)}var r=k(e);if(r&&N[r]){for(var i in 
N[r])e.removeEventListener(N[r][i].e,N[r][i].proxy,!1);delete N[r]}}function q(e,t){if(!e)return;var n=e.childNodes;if(n&&n.length>0)for(var r=0;r<n.length;r++)q(n[r],t);I(e,t)}var n,r=t.document,i=[],s=i.slice,o={},u=1,a=/<(\w+)[^>]*>/,f={},l={},c={columncount:!0,fontweight:!0,lineheight:!0,"column-count":!0,"font-weight":!0,"line-height":!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,"z-index":!0,zoom:!0},h=typeof MSApp=="object",y=function(t,i){this.length=0;if(!t)return this;if(t instanceof y&&i==n)return t;if(e.isFunction(t))return e(r).ready(t);if(e.isArray(t)&&t.length!=n){for(var s=0;s<t.length;s++)this[this.length++]=t[s];return this}if(e.isObject(t)&&e.isObject(i)){if(t.length==n)t.parentNode==i&&(this[this.length++]=t);else for(var o=0;o<t.length;o++)t[o].parentNode==i&&(this[this.length++]=t[o]);return this}if(e.isObject(t)&&i==n)return this[this.length++]=t,this;if(i!==n){if(i instanceof y)return i.find(t)}else i=r;return this.selector(t,i)},b=function(e,t){return new y(e,t)}
;b.is$=function(e){return e instanceof y},b.map=function(e,t){var r,i=[],s,o;if(b.isArray(e))for(s=0;s<e.length;s++)r=t.apply(e[s],[e[s],s]),r!==n&&i.push(r);else if(b.isObject(e))for(o in e){if(!e.hasOwnProperty(o)||o==="length")continue;r=t(e[o],[e[o],o]),r!==n&&i.push(r)}return i},b.each=function(e,t){var n,r;if(b.isArray(e)){for(n=0;n<e.length;n++)if(t(n,e[n])===!1)return e}else if(b.isObject(e))for(r in e){if(!e.hasOwnProperty(r)||r==="length")continue;if(t(r,e[r])===!1)return e}return e},b.extend=function(e){e==n&&(e=this);if(arguments.length===1){for(var t in e)this[t]=e[t];return this}return s.call(arguments,1).forEach(function(t){for(var n in t)e[n]=t[n]}),e},b.isArray=function(e){return e instanceof Array&&e.push!=n},b.isFunction=function(e){return typeof e=="function"&&!(e instanceof RegExp)},b.isObject=function(e){return typeof e=="object"&&e!==null},b.fn=y.prototype={namespace:"appframework",constructor:y,forEach:i.forEach,reduce:i.reduce,push:i.push,indexOf:i.indexOf,concat
:i.concat,selector:E,oldElement:undefined,sort:i.sort,slice:i.slice,length:0,setupOld:function(e){return e==n?b():(e.oldElement=this,e)},map:function(e){var t,r=[],i;for(i=0;i<this.length;i++)t=e.apply(this[i],[i,this[i]]),t!==n&&r.push(t);return b(r)},each:function(e){return this.forEach(function(t,n){e.call(t,n,t)}),this},ready:function(e){return r.readyState==="complete"||r.readyState==="loaded"||!b.os.ie&&r.readyState==="interactive"?e():r.addEventListener("DOMContentLoaded",e,!1),this},find:function(e){if(this.length===0)return this;var t=[],n;for(var r=0;r<this.length;r++){n=b(e,this[r]);for(var i=0;i<n.length;i++)t.push(n[i])}return b(m(t))},html:function(e,t){var r=function(){s.innerHTML=e};if(this.length===0)return this;if(e===n)return this[0].innerHTML;for(var i=0;i<this.length;i++){t!==!1&&b.cleanUpContent(this[i],!1,!0);if(h){var s=this[i];MSApp.execUnsafeLocalFunction(r)}else this[i].innerHTML=e}return this},text:function(e){if(this.length===0)return this;if(e===n)return this
[0].textContent;for(var t=0;t<this.length;t++)this[t].textContent=e;return this},css:function(e,r,i){var s=i!=n?i:this[0];if(this.length===0)return this;if(r==n&&typeof e=="string")return s.style[e]?s.style[e]:t.getComputedStyle(s)[e];for(var o=0;o<this.length;o++)if(b.isObject(e))for(var u in e)this[o].style[u]=p(u,e[u]);else this[o].style[e]=p(e,r);return this},vendorCss:function(e,t,n){return this.css(b.feat.cssPrefix+e,t,n)},cssTranslate:function(e){return this.vendorCss("Transform","translate"+b.feat.cssTransformStart+e+b.feat.cssTransformEnd)},computedStyle:function(e){if(this.length===0||e==n)return;return t.getComputedStyle(this[0],"")[e]},empty:function(){for(var e=0;e<this.length;e++)b.cleanUpContent(this[e],!1,!0),this[e].textContent="";return this},hide:function(){if(this.length===0)return this;for(var e=0;e<this.length;e++)this.css("display",null,this[e])!=="none"&&(this[e].setAttribute("afmOldStyle",this.css("display",null,this[e])),this[e].style.display="none");return this
},show:function(){if(this.length===0)return this;for(var e=0;e<this.length;e++)this.css("display",null,this[e])==="none"&&(this[e].style.display=this[e].getAttribute("afmOldStyle")?this[e].getAttribute("afmOldStyle"):"block",this[e].removeAttribute("afmOldStyle"));return this},toggle:function(e){if(this.length===0)return this;var t=e===!0;for(var r=0;r<this.length;r++)this.css("display",null,this[r])==="none"||e!=n&&t!==!1?this.css("display",null,this[r])==="none"&&(e==n||t===!0)&&(this[r].style.display=this[r].getAttribute("afmOldStyle")?this[r].getAttribute("afmOldStyle"):"block",this[r].removeAttribute("afmOldStyle")):(this[r].setAttribute("afmOldStyle",this.css("display",null,this[r])),this[r].style.display="none");return this},val:function(e){if(this.length===0)return e===n?undefined:this;if(e==n)return this[0].value;for(var t=0;t<this.length;t++)this[t].value=e;return this},attr:function(e,t){if(this.length===0)return t===n?undefined:this;if(t===n&&!b.isObject(e)){var r=this[0].afmCacheId&&
f[this[0].afmCacheId]&&f[this[0].afmCacheId][e]?f[this[0].afmCacheId][e]:this[0].getAttribute(e);return r}for(var i=0;i<this.length;i++)if(b.isObject(e))for(var s in e)b(this[i]).attr(s,e[s]);else b.isArray(t)||b.isObject(t)||b.isFunction(t)?(this[i].afmCacheId||(this[i].afmCacheId=b.uuid()),f[this[i].afmCacheId]||(f[this[i].afmCacheId]={}),f[this[i].afmCacheId][e]=t):t===null?(this[i].removeAttribute(e),this[i].afmCacheId&&f[this[i].afmCacheId][e]&&delete f[this[i].afmCacheId][e]):(this[i].setAttribute(e,t),this[i].afmCacheId&&f[this[i].afmCacheId][e]&&delete f[this[i].afmCacheId][e]);return this},removeAttr:function(e){var t=function(t){n[r].removeAttribute(t),n[r].afmCacheId&&f[n[r].afmCacheId]&&delete f[n[r].afmCacheId][e]},n=this;for(var r=0;r<this.length;r++)e.split(/\s+/g).forEach(t);return this},prop:function(e,t){if(this.length===0)return t===n?undefined:this;if(t===n&&!b.isObject(e)){var r,i=this[0].afmCacheId&&l[this[0].afmCacheId]&&l[this[0].afmCacheId][e]?l[this[0].afmCacheId
][e]:!(r=this[0][e])&&e in this[0]?this[0][e]:r;return i}for(var s=0;s<this.length;s++)if(b.isObject(e))for(var o in e)b(this[s]).prop(o,e[o]);else b.isArray(t)||b.isObject(t)||b.isFunction(t)?(this[s].afmCacheId||(this[s].afmCacheId=b.uuid()),l[this[s].afmCacheId]||(l[this[s].afmCacheId]={}),l[this[s].afmCacheId][e]=t):t===null&&t!==undefined?b(this[s]).removeProp(e):(b(this[s]).removeProp(e),this[s][e]=t);return this},removeProp:function(e){var t=function(t){n[r][t]&&(n[r][t]=undefined),n[r].afmCacheId&&l[n[r].afmCacheId]&&delete l[n[r].afmCacheId][e]},n=this;for(var r=0;r<this.length;r++)e.split(/\s+/g).forEach(t);return this},remove:function(e){var t=b(this).filter(e);if(t==n)return this;for(var r=0;r<t.length;r++)b.cleanUpContent(t[r],!0,!0),t[r]&&t[r].parentNode&&t[r].parentNode.removeChild(t[r]);return this},addClass:function(e){var t=function(e){o.hasClass(e,o[r])||s.push(e)};if(e==n)return this;for(var r=0;r<this.length;r++){var i=this[r].className,s=[],o=this;e.split(/\s+/g).forEach
(t),this[r].className+=(i?" ":"")+s.join(" "),this[r].className=this[r].className.trim()}return this},removeClass:function(e){if(e==n)return this;var t=function(e){i=i.replace(v(e)," ")};for(var r=0;r<this.length;r++){if(e==n)return this[r].className="",this;var i=this[r].className;typeof this[r].className=="object"&&(i=" "),e.split(/\s+/g).forEach(t),i.length>0?this[r].className=i.trim():this[r].className=""}return this},toggleClass:function(e,t){if(e==n)return this;for(var r=0;r<this.length;r++)typeof t!="boolean"&&(t=this.hasClass(e,this[r])),b(this[r])[t?"removeClass":"addClass"](e);return this},replaceClass:function(e,t){if(e==n||t==n)return this;var r=function(e){s=s.replace(v(e)," ")};for(var i=0;i<this.length;i++){if(e==n){this[i].className=t;continue}var s=this[i].className;e.split(/\s+/g).concat(t.split(/\s+/g)).forEach(r),s=s.trim(),s.length>0?this[i].className=(s+" "+t).trim():this[i].className=t}return this},hasClass:function(e,t){return this.length===0?!1:(t||(t=this[0]),v
(e).test(t.className))},append:function(e,i,s){if(e&&e.length!=n&&e.length===0)return this;if(b.isArray(e)||b.isObject(e))e=b(e);var o,u;i&&b(this).add(i);for(o=0;o<this.length;o++)if(e.length&&typeof e!="string")e=b(e),d(e,this[o],s);else{var f=a.test(e)?b(e):undefined;if(f==n||f.length===0)f=r.createTextNode(e);if(f instanceof y)for(var l=0,c=f.length;l<c;l++)u=f[l],u.nodeName==n||u.nodeName.toLowerCase()!=="script"||!!u.type&&u.type.toLowerCase()!=="text/javascript"?d(b(u),this[o],s):t.eval(u.innerHTML);else s!=n?this[o].insertBefore(f,this[o].firstChild):this[o].appendChild(f)}return this},appendTo:function(e){var t=b(e);return t.append(this),this},prependTo:function(e){var t=b(e);return t.append(this,null,!0),this},prepend:function(e){return this.append(e,null,1)},insertBefore:function(e,t){if(this.length===0)return this;e=b(e).get(0);if(!e)return this;for(var n=0;n<this.length;n++)t?e.parentNode.insertBefore(this[n],e.nextSibling):e.parentNode.insertBefore(this[n],e);return this},
insertAfter:function(e){this.insertBefore(e,!0)},get:function(e){e=e==n?null:e,e<0&&(e+=this.length);if(e===null){var t=[];for(var r=0;r<this.length;r++)t.push(this[r]);return t}return this[e]?this[e]:undefined},offset:function(){var e;return this.length===0?this:this[0]===t?{left:0,top:0,right:0,bottom:0,width:t.innerWidth,height:t.innerHeight}:(e=this[0].getBoundingClientRect(),{left:e.left+t.pageXOffset,top:e.top+t.pageYOffset,right:e.right+t.pageXOffset,bottom:e.bottom+t.pageYOffset,width:e.right-e.left,height:e.bottom-e.top})},height:function(e){if(this.length===0)return this;if(e!=n)return this.css("height",e);if(this[0]===this[0].window)return t.innerHeight;if(this[0].nodeType===this[0].DOCUMENT_NODE)return this[0].documentElement.offsetHeight;var r=this.computedStyle("height").replace("px","");return r?+r:this.offset().height},width:function(e){if(this.length===0)return this;if(e!=n)return this.css("width",e);if(this[0]===this[0].window)return t.innerWidth;if(this[0].nodeType===
this[0].DOCUMENT_NODE)return this[0].documentElement.offsetWidth;var r=this.computedStyle("width").replace("px","");return r?+r:this.offset().width},parent:function(e,t){if(this.length===0)return this;var n=[];for(var i=0;i<this.length;i++){var s=this[i];while(s.parentNode&&s.parentNode!==r){n.push(s.parentNode),s.parentNode&&(s=s.parentNode);if(!t)break}}return this.setupOld(b(m(n)).filter(e))},parents:function(e){return this.parent(e,!0)},children:function(e){if(this.length===0)return this;var t=[];for(var n=0;n<this.length;n++)t=t.concat(g(this[n].firstChild));return this.setupOld(b(t).filter(e))},siblings:function(e){if(this.length===0)return this;var t=[];for(var n=0;n<this.length;n++)this[n].parentNode&&(t=t.concat(g(this[n].parentNode.firstChild,this[n])));return this.setupOld(b(t).filter(e))},contents:function(e){if(this.length===0)return this;var t=[];for(var n=0;n<this.length;n++)this[n].parentNode&&S(this[n].childNodes,t);return this.setupOld(b(t).filter(e))},closest:function(
e,t){if(this.length===0)return this;var n=this[0],i=b(e,t);if(i.length===0)return b();while(n&&i.indexOf(n)===-1)n=n!==t&&n!==r&&n.parentNode;return b(n)},filter:function(e){if(this.length===0)return this;if(e==n)return this;var t=[];for(var r=0;r<this.length;r++){var i=this[r];i.parentNode&&b(e,i.parentNode).indexOf(i)>=0&&t.push(i)}return this.setupOld(b(m(t)))},not:function(e){if(this.length===0)return this;var t=[];for(var n=0;n<this.length;n++){var r=this[n];r.parentNode&&b(e,r.parentNode).indexOf(r)===-1&&t.push(r)}return this.setupOld(b(m(t)))},data:function(e,t){return this.attr("data-"+e,t)},end:function(){return this.oldElement!=n?this.oldElement:b()},clone:function(e){e=e===!1?!1:!0;if(this.length===0)return this;var t=[];for(var n=0;n<this.length;n++)t.push(this[n].cloneNode(e));return b(t)},size:function(){return this.length},serialize:function(){if(this.length===0)return"";var e=function(e){var n=e.getAttribute("type");if(e.nodeName.toLowerCase()!=="fieldset"&&!e.disabled&&
n!=="submit"&&n!=="reset"&&n!=="button"&&(n!=="radio"&&n!=="checkbox"||e.checked)&&e.getAttribute("name"))if(e.type==="select-multiple")for(var r=0;r<e.options.length;r++)e.options[r].selected&&t.push(e.getAttribute("name")+"="+encodeURIComponent(e.options[r].value));else t.push(e.getAttribute("name")+"="+encodeURIComponent(e.value))},t=[];for(var n=0;n<this.length;n++)this.slice.call(this[n].elements).forEach(e);return t.join("&")},eq:function(e){return b(this.get(e))},index:function(e){return e?this.indexOf(b(e)[0]):this.parent().children().indexOf(this[0])},is:function(e){return!!e&&this.filter(e).length>0},add:function(e){var t=b(e),n,r=t.length;for(n=0;n<r;n++)this[this.length++]=t[n];return this}},b.ajaxSettings={type:"GET",beforeSend:x,success:x,error:x,complete:x,context:undefined,timeout:0,crossDomain:null,processData:!0},b.jsonP=function(e){if(h)return e.type="get",e.dataType=null,b.get(e);var n="jsonp_callback"+ ++u,i="",s,o,a=r.createElement("script");t[n]=function(r){clearTimeout
(i),b(a).remove(),delete t[n],e.success.call(s,r)};if(e.url.indexOf("callback=?")!==-1)a.src=e.url.replace(/=\?/,"="+n);else{o=e.jsonp?e.jsonp:"callback";if(e.url.indexOf("?")===-1)e.url+="?"+o+"="+n;else if(e.url.indexOf("callback=")!==-1){var f="callback=",l=e.url.indexOf(f)+f.length,c=e.url.indexOf(l);c===-1&&(c=e.url.length);var p=e.url.substr(l,c);e.url=e.url.replace(f+p,f+n),p=p.replace("window.",""),e.success=t[p]}else e.url+="&"+o+"="+n;a.src=e.url}return e.error&&(a.onerror=function(){clearTimeout(i),e.error.call(s,"","error")}),b("head").append(a),e.timeout>0&&(i=setTimeout(function(){e.error.call(s,"","timeout")},e.timeout)),{}},b.ajax=function(e){var n,r=b.Deferred();if(typeof e=="string"){var i=e;e={url:i}}var s=e||{};for(var o in b.ajaxSettings)typeof s[o]=="undefined"&&(s[o]=b.ajaxSettings[o]);try{s.url||(s.url=t.location),s.headers||(s.headers={});if(!("async"in s)||s.async!==!1)s.async=!0;s.processData&&b.isObject(s.data)&&(s.data=b.param(s.data)),s.type.toLowerCase()==="get"&&
s.data&&(s.url.indexOf("?")===-1?s.url+="?"+s.data:s.url+="&"+s.data),s.data&&!s.contentType&&s.contentType!==!1&&(s.contentType="application/x-www-form-urlencoded; charset=UTF-8");if(!s.dataType)s.dataType="text/html";else switch(s.dataType){case"script":s.dataType="text/javascript, application/javascript";break;case"json":s.dataType="application/json";break;case"xml":s.dataType="application/xml, text/xml";break;case"html":s.dataType="text/html";break;case"text":s.dataType="text/plain";break;case"jsonp":return b.jsonP(e);default:s.dataType="text/html"}if(/=\?/.test(s.url))return b.jsonP(s);s.crossDomain===null&&(s.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(s.url)&&RegExp.$2!==t.location.host),s.crossDomain||(s.headers=b.extend({"X-Requested-With":"XMLHttpRequest"},s.headers));var u,a=s.context,f=/^([\w-]+:)\/\//.test(s.url)?RegExp.$1:t.location.protocol;n=new t.XMLHttpRequest,b.extend(n,r.promise),n.onreadystatechange=function(){var e=s.dataType;if(n.readyState===4){clearTimeout(u);var i
,o=!1,l=n.getResponseHeader("content-type");l||(l="");if(n.status>=200&&n.status<300||n.status===0&&f==="file:"){if(l==="application/json"||e==="application/json"&&!/^\s*$/.test(n.responseText))try{i=JSON.parse(n.responseText)}catch(c){o=c}else if(l.indexOf("javascript")!==-1)try{i=n.responseText,t.eval(i)}catch(c){console.log(c)}else e==="application/xml, text/xml"?i=n.responseXML:e==="text/html"?(i=n.responseText,b.parseJS(i)):i=n.responseText;n.status===0&&i.length===0&&(o=!0),o?(s.error.call(a,n,"parsererror",o),r.reject.call(a,n,"parsererror",o)):(r.resolve.call(a,i,"success",n),s.success.call(a,i,"success",n))}else o=!0,r.reject.call(a,n,"error"),s.error.call(a,n,"error");var h=o?"error":"success";s.complete.call(a,n,h)}},n.open(s.type,s.url,s.async),s.withCredentials&&(n.withCredentials=!0),s.contentType&&(s.headers["Content-Type"]=s.contentType);for(var l in s.headers)typeof s.headers[l]=="string"&&n.setRequestHeader(l,s.headers[l]);if(s.beforeSend.call(a,n,s)===!1)return n.abort
(),!1;s.timeout>0&&(u=setTimeout(function(){n.onreadystatechange=x,n.abort(),s.error.call(a,n,"timeout")},s.timeout)),n.send(s.data)}catch(c){r.resolve(a,n,"error",c),s.error.call(a,n,"error",c)}return n},b.get=function(e,t){return this.ajax({url:e,success:t})},b.post=function(e,t,r,i){return b.isFunction(t)&&(r=t,t={}),typeof r=="string"&&(i=r,r=function(){}),i===n&&(i="html"),this.ajax({url:e,type:"POST",data:t,dataType:i,success:r})},b.getJSON=function(e,t,n,r){return typeof t=="function"&&(n=t,t={},r=n),this.ajax({url:e,data:t,success:n,error:r,dataType:"json"})},b.getScript=function(e,t){var n=/^([\w-]+:)?\/\/([^\/]+)/.test(e);if(n){var i=b.Deferred(),s=b.create("script",{async:!0,src:e}).get(0);return s.onload=function(){t&&t(),i.resolve.call(this,"success"),b(this).remove()},s.onerror=function(){b(this).remove(),i.reject.call(this,"success")},r.head.appendChild(s),i.promise}return this.ajax({url:e,success:t,dataType:"script"})},b.param=function(e,t){var n=[];if(e instanceof y)e.each
(function(){var e=t?t+"["+this.id+"]":this.id,r=this.value;n.push(e+"="+encodeURIComponent(r))});else for(var r in e){if(b.isFunction(e[r]))continue;var i=t?t+"["+r+"]":r,s=e[r];n.push(b.isObject(s)?b.param(s,i):i+"="+encodeURIComponent(s))}return n.join("&")},b.parseJSON=function(e){return JSON.parse(e)},b.parseXML=function(e){if(!h)return(new DOMParser).parseFromString(e,"text/xml");MSApp.execUnsafeLocalFunction(function(){return(new DOMParser).parseFromString(e,"text/xml")})},T(b,navigator.userAgent),b.__detectUA=T,b.uuid=function(){var e=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},b.getCssMatrix=function(e){b.is$(e)&&(e=e.get(0));var r=t.WebKitCSSMatrix||t.MSCSSMatrix;if(e===n)return r?new r:{a:0,b:0,c:0,d:0,e:0,f:0};var i=t.getComputedStyle(e),s=i.webkitTransform||i.transform||i[b.feat.cssPrefix+"Transform"];if(r)return new r(s);if(s){var o=s.replace(/[^0-9\-.,]/g,"").split(",");return{a:+o[0],b:+o[1
],c:+o[2],d:+o[3],e:+o[4],f:+o[5]}}return{a:0,b:0,c:0,d:0,e:0,f:0}},b.create=function(e,t){var n,i=new y;if(t||e[0]!=="<"){t.html&&(t.innerHTML=t.html,delete t.html),n=r.createElement(e);for(var s in t)n[s]=t[s];i[i.length++]=n}else n=r.createElement("div"),h?MSApp.execUnsafeLocalFunction(function(){n.innerHTML=e.trim()}):n.innerHTML=e,S(n.childNodes,i);return i},b.query=function(e,t){if(!e)return new y;t=t||r;var n=new y;return n.selector(e,t)};var N=[],C=1;b.event={add:_,remove:D},b.fn.bind=function(e,t){for(var n=0,r=this.length;n<r;n++)_(this[n],e,t);return this},b.fn.unbind=function(e,t){for(var n=0,r=this.length;n<r;n++)D(this[n],e,t);return this},b.fn.one=function(e,t){return this.each(function(n,r){_(this,e,t,null,function(e,t){return function(){D(r,t,e);var n=e.apply(r,arguments);return n}})})};var P=function(){return!0},H=function(){return!1},B={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};
b.fn.delegate=function(e,t,n,r){b.isFunction(n)&&(r=n,n=null);for(var i=0,s=this.length;i<s;i++)F(this[i],t,r,e,n);return this},b.fn.undelegate=function(e,t,n){for(var r=0,i=this.length;r<i;r++)D(this[r],t,n,e);return this},b.fn.on=function(e,t,r,i){return b.isFunction(r)&&(i=r,r=null),t===n||b.isFunction(t)?this.bind(e,t):this.delegate(t,e,r,i)},b.fn.off=function(e,t,r){return t===n||b.isFunction(t)?this.unbind(e,t):this.undelegate(t,e,r)},b.fn.trigger=function(e,t,n){typeof e=="string"&&(n=n||{},e=A(e),n.ns=e.ns,e=b.Event(e.e,n)),e.data=t;for(var r=0,i=this.length;r<i;r++)this[r].dispatchEvent(e);return this},b.Event=function(e,t){var n=r.createEvent("Events"),i=!0;if(t)for(var s in t)s==="bubbles"?i=!!t[s]:n[s]=t[s];return n.initEvent(e,i,!0,null,null,null,null,null,null,null,null,null,null,null,null),n},b.bind=function(e,t,n){if(!e)return;e.__events||(e.__events={}),b.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++)e.__events[t[r]]||(e.__events[t[r]]=[]),e.__events[t[r]].push(n)},b.trigger=
function(e,t,n){if(!e)return;var r=!0;if(!e.__events)return r;b.isArray(t)||(t=[t]),b.isArray(n)||(n=[]);for(var i=0;i<t.length;i++)if(e.__events[t[i]]){var s=e.__events[t[i]].slice(0);for(var o=0;o<s.length;o++)b.isFunction(s[o])&&s[o].apply(e,n)===!1&&(r=!1)}return r},b.unbind=function(e,t,r){if(!e.__events)return;if(t==n){delete e.__events;return}b.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++)if(e.__events[t[i]]){var s=e.__events[t[i]];for(var o=0;o<s.length;o++){r==n&&delete s[o];if(s[o]===r){s.splice(o,1);break}}}},b.proxy=function(e,t,n){return function(){return n?e.apply(t,n):e.apply(t,arguments)}};var R=function(e,t){for(var n=0;n<e.length;n++)q(e[n],t)};b.cleanUpContent=function(e,t,n){if(!e)return;var r=e.childNodes;r&&r.length>0&&b.asap(R,{},[s.apply(r,[0]),n]),t&&I(e,n)};var U=[],z=[],W=[];b.asap=function(e,n,r){if(!b.isFunction(e))throw"$.asap - argument is not a valid function";U.push(e),z.push(n?n:{}),W.push(r?r:[]),t.postMessage("afm-asap","*")},t.addEventListener("message"
,function(e){e.source===t&&e.data==="afm-asap"&&(e.stopPropagation(),U.length>0&&U.shift().apply(z.shift(),W.shift()))},!0);var X={};return b.parseJS=function(e){if(!e)return;if(typeof e=="string"){var n=r.createElement("div");h?MSApp.execUnsafeLocalFunction(function(){n.innerHTML=e}):n.innerHTML=e,e=n}var i=e.getElementsByTagName("script");e=null;for(var s=0;s<i.length;s++)if(i[s].src.length>0&&!X[i[s].src]&&!h){var o=r.createElement("script");o.type=i[s].type,o.src=i[s].src,r.getElementsByTagName("head")[0].appendChild(o),X[i[s].src]=1,o=null}else t.eval(i[s].innerHTML)},["click","keydown","keyup","keypress","submit","load","resize","change","select","error"].forEach(function(e){b.fn[e]=function(t){return t?this.bind(e,t):this.trigger(e)}}),["focus","blur"].forEach(function(e){b.fn[e]=function(t){if(this.length===0)return;if(t)this.bind(e,t);else for(var n=0;n<this.length;n++)try{this[n][e]()}catch(r){}return this}}),b.Deferred=function(){return{reject:function(){},resolve:function(){
},promise:{then:function(){},fail:function(){}}}},b}(window);window.jq=e,"$"in window||(window.$=e),typeof define=="function"&&define.amd?define("appframework",[],function(){"use strict";return e}):typeof module!="undefined"&&module.exports&&(module.exports.af=e,module.exports.$=e),window.numOnly||(window.numOnly=function(t){"use strict";if(t===undefined||t==="")return 0;if(isNaN(parseFloat(t))){if(!t.replace)return 0;t=t.replace(/[^0-9.-]/g,"")}return parseFloat(t)})}define("game",["appframework","sounds"],function(e,t){function o(){ignore=!1}function u(){ignore=!0}function a(e){this.classname=e,this.flipped=!1}function f(r){n.win_level=r,window.chrome&&window.chrome.i18n?(r<3?e("#win_btn2").text(chrome.i18n.getMessage("win_nextlevel")):e("#win_btn2").text(chrome.i18n.getMessage("win_backtostart")),e("#win_btn1").text(chrome.i18n.getMessage("win_replay")),e("#win_btn3").text(chrome.i18n.getMessage("win_quit")),e("#win_dlg_text").html(chrome.i18n.getMessage("win_text"))):r<3?e("#win_btn2"
).text("NEXT LEVEL"):e("#win_btn2").text("BACK TO START"),t.win(),e("#win_dlg_page").show()}function l(t){var n=0,r=s[t].cardcount;e(".flip").each(function(){n++});var i=n/2|0,o=r/2|0;return window.chrome&&window.chrome.i18n?e("#lvl"+t+"_matches").text(chrome.i18n.getMessage("matches")+" "+chrome.i18n.getMessage("num"+i)+"/"+chrome.i18n.getMessage("num"+o)):e("#lvl"+t+"_matches").text("Matches "+i+"/"+o),n>=r}function c(i){t.flip(),n.input_off(),window.setTimeout(function(){var s=parseInt(i.substring(3,4));if(r!=undefined){var u=e("#"+i+" .front").attr("class"),a=e("#"+r+" .front").attr("class");u==a?l(s)?f(s):(t.match(),o()):(t.mismatch(),e("#"+i).removeClass("flip"),e("#"+r).removeClass("flip"),window.setTimeout(n.input_on,n.fliptime)),r=undefined}else r=i,o()},n.fliptime)}function h(i){if(r!=undefined){var s=e("#"+r+" .front").attr("class");e(".lvl"+i+"_card").each(function(){var o=e(this).attr("id"),a=e("#"+o+" .front").attr("class");s==a&&r!=o&&(u(),t.flip(),e("#"+o).addClass("flip"
),l(i)?(t.match(),window.setTimeout(function(){n.win_dlg(i)},n.fliptime)):(t.match(),window.setTimeout(n.input_on,n.fliptime)))}),r=undefined}else{var o=new Array;e(".lvl"+i+"_card").each(function(){e(this).hasClass("flip")||o.push(e(this).attr("id"))});if(o.length<=0)return;var a=Math.random()*o.length|0,f=o[a],c=e("#"+f+" .front").attr("class");e(".lvl"+i+"_card").each(function(){var r=e(this).attr("id"),s=e("#"+r+" .front").attr("class");c==s&&f!=r&&(u(),t.flip(),e("#"+f).addClass("flip"),e("#"+r).addClass("flip"),l(i)?(t.match(),window.setTimeout(function(){n.win_dlg(i)},n.fliptime)):(t.match(),window.setTimeout(n.input_on,n.fliptime)))})}}function p(n){t.click(),t.stop_bg_sounds(),t.play_level_sound(n),i=n,e(".card").removeClass("flip");var r=new Array,u=s[n].cardcount,a=s[n].cardcount/2,f,l;window.chrome&&window.chrome.i18n?e("#lvl"+n+"_matches").text(chrome.i18n.getMessage("matches")+" "+chrome.i18n.getMessage("num0")+"/"+chrome.i18n.getMessage("num"+a)):e("#lvl"+n+"_matches").text
("Matches 0/"+a);for(f=0;f<u;f++)r.push(f%a+1);for(f=0;f<u;f++){var c="#lvl"+n+"_card"+(f+1)+" .front",h=Math.random()*r.length|0,p=r.splice(h,1),d="front lvl"+n+"_card_type"+p;e(c).attr("class",d)}o()}var n={};n.infocus=!0,n.win_level=0,n.ignore=!1,n.fliptime=400;var r=undefined,i=-1,s={1:{cardcount:8},2:{cardcount:12},3:{cardcount:16}},d=function(e){i=e},v=function(){t.stop_bg_sounds(),t.click(),e("#win_dlg_page").hide(),e("#lvl1_page").hide(),e("#lvl2_page").hide(),e("#lvl3_page").hide(),e("#main_page").show(),d(-1)};return n.card_flipped=c,n.input_on=o,n.input_off=u,n.win_dlg=f,n.start_game=p,n.set_level=d,n.generate_hint=h,n.quit=v,n.unfocus=function(){n.infocus&&(n.infocus=!1,t.pause_level_sound(n.win_level))},n.focus=function(){n.infocus||(n.infocus=!0,t.play_level_sound(n.win_level))},n}),define("scale",[],function(){"use strict";return function(e,t){var n=window.getComputedStyle(e),r=parseInt(n.width.replace("px",""),10),i=parseInt(n.height.replace("px",""),10),s=e.style;s.position="absolute"
,s["-webkit-transform-origin"]="0 0 0",s.transform="0 0 0",s.display="none";var o=function(){var e=document.documentElement.clientWidth,t=document.documentElement.clientHeight,n=e/r,o=t/i,u=n;o<n&&(u=o);var a=(e-r*u)/2;a=parseInt(a*(1/u),10);var f=(t-i*u)/2;f=parseInt(f*(1/u),10);var l="scale("+u+","+u+")",c="translate("+a+"px, "+f+"px)";s["-webkit-transform"]=l+" "+c,s.transform=l+" "+c},u=function(){var e="rotate(90deg)",t=document.documentElement.clientWidth,n=document.documentElement.clientHeight,o=t/i,u=n/r,a=o;u<o&&(a=u);var f="scale("+a+","+a+")",l=(t-i*a)/2;l=parseInt(l*(1/a),10)+i;var c=(n-r*a)/2;c=parseInt(c*(1/a),10);var h="translate("+l+"px, "+c+"px)";s["-webkit-transform"]=f+" "+h+" "+e,s.transform=f+" "+h+" "+e},a=function(){if("lockOrientation"in screen)o();else{var e=document.documentElement,n=e.clientWidth<=t;e.clientWidth<e.clientHeight&&n?u():o()}};screen.lockOrientation&&screen.lockOrientation("landscape"),window.onresize=a,window.addEventListener("orientationchange"
,a),a(),setTimeout(function(){s.display="block"},0)}}),define("domReady",[],function(){"use strict";function u(e){var t;for(t=0;t<e.length;t+=1)e[t](s)}function a(){var e=o;i&&e.length&&(o=[],u(e))}function f(){i||(i=!0,n&&clearInterval(n),a())}function c(e){return i?e(s):o.push(e),c}var e,t,n,r=typeof window!="undefined"&&window.document,i=!r,s=r?document:null,o=[];if(r){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),t=document.createElement("div");try{e=window.frameElement===null}catch(l){}t.doScroll&&e&&window.external&&(n=setInterval(function(){try{t.doScroll(),f()}catch(e){}},30))}document.readyState==="complete"&&f()}return c.version="2.0.1",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),define("ui",["game","appframework","scale","domReady!"],function(e,t,n){var r=t("#container"),i=r.get(0),s=function(){window.chrome&&window.chrome.i18n&&(t("#lvl1_quit"
).html("&nbsp;&nbsp;&nbsp;"+chrome.i18n.getMessage("quit")),t("#lvl2_quit").html("&nbsp;&nbsp;&nbsp;"+chrome.i18n.getMessage("quit")),t("#lvl3_quit").html("&nbsp;&nbsp;&nbsp;"+chrome.i18n.getMessage("quit")),t("#lvl1_hint").text(chrome.i18n.getMessage("hint")),t("#lvl2_hint").text(chrome.i18n.getMessage("hint")),t("#lvl3_hint").text(chrome.i18n.getMessage("hint")),t("#main_lvl1btn").text(chrome.i18n.getMessage("level1")),t("#main_lvl2btn").text(chrome.i18n.getMessage("level2")),t("#main_lvl3btn").text(chrome.i18n.getMessage("level3")),t("#help_contents").html(chrome.i18n.getMessage("help_text"))),t("body").on("mouseup",function(){t("#main_lvl1btn").removeClass("main_lvl1btn_on"),t("#main_lvl1btn").addClass("main_lvl1btn_off"),t("#main_lvl2btn").removeClass("main_lvl2btn_on"),t("#main_lvl2btn").addClass("main_lvl2btn_off"),t("#main_lvl3btn").removeClass("main_lvl3btn_on"),t("#main_lvl3btn").addClass("main_lvl3btn_off")}),t("#win_dlg_page").on("mouseup",function(){t("#win_btn1").removeClass
("win_btn1_on"),t("#win_btn1").addClass("win_btn1_off"),t("#win_btn2").removeClass("win_btn2_on"),t("#win_btn2").addClass("win_btn2_off"),t("#win_btn3").removeClass("win_btn3_on"),t("#win_btn3").addClass("win_btn3_off")}),t("#main_lvl1btn").on("click",function(){t("#main_page").hide(),t("#lvl1_page").show(),e.start_game(1)}).on("mousedown",function(){this.className="main_btn_text main_lvl1btn_on"}),t("#main_lvl2btn").on("click",function(){t("#main_page").hide(),t("#lvl2_page").show(),e.start_game(2)}).on("mousedown",function(){this.className="main_btn_text main_lvl2btn_on"}),t("#main_lvl3btn").on("click",function(){t("#main_page").hide(),t("#lvl3_page").show(),e.start_game(3)}).on("mousedown",function(){this.className="main_btn_text main_lvl3btn_on"}),t(".quit").click(e.quit),t(".hintrays").click(function(){if(!e.ignore){var n=t(this).attr("id");e.generate_hint(parseInt(n.substring(3,4)))}}),t(".card").click(function(){var n=t(this),r=n.attr("id");!e.ignore&&!t(this).hasClass("flip")&&(
n.addClass("flip"),e.card_flipped(r))}),t("#win_btn1").on("click",function(){t("#win_dlg_page").hide(),t(".card").removeClass("flip"),window.setTimeout(function(){e.start_game(e.win_level)},e.fliptime)}).on("mousedown",function(){this.className="win_btn1_on"}),t("#win_btn2").on("click",function(){var n=e.win_level+1;n>3&&(n=1),t("#win_dlg_page").hide(),t("#lvl"+e.win_level+"_page").hide(),t("#lvl"+n+"_page").show(),e.start_game(n)}).on("mousedown",function(){this.className="win_btn2_on"}),t("#win_btn3").on("click",function(){e.quit}).on("mousedown",function(){this.className="win_btn3_on"}),window.onblur=function(){e.unfocus()},window.onfocus=function(){e.focus()},n(i,600),r.show()};return s}),define("pages",["appframework"],function(e){var t=function(t){e.ajax({url:"./pages.html",success:function(n){e("#container").append(n),setTimeout(t,0)}})};return t}),require(["sounds","help","license","ui","pages"],function(e,t,n,r,i){i(function(){r(),n("license","main_page"),t("main_help","help_")
,t("lvl1_help","help_"),t("lvl2_help","help_"),t("lvl3_help","help_"),e.loadAll()})}),define("main",function(){});