function rg() {
ys="oa"
ka=0
be=0
window.document.forms[0].t8.value=ct(54,v8)
window.document.forms[0].t9.value=ct(54,v8)
window.document.forms[0].u1.value=ct(54,v8)
dg()
}

function dg() {
np=new Image()
np.src="images/blanktop.gif"
nb=new Image()
nb.src="images/blankbot.gif"
for(var i=0;i<ns;++i) {
cs[i]=new Image()
ae=regname;mt=site;mu=checks
cs[i].src="images/suit"+i+".gif"};l3()
for(var i=0;i<26;++i) {
ci[i]=new Image()
ci[i].src="images/card"+i+".gif"
ci[i+26]=new Image()
ci[i+26].src="images/card"+i+".gif"
}
if (wd==1){
ci[52]=new Image()
ci[52].src="images/card26.gif"
}
setTimeout("ck()",1000)
}

function zs() {
if(!hw)rl();else ka=nd
if(ka==0)ka=rt
ys="wt"
bs="eb"
window.document.forms[0].bt.value=ct(3,be)
window.document.forms[0].ts.value=lt(4,ka)
window.document.forms[0].t8.value=""
window.document.forms[0].t9.value=ct(54,e1)
window.document.forms[0].u1.value=ct(54,e2)
}

function go() {
if (ka==0 && bs=="ob") {
window.document.forms[0].t8.value=ct(54,e4)
window.document.forms[0].t9.value=ct(54,e4)
window.document.forms[0].u1.value=ct(54,e4)
window.document.forms[0].ts.value="XXXX"
window.document.forms[0].bt.value="XXX"
ys="wt"
bs="wt"
be=0
al(gc,ka)
return true
}
return false
}

function ke(b) {
if (bs=="ob" && ys!="wa" && !go()) {
be=0
bs="eb"
}
if (bs=="eb") {
o=0
if ((be+b)>=5 || (ka-b)<=0) {
b=Math.min((5-be),ka)
be+=b
ka-=b
window.document.forms[0].t8.value=""
window.document.forms[0].t9.value=ct(54,t7)
window.document.forms[0].u1.value=ct(54,v9)
bs="xb"
ys="le"
}else{
ka-=b
be+=b
}
window.document.forms[0].ts.value=lt(4,ka)
window.document.forms[0].bt.value=ct(3,be)
ys="le"
}
if (bs=="xb" && ys!="wa") {
o+=1
window.document.forms[0].t9.value=ct(54,t7)
window.document.forms[0].u1.value=ct(54,e5)
if (o==3) {
ka+=be
be=0
bs="eb"
window.document.forms[0].ts.value=lt(4,ka)
window.document.forms[0].bt.value=ct(3,be)
window.document.forms[0].t9.value=ct(54,e1)
window.document.forms[0].u1.value=ct(54,e2)
}
}
}

function x2() {
if (ys=="wa" && dd==1) {
if (ka>=be) {
ka-=be
be+=be
dd=2
window.document.forms[0].ts.value=lt(4,ka)
window.document.forms[0].bt.value=ct(3,be)
}else
window.document.forms[0].t9.value=ct(54,s8)
}
}

function ud() {
var ff=Math.floor(Math.random()*37)
for(var i=0;i<nd;++i) {
er[i]=((i + ff) % nd)
}
var cl=nd
for(var i=0;i<10;++i) {
var r=Math.floor(Math.random()*cl)
dk[i]=er[r]
for (var j=r;j<(nd-1);++j) er[j]=er[j+1]
--cl
}
}

function dc(n,d) {
id()
for(var i=0;i<n;++i) {
if ((cx[i]%13)==1 && d==2) {
++du
--an
}
if (cx[i]==52 && d==1) {
kj=i
an=4
}
window.document.images[2*i].src=ci[cx[i]].src
window.document.images[(2*i)+1].src=cs[(Math.floor(cx[i]/13))].src
}
}

function id() {
for(var i=0;i<5;++i) {
window.document.images[2*i].src=np.src
window.document.images[(2*i)+1].src=nb.src
}
}

