text: var BigBlock={};BigBlock.Sprites=[];BigBlock.curentFrame=1;BigBlock.clickBlock=0;BigBlock.ready=function(){BigBlock.Timer.play()};
  BigBlock.Background=function(){return{alias:"bg",add:function(b){try{if(typeof b!="object")throw Error("To render a background, you must provide a valid array of json objects in the following format: [{'c':c,'i': i}, {}, {}].");else for(var a=0;a<b.length;a++)BigBlock.SpriteAdvanced.create({alias:this.alias,x:0,y:0,life:0,render_static:true,anim_state:"stop",anim_loop:1,anim:[{frm:{duration:3,pix:[b[a]],label:"1"}}]})}catch(e){BigBlock.Log.display(e.name+": "+e.message)}},replace:function(b,a){BigBlock.Background.remove();
  BigBlock.Background.add(b);typeof a=="function"&&a()},remove:function(b){for(var a in BigBlock.GridStatic.quads)if(BigBlock.GridStatic.quads.hasOwnProperty(a)){var e=document.getElementById(BigBlock.GridStatic.quads[a].id);if(e.hasChildNodes()){pixNodes=e.childNodes;for(var c=[],f=0;f<pixNodes.length;f++)this.alias==pixNodes[f].getAttribute("alias")&&c.push(pixNodes[f]);for(f in c)c.hasOwnProperty(f)&&e.removeChild(c[f])}}typeof b=="function"&&b()},setAttributes:function(b){if(typeof b!="undefined")for(var a in b)if(b.hasOwnProperty(a))this[a]=
  b[a]},setBodyStyle:function(b,a){try{if(typeof b=="undefined")throw Error("BigBlock.Timer.setBodyStyle(key, value) requires a style key.");if(typeof a=="undefined")throw Error("BigBlock.Timer.setBodyStyle(key, value) requires a style value.");}catch(e){BigBlock.Log.display(e.name+": "+e.message)}document.getElementsByTagName("body")[0].style[b]=a}}}();
  BigBlock.Char=function(){return{configure:function(){this.alias="Char";this.x=80;this.y=1;this.state="start";this.pix_index=BigBlock.getPixIndex(this.x,this.y);this.word_id=this.value="B";this.render=-1;this.clock=0;this.index=BigBlock.Sprites.length;this.angle=Math.degreesToRadians(0);this.life=this.step=this.vel=0;this.className="white";this.color_index=this.className+"0";this.color_max=0;this.pulse_rate=10;this.anim_frame_duration=this.anim_frame=0;this.anim_loop=1;this.anim_state="stop";this.action=
  function(){};this.render_static=true;this.afterDie=null},getAnim:function(b){return[{frm:{duration:1,pix:[{c:b,i:0}]}}]},getPix:function(b){b=b[0];if(typeof b.frm.pix[0]!="undefined")b.frm.pix[0].c=this.color_index;return b.frm},run:function(){switch(this.state){case "stop":break;case "start":this.state="run";break;case "run":this.action.call(this);break}this.pix_index=BigBlock.getPixIndex(this.x,this.y);this.img=this.getPix(this.anim,this.color_index);this.color_index=this.life!==0?this.className+
  Math.round(this.color_max*(this.clock/this.life)):this.className+(this.color_max-Math.round(this.color_max*Math.abs(Math.cos(this.clock/this.pulse_rate))));if(this.clock++>=this.life&&this.life!==0)BigBlock.Timer.killObject(this);else this.clock++},start:function(){this.state="start"},stop:function(){this.state="stop"},die:function(b){this.render_static=false;if(typeof b=="function")this.afterDie=b;BigBlock.Timer.killObject(this)},goToFrame:function(b,a,e){return goToFrame(b,a,e)}}}();
  BigBlock.CharSimple=function(){return{create:function(b){var a=BigBlock.clone(BigBlock.Char);a.configure();if(typeof b!="undefined")for(var e in b)if(b.hasOwnProperty(e))a[e]=b[e];b=BigBlock.Color.getPalette();for(var c in b.classes)if(b.classes[c].name==a.className){a.color_max=b.classes[c].val.length-1;break}a.color_index=a.className+"0";a.anim=a.getAnim(a.color_index);a.char_pos=BigBlock.CharPresets.getChar(a.value);a.render_static=true;BigBlock.Sprites.push(a)}}}();
  BigBlock.Color=function(){function b(){var f=0;for(var g in a.classes)if(a.classes.hasOwnProperty(g))f+=a.classes[g].val.length;return f}var a={classes:[{name:"white",val:["rgb(255,255,255)"]},{name:"black",val:["rgb(0,0,0)"]},{name:"grey_dark",val:["rgb(90,90,90)"]},{name:"grey",val:["rgb(150,150,150)"]},{name:"grey_light",val:["rgb(200,200,200)"]},{name:"red",val:["rgb(255,0,0)"]},{name:"magenta",val:["rgb(255,0,255)"]},{name:"blue",val:["rgb(0,0,255)"]},{name:"cyan",val:["rgb(0,255,255)"]},{name:"green",
  val:["rgb(0,255,0)"]},{name:"yellow",val:["rgb(255,255,0)"]},{name:"orange",val:["rgb(255,126,0)"]},{name:"brown",val:["rgb(160,82,45)"]},{name:"pink",val:["rgb(238,130,238)"]}]};a.classes[a.classes.length]={name:{},val:[]};for(var e="",c=255;c>-1;c--)e+=c!==0?"rgb("+c+", "+c+", "+c+");":"rgb("+c+", "+c+", "+c+")";e=e.split(";");a.classes[a.classes.length-1].name="white_black";a.classes[a.classes.length-1].val=[];for(c in e)if(e.hasOwnProperty(c))a.classes[a.classes.length-1].val[c]=e[c];return{current_class:0,
  build:function(){var f=a;for(var g in f.classes[this.current_class].val)f.classes[this.current_class].val.hasOwnProperty(g)&&document.styleSheets[document.styleSheets.length-1].insertRule("div.color"+f.classes[this.current_class].name+g+" {background-color:"+f.classes[this.current_class].val[g]+";}",0);this.current_class++;BigBlock.Loader.update({total:Math.round(document.styleSheets[document.styleSheets.length-1].cssRules.length/b()*100)});return document.styleSheets[document.styleSheets.length-
  1].cssRules.length<b()?false:true},add:function(f){try{if(typeof f=="undefined")throw Error(console.log("Color.add: params are required"));}catch(g){BigBlock.Log.display(g.name+": "+g.message)}for(var h in f.classes)a.classes.hasOwnProperty(h)&&a.classes.push(f.classes[h])},getPalette:function(){return a}}}();
  BigBlock.Emitter=function(){getTransformVariants=function(b,a,e,c,f,g,h,i,j,m,n){var l={};c=Math.ceil(Math.random()*(100-c*100+1));l.life=Math.ceil(e*((100-c)/100));c=Math.ceil(Math.random()*(100-g*100+1));l.vel=f*((100-c)/100);e=[1,-1];f=e[Math.getRamdomNumber(0,1)];l.angle_var=Math.ceil(Math.random()*(h+1))*f;f=e[Math.getRamdomNumber(0,1)];h=0;if(i!==0)h=Math.ceil(Math.random()*i*BigBlock.Grid.pix_dim)*f;if(j==1){i=Math.abs(h)/(i*BigBlock.Grid.pix_dim);l.life=Math.ceil(l.life*(1-i))>0?Math.ceil(l.life*
  (1-i)):1}i=e[Math.getRamdomNumber(0,1)];j=Math.floor(Math.random()*m*BigBlock.Grid.pix_dim)*i;if(n==1){i=Math.abs(j)/(m*BigBlock.Grid.pix_dim);l.life=Math.ceil(l.life*(1-i))>0?Math.ceil(l.life*(1-i)):1}l.x=b+h;l.y=a+j;return l};return{create:function(b){var a=BigBlock.clone(BigBlock.Sprite);a.configure();a.x=BigBlock.Grid.width/2;a.y=BigBlock.Grid.height/2+BigBlock.Grid.height/3;a.alias="emitter";a.emission_rate=3;a.p_count=0;a.p_burst=3;a.p_velocity=3;a.p_velocity_spread=1;a.p_angle=270;a.p_angle_spread=
  20;a.p_life=100;a.p_life_spread=0.5;a.p_life_offset_x=0;a.p_life_offset_y=0;a.p_gravity=0;a.p_init_pos_spread_x=0;a.p_init_pos_spread_y=0;a.p_spiral_vel_x=0;a.p_spiral_vel_y=0;a.action=function(){};if(typeof b!="undefined")for(var e in b)if(b.hasOwnProperty(e))a[e]=b[e];b=BigBlock.Color.getPalette();for(var c in b.classes)if(b.classes[c].name==a.className){a.color_max=b.classes[c].val.length-1;break}a.anim=[{frm:{duration:1,pix:[]}}];a.run=function(){switch(this.state){case "stop":break;case "start":if(this.clock%
  this.emission_rate===0)this.state="emit";this.action.call(this);break;case "emit":for(var f=0;f<this.p_burst;f++){vars=getTransformVariants(this.x,this.y,this.p_life,this.p_life_spread,this.p_velocity,this.p_velocity_spread,this.p_angle_spread,this.p_init_pos_spread_x,this.p_life_offset_x,this.p_init_pos_spread_y,this.p_life_offset_y);BigBlock.Particle.create({alias:"particle",className:this.className,x:vars.x,y:vars.y,life:vars.life,gravity:this.p_gravity,angle:Math.degreesToRadians(this.p_angle+
  vars.angle_var),vel:vars.vel,color_max:this.color_max,p_spiral_vel_x:this.p_spiral_vel_x,p_spiral_vel_y:this.p_spiral_vel_y});this.p_count++}this.state="start";break}this.pix_index=BigBlock.getPixIndex(this.x,this.y);this.img=this.getPix(this.anim,this.color_index);if(this.clock++>=this.life&&this.life!==0&&this.state!="dead")BigBlock.Timer.killObject(this);else this.clock++};a.getPix=function(){return[{frm:{duration:1,pix:[{c:"particle",i:0}]}}]};a.start=function(){this.state="start"};a.stop=function(){this.state=
  "stop"};BigBlock.Sprites.push(a)}}}();
  BigBlock.Footer=function(){return{alias:"app_footer",width:320,height:56,styles:{zIndex:-1,position:"absolute"},add:function(b,a,e){try{if(typeof b=="undefined"||typeof a=="undefined")throw Error("Footer.add(x, y) requires both an x and y coordinate.");else{var c=document.createElement("div");c.setAttribute("id",this.alias);document.body.appendChild(c);this.styles.width=this.width+"px";this.styles.height=this.height+"px";this.styles.left=b+"px";this.styles.top=a+"px";if(typeof e!="undefined")this.styles.backgroundColor=
  e;for(key in this.styles)if(this.styles.hasOwnProperty(key))document.getElementById(this.alias).style[key]=this.styles[key]}}catch(f){BigBlock.Log.display(f.name+": "+f.message)}},remove:function(b){var a=document.getElementById(this.alias);document.body.removeChild(a);typeof b=="function"&&b()},setAttributes:function(b){if(typeof b!="undefined")for(var a in b)if(b.hasOwnProperty(a))this[a]=b[a]},setStyle:function(b,a){try{if(typeof b=="undefined")throw Error("BigBlock.Footer.setStyle(key, value) requires a style key.");
  if(typeof a=="undefined")throw Error("BigBlock.Footer.setStyle(key, value) requires a style value.");}catch(e){BigBlock.Log.display(e.name+": "+e.message)}document.getElementById(this.alias).style[b]=a}}}();
  BigBlock.Grid=function(){return{alias:"Grid",pix_dim:8,width:320,height:368,x:0,y:0,build_start_time:(new Date).getTime(),build_end_time:(new Date).getTime(),build_offset:0,build_section_count:0,build_rowNum:0,char_width:8,char_height:8,styles:{},configure:function(b){if(typeof b!="undefined")for(var a in b)if(b.hasOwnProperty(a))this[a]=b[a]},setProps:function(b){if(typeof b!="undefined")for(var a in b)if(b.hasOwnProperty(a))this[a]=b[a]},setStyle:function(b,a){try{if(typeof b=="undefined")throw Error("BigBlock.Grid.setStyle(key, value) requires a style key.");
  if(typeof a=="undefined")throw Error("BigBlock.Grid.setStyle(key, value) requires a style value.");}catch(e){BigBlock.Log.display(e.name+": "+e.message)}for(var c in this.quads)if(this.quads.hasOwnProperty(c))document.getElementById(this.quads[c].id).style[b]=a},add:function(){this.build_start_time=(new Date).getTime();for(var b=0;b<4;b++)document.styleSheets[document.styleSheets.length-1].insertRule("div#"+this.quads[b].id+" {background-color:transparent;width: "+BigBlock.Grid.width/2+"px;height: "+
  BigBlock.Grid.height/2+"px;position: absolute;left: "+(window.innerWidth/2-this.quads[b].left)+"px;top: "+(window.innerHeight/2-this.quads[b].top)+"px;z-index: "+this.quads[b].zIndex+"}",0);this.x=window.innerWidth/2-this.quads[0].left;this.y=window.innerHeight/2-this.quads[0].top;var a;for(b in this.quads)if(this.quads.hasOwnProperty(b)){a=document.createElement("div");a.setAttribute("id",this.quads[b].id);document.body.appendChild(a);for(var e in this.styles)if(this.styles.hasOwnProperty(e))document.getElementById(this.quads[b].id).style[e]=
  this.styles[e]}},build:function(){for(var b=0,a=BigBlock.Grid.width/2,e=BigBlock.Grid.height/2,c=Math.round(e/BigBlock.Grid.pix_dim)/2,f=0;f<Math.round(a/BigBlock.Grid.pix_dim)*Math.round(e/BigBlock.Grid.pix_dim)/c;f++){if(b<Math.round(a/BigBlock.Grid.pix_dim))b++;else b=1;f%Math.round(a/BigBlock.Grid.pix_dim)===0&&this.build_rowNum++;document.styleSheets[document.styleSheets.length-1].insertRule(".pos"+(f+this.build_offset)+" {left:"+(b-1)*this.pix_dim+"px;top:"+(this.build_rowNum-1)*this.pix_dim+
  "px;}",0)}this.build_offset=document.styleSheets[document.styleSheets.length-1].cssRules.length;BigBlock.Loader.update({total:Math.round(document.styleSheets[document.styleSheets.length-1].cssRules.length/(Math.round(a/BigBlock.Grid.pix_dim)*Math.round(e/BigBlock.Grid.pix_dim))*100)});end_time=(new Date).getTime();return document.styleSheets[document.styleSheets.length-1].cssRules.length<Math.round(a/BigBlock.Grid.pix_dim)*Math.round(e/BigBlock.Grid.pix_dim)?false:true},build_char_styles:function(){document.styleSheets[document.styleSheets.length-
  1].insertRule(".text_bg{background-color: transparent;}",0);document.styleSheets[document.styleSheets.length-1].insertRule(".char{width : 1px;height : 1px;position: absolute;float: left;}",0);for(var b=1,a=0;a<this.char_width*this.char_height;a++){document.styleSheets[document.styleSheets.length-1].insertRule(".char_pos"+(a+1)+"{left:"+b+"px;top:"+(Math.floor(a/8)+1)+"px;}",0);if(b+1<=this.char_width)b++;else b=1}return true}}}();
  BigBlock.Header=function(){return{alias:"app_header",width:320,height:56,styles:{zIndex:-1,position:"absolute"},add:function(b,a,e){try{if(typeof b=="undefined"||typeof a=="undefined")throw Error("Header.add(x, y) requires both an x and y coordinate.");else{var c=document.createElement("div");c.setAttribute("id",this.alias);document.body.appendChild(c);this.styles.width=this.width+"px";this.styles.height=this.height+"px";this.styles.left=b+"px";this.styles.top=a-this.height+"px";if(typeof e!="undefined")this.styles.backgroundColor=
  e;for(key in this.styles)if(this.styles.hasOwnProperty(key))document.getElementById(this.alias).style[key]=this.styles[key]}}catch(f){BigBlock.Log.display(f.name+": "+f.message)}},remove:function(b){var a=document.getElementById(this.alias);document.body.removeChild(a);typeof b=="function"&&b()},setAttributes:function(b){if(typeof b!="undefined")for(var a in b)if(b.hasOwnProperty(a))this[a]=b[a]},setStyle:function(b,a){try{if(typeof b=="undefined")throw Error("BigBlock.Header.setStyle(key, value) requires a style key.");
  if(typeof a=="undefined")throw Error("BigBlock.Header.setStyle(key, value) requires a style value.");}catch(e){BigBlock.Log.display(e.name+": "+e.message)}document.getElementById(this.alias).style[b]=a}}}();
  BigBlock.InputFeedback=function(){return{life:10,className:"white",configure:function(b){if(typeof b!="undefined")for(var a in b)if(b.hasOwnProperty(a))this[a]=b[a]},display:function(b,a){try{if(typeof b=="undefined"||typeof a=="undefined")throw Error("BigBlock.InputFeedback.display(x, y) requires valid x and y locations");else BigBlock.SpriteSimple.create({alias:"input_feedback",className:this.className,x:b-BigBlock.GridActive.x,y:a-BigBlock.GridActive.y,life:this.life})}catch(e){BigBlock.Log.display(e.name+
  ": "+e.message)}},die:function(){BigBlock.Sprites[BigBlock.getObjIdByAlias("input_feedback")].die();delete BigBlock.InputFeedback}}}();
  BigBlock.BehaviorPresets=function(){function b(){return{getPreset:function(e){switch(e){case "move_wallCollide":return function(){var c=this.vel*BigBlock.Grid.pix_dim*Math.cos(this.angle),f=this.vel*BigBlock.Grid.pix_dim*Math.sin(this.angle);if(this.x+c>0&&this.x+c<BigBlock.Grid.width)this.x+=c;else{this.vel*=1.5;this.angle+=Math.degreesToRadians(180)}if(this.y+f>0&&this.y+f<BigBlock.Grid.height)this.y+=f;else{this.vel*=1.5;this.angle+=Math.degreesToRadians(180)}if(Math.floor(this.vel--)>0)this.vel--;
  else this.vel=0};case "move":return function(){this.x+=BigBlock.Grid.pix_dim}}}}}var a;return{install:function(){a||(a=b());return a}}}();
  BigBlock.CharPresets=function(){function b(){return{getChar:function(e){var c=false;switch(e){case " ":c=[];break;case "A":case "a":c=[{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:21},{p:25},{p:29},{p:33},{p:37}];break;case "B":case "b":c=[{p:1},{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:25},{p:29},{p:33},{p:34},{p:35},{p:36}];break;case "C":case "c":c=[{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:25},{p:29},{p:34},{p:35},{p:36}];break;case "D":case "d":c=[{p:1},{p:2},
  {p:3},{p:4},{p:9},{p:13},{p:17},{p:21},{p:25},{p:29},{p:33},{p:34},{p:35},{p:36}];break;case "E":case "e":c=[{p:1},{p:2},{p:3},{p:4},{p:9},{p:17},{p:18},{p:19},{p:25},{p:33},{p:34},{p:35},{p:36}];break;case "F":case "f":c=[{p:1},{p:2},{p:3},{p:4},{p:9},{p:17},{p:18},{p:19},{p:25},{p:33}];break;case "G":case "g":c=[{p:2},{p:3},{p:4},{p:5},{p:9},{p:17},{p:20},{p:21},{p:25},{p:29},{p:34},{p:35},{p:36},{p:37}];break;case "H":case "h":c=[{p:1},{p:5},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:21},{p:25},
  {p:29},{p:33},{p:37}];break;case "I":case "i":c=[{p:2},{p:3},{p:4},{p:11},{p:19},{p:27},{p:34},{p:35},{p:36}];break;case "J":case "j":c=[{p:5},{p:13},{p:21},{p:25},{p:29},{p:26},{p:34},{p:35},{p:36}];break;case "K":case "k":c=[{p:1},{p:5},{p:9},{p:12},{p:17},{p:18},{p:19},{p:25},{p:28},{p:33},{p:37}];break;case "L":case "l":c=[{p:1},{p:9},{p:17},{p:25},{p:33},{p:34},{p:35},{p:36}];break;case "M":case "m":c=[{p:1},{p:5},{p:9},{p:10},{p:12},{p:13},{p:17},{p:19},{p:21},{p:25},{p:29},{p:33},{p:37}];break;
  case "N":case "n":c=[{p:1},{p:5},{p:9},{p:10},{p:13},{p:17},{p:19},{p:21},{p:25},{p:28},{p:29},{p:33},{p:37}];break;case "O":case "o":c=[{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:21},{p:25},{p:29},{p:34},{p:35},{p:36}];break;case "P":case "p":c=[{p:1},{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:25},{p:33}];break;case "Q":case "q":c=[{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:19},{p:21},{p:25},{p:28},{p:29},{p:34},{p:35},{p:36},{p:37}];break;case "R":case "r":c=[{p:1},{p:2},{p:3},{p:4},
  {p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:25},{p:29},{p:33},{p:37}];break;case "S":case "s":c=[{p:2},{p:3},{p:4},{p:5},{p:9},{p:18},{p:19},{p:20},{p:29},{p:33},{p:34},{p:35},{p:36}];break;case "T":case "t":c=[{p:1},{p:2},{p:3},{p:4},{p:5},{p:11},{p:19},{p:27},{p:35}];break;case "U":case "u":c=[{p:1},{p:5},{p:9},{p:13},{p:17},{p:21},{p:25},{p:29},{p:34},{p:35},{p:36}];break;case "V":case "v":c=[{p:1},{p:5},{p:9},{p:13},{p:17},{p:21},{p:26},{p:28},{p:35}];break;case "W":case "w":c=[{p:1},{p:4},{p:7},
  {p:9},{p:12},{p:15},{p:17},{p:20},{p:23},{p:25},{p:28},{p:31},{p:34},{p:35},{p:37},{p:38}];break;case "X":case "x":c=[{p:1},{p:5},{p:10},{p:12},{p:19},{p:26},{p:28},{p:33},{p:37}];break;case "Y":case "y":c=[{p:1},{p:5},{p:10},{p:12},{p:19},{p:27},{p:35}];break;case "Z":case "z":c=[{p:1},{p:2},{p:3},{p:4},{p:5},{p:12},{p:19},{p:26},{p:33},{p:34},{p:35},{p:36},{p:37}];break;case "1":c=[{p:3},{p:10},{p:11},{p:19},{p:27},{p:35}];break;case "2":c=[{p:1},{p:2},{p:3},{p:4},{p:13},{p:18},{p:19},{p:20},{p:25},
  {p:33},{p:34},{p:35},{p:36},{p:37}];break;case "3":c=[{p:1},{p:2},{p:3},{p:4},{p:13},{p:18},{p:19},{p:20},{p:29},{p:33},{p:34},{p:35},{p:36}];break;case "4":c=[{p:3},{p:4},{p:10},{p:12},{p:17},{p:20},{p:25},{p:26},{p:27},{p:28},{p:29},{p:36}];break;case "5":c=[{p:1},{p:2},{p:3},{p:4},{p:5},{p:9},{p:17},{p:18},{p:19},{p:20},{p:29},{p:33},{p:34},{p:35},{p:36}];break;case "6":c=[{p:2},{p:3},{p:4},{p:9},{p:17},{p:18},{p:19},{p:20},{p:25},{p:29},{p:34},{p:35},{p:36}];break;case "7":c=[{p:2},{p:3},{p:4},
  {p:5},{p:13},{p:20},{p:27},{p:35}];break;case "8":c=[{p:2},{p:3},{p:4},{p:9},{p:13},{p:18},{p:19},{p:20},{p:25},{p:29},{p:34},{p:35},{p:36}];break;case "9":c=[{p:2},{p:3},{p:4},{p:9},{p:13},{p:18},{p:19},{p:20},{p:21},{p:28},{p:34},{p:35},{p:36}];break;case "0":c=[{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:21},{p:25},{p:29},{p:34},{p:35},{p:36}];break;case "arrow_down":c=[{p:3},{p:11},{p:17},{p:19},{p:21},{p:26},{p:27},{p:28},{p:35}];break;case "arrow_up":c=[{p:3},{p:10},{p:11},{p:12},{p:17},{p:19},
  {p:21},{p:27},{p:35}];break;case "arrow_left":c=[{p:3},{p:10},{p:17},{p:18},{p:19},{p:20},{p:21},{p:26},{p:35}];break;case "arrow_right":c=[{p:3},{p:12},{p:17},{p:18},{p:19},{p:20},{p:21},{p:28},{p:35}];break;case "!":c=[{p:3},{p:11},{p:19},{p:35}];break;case "@":c=[{p:2},{p:3},{p:4},{p:9},{p:11},{p:13},{p:17},{p:19},{p:20},{p:21},{p:25},{p:34},{p:35},{p:36}];break;case "#":c=[{p:2},{p:4},{p:9},{p:10},{p:11},{p:12},{p:13},{p:18},{p:20},{p:25},{p:26},{p:27},{p:28},{p:29},{p:34},{p:36}];break;case "$":c=
  [{p:2},{p:3},{p:4},{p:5},{p:9},{p:11},{p:18},{p:19},{p:20},{p:27},{p:29},{p:33},{p:34},{p:35},{p:36},{p:43}];break;case "%":c=[{p:1},{p:2},{p:4},{p:9},{p:10},{p:12},{p:19},{p:26},{p:28},{p:29},{p:34},{p:36},{p:37}];break;case "^":c=[{p:3},{p:10},{p:12}];break;case "&":c=[{p:2},{p:3},{p:9},{p:12},{p:18},{p:19},{p:25},{p:29},{p:34},{p:35},{p:36},{p:37}];break;case "*":c=[{p:3},{p:9},{p:11},{p:13},{p:18},{p:19},{p:20},{p:25},{p:27},{p:29},{p:35}];break;case "(":c=[{p:3},{p:10},{p:18},{p:26},{p:35}];
  break;case ")":c=[{p:3},{p:12},{p:20},{p:28},{p:35}];break;case "-":c=[{p:18},{p:19},{p:20}];break;case "_":c=[{p:34},{p:35},{p:36},{p:37}];break;case "=":c=[{p:10},{p:11},{p:12},{p:13},{p:26},{p:27},{p:28},{p:29}];break;case "+":c=[{p:3},{p:11},{p:17},{p:18},{p:19},{p:20},{p:21},{p:27},{p:35}];break;case ";":c=[{p:3},{p:27},{p:34}];break;case ":":c=[{p:11},{p:35}];break;case "'":c=[{p:3},{p:10},{p:18}];break;case ",":c=[{p:34},{p:41}];break;case ".":c=[{p:33}];break;case "<":c=[{p:3},{p:10},{p:17},
  {p:26},{p:35}];break;case ">":c=[{p:3},{p:12},{p:21},{p:28},{p:35}];break;case "/":c=[{p:4},{p:12},{p:19},{p:26},{p:34}];break;case "?":c=[{p:1},{p:2},{p:3},{p:12},{p:18},{p:19},{p:34}];break;case "{":c=[{p:3},{p:4},{p:11},{p:18},{p:27},{p:35},{p:36}];break;case "}":c=[{p:2},{p:3},{p:11},{p:20},{p:27},{p:34},{p:35}];break;case "[":c=[{p:3},{p:4},{p:11},{p:19},{p:27},{p:35},{p:36}];break;case "]":c=[{p:2},{p:3},{p:11},{p:19},{p:27},{p:34},{p:35}];break;case "|":c=[{p:3},{p:11},{p:19},{p:27},{p:35}];
  break;default:break}if(typeof params!="undefined")for(var f in params)if(params.hasOwnProperty(f))em[f]=params[f];return c}}}var a;return{install:function(){a||(a=b());return a}}}();
  BigBlock.EmitterPresets=function(){function b(){return{getPreset:function(e,c){var f=BigBlock.Grid,g={};switch(e){case "fire":g={className:"fire",x:f.width/2,y:f.height/1.25,life:0,emission_rate:1,p_burst:16,p_velocity:1.5,p_velocity_spread:0.1,p_angle:270,p_angle_spread:0,p_life:35,p_life_spread:1,p_life_offset_x:1,p_life_offset_y:0,p_gravity:0,p_init_pos_spread_x:4,p_init_pos_spread_y:0,p_spiral_vel_x:0,p_spiral_vel_y:0};break;case "spark":g={className:"fire",x:f.width/2,y:f.height/1.25,life:0,
  emission_rate:50,p_burst:1,p_velocity:1.5,p_velocity_spread:1,p_angle:270,p_angle_spread:0,p_life:50,p_life_spread:1,p_life_offset_x:1,p_life_offset_y:0,p_gravity:0,p_init_pos_spread_x:4,p_init_pos_spread_y:0,p_spiral_vel_x:1,p_spiral_vel_y:0};break;case "speak":g={className:"speak",x:f.width/2,y:f.height/2,life:10,emission_rate:10,p_burst:3,p_velocity:1.5,p_velocity_spread:0.75,p_angle:0,p_angle_spread:15,p_life:25,p_life_spread:1,p_life_offset_x:0,p_life_offset_y:0,p_gravity:0,p_init_pos_spread_x:0,
  p_init_pos_spread_y:0,p_spiral_vel_x:0,p_spiral_vel_y:0};break;case "trail_red":g={className:"red_black",x:f.width/2,y:f.height/2,life:10,emission_rate:10,p_burst:3,p_velocity:1.5,p_velocity_spread:0.1,p_angle:0,p_angle_spread:10,p_life:35,p_life_spread:1,p_life_offset_x:1,p_life_offset_y:0,p_gravity:0,p_init_pos_spread_x:4,p_init_pos_spread_y:0,p_spiral_vel_x:0,p_spiral_vel_y:0};break;case "trail_white":g={className:"white_black",x:f.width/2,y:f.height/2,life:10,emission_rate:10,p_burst:3,p_velocity:1.5,
  p_velocity_spread:0.1,p_angle:0,p_angle_spread:10,p_life:35,p_life_spread:1,p_life_offset_x:1,p_life_offset_y:0,p_gravity:0,p_init_pos_spread_x:4,p_init_pos_spread_y:0,p_spiral_vel_x:0,p_spiral_vel_y:0};break;default:try{throw Error("BigBlock.EmitterPresets: preset does not exist.");}catch(h){BigBlock.Log.display(h.name+": "+h.message)}break}if(typeof c!="undefined")for(var i in c)if(c.hasOwnProperty(i))g[i]=c[i];return g}}}var a;return{install:function(){a||(a=b());return a}}}();
  BigBlock.Loader=function(){return{id:"loader",class_name:"loader_container",style:{left:window.innerWidth/2-50+"px",top:window.innerHeight/2-5+"px",position:"absolute",backgroundColor:"transparent",width:"100px",height:"10px",border:"1px solid #aaa",padding:"2px",textAlign:"center",color:"#fff",fontStyle:"normal",fontFamily:"Verdana, sans-serif",fontSize:"1em",fontVariant:"normal",fontWeight:"normal"},width:100,height:10,format:"percentage",total:0,msg:"&nbsp;",bar_color:"#999",add:function(){document.body.innerHTML=
  "<div id='"+this.id+"' class='"+this.class_name+"'><div id='"+this.id+"_bar' class='"+this.class_name+"_bar' style='background-color:"+this.bar_color+";height:"+this.height+"px;'></div></div>";for(var b in this.style)if(this.style.hasOwnProperty(b)){var a=this.style[b];document.getElementById(this.id).style[b]=a}},update:function(b){if(typeof b!="undefined")if(typeof b.total!="undefined")this.total=b.total;b=this.total/100*100;document.getElementById(this.id+"_bar").style.width=b+"px"}}}();
  BigBlock.Particle=function(){getTransform=function(b,a,e,c,f,g,h,i,j,m,n){var l={},o=Math.round(Math.cos(g)*m*BigBlock.Grid.pix_dim);m=b*BigBlock.Grid.pix_dim*Math.cos(a)+o;o=Math.round(Math.cos(g)*n*BigBlock.Grid.pix_dim);b=b*BigBlock.Grid.pix_dim*Math.sin(a)+o;if(!(e+m>=BigBlock.Grid.width)){l.x=e+m;l.y=c+b+f*BigBlock.Grid.pix_dim}l.color_index=i+Math.round(j*(g/h));return l};return{create:function(b){var a=BigBlock.clone(BigBlock.Sprite);a.configure();if(typeof b!="undefined")for(var e in b)if(b.hasOwnProperty(e))a[e]=
  b[e];a.color_index=a.className+"0";a.anim=[{frm:{duration:1,pix:[{c:this.color_index,i:0}]}}];a.run=function(){switch(this.state){case "stop":break;case "start":var c=getTransform(this.vel,this.angle,this.x,this.y,this.gravity,this.clock,this.life,this.className,this.color_max,this.p_spiral_vel_x,this.p_spiral_vel_y);this.x=c.x;this.y=c.y;this.color_index=c.color_index;this.gravity*=1.08;break;case "dead":break}this.pix_index=BigBlock.getPixIndex(this.x,this.y);this.img=this.getPix(this.anim,this.color_index);
  if(this.clock++>=this.life&&this.life!==0&&this.state!="dead")BigBlock.Timer.killObject(this);else this.clock++};a.stop=function(){this.state="stop"};BigBlock.Sprites.push(a)}}}();
  BigBlock.RenderMgr=function(){return{renderPix:function(){var b=BigBlock.GridActive.quads;for(var a in b)if(b.hasOwnProperty(a)){var e=document.getElementById(b[a].id);if(e.hasChildNodes()){pixNodes=e.childNodes;for(e=0;e<pixNodes.length;e++)pixNodes[e].setAttribute("class","pix color")}}var c,f,g;b=0;var h;for(a=0;a<BigBlock.Sprites.length;a++){if(BigBlock.Sprites[a].render!==0&&BigBlock.Sprites[a].state!="dead"){e=0;if(typeof BigBlock.Sprites[a].img!="undefined"&&typeof BigBlock.Sprites[a].img.pix!=
  "undefined")for(e in BigBlock.Sprites[a].img.pix){g=BigBlock.Sprites[a].img.pix[e].i;var i=g+BigBlock.Sprites[a].pix_index;if(i!==false){c=BigBlock.Sprites[a].img.pix[e].c;var j=document.createElement("div");if(BigBlock.Sprites[a].render_static)switch(BigBlock.Sprites[a].alias){case "Char":f=BigBlock.getPixLoc("x",BigBlock.Sprites[a].x,g);g=BigBlock.getPixLoc("y",BigBlock.Sprites[a].y,g);if(f>=0&&f<BigBlock.GridStatic.width&&g>=0&&g<BigBlock.GridStatic.height){i=BigBlock.getPixIndex(f,g);j.setAttribute("class",
  "pix text_bg pos"+i);h=BigBlock.Sprites[a].char_pos;for(k=0;k<h.length;k++){i=document.createElement("div");i.setAttribute("class","char char_pos"+h[k].p+" color"+c);j.appendChild(i)}j.setAttribute("id",BigBlock.Sprites[a].word_id);document.getElementById(BigBlock.RenderMgr.getQuad("text",f,g)).appendChild(j)}break;default:f=BigBlock.getPixLoc("x",BigBlock.Sprites[a].x,g);g=BigBlock.getPixLoc("y",BigBlock.Sprites[a].y,g);if(f>=0&&f<BigBlock.GridStatic.width&&g>=0&&g<BigBlock.GridStatic.height){i=
  BigBlock.getPixIndex(f,g);j.setAttribute("class","pix color"+c+" pos"+i);j.setAttribute("id","_static");j.setAttribute("alias",BigBlock.Sprites[a].alias);document.getElementById(BigBlock.RenderMgr.getQuad("static",f,g)).appendChild(j)}break}else{h=document.getElementById(b);f=BigBlock.getPixLoc("x",BigBlock.Sprites[a].x,g);g=BigBlock.getPixLoc("y",BigBlock.Sprites[a].y,g);if(f>=0&&f<BigBlock.GridActive.width&&g>=0&&g<BigBlock.GridActive.height){i=BigBlock.getPixIndex(f,g);if(h){h.setAttribute("class",
  "pix color"+c+" pos"+i);c=h.parentNode.getAttribute("id");f=BigBlock.RenderMgr.getQuad("active",f,g);if(c!=f){document.getElementById(c).removeChild(h);document.getElementById(f).appendChild(h)}}else{j.setAttribute("id",b);j.setAttribute("class","pix color"+c+" pos"+i);document.getElementById(BigBlock.RenderMgr.getQuad("active",f,g)).appendChild(j)}}}}else if(h=document.getElementById(b)){c=h.parentNode.getAttribute("id");document.getElementById(c).removeChild(h)}b++}BigBlock.Sprites[a].render--}if(BigBlock.Sprites[a].render_static&&
  typeof BigBlock.Sprites[a].img!="undefined"){BigBlock.Sprites[a].render_static=false;BigBlock.Sprites[a].die()}}},getQuad:function(b,a,e){var c;switch(b){case "active":c=BigBlock.GridActive;break;case "static":c=BigBlock.GridStatic;break;case "text":c=BigBlock.GridText;break}if(a<BigBlock.Grid.width/2&&e<BigBlock.Grid.height/2)return c.quads[0].id;if(a>=BigBlock.Grid.width/2&&e<BigBlock.Grid.height/2)return c.quads[1].id;if(a<BigBlock.Grid.width/2&&e>=BigBlock.Grid.height/2)return c.quads[2].id;if(a>=
  BigBlock.Grid.width/2&&e>=BigBlock.Grid.height/2)return c.quads[3].id},clearScene:function(b,a){try{if(typeof b!="undefined")if(typeof b!="function")throw Error("BigBlock.RenderMgr.clearScene(beforeClear, afterClear): beforeClear must be a function.");else b()}catch(e){BigBlock.Log.display(e.name+": "+e.message)}var c,f,g;if(typeof BigBlock.GridStatic!="undefined"){c=BigBlock.GridStatic.quads;for(f in c)if(c.hasOwnProperty(f)){g=document.getElementById(c[f].id);if(g.hasChildNodes())for(;g.firstChild;)g.removeChild(g.firstChild)}BigBlock.GridStatic.setStyle("backgroundColor",
  "transparent")}if(typeof BigBlock.GridText!="undefined"){c=BigBlock.GridText.quads;for(f in c)if(c.hasOwnProperty(f)){g=document.getElementById(c[f].id);if(g.hasChildNodes())for(;g.firstChild;)g.removeChild(g.firstChild)}BigBlock.GridText.setStyle("backgroundColor","transparent")}if(typeof BigBlock.GridActive!="undefined"){c=BigBlock.GridActive.quads;for(f in c)if(c.hasOwnProperty(f)){g=document.getElementById(c[f].id);if(g.hasChildNodes())for(;g.firstChild;)g.removeChild(g.firstChild)}BigBlock.GridActive.setStyle("backgroundColor",
  "transparent")}if(typeof BigBlock.Sprites!="undefined")BigBlock.Sprites=[];try{if(typeof a!="undefined")if(typeof a!="function")throw Error("BigBlock.RenderMgr.clearScene(beforeClear, afterClear): beforeClear must be a function.");else a()}catch(h){BigBlock.Log.display(h.name+": "+h.message)}}}}();
  BigBlock.ScreenEvent=function(){return{create:function(b){this.alias="ScreenEvent";try{if(typeof b=="undefined")throw Error("BigBlock.ScreenEvent.create(params) requires a params passed in json format. params can be empty ie. {}");else{this.event_start=(new Date).getTime();this.event_time=this.event_end=0;this.event_buffer=typeof b.event_buffer!="undefined"?b.event_buffer:100;this.click_event=typeof b.click!="undefined"?b.click:function(e){BigBlock.ScreenEvent.event_end=(new Date).getTime();BigBlock.ScreenEvent.event_time=
  BigBlock.ScreenEvent.event_end-BigBlock.ScreenEvent.event_start;e.preventDefault();e.stopPropagation();document.removeEventListener("touchstart",BigBlock.ScreenEvent.touch_event,false);if(BigBlock.ScreenEvent.event_time>BigBlock.ScreenEvent.event_buffer){BigBlock.ScreenEvent.frameAdvance(e,e.clientX,e.clientY);typeof BigBlock.InputFeedback!="undefined"&&BigBlock.Timer.input_feedback===true&&BigBlock.InputFeedback.display(e.clientX,e.clientY);if(typeof BigBlock.TapTimeout!="undefined"){BigBlock.TapTimeout.stop();
  BigBlock.TapTimeout.start()}BigBlock.ScreenEvent.event_start=(new Date).getTime()}};document.addEventListener("click",this.click_event,false);this.touch_event_start=typeof b.touchstart!="undefined"?b.touchstart:function(e){BigBlock.ScreenEvent.event_end=(new Date).getTime();BigBlock.ScreenEvent.event_time=BigBlock.ScreenEvent.event_end-BigBlock.ScreenEvent.event_start;e.preventDefault();this.touch=e.touches[0];document.removeEventListener("click",BigBlock.ScreenEvent.click_event,false);if(BigBlock.ScreenEvent.event_time>
  BigBlock.ScreenEvent.event_buffer){BigBlock.ScreenEvent.frameAdvance(e,this.touch.clientX,this.touch.clientY);typeof BigBlock.InputFeedback!="undefined"&&BigBlock.Timer.input_feedback===true&&BigBlock.InputFeedback.display(this.touch.clientX,this.touch.clientY);if(typeof BigBlock.TapTimeout!="undefined"){BigBlock.TapTimeout.stop();BigBlock.TapTimeout.start()}BigBlock.ScreenEvent.event_start=(new Date).getTime()}console.log("start: "+this.touch.clientX+", "+this.touch.clientY)};document.addEventListener("touchstart",
  this.touch_event_start,false);this.touch_event_move=typeof b.touchmove!="undefined"?b.touchmove:function(e){e.preventDefault()};document.addEventListener("touchmove",this.touch_event_move,false);this.touch_event_end=typeof b.touchend!="undefined"?b.touchend:function(e){e.preventDefault();e.stopPropagation()};document.addEventListener("touchend",this.touch_event_end,false);this.frameAdvance=typeof b.frameAdvance!="undefined"?b.frameAdvance:function(){switch(BigBlock.curentFrame){case 1:typeof BigBlock.TapTimeout!=
  "undefined"&&BigBlock.TapTimeout.die();break}};if(typeof b.inputFeedback!="undefined")this.inputFeedback=b.inputFeedback}}catch(a){BigBlock.Log.display(a.name+": "+a.message)}}}}();
  BigBlock.Sprite=function(){function b(a,e,c){try{if(typeof a=="undefined")throw Error("goToAndPlay(arg, anim_frame, anim) requires a frame number, label or keyword(nextFrame, lastFrame)");if(typeof e=="undefined")throw Error("goToAndPlay(arg, anim_frame, anim) requires an anim_frame");if(typeof c=="undefined")throw Error("goToAndPlay(arg, anim_frame, anim) requires an anim");}catch(f){BigBlock.Log.display(f.name+": "+f.message)}switch(typeof a){case "number":try{if(a-1<0||a-1>=c.length)throw Error("Frame number does not exist.");
  }catch(g){BigBlock.Log.display(g.name+": "+g.message)}return a-1;case "string":switch(a){case "nextFrame":return e++;case "lastFrame":return e--;default:var h;a:{try{if(typeof a=="undefined")throw Error("getFrameIndexByLabel(arg, anim) requires a label");if(typeof c=="undefined")throw Error("getFrameIndexByLabel(arg, anim) requires an anim");}catch(i){BigBlock.Log.display(i.name+": "+i.message)}e=0;for(var j in c)if(c.hasOwnProperty(j)){if(a==c[j].frm.label){h=j;break a}e++}try{if(e!==0)throw Error("Frame label does not exist.");
  }catch(m){BigBlock.Log.display(m.name+": "+m.message)}}return h}}}return{configure:function(){this.alias="Sprite";this.y=this.x=1;this.state="start";this.pix_index=BigBlock.getPixIndex(this.x,this.y);this.render=-1;this.clock=0;this.index=BigBlock.Sprites.length;this.angle=Math.degreesToRadians(0);this.life=this.step=this.vel=0;this.className="white";this.color_index=this.className+"0";this.color_max=0;this.pulse_rate=10;this.anim_frame_duration=this.anim_frame=0;this.anim_loop=1;this.anim_state=
  "stop";this.afterDie=null;this.render_static=false;this.action=function(){}},getAnim:function(a){return[{frm:{duration:1,pix:[{c:a,i:0}]}}]},getPix:function(a){a=a[0];if(typeof a.frm.pix[0]!="undefined")a.frm.pix[0].c=this.color_index;return a.frm},run:function(){switch(this.state){case "stop":break;case "start":this.state="run";break;case "run":this.action.call(this);break}this.pix_index=this.x>=0&&this.x<BigBlock.Grid.width&&this.y>=0&&this.y<BigBlock.Grid.height?BigBlock.getPixIndex(this.x,this.y):
  false;this.img=this.getPix(this.anim,this.color_index);this.color_index=this.life!==0?this.className+Math.round(this.color_max*(this.clock/this.life)):this.pulse_rate!==0?this.className+(this.color_max-Math.round(this.color_max*Math.abs(Math.cos(this.clock/this.pulse_rate)))):this.className+"0";if(this.clock++>=this.life&&this.life!==0)BigBlock.Timer.killObject(this);else this.clock++},start:function(){this.state="start"},stop:function(){this.state="stop"},die:function(a){if(typeof a=="function")this.afterDie=
  a;BigBlock.Timer.killObject(this)},goToFrame:function(a,e,c){return b(a,e,c)}}}();
  BigBlock.SpriteAdvanced=function(){return{create:function(b){var a=BigBlock.clone(BigBlock.Sprite);a.configure();a.anim=[{frm:{duration:1,pix:[{c:"white0",i:0}]}}];if(typeof b!="undefined")for(var e in b)if(b.hasOwnProperty(e))a[e]=b[e];b=BigBlock.Color.getPalette();for(var c in b.classes)if(b.classes[c].name==a.className){a.color_max=b.classes[c].val.length-1;break}a.getPix=function(f){try{if(typeof f=="undefined")throw Error("getPix(anim) requires an anim json object");}catch(g){BigBlock.Log.display(g.name+
  ": "+g.message)}switch(this.anim_state){case "stop":if(typeof f[this.anim_frame]=="undefined")this.anim_frame=0;var h=f[this.anim_frame];if(this.anim_frame_duration===0){h=f[this.anim_frame];typeof h.frm.enterFrame=="function"&&h.frm.enterFrame.call(this)}this.anim_frame_duration++;break;case "play":if(typeof f[this.anim_frame]=="undefined")this.anim_frame=0;h=f[this.anim_frame];if(this.anim_frame_duration<h.frm.duration){if(this.anim_frame_duration===0){h=f[this.anim_frame];typeof h.frm.enterFrame==
  "function"&&h.frm.enterFrame.call(this)}this.anim_frame_duration++}else{h=f[this.anim_frame];typeof h.frm.exitFrame=="function"&&h.frm.exitFrame.call(this);this.anim_frame_duration=0;this.anim_frame++;if(typeof f[this.anim_frame]=="undefined")if(this.anim_loop==1)this.anim_frame=0;else{h={frm:{duration:1,pix:[]}};this.die(this);return h}h=f[this.anim_frame]}break}if(typeof h!="undefined")return h.frm};a.start=function(){this.anim_state="start"};a.stop=function(){this.anim_state="stop"};a.goToAndPlay=
  function(f){try{if(typeof f=="undefined")throw Error(console.log("goToAndPlay(arg) requires a frame number, label or keyword(nextFrame, lastFrame)"));}catch(g){BigBlock.Log.display(g.name+": "+g.message)}this.anim_frame=this.goToFrame(f,this.anim_frame,this.anim);this.anim_state="play"};a.goToAndStop=function(f){try{if(typeof f=="undefined")throw Error(console.log("goToAndStop(arg) requires a frame number, label or keyword(nextFrame, lastFrame)"));}catch(g){BigBlock.Log.display(g.name+": "+g.message)}this.anim_frame=
  this.goToFrame(f,this.anim_frame,this.anim);if(typeof f=="number")this.anim_frame_duration=0;this.anim_state="stop"};BigBlock.Sprites.push(a)}}}();
  BigBlock.SpriteSimple=function(){return{create:function(b){var a=BigBlock.clone(BigBlock.Sprite);a.configure();if(typeof b!="undefined")for(var e in b)if(b.hasOwnProperty(e))a[e]=b[e];b=BigBlock.Color.getPalette();for(var c in b.classes)if(b.classes[c].name==a.className){a.color_max=b.classes[c].val.length-1;break}a.color_index=a.className+"0";a.anim=a.getAnim(a.color_index);BigBlock.Sprites.push(a)}}}();
  BigBlock.TapTimeout=function(){return{timeout_length:3E3,timeout_obj:false,arrow_direction:"up",x:BigBlock.Grid.width/2-BigBlock.Grid.pix_dim,y:BigBlock.Grid.height-BigBlock.Grid.pix_dim*2,className:"white",start:function(b){if(typeof b!="undefined")for(var a in b)if(b.hasOwnProperty(a))this[a]=b[a];this.timeout_obj=setTimeout("BigBlock.TapTimeout.display()",this.timeout_length)},display:function(){BigBlock.WordSimple.create({word_id:"tap_timeout_word_tap",x:this.x,y:this.y,value:"tap",className:this.className});
  switch(this.arrow_direction){case "left":BigBlock.WordSimple.create({word_id:"tap_timeout_arrow",x:this.x-BigBlock.Grid.pix_dim*2,y:this.y,value:"arrow_left",className:this.className});break;case "right":BigBlock.WordSimple.create({word_id:"tap_timeout_arrow",x:this.x,y:this.y,value:"arrow_right",className:this.className});break;case "down":BigBlock.WordSimple.create({word_id:"tap_timeout_arrow",x:this.x,y:this.y,value:"arrow_down",className:this.className});break;default:BigBlock.WordSimple.create({word_id:"tap_timeout_arrow",
  x:this.x+BigBlock.Grid.pix_dim,y:this.y-BigBlock.Grid.pix_dim,value:"arrow_up",className:this.className});break}},stop:function(){clearTimeout(this.timeout_obj);typeof BigBlock.Sprites[BigBlock.getObjIdByWordId("tap_timeout_word_tap")]!="undefined"&&BigBlock.Sprites[BigBlock.getObjIdByWordId("tap_timeout_word_tap")].remove();typeof BigBlock.Sprites[BigBlock.getObjIdByWordId("tap_timeout_arrow")]!="undefined"&&BigBlock.Sprites[BigBlock.getObjIdByWordId("tap_timeout_arrow")].remove()},die:function(){this.stop();
  delete BigBlock.TapTimeout}}}();
  BigBlock.Timer=function(){var b=(new Date).getTime();return{alias:"Timer",frame_rate:33,start:(new Date).getTime(),end:(new Date).getTime(),time:0,clock:0,errors:[],build_start:(new Date).getTime(),sprites_to_kill:[],tap_timeout:true,tap_timeout_params:false,input_feedback:true,input_feedback_grad:false,grid_active_styles:false,grid_static_styles:false,grid_text_styles:false,document_body_style:{backgroundColor:"#333"},app_header:false,app_header_styles:{},app_footer:false,app_footer_styles:{},before_play:false,
  play:function(a){if(typeof a!="undefined")for(var e in a)if(a.hasOwnProperty(e))this[e]=a[e];for(var c in this.document_body_style)if(this.document_body_style.hasOwnProperty(c))document.getElementsByTagName("body")[0].style[c]=this.document_body_style[c];a=document.createElement("style");a.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(a);document.styleSheets[document.styleSheets.length-1].insertRule("body {margin: 0;padding: 0;}",0);document.styleSheets[document.styleSheets.length-
  1].insertRule("div.color {background-color : transparent;}",0);document.styleSheets[document.styleSheets.length-1].insertRule("div.pix {float:left;width:"+BigBlock.Grid.pix_dim+"px;height:"+BigBlock.Grid.pix_dim+"px;position:absolute;}",0);BigBlock.GridActive=BigBlock.clone(BigBlock.Grid);BigBlock.GridActive.configure({quads:[{id:"qA_tl",left:BigBlock.Grid.width/2,top:BigBlock.Grid.height/2,zIndex:1},{id:"qA_tr",left:0,top:BigBlock.Grid.height/2,zIndex:1},{id:"qA_bl",left:BigBlock.Grid.width/2,top:0,
  zIndex:1},{id:"qA_br",left:0,top:0,zIndex:1}],styles:this.grid_active_styles});BigBlock.GridStatic=BigBlock.clone(BigBlock.Grid);BigBlock.GridStatic.configure({quads:[{id:"qS_tl",left:BigBlock.Grid.width/2,top:BigBlock.Grid.height/2,zIndex:-10},{id:"qS_tr",left:0,top:BigBlock.Grid.height/2,zIndex:-1},{id:"qS_bl",left:BigBlock.Grid.width/2,top:0,zIndex:-1},{id:"qS_br",left:0,top:0,zIndex:-1}],styles:this.grid_static_styles});BigBlock.GridText=BigBlock.clone(BigBlock.Grid);BigBlock.GridText.configure({quads:[{id:"qT_tl",
  left:BigBlock.Grid.width/2,top:BigBlock.Grid.height/2,zIndex:20},{id:"qT_tr",left:0,top:BigBlock.Grid.height/2,zIndex:2},{id:"qT_bl",left:BigBlock.Grid.width/2,top:0,zIndex:2},{id:"qT_br",left:0,top:0,zIndex:2}],styles:this.grid_text_styles});if(this.input_feedback===true){input_feedback=this.input_feedback_grad!==false?this.input_feedback_grad:"rgb(255, 255, 255);rgb(239, 239, 239);rgb(216, 216, 216);rgb(189, 189, 189);rgb(159, 159, 159);rgb(127, 127, 127);rgb(96, 96, 96);rgb(66, 66, 66);rgb(39, 39, 39);rgb(16, 16, 16)";
  a={classes:[{name:"input_feedback",val:input_feedback.split(";")}]};BigBlock.Color.add(a);BigBlock.InputFeedback.configure({className:"input_feedback"})}typeof BigBlock.ScreenEvent.alias=="undefined"&&BigBlock.ScreenEvent.create({});this.add_char_loader()},add_char_loader:function(){BigBlock.Loader.add();BigBlock.Loader.update();var a=document.createElement("style");a.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(a);this.build_char()},build_char:function(){BigBlock.GridActive.build_char_styles()?
  this.add_color_loader():setTimeout(this.build_char,1)},add_color_loader:function(){BigBlock.Loader.add();BigBlock.Loader.update();var a=document.createElement("style");a.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(a);this.build_color()},build_color:function(){BigBlock.Color.build()?BigBlock.Timer.add_grid_loader():setTimeout(BigBlock.Timer.build_color,1)},add_grid_loader:function(){BigBlock.Loader.add();BigBlock.Loader.update();var a=document.createElement("style");
  a.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(a);for(a=0;a<document.styleSheets.length;a++)if(document.styleSheets[a].cssRules.length>0)if(document.styleSheets[a].cssRules[0].selectorText.search("extGrid")!=-1)break;BigBlock.Timer.build_grid()},build_grid:function(){if(BigBlock.GridActive.build()){document.body.innerHTML="";BigBlock.GridActive.add();BigBlock.GridStatic.add();BigBlock.GridText.add();for(var a in BigBlock.Sprites)if(BigBlock.Sprites.hasOwnProperty(a))BigBlock.Sprites[a].state=
  "start";BigBlock.Log.display((new Date).getTime()-b+"ms");delete BigBlock.GridActive.build;delete BigBlock.GridActive.add;delete BigBlock.GridStatic.add;delete BigBlock.GridStatic.build;delete BigBlock.GridText.add;delete BigBlock.GridText.build;delete BigBlock.Loader;delete BigBlock.Timer.add_color_loader;delete BigBlock.Timer.build_color;delete BigBlock.Timer.add_grid_loader;delete BigBlock.Timer.build_grid;delete BigBlock.Timer.play;if(BigBlock.Timer.tap_timeout){if(typeof BigBlock.CharPresets.getChar!=
  "function")BigBlock.CharPresets=BigBlock.CharPresets.install();BigBlock.TapTimeout.start(BigBlock.Timer.tap_timeout_params)}if(BigBlock.Timer.app_header!==false)BigBlock.Header.add(BigBlock.GridActive.x,BigBlock.GridActive.y,typeof BigBlock.Timer.app_header_styles.backgroundColor=="undefined"?BigBlock.Timer.document_body_style.backgroundColor:BigBlock.Timer.app_header_styles.backgroundColor);if(BigBlock.Timer.app_footer!==false)BigBlock.Footer.add(BigBlock.GridActive.x,BigBlock.GridActive.y+BigBlock.GridActive.height,
  typeof BigBlock.Timer.app_footer_styles.backgroundColor=="undefined"?BigBlock.Timer.document_body_style.backgroundColor:BigBlock.Timer.app_footer_styles.backgroundColor);BigBlock.Timer.before_play!==false&&typeof BigBlock.Timer.before_play=="function"&&BigBlock.Timer.before_play();BigBlock.Timer.run()}else setTimeout(BigBlock.Timer.build_grid,1)},run:function(){for(var a=0;a<BigBlock.Sprites.length;a++)typeof BigBlock.Sprites[a]=="object"&&typeof BigBlock.Sprites[a].run=="function"&&BigBlock.Sprites[a].run();
  BigBlock.Timer.cleanUpSprites();this.end=(new Date).getTime();this.time=this.end-this.start;if(this.time<=this.frame_rate+1)this.buffer=setTimeout("BigBlock.Timer.render()",this.frame_rate-this.time);else BigBlock.Timer.render()},cleanUpSprites:function(){for(var a=0;a<this.sprites_to_kill.length;a++)BigBlock.Sprites[this.sprites_to_kill[a]].state="dead";a=false;for(var e=0;e<BigBlock.Sprites.length;e++)if(BigBlock.Sprites[e].state=="dead"){typeof BigBlock.Sprites[e].afterDie=="function"&&BigBlock.Sprites[e].afterDie();
  BigBlock.Sprites.splice(e,1);a=true}if(a)for(a=0;a<BigBlock.Sprites.length;a++)BigBlock.Sprites[a].index=a;this.sprites_to_kill=[]},render:function(){this.clock++;BigBlock.RenderMgr.renderPix(BigBlock.Sprites);this.buffer=setTimeout("BigBlock.Timer.run()",this.frame_rate);this.start=(new Date).getTime()},killObject:function(a){if(typeof a!="undefined")if(typeof BigBlock.Sprites[a.index]=="object")try{BigBlock.Sprites[a.index].render_static||this.sprites_to_kill.push(a.index)}catch(e){BigBlock.Log.display(e.name+
  ": "+e.message)}}}}();Math.degreesToRadians=function(b){return Math.PI/180*b};Math.radiansToDegrees=function(b){return 180/Math.PI*b};Math.getRamdomNumber=function(b,a){return Math.floor(Math.random()*(a+1))+b};Math.getDistanceBwTwoPts=function(b,a,e,c){return d=Math.sqrt(Math.pow(e-b,2)+Math.pow(c-a,2))};BigBlock.clone=function(b){function a(){}a.prototype=b;return new a};
  BigBlock.getPixIndex=function(b,a){if(b>=BigBlock.Grid.width/2)b-=BigBlock.Grid.width/2;if(a>=BigBlock.Grid.height/2)a-=BigBlock.Grid.height/2;if(BigBlock.Grid.pix_dim!==0){var e=Math.floor(b/BigBlock.Grid.pix_dim),c=Math.floor(a/BigBlock.Grid.pix_dim);return e+Math.round(BigBlock.Grid.width/2/BigBlock.Grid.pix_dim)*c}else return 1};
  BigBlock.getPixLoc=function(b,a,e){var c;if(b=="x"){e%=Math.round(BigBlock.Grid.width/BigBlock.Grid.pix_dim);c=a+e*BigBlock.Grid.pix_dim}if(b=="y")c=a+(e>0?Math.floor(e/Math.round(BigBlock.Grid.width/BigBlock.Grid.pix_dim)):Math.ceil(e/Math.round(BigBlock.Grid.width/BigBlock.Grid.pix_dim)))*BigBlock.Grid.pix_dim;return c};BigBlock.getObjIdByAlias=function(b){var a=false;for(var e in BigBlock.Sprites)if(BigBlock.Sprites[e].alias==b)return a=e;return a};
  BigBlock.getObjIdByWordId=function(b){var a=false;for(var e in BigBlock.Sprites)if(BigBlock.Sprites[e].word_id==b)return a=e;return a};BigBlock.Log=function(){return{display:function(b){try{window.console&&window.console.firebug&&console.log(b)}catch(a){}}}}();BigBlock.getUniqueId=function(){return(new Date).getTime()+BigBlock.Sprites.length};
  BigBlock.removeStatic=function(b,a){try{if(typeof b=="undefined")throw Error("BigBlock.removeStatic(alias) requires an alias.");if(typeof b!="string")throw Error("BigBlock.removeStatic(alias); alias must be a string.");}catch(e){BigBlock.Log.display(e.name+": "+e.message)}for(var c in BigBlock.GridStatic.quads)if(BigBlock.GridStatic.quads.hasOwnProperty(c)){var f=document.getElementById(BigBlock.GridStatic.quads[c].id);if(f.hasChildNodes()){pixNodes=f.childNodes;for(var g=[],h=0;h<pixNodes.length;h++)b==
  pixNodes[h].getAttribute("alias")&&g.push(pixNodes[h]);for(h in g)g.hasOwnProperty(h)&&f.removeChild(g[h])}}typeof a=="function"&&a()};BigBlock.inArray=function(b,a){console.log(b);console.log(a);for(var e=false,c=0;c<a.length;c++)if(typeof b==typeof a[c]&&b==a)e=true;return e};BigBlock.checkHasDupes=function(b){var a,e,c;a=[];c=b.pix.length;for(a=0;a<c;a++)for(e=a+1;e<c;e++)if(b.pix.i.i==b.pix.j.i)return a=[b.pix.i,b.pix.j];return false};
  BigBlock.Word=function(){return{configure:function(){this.alias="Word";this.word_id="word1";this.x=BigBlock.Grid.width/2;this.y=BigBlock.Grid.height/2;this.state="run";this.value="BIG BLOCK";this.center=false;this.className="white";this.afterDie=null;this.render=0;this.render_static=true;this.index=BigBlock.Sprites.length},die:function(){},remove:function(b){var a=this.word_id,e=BigBlock.GridText.quads;for(var c in e)if(e.hasOwnProperty(c)){var f=document.getElementById(e[c].id);if(f.hasChildNodes()){pixNodes=
  f.childNodes;for(var g=[],h=0;h<pixNodes.length;h++)pixNodes[h].getAttribute("id")==a+"_char"&&g.push(pixNodes[h]);for(h in g)g.hasOwnProperty(h)&&f.removeChild(g[h])}}if(typeof b=="function")this.afterDie=b;this.render_static=false;BigBlock.Timer.killObject(this)}}}();
  BigBlock.WordSimple=function(){return{create:function(b){var a=BigBlock.clone(BigBlock.Word);a.configure();if(typeof b!="undefined")for(var e in b)if(b.hasOwnProperty(e))a[e]=b[e];b=BigBlock.Color.getPalette();for(var c in b.classes)if(b.classes[c].name==a.className){a.color_max=b.classes[c].val.length-1;break}if(a.center)a.x=BigBlock.Grid.width/2-a.value.length*BigBlock.Grid.pix_dim/2;try{if(typeof BigBlock.CharPresets.getChar=="undefined")throw Error("BigBlock.CharPresets = BigBlock.CharPresets.install() must be run before creating Words.");
  else if(BigBlock.CharPresets.getChar(a.value))BigBlock.CharSimple.create({word_id:a.word_id+"_char",value:a.value,x:a.x,y:a.y,className:a.className});else for(c=0;c<a.value.length;c++)BigBlock.CharSimple.create({word_id:a.word_id+"_char",value:a.value[c],x:a.x+c*BigBlock.Grid.pix_dim,y:a.y,className:a.className})}catch(f){BigBlock.Log.display(f.name+": "+f.message)}BigBlock.Sprites.push(a)}}}();