scene2={init:function(){mainCol="#737DFC";bgCol="#000A8C";modal.enable();keysAble=true;$("#intro").fadeOut("500");$("#intro").remove().delay("500");sceneOne.stop();$("#main").fadeIn("500");$("#main").append('<div id="content"></div>');$("#content").css("height",fullH-216).css("top","130px").css("width",fullW-100);$("#html").animate({backgroundColor:bgCol},"500");$("#noise").show();document.body.style.cursor="url(images/cursor.png) 11 7, normal";makeItHappen();}};function makeItHappen(){canvas=document.getElementById("scene2");ctx=canvas.getContext("2d");ctx.canvas.width=fullW;ctx.canvas.height=fullH;sceneTwo=new Frame.Set(canvas,1000);sceneTwo.setUpdateSet(function(){});sceneTwo.setDrawSet(function(){innerFX();ctx.save();ctx.shadowBlur=10;ctx.shadowColor=mainCol;ctx.shadowOffsetX=ctx.shadowOffsetY=0;ctx.fillStyle=mainCol;ctx.fillRect(50,50,fullW-100,30);ctx.fill();ctx.restore();ctx.save();ctx.translate(55,fullH-130);drawShortcut("A","About Me",0,60);drawShortcut("P","Projects",120,60);drawShortcut("D","Downloads",240,60);drawShortcut("C","Contact",360,60);ctx.restore();});renderText.about();$(document).keypress(function(a){keyD=(a.keyCode?a.keyCode:a.which);if(keysAble){if(keyD==97){renderText.about();}else{if(keyD==112){renderText.projects();}else{if(keyD==100){renderText.downloads();}else{if(keyD==99){renderText.contact();}}}}}});}renderText={error:"Error loading the content! Please refresh.",about:function(){$.ajax({url:"content/about.ii",type:"GET",dataType:"html",timeout:1000,error:function(){alert(renderText.error);},success:function(a){renderText.art(false);$("#content").html(a);numKeys.init();renderText.titleBar("HARRY HARRISON");}});},projects:function(){$.ajax({url:"content/projects.ii",type:"GET",dataType:"text",timeout:1000,error:function(){alert(renderText.error);},success:function(a){renderText.art(false);$("#content").html(a);renderText.titleBar("HARRY HARRISON'S PROJECTS");numKeys.projects();}});},downloads:function(){$.ajax({url:"content/downloads.ii",type:"GET",dataType:"text",timeout:1000,error:function(){alert(renderText.error);},success:function(a){renderText.art(false);$("#content").html(a);numKeys.downloads();renderText.titleBar("HARRY HARRISON'S DOWNLOADS");}});},contact:function(){modal.contact();},contactSent:function(a){$.ajax({url:"content/art/sent.ii",type:"GET",dataType:"text",timeout:1000,error:function(){alert(renderText.error);},success:function(b){renderText.art(true);$("#content").html(b);renderText.titleBar(a);}});},titleBar:function(a){ctx.save();ctx.clearRect(50,50,fullW-100,30);ctx.fillStyle=mainCol;ctx.fillRect(50,50,fullW-100,30);ctx.fill();ctx.font="21px M1mbold";ctx.fillStyle=bgCol;ctx.textBaseline="top";ctx.fillText("HH▮II 1.0.1",60,55);tWidth=ctx.measureText(a).width;ctx.fillText(a,centerX-(tWidth/2),55);ctx.restore();},art:function(a){if(a==true){$("#content").css("line-height","14px").css("letter-spacing","-1px");}else{$("#content").css("line-height","1.8").css("letter-spacing","0px");}}};numKeys={enableD:function(){d1=true;d2=true;d3=true;d4=true;d5=true;d6=true;d7=true;d8=true;d9=true;},enableP:function(){p1=true;p2=true;p3=true;p4=true;p5=true;p6=true;p7=true;p8=true;p9=true;},init:function(){return false;},downloads:function(){numKeys.enableD();$(document).keypress(function(a){keyD=(a.keyCode?a.keyCode:a.which);if(keysAble){if(keyD==49&&d1){location.href="/=/DATASPECTRA/";d1=false;}else{if(keyD==50&&d2){location.href="/=/LB-SS/";d4=false;}else{if(keyD==51&&d3){location.href="/=/STARFIELD/";d3=false;}else{if(keyD==52&&d4){location.href="/=/TRAFFIC/";d4=false;}else{if(keyD==53&&d5){location.href="/=/xcode_fixel_template/Flixel_Xcode_Template_Installer.zip";d5=false;}else{if(keyD==54&&d6){location.href="/=/xcode_AS3/Xcode_AS3-SH_Installer.zip";d6=false;}else{if(keyD==55&&d7){}else{if(keyD==56&&d8){}else{if(keyD==57&&d9){}}}}}}}}}}});},projects:function(){numKeys.enableP();$(document).keypress(function(a){keyD=(a.keyCode?a.keyCode:a.which);if(keysAble){if(keyD==49&&p1){}else{if(keyD==50&&p2){}else{if(keyD==51&&p3){}else{if(keyD==52&&p4){}else{if(keyD==53&&p5){}else{if(keyD==54&&p6){}else{if(keyD==55&&p7){}else{if(keyD==56&&p8){}else{if(keyD==57&&p9){}}}}}}}}}}});},};function write(c,a,d,b){ctx.save();ctx.shadowBlur=5;ctx.shadowColor=mainCol;ctx.shadowOffsetX=ctx.shadowOffsetY=0;if(b=="b"){ctx.font="16px M1mbold";}else{if(b=="bi"){ctx.font="Italic 16px M1mbold";}else{if(b=="i"){ctx.font="Italic 16px M1mregular";}else{if(b=="n"){ctx.font="16px M1mregular";}else{ctx.font="16px M1mregular";}}}}ctx.fillStyle=mainCol;ctx.textBaseline="top";ctx.fillText(c,a,d);ctx.restore();}function drawShortcut(b,d,a,e,c){ctx.save();ctx.save();ctx.shadowBlur=5;ctx.shadowColor=mainCol;ctx.shadowOffsetX=ctx.shadowOffsetY=0;ctx.fillStyle=mainCol;if(c){ctx.fillRect(a-5,e-5,c,25);}else{ctx.fillRect(a-5,e-5,18,25);}ctx.fill();ctx.restore();ctx.font="16px M1mbold";ctx.fillStyle=bgCol;ctx.textBaseline="top";ctx.fillText(b,a,e);if(c){write(d,a+5+c,e);}else{write(d,a+18+5,e);}ctx.restore();}modal={click:function(){if(m.click&&mClicks>1){modal.init();drawKeyboard();$("#modal span").text("Use your keyboard to navigate");}else{return false;}},resize:function(){if(m.resize){modal.init();drawRefresh();$("#modal span").text("You may want to refresh the page");}else{return false;}},contact:function(){if(m.contact){modal.init(true);drawContact();keysAble=false;}else{return false;}},closeContact:function(){if(closeContact){$("#modal").fadeOut("500");$("#overlay").fadeOut("500");setTimeout(function(){m.initable=true;modal.enable();keysAble=true;$("#overlay").remove();$("#modal").remove();},500);}},sentContact:function(a){renderText.contactSent(a);$("#modal").fadeOut("500");$("#overlay").fadeOut("500");setTimeout(function(){m.initable=true;modal.enable();keysAble=true;$("#overlay").remove();$("#modal").remove();},500);},errorContact:function(){$("#modal span").fadeOut("500");$("#modal").append('<span class="cError" style="display:none;">That\'s not an email address...</span>');$("#modal .cError").fadeIn("500");setTimeout(function(){$("#modal .cError").fadeOut("500").delay("500").remove();$("#modal span").fadeIn("500");},1500);},init:function(b){if(m.initable){modal.disable();$("#main").append('<div id="overlay"></div>');$("#overlay").fadeIn("500");$("#main").append('<div id="modal"></div>');$("#modal").append('<canvas id="modalCanvas"></canvas>').append("<span></span>");modCanvas=document.getElementById("modalCanvas");ctxM=modCanvas.getContext("2d");$("#modal").css("left",centerX-190).css("top",centerY-160);$("#modal").fadeIn("500");if(b){closeContact=true;if($.browser.mozilla){alert("There is a bug in Firefox involving forms.\n\nPlease use Google Chrome or Safari to contact me. Thanks.");modal.closeContact();}else{var c='<input class="field" name="email" type="text" placeholder="Enter your email here"/>';var a='<input id="submit" type="submit" name="submit" value="CLOSE"/>';$("#modal span").append('<form method="post"  action="javascript:cForm()">'+c+a+"</form>");}$(".field").keyup(function(){$("#submit").addClass("active").val("SEND");var d=$(".field").val();if(d.length<1){$("#submit").removeClass("active").val("CLOSE");}});}else{$("#modal").delay("1000").fadeOut("500");$("#overlay").delay("1000").fadeOut("500");setTimeout(function(){m.initable=true;modal.enable();$("#overlay").remove();$("#modal").remove();},2000);}}else{return false;}},enable:function(){m={contact:true,click:true,resize:true,initable:true};closeContact=false;},disable:function(){m={contact:false,click:false,resize:false,initable:false};}};function cForm(){var a=$(".field").val();if(a.length<1){modal.closeContact();}else{if(!a.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)){modal.errorContact();m.contact=true;}else{$.ajax({type:"POST",url:"mail.php",data:"email="+a,cache:false,success:function(b){modal.sentContact(b);}});return false;}}}function innerFX(){speed=70;interval=null;if(this.interval!==null){return;}this.interval=setInterval(function(){var b=Math.round(Math.random()*512);var c=Math.round(Math.random()*512);$("#noise").css("background-position",b+"px "+c+"px");},this.speed);ctx.save();glow=ctx.createRadialGradient(fullW/2,fullH/2,fullW/2,fullW/2,fullH/2,fullH/2);glow.addColorStop(0,"rgba(255,255,255,0)");glow.addColorStop(1,"rgba(255,255,255,0.1)");ctx.fillStyle=glow;ctx.fillRect(0,0,fullW,fullH);ctx.restore();ctx.save();ctx.shadowBlur=100;ctx.shadowColor=mainCol;ctx.shadowOffsetX=ctx.shadowOffsetY=0;ctx.fillRect(0,-10,fullW,10);ctx.fill();ctx.restore();for(var a=5;a<canvas.height;a+=5){ctx.moveTo(0,a);ctx.lineTo(canvas.width,a);}ctx.globalAlpha=0.025;ctx.strokeStyle="rgb(255,255,255)";ctx.stroke();ctx.globalAlpha=1;}if($.browser.webkit){console.log('"Somewhere, something incredible is waiting to be known." - Carl Sagan');}else{console.log=function(){};}$(window).resize(function(){to=false;if(to!==false){clearTimeout(to);}to=setTimeout(function(){fullW=window.innerWidth;fullH=window.innerHeight;modal.resize();},200);});$(window).click(function(){mClicks++;modal.click();});
