u=0,q=2,d=a.getContext('2d'),e=4,f=7,h=Math,k=y=250,l=t=270,m='beginPath',n='fillStyle',p='fill',s='arc';setInterval("2==q&&t>=l&&1==u&&(q=-2,l=t,f=7);-2==q&&t<=l&&0==u&&(q=2,l=t,f=7);2==q&&0>=f?u=1:-2==q&&0>=f&&(u=0);0==u&&2==q?f-=1:1==u&&-2==q?f-=1:1==u&&2==q?f++:0==u&&-2==q&&(f++);0==u?l+=1.3*f:1==u&&(l-=1.3*f);e=l*h.PI/180;d.clearRect(0,0,500,500);for(g=-2;3>g;g++){q==g?(k+=y*h.cos(e),y=-y*h.sin(e)):k=y=250;d[m]();d.moveTo(250+40*g+g,-20);d.lineTo(k+40*g,y);d.strokeStyle='#000';d.stroke();d[m]();c=k+40*g;d[s](c,y,20,1.5,3.6,0);d[s](c,y,10,2.6,0.5,1);d[s](c,y,20,1.6,3.7,0);d[n]='#080';d[p]();d[m]();d[s](c,y,20,3.7,5.8,0);d[s](c,y,10,4.7,2.6,1);d[s](c,y,20,3.7,3.7,0);d[n]='red';d[p]();d[m]();d[s](c,y,20,5.8,1.6,0);d[s](c,y,10,0.5,4.7,1);d[s](c,y,20,5.8,5.8,0);d[n]='#FF0';d[p]();d[m]();d[s](c,y,10,0,6.3,0);d[s](c,y,20/2.4,0,6.3,1);d[n]='#FFF';d[p]();d[m]();d[s](c,y,20/2.4,0,6.3,0);d[n]='#00F';d[p]()}",50);
var aa = document.getElementsByTagName('canvas')[0];
var a = 0;
var q = 2;
var c = aa.getContext('2d');
var d = 4;
var e = 'fillStyle';
var f = 'beginPath';
var g = 7;
var h = Math;
var r = 20;
var x = y = 250;
var j = 270;
setInterval(function () {
if (q == 2 && 270 >= j && a == 1) {
q = -2;
j = 270;
g = 7;
}
if (q == -2 && j >= 270 && a == 0) {
q = 2;
j = 270;
g = 7;
}
if (q == 2 && 0 >= g) {
a = 1;
} else if (q == -2 && 0 >= g) {
a = 0;
}
if (a == 0 && q == 2) {
g -= 1;
} else if (a == 1 && q == -2) {
g -= 1;
} else if (a == 1 && q == 2) {
g += 1;
} else if (a == 0 && q == -2) {
g += 1;
}
if (a == 0) {
j += 1.3 * g;
} else if (a == 1) {
j -= 1.3 * g;
}
d = j * h.PI / 180;
c.clearRect(0, 0, 500, 500);
for (var i = -2; 3 > i; i++) {
if (q == i) {
x = x + y * h.cos(d);
y = -y * h.sin(d);
} else {
x = y = 250;
}
c.beginPath();
c.moveTo(500 / 2 + r * 2 * i + i, -20);
c.lineTo(x + r * 2 * i, y);
c.strokeStyle = "#000";
c.stroke();
c.beginPath();
ch((x + r * 2 * i));
}
function ch (x) {
c.arc(x, y, r, 1.5, 3.6, 0);
c.arc(x, y, r/2, 2.6, 0.5, 1);
c.arc(x, y, r, 1.6, 3.7, 0);
c[e] = '#080';
c.fill();
c[f]();
c.arc(x, y, r, 3.7, 5.8, 0);
c.arc(x, y, r/2, 4.7, 2.6,1);
c.arc(x, y, r, 3.7, 3.7, 0);
c[e] = 'red';
c.fill();
c[f]();
c.arc(x, y, r, 5.8, 1.6, 0);
c.arc(x, y, r/2, 0.5, 4.7,1);
c.arc(x, y, r, 5.8, 5.8, 0);
c[e] = '#FF0';
c.fill();
c[f]();
c.arc(x, y, r/2, 0, 6.3, 0);
c.arc(x, y, r/2.4, 0, 6.3, 1);
c[e] = '#FFF';
c.fill();
c[f]();
c.arc(x, y, r/2.4, 0, 6.3, 0);
c[e] = '#00F';
c.fill();
};
}, 50);