let my={};function anifracpickMain(){let version='0.852';let w=380;let h=320;my.circle={x:92,y:92,rad:90};my.typs=['pizza','circle','square'];my.typ=my.typs[0];my.numClr='orange';my.denClr='blue';let s="";s+='';s+='
';s+=wrap('','','rel','z-index:22; margin-top:-10px;',getRadioHTML('','typ',my.typs,'chgTyp'))
my.imgHome=(document.domain=='localhost')?'/mathsisfun/numbers/images/':'/numbers/images/'
s+=wrap('','','rel','display:inline-block; height:182px; width:182px; z-index:22;','
Click the '+my.typ+' ↓
'+
'

'+
'
');s+=wrap('','','rel','display:inline-block; width:150px; height:130px; ',`
`)
let denLt=60
s+=wrap('','','rel','display:inline-block;height:55px; width:155px;','
Slices:
'+
'
'+
'
'+
'
')
s+=wrap('fracWords','output','rel','font: bold italic 1.2rem Arial; z-index:22;','')
s+=wrap('','','rel','margin-top:5px; z-index:22;','Simplest form:')
s+=wrap('simpWords','output','rel','font: italic 1.2rem Arial; z-index:22;','')
s+=wrap('','','rel','font: 0.7rem Arial; color: #6600cc; margin-top:0.3rem;',`© 2021 MathsIsFun.com v${version}`)
s+='
';let div=document.createElement('div')
div.innerHTML=s
let script=document.currentScript
script.parentElement.insertBefore(div,script);my.canShape=canvasInit('canShape',(my.circle.rad+2)*2,(my.circle.rad+2)*2,2)
my.sectors=[true];my.fracUser=new Frac('canUserFrac');my.fracUser.drawMe(3,5);let el=my.canShape.el
el.addEventListener('touchmove',function(e){let touch=e.targetTouches[0];e.clientX=touch.clientX;e.clientY=touch.clientY;e.touchQ=true;mouseMove(e);e.preventDefault();});el.addEventListener('mousemove',mouseMove);el.addEventListener('mousedown',mouseDown);my.denom=getDen();document.getElementById("typ0").checked=true;chgTyp(0);document.getElementById('clickLbl').style.visibility='visible';}
function chgTyp(n){my.typ=my.typs[n];document.getElementById('clickLbl').style.visibility='hidden';update();}
function mouseMove(e){let el=my.canShape.el
let rect=el.getBoundingClientRect();let x=(e.clientX-rect.left)-my.circle.x;let y=(e.clientY-rect.top)-my.circle.y;let inQ=false;switch(my.typ){case 'pizza':case 'circle':if(x*x+y*y