/*
 * Tetris with jQuery - 2006/06/25
 *   see: http://en.wikipedia.org/wiki/Category:Tetris
 *        http://en.wikipedia.org/wiki/Tetris_Worlds
 *   be careful: http://en.wikipedia.org/wiki/Tetris_effect
 * Copyright (c) 2006 Franck Marcia
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[(function(e){return d[e]})];e=(function(){return'\\w+'});c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h 5={p:[\'#1Y\',\'#22\',\'#23\',\'#1W\',\'#24\',\'#1s\',\'#1t\',\'#1U\'],1c:[0,-1,-1,-1,0,-1,-1,0],1d:[0,1u,1q,1T,1v],W:[[],[[[0,0,0,0],[1,1,1,1],[0,0,0,0],[0,0,0,0]],[[0,1,0,0],[0,1,0,0],[0,1,0,0],[0,1,0,0]]],[[[0,0,0,0],[1,1,1,0],[0,1,0,0],[0,0,0,0]],[[0,1,0,0],[1,1,0,0],[0,1,0,0],[0,0,0,0]],[[0,1,0,0],[1,1,1,0],[0,0,0,0],[0,0,0,0]],[[0,1,0,0],[0,1,1,0],[0,1,0,0],[0,0,0,0]]],[[[0,0,0,0],[1,1,1,0],[1,0,0,0],[0,0,0,0]],[[1,1,0,0],[0,1,0,0],[0,1,0,0],[0,0,0,0]],[[0,0,1,0],[1,1,1,0],[0,0,0,0],[0,0,0,0]],[[0,1,0,0],[0,1,0,0],[0,1,1,0],[0,0,0,0]]],[[[1,0,0,0],[1,1,1,0],[0,0,0,0],[0,0,0,0]],[[0,1,1,0],[0,1,0,0],[0,1,0,0],[0,0,0,0]],[[0,0,0,0],[1,1,1,0],[0,0,1,0],[0,0,0,0]],[[0,1,0,0],[0,1,0,0],[1,1,0,0],[0,0,0,0]]],[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:q 1M:5.1o();R}B U},Z:6(){h r=1+1N.1O()*7;B 1R(r>7?7:r,10)},1g:6(){h i,j,s,c,d,n=5.p[0];5.C=5.Z();s=5.W[5.C][0];c=5.p[5.C];8(i=0;i<4;++i){8(j=0;j<4;++j){d=s[i][j]?c:n;$([\'#x\',j,i].14(\'\')).u(\'v\',d)}}},16:6(){5.L=5.C;5.x=5.P=4;5.y=5.1c[5.L];5.T=5.y-2;5.r=5.H=0;5.N=5.W[5.L];9(5.D(0,5.x,5.y)){5.1g();B 15}B U},A:6(){$(5.I).1i(5.K);m.12(5.g);5.g=1j;$(\'#a\').J(5.A).G(\'M\').t(5.M)},M:6(){$(5.I).1h(5.K);5.g=m.Y(5.F,5.Q);$(\'#a\').J(5.M).G(\'A\').t(5.A)},1a:6(){h i,j;9(5.g){$(5.I).1i(5.K);m.12(5.g);5.g=1j;$(\'#a\').J(5.A).G(\'a\').t(5.a)}V{$(\'#a\').J(5.M).G(\'a\').t(5.a)}$(\'#13\').1k(\'1l\',15);8(i=0;i<18;++i){8(j=1;j<11;++j){9(5.b[i][j]){5.z[i][j].u(\'v\',\'#X\')}}}5.O(5.H,5.P,5.T,\'#X\')},D:6(r,x,y){h i,j;8(i=0;i<4;++i){8(j=0;j<4;++j){9(5.N[r][j][i]&&5.b[y+j]&&5.b[y+j][x+i]){B U}}}B 15},1m:6(){9(5.D(5.r,5.x-1,5.y)){--5.x;5.o()}},1n:6(){9(5.D(5.r,5.x+1,5.y)){++5.x;5.o()}},1o:6(){h r=5.r==5.N.1X-1?0:5.r+1;9(5.D(r,5.x,5.y)){5.H=5.r;5.r=r;5.o()}},F:6(){9(5.D(5.r,5.x,5.y+1)){++5.y;5.o()}V{5.1p()}},1p:6(){h i,j,k,r,f;8(i=0;i<4;++i){8(j=0;j<4;++j){9(5.N[5.r][j][i]&&5.b[5.y+j]){5.b[5.y+j][5.x+i]=5.L}}}f=0;8(i=17,k=17;i>-1&&f<4;--i,--k){9(5.b[i].14(\'\').1r(\'0\')==-1){8(j=1;j<11;++j){5.z[k][j].u(\'v\',\'#X\')}++f;8(j=i;j>0;--j){5.b[j]=5.b[j-1].1w()}++i}}9(f){m.12(5.g);5.g=m.1z(6(){5.1b(f)},1q)}9(5.16()){5.o()}V{5.1a()}},1b:6(f){h i,j,l=(5.w<20?5.w:20)*1I;5.E+=f;9(5.E%10===0){5.w=5.E/10}m.1L(5.g);5.g=m.Y(5.F,5.Q-l);5.S+=(5.w+1)*5.1d[f];8(i=0;i<18;++i){8(j=1;j<11;++j){5.z[i][j].u(\'v\',5.p[5.b[i][j]])}}5.o()},O:6(r,x,y,c){h i,j;8(i=0;i<4;++i){8(j=0;j<4;++j){9(5.N[r][j][i]){5.z[y+j][x+i].u(\'v\',c)}}}},o:6(){5.O(5.H,5.P,5.T,5.p[0]);5.O(5.r,5.x,5.y,5.p[5.L]);$(\'#w\').19(5.w+1);$(\'#E\').19(5.E);$(\'#S\').19(5.S);5.P=5.x;5.T=5.y;5.H=5.r}};$(m).21(6(){5.1f();$(\'#b 1e, #C 1e\').u(\'v\',5.p[0]);$(\'#a\').t(5.a);$(\'#13\').t(5.1a)});',62,129,'|||||tetris|function||for|if|start|grid|||||timer|var|||||window||refresh|colors|case|||click|css|backgroundColor|level|||cells|pause|return|next|canGo|lines|moveDown|val|r0|bound|unclick|key|cur|resume|curShape|draw|x0|duration|break|score|y0|false|else|shapes|ffffff|setInterval|newShape|||clearInterval|stop|join|true|shift|||html|gameOver|after|startAt|points|table|init|setNext|keypress|unkeypress|null|set|disabled|moveLeft|moveRight|rotate|touchDown|100|indexOf|00ff00|66ccff|40|1200|concat|String|97|setTimeout|msie|td|600|charCode|keyCode|106|76|108|25|107|73|clearTimeout|105|Math|random|switch|74|parseInt|fromCharCode|300|ff0000|browser|0000ff|length|eaeaea|75||load|ff6600|ffff00|cc00ff'.split('|'),0,{}))
