/*
 Platform.js <https://mths.be/platform>
 Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/>
 Copyright 2011-2013 John-David Dalton
 Available under MIT license <https://mths.be/mit>
*/
(function(){var a="undefined"!==typeof window&&"undefined"!==typeof window.document?window.document:{},d="undefined"!==typeof module&&module.exports,b="undefined"!==typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,e=function(){for(var g,e=["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "),"webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "),
"webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "),"mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "),"msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ")],b=0,c=e.length,d={};b<c;b++)if((g=e[b])&&g[1]in a){for(b=0;b<g.length;b++)d[e[0][b]]=
g[b];return d}return!1}(),h={change:e.fullscreenchange,error:e.fullscreenerror},p={request:function(g){var d=e.requestFullscreen;g=g||a.documentElement;if(/5\.1[.\d]* Safari/.test(navigator.userAgent))g[d]();else g[d](b&&Element.ALLOW_KEYBOARD_INPUT)},exit:function(){a[e.exitFullscreen]()},toggle:function(a){this.isFullscreen?this.exit():this.request(a)},onchange:function(a){this.on("change",a)},onerror:function(a){this.on("error",a)},on:function(e,b){var d=h[e];d&&a.addEventListener(d,b,!1)},off:function(e,
b){var d=h[e];d&&a.removeEventListener(d,b,!1)},raw:e};e?(Object.defineProperties(p,{isFullscreen:{get:function(){return!!a[e.fullscreenElement]}},element:{enumerable:!0,get:function(){return a[e.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return!!a[e.fullscreenEnabled]}}}),d?module.exports=p:window.screenfull=p):d?module.exports=!1:window.screenfull=!1})();
(function(){function a(a){a=String(a);return a.charAt(0).toUpperCase()+a.slice(1)}function d(a,c){var b=-1,u=a?a.length:0;if("number"==typeof u&&-1<u&&u<=z)for(;++b<u;)c(a[b],b,a);else e(a,c)}function b(c){c=String(c).replace(/^ +| +$/g,"");return/^(?:webOS|i(?:OS|P))/.test(c)?c:a(c)}function e(a,c){for(var b in a)k.call(a,b)&&c(a[b],b,a)}function h(c){return null==c?a(c):A.call(c).slice(8,-1)}function p(a,c){var b=null!=a?typeof a[c]:"number";return!/^(?:boolean|number|string|undefined)$/.test(b)&&
("object"==b?!!a[c]:!0)}function g(a){return String(a).replace(/([ -])(?!$)/g,"$1?")}function l(a,c){var b=null;d(a,function(e,d){b=c(b,e,d,a)});return b}function m(a){function c(c){return l(c,function(c,e){var d=e.pattern||g(e);!c&&(c=RegExp("\\b"+d+" *\\d+[.\\w_]*","i").exec(a)||RegExp("\\b"+d+" *\\w+-[\\w]*","i").exec(a)||RegExp("\\b"+d+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(a))&&((c=String(e.label&&!RegExp(d,"i").test(e.label)?e.label:c).split("/"))[1]&&!/[\d.]+/.test(c[0])&&(c[0]+=
" "+c[1]),e=e.label||e,c=b(c[0].replace(RegExp(d,"i"),e).replace(RegExp("; *(?:"+e+"[_-])?","i")," ").replace(RegExp("("+e+")[-_.]?(\\w)","i"),"$1 $2")));return c})}function d(c){return l(c,function(c,b){return c||(RegExp(b+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(a)||0)[1]||null})}var n=q,u=a&&"object"==typeof a&&"String"!=h(a);u&&(n=a,a=null);var x=n.navigator||{},k=x.userAgent||"";a||(a=k);var J=u?!!x.likeChrome:/\bChrome\b/.test(a)&&!/internal|\n/i.test(A.toString()),
K=u?"Object":"ScriptBridgingProxyObject",S=u?"Object":"Environment",L=u&&n.java?"JavaPackage":h(n.java),r=u?"Object":"RuntimeObject";S=(L=/\bJava/.test(L)&&n.java)&&h(n.environment)==S;var z=L?"a":"\u03b1",y=L?"b":"\u03b2",T=n.document||{},H=n.operamini||n.opera,P=w.test(P=u&&H?H["[[Class]]"]:h(H))?P:H=null,f,Q=a;u=[];var R=null,I=a==k;k=I&&H&&"function"==typeof H.version&&H.version();var C=function(c){return l(c,function(c,b){return c||RegExp("\\b"+(b.pattern||g(b))+"\\b","i").exec(a)&&(b.label||
b)})}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),t=function(c){return l(c,function(c,b){return c||RegExp("\\b"+(b.pattern||g(b))+"\\b","i").exec(a)&&(b.label||b)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser",
"PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},
{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),D=c([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad",
"iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),E=function(c){return l(c,function(c,b,e){return c||(b[D]||b[/^[a-z]+(?: +[a-z]+\b)*/i.exec(D)]||RegExp("\\b"+g(e)+"(?:\\b|\\w*\\d)","i").exec(a))&&e})}({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},
"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),v=function(c){return l(c,function(c,e){var d=e.pattern||g(e);if(!c&&(c=RegExp("\\b"+d+"(?:/[\\d.]+|[ \\w.]*)","i").exec(a))){var f=c,q=e.label||e,h={"10.0":"10","6.4":"10 Technical Preview",
"6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};d&&q&&/^Win/i.test(f)&&!/^Windows Phone /i.test(f)&&(h=h[/[\d.]+$/.exec(f)])&&(f="Windows "+h);f=String(f);d&&q&&(f=f.replace(RegExp(d,"i"),q));c=f=b(f.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/,
" $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}return c})}(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac",
"Windows 98;","Windows "]);C&&(C=[C]);E&&!D&&(D=c([E]));if(f=/\bGoogle TV\b/.exec(D))D=f[0];/\bSimulator\b/i.test(a)&&(D=(D?D+" ":"")+"Simulator");"Opera Mini"==t&&/\bOPiOS\b/.test(a)&&u.push("running in Turbo/Uncompressed mode");"IE"==t&&/\blike iPhone OS\b/.test(a)?(f=m(a.replace(/like iPhone OS/,"")),E=f.manufacturer,D=f.product):/^iP/.test(D)?(t||(t="Safari"),v="iOS"+((f=/ OS ([\d_]+)/i.exec(a))?" "+f[1].replace(/_/g,"."):"")):"Konqueror"!=t||/buntu/i.test(v)?E&&"Google"!=E&&(/Chrome/.test(t)&&
!/\bMobile Safari\b/i.test(a)||/\bVita\b/.test(D))||/\bAndroid\b/.test(v)&&/^Chrome/.test(t)&&/\bVersion\//i.test(a)?(t="Android Browser",v=/\bAndroid\b/.test(v)?v:"Android"):"Silk"==t?(/\bMobi/i.test(a)||(v="Android",u.unshift("desktop mode")),/Accelerated *= *true/i.test(a)&&u.unshift("accelerated")):"PaleMoon"==t&&(f=/\bFirefox\/([\d.]+)\b/.exec(a))?u.push("identifying as Firefox "+f[1]):"Firefox"==t&&(f=/\b(Mobile|Tablet|TV)\b/i.exec(a))?(v||(v="Firefox OS"),D||(D=f[1])):!t||(f=!/\bMinefield\b/i.test(a)&&
/\b(?:Firefox|Safari)\b/.exec(t))?(t&&!D&&/[\/,]|^[^(]+?\)/.test(a.slice(a.indexOf(f+"/")+8))&&(t=null),(f=D||E||v)&&(D||E||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(v))&&(t=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(v)?v:f)+" Browser")):"Electron"==t&&(f=(/\bChrome\/([\d.]+)\b/.exec(a)||0)[1])&&u.push("Chromium "+f):v="Kubuntu";k||(k=d(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",g(t),"(?:Firefox|Minefield|NetFront)"]));
if(f="iCab"==C&&3<parseFloat(k)&&"WebKit"||/\bOpera\b/.test(t)&&(/\bOPR\b/.test(a)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(a)&&!/^(?:Trident|EdgeHTML)$/.test(C)&&"WebKit"||!C&&/\bMSIE\b/i.test(a)&&("Mac OS"==v?"Tasman":"Trident")||"WebKit"==C&&/\bPlayStation\b(?! Vita\b)/i.test(t)&&"NetFront")C=[f];"IE"==t&&(f=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(a)||0)[1])?(t+=" Mobile",v="Windows Phone "+(/\+$/.test(f)?f:f+".x"),u.unshift("desktop mode")):/\bWPDesktop\b/i.test(a)?(t="IE Mobile",v="Windows Phone 8.x",
u.unshift("desktop mode"),k||(k=(/\brv:([\d.]+)/.exec(a)||0)[1])):"IE"!=t&&"Trident"==C&&(f=/\brv:([\d.]+)/.exec(a))&&(t&&u.push("identifying as "+t+(k?" "+k:"")),t="IE",k=f[1]);if(I){if(p(n,"global"))if(L&&(f=L.lang.System,Q=f.getProperty("os.arch"),v=v||f.getProperty("os.name")+" "+f.getProperty("os.version")),S){try{k=n.require("ringo/engine").version.join("."),t="RingoJS"}catch(V){(f=n.system)&&f.global.system==n.system&&(t="Narwhal",v||(v=f[0].os||null))}t||(t="Rhino")}else"object"==typeof n.process&&
!n.process.browser&&(f=n.process)&&("object"==typeof f.versions&&("string"==typeof f.versions.electron?(u.push("Node "+f.versions.node),t="Electron",k=f.versions.electron):"string"==typeof f.versions.nw&&(u.push("Chromium "+k,"Node "+f.versions.node),t="NW.js",k=f.versions.nw)),t||(t="Node.js",Q=f.arch,v=f.platform,k=(k=/[\d.]+/.exec(f.version))?k[0]:null));else h(f=n.runtime)==K?(t="Adobe AIR",v=f.flash.system.Capabilities.os):h(f=n.phantom)==r?(t="PhantomJS",k=(f=f.version||null)&&f.major+"."+f.minor+
"."+f.patch):"number"==typeof T.documentMode&&(f=/\bTrident\/(\d+)/i.exec(a))?(k=[k,T.documentMode],(f=+f[1]+4)!=k[1]&&(u.push("IE "+k[1]+" mode"),C&&(C[1]=""),k[1]=f),k="IE"==t?String(k[1].toFixed(1)):k[0]):"number"==typeof T.documentMode&&/^(?:Chrome|Firefox)\b/.test(t)&&(u.push("masking as "+t+" "+k),t="IE",k="11.0",C=["Trident"],v="Windows");v=v&&b(v)}k&&(f=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(k)||/(?:alpha|beta)(?: ?\d)?/i.exec(a+";"+(I&&x.appMinorVersion))||/\bMinefield\b/i.test(a)&&
"a")&&(R=/b/i.test(f)?"beta":"alpha",k=k.replace(RegExp(f+"\\+?$"),"")+("beta"==R?y:z)+(/\d+\+?/.exec(f)||""));if("Fennec"==t||"Firefox"==t&&/\b(?:Android|Firefox OS)\b/.test(v))t="Firefox Mobile";else if("Maxthon"==t&&k)k=k.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(D))"Xbox 360"==D&&(v=null),"Xbox 360"==D&&/\bIEMobile\b/.test(a)&&u.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(t)&&(!t||D||/Browser|Mobi/.test(t))||"Windows CE"!=v&&!/Mobi/i.test(a))if("IE"==t&&I)try{null===n.external&&
u.unshift("platform preview")}catch(V){u.unshift("embedded")}else(/\bBlackBerry\b/.test(D)||/\bBB10\b/.test(a))&&(f=(RegExp(D.replace(/ +/g," *")+"/([.\\d]+)","i").exec(a)||0)[1]||k)?(f=[f,/BB10/.test(a)],v=(f[1]?(D=null,E="BlackBerry"):"Device Software")+" "+f[0],k=null):this!=e&&"Wii"!=D&&(I&&H||/Opera/.test(t)&&/\b(?:MSIE|Firefox)\b/i.test(a)||"Firefox"==t&&/\bOS X (?:\d+\.){2,}/.test(v)||"IE"==t&&(v&&!/^Win/.test(v)&&5.5<k||/\bWindows XP\b/.test(v)&&8<k||8==k&&!/\bTrident\b/.test(a)))&&!w.test(f=
m.call(e,a.replace(w,"")+";"))&&f.name&&(f="ing as "+f.name+((f=f.version)?" "+f:""),w.test(t)?(/\bIE\b/.test(f)&&"Mac OS"==v&&(v=null),f="identify"+f):(f="mask"+f,t=P?b(P.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(f)&&(v=null),I||(k=null)),C=["Presto"],u.push(f));else t+=" Mobile";if(f=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(a)||0)[1]){f=[parseFloat(f.replace(/\.(\d)$/,".0$1")),f];if("Safari"==t&&"+"==f[1].slice(-1))t="WebKit Nightly",R="alpha",k=f[1].slice(0,-1);else if(k==f[1]||k==(f[2]=
(/\bSafari\/([\d.]+\+?)/i.exec(a)||0)[1]))k=null;f[1]=(/\bChrome\/([\d.]+)/i.exec(a)||0)[1];537.36==f[0]&&537.36==f[2]&&28<=parseFloat(f[1])&&"WebKit"==C&&(C=["Blink"]);I&&(J||f[1])?(C&&(C[1]="like Chrome"),f=f[1]||(f=f[0],530>f?1:532>f?2:532.05>f?3:533>f?4:534.03>f?5:534.07>f?6:534.1>f?7:534.13>f?8:534.16>f?9:534.24>f?10:534.3>f?11:535.01>f?12:535.02>f?"13+":535.07>f?15:535.11>f?16:535.19>f?17:536.05>f?18:536.1>f?19:537.01>f?20:537.11>f?"21+":537.13>f?23:537.18>f?24:537.24>f?25:537.36>f?26:"Blink"!=
C?"27":"28")):(C&&(C[1]="like Safari"),f=(f=f[0],400>f?1:500>f?2:526>f?3:533>f?4:534>f?"4+":535>f?5:537>f?6:538>f?7:601>f?8:"8"));C&&(C[1]+=" "+(f+="number"==typeof f?".x":/[.+]/.test(f)?"":"+"));"Safari"==t&&(!k||45<parseInt(k))&&(k=f)}"Opera"==t&&(f=/\bzbov|zvav$/.exec(v))?(t+=" ",u.unshift("desktop mode"),"zvav"==f?(t+="Mini",k=null):t+="Mobile",v=v.replace(RegExp(" *"+f+"$"),"")):"Safari"==t&&/\bChrome\b/.exec(C&&C[1])&&(u.unshift("desktop mode"),t="Chrome Mobile",k=null,/\bOS X\b/.test(v)?(E=
"Apple",v="iOS 4.3+"):v=null);k&&0==k.indexOf(f=/[\d.]+$/.exec(v))&&-1<a.indexOf("/"+f+"-")&&(v=String(v.replace(f,"")).replace(/^ +| +$/g,""));C&&!/\b(?:Avant|Nook)\b/.test(t)&&(/Browser|Lunascape|Maxthon/.test(t)||"Safari"!=t&&/^iOS/.test(v)&&/\bSafari\b/.test(C[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(t)&&C[1])&&(f=C[C.length-1])&&u.push(f);u.length&&(u=["("+u.join("; ")+")"]);E&&D&&0>D.indexOf(E)&&u.push("on "+E);D&&u.push((/^on /.test(u[u.length-
1])?"":"on ")+D);if(v){var U=(f=/ ([\d.+]+)$/.exec(v))&&"/"==v.charAt(v.length-f[0].length-1);v={architecture:32,family:f&&!U?v.replace(f[0],""):v,version:f?f[1]:null,toString:function(){var a=this.version;return this.family+(a&&!U?" "+a:"")+(64==this.architecture?" 64-bit":"")}}}(f=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Q))&&!/\bi686\b/i.test(Q)?(v&&(v.architecture=64,v.family=v.family.replace(RegExp(" *"+f),"")),t&&(/\bWOW64\b/i.test(a)||I&&/\w(?:86|32)$/.test(x.cpuClass||x.platform)&&!/\bWin64; x64\b/i.test(a))&&
u.unshift("32-bit")):v&&/^OS X/.test(v.family)&&"Chrome"==t&&39<=parseFloat(k)&&(v.architecture=64);a||(a=null);n={};n.description=a;n.layout=C&&C[0];n.manufacturer=E;n.name=t;n.prerelease=R;n.product=D;n.ua=a;n.version=t&&k;n.os=v||{architecture:null,family:null,version:null,toString:function(){return"null"}};n.parse=m;n.toString=function(){return this.description||""};n.version&&u.unshift(k);n.name&&u.unshift(t);v&&t&&(v!=String(v).split(" ")[0]||v!=t.split(" ")[0]&&!D)&&u.push(D?"("+v+")":"on "+
v);u.length&&(n.description=u.join(" "));return n}var c={"function":!0,object:!0},q=c[typeof window]&&window||this,x=c[typeof exports]&&exports;c=c[typeof module]&&module&&!module.nodeType&&module;var n=x&&c&&"object"==typeof global&&global;!n||n.global!==n&&n.window!==n&&n.self!==n||(q=n);var z=Math.pow(2,53)-1,w=/\bOpera/;n=Object.prototype;var k=n.hasOwnProperty,A=n.toString,y=m();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(q.platform=y,define(function(){return y})):x&&
c?e(y,function(a,c){x[c]=a}):q.platform=y}).call(this);
function buildIOSMeta(){for(var a=[{name:"viewport",content:"width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"},{name:"apple-mobile-web-app-capable",content:"yes"},{name:"apple-mobile-web-app-status-bar-style",content:"black"}],d=0;d<a.length;d++){var b=document.createElement("meta");b.name=a[d].name;b.content=a[d].content;var e=window.document.head.querySelector('meta[name="'+b.name+'"]');e&&e.parentNode.removeChild(e);window.document.head.appendChild(b)}}
function hideIOSFullscreenPanel(){jQuery(".xxx-ios-fullscreen-message").css("display","none");jQuery(".xxx-ios-fullscreen-scroll").css("display","none");jQuery(".xxx-game-iframe-full").removeClass("xxx-game-iframe-iphone-se")}function buildIOSFullscreenPanel(){jQuery("body").append('<div class="xxx-ios-fullscreen-message"><div class="xxx-ios-fullscreen-swipe"></div></div><div class="xxx-ios-fullscreen-scroll"></div>')}
function showIOSFullscreenPanel(){jQuery(".xxx-ios-fullscreen-message").css("display","block");jQuery(".xxx-ios-fullscreen-scroll").css("display","block")}
function __iosResize(){window.scrollTo(0,0);if("iPhone"===platform.product)switch(window.devicePixelRatio){case 2:switch(window.innerWidth){case 568:320!==window.innerHeight&&jQuery(".xxx-game-iframe-full").addClass("xxx-game-iframe-iphone-se");break;case 667:375===window.innerHeight?hideIOSFullscreenPanel():showIOSFullscreenPanel();break;default:hideIOSFullscreenPanel()}break;case 3:switch(window.innerWidth){case 736:414===window.innerHeight?hideIOSFullscreenPanel():showIOSFullscreenPanel();break;
case 724:375===window.innerHeight?hideIOSFullscreenPanel():showIOSFullscreenPanel();break;default:hideIOSFullscreenPanel()}break;default:hideIOSFullscreenPanel()}}function iosResize(){__iosResize();setTimeout(function(){__iosResize()},500)}function iosInIframe(){try{return window.self!==window.top}catch(a){return!0}}$(document).ready(function(){platform&&"iPhone"===platform.product&&!iosInIframe()&&(buildIOSFullscreenPanel(),buildIOSMeta())});
jQuery(window).resize(function(){platform&&"iPhone"===platform.product&&!iosInIframe()&&iosResize()});var s_iOffsetX,s_iOffsetY,s_iScaleFactor=1,s_bIsIphone=!1;
(function(a){(jQuery.browser=jQuery.browser||{}).mobile=/android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(ad|hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|tablet|treo|up\.(browser|link)|vodafone|wap|webos|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0,
4))})(navigator.userAgent||navigator.vendor||window.opera);$(window).resize(function(){sizeHandler()});function trace(a){console.log(a)}function isChrome(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function isIOS(){var a="iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";");for(-1!==navigator.userAgent.toLowerCase().indexOf("iphone")&&(s_bIsIphone=!0);a.length;)if(navigator.platform===a.pop())return!0;return s_bIsIphone=!1}
function getSize(a){var d=a.toLowerCase(),b=window.document,e=b.documentElement;if(void 0===window["inner"+a])a=e["client"+a];else if(window["inner"+a]!=e["client"+a]){var h=b.createElement("body");h.id="vpw-test-b";h.style.cssText="overflow:scroll";var p=b.createElement("div");p.id="vpw-test-d";p.style.cssText="position:absolute;top:-1000px";p.innerHTML="<style>@media("+d+":"+e["client"+a]+"px){body#vpw-test-b div#vpw-test-d{"+d+":7px!important}}</style>";h.appendChild(p);e.insertBefore(h,b.head);
a=7==p["offset"+a]?e["client"+a]:window["inner"+a];e.removeChild(h)}else a=window["inner"+a];return a}window.addEventListener("orientationchange",onOrientationChange);function onOrientationChange(){window.matchMedia("(orientation: portrait)").matches&&sizeHandler();window.matchMedia("(orientation: landscape)").matches&&sizeHandler()}function getIOSWindowHeight(){return document.documentElement.clientWidth/window.innerWidth*window.innerHeight}
function getHeightOfIOSToolbars(){var a=(0===window.orientation?screen.height:screen.width)-getIOSWindowHeight();return 1<a?a:0}
function sizeHandler(){window.scrollTo(0,1);if($("#canvas")){var a="safari"===platform.name.toLowerCase()?getIOSWindowHeight():getSize("Height");var d=getSize("Width");_checkOrientation(d,a);var b=Math.min(a/CANVAS_HEIGHT,d/CANVAS_WIDTH),e=CANVAS_WIDTH*b;b*=CANVAS_HEIGHT;if(b<a){var h=a-b;b+=h;e+=CANVAS_WIDTH/CANVAS_HEIGHT*h}else e<d&&(h=d-e,e+=h,b+=CANVAS_HEIGHT/CANVAS_WIDTH*h);h=a/2-b/2;var p=d/2-e/2,g=CANVAS_WIDTH/e;if(p*g<-EDGEBOARD_X||h*g<-EDGEBOARD_Y)b=Math.min(a/(CANVAS_HEIGHT-2*EDGEBOARD_Y),
d/(CANVAS_WIDTH-2*EDGEBOARD_X)),e=CANVAS_WIDTH*b,b*=CANVAS_HEIGHT,h=(a-b)/2,p=(d-e)/2,g=CANVAS_WIDTH/e;s_iOffsetX=-1*p*g;s_iOffsetY=-1*h*g;0<=h&&(s_iOffsetY=0);0<=p&&(s_iOffsetX=0);null!==s_oInterface&&s_oInterface.refreshButtonPos(s_iOffsetX,s_iOffsetY);null!==s_oMenu&&s_oMenu.refreshButtonPos(s_iOffsetX,s_iOffsetY);s_bIsIphone?(canvas=document.getElementById("canvas"),s_oStage.canvas.width=2*e,s_oStage.canvas.height=2*b,canvas.style.width=e+"px",canvas.style.height=b+"px",d=Math.min(e/CANVAS_WIDTH,
b/CANVAS_HEIGHT),s_iScaleFactor=2*d,s_oStage.scaleX=s_oStage.scaleY=2*d):s_bMobile||isChrome()?($("#canvas").css("width",e+"px"),$("#canvas").css("height",b+"px")):(s_oStage.canvas.width=e,s_oStage.canvas.height=b,s_iScaleFactor=Math.min(e/CANVAS_WIDTH,b/CANVAS_HEIGHT),s_oStage.scaleX=s_oStage.scaleY=s_iScaleFactor);0>h||(h=(a-b)/2);$("#canvas").css("top",h+"px");$("#canvas").css("left",p+"px");fullscreenHandler()}}
function _checkOrientation(a,d){s_bMobile&&ENABLE_CHECK_ORIENTATION&&(a>d?"landscape"===$(".orientation-msg-container").attr("data-orientation")?($(".orientation-msg-container").css("display","none"),s_oMain.startUpdate()):($(".orientation-msg-container").css("display","block"),s_oMain.stopUpdate()):"portrait"===$(".orientation-msg-container").attr("data-orientation")?($(".orientation-msg-container").css("display","none"),s_oMain.startUpdate()):($(".orientation-msg-container").css("display","block"),
s_oMain.stopUpdate()))}function createBitmap(a,d,b){var e=new createjs.Bitmap(a),h=new createjs.Shape;d&&b?h.graphics.beginFill("#fff").drawRect(0,0,d,b):h.graphics.beginFill("#ff0").drawRect(0,0,a.width,a.height);e.hitArea=h;return e}function createSprite(a,d,b,e,h,p){a=null!==d?new createjs.Sprite(a,d):new createjs.Sprite(a);d=new createjs.Shape;d.graphics.beginFill("#000000").drawRect(-b,-e,h,p);a.hitArea=d;return a}
function randomFloatBetween(a,d,b){"undefined"===typeof b&&(b=2);return parseFloat(Math.min(a+Math.random()*(d-a),d).toFixed(b))}function shuffle(a){for(var d=a.length,b,e;0!==d;)e=Math.floor(Math.random()*d),--d,b=a[d],a[d]=a[e],a[e]=b;return a}function formatTime(a){a/=1E3;var d=Math.floor(a/60);a=parseFloat(a-60*d).toFixed(1);var b="";b=10>d?b+("0"+d+":"):b+(d+":");return 10>a?b+("0"+a):b+a}
function NoClickDelay(a){this.element=a;window.Touch&&this.element.addEventListener("touchstart",this,!1)}
NoClickDelay.prototype={handleEvent:function(a){switch(a.type){case "touchstart":this.onTouchStart(a);break;case "touchmove":this.onTouchMove(a);break;case "touchend":this.onTouchEnd(a)}},onTouchStart:function(a){a.preventDefault();this.moved=!1;this.element.addEventListener("touchmove",this,!1);this.element.addEventListener("touchend",this,!1)},onTouchMove:function(a){this.moved=!0},onTouchEnd:function(a){this.element.removeEventListener("touchmove",this,!1);this.element.removeEventListener("touchend",
this,!1);if(!this.moved){a=document.elementFromPoint(a.changedTouches[0].clientX,a.changedTouches[0].clientY);3===a.nodeType&&(a=a.parentNode);var d=document.createEvent("MouseEvents");d.initEvent("click",!0,!0);a.dispatchEvent(d)}}};function playSound(a,d,b){return!1===DISABLE_SOUND_MOBILE||!1===s_bMobile?(s_aSounds[a].play(),s_aSounds[a].volume(d),s_aSounds[a].loop(b),s_aSounds[a]):null}function stopSound(a){!1!==DISABLE_SOUND_MOBILE&&!1!==s_bMobile||s_aSounds[a].stop()}
function setVolume(a,d){!1!==DISABLE_SOUND_MOBILE&&!1!==s_bMobile||s_aSounds[a].volume(d)}function setMute(a,d){!1!==DISABLE_SOUND_MOBILE&&!1!==s_bMobile||s_aSounds[a].mute(d)}function ctlArcadeResume(){null!==s_oMain&&s_oMain.startUpdate()}function ctlArcadePause(){null!==s_oMain&&s_oMain.stopUpdate()}function getParamValue(a){for(var d=window.location.search.substring(1).split("&"),b=0;b<d.length;b++){var e=d[b].split("=");if(e[0]==a)return e[1]}}
(function(){function a(a){var b={focus:"visible",focusin:"visible",pageshow:"visible",blur:"hidden",focusout:"hidden",pagehide:"hidden"};a=a||window.event;a.type in b?document.body.className=b[a.type]:(document.body.className=this[d]?"hidden":"visible","hidden"===document.body.className?s_oMain.stopUpdate():s_oMain.startUpdate())}var d="hidden";d in document?document.addEventListener("visibilitychange",a):(d="mozHidden")in document?document.addEventListener("mozvisibilitychange",a):(d="webkitHidden")in
document?document.addEventListener("webkitvisibilitychange",a):(d="msHidden")in document?document.addEventListener("msvisibilitychange",a):"onfocusin"in document?document.onfocusin=document.onfocusout=a:window.onpageshow=window.onpagehide=window.onfocus=window.onblur=a})();function fullscreenHandler(){ENABLE_FULLSCREEN&&screenfull.enabled&&(s_bFullscreen=screenfull.isFullscreen,null!==s_oInterface&&s_oInterface.resetFullscreenBut(),null!==s_oMenu&&s_oMenu.resetFullscreenBut())}
if(screenfull.enabled)screenfull.on("change",function(){s_bFullscreen=screenfull.isFullscreen;null!==s_oInterface&&s_oInterface.resetFullscreenBut();null!==s_oMenu&&s_oMenu.resetFullscreenBut()});
function CSpriteLibrary(){var a={},d,b,e,h,p,g;this.init=function(a,m,c){d={};e=b=0;h=a;p=m;g=c};this.addSprite=function(e,g){if(!a.hasOwnProperty(e)){var c=new Image;a[e]=d[e]={szPath:g,oSprite:c,bLoaded:!1};b++}};this.getSprite=function(b){return a.hasOwnProperty(b)?a[b].oSprite:null};this._onSpritesLoaded=function(){b=0;p.call(g)};this._onSpriteLoaded=function(){h.call(g);++e===b&&this._onSpritesLoaded()};this.loadSprites=function(){for(var a in d)d[a].oSprite.oSpriteLibrary=this,d[a].oSprite.szKey=
a,d[a].oSprite.onload=function(){this.oSpriteLibrary.setLoaded(this.szKey);this.oSpriteLibrary._onSpriteLoaded(this.szKey)},d[a].oSprite.onerror=function(a){var c=a.currentTarget;setTimeout(function(){d[c.szKey].oSprite.src=d[c.szKey].szPath},500)},d[a].oSprite.src=d[a].szPath};this.setLoaded=function(b){a[b].bLoaded=!0};this.isLoaded=function(b){return a[b].bLoaded};this.getNumSprites=function(){return b}}
var CANVAS_WIDTH=1500,CANVAS_HEIGHT=640,EDGEBOARD_X=300,EDGEBOARD_Y=0,FPS_TIME=1E3/24,DISABLE_SOUND_MOBILE=!1,FONT_GAME="arialbold",STATE_LOADING=0,STATE_MENU=1,STATE_HELP=1,STATE_GAME=3,GAME_STATE_IDLE=0,GAME_STATE_SPINNING=1,GAME_STATE_SHOW_ALL_WIN=2,GAME_STATE_SHOW_WIN=3,REEL_STATE_START=0,REEL_STATE_MOVING=1,REEL_STATE_STOP=2,ON_MOUSE_DOWN=0,ON_MOUSE_UP=1,ON_MOUSE_OVER=2,ON_MOUSE_OUT=3,ON_DRAG_START=4,ON_DRAG_END=5,REEL_OFFSET_X=380,REEL_OFFSET_Y=84,NUM_REELS=5,NUM_ROWS=3,NUM_SYMBOLS=8,WILD_SYMBOL=
8,NUM_PAYLINES=20,SYMBOL_SIZE=140,SPACE_BETWEEN_SYMBOLS=10,MAX_FRAMES_REEL_EASE=16,MIN_REEL_LOOPS,REEL_DELAY,REEL_START_Y=REEL_OFFSET_Y-3*SYMBOL_SIZE,REEL_ARRIVAL_Y=REEL_OFFSET_Y+3*SYMBOL_SIZE,TIME_SHOW_WIN,TIME_SHOW_ALL_WINS,MIN_BET=.05,MAX_BET=.5,TOTAL_MONEY,WIN_OCCURRENCE,SLOT_CASH,MIN_WIN,PAYTABLE_VALUES,ENABLE_FULLSCREEN,ENABLE_CHECK_ORIENTATION,SHOW_CREDITS;
function CSlotSettings(){this._init=function(){this._initSymbolSpriteSheets();this._initPaylines();this._initSymbolWin();this._initSymbolAnims();this._initSymbolsOccurence()};this._initSymbolSpriteSheets=function(){s_aSymbolData=[];for(var a=1;a<NUM_SYMBOLS+1;a++){var d={images:[s_oSpriteLibrary.getSprite("symbol_"+a)],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],moving:[1,2]}};s_aSymbolData[a]=new createjs.SpriteSheet(d)}};this._initPaylines=function(){s_aPaylineCombo=
[[{row:1,col:0},{row:1,col:1},{row:1,col:2},{row:1,col:3},{row:1,col:4}],[{row:0,col:0},{row:0,col:1},{row:0,col:2},{row:0,col:3},{row:0,col:4}],[{row:2,col:0},{row:2,col:1},{row:2,col:2},{row:2,col:3},{row:2,col:4}],[{row:0,col:0},{row:1,col:1},{row:2,col:2},{row:1,col:3},{row:0,col:4}],[{row:2,col:0},{row:1,col:1},{row:0,col:2},{row:1,col:3},{row:2,col:4}],[{row:1,col:0},{row:0,col:1},{row:0,col:2},{row:0,col:3},{row:1,col:4}],[{row:1,col:0},{row:2,col:1},{row:2,col:2},{row:2,col:3},{row:1,col:4}],
[{row:0,col:0},{row:0,col:1},{row:1,col:2},{row:2,col:3},{row:2,col:4}],[{row:2,col:0},{row:2,col:1},{row:1,col:2},{row:0,col:3},{row:0,col:4}],[{row:1,col:0},{row:2,col:1},{row:1,col:2},{row:0,col:3},{row:1,col:4}],[{row:2,col:0},{row:0,col:1},{row:1,col:2},{row:2,col:3},{row:1,col:4}],[{row:0,col:0},{row:1,col:1},{row:1,col:2},{row:1,col:3},{row:0,col:4}],[{row:2,col:0},{row:1,col:1},{row:1,col:2},{row:1,col:3},{row:2,col:4}],[{row:0,col:0},{row:1,col:1},{row:0,col:2},{row:1,col:3},{row:0,col:4}],
[{row:2,col:0},{row:1,col:1},{row:2,col:2},{row:1,col:3},{row:2,col:4}],[{row:1,col:0},{row:1,col:1},{row:0,col:2},{row:1,col:3},{row:1,col:4}],[{row:1,col:0},{row:1,col:1},{row:2,col:2},{row:1,col:3},{row:1,col:4}],[{row:0,col:0},{row:0,col:1},{row:2,col:2},{row:0,col:3},{row:0,col:4}],[{row:2,col:0},{row:2,col:1},{row:0,col:2},{row:2,col:3},{row:2,col:4}],[{row:0,col:0},{row:2,col:1},{row:2,col:2},{row:2,col:3},{row:0,col:4}]]};this._initSymbolWin=function(){s_aSymbolWin=[];s_aSymbolWin[0]=PAYTABLE_VALUES[0];
s_aSymbolWin[1]=PAYTABLE_VALUES[1];s_aSymbolWin[2]=PAYTABLE_VALUES[2];s_aSymbolWin[3]=PAYTABLE_VALUES[3];s_aSymbolWin[4]=PAYTABLE_VALUES[4];s_aSymbolWin[5]=PAYTABLE_VALUES[5];s_aSymbolWin[6]=PAYTABLE_VALUES[6]};this._initSymbolAnims=function(){s_aSymbolAnims=[];var a={framerate:20,images:[s_oSpriteLibrary.getSprite("symbol_1_anim")],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],anim:[1,14]}};s_aSymbolAnims[0]=new createjs.SpriteSheet(a);a={framerate:20,images:[s_oSpriteLibrary.getSprite("symbol_2_anim")],
frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],anim:[1,14]}};s_aSymbolAnims[1]=new createjs.SpriteSheet(a);a={framerate:20,images:[s_oSpriteLibrary.getSprite("symbol_3_anim")],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],anim:[1,14]}};s_aSymbolAnims[2]=new createjs.SpriteSheet(a);a={framerate:20,images:[s_oSpriteLibrary.getSprite("symbol_4_anim")],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,
1],anim:[1,14]}};s_aSymbolAnims[3]=new createjs.SpriteSheet(a);a={framerate:20,images:[s_oSpriteLibrary.getSprite("symbol_5_anim")],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],anim:[1,14]}};s_aSymbolAnims[4]=new createjs.SpriteSheet(a);a={framerate:20,images:[s_oSpriteLibrary.getSprite("symbol_6_anim")],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],anim:[1,14]}};s_aSymbolAnims[5]=new createjs.SpriteSheet(a);a={framerate:20,
images:[s_oSpriteLibrary.getSprite("symbol_7_anim")],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],anim:[1,14]}};s_aSymbolAnims[6]=new createjs.SpriteSheet(a);a={framerate:20,images:[s_oSpriteLibrary.getSprite("symbol_8_anim")],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],anim:[1,14]}};s_aSymbolAnims[7]=new createjs.SpriteSheet(a)};this._initSymbolsOccurence=function(){s_aRandSymbols=[];var a;for(a=0;1>a;a++)s_aRandSymbols.push(1);
for(a=0;2>a;a++)s_aRandSymbols.push(2);for(a=0;3>a;a++)s_aRandSymbols.push(3);for(a=0;4>a;a++)s_aRandSymbols.push(4);for(a=0;4>a;a++)s_aRandSymbols.push(5);for(a=0;6>a;a++)s_aRandSymbols.push(6);for(a=0;6>a;a++)s_aRandSymbols.push(7);for(a=0;1>a;a++)s_aRandSymbols.push(8)};this._init()}
var s_aSymbolData,s_aPaylineCombo,s_aSymbolWin,s_aSymbolAnims,s_aRandSymbols,TEXT_MONEY="MONEY",TEXT_PLAY="PLAY",TEXT_BET="BET",TEXT_COIN="COIN",TEXT_MAX_BET="MAX BET",TEXT_INFO="INFO",TEXT_LINES="LINES",TEXT_SPIN="SPIN",TEXT_WIN="WIN",TEXT_HELP_WILD="THIS SIMBOL IS A JOLLY WHICH CAN REPLACE ANY OTHER SYMBOL TO MAKE UP A COMBO",TEXT_CREDITS_DEVELOPED="DEVELOPED BY",TEXT_CURRENCY="$",TEXT_PRELOADER_CONTINUE="START",TEXT_NO_MONEY="NO MONEY! DO YOU WANT TO RECHARGE?",TEXT_RECHARGE="RECHARGE",TEXT_SHARE_IMAGE=
"200x200.jpg",TEXT_SHARE_TITLE="Congratulations!",TEXT_SHARE_MSG1="You collected <strong>",TEXT_SHARE_MSG2=" points</strong>!<br><br>Share your score with your friends!",TEXT_SHARE_SHARE1="My score is ",TEXT_SHARE_SHARE2=" points! Can you do better?";
function CPreloader(){var a,d,b,e,h,p,g,l,m,c;this._init=function(){s_oSpriteLibrary.init(this._onImagesLoaded,this._onAllImagesLoaded,this);s_oSpriteLibrary.addSprite("progress_bar","./sprites/progress_bar.png");s_oSpriteLibrary.addSprite("200x200","./sprites/200x200.jpg");s_oSpriteLibrary.addSprite("but_start","./sprites/but_start.png");s_oSpriteLibrary.loadSprites();c=new createjs.Container;s_oStage.addChild(c)};this.unload=function(){c.removeAllChildren();m.unload()};this._onImagesLoaded=function(){};
this._onAllImagesLoaded=function(){this.attachSprites();s_oMain.preloaderReady()};this.attachSprites=function(){var q=new createjs.Shape;q.graphics.beginFill("black").drawRect(0,0,CANVAS_WIDTH,CANVAS_HEIGHT);c.addChild(q);q=s_oSpriteLibrary.getSprite("200x200");g=createBitmap(q);g.regX=.5*q.width;g.regY=.5*q.height;g.x=CANVAS_WIDTH/2;g.y=CANVAS_HEIGHT/2-140;c.addChild(g);l=new createjs.Shape;l.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(g.x-100,g.y-100,200,200,10);c.addChild(l);g.mask=l;
q=s_oSpriteLibrary.getSprite("progress_bar");e=createBitmap(q);e.x=CANVAS_WIDTH/2-q.width/2;e.y=CANVAS_HEIGHT/2+90;c.addChild(e);a=q.width;d=q.height;h=new createjs.Shape;h.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(e.x,e.y,1,d);c.addChild(h);e.mask=h;b=new createjs.Text("","30px "+FONT_GAME,"#fff");b.x=CANVAS_WIDTH/2;b.y=CANVAS_HEIGHT/2+140;b.textBaseline="alphabetic";b.textAlign="center";c.addChild(b);q=s_oSpriteLibrary.getSprite("but_start");m=new CTextButton(CANVAS_WIDTH/2,CANVAS_HEIGHT/
2+40,q,TEXT_PRELOADER_CONTINUE,"Arial","#000",50,c);m.addEventListener(ON_MOUSE_UP,this._onButStartRelease,this);m.setVisible(!1);p=new createjs.Shape;p.graphics.beginFill("black").drawRect(0,0,CANVAS_WIDTH,CANVAS_HEIGHT);c.addChild(p);createjs.Tween.get(p).to({alpha:0},500).call(function(){createjs.Tween.removeTweens(p);c.removeChild(p)})};this._onButStartRelease=function(){s_oMain._onRemovePreloader()};this.refreshLoader=function(c){b.text=c+"%";100===c&&(s_oMain._onRemovePreloader(),b.visible=
!1,e.visible=!1);h.graphics.clear();c=Math.floor(c*a/100);h.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(e.x,e.y,c,d)};this._init()}
function CMain(a){var d,b=0,e=0,h=STATE_LOADING,p,g;this.initContainer=function(){var a=document.getElementById("canvas");s_oStage=new createjs.Stage(a);createjs.Touch.enable(s_oStage);s_bMobile=jQuery.browser.mobile;!1===s_bMobile&&s_oStage.enableMouseOver(20);s_iPrevTime=(new Date).getTime();createjs.Ticker.framerate=30;createjs.Ticker.addEventListener("tick",this._update);navigator.userAgent.match(/Windows Phone/i)&&(DISABLE_SOUND_MOBILE=!0);s_oSpriteLibrary=new CSpriteLibrary;p=new CPreloader};
this.preloaderReady=function(){!1!==DISABLE_SOUND_MOBILE&&!1!==s_bMobile||this._initSounds();this._loadImages();d=!0};this.soundLoaded=function(){b++;p.refreshLoader(Math.floor(b/e*100));b===e&&new CSlotSettings};this._initSounds=function(){Howler.mute(!s_bAudioActive);s_aSoundsInfo=[];s_aSoundsInfo.push({path:"./sounds/",filename:"press_but",loop:!1,volume:1,ingamename:"press_but"});s_aSoundsInfo.push({path:"./sounds/",filename:"win",loop:!1,volume:1,ingamename:"win"});s_aSoundsInfo.push({path:"./sounds/",
filename:"reels",loop:!1,volume:1,ingamename:"reels"});s_aSoundsInfo.push({path:"./sounds/",filename:"reel_stop",loop:!1,volume:1,ingamename:"reel_stop"});s_aSoundsInfo.push({path:"./sounds/",filename:"start_reel",loop:!1,volume:1,ingamename:"start_reel"});e+=s_aSoundsInfo.length;s_aSounds=[];for(var a=0;a<s_aSoundsInfo.length;a++)this.tryToLoadSound(s_aSoundsInfo[a],!1)};this.tryToLoadSound=function(a,b){setTimeout(function(){s_aSounds[a.ingamename]=new Howl({src:[a.path+a.filename+".mp3"],autoplay:!1,
preload:!0,loop:a.loop,volume:a.volume,onload:s_oMain.soundLoaded,onloaderror:function(a,c){for(var b=0;b<s_aSoundsInfo.length;b++)if(a===s_aSounds[s_aSoundsInfo[b].ingamename]._sounds[0]._id){s_oMain.tryToLoadSound(s_aSoundsInfo[b],!0);break}},onplayerror:function(a){for(var c=0;c<s_aSoundsInfo.length;c++)if(a===s_aSounds[s_aSoundsInfo[c].ingamename]._sounds[0]._id){s_aSounds[s_aSoundsInfo[c].ingamename].once("unlock",function(){s_aSounds[s_aSoundsInfo[c].ingamename].play()});break}}})},b?200:0)};
this._loadImages=function(){s_oSpriteLibrary.init(this._onImagesLoaded,this._onAllImagesLoaded,this);s_oSpriteLibrary.addSprite("but_bg","./sprites/but_play_bg.png");s_oSpriteLibrary.addSprite("but_exit","./sprites/but_exit.png");s_oSpriteLibrary.addSprite("bg_menu","./sprites/bg_menu.jpg");s_oSpriteLibrary.addSprite("bg_game","./sprites/bg_game.jpg");s_oSpriteLibrary.addSprite("paytable","./sprites/paytable.jpg");s_oSpriteLibrary.addSprite("mask_slot","./sprites/mask_slot.png");s_oSpriteLibrary.addSprite("spin_but",
"./sprites/but_spin_bg.png");s_oSpriteLibrary.addSprite("coin_but","./sprites/but_coin_bg.png");s_oSpriteLibrary.addSprite("info_but","./sprites/but_info_bg.png");s_oSpriteLibrary.addSprite("bet_but","./sprites/bet_but.png");s_oSpriteLibrary.addSprite("win_frame_anim","./sprites/win_frame_anim.png");s_oSpriteLibrary.addSprite("but_lines_bg","./sprites/but_lines_bg.png");s_oSpriteLibrary.addSprite("but_maxbet_bg","./sprites/but_maxbet_bg.png");s_oSpriteLibrary.addSprite("audio_icon","./sprites/audio_icon.png");
s_oSpriteLibrary.addSprite("msg_box","./sprites/msg_box.png");s_oSpriteLibrary.addSprite("logo_ctl","./sprites/logo_ctl.png");s_oSpriteLibrary.addSprite("but_fullscreen","./sprites/but_fullscreen.png");s_oSpriteLibrary.addSprite("but_credits","./sprites/but_credits.png");for(var a=1;a<NUM_SYMBOLS+1;a++)s_oSpriteLibrary.addSprite("symbol_"+a,"./sprites/symbol_"+a+".png"),s_oSpriteLibrary.addSprite("symbol_"+a+"_anim","./sprites/symbol_"+a+"_anim.png");for(a=1;a<NUM_PAYLINES+1;a++)s_oSpriteLibrary.addSprite("payline_"+
a,"./sprites/payline_"+a+".png");e+=s_oSpriteLibrary.getNumSprites();s_oSpriteLibrary.loadSprites()};this._onImagesLoaded=function(){b++;p.refreshLoader(Math.floor(b/e*100));b===e&&new CSlotSettings};this._onAllImagesLoaded=function(){};this._onRemovePreloader=function(){p.unload();this.gotoMenu()};this.gotoMenu=function(){new CMenu;h=STATE_MENU};this.gotoGame=function(){g=new CGame(l);h=STATE_GAME};this.gotoHelp=function(){new CHelp;h=STATE_HELP};this.stopUpdate=function(){d=!1;createjs.Ticker.paused=
!0;$("#block_game").css("display","block");!1!==DISABLE_SOUND_MOBILE&&!1!==s_bMobile||Howler.mute(!0)};this.startUpdate=function(){s_iPrevTime=(new Date).getTime();d=!0;createjs.Ticker.paused=!1;$("#block_game").css("display","none");(!1===DISABLE_SOUND_MOBILE||!1===s_bMobile)&&s_bAudioActive&&Howler.mute(!1)};this._update=function(a){if(!1!==d){var c=(new Date).getTime();s_iTimeElaps=c-s_iPrevTime;s_iCntTime+=s_iTimeElaps;s_iCntFps++;s_iPrevTime=c;1E3<=s_iCntTime&&(s_iCurFps=s_iCntFps,s_iCntTime-=
1E3,s_iCntFps=0);h===STATE_GAME&&g.update();s_oStage.update(a)}};s_oMain=this;var l=a;PAYTABLE_VALUES=[];for(var m=0;7>m;m++)PAYTABLE_VALUES[m]=a["paytable_symbol_"+(m+1)];s_bAudioActive=a.audio_enable_on_startup;ENABLE_FULLSCREEN=l.fullscreen;ENABLE_CHECK_ORIENTATION=l.check_orientation;SHOW_CREDITS=l.show_credits;this.initContainer()}
var s_bMobile,s_bAudioActive=!0,s_bFullscreen=!1,s_iCntTime=0,s_iTimeElaps=0,s_iPrevTime=0,s_iCntFps=0,s_iCurFps=0,s_oDrawLayer,s_oStage,s_oMain,s_oSpriteLibrary,s_aSoundsInfo,s_aSounds;
function CTextButton(a,d,b,e,h,p,g,l){var m,c,q,x,n,z,w,k,A,y;this._init=function(a,b,e,d,g,h,n){m=!1;c=1;q=[];x=[];y=createBitmap(e);k=new createjs.Container;k.x=a;k.y=b;k.regX=e.width/2;k.regY=e.height/2;s_bMobile||(k.cursor="pointer");k.addChild(y,A);l.addChild(k);A=new CTLText(k,14,5,e.width-28,e.height-10,n,"center",h,g,1,0,0,d,!0,!0,!1,!1);this._initListener()};this.unload=function(){k.off("mousedown",n);k.off("pressup",z);l.removeChild(k)};this.setVisible=function(a){k.visible=a};this.setAlign=
function(a){A.textAlign=a};this.setTextX=function(a){A.x=a};this.setScale=function(a){c=k.scaleX=k.scaleY=a};this.enable=function(){m=!1};this.disable=function(){m=!0};this._initListener=function(){n=k.on("mousedown",this.buttonDown);z=k.on("pressup",this.buttonRelease)};this.addEventListener=function(a,c,b){q[a]=c;x[a]=b};this.addEventListenerWithParams=function(a,c,b,e){q[a]=c;x[a]=b;w=e};this.buttonRelease=function(){m||(playSound("press_but",1,!1),k.scaleX=c,k.scaleY=c,q[ON_MOUSE_UP]&&q[ON_MOUSE_UP].call(x[ON_MOUSE_UP],
w))};this.buttonDown=function(){m||(k.scaleX=.9*c,k.scaleY=.9*c,q[ON_MOUSE_DOWN]&&q[ON_MOUSE_DOWN].call(x[ON_MOUSE_DOWN]))};this.setPosition=function(a,c){k.x=a;k.y=c};this.tweenPosition=function(a,c,b,e,d,g,h){createjs.Tween.get(k).wait(e).to({x:a,y:c},b,d).call(function(){void 0!==g&&g.call(h)})};this.changeText=function(a){A.refreshText(a)};this.setX=function(a){k.x=a};this.setY=function(a){k.y=a};this.getButtonImage=function(){return k};this.getX=function(){return k.x};this.getY=function(){return k.y};
this.getSprite=function(){return k};this.getScale=function(){return k.scaleX};this._init(a,d,b,e,h,p,g)}
function CGfxButton(a,d,b,e){var h,p,g,l,m=[],c;this._init=function(a,b,d){g=[];l=[];c=createBitmap(d);c.x=a;c.y=b;c.regX=d.width/2;c.regY=d.height/2;s_bMobile||(c.cursor="pointer");e.addChild(c);this._initListener()};this.unload=function(){c.off("mousedown",h);c.off("pressup",p);e.removeChild(c)};this.setVisible=function(a){c.visible=a};this._initListener=function(){h=c.on("mousedown",this.buttonDown);p=c.on("pressup",this.buttonRelease)};this.addEventListener=function(a,c,b){g[a]=c;l[a]=b};this.addEventListenerWithParams=
function(a,c,b,e){g[a]=c;l[a]=b;m=e};this.buttonRelease=function(){playSound("press_but",.3,!1);c.scaleX=1;c.scaleY=1;g[ON_MOUSE_UP]&&g[ON_MOUSE_UP].call(l[ON_MOUSE_UP],m)};this.buttonDown=function(){c.scaleX=.9;c.scaleY=.9;g[ON_MOUSE_DOWN]&&g[ON_MOUSE_DOWN].call(l[ON_MOUSE_DOWN],m)};this.setPosition=function(a,b){c.x=a;c.y=b};this.setX=function(a){c.x=a};this.setY=function(a){c.y=a};this.getButtonImage=function(){return c};this.getX=function(){return c.x};this.getY=function(){return c.y};this._init(a,
d,b);return this}
function CToggle(a,d,b,e,h){var p,g,l,m,c,q,x;this._init=function(a,c,b,e,d){x=void 0!==d?d:s_oStage;g=[];l=[];d=new createjs.SpriteSheet({images:[b],frames:{width:b.width/2,height:b.height,regX:b.width/2/2,regY:b.height/2},animations:{state_true:[0],state_false:[1]}});p=e;m=createSprite(d,"state_"+p,b.width/2/2,b.height/2,b.width/2,b.height);m.x=a;m.y=c;m.stop();s_bMobile||(m.cursor="pointer");x.addChild(m);this._initListener()};this.unload=function(){m.off("mousedown",c);m.off("pressup",q);x.removeChild(m)};
this._initListener=function(){c=m.on("mousedown",this.buttonDown);q=m.on("pressup",this.buttonRelease)};this.addEventListener=function(a,c,b){g[a]=c;l[a]=b};this.setCursorType=function(a){m.cursor=a};this.setActive=function(a){p=a;m.gotoAndStop("state_"+p)};this.buttonRelease=function(){m.scaleX=1;m.scaleY=1;playSound("press_but",1,!1);p=!p;m.gotoAndStop("state_"+p);g[ON_MOUSE_UP]&&g[ON_MOUSE_UP].call(l[ON_MOUSE_UP],p)};this.buttonDown=function(){m.scaleX=.9;m.scaleY=.9;g[ON_MOUSE_DOWN]&&g[ON_MOUSE_DOWN].call(l[ON_MOUSE_DOWN])};
this.setPosition=function(a,c){m.x=a;m.y=c};this._init(a,d,b,e,h)}
function CBetBut(a,d,b){var e,h,p,g=[],l;this._init=function(a,c,b){e=!1;h=[];p=[];b=s_oSpriteLibrary.getSprite("bet_but");var d=new createjs.SpriteSheet({images:[b],frames:{width:b.width/2,height:b.height,regX:0,regY:0},animations:{on:[0,1],off:[1,2]}});l=createSprite(d,"on",0,0,b.width/2,b.height);l.stop();l.x=a;l.y=c;l.regX=b.width/2;l.regY=b.height/2;s_oStage.addChild(l);this._initListener()};this.unload=function(){l.off("mousedown",this.buttonDown);l.off("pressup",this.buttonRelease);s_oStage.removeChild(l)};
this.disable=function(a){e=a};this.setVisible=function(a){l.visible=a};this.setOn=function(){l.gotoAndStop("on")};this.setOff=function(){l.gotoAndStop("off")};this._initListener=function(){l.on("mousedown",this.buttonDown);l.on("pressup",this.buttonRelease)};this.addEventListener=function(a,c,b){h[a]=c;p[a]=b};this.addEventListenerWithParams=function(a,c,b,e){h[a]=c;p[a]=b;g=e};this.buttonRelease=function(){h[ON_MOUSE_UP]&&!1===e&&(playSound("press_but",1,!1),h[ON_MOUSE_UP].call(p[ON_MOUSE_UP],g))};
this.buttonDown=function(){h[ON_MOUSE_DOWN]&&!1===e&&h[ON_MOUSE_DOWN].call(p[ON_MOUSE_DOWN],g)};this.setPosition=function(a,c){l.x=a;l.y=c};this.setX=function(a){l.x=a};this.setY=function(a){l.y=a};this.getButtonImage=function(){return l};this.getX=function(){return l.x};this.getY=function(){return l.y};this._init(a,d,b)}
function CMenu(){var a,d,b,e,h,p,g=null,l=null,m,c,q,x,n,z;this._init=function(){m=createBitmap(s_oSpriteLibrary.getSprite("bg_menu"));s_oStage.addChild(m);var w=s_oSpriteLibrary.getSprite("but_bg");c=new CTextButton(CANVAS_WIDTH/2,CANVAS_HEIGHT-164,w,TEXT_PLAY,FONT_GAME,"#ffffff",40,s_oStage);c.addEventListener(ON_MOUSE_UP,this._onButPlayRelease,this);if(!1===DISABLE_SOUND_MOBILE||!1===s_bMobile)w=s_oSpriteLibrary.getSprite("audio_icon"),h=CANVAS_WIDTH-w.width/4-10,p=w.height/2+10,q=new CToggle(h,
p,w,s_bAudioActive),q.addEventListener(ON_MOUSE_UP,this._onAudioToggle,this);SHOW_CREDITS?(w=s_oSpriteLibrary.getSprite("but_credits"),a=w.height/2+10,d=w.height/2+10,x=new CGfxButton(a,d,w,s_oStage),x.addEventListener(ON_MOUSE_UP,this._onButCreditsRelease,this),b=a+w.width+10,e=d):(b=w.height/2+10,e=w.height/2+10);w=window.document;var k=w.documentElement;g=k.requestFullscreen||k.mozRequestFullScreen||k.webkitRequestFullScreen||k.msRequestFullscreen;l=w.exitFullscreen||w.mozCancelFullScreen||w.webkitExitFullscreen||
w.msExitFullscreen;!1===ENABLE_FULLSCREEN&&(g=!1);g&&screenfull.enabled&&(w=s_oSpriteLibrary.getSprite("but_fullscreen"),n=new CToggle(b,e,w,s_bFullscreen,s_oStage),n.addEventListener(ON_MOUSE_UP,this._onFullscreenRelease,this));z=new createjs.Shape;z.graphics.beginFill("black").drawRect(0,0,CANVAS_WIDTH,CANVAS_HEIGHT);s_oStage.addChild(z);createjs.Tween.get(z).to({alpha:0},400).call(function(){z.visible=!1});this.refreshButtonPos(s_iOffsetX,s_iOffsetY)};this.unload=function(){c.unload();c=null;if(!1===
DISABLE_SOUND_MOBILE||!1===s_bMobile)q.unload(),q=null;SHOW_CREDITS&&x.unload();g&&screenfull.enabled&&n.unload();s_oStage.removeChild(m);m=null;s_oStage.removeChild(z);s_oMenu=z=null};this.refreshButtonPos=function(c,k){!1!==DISABLE_SOUND_MOBILE&&!1!==s_bMobile||q.setPosition(h-c,k+p);SHOW_CREDITS&&x.setPosition(a+c,d+k);g&&screenfull.enabled&&n.setPosition(b+c,e+k)};this._onButPlayRelease=function(){this.unload();$(s_oMain).trigger("start_session");s_oMain.gotoGame()};this._onAudioToggle=function(){Howler.mute(s_bAudioActive);
s_bAudioActive=!s_bAudioActive};this._onButCreditsRelease=function(){new CCreditsPanel};this.resetFullscreenBut=function(){g&&screenfull.enabled&&n.setActive(s_bFullscreen)};this._onFullscreenRelease=function(){s_bFullscreen?l.call(window.document):g.call(window.document.documentElement);sizeHandler()};s_oMenu=this;this._init()}var s_oMenu=null;
function CGame(a){var d=!1,b,e,h,p,g,l,m,c,q,x,n,z,w,k,A,y,u,M,N,B,F=null,G;this._init=function(){b=GAME_STATE_IDLE;z=p=e=0;y=[0,1,2,3,4];h=y[0];g=NUM_PAYLINES;x=TOTAL_MONEY;c=MIN_BET;q=c*g;s_oTweenController=new CTweenController;M=createBitmap(s_oSpriteLibrary.getSprite("bg_game"));s_oStage.addChild(M);this._initReels();N=new createjs.Bitmap(s_oSpriteLibrary.getSprite("mask_slot"));s_oStage.addChild(N);B=new CInterface(c,q,x);this._initStaticSymbols();F=new CPayTablePanel;G=new CRechargePanel;x<
q&&G.show();d=!0};this.unload=function(){stopSound("reels");B.unload();F.unload();G.unload();for(var a=0;a<w.length;a++)w[a].unload();for(a=0;a<NUM_ROWS;a++)for(var c=0;c<NUM_REELS;c++)k[a][c].unload();s_oStage.removeAllChildren()};this.setMoney=function(a){x=a;B.refreshMoney(x)};this._initReels=function(){var a=REEL_OFFSET_X,c=REEL_OFFSET_Y,b=0;w=[];for(var e=0;e<NUM_REELS;e++)w[e]=new CReelColumn(e,a,c,b),w[e+NUM_REELS]=new CReelColumn(e+NUM_REELS,a,c+SYMBOL_SIZE*NUM_ROWS,b),a+=SYMBOL_SIZE+SPACE_BETWEEN_SYMBOLS,
b+=REEL_DELAY};this._initStaticSymbols=function(){var a=REEL_OFFSET_X,c=REEL_OFFSET_Y;k=[];for(var b=0;b<NUM_ROWS;b++){k[b]=[];for(var e=0;e<NUM_REELS;e++){var d=new CStaticSymbolCell(b,e,a,c);k[b][e]=d;a+=SYMBOL_SIZE+SPACE_BETWEEN_SYMBOLS}a=REEL_OFFSET_X;c+=SYMBOL_SIZE}};this.generateFinalSymbols=function(){u=[];for(var a=0;a<NUM_ROWS;a++){u[a]=[];for(var c=0;c<NUM_REELS;c++)u[a][c]=s_aRandSymbols[Math.floor(Math.random()*s_aRandSymbols.length)]}A=[];for(a=n=0;a<g;a++){c=s_aPaylineCombo[a];var b=
[],e=u[c[0].row][c[0].col],d=1,h=1;for(b.push({row:c[0].row,col:c[0].col,value:u[c[0].row][c[0].col]});e===WILD_SYMBOL&&h<NUM_REELS;)d++,e=u[c[h].row][c[h].col],b.push({row:c[h].row,col:c[h].col,value:u[c[h].row][c[h].col]}),h++;for(;h<c.length;h++)if(u[c[h].row][c[h].col]===e||u[c[h].row][c[h].col]===WILD_SYMBOL)d++,b.push({row:c[h].row,col:c[h].col,value:u[c[h].row][c[h].col]});else break;0<s_aSymbolWin[e-1][d-1]&&(n+=s_aSymbolWin[e-1][d-1],A.push({line:a+1,amount:s_aSymbolWin[e-1][d-1],num_win:d,
value:e,list:b}))}return 0<A.length?!0:!1};this._generateRandSymbols=function(){for(var a=[],c=0;c<NUM_ROWS;c++)a[c]=s_aRandSymbols[Math.floor(Math.random()*s_aRandSymbols.length)];return a};this.reelArrived=function(a,c){if(e>MIN_REEL_LOOPS)if(h===c){if(!1===w[a].isReadyToStop()){var b=a;a<NUM_REELS?(b+=NUM_REELS,w[b].setReadyToStop(),w[a].restart([u[0][a],u[1][a],u[2][a]],!0)):(b-=NUM_REELS,w[b].setReadyToStop(),w[a].restart([u[0][b],u[1][b],u[2][b]],!0))}}else w[a].restart(this._generateRandSymbols(),
!1);else w[a].restart(this._generateRandSymbols(),!1),0===a&&e++};this.stopNextReel=function(){p++;0===p%2&&(playSound("reel_stop",1,!1),h=y[p/2],p===2*NUM_REELS&&this._endReelAnimation())};this._endReelAnimation=function(){stopSound("reels");B.disableBetBut(!1);p=e=0;h=y[0];if(0<A.length){for(var a=0;a<A.length;a++){F.highlightCombo(A[a].value,A[a].num_win);B.showLine(A[a].line);for(var d=A[a].list,g=0;g<d.length;g++)k[d[g].row][d[g].col].show(d[g].value)}n*=c;x+=n;SLOT_CASH-=n;0<n&&(B.refreshMoney(x),
B.refreshWinText(n));l=0;b=GAME_STATE_SHOW_ALL_WIN;playSound("win",.3,!1)}else b=GAME_STATE_IDLE;B.enableGuiButtons();z++;z===O&&(z=0,$(s_oMain).trigger("show_interlevel_ad"));$(s_oMain).trigger("save_score",x)};this.hidePayTable=function(){F.hide()};this._showWin=function(){if(0<m){stopSound("win");var a=A[m-1].line;B.hideLine(a);a=A[m-1].list;for(var c=0;c<a.length;c++)k[a[c].row][a[c].col].stopAnim()}m===A.length&&(m=0);a=A[m].line;B.showLine(a);a=A[m].list;for(c=0;c<a.length;c++)k[a[c].row][a[c].col].show(a[c].value);
m++};this._hideAllWins=function(){for(var a=0;a<A.length;a++)for(var c=A[a].list,e=0;e<c.length;e++)k[c[e].row][c[e].col].stopAnim();B.hideAllLines();m=l=0;l=TIME_SHOW_WIN;b=GAME_STATE_SHOW_WIN};this.activateLines=function(a){g=a;this.removeWinShowing();q=a=c*g;B.refreshTotalBet(q);B.refreshNumLines(g);a>x?(B.disableSpin(),G.show()):B.enableSpin()};this.addLine=function(){g===NUM_PAYLINES?g=1:g++;var a=c*g;q=a=parseFloat(a.toFixed(2));B.refreshTotalBet(q);B.refreshNumLines(g);a>x?(B.disableSpin(),
G.show()):B.enableSpin()};this.changeCoinBet=function(){var a=Math.floor(100*(c+.05))/100;a>MAX_BET?(c=MIN_BET,q=c*g,q=parseFloat(q.toFixed(2)),B.refreshBet(c),B.refreshTotalBet(q),a=q):(a*=g,a=parseFloat(a.toFixed(2)),c+=.05,c=Math.floor(100*c)/100,q=a,B.refreshBet(c),B.refreshTotalBet(q));a>x?(B.disableSpin(),G.show()):B.enableSpin()};this.onMaxBet=function(){var a=MAX_BET;g=NUM_PAYLINES;a*=g;c=MAX_BET;q=a;B.refreshBet(c);B.refreshTotalBet(q);B.refreshNumLines(g);a>x?(B.disableSpin(),G.show()):
(B.enableSpin(),this.onSpin())};this.removeWinShowing=function(){F.resetHighlightCombo();B.resetWin();for(var a=0;a<NUM_ROWS;a++)for(var c=0;c<NUM_REELS;c++)k[a][c].hide();for(a=0;a<w.length;a++)w[a].activate();b=GAME_STATE_IDLE};this.onSpin=function(){stopSound("win");if(x<q)G.show();else{playSound("reels",1,!1);B.disableBetBut(!0);this.removeWinShowing();MIN_WIN=s_aSymbolWin[0][s_aSymbolWin[0].length-1];for(var a=0;a<s_aSymbolWin.length;a++)for(var e=s_aSymbolWin[a],d=0;d<e.length;d++)0!==e[d]&&
e[d]<MIN_WIN&&(MIN_WIN=e[d]);MIN_WIN*=c;x-=q;B.refreshMoney(x);SLOT_CASH+=q;$(s_oMain).trigger("bet_placed",{bet:c,tot_bet:q});if(SLOT_CASH<MIN_WIN){do a=this.generateFinalSymbols();while(!0===a)}else if(Math.floor(101*Math.random())>WIN_OCCURRENCE){do a=this.generateFinalSymbols();while(!0===a)}else{do a=this.generateFinalSymbols();while(!1===a||n*c>SLOT_CASH)}B.hideAllLines();B.disableGuiButtons();b=GAME_STATE_SPINNING}};this._printSymbol=function(){for(var a=0;a<NUM_ROWS;a++)for(var c=0;c<NUM_REELS;c++)trace("_aFinalSymbolCombo["+
a+"]["+c+"]: "+u[a][c])};this.onInfoClicked=function(){b!==GAME_STATE_SPINNING&&(F.isVisible()?F.hide():F.show())};this.onExit=function(){this.unload();$(s_oMain).trigger("end_session");$(s_oMain).trigger("share_event",x);s_oMain.gotoMenu()};this.getState=function(){return b};this.update=function(){if(!1!==d)switch(b){case GAME_STATE_SPINNING:for(var a=0;a<w.length;a++)w[a].update();break;case GAME_STATE_SHOW_ALL_WIN:l+=s_iTimeElaps;l>TIME_SHOW_ALL_WINS&&this._hideAllWins();break;case GAME_STATE_SHOW_WIN:l+=
s_iTimeElaps,l>TIME_SHOW_WIN&&(l=0,this._showWin())}};s_oGame=this;WIN_OCCURRENCE=a.win_occurrence;MIN_REEL_LOOPS=a.min_reel_loop;REEL_DELAY=a.reel_delay;TIME_SHOW_WIN=a.time_show_win;TIME_SHOW_ALL_WINS=a.time_show_all_wins;TOTAL_MONEY=a.money;SLOT_CASH=a.slot_cash;var O=a.ad_show_counter;this._init()}var s_oGame,s_oTweenController;
function CReelColumn(a,d,b,e){var h,p,g,l,m,c,q,x,n,z,w,k,A,y;this._init=function(a,b,e,d){g=p=h=!1;q=0;l=a;c=d;m=l<NUM_REELS?l:l-NUM_REELS;n=0;z=MAX_FRAMES_REEL_EASE;x=REEL_STATE_START;w=e;k=w+SYMBOL_SIZE*NUM_ROWS;this.initContainer(b,e)};this.initContainer=function(a,c){y=new createjs.Container;y.x=a;y.y=c;var b=0;A=[];for(var e=0;e<NUM_ROWS;e++){var d=createSprite(s_aSymbolData[s_aRandSymbols[Math.floor(Math.random()*s_aRandSymbols.length)]],"static",0,0,SYMBOL_SIZE,SYMBOL_SIZE);d.stop();d.x=0;
d.y=b;y.addChild(d);A[e]=d;b+=SYMBOL_SIZE}s_oStage.addChild(y)};this.unload=function(){s_oStage.removeChild(y)};this.activate=function(){w=y.y;k=w+SYMBOL_SIZE*NUM_ROWS;h=!0};this._setSymbol=function(a){y.removeAllChildren();for(var c=0,b=0;b<a.length;b++){var e=new createjs.Sprite(s_aSymbolData[a[b]],"static",0,0,SYMBOL_SIZE,SYMBOL_SIZE);e.stop();e.x=0;e.y=c;y.addChild(e);A[b]=e;c+=SYMBOL_SIZE}};this.restart=function(a,c){y.y=w=REEL_START_Y;k=w+SYMBOL_SIZE*NUM_ROWS;this._setSymbol(a);if(p=c){n=0;
z=MAX_FRAMES_REEL_EASE;x=REEL_STATE_STOP;for(var b=0;b<NUM_ROWS;b++)A[b].gotoAndStop("static");g=!0}else for(b=0;b<NUM_ROWS;b++)A[b].gotoAndStop("moving")};this.setReadyToStop=function(){n=0;z=MAX_FRAMES_REEL_EASE;x=REEL_STATE_STOP};this.isReadyToStop=function(){return p};this._updateStart=function(){0===n&&l<NUM_REELS&&playSound("start_reel",.3,!1);n++;n>z&&(n=0,z/=2,x++,w=y.y,k=w+SYMBOL_SIZE*NUM_ROWS);var a=s_oTweenController.easeInBack(n,0,1,z);a=s_oTweenController.tweenValue(w,k,a);y.y=a};this._updateMoving=
function(){n++;n>z&&(n=0,w=y.y,k=w+SYMBOL_SIZE*NUM_ROWS);var a=s_oTweenController.easeLinear(n,0,1,z);a=s_oTweenController.tweenValue(w,k,a);y.y=a};this._updateStopping=function(){n++;if(n>=z)h=!1,n=0,z=MAX_FRAMES_REEL_EASE,x=REEL_STATE_START,q=0,p=!1,g&&(g=!1,y.y=REEL_OFFSET_Y),s_oGame.stopNextReel();else{var a=s_oTweenController.easeOutCubic(n,0,1,z);a=s_oTweenController.tweenValue(w,k,a);y.y=a}};this.update=function(){if(!1!==h&&(q++,q>c))switch(!1===p&&y.y>REEL_ARRIVAL_Y&&s_oGame.reelArrived(l,
m),x){case REEL_STATE_START:this._updateStart();break;case REEL_STATE_MOVING:this._updateMoving();break;case REEL_STATE_STOP:this._updateStopping()}};this._init(a,d,b,e)}
function CInterface(a,d,b){var e,h,p,g,l,m,c,q,x,n,z,w,k,A,y,u=null,M=null,N,B,F,G,O,J;this._init=function(a,b,d){var r=s_oSpriteLibrary.getSprite("but_exit");p=CANVAS_WIDTH-r.width/2-2;g=r.height/2+2;x=new CGfxButton(p,g,r,s_oStage);x.addEventListener(ON_MOUSE_UP,this._onExit,this);!1===DISABLE_SOUND_MOBILE||!1===s_bMobile?(l=x.getX()-r.width,m=r.height/2+2,k=new CToggle(l,m,s_oSpriteLibrary.getSprite("audio_icon"),s_bAudioActive),k.addEventListener(ON_MOUSE_UP,this._onAudioToggle,this),e=l-r.width,
h=m):(e=x.getX()-r.width,h=r.height/2+2);r=window.document;var K=r.documentElement;u=K.requestFullscreen||K.mozRequestFullScreen||K.webkitRequestFullScreen||K.msRequestFullscreen;M=r.exitFullscreen||r.mozCancelFullScreen||r.webkitExitFullscreen||r.msExitFullscreen;!1===ENABLE_FULLSCREEN&&(u=!1);u&&screenfull.enabled&&(r=s_oSpriteLibrary.getSprite("but_fullscreen"),J=new CToggle(e,h,r,s_bFullscreen,s_oStage),J.addEventListener(ON_MOUSE_UP,this._onFullscreenRelease,this));r=s_oSpriteLibrary.getSprite("spin_but");
n=new CTextButton(1026+r.width/2,595,r,TEXT_SPIN,FONT_GAME,"#ffffff",30,s_oStage);n.addEventListener(ON_MOUSE_UP,this._onSpin,this);r=s_oSpriteLibrary.getSprite("info_but");z=new CTextButton(296+r.width/2,595,r,TEXT_INFO,FONT_GAME,"#ffffff",30,s_oStage);z.addEventListener(ON_MOUSE_UP,this._onInfo,this);r=s_oSpriteLibrary.getSprite("but_lines_bg");w=new CTextButton(436+r.width/2,595,r,TEXT_LINES,FONT_GAME,"#ffffff",30,s_oStage);w.addEventListener(ON_MOUSE_UP,this._onAddLine,this);r=s_oSpriteLibrary.getSprite("coin_but");
A=new CTextButton(620+r.width/2,595,r,TEXT_COIN,FONT_GAME,"#ffffff",30,s_oStage);A.addEventListener(ON_MOUSE_UP,this._onBet,this);r=s_oSpriteLibrary.getSprite("but_maxbet_bg");y=new CTextButton(805+r.width/2,595,r,TEXT_MAX_BET,FONT_GAME,"#ffffff",30,s_oStage);y.addEventListener(ON_MOUSE_UP,this._onMaxBet,this);B=new CTLText(s_oStage,330,14,150,50,24,"center","#ffde00",FONT_GAME,1,0,0,TEXT_MONEY+" "+d.toFixed(2)+TEXT_CURRENCY,!0,!0,!0,!1);G=new CTLText(s_oStage,460,CANVAS_HEIGHT-120,134,30,30,"center",
"#ffffff",FONT_GAME,1,0,0,NUM_PAYLINES,!0,!0,!1,!1);N=new CTLText(s_oStage,643,CANVAS_HEIGHT-120,134,30,30,"center","#ffffff",FONT_GAME,1,0,0,a.toFixed(2),!0,!0,!1,!1);F=new CTLText(s_oStage,825,CANVAS_HEIGHT-120,175,30,30,"center","#ffffff",FONT_GAME,1,0,0,TEXT_BET+": "+b.toFixed(2),!0,!0,!1,!1);O=new CTLText(s_oStage,1049,CANVAS_HEIGHT-120,132,30,30,"center","#ffde00",FONT_GAME,1,0,0," ",!0,!0,!1,!1);r=s_oSpriteLibrary.getSprite("bet_but");c=[];a=r.height/2;b=84+a;d=new CBetBut(319+r.width/2,b,
r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,4);c[3]=d;b+=43;d=new CBetBut(319+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,2);c[1]=d;b+=43;d=new CBetBut(319+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,20);c[19]=d;b+=43;d=new CBetBut(319+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,16);c[15]=d;b+=43;d=new CBetBut(319+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,
this._onBetLineClicked,this,10);c[9]=d;b+=43;d=new CBetBut(319+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,1);c[0]=d;b+=44;d=new CBetBut(319+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,11);c[10]=d;b+=43;d=new CBetBut(319+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,17);c[16]=d;b+=43;d=new CBetBut(319+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,
this,3);c[2]=d;d=new CBetBut(319+r.width/2,b+43,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,5);c[4]=d;b=84+a;d=new CBetBut(1130+r.width/2,b,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,14);c[13]=d;b+=43;d=new CBetBut(1130+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,12);c[11]=d;b+=43;d=new CBetBut(1130+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,9);c[8]=d;
b+=43;d=new CBetBut(1130+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,18);c[17]=d;b+=43;d=new CBetBut(1130+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,6);c[5]=d;b+=44;d=new CBetBut(1130+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,7);c[6]=d;b+=43;d=new CBetBut(1130+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,19);c[18]=d;b+=43;d=new CBetBut(1130+
r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,8);c[7]=d;b+=43;d=new CBetBut(1130+r.width/2,b,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,13);c[12]=d;d=new CBetBut(1130+r.width/2,b+43,r,!0);d.addEventListenerWithParams(ON_MOUSE_UP,this._onBetLineClicked,this,15);c[14]=d;q=[];for(r=0;r<NUM_PAYLINES;r++)a=createBitmap(s_oSpriteLibrary.getSprite("payline_"+(r+1))),a.visible=!1,s_oStage.addChild(a),q[r]=a;this.refreshButtonPos(s_iOffsetX,
s_iOffsetY)};this.unload=function(){x.unload();x=null;n.unload();n=null;z.unload();z=null;w.unload();w=null;A.unload();A=null;y.unload();y=null;!1===DISABLE_SOUND_MOBILE&&(k.unload(),k=null);u&&screenfull.enabled&&J.unload();for(var a=0;a<NUM_PAYLINES;a++)c[a].unload();s_oInterface=null};this.refreshButtonPos=function(a,c){x.setPosition(p-a,c+g);!1!==DISABLE_SOUND_MOBILE&&!1!==s_bMobile||k.setPosition(l-a,c+m);u&&screenfull.enabled&&J.setPosition(e-a,h+c)};this.refreshMoney=function(a){B.refreshText(TEXT_MONEY+
"\n"+a.toFixed(2)+TEXT_CURRENCY)};this.refreshBet=function(a){N.refreshText(a.toFixed(2))};this.refreshTotalBet=function(a){F.refreshText(TEXT_BET+": "+a.toFixed(2))};this.refreshNumLines=function(a){G.refreshText(a);for(var b=0;b<NUM_PAYLINES;b++)b<a?(c[b].setOn(),q[b].visible=!0):c[b].setOff();setTimeout(function(){for(var a=0;a<NUM_PAYLINES;a++)q[a].visible=!1},1E3)};this.resetWin=function(){O.refreshText(" ")};this.refreshWinText=function(a){O.refreshText(TEXT_WIN+" "+a.toFixed(2)+TEXT_CURRENCY)};
this.showLine=function(a){q[a-1].visible=!0};this.hideLine=function(a){q[a-1].visible=!1};this.hideAllLines=function(){for(var a=0;a<NUM_PAYLINES;a++)q[a].visible=!1};this.disableBetBut=function(a){for(var b=0;b<NUM_PAYLINES;b++)c[b].disable(a)};this.enableGuiButtons=function(){n.enable();y.enable();A.enable();w.enable();z.enable()};this.enableSpin=function(){n.enable();y.enable()};this.disableSpin=function(){n.disable();y.disable()};this.disableGuiButtons=function(){n.disable();y.disable();A.disable();
w.disable();z.disable()};this._onBetLineClicked=function(a){this.refreshNumLines(a);s_oGame.activateLines(a)};this._onExit=function(){s_oGame.onExit()};this._onSpin=function(){s_oGame.onSpin()};this._onAddLine=function(){s_oGame.addLine()};this._onInfo=function(){s_oGame.onInfoClicked()};this._onBet=function(){s_oGame.changeCoinBet()};this._onMaxBet=function(){s_oGame.onMaxBet()};this._onAudioToggle=function(){Howler.mute(s_bAudioActive);s_bAudioActive=!s_bAudioActive};this.resetFullscreenBut=function(){u&&
screenfull.enabled&&J.setActive(s_bFullscreen)};this._onFullscreenRelease=function(){s_bFullscreen?M.call(window.document):u.call(window.document.documentElement);sizeHandler()};s_oInterface=this;this._init(a,d,b);return this}var s_oInterface=null;
function CPayTablePanel(){var a,d,b,e;this._init=function(){e=new createjs.Container;b=createBitmap(s_oSpriteLibrary.getSprite("paytable"));e.addChild(b);this._createPayouts();new CTLText(e,760,466,454,120,26,"center","#ffff00",FONT_GAME,1,0,0,TEXT_HELP_WILD,!0,!0,!0,!1);e.visible=!1;s_oStage.addChild(e);var a=this;e.on("pressup",function(){a._onExit()})};this.unload=function(){var b=this;e.off("pressup",function(){b._onExit()});s_oStage.removeChild(e);for(var p=0;p<a.length;p++)for(var g=0;g<a[p].length;g++)e.removeChild(a[p][g].getText()),
e.removeChild(d[p][g].getText())};this._createPayouts=function(){a=[];d=[];for(var b=[{x:440,y:112},{x:440,y:292},{x:440,y:476},{x:770,y:112},{x:770,y:292},{x:1090,y:112},{x:1090,y:292}],p=0,g=0;g<s_aSymbolWin.length;g++){for(var l=[],m=0;m<s_aSymbolWin[g].length;m++)l[m]=s_aSymbolWin[g][m];do m=l.indexOf(0),-1!==m&&l.splice(m,1);while(-1!==m);m=l.length;if(0!==m){var c=30;4===m&&(c=25);var q=b[p].y;a[g]=[];d[g]=[];for(var x=0;x<m;x++){var n=new CTLText(e,b[p].x,q,44,25,25,"left","#ffffff",FONT_GAME,
1,0,0,"X"+(5-x),!0,!0,!1,!1);a[g][x]=n;n=new CTLText(e,n.getX()+50,n.getY(),44,25,25,"left","#ffff00",FONT_GAME,1,0,0,l[m-x-1],!0,!0,!1,!1);d[g][x]=n;q+=c}p++}}};this.show=function(){e.visible=!0};this.hide=function(){e.visible=!1};this.resetHighlightCombo=function(){for(var b=0;b<a.length;b++)for(var e=0;e<a[b].length;e++)a[b][e].setColor("#ffffff"),d[b][e].setColor("#ffff00"),createjs.Tween.removeTweens(d[b][e].getText()),d[b][e].setAlpha(1)};this.highlightCombo=function(a,b){d[a-1][NUM_REELS-b].setColor("#ff0000");
this.tweenAlpha(d[a-1][NUM_REELS-b].getText(),0)};this.tweenAlpha=function(a,b){var d=this;createjs.Tween.get(a).to({alpha:b},200).call(function(){1===b?d.tweenAlpha(a,0):d.tweenAlpha(a,1)})};this._onExit=function(){s_oGame.hidePayTable()};this.isVisible=function(){return e.visible};this._init()}
function CStaticSymbolCell(a,d,b,e){var h=-1,p,g,l,m;this._init=function(a,b,d,e){m=new createjs.Container;m.visible=!1;g=[];for(a=0;a<NUM_SYMBOLS;a++)b=createSprite(s_aSymbolAnims[a],"static",0,0,SYMBOL_SIZE,SYMBOL_SIZE),b.stop(),b.x=d,b.y=e,b.on("animationend",this._onAnimEnded,null,!1,{index:a}),m.addChild(b),g[a]=b,g[a].visible=!1;a={framerate:60,images:[s_oSpriteLibrary.getSprite("win_frame_anim")],frames:{width:SYMBOL_SIZE,height:SYMBOL_SIZE,regX:0,regY:0},animations:{"static":[0,1],anim:[1,
19]}};a=new createjs.SpriteSheet(a);l=new createjs.Sprite(a,"static",0,0,SYMBOL_SIZE,SYMBOL_SIZE);l.stop();l.x=d;l.y=e;m.addChild(l);s_oStage.addChild(m)};this.unload=function(){s_oStage.removeChild(m)};this.hide=function(){-1<h&&(l.gotoAndStop("static"),l.visible=!1,g[h].gotoAndPlay("static"),m.visible=!1)};this.show=function(a){l.gotoAndPlay("anim");l.visible=!0;for(var b=0;b<NUM_SYMBOLS;b++)g[b].visible=b+1===a?!0:!1;g[a-1].gotoAndPlay("anim");h=a-1;p=g[a-1].spriteSheet.getNumFrames();m.visible=
!0};this._onAnimEnded=function(a,b){g[b.index].currentFrame!==p&&(g[b.index].stop(),setTimeout(function(){g[b.index].gotoAndPlay(1)},100))};this.stopAnim=function(){g[h].gotoAndStop("static");g[h].visible=!1;l.gotoAndStop("static");l.visible=!1};this._init(a,d,b,e)}
function CTweenController(){this.tweenValue=function(a,d,b){return a+b*(d-a)};this.easeLinear=function(a,d,b,e){return b*a/e+d};this.easeInCubic=function(a,d,b,e){e=(a/=e)*a*a;return d+b*e};this.easeBackInQuart=function(a,d,b,e){e=(a/=e)*a;return d+b*(2*e*e+2*e*a+-3*e)};this.easeInBack=function(a,d,b,e){return b*(a/=e)*a*(2.70158*a-1.70158)+d};this.easeOutBack=function(a,d,b,e,h){void 0==h&&(h=1.70158);return b*((a=a/e-1)*a*((h+1)*a+h)+1)+d};this.easeOutCubic=function(a,d,b,e){return b*((a=a/e-1)*
a*a+1)+d}}
function CCreditsPanel(){var a,d,b,e,h,p,g,l,m,c;this._init=function(){c=new createjs.Container;c.alpha=0;s_oStage.addChild(c);var q=new createjs.Shape;q.graphics.beginFill("rgba(0,0,0,0.7)").drawRect(0,0,CANVAS_WIDTH,CANVAS_HEIGHT);c.addChild(q);d=createBitmap(s_oSpriteLibrary.getSprite("msg_box"));c.addChild(d);g=new createjs.Shape;g.graphics.beginFill("#0f0f0f").drawRect(0,0,CANVAS_WIDTH,CANVAS_HEIGHT);g.alpha=.01;g.on("click",this._onLogoButRelease);c.addChild(g);q=s_oSpriteLibrary.getSprite("but_exit");a=
CANVAS_WIDTH/2+390;e=new CGfxButton(a,185,q,c);e.addEventListener(ON_MOUSE_UP,this.unload,this);p=new createjs.Text(TEXT_CREDITS_DEVELOPED,"40px "+FONT_GAME,"#000");p.textAlign="center";p.textBaseline="alphabetic";p.x=CANVAS_WIDTH/2;p.y=270;p.outline=3;c.addChild(p);h=new createjs.Text(TEXT_CREDITS_DEVELOPED,"40px "+FONT_GAME,"#fff");h.textAlign="center";h.textBaseline="alphabetic";h.x=CANVAS_WIDTH/2;h.y=270;c.addChild(h);q=s_oSpriteLibrary.getSprite("logo_ctl");b=createBitmap(q);b.regX=q.width/2;
b.regY=q.height/2;b.x=CANVAS_WIDTH/2;b.y=CANVAS_HEIGHT/2;c.addChild(b);m=new createjs.Text("www.codethislab.com","34px "+FONT_GAME,"#000");m.textAlign="center";m.textBaseline="alphabetic";m.x=CANVAS_WIDTH/2;m.y=395;m.outline=3;c.addChild(m);l=new createjs.Text("www.codethislab.com","34px "+FONT_GAME,"#fff");l.textAlign="center";l.textBaseline="alphabetic";l.x=CANVAS_WIDTH/2;l.y=395;c.addChild(l);createjs.Tween.get(c).to({alpha:1},600,createjs.Ease.cubicOut);this.refreshButtonPos(s_iOffsetX,s_iOffsetY)};
this.refreshButtonPos=function(a,b){};this.unload=function(){g.off("click",this._onLogoButRelease);e.unload();e=null;s_oStage.removeChild(c)};this._onLogoButRelease=function(){window.open("http://www.codethislab.com/index.php?&l=en","_blank")};this._init()}
CTLText.prototype={constructor:CTLText,__autofit:function(){if(this._bFitText){for(var a=this._iFontSize;(this._oText.getBounds().height>this._iHeight-2*this._iPaddingV||this._oText.getBounds().width>this._iWidth-2*this._iPaddingH)&&!(a--,this._oText.font=a+"px "+this._szFont,this._oText.lineHeight=Math.round(a*this._fLineHeightFactor),this.__updateY(),this.__verticalAlign(),8>a););this._iFontSize=a}},__verticalAlign:function(){if(this._bVerticalAlign){var a=this._oText.getBounds().height;this._oText.y-=
(a-this._iHeight)/2+this._iPaddingV}},__updateY:function(){this._oText.y=this._y+this._iPaddingV;switch(this._oText.textBaseline){case "middle":this._oText.y+=this._oText.lineHeight/2+(this._iFontSize*this._fLineHeightFactor-this._iFontSize)}},__createText:function(a){this._bDebug&&(this._oDebugShape=new createjs.Shape,this._oDebugShape.graphics.beginFill("rgba(0,0,0,0.5)").drawRect(this._x,this._y,this._iWidth,this._iHeight),this._oContainer.addChild(this._oDebugShape));this._oText=new createjs.Text(a,
this._iFontSize+"px "+this._szFont,this._szColor);this._oText.textBaseline="middle";this._oText.lineHeight=Math.round(this._iFontSize*this._fLineHeightFactor);this._oText.textAlign=this._szAlign;this._oText.lineWidth=this._bMultiline?this._iWidth-2*this._iPaddingH:null;switch(this._szAlign){case "center":this._oText.x=this._x+this._iWidth/2;break;case "left":this._oText.x=this._x+this._iPaddingH;break;case "right":this._oText.x=this._x+this._iWidth-this._iPaddingH}this._oContainer.addChild(this._oText);
this.refreshText(a)},setVerticalAlign:function(a){this._bVerticalAlign=a},setOutline:function(a){null!==this._oText&&(this._oText.outline=a)},setShadow:function(a,d,b,e){null!==this._oText&&(this._oText.shadow=new createjs.Shadow(a,d,b,e))},setColor:function(a){this._oText.color=a},setAlpha:function(a){this._oText.alpha=a},removeTweens:function(){createjs.Tween.removeTweens(this._oText)},getText:function(){return this._oText},getX:function(){return this._x},getY:function(){return this._y},getFontSize:function(){return this._iFontSize},
refreshText:function(a){""===a&&(a=" ");null===this._oText&&this.__createText(a);this._oText.text=a;this._oText.font=this._iFontSize+"px "+this._szFont;this._oText.lineHeight=Math.round(this._iFontSize*this._fLineHeightFactor);this.__autofit();this.__updateY();this.__verticalAlign()}};
function CTLText(a,d,b,e,h,p,g,l,m,c,q,x,n,z,w,k,A){this._oContainer=a;this._x=d;this._y=b;this._iWidth=e;this._iHeight=h;this._bMultiline=k;this._iFontSize=p;this._szAlign=g;this._szColor=l;this._szFont=m;this._iPaddingH=q;this._iPaddingV=x;this._bVerticalAlign=w;this._bFitText=z;this._bDebug=A;this._oDebugShape=null;this._fLineHeightFactor=c;this._oText=null;n&&this.__createText(n)}
function CRechargePanel(){var a,d,b,e,h,p,g,l=this;this._init=function(){g=new createjs.Container;g.visible=!1;s_oStage.addChild(g);b=createBitmap(s_oSpriteLibrary.getSprite("msg_box"));d=b.on("click",function(){});g.addChild(b);var l=s_oSpriteLibrary.getSprite("but_exit");a=CANVAS_WIDTH/2+390;h=new CGfxButton(a,185,l,g);h.addEventListener(ON_MOUSE_UP,this.hide,this);p=new CTLText(g,CANVAS_WIDTH/2-300,170,600,150,40,"center","#000",FONT_GAME,1,0,0,TEXT_NO_MONEY,!0,!0,!0,!1);p.setOutline(3);new CTLText(g,
CANVAS_WIDTH/2-300,170,600,150,40,"center","#fff",FONT_GAME,1,0,0,TEXT_NO_MONEY,!0,!0,!0,!1);e=new CTextButton(CANVAS_WIDTH/2,CANVAS_HEIGHT/2+100,s_oSpriteLibrary.getSprite("but_bg"),TEXT_RECHARGE,FONT_GAME,"#fff",40,g);e.addEventListener(ON_MOUSE_UP,this._onRecharge,this)};this.unload=function(){b.off("click",d);h.unload();h=null;e.unload();s_oStage.removeChild(g)};this.show=function(){g.alpha=0;g.visible=!0;createjs.Tween.get(g).to({alpha:1},600,createjs.Ease.cubicOut)};this.hide=function(){g.visible=
!1};this._onRecharge=function(){$(s_oMain).trigger("recharge");l.hide()};this._init()};