Akadaşlar Canvas Rider oyununu sitemize eklemek mümkün mü acaba?
#Konuyu yanlış yere açtıysa affola..
Canvas Rider#Siteye Ekleme |
9 Mesajlar | 2.275 Okunma |
<script></script><script>canvas_ride(559890); if (window.location.href.indexOf("#") != -1) watchGhost(1);</script>
// Canvas Rider RC7 by Pete & Maxime, a canvasrider.com exclusive
function J(x,y){this.x=x;this.y=y;}J.prototype.o=function(){return new J((this.x-C.A5.x)*C.H+p.width/2,(this.y-C.A5.y)*C.H+p.height/2);};J.prototype.Cr=function(){return new J((this.x-p.width/2)/C.H+C.A5.x,(this.y-p.height/2)/C.H+C.A5.y);};J.prototype.AN=function(U){this.x=U.x;this.y=U.y;};J.prototype.Ai=function(U){this.x+=U.x;this.y+=U.y;};J.prototype.add=function(U){return new J(this.x+U.x,this.y+U.y);};J.prototype.sub=function(U){return new J(this.x-U.x,this.y-U.y);};J.prototype.F=function(DF){return new J(this.x*DF,this.y*DF);};J.prototype.Bd=function(U){return this.x*U.x+this.y*U.y;};J.prototype.Bc=function(Cw){return new J(this.x/Cw,this.y/Cw);};J.prototype.length=function(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2));};J.prototype.Ae=function(){return Math.pow(this.x,2)+Math.pow(this.y,2);};function Ah(G,parent){this.G=new J(G.x,G.y);this._=new J(G.x,G.y);this.g=new J(0,0);this.parent=parent;this.Al=10;this.B6=0;this.Ad=true;}Ah.prototype.drive=function(O){this.G.Ai(O.F(-O.Bd(this.g)*this.B6));this.BR=true;};Ah.prototype.AO=function(){this.g.Ai(this.parent.Af);this.g=this.g.F(0.99);this.G.Ai(this.g);this.BR=false;if(this.Ad){C.Ad(this);}this.g=this.G.sub(this._);this._.AN(this.G);};function Ba(G,parent){this.G=new J(G.x,G.y);this._=new J(G.x,G.y);this.g=new J(0,0);this.parent=parent;this.Al=10;this.B6=0;this.Ad=true;this.Af=true;this.Bq=0;this.AX=0;}Ba.prototype.drive=function(O){this.G.Ai(O.F(this.AX*this.parent.O));if(this.AR){this.G.Ai(O.F(-O.Bd(this.g)*0.3));}this.Bq=O.Bd(this.g)/this.Al;this.BR=true;};Ba.prototype.AO=function(){this.g.Ai(this.parent.Af);this.g=this.g.F(0.99);this.G.Ai(this.g);this.BR=false;if(this.Ad){C.Ad(this);}this.g=this.G.sub(this._);this._.AN(this.G);};function By(G,parent){this.G=new J(G.x+5*(Math.random()-Math.random()),G.y+5*(Math.random()-Math.random()));this._=new J(this.G.x,this.G.y);this.g=new J(11*(Math.random()-Math.random()),11*(Math.random()-Math.random()));this.parent=parent;this.Al=2+Math.random()*9;this.Ak=Math.random()*6.2;this.Bq=Math.random()-Math.random();this.B6=0.05;this.Ad=true;this.DG=new Array(1,0.7,0.8,0.9,0.5,1,0.7,1);}By.prototype.Am=function(){var M=this.G.o();this.Ak+=this.Bq;var AS=this.DG[0]*this.Al/2;var L=M.x+AS*Math.cos(this.Ak);var N=M.y+AS*Math.sin(this.Ak);B.beginPath();B.fillStyle="black";B.moveTo(L,N);for(var AA=2;AA<8;AA++){AS=this.DG[AA-1]*this.Al/2;L=M.x+AS*Math.cos(this.Ak+6.283*AA/8);N=M.y+AS*Math.sin(this.Ak+6.283*AA/8);B.lineTo(L,N);}B.fill();};By.prototype.drive=function(O){this.Bq=O.Bd(this.g)/this.Al;this.G.Ai(O.F(-O.Bd(this.g)*this.B6));this.Ak+=this.Bq;var AA=O.length();if(AA>0){var AS=new J(-O.y/AA,O.x/AA);this._.Ai(AS.F(AS.Bd(this.g)*0.8));}};By.prototype.AO=function(){this.g.Ai(this.parent.Af);this.g=this.g.F(0.99);this.G.Ai(this.g);this.BR=false;if(this.Ad){C.Ad(this);}this.g=this.G.sub(this._);this._.AN(this.G);};function Ac(A2,A4,parent){this.A2=A2;this.A4=A4;this.parent=parent;this.A1=40;this.AB=40;this.BE=0.5;this.BC=0.7;}Ac.prototype.A3=function(AH,AK){this.AB=this.AB+(this.A1-AH-this.AB)/AK;};Ac.prototype.rotate=function(Bz){var AJ=this.A4.G.sub(this.A2.G);var DU=new J(-AJ.y/this.AB,AJ.x/this.AB);this.A2.G.Ai(DU.F(Bz));this.A4.G.Ai(DU.F(-Bz));};Ac.prototype.AO=function(){var AJ=this.A4.G.sub(this.A2.G);var length=AJ.length();if(length<1){return;}AJ=AJ.F(1/length);var DD=AJ.F((length-this.AB)*this.BC);var B6=this.A4.g.sub(this.A2.g).Bd(AJ)*this.BE;DD.Ai(AJ.F(B6));this.A4.g.Ai(DD.F(-1));this.A2.g.Ai(DD);};Ac.prototype.Aq=function(){var CE=new J;CE.AN(this.A2.G);this.A2.G.AN(this.A4.G);this.A4.G.AN(CE);CE.AN(this.A2._);this.A2._.AN(this.A4._);this.A4._.AN(CE);CE.AN(this.A2.g);this.A2.g.AN(this.A4.g);this.A4.g.AN(CE);var Da=this.A2.Ak;this.A2.Ak=this.A4.Ak;this.A4.Ak=Da;};function Bk(){this.D=new Array;this.D.push(new Ah(new J(Z[Z.length-1][0],Z[Z.length-1][1]),this));this.D[0]._=new J(Z[Z.length-1][2],Z[Z.length-1][3]);this.D[0].g=new J(Z[Z.length-1][4],Z[Z.length-1][5]);this.D.push(new Ba(new J(Z[Z.length-1][6],Z[Z.length-1][7]),this));this.D[1]._=new J(Z[Z.length-1][8],Z[Z.length-1][9]);this.D[1].g=new J(Z[Z.length-1][10],Z[Z.length-1][11]);this.D[1].AX=Z[Z.length-1][12];this.D.push(new Ba(new J(Z[Z.length-1][13],Z[Z.length-1][14]),this));this.D[2]._=new J(Z[Z.length-1][15],Z[Z.length-1][16]);this.D[2].g=new J(Z[Z.length-1][17],Z[Z.length-1][18]);this.D[2].AX=Z[Z.length-1][19];this.h=this.D[0];this.h.Al=14;this.h.drive=function(){AP.DB();};this.Q=this.D[1];this.Q.Al=11.7;this.AI=this.D[2];this.AI.Al=11.7;this.S=new Array;this.S.push(new Ac(this.D[0],this.D[1],this));this.S.push(new Ac(this.D[1],this.D[2],this));this.S.push(new Ac(this.D[2],this.D[0],this));this.AM=this.S[0];this.AM.A1=45;this.AM.AB=Z[Z.length-1][20];this.AM.BC=0.35;this.AM.BE=0.3;this.AQ=this.S[1];this.AQ.A1=42;this.AQ.AB=Z[Z.length-1][21];this.AQ.BC=0.35;this.AQ.BE=0.3;this.AU=this.S[2];this.AU.A1=45;this.AU.AB=Z[Z.length-1][22];this.AU.BC=0.35;this.AU.BE=0.3;this.save=false;this.A9=false;this.At=0;this.O=Z[Z.length-1][23];this.Af=new J(Z[Z.length-1][24],Z[Z.length-1][25]);this.A8=Z[Z.length-1][26];C.Be=Z[Z.length-1][27];for(var j=0;j=this.z){delete AZ[BD][BJ];}}}}else{AZ=new Array(new Array,new Array,new Array,new Array,new Array);}}Bk.prototype.Aq=function(){Ct=Aq=false;this.O*=-1;this.AQ.Aq();var AM=this.S[0].AB;this.AM.AB=this.S[2].AB;this.AU.AB=AM;};Bk.prototype.DC=function(){this.save=false;if(C.BU&&C.Be==C.BU){if((AZ[0].length||AZ[1].length)&&C.ID!=undefined){alert("Track complete!");var request=new XMLHttpRequest();request.open("POST","js/completed.php",false);request.setRequestHeader("Content-type","application/x-www-form-urlencoded");request.send("trackID="+C.ID);}if(this.z>5000&&(!C.z||this.z=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}if(this.Q.BR&&this.AI.BR){this.A8=false;}if(!this.A8&&!this.A9){this.BS();for(var T=this.S.length-1;T>=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}}};function Cb(AT){this.D=new Array;this.D.push(new Ah(new J(K[K.length-1][0],K[K.length-1][1]),this));this.D[0]._=new J(K[K.length-1][2],K[K.length-1][3]);this.D[0].g=new J(K[K.length-1][4],K[K.length-1][5]);this.D.push(new Ba(new J(K[K.length-1][6],K[K.length-1][7]),this));this.D[1]._=new J(K[K.length-1][8],K[K.length-1][9]);this.D[1].g=new J(K[K.length-1][10],K[K.length-1][11]);this.D[1].AX=K[K.length-1][12];this.D.push(new Ba(new J(K[K.length-1][13],K[K.length-1][14]),this));this.D[2]._=new J(K[K.length-1][15],K[K.length-1][16]);this.D[2].g=new J(K[K.length-1][17],K[K.length-1][18]);this.D[2].AX=K[K.length-1][19];this.h=this.D[0];this.h.Al=14;this.h.drive=function(){W=false;};this.Q=this.D[1];this.Q.Al=11.7;this.AI=this.D[2];this.AI.Al=11.7;this.S=new Array;this.S.push(new Ac(this.D[0],this.D[1],this));this.S.push(new Ac(this.D[1],this.D[2],this));this.S.push(new Ac(this.D[2],this.D[0],this));this.AM=this.S[0];this.AM.A1=45;this.AM.AB=K[K.length-1][20];this.AM.BC=0.35;this.AM.BE=0.3;this.AQ=this.S[1];this.AQ.A1=42;this.AQ.AB=K[K.length-1][21];this.AQ.BC=0.35;this.AQ.BE=0.3;this.AU=this.S[2];this.AU.A1=45;this.AU.AB=K[K.length-1][22];this.AU.BC=0.35;this.AU.BE=0.3;this.Cq=true;this.At=0;this.O=K[K.length-1][23];this.Af=new J(K[K.length-1][24],K[K.length-1][25]);this.A8=K[K.length-1][26];this.left=K[K.length-1][27];this.right=K[K.length-1][28];this.AW=K[K.length-1][29];this.AR=K[K.length-1][30];this.AT=AT;this.z=this.AT[5];}Cb.prototype.Aq=function(){this.O*=-1;this.AQ.Aq();var AM=this.S[0].AB;this.AM.AB=this.S[2].AB;this.AU.AB=AM;};Cb.prototype.BS=function(){this.Q.AX+=(this.AW-this.D[1].AX)/10;if(this.AW){this.At+=this.Q.Bq/5;}this.Q.AR=this.AI.AR=this.AR;var As=this.left-this.right;this.AM.A3(As*5*this.O,5);this.AU.A3(-As*5*this.O,5);this.AQ.rotate(As/6);if(!As&&this.AW){this.AM.A3(-7,5);this.AU.A3(7,5);}};Cb.prototype.Am=function(){var Q=this.Q.G.o();var AI=this.AI.G.o();B.beginPath();B.strokeStyle="rgba(0, 0, 0, 0.5)";B.lineWidth=3.5*C.H;B.arc(Q.x,Q.y,10*C.H,0,2*Math.PI,true);B.moveTo(AI.x+10*C.H,AI.y);B.arc(AI.x,AI.y,10*C.H,0,2*Math.PI,true);B.stroke();var length=AI.sub(Q);var AC=new J((AI.y-Q.y)*this.O,(Q.x-AI.x)*this.O);var A$=Q.add(length.F(0.3)).add(AC.F(0.25));var Ca=Q.add(length.F(0.84)).add(AC.F(0.42));var Cf=Q.add(length.F(0.84)).add(AC.F(0.37));var BG=Q.add(length.F(0.4)).add(AC.F(0.05));B.beginPath();B.lineWidth=3*C.H;B.moveTo(Q.x,Q.y);B.lineTo(A$.x,A$.y);B.lineTo(Ca.x,Ca.y);B.moveTo(Cf.x,Cf.y);B.lineTo(BG.x,BG.y);B.lineTo(Q.x,Q.y);var CY=new J(6*C.H*Math.cos(this.At),6*C.H*Math.sin(this.At));var BV=BG.add(CY);var BW=BG.sub(CY);B.moveTo(BV.x,BV.y);B.lineTo(BW.x,BW.y);var CS=Q.add(length.F(0.17)).add(AC.F(0.38));var Cg=Q.add(length.F(0.3)).add(AC.F(0.45));B.moveTo(CS.x,CS.y);B.lineTo(Cg.x,Cg.y);var Ci=Q.add(length.F(0.25)).add(AC.F(0.4));B.moveTo(BG.x,BG.y);B.lineTo(Ci.x,Ci.y);var Cj=Q.add(length.F(1)).add(AC.F(0));var Cl=Q.add(length.F(0.97)).add(AC.F(0));var CO=Q.add(length.F(0.8)).add(AC.F(0.48));var CQ=Q.add(length.F(0.86)).add(AC.F(0.5));var Ck=Q.add(length.F(0.82)).add(AC.F(0.65));var BL=Q.add(length.F(0.78)).add(AC.F(0.67));B.moveTo(Cj.x,Cj.y);B.lineTo(Cl.x,Cl.y);B.lineTo(CO.x,CO.y);B.lineTo(CQ.x,CQ.y);B.lineTo(Ck.x,Ck.y);B.lineTo(BL.x,BL.y);B.stroke();var h=this.h.G.o();AC=h.sub(Q.add(length.F(0.5)));var An=A$.add(length.F(-0.1)).add(AC.F(0.3));var Ar=BV.sub(An);var BA=new J(Ar.y*this.O,-Ar.x*this.O);BA=BA.F(C.H*C.H);var Cn=An.add(Ar.F(0.5)).add(BA.F(200/Ar.Ae()));Ar=BW.sub(An);BA=new J(Ar.y*this.O,-Ar.x*this.O);BA=BA.F(C.H*C.H);var Co=An.add(Ar.F(0.5)).add(BA.F(200/Ar.Ae()));B.beginPath();B.lineWidth=6*C.H;B.strokeStyle="rgba(0, 0, 0, 0.25)";B.moveTo(BW.x,BW.y);B.lineTo(Co.x,Co.y);B.lineTo(An.x,An.y);B.stroke();B.beginPath();B.strokeStyle="rgba(0, 0, 0, 0.5)";B.lineWidth=6*C.H;B.moveTo(BV.x,BV.y);B.lineTo(Cn.x,Cn.y);B.lineTo(An.x,An.y);B.stroke();var BY=A$.add(length.F(0.05)).add(AC.F(0.9));B.beginPath();B.lineWidth=8*C.H;B.moveTo(An.x,An.y);B.lineTo(BY.x,BY.y);B.stroke();var Bs=A$.add(length.F(0.15)).add(AC.F(1.05));var Ch=A$.add(length.F(0.4)).add(AC.F(1.1));var Cd=A$.add(length.F(0.05)).add(AC.F(1.05));B.beginPath();B.lineWidth=2*C.H;B.moveTo(Bs.x+5*C.H,Bs.y);B.arc(Bs.x,Bs.y,5*C.H,0,2*Math.PI,true);B.moveTo(Ch.x,Ch.y);B.lineTo(Cd.x,Cd.y);B.stroke();length=BY.sub(BL);AC=new J(length.y*this.O,-length.x*this.O);AC=AC.F(C.H*C.H);var CV=BL.add(length.F(0.4)).add(AC.F(130/length.Ae()));B.beginPath();B.lineWidth=5*C.H;B.moveTo(BY.x,BY.y);B.lineTo(CV.x,CV.y);B.lineTo(BL.x,BL.y);B.stroke();B.strokeStyle="black";};Cb.prototype.AO=function(){if(AP.z>this.z){this.AO=function(){};}if(this.AT[0][AP.z]){this.left=this.left?0:1;}if(this.AT[1][AP.z]){this.right=this.right?0:1;}if(this.AT[2][AP.z]){this.AW=this.AW?0:1;}if(this.AT[3][AP.z]){this.AR=this.AR?0:1;}if(this.AT[4][AP.z]){this.Aq();}this.BS();for(var T=this.S.length-1;T>=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}if(this.Q.BR&&this.AI.BR){this.A8=false;}if(!this.A8){this.BS();for(var T=this.S.length-1;T>=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}}};function Bn(){this.D=new Array;this.D.push(new Ah(new J(b[b.length-1][0],b[b.length-1][1]),this));this.D[0]._=new J(b[b.length-1][2],b[b.length-1][3]);this.D[0].g=new J(b[b.length-1][4],b[b.length-1][5]);this.D.push(new Ba(new J(b[b.length-1][6],b[b.length-1][7]),this));this.D[1]._=new J(b[b.length-1][8],b[b.length-1][9]);this.D[1].g=new J(b[b.length-1][10],b[b.length-1][11]);this.D[1].AX=b[b.length-1][12];this.D.push(new Ba(new J(b[b.length-1][13],b[b.length-1][14]),this));this.D[2]._=new J(b[b.length-1][15],b[b.length-1][16]);this.D[2].g=new J(b[b.length-1][17],b[b.length-1][18]);this.D[2].AX=b[b.length-1][19];this.h=this.D[0];this.h.Al=14;this.h.drive=function(){AP.DB();};this.Q=this.D[1];this.Q.Al=14;this.AI=this.D[2];this.AI.Al=14;this.S=new Array;this.S.push(new Ac(this.D[0],this.D[1],this));this.S.push(new Ac(this.D[1],this.D[2],this));this.S.push(new Ac(this.D[2],this.D[0],this));this.AM=this.S[0];this.AM.A1=47;this.AM.AB=b[b.length-1][20];this.AM.BC=0.2;this.AM.BE=0.3;this.AQ=this.S[1];this.AQ.A1=45;this.AQ.AB=b[b.length-1][21];this.AQ.BC=0.2;this.AQ.BE=0.3;this.AU=this.S[2];this.AU.A1=45;this.AU.AB=b[b.length-1][22];this.AU.BC=0.2;this.AU.BE=0.3;this.save=false;this.A9=false;this.At=0;this.O=b[b.length-1][23];this.Af=new J(b[b.length-1][24],b[b.length-1][25]);this.A8=b[b.length-1][26];C.Be=b[b.length-1][27];for(var j=0;j=this.z){delete AZ[BD][BJ];}}}}else{AZ=new Array(new Array,new Array,new Array,new Array,new Array);}}Bn.prototype.Aq=function(){Ct=Aq=false;this.O*=-1;this.AQ.Aq();var AM=this.S[0].AB;this.AM.AB=this.S[2].AB;this.AU.AB=AM;};Bn.prototype.DC=function(){this.save=false;if(C.BU&&C.Be==C.BU){if((AZ[0].length||AZ[1].length)&&C.ID!=undefined){alert("Track complete!");var request=new XMLHttpRequest();request.open("POST","js/completed.php",false);request.setRequestHeader("Content-type","application/x-www-form-urlencoded");request.send("trackID="+C.ID);}if(this.z>5000&&(!C.z||this.z=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}if(this.Q.BR&&this.AI.BR){this.A8=false;}if(!this.A8&&!this.A9){this.BS();for(var T=this.S.length-1;T>=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}}};function CW(AT){this.D=new Array;this.D.push(new Ah(new J(K[K.length-1][0],K[K.length-1][1]),this));this.D[0]._=new J(K[K.length-1][2],K[K.length-1][3]);this.D[0].g=new J(K[K.length-1][4],K[K.length-1][5]);this.D.push(new Ba(new J(K[K.length-1][6],K[K.length-1][7]),this));this.D[1]._=new J(K[K.length-1][8],K[K.length-1][9]);this.D[1].g=new J(K[K.length-1][10],K[K.length-1][11]);this.D[1].AX=K[K.length-1][12];this.D.push(new Ba(new J(K[K.length-1][13],K[K.length-1][14]),this));this.D[2]._=new J(K[K.length-1][15],K[K.length-1][16]);this.D[2].g=new J(K[K.length-1][17],K[K.length-1][18]);this.D[2].AX=K[K.length-1][19];this.h=this.D[0];this.h.Al=14;this.h.drive=function(){W=false;};this.Q=this.D[1];this.Q.Al=14;this.AI=this.D[2];this.AI.Al=14;this.S=new Array;this.S.push(new Ac(this.D[0],this.D[1],this));this.S.push(new Ac(this.D[1],this.D[2],this));this.S.push(new Ac(this.D[2],this.D[0],this));this.AM=this.S[0];this.AM.A1=47;this.AM.AB=K[K.length-1][20];this.AM.BC=0.2;this.AM.BE=0.3;this.AQ=this.S[1];this.AQ.A1=45;this.AQ.AB=K[K.length-1][21];this.AQ.BC=0.2;this.AQ.BE=0.3;this.AU=this.S[2];this.AU.A1=45;this.AU.AB=K[K.length-1][22];this.AU.BC=0.2;this.AU.BE=0.3;this.Cq=true;this.At=0;this.O=K[K.length-1][23];this.Af=new J(K[K.length-1][24],K[K.length-1][25]);this.A8=K[K.length-1][26];this.left=K[K.length-1][27];this.right=K[K.length-1][28];this.AW=K[K.length-1][29];this.AR=K[K.length-1][30];this.AT=AT;this.z=this.AT[5];}CW.prototype.Aq=function(){this.O*=-1;this.AQ.Aq();var AM=this.S[0].AB;this.AM.AB=this.S[2].AB;this.AU.AB=AM;};CW.prototype.BS=function(){this.Q.AX+=(this.AW-this.D[1].AX)/10;if(this.AW){this.At+=this.Q.Bq/5;}this.Q.AR=this.AI.AR=this.AR;var As=this.left-this.right;this.AM.A3(As*5*this.O,5);this.AU.A3(-As*5*this.O,5);this.AQ.rotate(As/8);if(!As&&this.AW){this.AM.A3(-7,5);this.AU.A3(7,5);}};CW.prototype.Am=function(){var M=this.Q.G.o();var AA=this.AI.G.o();var AS=this.h.G.o();var L=AA.sub(M);var N=new J((AA.y-M.y)*this.O,(M.x-AA.x)*this.O);var R=AS.sub(M.add(L.F(0.5)));B.beginPath();B.strokeStyle="rgba(0, 0, 0, 0.5)";B.lineWidth=3.5*C.H;B.arc(M.x,M.y,12.5*C.H,0,2*Math.PI,true);B.moveTo(AA.x+12.5*C.H,AA.y);B.arc(AA.x,AA.y,12.5*C.H,0,2*Math.PI,true);B.stroke();B.beginPath();B.fillStyle="rgba(0, 0, 0, 0.25)";B.moveTo(M.x+5*C.H,M.y);B.arc(M.x,M.y,5*C.H,0,2*Math.PI,true);B.moveTo(AA.x+4*C.H,AA.y);B.arc(AA.x,AA.y,4*C.H,0,2*Math.PI,true);B.fill();B.beginPath();B.lineWidth=5*C.H;B.moveTo(M.x,M.y);B.lineTo(M.x+L.x*0.4+N.x*0.05,M.y+L.y*0.4+N.y*0.05);B.moveTo(M.x+L.x*0.72+R.x*0.64,M.y+L.y*0.72+R.y*0.64);B.lineTo(M.x+L.x*0.46+R.x*0.4,M.y+L.y*0.46+R.y*0.4);B.lineTo(M.x+L.x*0.4+N.x*0.05,M.y+L.y*0.4+N.y*0.05);B.stroke();B.beginPath();B.lineWidth=2*C.H;B.moveTo(M.x+L.x*0.72+R.x*0.64,M.y+L.y*0.72+R.y*0.64);B.lineTo(M.x+L.x*0.43+N.x*0.05,M.y+L.y*0.43+N.y*0.05);B.moveTo(M.x+L.x*0.45+R.x*0.3,M.y+L.y*0.45+R.y*0.3);B.lineTo(M.x+L.x*0.3+R.x*0.4,M.y+L.y*0.3+R.y*0.4);B.lineTo(M.x+L.x*0.25+R.x*0.6,M.y+L.y*0.25+R.y*0.6);B.moveTo(M.x+L.x*0.17+R.x*0.6,M.y+L.y*0.17+R.y*0.6);B.lineTo(M.x+L.x*0.3+R.x*0.6,M.y+L.y*0.3+R.y*0.6);var Ap=new J(6*Math.cos(this.At)*C.H,6*Math.sin(this.At)*C.H);B.moveTo(M.x+L.x*0.43+N.x*0.05+Ap.x,M.y+L.y*0.43+N.y*0.05+Ap.y);B.lineTo(M.x+L.x*0.43+N.x*0.05-Ap.x,M.y+L.y*0.43+N.y*0.05-Ap.y);B.stroke();B.beginPath();B.lineWidth=C.H;B.moveTo(M.x+L.x*0.46+R.x*0.4,M.y+L.y*0.46+R.y*0.4);B.lineTo(M.x+L.x*0.28+R.x*0.5,M.y+L.y*0.28+R.y*0.5);B.stroke();B.beginPath();B.lineWidth=3*C.H;B.moveTo(AA.x,AA.y);B.lineTo(M.x+L.x*0.71+R.x*0.73,M.y+L.y*0.71+R.y*0.73);B.lineTo(M.x+L.x*0.73+R.x*0.77,M.y+L.y*0.73+R.y*0.77);B.lineTo(M.x+L.x*0.7+R.x*0.8,M.y+L.y*0.7+R.y*0.8);B.stroke();N=AS.sub(M.add(L.F(0.5)));var Aw=M.add(L.F(0.3)).add(N.F(0.25));var B2=M.add(L.F(0.4)).add(N.F(0.05));var Bp=B2.add(Ap);var A6=B2.sub(Ap);var A7=M.add(L.F(0.67)).add(N.F(0.8));var AY=Aw.add(L.F(-0.05)).add(N.F(0.42));var Aa=Bp.sub(AY);R=new J(Aa.y*this.O,-Aa.x*this.O);R=R.F(C.H*C.H);var CZ=AY.add(Aa.F(0.5)).add(R.F(200/Aa.Ae()));Aa=A6.sub(AY);R=new J(Aa.y*this.O,-Aa.x*this.O);R=R.F(C.H*C.H);var CX=AY.add(Aa.F(0.5)).add(R.F(200/Aa.Ae()));B.beginPath();B.lineWidth=6*C.H;B.strokeStyle="rgba(0, 0, 0, 0.25)";B.moveTo(A6.x,A6.y);B.lineTo(CX.x,CX.y);B.lineTo(AY.x,AY.y);B.stroke();B.beginPath();B.strokeStyle="rgba(0, 0, 0, 0.5)";B.moveTo(Bp.x,Bp.y);B.lineTo(CZ.x,CZ.y);B.lineTo(AY.x,AY.y);B.stroke();var BX=Aw.add(L.F(0.1)).add(N.F(0.95));B.beginPath();B.lineWidth=8*C.H;B.moveTo(AY.x,AY.y);B.lineTo(BX.x,BX.y);B.stroke();var Bl=Aw.add(L.F(0.2)).add(N.F(1.09));var CT=Aw.add(L.F(0.4)).add(N.F(1.15));var Ce=Aw.add(L.F(0.1)).add(N.F(1.05));B.beginPath();B.lineWidth=2*C.H;B.moveTo(Bl.x+5*C.H,Bl.y);B.arc(Bl.x,Bl.y,5*C.H,0,2*Math.PI,true);B.moveTo(CT.x,CT.y);B.lineTo(Ce.x,Ce.y);B.stroke();L=BX.sub(A7);N=new J(L.y*this.O,-L.x*this.O);N=N.F(C.H*C.H);var CU=A7.add(L.F(0.3)).add(N.F(80/L.Ae()));B.beginPath();B.lineWidth=5*C.H;B.moveTo(BX.x,BX.y);B.lineTo(CU.x,CU.y);B.lineTo(A7.x,A7.y);B.stroke();B.strokeStyle="black";};CW.prototype.AO=function(){if(AP.z>this.z){this.AO=function(){};}if(this.AT[0][AP.z]){this.left=this.left?0:1;}if(this.AT[1][AP.z]){this.right=this.right?0:1;}if(this.AT[2][AP.z]){this.AW=this.AW?0:1;}if(this.AT[3][AP.z]){this.AR=this.AR?0:1;}if(this.AT[4][AP.z]){this.Aq();}this.BS();for(var T=this.S.length-1;T>=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}if(this.Q.BR&&this.AI.BR){this.A8=false;}if(!this.A8){this.BS();for(var T=this.S.length-1;T>=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}}};function $(Cx){this.A9=true;this.D=new Array;this.S=new Array;this.O=1;var U=new J(0,0);this.D.push(new Ah(U,this));this.h=this.D[0];this.D.push(new Ah(U,this));this.Ab=this.D[1];this.S.push(new Ac(this.h,this.Ab,this));this.D.push(new Ah(U,this));this.Bx=this.D[2];this.D.push(new Ah(U,this));this.Bu=this.D[3];this.D.push(new Ah(U,this));this.BO=this.D[4];this.D.push(new Ah(U,this));this.B0=this.D[5];this.S.push(new Ac(this.h,this.Bx,this));this.S.push(new Ac(this.Bx,this.BO,this));this.S.push(new Ac(this.h,this.Bu,this));this.S.push(new Ac(this.Bu,this.B0,this));this.D.push(new Ah(U,this));this.Bw=this.D[6];this.D.push(new Ah(U,this));this.Bv=this.D[7];this.D.push(new Ah(U,this));this.BQ=this.D[8];this.D.push(new Ah(U,this));this.BN=this.D[9];this.S.push(new Ac(this.Ab,this.Bw,this));this.S.push(new Ac(this.Bw,this.BQ,this));this.S.push(new Ac(this.Ab,this.Bv,this));this.S.push(new Ac(this.Bv,this.BN,this));for(var u=0;u=0;T--){this.S[T].AO();}for(var u=this.D.length-1;u>=0;u--){this.D[u].AO();}};$.prototype.DY=function(C6,C3){C6=C6.F(0.7);C3=C3.F(0.7);for(var T=0;T20){this.S[T].A1=this.S[T].AB=20;}}for(var T=1;T<5;T++){this.S[T].A1=13;this.S[T].AB=13;}var L=new Array(this.h,this.Bx,this.Bu,this.BO,this.B0);var N=new Array(this.Ab,this.Bw,this.Bv,this.BQ,this.BN);for(var Az=0;Az=0;u--){this.D[u].g.AN(this.D[u].G.sub(this.D[u]._));this.D[u].g.x+=Math.random()-Math.random();this.D[u].g.y+=Math.random()-Math.random();}};function Cp(B7,Cx){this.A9=true;this.B$=new $(Cx);this.B$.DY(B7.h.g,B7.Q.g);this.B$.O=B7.O;this.B$.Af=B7.Af;this.Af=B7.Af;this.z=B7.z;this.h=this.B$.h;this.DL=B7;}Cp.prototype.Am=function(){this.DL.Am();this.B$.Am();};Cp.prototype.AO=function(){this.DL.AO();this.B$.AO();};function C5(G,Af,z){this.A9=true;this.Ay=30+20*Math.random();this.Df=0;this.D=new Array;this.D.push(new By(G,this));this.D.push(new By(G,this));this.D.push(new By(G,this));this.D.push(new By(G,this));this.D.push(new By(G,this));this.G=new J(G.x,G.y);this.Af=Af;this.z=z;this.h=new Ah(G,this);this.h.g.x=20;this.A9=true;}C5.prototype.Am=function(){if(this.Ay>0){this.Ay-=10;var M=this.G.o();var AS=Math.random()*6.2;var L=this.Ay/2;var N=M.x+L*Math.cos(AS);var R=M.y+L*Math.sin(AS);B.beginPath();B.fillStyle="yellow";B.moveTo(N,R);for(AA=1;AA<16;AA++){L=(this.Ay+30*Math.random())/2;N=M.x+L*Math.cos(AS+6.283*AA/16);R=M.y+L*Math.sin(AS+6.283*AA/16);B.lineTo(N,R);}B.fill();}for(var u=0;u=0;u--){this.D[u].AO();}};function target(x,y){this.G=new J(x,y);this.BM=false;}target.prototype.Am=function(){B.beginPath();B.fillStyle=this.BM?"#FFFFAA":"#FFFF00";B.lineWidth=2*C.H;B.moveTo(this.G.o().x+7*C.H,this.G.o().y);B.arc(this.G.o().x,this.G.o().y,7*C.H,0,2*Math.PI,true);B.fill();B.stroke();};target.prototype.Ad=function(AV){if(!this.BM&&AV.G.sub(this.G).Ae()<500&&!AV.parent.Cq){this.BM=true;C.Be++;if(C.BU&&C.Be==C.BU){AV.parent.save=true;}}};target.prototype.Aj=function(U){if(U.sub(this.G).length()=0&&Aw<=1){var B2=(Ap.x*this.BK.y-Ap.y*this.BK.x)*((Ap.x-AS.x)*this.BK.y-(Ap.y-AS.y)*this.BK.x)<0?-1:1;N=Ap.sub(this.BK.F(Aw));R=N.length();if(Rthis.length+L){return;}var Bp=Aw>0?this.AK:this.AH;N=AA.sub(Bp);R=N.length();if(R=this.length){Bi.AN(this.AK);}else{Bi.AN(this.AH.add(this.BK.Bc(this.length).F(B8)));}var DA=U.sub(Bi);if(DA.length()<=BH){this.remove=true;C.remove(this.AH,this.AK);}};line.prototype.CR=function(){this.B9=true;var end=" "+this.AK.x.toString(32)+" "+this.AK.y.toString(32);var next=C.I[Math.floor(this.AK.x/C.q)][Math.floor(this.AK.y/C.q)].search(this.AK,"line");if(next!=undefined){end+=next.CR();}return end;};function B5(C_,C9,C8,C$){this.AH=new J(Math.round(C_),Math.round(C9));this.AK=new J(Math.round(C8),Math.round(C$));this.BK=this.AK.sub(this.AH);this.length=this.BK.length();this.remove=false;}B5.prototype.C7=function(Au,CI,CP){Au.beginPath();Au.moveTo(this.AH.x*C.H-CI,this.AH.y*C.H-CP);Au.lineTo(this.AK.x*C.H-CI,this.AK.y*C.H-CP);Au.stroke();};B5.prototype.Aj=function(U){var C4=U.sub(this.AH);var B8=C4.Bd(this.BK.Bc(this.length));var Bi=new J(0,0);if(B8<=0){Bi.AN(this.AH);}else if(B8>=this.length){Bi.AN(this.AK);}else{Bi.AN(this.AH.add(this.BK.Bc(this.length).F(B8)));}var DA=U.sub(Bi);if(DA.length()<=BH){this.remove=true;C.remove(this.AH,this.AK);}};B5.prototype.CR=function(){this.B9=true;var end=" "+this.AK.x.toString(32)+" "+this.AK.y.toString(32);var next=C.I[Math.floor(this.AK.x/C.q)][Math.floor(this.AK.y/C.q)].search(this.AK,"sline");if(next!=undefined){end+=next.CR();}return end;};function BP(){this.AG=new Array;this.AL=new Array;this.AD=new Array;}BP.prototype.Ad=function(AV){for(var P=this.AG.length-1;P>=0;P--){this.AG[P].Ad(AV);}if(!AV.parent.A9){for(var j=this.AD.length-1;j>=0;j--){this.AD[j].Ad(AV);}}};BP.prototype.Cy=function(){for(var P=0;P7){var Cv=this.ID;this.ID=undefined;BB.style.display="block";V="line";}else{var request=new XMLHttpRequest;request.open("POST","js/load.php",false);request.setRequestHeader("Content-type","application/x-www-form-urlencoded");request.send("track="+this.ID);var Cv=request.responseText;}}var C=Cv.split("#");var AG=C[0].split(",");for(var Az=0;Az3){for(var U=0;U=2&&P.length<100000){var I=CG(new J(P.AH.x,P.AH.y),new J(P.AK.x,P.AK.y),this.q);for(var T=0;T3){for(var U=0;U=2&&v.length<100000){var I=CG(new J(v.AH.x,v.AH.y),new J(v.AK.x,v.AK.y),this.q);for(var T=0;T2){switch(AJ[0]){case"T":var Ag=new target(parseInt(AJ[1],32),parseInt(AJ[2],32));this.BU++;this.AD.push(Ag);break;case"C":var Ag=new CA(parseInt(AJ[1],32),parseInt(AJ[2],32));this.AD.push(Ag);break;case"B":var Ag=new CB(parseInt(AJ[1],32),parseInt(AJ[2],32),parseInt(AJ[3],32)+180);break;case"G":var Ag=new CD(parseInt(AJ[1],32),parseInt(AJ[2],32),parseInt(AJ[3],32)+180);break;case"O":var Ag=new B_(parseInt(AJ[1],32),parseInt(AJ[2],32));break;case"S":var Ag=new CL(parseInt(AJ[1],32),parseInt(AJ[2],32));break;default:;}var x=Math.floor(Ag.G.x/this.q);var y=Math.floor(Ag.G.y/this.q);if(this.I[x]==undefined){this.I[x]=new Array;}if(this.I[x][y]==undefined){this.I[x][y]=new BP(x,y);}this.I[x][y].AD.push(Ag);}}if(C[3]=="MTB"||C[3]=="BMX"){B3=C[3];this.z=C[4]!=""?C[4]:false;}else{this.z=C[3]!=""?C[3]:false;}}BI.prototype.DR=function(){if(Z.length>1){Z.pop();}if(b.length>1){b.pop();}if(W&&K.length>1){K.pop();}};BI.prototype.C2=function(){this.DV();Bb=false;AP=B3=="BMX"?new Bk:new Bn;focus=AP.h;if(W){W=this.AT[6]=="BMX"?new Cb(this.AT):new CW(this.AT);if(K.length==1&&!AW){focus=W.h;}}if(this.ID!="banner"){this.A5=new J(AP.h.G.x,AP.h.G.y);}};BI.prototype.Cs=function(){Z=new Array(new Array(0,-1,0,-1,0,0,-21,38,-21,38,0,0,0,21,38,21,38,0,0,0,45,42,45,1,0,0.3,false,0,new Array,0));b=new Array(new Array(2,-3,2,-3,0,0,-23,35,-23,35,0,0,0,23,35,23,35,0,0,0,47,45,45,1,0,0.3,false,0,new Array,0));if(W){K=this.AT[6]=="BMX"?new Array(new Array(0,-1,0,-1,0,0,-21,38,-21,38,0,0,0,21,38,21,38,0,0,0,45,42,45,1,0,0.3,false,0,0,0,0)):new Array(new Array(2,-3,2,-3,0,0,-23,35,-23,35,0,0,0,23,35,23,35,0,0,0,47,45,45,1,0,0.3,false,0,0,0,0));}this.C2();};BI.prototype.DV=function(){for(var x in this.I){for(var y in this.I[x]){for(var j=0;jp.width-50){C.A5.x+=10/this.H;w.x+=10/this.H;}if(w.o().y<50){C.A5.y-=10/this.H;w.y-=10/this.H;}else if(w.o().y>p.height-50){C.A5.y+=10/this.H;w.y+=10/this.H;}B.beginPath();B.strokeStyle="red";B.moveTo(AF.o().x,AF.o().y);B.lineTo(w.o().x,w.o().y);B.stroke();}var A_=(new J(0,0)).Cr();var CH=(new J(p.width,p.height)).Cr();A_.x=Math.floor(A_.x/this.q);A_.y=Math.floor(A_.y/this.q);CH.x=Math.floor(CH.x/this.q);CH.y=Math.floor(CH.y/this.q);var DI=new Array;for(var x=A_.x;x<=CH.x;x++){for(var y=A_.y;y<=CH.y;y++){if(this.I[x]!=undefined&&this.I[x][y]!=undefined){if(this.I[x][y].AG.length>0||this.I[x][y].AL.length>0){DI[x+"_"+y]=1;if(this.Ax[x+"_"+y]==undefined){this.Ax[x+"_"+y]=document.createElement("canvas");this.Ax[x+"_"+y].width=this.q*this.H;this.Ax[x+"_"+y].height=this.q*this.H;var Au=this.Ax[x+"_"+y].getContext("2d");Au.lineCap="round";Au.lineWidth=Math.max(2*this.H,0.5);Au.strokeStyle="#AAAAAA";for(var v=0;v1||b.length>1?"Press ENTER to restart or BACKSPACE to cancel checkpoint":"Press ENTER to restart";}else if(this.ID==undefined||this.ID=="banner"){var text="CANVAS RIDER RC7";if(this.ID==undefined){if(BT==10&&(V=="line"||V=="scenery line"||V=="brush"||V=="scenery brush")){text+=" - Grid ";}text+=" - "+V;if(V=="brush"||V=="scenery brush"){text+=" ( size "+CF+" )";}}if((label&&label[0]&&!label[1])){text="CANVAS RIDER RC7";}}else{var CN=Math.floor(AP.z/60000);var CK=Math.floor(AP.z%60000/1000);var Dd=Math.floor((AP.z-CN*60000-CK*1000)/100);if(CN<10){CN="0"+CN;}if(CK<10){CK="0"+CK;}var text=CN+":"+CK+"."+Dd;}if(label&&!label[0]&&!label[1]){text+=" - "+(Bb?"Unpause":"Pause")+" ( SPACE )";}B.strokeText(": "+this.Be+" / "+this.BU+" - "+text,50,16);B.fillText(": "+this.Be+" / "+this.BU+" - "+text,50,16);if(label){if(!label[0]){B.strokeText(label[2],36,15+label[1]*25);B.fillText(label[2],36,15+label[1]*25);}else{B.textAlign="right";if(document.documentElement.offsetHeight<=window.innerHeight){B.strokeText(label[2],p.width-36,15+label[1]*25);B.fillText(label[2],p.width-36,15+label[1]*25);}else{B.strokeText(label[2],p.width-51,15+label[1]*25);B.fillText(label[2],p.width-51,15+label[1]*25);}B.textAlign="left";}}};BI.prototype.Aj=function(U){var x=Math.floor(U.x/this.q-0.5);var y=Math.floor(U.y/this.q-0.5);if(this.I[x]!=undefined){if(this.I[x][y]!=undefined){for(var P=0;P0.2){C.H=Math.round(C.H*10-2)/10;C.Ax=new Array;}break;case 107:if(C.H<4){C.H=Math.round(C.H*10+2)/10;C.Ax=new Array;}break;case 90:if(!focus&&C.ID==undefined){C.DK();}else if(Ct){Aq=1;}break;case 32:if(p.width!=250){AE.preventDefault();}Bb=!Bb;break;default:;}if(C.ID==undefined){switch(AE.keyCode){case 65:if(V!="brush"){V="brush";document.body.style.cursor="none";shift=true;}else if(!A0){A0=true;AF.AN(Bf);shift=true;}break;case 83:if(V!="scenery brush"){V="scenery brush";document.body.style.cursor="none";shift=true;}else if(!A0){A0=true;AF.AN(Bg);shift=true;}break;case 81:if(V!="line"){V="line";document.body.style.cursor="none";}else if(!A0){A0=true;AF.AN(Bf);shift=true;}break;case 87:if(V!="scenery line"){V="scenery line";document.body.style.cursor="none";}else if(!A0){A0=true;AF.AN(Bg);shift=true;}break;case 69:V="eraser";document.body.style.cursor="none";shift=true;break;case 82:if(V!="camera"){DJ=V;V="camera";document.body.style.cursor="move";}else{C0=true;}break;default:;}}};document.function(AE){switch(AE.keyCode){case 13:case 37:case 39:case 38:case 40:AE.preventDefault();break;case 8:case 32:if(p.width!=250){AE.preventDefault();}break;default:;}};document.function(AE){switch(AE.keyCode){case 70:case 27:DQ();break;case 66:DS();break;case 37:left=0;break;case 39:right=0;break;case 38:AW=0;break;case 40:AR=0;break;case 90:Ct=true;break;case 71:if(BT==1){BT=10;Bh[1][6]="Disable grid snapping ( G )";}else{BT=1;Bh[1][6]="Enable grid snapping ( G )";}break;case 82:if(C0){V=DJ;document.body.style.cursor="none";C0=false;}break;case 49:case 50:case 51:case 52:case 53:if(C.ID!=undefined){watchGhost(AE.keyCode-48);}break;case 81:case 87:case 69:case 83:case 65:if(shift){shift=false;A0=false;}break;default:;}};BF.onmousemove=function(AE){var G=Math.floor((AE.clientY-BF.offsetTop+window.pageYOffset)/25);label=new Array(0,G,Bh[0][G]);};BB.onmousemove=function(AE){var G=Math.floor((AE.clientY-BB.offsetTop+window.pageYOffset)/25);label=new Array(1,G,Bh[1][G]);if(G==14){if(V=="sline"||V=="sbrush"){label[2]="Shorten last set of scenery lines ( Z )";}}};BF.function(AE){focus=false;switch(Math.floor((AE.clientY-BF.offsetTop+window.pageYOffset)/25)+1){case 1:Bb=!Bb;break;case 3:C.DR();case 2:C.C2();break;case 5:DS();break;case 7:if(!Cu){Cu=true;label[2]=Bh[0][6]="Disable line shading";}else{Cu=false;label[2]=Bh[0][6]="Enable line shading";}C.Ax=new Array;break;case 8:DQ();break;default:;}};BB.function(AE){if(C.ID!=undefined)return false;focus=false;switch(Math.floor((AE.clientY-BF.offsetTop+window.pageYOffset)/25)+1){case 1:V="brush";break;case 2:V="scenery brush";break;case 3:V="line";break;case 4:V="scenery line";break;case 5:V="eraser";break;case 6:V="camera";break;case 7:if(BT==1){BT=10;label[2]=Bh[1][6]="Disable grid snapping ( G )";}else{BT=1;label[2]=Bh[1][6]="Enable grid snapping ( G )";}break;case 9:V="goal";break;case 10:V="checkpoint";break;case 11:V="boost";break;case 12:V="gravity";break;case 13:V="bomb";break;case 15:C.DK();break;default:;}};p.function(){label=false;if(V=="camera"){document.body.style.cursor="move";}else{document.body.style.cursor="none";}};p.function(AE){A0=true;focus=false;if(!shift){AF.AN(w);}switch(V){case"boost":case"gravity":document.body.style.cursor="crosshair";break;case"eraser":C.Aj(w);break;case"goal":var Ag=new target(AF.x,AF.y);C.BU++;C.AD.push(Ag);break;case"checkpoint":var Ag=new CA(AF.x,AF.y);C.AD.push(Ag);break;case"bomb":var Ag=new B_(AF.x,AF.y);break;case"brush":case"scenery brush":if(shift){if(V=="brush"){var P=new line(AF.x,AF.y,w.x,w.y);}else{var P=new B5(AF.x,AF.y,w.x,w.y);}if(P.length>=2&&P.length<100000){var I=CG(new J(P.AH.x,P.AH.y),new J(P.AK.x,P.AK.y),C.q);for(var T=0;T=CF&&!shift){if(V=="brush"){var P=new line(AF.x,AF.y,w.x,w.y);}else{var P=new B5(AF.x,AF.y,w.x,w.y);}var I=CG(new J(P.AH.x,P.AH.y),new J(P.AK.x,P.AK.y),C.q);for(var T=0;T=2&&P.length<100000){var I=CG(new J(P.AH.x,P.AH.y),new J(P.AK.x,P.AK.y),C.q);for(var T=0;T10){C=new BI(document.getElementById("trackcode").value);document.getElementById("charcount").innerHTML="Trackcode";document.getElementById("trackcode").value=null;C.Cs();}else{alert("No trackcode to load!");}};document.getElementById("save").onclick=function(){if(C.ID==undefined){document.getElementById("trackcode").value=C.Bt();document.getElementById("trackcode").select();document.getElementById("charcount").innerHTML="Trackcode - "+Math.round(document.getElementById("trackcode").value.length/1000)+"k - CTRL + C to copy";}};document.getElementById("upload").onclick=function(){var Ao=document.cookie.indexOf("; ID=");if(Ao==-1&&!document.cookie.indexOf("ID=")){Ao=-2;}if(Ao!=-1){Ao+=5;var end=document.cookie.indexOf(";",Ao);if(end==-1){end=document.cookie.length;}var Dc=document.cookie.substring(Ao,end);var DH=C.Bt();if(DH.length>2000){Bb=true;V="camera";p.width=250;p.height=150;BF.style.display="none";BB.style.display="none";B.lineCap="round";B.lineJoin="round";document.getElementById("track_menu").style.display="none";var input=document.createElement("input");input.setAttribute("type","text");input.setAttribute("id","name");input.setAttribute("size",18);input.setAttribute("maxlength",20);var submit=document.createElement("input");submit.setAttribute("type","submit");submit.setAttribute("value","SAVE NAME & THUMBNAIL");submit.onclick=function(){var DE=p.toDataURL("image/png");if(DE=="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAACWCAYAAAD32pUcAAAAp0lEQVR4nO3BAQEAAACCIP+vbkhAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPBrSqQAAZytjkAAAAAASUVORK5CYII="){alert("The thumbnail is blank!\nDrag & fit an interesting part of your track inside.");return false;}var name=input.value;if(name.length<4){alert("The track name is too short!");return false;}if(!/^[\w\s]+$/.test(name)){alert("No special characters allowed in the track name!");return false;}submit.disabled="disabled";var request=new XMLHttpRequest;request.open("POST","js/save.php",false);request.setRequestHeader("Content-type","application/x-www-form-urlencoded");request.send("authorID="+Dc+"&name="+name+"&code="+DH);var Cz=request.responseText;if(Cz==""){alert("Your track was refused.");return false;}request.open("POST","js/save.php?thumbnailID="+Cz,false);request.send(DE);location.href="http://canvasrider.com/tracks/"+Cz;};var Bc=document.createElement("div");Bc.appendChild(input);Bc.appendChild(document.createTextNode(" "));Bc.appendChild(submit);document.getElementById("content").insertBefore(Bc,p.nextSibling);var adjust=document.createElement("div");adjust.style.color=p.style.borderColor="red";adjust.innerHTML="Use your mouse to drag & fit an interesting part of your track in the thumbnail
";document.getElementById("content").insertBefore(adjust,p);}else{alert("Sorry, but your track must be bigger or more detailed.");return false;}}};function H(AE){if(C.ID!="banner"){AE.preventDefault();if(shift){if(V=="eraser"){if((AE.detail>0||AE.wheelDelta<0)&&BH>5){BH-=5;}else if((AE.detail<0||AE.wheelDelta>0)&&BH<40){BH+=5;}}else if(V=="brush"||V=="scenery brush"){if((AE.detail>0||AE.wheelDelta<0)&&CF>4){CF-=8;}else if((AE.detail<0||AE.wheelDelta>0)&&CF<200){CF+=8;}}}else{if((AE.detail>0||AE.wheelDelta<0)&&C.H>0.2){C.H=Math.round(C.H*10-2)/10;}else if((AE.detail<0||AE.wheelDelta>0)&&C.H<4){C.H=Math.round(C.H*10+2)/10;}C.Ax=new Array;}var Cw=(new J(AE.clientX-p.offsetLeft,AE.clientY-p.offsetTop+window.pageYOffset)).Cr();if(!focus){C.A5.Ai(w.sub(Cw));}}}p.addEventListener("DOMMouseScroll",H,false);p.addEventListener("mousewheel",H,false);
p.onselectstart = function (evt) { evt.preventDefault(); }