';document.write(s);var el=document.getElementById('canvasId');var ratio=2;el.width=w*ratio;el.height=h*ratio;el.style.width=w+"px";el.style.height=h+"px";g=el.getContext("2d");g.setTransform(ratio,0,0,ratio,0,0);this.midX=140;this.midY=140;this.scale=0.044;this.radius=110;my.degrees=0;onkmhChg(1,60)
my.sttTime=performance.now();my.bikeX=0
dialDraw()
my.playQ=false;togglePlay();}
function anim(){var nowTime=performance.now();my.bikeX+=(nowTime-my.prevTime)/300*my.kmh
if(my.bikeX>w-20)my.bikeX=-40
my.prevTime=nowTime;var div=document.getElementById('bike');div.style.left=my.bikeX+'px'
if(my.playQ)
requestAnimationFrame(anim);}
function togglePlay(){var btn='playBtn';if(my.playQ){my.playQ=false;document.getElementById(btn).classList.add("play");document.getElementById(btn).classList.remove("pause");}else{my.playQ=true;document.getElementById(btn).classList.add("pause");document.getElementById(btn).classList.remove("play");my.sttTime=performance.now();my.prevTime=my.sttTime;anim();}}
function getPlayHTML(w){var s='';s+='';s+='';return s;}
function onkmhChg(n,v){v=Number(v);document.getElementById('kmh').innerHTML=v;document.getElementById('speed').innerHTML=v;dialDraw()
my.kmh=v;}
function dialDraw(){g.clearRect(0,0,g.canvas.width,g.canvas.height)
g.strokeStyle='red'
g.lineWidth=4
g.beginPath()
g.moveTo(97,100)
var rad=70
var ang=(my.kmh*(220/185)-220)*Math.PI/180.0
var dialX=Math.cos(ang)*rad
var dialY=Math.sin(ang)*rad
g.lineTo(97+dialX,100+dialY)
g.stroke()}