var w,h,g,my={};function freecellMain(){var version='0.64';w=670;h=450;my.suitRules=[{id:'any',name:'Any'},{id:'alt',name:'Alternating Red Black'},{id:'same',name:'Same'},];my.suitRule=my.suitRules[0]
my.cardWd=73
my.cardHt=98
my.gap={x:80,y:19}
my.freePt={x:8,y:48}
my.fndPt={x:345,y:48}
my.tabPt={x:15,y:160}
my.tabMax=8
my.imgHome=(document.domain=='localhost')?'/mathsisfun/games/images/':'/games/images/'
var s='';s+=''
my.sndHome=(document.domain=='localhost')?'/mathsisfun/images/sounds/':'/images/sounds/'
s+='';s+='';s+='';s+='
';s+='
'
s+='
'
s+=''
s+=''
my.snds=[];my.soundQ=true
s+=' '
s+=soundBtnHTML()
s+=' '
s+=''
s+='
'
s+='
';s+=optPopHTML();s+='
';s+='
© 2019 MathsIsFun.com v'+version+'
';s+='
';s+='
';s+='
';document.write(s);var el=document.getElementById('canvas1');var ratio=3;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);my.drag={onQ:false}
window.addEventListener('mousemove',function(ev){mouseMove(ev)})
window.addEventListener('touchmove',function(ev){console.log('touchmove')
var touch=ev.targetTouches[0];ev.clientX=touch.clientX;ev.clientY=touch.clientY;ev.touchQ=true;mouseMove(ev)})
my.zIndex=20;my.autoFdnQ=true
my.deck=new Deck();}
function mouseMove(ev){if(!my.drag.onQ)return
var div=my.drag.div
var lt=parseFloat(div.style.left)+ev.clientX-my.drag.x
div.style.left=lt+'px'
my.drag.x=ev.clientX
var tp=parseFloat(div.style.top)+ev.clientY-my.drag.y
div.style.top=tp+'px'
my.drag.y=ev.clientY
for(var i=0;i