function TarootCards(){this.cards=new Array(4);this.ncard=0;this.A=new Array(22);this.backcard="";this.cardleft=30;this.cardskip=10;this.cardtop="125px";this.cardwidth="100px";this.cardheight="140px";this.cardsplace="";this.getLayer=function(a){if(document.getElementById&&document.getElementById(a)){return document.getElementById(a)}else{if(document.all&&document.all(a)){return document.all(a)}else{if(document.layers&&document.layers[a]){return document.layers[a]}else{return false}}}};this.init=function(g,f,d,e,c,a,b){this.backcard=c;this.cardleft=f;this.cardtop=e;this.cardwidth=a;this.cardheight=b;this.cardskip=d;this.cardsplace=g;this.initCards()};this.initCards=function(){for(var c=0;c<22;c++){this.A[c]=c}for(var c=0;c<30;c++){var b=Math.round(Math.random()*100)%22;var a=Math.round(Math.random()*100)%22;t=this.A[b];this.A[b]=this.A[a];this.A[a]=t}};this.onCardBlur=function(b,a){if(card.goTop){card.style.zIndex=parseInt(card.style.zIndex)-100;card.goTop=false}};this.onCardClick=function(b,a){this.getLayer("securityErr").style.display="none";card=document.getElementById(a);if(card.select){if(!card.goTop){card.goTop=true;card.style.zIndex=parseInt(card.style.zIndex)+100}}if(this.ncard>3){return}if(!card.select){card.select=true;card.style.top=this.cardtop-25+"px";card.style.cursor="default";this.cards[this.ncard]=this.A[b];card.src="/img/card"+this.A[b]+".jpg";if(this.ncard==3){this.getLayer("tarootbtn").style.display="block";this.getLayer("securityForm").style.display="block"}this.ncard++}};this.takeTaroot=function(){if(this.ncard<4){return false}else{document.takeTarootForm.c0.value=this.cards[0];document.takeTarootForm.c1.value=this.cards[1];document.takeTarootForm.c2.value=this.cards[2];document.takeTarootForm.c3.value=this.cards[3];document.takeTarootForm.submit();return true}};this.putCards=function(b){var c="";for(b=0;b<22;b++){var a=parseInt(this.cardleft)+parseInt(this.cardskip)*b;var d="card"+b;c+='<img class="card" id='+d+' src="'+this.backcard+'" onmousemove="T.onCardBlur('+b+", '"+d+'\')" onmouseup="T.onCardBlur('+b+", '"+d+'\')" onblur="T.onCardBlur('+b+", '"+d+'\')" onmousedown="T.onCardClick('+b+", '"+d+'\');" style="top:'+this.cardtop+"; left:"+a+"px; z-index:"+(b+1)+';" alt="taroot tarot card">'}document.all[this.cardsplace].innerHTML+=c}};