var ipad2=(function(){var e=$("#ipad"),b=e.find("#slider, #breakout"),c=8,d=function(f){f.animate({width:"40%",height:"40%",top:"25%",left:"25%",opacity:0},400,function(){$(f).hide()})},a={anim:function(f){if(f&&!this.is(":visible")){d(this)}else{if(this.is(":visible")){d(this)}else{this.show().animate({width:"100%",height:"100%",top:"0px",left:"0px",opacity:1})}}},generatePlaceholders:function(){var g=0,f=[],j=document.createDocumentFragment(),h;for(;g<c;g++){f[g]=document.createElement("a");f[g].href="#";f[g].innerHTML="Placeholder";h=g%4*-36+"px ";h+=g<4?"-36px":"0";f[g].style.backgroundPosition=h;f[g].addEventListener("click",function(i){i.preventDefault()},false);j.appendChild(f[g])}$("#desktop").append(j)},switchApp:function(f){if(f.target.className==="home-btn"){b.each(function(){a.anim.call($(this),true)})}else{if(f.target.className==="slideshow"){a.anim.call(b.eq(1))}else{if(f.target.className==="breakout"){a.anim.call(b.eq(0))}}}f.preventDefault()},time:function(){var g=new Date(),f=g.getHours(),h=g.getMinutes(),i=function(j){return j<10?"0"+j:j};e.find("li:eq(1)").html(i(f)+":"+i(h))},init:function(){var g=window,f=g.location.hostname==="teknas"?"http://teknas/JS-Games/breakout/":"http://nicolahibbert.com/demo/breakout/";$(".home-btn").one("click",function(h){$.getScript(f+"breakout.min.js");h.preventDefault()});$(".home-btn, .slideshow, .breakout").click(function(h){a.switchApp(h)});a.generatePlaceholders();setInterval(function(){a.time()},1000)}};if(!document.createElement("canvas").getContext){return false}else{a.init()}})();
