<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes" />
<title>0.0/0.0 is User Score/Goes ... up to 52 players can take it in turns with our Numbers Quiz - RJM Programming - April, 2021</title>
<script type='text/javascript'>
  var documenttitle=document.title;
  var pmesg='', pretv='';
  var lastcde='', lastconf='';
  var lastiourx=-1, lastioury=-1;
  var thirteen=4; //13;
  var four=13; //4;
  var card_game='memories';
  var in_bidding=false;
  var in_kitty=false;
  var tds_kitty='';
  var xsuffs=[];
  var hsuffs=[];
  var ssuffs=[];
  var msuffs=[];
  var rsuffs=[];
  var cbid='None';
  var cbidby=1;
  var cbidrank=-1;
  var bidplayer=1;
  var passcnt=0;
  var bids=["6s","6c","6d","6h","6n","7s","7c","7d","7h","7n","8s","misère","8c","8d","8h","8n","9s","9c","9d","9h","9n","10s","10c","10d","10h","open_misère","10n"];
  var sbid=["40","60","80","100","120","140","160","180","200","220","240","250","260","280","300","320","340","360","380","400","420","440","460","480","500","500","520"];
  if (!String.fromCodePoint) {   // thanks to http://xahlee.info/js/js_unicode_code_point.html
  // ES6 Unicode Shims 0.1 , © 2012 Steven Levithan , MIT License
    String.fromCodePoint = function fromCodePoint () {
        var chars = [], point, offset, units, i;
        for (i = 0; i < arguments.length; ++i) {
            point = arguments[i];
            offset = point - 0x10000;
            units = point > 0xFFFF ? [0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF)] : [point];
            chars.push(String.fromCharCode.apply(null, units));
        }
        return chars.join("");
    }
  }
  
  function documenttitleeq(indt) {
   documenttitle=indt;
   if (card_game.toLowerCase() == '500ish') {
   if (card_game == '500ISH') {
   document.title='500 card game where winning bid is ' + (cbid + ' (by Player ' + cbidby + ')').replace('None (by Player 1)','Pass').replace('None','Pass').replace('1','1,III').replace('2','2,IV').replace('3','3,1').replace('4','4,2').replace('III','3').replace('IV','4') + ' and trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + ' ... ' + scoresuffix;
   if (eval('' + nominal_numplayers + ' * (' + scoresuffix.replace(/\,/g, ' + ') + ')')  >= 40) {
     if (eval('' + totcpp) > 0) {
     totcpp=-totcpp;
     if (confirm('Thanks for playing the 500 card game ... ' + scoresuffix + ' ... OK to play again?')) {
       location.href=document.URL;
     }
     }
   }
   } else {
   if (cbid.replace('None', '') != '') {
   document.title='500 card game where winning bid is ' + (cbid + ' (by Player ' + cbidby + ')').replace('None (by Player 1)','Pass').replace('None','Pass').replace('1','1,III').replace('2','2,IV').replace('3','3,1').replace('4','4,2').replace('III','3').replace('IV','4') + ' and trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + ' ... ' + scoresuffix;
   } else if (in_bidding) {
   document.title='500 card game ... ' + scoresuffix;
   } else {   
   document.title='500 (hybrid) card game ... ' + scoresuffix;
   }
   if (eval('' + nominal_numplayers + ' * (' + scoresuffix.replace(/\,/g, ' + ') + ')')  >= Math.abs(eval('' + totcpp))) {
     if (eval('' + totcpp) > 0) {
     totcpp=-totcpp;
     if (confirm('Thanks for playing the 500 (hybrid) card game ... ' + scoresuffix + ' ... OK to play again?')) {
       location.href=document.URL;
     }
     }
   }
   }
   } else {
   document.title=documenttitle;
   }
  }
  function showStuff(evt) {
   if (xhr.readyState == 4) {
    if (xhr.status == 200) {
      sentanswer=xhr.responseText.split('</p>')[0].split('>')[eval(-1 + xhr.responseText.split('</p>')[0].split('>').length)]; 
      //alert('sentanswer=' + sentanswer + '!');
      sentclick();
    }
   }
  }
  
  
  function doesFileExist(urlToFile) {  // thanks to https://www.kirupa.com/html5/checking_if_a_file_exists.htm
    if (urlToFile != '') {
    var xxhr = new XMLHttpRequest();
    xxhr.open('HEAD', urlToFile, false);
    xxhr.send();
     
    if (xxhr.status == "404") {
         return false;
    } else {
         listenforwhat=''; //console.log(xxhr);
         form = new FormData();
         xhr = new XMLHttpRequest();
         form.append('gamedate', '' + dis);
         form.append('myanswer', '');
         xhr.open('post', document.URL.split('?')[0].split('#')[0].replace('.html','.php').replace('.htm','.php'), true);
         xhr.onreadystatechange = showStuff;
         xhr.send(form);
         //alert('found');
         //sentanswer='?.?';
         return true;
    }
    } else {
        return false;
    }
  }
  
  var csuffix='';
  var gallow=false;
  var fey='1100';   // 580
  var tfpx='24px;';
  var newtfpx='40px;';
  var eypc='80%';
  var neweypc='80%';
  var eyfb='fill:black;';
  var neweyfb='stroke:red;';
  var brad='border-radius:60px;';
  if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
   brad='';
  }
  
  var sentanswer='';
  var listenforwhat='';
  var form=null;
  var xhr=null;
  var gd = location.search.split('gamedate=')[1] ? decodeURIComponent(location.search.split('gamedate=')[1].split('&')[0]).replace(/\+/g,' ') : '';
  var ma = location.search.split('myanswer=')[1] ? decodeURIComponent(location.search.split('myanswer=')[1].split('&')[0]).replace(/\+/g,' ') : '';
  var psecs=0, secs=0;
  var dis=null;
  
  if (gd != '' && ma != '') {
  gd=gd;
  } else {  
  
  var deckn=52;
  var hackString='';
  var tricknumber=1;
  var emstuff='', cemstuff='';
  var nav=navigator.userAgent;
  // Thanks to https://stackoverflow.com/questions/7996252/window-popups-how-to-get-window-blur-or-window-focus-to-work-in-firefox-4
  hackString = nav.indexOf('Chrome') > -1 ? "scrollbar=yes," : "toolbar=0,statusbar=1,resizable=1,scrollbars=0,menubar=0,location=1,directories=0,";
  
  // Thanks to https://www.fileformat.info/info/unicode/block/playing_cards/list.htm
  var spcps=["127137/images/01s.gif",
                           "127138/images/02s.gif",
                           "127139/images/03s.gif",
                           "127140/images/04s.gif",
                           "127141/images/05s.gif",
                           "127142/images/06s.gif",
                           "127143/images/07s.gif",
                           "127144/images/08s.gif",
                           "127145/images/09s.gif",
                           "127146/images/10s.gif",
                           "127147/images/11s.gif",
                           "127149/images/12s.gif",
                           "127150/images/13s.gif",
                           "127153/images/01h.gif",
                           "127154/images/02h.gif",                           
                           "127155/images/03h.gif",
                           "127156/images/04h.gif",
                           "127157/images/05h.gif",
                           "127158/images/06h.gif",
                           "127159/images/07h.gif",
                           "127160/images/08h.gif",
                           "127161/images/09h.gif",
                           "127162/images/10h.gif",
                           "127163/images/11h.gif",
                           "127165/images/12h.gif",
                           "127166/images/13h.gif",
                           "127169/images/01d.gif",
                           "127170/images/02d.gif",
                           "127171/images/03d.gif",
                           "127172/images/04d.gif",
                           "127173/images/05d.gif",
                           "127174/images/06d.gif",
                           "127175/images/07d.gif",
                           "127176/images/08d.gif",
                           "127177/images/09d.gif",
                           "127178/images/10d.gif",
                           "127179/images/11d.gif",
                           "127181/images/12d.gif",
                           "127182/images/13d.gif",
                           "127185/images/01c.gif",
                           "127186/images/02c.gif",
                           "127187/images/03c.gif",
                           "127188/images/04c.gif",
                           "127189/images/05c.gif",
                           "127190/images/06c.gif",
                           "127191/images/07c.gif",
                           "127192/images/08c.gif",
                           "127193/images/09c.gif",
                           "127194/images/10c.gif",
                           "127195/images/11c.gif",
                           "127197/images/12c.gif",
                           "127198/images/13c.gif"];
                           
    var dragorder=[],  dragorderbig=[], curdrag=0, altcards=[];
                           
    var cards=["//www.rjmprogramming.com.au/images/01s.gif?n=7",
                           "//www.rjmprogramming.com.au/images/02s.gif?n=16",
                           "//www.rjmprogramming.com.au/images/03s.gif?n=33",
                           "//www.rjmprogramming.com.au/images/04s.gif?n=29",
                           "//www.rjmprogramming.com.au/images/05s.gif?n=8",
                           "//www.rjmprogramming.com.au/images/06s.gif?n=35",
                           "//www.rjmprogramming.com.au/images/07s.gif?n=52",
                           "//www.rjmprogramming.com.au/images/08s.gif?n=51",
                           "//www.rjmprogramming.com.au/images/09s.gif?n=12",
                           "//www.rjmprogramming.com.au/images/10s.gif?n=30",
                           "//www.rjmprogramming.com.au/images/11s.gif?n=1",
                           "//www.rjmprogramming.com.au/images/12s.gif?n=36",
                           "//www.rjmprogramming.com.au/images/13s.gif?n=22",
                           "//www.rjmprogramming.com.au/images/01h.gif?n=32",
                           "//www.rjmprogramming.com.au/images/02h.gif?n=23",                           
                           "//www.rjmprogramming.com.au/images/03h.gif?n=3",
                           "//www.rjmprogramming.com.au/images/04h.gif?n=18",
                           "//www.rjmprogramming.com.au/images/05h.gif?n=28",
                           "//www.rjmprogramming.com.au/images/06h.gif?n=39",
                           "//www.rjmprogramming.com.au/images/07h.gif?n=45",
                           "//www.rjmprogramming.com.au/images/08h.gif?n=48",
                           "//www.rjmprogramming.com.au/images/09h.gif?n=50",
                           "//www.rjmprogramming.com.au/images/10h.gif?n=44",
                           "//www.rjmprogramming.com.au/images/11h.gif?n=4",
                           "//www.rjmprogramming.com.au/images/12h.gif?n=9",
                           "//www.rjmprogramming.com.au/images/13h.gif?n=5",
                           "//www.rjmprogramming.com.au/images/01d.gif?n=27",
                           "//www.rjmprogramming.com.au/images/02d.gif?n=41",
                           "//www.rjmprogramming.com.au/images/03d.gif?n=20",
                           "//www.rjmprogramming.com.au/images/04d.gif?n=11",
                           "//www.rjmprogramming.com.au/images/05d.gif?n=37",
                           "//www.rjmprogramming.com.au/images/06d.gif?n=49",
                           "//www.rjmprogramming.com.au/images/07d.gif?n=42",
                           "//www.rjmprogramming.com.au/images/08d.gif?n=6",
                           "//www.rjmprogramming.com.au/images/09d.gif?n=21",
                           "//www.rjmprogramming.com.au/images/10d.gif?n=31",
                           "//www.rjmprogramming.com.au/images/11d.gif?n=40",
                           "//www.rjmprogramming.com.au/images/12d.gif?n=43",
                           "//www.rjmprogramming.com.au/images/13d.gif?n=17",
                           "//www.rjmprogramming.com.au/images/01c.gif?n=46",
                           "//www.rjmprogramming.com.au/images/02c.gif?n=19",
                           "//www.rjmprogramming.com.au/images/03c.gif?n=47",
                           "//www.rjmprogramming.com.au/images/04c.gif?n=25",
                           "//www.rjmprogramming.com.au/images/05c.gif?n=10",
                           "//www.rjmprogramming.com.au/images/06c.gif?n=15",
                           "//www.rjmprogramming.com.au/images/07c.gif?n=13",
                           "//www.rjmprogramming.com.au/images/08c.gif?n=26",
                           "//www.rjmprogramming.com.au/images/09c.gif?n=38",
                           "//www.rjmprogramming.com.au/images/10c.gif?n=34",
                           "//www.rjmprogramming.com.au/images/11c.gif?n=2",
                           "//www.rjmprogramming.com.au/images/12c.gif?n=14",
                           "//www.rjmprogramming.com.au/images/13c.gif?n=24"];
 // data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='48' viewport='0 0 100 100' style='background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:44px'><!-- 127195 11c --><text y='50%'>2.1</text></svg>
  var altcw=-1;
  var nominal_implication='';
  var nominal_numplayers = (document.URL.replace('?','&').indexOf('&card') != -1) ? prompt('How many players are playing your ' + document.URL.replace('?','&').split('&card')[1].split('&')[0].split('#')[0].split('=')[0].replace(/\_/g,' ').trim().substring(0,1).toUpperCase() + document.URL.replace('?','&').split('&card')[1].split('&')[0].split('#')[0].split('=')[0].replace(/\_/g,' ').trim().substring(1).toLowerCase() + ' card game (if Zebra (ie. Memories with cross colour match limitation) prefix answer by + and if Any Colour (ie. Memories with a same colour lack of limitation) prefix answer by -) and suffix by .0 for hybrid 500 card game (or use 04.0 to play 4 players in two teams with bidding version and optionally comma delimit by a list of email/SMS addresses/numbers, else we can show you cards via "turn away" popup windows, and if you want players not to have to follow suit involve a space character somewhere)?', (location.search.split('card_memories=')[1] ? (decodeURIComponent(location.search.split('card_memories=')[1] + '~').split('&')[0]).toLowerCase().split('a')[0].split('b')[0].split('c')[0].split('d')[0].split('e')[0].split('f')[0].split('g')[0].split('h')[0].split('i')[0].split('j')[0].split('k')[0].split('l')[0].split('m')[0].split('n')[0].split('o')[0].split('p')[0].split('q')[0].split('r')[0].split('s')[0].split('t')[0].split('u')[0].split('v')[0].split('w')[0].split('x')[0].split('y')[0].split('z')[0].replace(/^\~/g,'2').replace(/\~/g,'') : '2')) : null;
  var communication_list='';
  var emailsms=[];
  setTimeout(secsu,1000);
  if (nominal_numplayers) {
    if (('' + nominal_numplayers).trim().indexOf(',') != -1) { 
      communication_list=nominal_numplayers.replace(nominal_numplayers.split(',')[0] + ',','');
      emailsms=communication_list.split(',');
    }
    if (('' + nominal_numplayers).split(',')[0].trim().indexOf('04.0') != -1) {
      card_game='500ISH';
      nominal_numplayers=nominal_numplayers.replace('04.0','4.0');
      in_bidding=true;
    } 
    if (('' + nominal_numplayers).trim().indexOf('+') == 0) { 
      nominal_numplayers=nominal_numplayers.replace(/\+/g,'').split('.')[0]; 
      backi='/PHP/animegif/white.jpg'; 
      card_game='zebra';   
    } else if (('' + nominal_numplayers).trim().indexOf('-') == 0) { 
      nominal_numplayers=nominal_numplayers.replace(/\-/g,'').split('.')[0]; 
      backi='/PHP/animegif/white.jpg'; 
      card_game='any_colour';   
    } else if (('' + nominal_numplayers).trim().indexOf('.') != -1) { 
      if (('' + nominal_numplayers).trim().indexOf('.0') != -1) { 
        if (card_game == '500ISH') { 
//Ten cards are dealt each player in a three-four-three sequence, and three cards are dealt facedown to the table as a “widow.”
   spcps=["127137/images/01s.gif",
                           "127140/images/04s.gif",
                           "127141/images/05s.gif",
                           "127142/images/06s.gif",
                           "127143/images/07s.gif",
                           "127144/images/08s.gif",
                           "127145/images/09s.gif",
                           "127146/images/10s.gif",
                           "127147/images/11s.gif",
                           "127149/images/12s.gif",
                           "127150/images/13s.gif",
                           "127153/images/01h.gif",
                           "127157/images/05h.gif",
                           "127158/images/06h.gif",
                           "127159/images/07h.gif",
                           "127160/images/08h.gif",
                           "127161/images/09h.gif",
                           "127162/images/10h.gif",
                           "127163/images/11h.gif",
                           "127165/images/12h.gif",
                           "127166/images/13h.gif",
                           "127169/images/01d.gif",
                           "127173/images/05d.gif",
                           "127174/images/06d.gif",
                           "127175/images/07d.gif",
                           "127176/images/08d.gif",
                           "127177/images/09d.gif",
                           "127178/images/10d.gif",
                           "127179/images/11d.gif",
                           "127181/images/12d.gif",
                           "127182/images/13d.gif",
                           "127185/images/01c.gif",
                           "127188/images/04c.gif",
                           "127189/images/05c.gif",
                           "127190/images/06c.gif",
                           "127191/images/07c.gif",
                           "127192/images/08c.gif",
                           "127193/images/09c.gif",
                           "127194/images/10c.gif",
                           "127195/images/11c.gif",
                           "127197/images/12c.gif",
                           "127198/images/13c.gif"];
  // 16,33,23,3,18,41,20,11,19,47     
  cards=["//www.rjmprogramming.com.au/images/01s.gif?n=7",
                           "//www.rjmprogramming.com.au/images/04s.gif?n=29",
                           "//www.rjmprogramming.com.au/images/05s.gif?n=8",
                           "//www.rjmprogramming.com.au/images/06s.gif?n=35",
                           "//www.rjmprogramming.com.au/images/07s.gif?n=16",
                           "//www.rjmprogramming.com.au/images/08s.gif?n=33",
                           "//www.rjmprogramming.com.au/images/09s.gif?n=12",
                           "//www.rjmprogramming.com.au/images/10s.gif?n=30",
                           "//www.rjmprogramming.com.au/images/11s.gif?n=1",
                           "//www.rjmprogramming.com.au/images/12s.gif?n=36",
                           "//www.rjmprogramming.com.au/images/13s.gif?n=22",
                           "//www.rjmprogramming.com.au/images/01h.gif?n=32",
                           "//www.rjmprogramming.com.au/images/05h.gif?n=28",
                           "//www.rjmprogramming.com.au/images/06h.gif?n=39",
                           "//www.rjmprogramming.com.au/images/07h.gif?n=23",
                           "//www.rjmprogramming.com.au/images/08h.gif?n=3",
                           "//www.rjmprogramming.com.au/images/09h.gif?n=18",
                           "//www.rjmprogramming.com.au/images/10h.gif?n=41",
                           "//www.rjmprogramming.com.au/images/11h.gif?n=4",
                           "//www.rjmprogramming.com.au/images/12h.gif?n=9",
                           "//www.rjmprogramming.com.au/images/13h.gif?n=5",
                           "//www.rjmprogramming.com.au/images/01d.gif?n=27",
                           "//www.rjmprogramming.com.au/images/05d.gif?n=37",
                           "//www.rjmprogramming.com.au/images/06d.gif?n=20",
                           "//www.rjmprogramming.com.au/images/07d.gif?n=42",
                           "//www.rjmprogramming.com.au/images/08d.gif?n=6",
                           "//www.rjmprogramming.com.au/images/09d.gif?n=21",
                           "//www.rjmprogramming.com.au/images/10d.gif?n=31",
                           "//www.rjmprogramming.com.au/images/11d.gif?n=40",
                           "//www.rjmprogramming.com.au/images/12d.gif?n=19",
                           "//www.rjmprogramming.com.au/images/13d.gif?n=17",
                           "//www.rjmprogramming.com.au/images/01c.gif?n=11",
                           "//www.rjmprogramming.com.au/images/04c.gif?n=25",
                           "//www.rjmprogramming.com.au/images/05c.gif?n=10",
                           "//www.rjmprogramming.com.au/images/06c.gif?n=15",
                           "//www.rjmprogramming.com.au/images/07c.gif?n=13",
                           "//www.rjmprogramming.com.au/images/08c.gif?n=26",
                           "//www.rjmprogramming.com.au/images/09c.gif?n=38",
                           "//www.rjmprogramming.com.au/images/10c.gif?n=34",
                           "//www.rjmprogramming.com.au/images/11c.gif?n=2",
                           "//www.rjmprogramming.com.au/images/12c.gif?n=14",
                           "//www.rjmprogramming.com.au/images/13c.gif?n=24"];
          deckn=eval('' + cards.length);
          thirteen=4; //13;
          four=11; //4;
        } else {
          card_game='500ish'; 
        }  
        if (('' + nominal_numplayers).indexOf(' ') != -1) { gallow=true; }
        nominal_numplayers=nominal_numplayers.replace(/\ /g,'');
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
        tfpx='35px;';
        newtfpx='95px;';
    if (navigator.userAgent.match(/iPad/i)) {
        eypc='50%';
        neweypc="60%' x='10%";
    } else {
        eypc='50%';
        neweypc="-60' x='10%";
        newtfpx='95px;';
    }
    } else {
        tfpx='30px;';
        newtfpx='45px;';
        eypc='65%';
        neweypc="65%' x='30%";
    }
        deckn++;
        //alert(deckn);
        cards.push("//www.rjmprogramming.com.au/images/000.gif?n=" + deckn);
        spcps.push("127183/images/000.gif");
      }
      nominal_numplayers=nominal_numplayers.split('.')[0]; 
      backi='/PHP/animegif/white.jpg'; 
    }
    if (('' + nominal_numplayers).trim().indexOf('+') == 0) { nominal_numplayers=nominal_numplayers.replace(/\+/g,''); backi='/PHP/animegif/white.jpg'; card_game='zebra';   }
    if (('' + nominal_numplayers).trim().indexOf('-') == 0) { nominal_numplayers=nominal_numplayers.replace(/\-/g,''); backi='/PHP/animegif/white.jpg'; card_game='any_colour';   }
    if (('' + nominal_numplayers).replace('0','').trim() != '' && ('' + nominal_numplayers).replace('0','').trim().indexOf('-') == -1) {
      if (card_game.toLowerCase() != '500ish') { 
      var prompt = function(zwords, defwords){ return null; };  
      nominal_implication="  var prompt = function(zwords, defwords){ return null; };   ";
      }
      fiftytwo=-1;
      if (card_game == 'memories') { backi="/Games/Memories/Memories.jpg"; }
    } else {
      nominal_numplayers=null;
    }
  }
  
  var fi=null;
  var ij=0, ji=-1, kl='', kq=-1;
  var donelist=[], oplist=[], opltlistl=[], opltlistt=[], oopltlistl=[], oopltlistt=[], oplistname=[];
  var owidth=20, oheight=20;
  var oowidth=20, ooheight=20;
  var oleft=235, thisleft=235;
  var firstbit='  Will accept Q?A (sessional questions ended via ? & cleared with ?x) or Q?!A (local ended via ?! & cleared with ?!x). Versus Memories or ';
  var otop=100, thistop=100;
  var uis='';
  var force=false;
  var overallgoes=0, overallscore=0;
  var numplayers=1, curplayer=1, lastcurplayer=1;
  var lastgoes=[0], lastscore=[0];
  var clastgoes='0', clastscore='0';
  var theblurb='', wblurb='';
  var lastdts0='';
  var lastsq=-1;
  var sslistq=[], sslista=[];
  var lslistq=[], lslista=[];
  var redone=false;
  var flexible=false;
  var nomap=true;
  var found=false;
  var defstyle="<style> html { opacity:1.0; overflow:visible; background-color: yellow; font-size: 36px; background: URL('//www.rjmprogramming.com.au/rjmquiz_plus.jpg') repeat contain; } </style>";
  var eles=[];
  var nullv='' + eval(-1 + deckn);
  var cw=-1;
  var defstcp='127166';
  var stcprefix='';
  var lastdrag='';
  var wastitle='0.0/0.0 is User Score/Goes ... up to ' + deckn + ' players can take it in turns with our Numbers Quiz - RJM Programming - April, 2021';
  var given="Given answer is integer from 0 to 25 ... ";
  var iourx=-1, ioury=-1;
  var aminmiddle=false; 
  var da=''; 
  var dp=''; 
  var def='', os='', ps='', pg='';
  var lastzkq='', lastzkl='';
  
  var scoresuffix='';
  var donelistis=',';
  var nogolist=',';
  var susslist=',';
  var curpcols=['0,0,255,','0,255,0,','255,0,0,','0,0,127,','0,127,0,','127,0,0,',  '255,0,255,','255,255,0,','0,255,255,', '127,0,127,','127,127,0,','0,127,127,'];
  
  var hands=[], trumpsare='', thishand=[], lastwinner=1, thehand=',';
  var tcp=0, tcpnum=1;
  var iflip=0, cpp=deckn, totcpp=deckn, backis="//www.rjmprogramming.com.au/images/back01.gif"; 
  
  var zsuff='', zsuffs=[], ysuffs=[];
  var ocp=null;
  var dhicp='<style> html { cursor: url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>1.1</text></svg>") 16 0, pointer; }   </style>';
  var lasttogglenumber='';
  var lastec='', notyet=false;
  var backi="/rjmquiz_plus.jpg";
  var fiftytwo=deckn;
  var message='';
  var lastcard='';
  var lasttto='';
  var dhi='';
  var prevsb='';
  var covercover=',cover,cover';
  var gamescoreprefix='';
  var gamescores=[0];
  var lasttmid='';
  var lasttfrom='';
  var lasttoggleto='';
  var lasttogglefrom='';
  var curplayer=1, card_of_play=0;
  var csuff=String.fromCodePoint(8320 + eval('' + curplayer));
  if (nominal_numplayers) {
    prevsb=String.fromCodePoint(10067,10068) + csuff;
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    covercover=',80px 60px,80px 60px';
    dhi='<style> html { cursor: url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10067,10068) + csuff + '</text></svg>") 16 0, pointer; }   </style>';
    if (card_game.toLowerCase() != '500ish') { document.head.innerHTML+=dhi; }
    } else if (card_game.toLowerCase() != '500ish') { 
    document.head.innerHTML+='<style> html { cursor: url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10067,10068) + csuff + '</text></svg>") 16 0, pointer; }   </style>';
    }
  }
     
    var ic=0;  
    var flip=0; //, iflip=0, cpp=52, totcpp=52, backis="//www.rjmprogramming.com.au/images/back01.gif"; 
    if (card_game.toLowerCase() == '500ish') { 
      flip=1; 
      cpp=Math.floor(eval(eval(-1 + deckn) / eval('' + nominal_numplayers))); 
      totcpp=eval(cpp * eval('' + nominal_numplayers));
      if (card_game == '500ISH') { 
        cpp=11;
        totcpp=deckn;
      }
      //alert('cpp=' + cpp + ' and totcpp=' + totcpp);
      covercover=',580px 60px,580px 60px';
        scoresuffix+='0';
        for (var iixc=0; iixc<nominal_numplayers; iixc++) {
          zsuffs.push('');
          ysuffs.push('');
          xsuffs.push('');
          hsuffs.push('');
          ssuffs.push('');
          msuffs.push('');
          rsuffs.push('');
          if (iixc != 0) { scoresuffix+=',0'; }
        }
        dhi='<style> html { cursor: url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + fey + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>    Click away Player ' + csuff + ' ' + scoresuffix.split(' (via ')[0] + '</text></svg>") 16 0, pointer; }   </style>';
    }                   
    for (ic=1; ic<=eval(0 + eval('' + cards.length)); ic++) {
     if (nominal_numplayers) {
       if (card_game.toLowerCase() == '500ish') {
       oplistname.push('');
       if (eval('' + ic) > eval('' + totcpp)) { if (iflip == 0) { iflip=eval(-1 + ic);   }  backis="//www.rjmprogramming.com.au/PHP/animegif/white.jpg";  }
      found=false;
     for (var jjc=1; jjc<=cards.length; jjc++) {
       if ((cards[eval(-1 + jjc)] + '~').indexOf('?n=' + ic + '~') != -1) {
       if (('' + cards[eval(-1 + ic)]).indexOf('?n=') != -1) {
       //alert(backis + "?n=" + cards[eval(-1 + jjc)].split('?n=')[1] + '#' + cards[eval(-1 + jjc)].split('?')[0]);
       //altcards.push(backis + "?n=" + cards[eval(-1 + jjc)].split('?n=')[1] + '#' + cards[eval(-1 + jjc)].split('?')[0]);
       altcards.push(backis + "?n=" + cards[eval(-1 + ic)].split('?n=')[1] + '#' + cards[eval(-1 + ic)].split('?')[0] + '##' + spcps[eval(-1 + ic)].split('/')[0]);
       } else {
       altcards.push(backis);
       }
         found=true;
       }
     }
      
       } else {
       if (cards[eval(-1 + ic)].indexOf('?n=') != -1) {
       altcards.push("//www.rjmprogramming.com.au/images/back01.gif?n=" + cards[eval(-1 + ic)].split('?n=')[1] + '#' + cards[eval(-1 + ic)].split('?')[0] + '##' + spcps[eval(-1 + ic)].split('/')[0]);
       } else {
       altcards.push("//www.rjmprogramming.com.au/images/back01.gif");
       }
       //cards[eval(-1 + ic)]="//www.rjmprogramming.com.au/images/blank01.gif#" + cards[eval(-1 + ic)];
       }
     } else {
       altcards.push(cards[eval(-1 + ic)]);
     }
    }
    
//    if (flip != 0) {  // trumps card
//       curplayer=1;
//       if (cards[iflip].indexOf('?n=') != -1) {
//       altcards[iflip]=cards[iflip].split('?')[0] + "?n=" + cards[iflip].split('?n=')[1] + '#' + "//www.rjmprogramming.com.au/images/back01.gif";
//       } else {
//       altcards[iflip]=cards[iflip].split('?')[0];
//       }
//    }
    
    if (card_game.toLowerCase() != '500ish' || 1 == 1) {
    for (ic=1; ic<=cards.length; ic++) {
     found=false;
     for (var jc=1; jc<=cards.length; jc++) {
       if ((cards[eval(-1 + jc)] + '~').indexOf('?n=' + ic + '~') != -1) {
         dragorder.push(eval(-1 + jc));
         dragorderbig.push(eval(spcps[eval(-1 + jc)].split('/')[0]));
         if (card_game.toLowerCase() != '500ish') {
         cards[eval(-1 + jc)]=cards[eval(-1 + jc)].replace('?n=' + ic, '');
         } 
         firstbit+=String.fromCodePoint(eval('' + spcps[eval(-1 + jc)].split('/')[0])) + ' ';
         found=true;
       }
     }
     //if (!found) {
     //  alert('ic=' + ic);
     //}
    } 
    }
    
    console.log('dragorder=' + dragorder);
                           
 var sq=["Is the additive identity.",
  "Is the multiplicative identity.",
  "Is the only even prime.",
  "Is the number of spatial dimensions we live in.",
  "Is the smallest number of colours sufficient to colour all planar maps.",
  "Is the number of Platonic solids.",
  "Is the smallest perfect number.",
  "Is the smallest number of sides of a regular polygon that is not constructible by straightedge and compass.",
  "Is the largest cube in the Fibonacci sequence.",
  "Is the maximum number of cubes that are needed to sum to any positive integer.",
  "Is the base of our number system.",
  "Is the largest known multiplicative persistence.",
  "Is the smallest abundant number.",
  "Is the number of Archimedian solids.",
  "Is the smallest even number n with no solutions to phi(m) = n.",
  "Is the smallest composite number n with the property that there is only one group of order n.",
  "Is the only number of the form xy = yx with x and y being different integers.",
  "Is the number of wallpaper groups.",
  "Is the only positive number that is twice the sum of its digits.",
  "Is the maximum number of 4th powers needed to sum to any number.",
  "Is the number of rooted trees with 6 vertices.",
  "Is the smallest number of distinct squares needed to tile a square.",
  "Is the number of partitions of 8.",
  "Is the smallest number of integer-sided boxes that tile a box so that no two boxes share a common length.",
  "Is the largest number divisible by all numbers less than its square root.",
  "Is the smallest square that can be written as a sum of 2 squares."];
  
  var ijk=0;
  var asq=[];
  
  for (var acv=0; acv<sq.length; acv++) {
    asq.push('' + acv);
  }
  
  if (document.URL.indexOf('spcp=') == -1) {
    if (1 == 2) {
    document.head.innerHTML+="<style> html { opacity:1.0; overflow: visible; background-color: yellow; font-size: 36px; background: URL('//www.rjmprogramming.com.au" + backi + "'); background-size: contain; } </style>";
    }
      var factorx=1.0;
      var factory=1.0;
      if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
        factorx=1.0;
        factory=1.8; //8;
        oleft=Math.floor(eval(235 / factorx));
        thisleft=Math.floor(eval(235 / factorx));
        otop=Math.floor(eval(198.0 / eval('' + factory)));
        thistop=Math.floor(eval(198.0 / eval('' + factory)));
     }
    if (!redone) { redone=true; reassess(); }
    kq='' + Math.floor(Math.random() * sq.length);
    documenttitleeq('0.0/0.0 is User Score/Goes ... up to ' + deckn + ' players can take it in turns with our Numbers Quiz');
    kl='' + Math.floor(Math.random() * spcps.length);
    
//    kl=16; // kludge
    //if (card_game == '500ISH') { alert('totcpp=' + totcpp + ' and kl=' + kl); }
    
    donelist.push('' + kl);
    //if (card_game.toLowerCase() == '500ish') {
    //  cards[ijk]=cards[ijk].split('?')[0] + '?n=' + kl;
    //}
    uis=document.URL.split('#')[0].split('?')[0] + '?spcp=' + spcps[eval('' + donelist[0])].split('/')[0];
    //console.log("oplist.push(window.open('" + uis + "', '_blank', 'left=" + thisleft + ",top=" + thistop + ",width=20,height=20'))");
    console.log('prefirst');
    if (altcards[kl].indexOf('##') != -1) {
     opltlistl.push('.' + altcards[kl].split('##')[1]);
    }
    eval("oplist.push(windowopen('" + uis + "', '_blank', '" + hackString + "left=" + thisleft + ",top=" + thistop + ",width=20,height=20'))");
    if (oplist[eval(-1 + oplist.length)]) {
    //oplist[eval(-1 + oplist.length)].document.write("<html><head><link rel=icon href=" + cards[kl] + "><scr" + "ipt type='text/javascript'> var da='" + asq[eval(0 + kq)] + "'; var dp='" + given + sq[kq] + "'; var def=String.fromCodePoint(" + spcps[eval('' + kl)].split('/')[0] + "); function checka(tpa) { var os=''; var ps=eval(window.opener.documenttitle.split('/')[0].trim()); var pg=eval(window.opener.documenttitle.split('/')[1].split(' ')[0]); if (tpa.trim().toLowerCase() == da.toLowerCase()) { ps++; os=tpa.split(da)[1];  } else { pg++;  os=tpa.split(tpa.trim())[1];  } window.opener.documenttitleeq(ps + os + '/' + pg + ' is User Score/Goes'); window.close();  } function pa() { if (document.hasFocus()) {  if (window.opener.wond(" + eval(-1 + oplist.length) + ")) { window.opener.wosf(" + eval(-1 + oplist.length) + ");  var hj=prompt(dp + window.opener.blurb(), def);  if (hj == null) { hj=''; } else { hj=window.opener.assess(hj); } if (hj.replace(def,'') == '') { setTimeout(pa,1000);  } else { checka(hj); } } else { setTimeout(pa,1000); } } } document.head.innerHTML+=\"<style> html { overflow:visible; background:URL('" + cards[kl] + "'); background-size:contain;  background-repeat:no-repeat; } </style>\";  if (document.hasFocus()) {  if (window.opener.wond(" + eval(-1 + oplist.length) + ")) {  setTimeout(pa,2000); } else { pa(); }  } else { pa(); }   </scr" + "ipt></head></html>");
    oplist[eval(-1 + oplist.length)].document.write("<html><head><link rel=icon href=" + altcards[kl].split('##')[0] + "><scr" + "ipt type='text/javascript'>" + nominal_implication + " var aminmiddle=false; var da='" + asq[eval(0 + kq)] + "'; var dp='" + given + sq[kq] + "'; var def=String.fromCodePoint(" + spcps[eval('' + kl)].split('/')[0] + "); function checka(tpa) { var os=''; var ps=eval(window.opener.documenttitle.split('/')[0].trim()); var pg=eval(window.opener.documenttitle.split('/')[1].split(' ')[0]); if (tpa.trim().toLowerCase() == da.toLowerCase()) { ps++; os=tpa.split(da)[1];  } else { pg++;  os=tpa.split(tpa.trim())[1];  } window.opener.documenttitleeq(ps + os + '/' + pg + ' is User Score/Goes'); window.opener.closeit('" + kl + "');  window.close();  } function pa() { if (aminmiddle) { setTimeout(pa, 10000); return false; }  if (document.hasFocus()) {  var hj=window.opener.ourprompt(" + eval(-1 + oplist.length) + ",dp + window.opener.blurb(), def); if (hj) { aminmiddle=true; setTimeout(function() { hj=prompt(dp + window.opener.blurb(), def);  if (hj == null) { hj=''; } else { hj=window.opener.assess(hj); } if (hj.replace(def,'') != '') { checka(hj); } else { setTimeout(pa,10000); }  aminmiddle=false;  }, 8000);  }  if (hj == null) { hj=''; } else { hj=window.opener.assess(hj); } if (hj.replace(def,'') == '') { setTimeout(pa,1000);  } else { checka(hj); } } else { setTimeout(pa,1000); } } document.head.innerHTML+=\"<style> html { background:URL('" + trumpgames(altcards[kl],kl) + "'); background-size:contain;  background-repeat:no-repeat; } </style>\";   pa(); </scr" + "ipt></head></html>");
    oplist[eval(-1 + oplist.length)].documenttitleeq(String.fromCodePoint(eval(spcps[eval('' + donelist[0])].split('/')[0])));
    oplist[eval(-1 + oplist.length)].document.name='' + kl;
    oplist[eval(-1 + oplist.length)].onfocus = function() { if (documenttitle.indexOf('/') != -1) { wastitle=document.title;  setTimeout(reputwas,2000); } }
    }
    
    if (huh(oplist[0])) {
    if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && card_game.toLowerCase() == "500ish" && dhi != '') {
    //alert(5);
    document.head.innerHTML+="<style> html {  opacity:1.0; overflow:visible; background-color: yellow; font-size: 36px; background: URL(" + dhi.split('url(')[1].split(') ')[0] + "); background-repeat: repeat; } </style>";
    } else if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && ocp) {
    //alert(4);
    document.head.innerHTML+="<style> html {  opacity:1.0; overflow:visible; background-color: yellow; font-size: 36px; background: URL(" + opc.style.cursor.split('url(')[1].split(') ')[0] + "); background-repeat: repeat; } </style>";
    } else if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && dhi != '') {
    //alert(3);
    document.head.innerHTML+="<style> html {  opacity:1.0; overflow:visible; background-color: yellow; font-size: 36px; background: URL(" + dhi.split('url(')[1].split(') ')[0] + "); background-repeat: repeat; } </style>";
    } else if (nominal_numplayers && card_game.toLowerCase() == "500ish" && dhi != '') {
    //alert(2);
    document.head.innerHTML+="<style> html {  opacity:1.0; overflow:visible; background-color: yellow; font-size: 36px; background: URL(" + dhi.split('url(')[1].split(') ')[0] + "); background-repeat: repeat; } </style>";
    } else {
    //alert(1);
    document.head.innerHTML+="<style> html {  opacity:1.0; overflow:visible; background-color: yellow; font-size: 36px; background: URL('//www.rjmprogramming.com.au" + backi + "'); background-size: contain; } </style>";
    }
    } else if (nominal_numplayers && card_game.toLowerCase() == "500ish" && dhi != '') {
    //alert('-4 ' + dhi.split('url(')[1].split(') ')[0]);
    //alert(dhi.split('url(')[1].split(') ')[0] + ' ... via ' + dhi);
    document.head.innerHTML+="<style> html {  opacity:1.0; overflow:visible; background-color: yellow; font-size: 36px; background: URL(" + dhi.split('url(')[1].split(') ')[0] + "); background-repeat: repeat; } </style>";
    } //else {
    //alert(-5);
    //}
    var tendone=false;
    if (card_game.toLowerCase() == '500ish') { tendone=true; } 
    for (var jijk=1; jijk<spcps.length; jijk++) {
      kq='' + Math.floor(Math.random() * sq.length);
      kl='' + Math.floor(Math.random() * spcps.length);
      
//      if (jijk == 1) { kl=38; }  // kludge 2
      
      if (eval(3 + eval('' + jijk)) == eval('' + spcps.length) && !tendone && ('' + kl) != '10') {
        kl='10';
      }
      while (donelist.indexOf(kl) != -1) {
        //alert(kl);
        kl='' + Math.floor(Math.random() * spcps.length);
      }
      donelist.push(kl);
    //if (card_game.toLowerCase() == '500ish') {
    //  cards[jijk]=cards[jijk].split('?')[0] + '?n=' + kl;
    //}
      if (('' + kl) == '10') {
        tendone=true;
      }
    }
    
     
    //if (card_game == '500ISH') { alert('donelist.length=' + donelist.length); }
    //if (card_game == '500ISH') { alert('altcards.length=' + altcards.length); }
    console.log('kl=' + kl);
    defstcp=spcps[eval('' + kl)].split('/')[0];
    if (huh(oplist[0])) {
    dothis('' + donelist[0]);
    }
    for (ijk=1; ijk<spcps.length; ijk++) {
      kq='' + Math.floor(Math.random() * sq.length);
      kl='' + donelist[ijk]; //Math.floor(Math.random() * spcps.length);
      //while (donelist.indexOf(kl) != -1) {
      //  kl='' + Math.floor(Math.random() * spcps.length);
      //}
      //if (!oplist[0]) {
      //donelist.push(kl);
      //}
      
      if (1 == 2 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { 
      if (eval(ijk % eval(2 * thirteen + 1)) == 0) {
        thisleft=oleft;
        thistop+=eval(eval(screen.height - 100)  / eval(four / 1.5));  // four
      } else {
        thisleft+=eval(eval(screen.width - 235)  / eval(2 + eval(2 * thirteen + 1))); // thirteen
      }
      } else {
      if (eval(ijk % eval(2 * thirteen + 1)) == 0) {
        thisleft=oleft;
        //thistop+=eval(eval(eval(eval(screen.height / factory) - 100)  / eval(four / 1.5)));  // four
        console.log('top change is ' + eval(eval(eval(eval(screen.height - 100) / factory))  / eval(four / 1.5)));
        thistop+=eval(eval(eval(eval(screen.height - 100) / factory))  / eval(four / 1.5));  // four
      } else {
        thisleft+=Math.floor(eval(eval(eval(screen.width * factorx) - eval(235 / factorx)) / eval(2 + eval(2 * thirteen + 1)))); // thirteen
      }
      }
      uis=document.URL.split('#')[0].split('?')[0] + '?spcp=' + spcps[eval('' + kl)].split('/')[0];
      //console.log("oplist.push(window.open('" + uis + "', '_blank', 'left=" + thisleft + ",top=" + thistop + ",width=20,height=20'))");
    if (altcards[kl].indexOf('##') != -1) {
     opltlistl.push('.' + altcards[kl].split('##')[1]);
    }
      eval("oplist.push(windowopen('" + uis + "', '_blank', '" + hackString + "left=" + thisleft + ",top=" + thistop + ",width=20,height=20'))");
      if (oplist[eval(-1 + oplist.length)]) {
      //oplist[eval(-1 + oplist.length)].document.write("<html><head><link rel=icon href=" + cards[kl] + "><scr" + "ipt type='text/javascript'> var da='" + asq[eval(0 + kq)] + "'; var dp='" + given + sq[kq] + "'; var def=String.fromCodePoint(" + spcps[eval('' + kl)].split('/')[0] + ");  function checka(tpa) { var os=''; var ps=eval(window.opener.documenttitle.split('/')[0].trim()); var pg=eval(window.opener.documenttitle.split('/')[1].split(' ')[0]); if (tpa.trim().toLowerCase() == da.toLowerCase()) { ps++; os=tpa.split(da)[1];  } else { pg++; os=tpa.split(tpa.trim())[1];   } window.opener.documenttitleeq(ps + os + '/' + pg + ' is User Score/Goes'); window.close();   }  function pa() { if (document.hasFocus()) { if (window.opener.wond(" + eval(-1 + oplist.length) + ")) {  window.opener.wosf(" + eval(-1 + oplist.length) + ");  var hj=prompt(dp + window.opener.blurb(), def); if (hj == null) { hj=''; } else { hj=window.opener.assess(hj); } if (hj.replace(def,'') == '') { setTimeout(pa,1000);  } else { checka(hj); } } else { setTimeout(pa,1000); } } } document.head.innerHTML+=\"<style> html { background:URL('" + cards[kl] + "'); background-size:contain;  background-repeat:no-repeat; } </style>\"; if (document.hasFocus()) {  if (window.opener.wond(" + eval(-1 + oplist.length) + ")) {  setTimeout(pa,2000); } else { pa(); }  } else { pa(); } </scr" + "ipt></head></html>");
      //oplist[eval(-1 + oplist.length)].document.write("<html><head><link rel=icon href=" + altcards[kl] + "><scr" + "ipt type='text/javascript'>" + nominal_implication + "  var aminmiddle=false; var da='" + asq[eval(0 + kq)] + "'; var dp='" + given + sq[kq] + "'; var def=String.fromCodePoint(" + spcps[eval('' + kl)].split('/')[0] + "); function checka(tpa) { var os=''; var ps=eval(window.opener.documenttitle.split('/')[0].trim()); var pg=eval(window.opener.documenttitle.split('/')[1].split(' ')[0]); if (tpa.trim().toLowerCase() == da.toLowerCase()) { ps++; os=tpa.split(da)[1];  } else { pg++;  os=tpa.split(tpa.trim())[1];  } window.opener.documenttitleeq(ps + os + '/' + pg + ' is User Score/Goes'); window.opener.closeit('" + kl + "'); window.close();   } function pa() { if (aminmiddle) { setTimeout(pa, 10000);  return false; } if (document.hasFocus()) {  var hj=window.opener.ourprompt(" + eval(-1 + oplist.length) + ",dp + window.opener.blurb(), def); if (hj) { aminmiddle=true; setTimeout(function() { hj=prompt(dp + window.opener.blurb(), def);  if (hj == null) { hj=''; } else { hj=window.opener.assess(hj); } if (hj.replace(def,'') != '') { checka(hj); } else { setTimeout(pa,10000); }   aminmiddle=false;  }, 8000);  }  if (hj == null) { hj=''; } else { hj=window.opener.assess(hj); } if (hj.replace(def,'') == '') { setTimeout(pa,1000);  } else { checka(hj); } } else { setTimeout(pa,1000); } } document.head.innerHTML+=\"<style> html { background:URL('" + trumpgames(altcards[kl],kl) + "'); background-size:contain;  background-repeat:no-repeat; } </style>\";   pa(); </scr" + "ipt></head></html>");
      oplist[eval(-1 + oplist.length)].document.write("<html><head><link rel=icon href=" + altcards[kl].split('##')[0] + "><scr" + "ipt type='text/javascript'>" + nominal_implication + "  var aminmiddle=false; var da='" + asq[eval(0 + kq)] + "'; var dp='" + given + sq[kq] + "'; var def=String.fromCodePoint(" + spcps[eval('' + kl)].split('/')[0] + "); function checka(tpa) { var os=''; var ps=eval(window.opener.documenttitle.split('/')[0].trim()); var pg=eval(window.opener.documenttitle.split('/')[1].split(' ')[0]); if (tpa.trim().toLowerCase() == da.toLowerCase()) { ps++; os=tpa.split(da)[1];  } else { pg++;  os=tpa.split(tpa.trim())[1];  } window.opener.documenttitleeq(ps + os + '/' + pg + ' is User Score/Goes'); window.opener.closeit('" + kl + "'); window.close();   } function pa() { if (aminmiddle) { setTimeout(pa, 10000);  return false; } if (document.hasFocus()) {  var hj=window.opener.ourprompt(" + eval(-1 + oplist.length) + ",dp + window.opener.blurb(), def); if (hj) { aminmiddle=true; setTimeout(function() { hj=prompt(dp + window.opener.blurb(), def);  if (hj == null) { hj=''; } else { hj=window.opener.assess(hj); } if (hj.replace(def,'') != '') { checka(hj); } else { setTimeout(pa,10000); }   aminmiddle=false;  }, 8000);  }  if (hj == null) { hj=''; } else { hj=window.opener.assess(hj); } if (hj.replace(def,'') == '') { setTimeout(pa,1000);  } else { checka(hj); } } else { setTimeout(pa,1000); } } document.head.innerHTML+=\"<style> html { background:URL('" + trumpgames(altcards[kl],kl) + "'); background-size:contain;  background-repeat:no-repeat; } </style>\";   pa(); </scr" + "ipt></head></html>");
      oplist[eval(-1 + oplist.length)].documenttitleeq(String.fromCodePoint(eval(spcps[eval('' + kl)].split('/')[0])));
      oplist[eval(-1 + oplist.length)].document.name='' + kl;
      oplist[eval(-1 + oplist.length)].onfocus = function() { if (documenttitle.indexOf('/') != -1) { wastitle=document.title;  setTimeout(reputwas,2000); } }
      }
    }    
    documenttitleeq('0.0/0.0 is User Score/Goes ... up to ' + deckn + ' players can take it in turns with our Numbers Quiz - RJM Programming - April, 2021');
    if (!oplist[0] || 7 == 7) {
    owidth=eval('' + eval('' + opltlistl[1]) - eval('' + opltlistl[0]));
    //if (card_game.toLowerCase() == '500ish') { tfpx='' + owidth + 'px'; }
    oheight=eval('' + eval('' + opltlistt[9]) - eval('' + opltlistt[0]));
    oowidth=owidth;
    ooheight=oheight;
    defstyle=defstyle.replace(/20px\ /g, ('' + owidth).split('.')[0] + 'px ');
    defstyle=defstyle.replace(/20px\,/g, ('' + oheight).split('.')[0] + 'px,');
    defstyle=defstyle.replace(/20px\;/g, ('' + oheight).split('.')[0] + 'px;');
    if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && card_game.toLowerCase() == "500ish" && dhi != '') {
    defstyle=defstyle.replace(';background-size:',  ',no-repeat,no-repeat' + ';background-size:');
    } else if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && ocp) {
    defstyle=defstyle.replace(';background-size:',  ',repeat,repeat' + ';background-size:');
    } else if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && dhi != '') {
    defstyle=defstyle.replace(';background-size:',  ',repeat,repeat' + ';background-size:');
    } else {
    defstyle=defstyle.replace(';background-size:',  ',no-repeat,no-repeat' + ';background-size:');
    }
    if (nominal_numplayers) {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { 
    defstyle=defstyle.replace(';background-position:',  covercover + ';background-position:');
    //defstyle=defstyle.replace(';background-position:',  ',' + eval(0.7 * screen.width) + 'px ' + eval(0.8 * screen.height) + 'px,' + eval(0.7 * screen.width) + 'px ' + eval(0.8 * screen.height) + 'px' + ';background-position:');
    } else {
    defstyle=defstyle.replace(';background-position:',  covercover + ';background-position:');
    }
    } else {
    if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && ocp) {
    defstyle=defstyle.replace(';background-position:',  ',80px 60px,80px 60px' + ';background-position:');
    } else if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && dhi != '') {
    defstyle=defstyle.replace(';background-position:',  ',80px 60px,80px 60px' + ';background-position:');
    } else {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { 
    defstyle=defstyle.replace(';background-position:',  ',' + eval(0.7 * window.innerWidth) + 'px ' + eval(0.8 * window.innerHeight) + 'px,' + eval(0.7 * window.innerWidth) + 'px ' + eval(0.8 * window.innerHeight) + 'px' + ';background-position:');
    //defstyle=defstyle.replace(';background-position:',  ',' + eval(0.7 * screen.width) + 'px ' + eval(0.8 * screen.height) + 'px,' + eval(0.7 * screen.width) + 'px ' + eval(0.8 * screen.height) + 'px' + ';background-position:');
    } else {
    defstyle=defstyle.replace(';background-position:',  ',' + eval(0.7 * screen.width) + 'px ' + eval(0.8 * screen.height) + 'px,' + eval(0.7 * screen.width) + 'px ' + eval(0.8 * screen.height) + 'px' + ';background-position:');
    }
    }
    }
    defstyle=defstyle.replace(';background-image:',  ',0px 0px,0px 0px' + ';background-image:');
    if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && card_game.toLowerCase() == "500ish" && dhi != '') {
    defstyle=defstyle.replace('; } </style>', (',linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),url(' + dhi.split('url(')[1].split(') ')[0] + ');  } </style>')); //  + ' ' + owidth + ' ' + oheight
    } else if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && ocp) {
    defstyle=defstyle.replace('; } </style>', (',linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),url(' + opc.style.cursor.split('url(')[1].split(') ')[0] + ');  } </style>')); //  + ' ' + owidth + ' ' + oheight
    } else if ((nominal_numplayers && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) && dhi != '') {
    defstyle=defstyle.replace('; } </style>', (',linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),url(' + dhi.split('url(')[1].split(') ')[0] + ');  } </style>')); //  + ' ' + owidth + ' ' + oheight
    } else if ((nominal_numplayers && card_game.toLowerCase() == "500ish") && dhi != '') {
    defstyle=defstyle.replace('; } </style>', (',linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),url(' + dhi.split('url(')[1].split(') ')[0] + ');  } </style>')); //  + ' ' + owidth + ' ' + oheight
    } else {
    defstyle=defstyle.replace('; } </style>', (',linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),url(//www.rjmprogramming.com.au' + backi + '); } </style>')); //  + ' ' + owidth + ' ' + oheight
    }
    
    
    if (nominal_numplayers) {
    //  defstyle=defstyle.replace(/\,url\(\/\/www\.rjmprogramming\.com\.au\/images\/back01.gif\)/g,'');
    //  if (defstyle.indexOf('url(//www.rjmprogramming.com.au/images/back01.gif)') != -1) {
    //    defstyle=defstyle.replace('url(//www.rjmprogramming.com.au/images/back01.gif)', '').replace(',url(','url(');
    //  }
      if (card_game.toLowerCase() == '500ish') {
      defstyle=defstyle.replace('} </style>', ' animation: animatedBackground 10s linear infinite; } @keyframes animatedBackground { from { filter: brightness(160%); } to { filter: brightness(190%); } } </style>');
      } else {
      defstyle=defstyle.replace('} </style>', ' animation: animatedBackground 10s linear infinite; } @keyframes animatedBackground { from { filter: contrast(175%) brightness(120%) saturate(70%); } to { filter: contrast(95%) brightness(90%) saturate(150%); } } </style>');
      }
    }
    
    document.head.innerHTML+=bpmore(defstyle); 
    //console.log(defstyle);
    } else if (huh(oplist[0])) {
    for (var kijk=0; kijk<spcps.length; kijk++) {
      opltlistl.push(oplist[kijk].screenLeft);
      opltlistt.push(oplist[kijk].screenTop);
    }
    }
    
    if (!nominal_numplayers) {
    if (huh(oplist[0])) {
    setInterval(examinescore, 200);
    } else {
    examinescore();
    }
    }
    
  } else {
  
    dothis((location.search.split('spcp=')[1] ? location.search.split('spcp=')[1].split('&')[0] : defstcp));
  
  }
  
  }
  
  function snapshot(defb) {
     if (prevsb != '') {
     //if (dhi.indexOf('url(') != -1) {
     //alert('here');
     return 'url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + 'margin-left:5px;border-radius:160px;background-color:rgba(' + curpcols[eval(eval(-1 + curplayer) % eval('' + curpcols.length))] + '0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '> ' + String.fromCodePoint(10004) + ' ' + csuff + '</text></svg>")';
     //}
     }
     return defb;
  }
  
  function antilastec() {
    if (card_game.toLowerCase() != '500ish' || 1 == 1) { lastec=''; }
  }
  
  function antinotyet() {
    if (card_game.toLowerCase() != '500ish' || 1 == 1) { notyet=true; }
  }
  
  function domessagetwo() {
    gamescoreprefix='Tricks taken are ' + gamescores[0];
    for (var ijkhl=1; ijkhl<eval('' + nominal_numplayers); ijkhl++) {
      if (eval('' + gamescores.length) > eval('' + ijkhl)) {
        gamescoreprefix+=':' + gamescores[eval('' + ijkhl)];
      } else {
        gamescoreprefix+=':0';
      }
    }
    if (message != '') {
      csuff='';
      var hjg='' + curplayer;
      for (var ipl=0; ipl<hjg.length; ipl++) {
        //alert(hjg.substring(ipl,eval(1 + eval('' + ipl))) + ' has ord ' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0) + ' to ' + eval(8304 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
        csuff+=String.fromCodePoint(eval(8320 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
      }
      if (card_game.toLowerCase() != '500ish') { 
      if (ocp) { 
        if (card_game.toLowerCase() != '500ish') { ocp.style.cursor='url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10067,10068) + csuff + '</text></svg>") 16 0, pointer';  }
        if (defstyle.indexOf('data:image/svg') != -1) {
          defstyle=defstyle.replace(prevsb, String.fromCodePoint(10067,10068) + csuff);
          prevsb=String.fromCodePoint(10067,10068) + csuff;
          //document.head.innerHTML+=defstyle;
        }
      } else if (defstyle.indexOf('data:image/svg') != -1) {
        defstyle=defstyle.replace(prevsb, String.fromCodePoint(10067,10068) + csuff);
        prevsb=String.fromCodePoint(10067,10068) + csuff;
        //document.head.innerHTML+=defstyle;
      }
      }
      alert(gamescoreprefix + ' ... ' + message + '');
      message='';
                  defstyle=defstyle.replace(toggleto, togglefrom);
                  defstyle=defstyle.replace(lasttoggleto, lasttogglefrom);
                  document.head.innerHTML+=defstyle;
                    lasttto='';
                    lasttmid='';
                    lasttfrom='';
                    lasttoggleto='';
                    lasttogglefrom='';
                    lastcard='';
                    lasttogglenumber='';
    }
    susslist=',';
  }
  
  function domessage() {
    gamescoreprefix='Tricks taken are ' + gamescores[0];
    for (var ijkhl=1; ijkhl<eval('' + nominal_numplayers); ijkhl++) {
      if (eval('' + gamescores.length) > eval('' + ijkhl)) {
        gamescoreprefix+=':' + gamescores[eval('' + ijkhl)];
      } else {
        gamescoreprefix+=':0';
      }
    }
    if (message != '') {
      csuff='';
      var hjg='' + curplayer;
      for (var ipl=0; ipl<hjg.length; ipl++) {
        //alert(hjg.substring(ipl,eval(1 + eval('' + ipl))) + ' has ord ' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0) + ' to ' + eval(8304 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
        csuff+=String.fromCodePoint(eval(8320 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
      }
      if (card_game.toLowerCase() != '500ish') { 
      if (ocp) { 
        if (card_game.toLowerCase() != '500ish') { ocp.style.cursor='url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10067,10068) + csuff + '</text></svg>") 16 0, pointer'; }
        if (defstyle.indexOf('data:image/svg') != -1) {
          defstyle=defstyle.replace(prevsb, String.fromCodePoint(10067,10068) + csuff);
          prevsb=String.fromCodePoint(10067,10068) + csuff;
          //document.head.innerHTML+=defstyle;
        }
      } else if (defstyle.indexOf('data:image/svg') != -1) {
        defstyle=defstyle.replace(prevsb, String.fromCodePoint(10067,10068) + csuff);
        prevsb=String.fromCodePoint(10067,10068) + csuff;
        //document.head.innerHTML+=defstyle;
      }
      }
      alert(gamescoreprefix + ' ... ' + message + '');
      message='';
                  // Thanks to https://css-tricks.com/more-control-over-css-borders-with-background-image/
                  //alert(' repeating-linear-gradient(0deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(90deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(180deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(270deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px),'.substring(0,1) + togglefrom.replace(/\.gif/g,'.JUNKgif'));
                  defstyle=defstyle.replace(toggleto, snapshot(' repeating-linear-gradient(0deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(90deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(180deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(270deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px),'.substring(0,1) + togglefrom.replace(/\.gif/g,'.JUNKgif'))); // + ' 30 round');
                  defstyle=defstyle.replace(lasttoggleto, snapshot(' repeating-linear-gradient(0deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(90deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(180deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px), repeating-linear-gradient(270deg, #333333, #333333 10px, transparent 10px, transparent 20px, #333333 20px),'.substring(0,1) + lasttogglefrom.replace(/\.gif/g,'.JUNKgif'))); //  + ' 30 round');
                  document.head.innerHTML+=defstyle;
                  nogolist+=susslist;
                  susslist=',';
                    lasttto='';
                    lasttmid='';
                    lasttfrom='';
                    lasttoggleto='';
                    lasttogglefrom='';
                    lastcard='';
                    lasttogglenumber='';
    }
    susslist=',';
  }
  
  function pa() { 
    if (aminmiddle) { 
      if (1 == 2) { setTimeout(pa, 10000);  }
      return false; 
    }  
    if ('document.hasFocus()' == 'document.hasFocus()' &&  card_game.toLowerCase() != '500ish') { 
    //if (card_game.toLowerCase() == '500ish') { overallgoes=curdrag; }
      console.log(('' + opltlistl[eval('' + cw)]) + ' dragorderbig[' + curdrag + ']=' + dragorderbig[eval('' + curdrag)] + ' vs cw=' + cw + ' and overallgoes=' + overallgoes); 
    if ((('' + opltlistl[eval('' + cw)]).split('.')[1] == ('' + dragorderbig[eval('' + curdrag)]) && eval('' + curdrag) == eval('' + overallgoes))) {
      console.log('Dragorderbig[' + curdrag + ']=' + dragorderbig[eval('' + curdrag)] + ' vs cw=' + cw + ' and overallgoes=' + overallgoes); 
    ps=documenttitle.split('/')[0].trim(); 
    pg=documenttitle.split('/')[1].split(' ')[0]; 
    if (ps.indexOf('.') == -1 || pg.indexOf('.') == -1) {
    ps=eval('' + overallscore + '.' + psecs); //eval(documenttitle.split('/')[0].trim()); 
    pg=eval('' + overallgoes + '.' + secs); 
    documenttitleeq(documenttitle.replace(documenttitle.split(' ')[0], '' + overallscore + '.' + psecs + '/' + '' + overallgoes + '.' + secs));
    console.log('documenttitle becomes ' + documenttitle);
    } else {
    ps=eval(ps);
    pg=eval(pg);
    }
      var decs=documenttitle.split('.');
      curdrag++;
      psecs++;
      overallgoes++;
      if (eval('' + decs.length) >= 3) {
        documenttitleeq(documenttitle.replace('.' + decs[1] + '.', '.' + curdrag + '/' + overallgoes + '.'));
      }
      if (!nominal_numplayers) {
      defstyle=defstyle.replace(cards[donelist[eval('' + cw)]].split('#')[0].split('gif')[0], cards[donelist[eval('' + cw)]].split('#')[0].split('gif')[0] + 'JUNK');
      document.head.innerHTML+=defstyle;
      }
      //oplist[eval('' + tw)].close();
      return null;
    }
      aminmiddle=true; 
      var hj=prompt(dp + blurb(), def); 
      if (hj) { 
        //setTimeout(function() { hj=prompt(dp + blurb(), def);  if (hj == null) { hj=''; } else { hj=assess(hj); } if (hj.replace(def,'') != '') { checka(hj); } else if (1 == 2) { setTimeout(pa,10000); }  aminmiddle=false;  }, 8000); 
        if (hj == null) { 
          hj=''; 
        } else { 
          hj=assess(hj); 
        } 
        if (hj.replace(def,'') == '') { 
          if (1 == 2) { setTimeout(pa,1000); } 
        } else {
          checka(hj); 
        } 
      } else if (1 == 2) { 
        setTimeout(pa,1000); 
      }
      aminmiddle=false; 
      //examinescore(); 
    } 
  }
  
  function checka(tpa) { 
    console.log('documenttitle=' + documenttitle + ' and tpa=' + tpa);
    os=''; 
    console.log('documenttitle=' + documenttitle + ' and tpa=' + tpa);
    if (1 == 5) {
    if (huh(oplist[0])) {
    ps=eval(documenttitle.split('/')[0].trim()); 
    pg=eval(documenttitle.split('/')[1].split(' ')[0]); 
    } else {
    ps=documenttitle.split('/')[0].trim(); 
    pg=documenttitle.split('/')[1].split(' ')[0]; 
    if (ps.indexOf('.') == -1 || pg.indexOf('.') == -1) {
    ps=eval('' + overallscore + '.' + psecs); //eval(documenttitle.split('/')[0].trim()); 
    pg=eval('' + overallgoes + '.' + secs); 
    documenttitleeq(documenttitle.replace(documenttitle.split(' ')[0], '' + overallscore + '.' + psecs + '/' + '' + overallgoes + '.' + secs));
    console.log('documenttitle becomes ' + documenttitle + ' and tpa=' + tpa);
    } else {
    ps=eval(ps);
    pg=eval(pg);
    }
    }
    }
    force=true;
    if (('' + ps) == '') { ps='0'; }
    if (('' + pg) == '') { pg='0'; }
    if (tpa.trim().toLowerCase() == da.toLowerCase()) { 
      ps++; 
      os=tpa.split(da)[1]; 
     if (os == '' || 1 == 1) {
    //overallscore++; 
    //overallgoes++; 
    console.log('Os=' + os + 'dt=' + '' + ('' + ps).split('.')[0] + os + '/' + '' + ('' + pg).split('.')[0] + ' is User Score/Goes');
    documenttitleeq('' + '' + ('' + ps).split('.')[0] + os + '/' + '' + ('' + pg).split('.')[0] + ' is User Score/Goes'); 
    }
    } else { 
      pg++;  
      os=tpa.split(tpa.trim())[1]; 
     if (os == '' || 1 == 1) {
    //overallgoes++; 
    console.log('os=' + os + 'dt=' + '' + ('' + ps).split('.')[0] + os + '/' + ('' + pg).split('.')[0] + ' is User Score/Goes');
    documenttitleeq('' + ('' + ps).split('.')[0] + os + '/' + ('' + pg).split('.')[0] + ' is User Score/Goes'); 
    }
    } 
    if (tpa != '') {
    if (!nominal_numplayers) {
       defstyle=defstyle.replace(cards[donelist[eval('' + cw)]].split('#')[0].split('gif')[0], cards[donelist[eval('' + cw)]].split('#')[0].split('gif')[0] + 'JUNK');
       document.head.innerHTML+=defstyle;
    }
    }
    if (!nominal_numplayers) {
    examinescore();
    }
  }
  
  function threetoone(threeis) {
    var suitis=('' + threeis).slice(-1);
    var crdis=('' + threeis).substring(0,2);
    if (crdis == '11' && trumpsare != '0') {
      if (trumpsare.replace('c','s') == 's' && suitis.replace('c','s') == 's' && suitis != trumpsare) {
        return suitis.replace('c','S').replace('s','C').toLowerCase();
      } else if (trumpsare.replace('h','d') == 'd' && suitis.replace('h','d') == 'd' && suitis != trumpsare) { 
        return suitis.replace('h','D').replace('d','H').toLowerCase();
      }
    } 
    return suitis.toLowerCase();
  }
  
  function lessmaybeno(xxcw) {
    var allowthrough=gallow, fnd=false, fnds=[], ifnds=0;
    csuffix='';
    //if (nogolist.indexOf(',' + xxcw + ',') != -1) { if (card_game.toLowerCase() == '500ish') { console.log('oops'); }  return '1234567'; }
    //alert('thishand.length=' + thishand.length);
    if (thishand.length != 0 && card_game.toLowerCase() == '500ish') {
    //alert('here');
        //if (!allowthrough) {  alert('RE ' + ysuffs[eval(-1 + eval('' + curplayer))] + ' ... lead with ' + thishand[0].slice(-1).toLowerCase() + ' and you played ' + hands[eval(0 + xxcw)].slice(-1).toLowerCase());     }
        if (!allowthrough && threetoone(thishand[0].slice(-3).toLowerCase()) != threetoone(hands[eval(0 + xxcw)].slice(-3).toLowerCase())) {
            fnds=ysuffs[eval(-1 + eval('' + curplayer))].substring(1).split(' ');
            for (ifnds=0; ifnds<fnds.length; ifnds++) {
              if (fnds[ifnds].indexOf(',') != -1) {
                if (fnds[ifnds].indexOf(thishand[0].slice(-1).toLowerCase()) != -1) { fnd=true; }
              }
            }
            if (fnd) {
              if (eval('' + emailsms.length) >= eval('' + curplayer)) { if (('' + emailsms[eval('' + curplayer)]).trim() != '') {   csuffix='  Will resend last email if you cancel this play.';    }  }
              if (lastconf != xxcw) { allowthrough=confirm('You could follow suit (where trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + '), Player ' + clong(curplayer) + '!  Allow through anyway?' + csuffix); } 
              if (!allowthrough) { if (1 == 11) { alert('false'); } lastiourx=-1;  lastioury=-1;  lastconf='' + xxcw; if (eval('' + emailsms.length) >= eval('' + curplayer)) { retcom(pmesg, pretv); }  return '1234568'; } else {  if (1 == 11) { alert('true'); }   lastiourx=iourx;  lastioury=ioury;  lastconf=''; setTimeout(lastixy,2000); }
            }
        }
    }
    return xxcw;
  }
  
  function lastixy() {
   lastiourx=-1;  lastioury=-1; 
  }
  
  function maybeno(xxcw) {
    var allowthrough=gallow, fnd=false, fnds=[], ifnds=0;
    csuffix='';
    if (nogolist.indexOf(',' + xxcw + ',') != -1) { if (card_game.toLowerCase() == '500ish') { console.log('oops'); }  return '1234567'; }
    //alert('thishand.length=' + thishand.length);
    if (thishand.length != 0 && card_game.toLowerCase() == '500ish') {
    //alert('here');
        //if (!allowthrough) {  alert('RE ' + ysuffs[eval(-1 + eval('' + curplayer))] + ' ... lead with ' + thishand[0].slice(-1).toLowerCase() + ' and you played ' + hands[eval(0 + xxcw)].slice(-1).toLowerCase());     }
        if (!allowthrough && threetoone(thishand[0].slice(-3).toLowerCase()) != threetoone(hands[eval(0 + xxcw)].slice(-1).toLowerCase())) {
            fnds=ysuffs[eval(-1 + eval('' + curplayer))].substring(1).split(' ');
            for (ifnds=0; ifnds<fnds.length; ifnds++) {
              if (fnds[ifnds].indexOf(',') != -1) {
                if (fnds[ifnds].indexOf(thishand[0].slice(-1).toLowerCase()) != -1) { fnd=true; }
              }
            }
            if (fnd) {
              if (eval('' + emailsms.length) >= eval('' + curplayer)) { if (('' + emailsms[eval('' + curplayer)]).trim() != '') {   csuffix='  Will resend last email if you cancel this play.';    }  }
              allowthrough=confirm('You could follow suit (where trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + '), Player ' + clong(curplayer) + '!  Allow through anyway?' + csuffix);
              if (!allowthrough) { if (1 == 11) { alert('False'); }  if (eval('' + emailsms.length) >= eval('' + curplayer)) { retcom(pmesg, pretv); }  return '1234568'; } else {   if (1 == 11) { alert('True'); }   }
            }
        }
    }
    return xxcw;
  }
    
  function bpmore(incss) {
     var thirty=30;
     var cgcols=['lime','maroon','lightblue','purple','lightgray','teal','fuchsia','olive','red','lightgreen','darkorange','pink','orange','yellow'];
     if (card_game.toLowerCase() == '500ish') {
       cgcols=["rgba(0,255,0,0.1)","rgba(173,216,230,0.1)","rgba(211,211,211,0.1)","rgba(255,0,255,0.1)","rgba(144,238,144.0.1)","rgba(255,192,203,0.1)","rgba(255,165,0,0.1)","rgba(255,255,0,0.1)"];
     }
     var icg=eval(0 + Math.floor(Math.random() * cgcols.length));
     var mvt=eval(10 + Math.floor(Math.random() * 40));
     var kf=" @keyframes animatedBpos { from { background-position: bp1; } to { background-position: bp2; } } ";
     var inkf="", jnkf="", jnkfd="", nn=0;
     var inks=[];
     if (card_game.toLowerCase() == '500ish') { thirty=1; mvt=1; }
     if (incss.indexOf('} </style>') != -1) {
     if (incss.indexOf('background-position:') != -1) {
       inkf=incss.split('background-position:')[1].split(';')[0].trim();
       inks=inkf.split(',');
       for (nn=0; nn<inks.length; nn++) {
         if (('' + inks[nn]).indexOf(' ') != -1) {
         if (('' + inks[nn]).indexOf('px') != -1) {
         jnkf+=jnkfd + eval(mvt + eval('' + inks[nn].replace(/px/g,'').replace(/\%/g,'').split(' ')[0])) + 'px ' + eval(thirty + eval('' + inks[nn].replace(/px/g,'').replace(/\%/g,'').split(' ')[1])) + 'px';
         } else {
         jnkf+=jnkfd + eval(mvt + eval('' + inks[nn].replace(/px/g,'').replace(/\%/g,'').split(' ')[0])) + '% ' + eval(thirty + eval('' + inks[nn].replace(/px/g,'').replace(/\%/g,'').split(' ')[1])) + '%';
         }
         } else {
         jnkf+=jnkfd + inks[nn];
         }
         jnkfd=',';
       }
       if (card_game == '500ISH') { incss=incss.replace(/1\.11\ \?n\=[^<]*\</g,'<').replace(/2\.11\ \?n\=[^<]*\</g,'<').replace(/3\.11\ \?n\=[^<]*\</g,'<'); }
       if (incss.indexOf('} @keyframes ') != -1) {
         return incss.replace(/\ \?n\=[^<]*\</g,'<').replace('yellow',cgcols[icg]).replace('} @keyframes ', ' animation: animatedBpos 10s linear infinite; }' + kf.replace('bp1', inkf).replace('bp2', jnkf) + ' @keyframes ');
       } else {
         return incss.replace(/\ \?n\=[^<]*\</g,'<').replace('yellow',cgcols[icg]).replace('} </style>', ' animation: animatedBpos 10s linear infinite; }' + kf.replace('bp1', inkf).replace('bp2', jnkf) + ' } </style>');
       }
     }
     }
     return incss.replace(/\ \?n\=[^<]*\</g,'<');
  } 
  
  function myalertwt(wh) {
    if (lastwinner == lastwinner) {
    curplayer=lastwinner;
        if (thehand.replace(',','') != '' && 1 == 1) {
          emstuff='';
          //alert(thehand);
          var thbits=('' + thehand).split(',');
          for (var ith=0; ith<thbits.length; ith++) {
            if (thbits[ith] != '') {
            for (var jth=0; jth<spcps.length; jth++) {
              if (spcps[jth].indexOf(thbits[ith].slice(-3) + '.') != -1) {
                emstuff+=' ' + String.fromCodePoint(eval('' + spcps[jth].split('/')[0]));
              }
            }
            }
          }
        }
    dolaterz(wh + ' ... Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]); //myalertmc(wh + ' ... Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
    }
  }
  
  function tabord(indivhtml) {
    var ilook=0, jlook=1, klook=0;
    var slookfor=[' data-suit=s', ' data-suit=c', ' data-suit=d', ' data-suit=h'];
    var slooks=[];
    var outdivhtml='<br><table border=2><thead></thead><tbody></tbody></table>'
    if (in_bidding) {
        twentythree=30;
        //outdivhtml=outdivhtml.replace('</tbody>', '<tr><td>Bidding<br>Current Bid: ' + cbid + '<td><input type=SUBMIT name=myanswer value="pass "></input></td></TR></tbody>');
        outdivhtml=outdivhtml.replace('</tbody>', '<tr><td>Bidding<br>Current Bid: None<td><input type=SUBMIT name=myanswer value="pass "></input></td></TR></tbody>');
        twentythree--;
        twentythree--;
        for (klook=0; klook<bids.length; klook++) {
         if (bids[klook].indexOf('open') == 0) {
         outdivhtml=outdivhtml.replace('</TR>', '<td><input style=display:none; type=SUBMIT name=myanswer value=' + bids[klook] + '></input></td></TR>');
         } else {
         outdivhtml=outdivhtml.replace('</TR>', '<td><input type=SUBMIT name=myanswer value="' + bids[klook] + '   "></input></td></TR>');
         }
         twentythree--;
        }
        outdivhtml=outdivhtml.replace('</TR>', '<td colspan=' + twentythree + '></tr><tr><td colspan=30 style=text-align:center;>... relevant to your cards below ...</td></tr>');
    } else if (in_kitty) {
        outdivhtml=outdivhtml.replace('</tbody>', tds_kitty + '</tbody>');
        in_kitty=false;
    }
    for (ilook=0; ilook<slookfor.length; ilook++) {
      slooks=(indivhtml + ' <input ').split(slookfor[ilook]);
      if (in_bidding) {
        for (jlook=0; jlook<slooks.length; jlook++) {
          slooks[jlook]=slooks[jlook].replace('>:','><br>').replace(/submit/g,'button').replace(/\ href\=/g,' data-href=').replace(/background\-color\:yellow\;/g,'').replace(/background\-color\:lightgreen\;/g,'').replace(/border\:5px\ solid\ yellow\;/g,'');
        }
      }
      twentythree=30;
      outdivhtml=outdivhtml.replace('</tbody>', '<tr><td>' + slookfor[ilook].replace(' data-suit=','').replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + '</td></TR></tbody>');
      twentythree--;
      for (jlook=1; jlook<slooks.length; jlook++) {
       outdivhtml=outdivhtml.replace('</TR>', '<td> <input' + slooks[jlook].split(' <input ')[0].replace('>:','><br>') + '</td></TR>');
       twentythree--;
      }
      outdivhtml=outdivhtml.replace('</TR>', '<td colspan=' + twentythree + '></tr>');
    }
    //alert(outdivhtml);
    return outdivhtml;
  }
  
  function inhouse(inhref) {
    var ine=inhref.split('mailto:')[1].split('?')[0];
    var dprefix='';
    var byis='';
    var aprefix=document.URL.split('?')[0].split('#')[0] + '?gamedate=' + encodeURIComponent('' + dis) + '&myanswer=';
    if (ine.toLowerCase() == ine) {
         form = new FormData();
         xhr = new XMLHttpRequest();
         form.append('to', ine);
         form.append('inline', 'y');
         var subjis=decodeURIComponent(inhref.split('subject=')[1].split('&')[0].split('#')[0]).replace(/\<font\ color\=red\>/g,'').replace(/\<\/font\>/g,'');
         if (in_bidding) {
           if (ssuffs[eval(-1 + bidplayer)] == '') { ssuffs[eval(-1 + bidplayer)]=subjis; } else { subjis=ssuffs[eval(-1 + bidplayer)];  }    
         }
         form.append('subject', subjis);
         var indef=decodeURIComponent(inhref.split('body=')[1].split('&')[0].split('#')[0] + "%20");
         var indefs=indef.split(':'), changefrom='', changeto='';
         //if (inhref.indexOf('Congratulations') != -1) { alert("0:indefs[0].slice(-12)=" + indefs[0].slice(-12) + " and indef=" + indef); }
         var data_suit='';
         var thispcard='';
         for (var ijhg=0; ijhg<eval(-1 + eval('' + indefs.length)); ijhg++) {
           data_suit=' data-suit=' + ('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare);
           thispcard=' ' + ('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-3).substring(0,2).toLowerCase().replace('00','Joker aka ').replace('01','Ace of ').replace('02','Two of ').replace('03','Three of ').replace('04','Four of ').replace('05','Five of ').replace('06','Six of ').replace('07','Seven of ').replace('08','Eight of ').replace('09','Nine of ').replace('10','Ten of ').replace('11','Jack of ').replace('12','Queen of ').replace('13','King of ') + data_suit.replace(' data-suit=','').replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + '';
           byis='';
           if (indefs[ijhg].slice(-1) == '>' || (indefs[ijhg].slice(-1) >= '0' && indefs[ijhg].slice(-1) <= '9')) {
            if ((indefs[eval(1 + ijhg)] + 'x').substring(0,1) != ' ') {
             changefrom=' ' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + ':';
             if (('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('h','d') == 'd') {
   //alert('1:' + ysuffs[eval(-1 + eval('' + curplayer))].substring(1).split(' ')[eval('' + ijhg)]);
             if (indef.indexOf('Congratulations') == -1 && ('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == (thehand + ' ,xxx, ').substring(1).split(',')[0].slice(-1).toLowerCase()) {
             if (('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == trumpsare.toLowerCase()) {
             byis='border:5px solid yellow;';
             }
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play this leading suit' + byis.replace('border:5px solid yellow;',' and trump') + thispcard + ' card to my right" style="display:inline-block;background-color:lightgreen;' + byis + '" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;color:red;font-color:red;" title="Click me if you want to play this leading suit' + byis.replace('border:5px solid yellow;',' and trump') + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             } else if (('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == trumpsare.toLowerCase()) {
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play this trump' + thispcard + ' card to my right" style="display:inline-block;background-color:yellow;" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;color:red;font-color:red;" title="Click me if you want to play this trump' + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             } else {
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play' + thispcard + ' card to my right" style="display:inline-block;" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;color:red;font-color:red;" title="Click me if you want to play this' + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             }
         //if (indef.indexOf('Congratulations') != -1) { alert("1:changefrom=" + changefrom + " changeto=" + changeto); }
             } else if (('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('s','c') == 'c') {
   //alert('2:' + ysuffs[eval(-1 + eval('' + curplayer))].substring(1).split(' ')[eval('' + ijhg)]);
             if (indef.indexOf('Congratulations') == -1 && ('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == (thehand + ' ,xxx, ').substring(1).split(',')[0].slice(-1).toLowerCase()) {
             if (('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == trumpsare.toLowerCase()) {
             byis='border:5px solid yellow;';
             }
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play this leading suit' + byis.replace('border:5px solid yellow;',' and trump') + thispcard + ' card to my right" style="display:inline-block;background-color:lightgreen;' + byis + '" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;color:black;font-color:black;" title="Click me if you want to play this leading suit' + byis.replace('border:5px solid yellow;',' and trump') + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             } else if (('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == trumpsare.toLowerCase()) {
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play this trump' + thispcard + ' card to my right" style="display:inline-block;background-color:yellow;" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;color:black;font-color:black;" title="Click me if you want to play this trump' + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             } else {
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play' + thispcard + ' card to my right" style="display:inline-block;" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;color:black;font-color:black;" title="Click me if you want to play this' + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             }
         //if (indef.indexOf('Congratulations') != -1) { alert("2:changefrom=" + changefrom + " changeto=" + changeto); }
             } else {
   //alert('3:' + ysuffs[eval(-1 + eval('' + curplayer))].substring(1));
             if (indef.indexOf('Congratulations') == -1 && ('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == (thehand + ' ,xxx, ').substring(1).split(',')[0].slice(-1).toLowerCase()) {
             if (('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == trumpsare.toLowerCase()) {
             byis='border:5px solid yellow;';
             }
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play this leading suit' + byis.replace('border:5px solid yellow;',' and trump') + thispcard + ' card to my right" style="display:inline-block;background-color:lightgreen;' + byis + '" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;" title="Click me if you want to play this leading suit' + byis.replace('border:5px solid yellow;',' and trump') + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             } else if (('' + ysuffs[eval(-1 + curplayer)].substring(1).split(' ')[eval('' + ijhg)]).slice(-1).toLowerCase().replace('0',trumpsare) == trumpsare.toLowerCase()) {
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play this trump' + thispcard + ' card to my right" style="display:inline-block;background-color:yellow;" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;" title="Click me if you want to play this trump' + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             } else {
             changeto=dprefix + ' <input' + data_suit + ' title="Click me if you want to play' + thispcard + ' card to my right" style="display:inline-block;" type="submit" name="myanswer" value="' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + '"></input>:<a target=_blank style="text-decoration:none;font-size:48px;" title="Click me if you want to play this' + thispcard + ' card" href="' + aprefix + encodeURIComponent(indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)]) + '">';
             }
         //if (indef.indexOf('Congratulations') != -1) { alert("3:changefrom=" + changefrom + " changeto=" + changeto); }
             }
             indef=indef.replace(changefrom, changeto);
             dprefix='</a>';
            } else if (dprefix != '') {
             changefrom=' ' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + ':';
             changeto=dprefix + ' ' + indefs[ijhg].split(' ')[eval(-1 + indefs[ijhg].split(' ').length)] + ':';
             indef=indef.replace(changefrom, changeto);
             dprefix='';
            }
           }
         }
         var htmlis='<html><body><form method=GET action="' + document.URL.split('?')[0].split('#')[0] + '"><input type=hidden name=gamedate id=gamedate value="' + dis + '"></input><div style=font-size:36px;>' + tabord(indef + dprefix) + '</div></form></body></html>';
         if (in_bidding) {
           if (hsuffs[eval(-1 + bidplayer)] == '') { hsuffs[eval(-1 + bidplayer)]=htmlis; } else { htmlis=hsuffs[eval(-1 + bidplayer)].replace(': None<',': ' + cbid + '<');   }    
         }
         form.append('body', htmlis.replace(': None<',': ' + cbid + '<'));
         //alert(decodeURIComponent(inhref.split('body=')[1].split('&')[0].split('#')[0]));
         xhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
         xhr.send(form);
         
         // Thu Apr 15 2021 12:05:50 GMT 1000 (Australian Eastern Standard Time)
         listenforwhat=('' + dis).replace(/\+/g,'_').replace(/\ /g,'_').replace(/\:/g,'_').replace(/\(/g,'_').replace(/\)/g,'_').toLowerCase() + '.html';
         
         setTimeout(listenout, 5000);
         return '';
    }
    return inhref;
  }
  
  function retcom(mesg, retv) {
    var afi=null, thbits=[], ith=0, jth=0, kth=1, prefis='';
    var ccbit='', bbbit='', followedby='';
    var splitter=' ...';
    pmesg=mesg;
    pretv=pretv;
    if (!dis) {
    dis=new Date();
    }
    if (in_bidding) {
           if (mesg.indexOf(' ' + bidplayer + '.11:') != -1) { mesg=mesg.split(' ' + bidplayer + '.11:')[0];  }
           if (msuffs[eval(-1 + bidplayer)] == '') { msuffs[eval(-1 + bidplayer)]=mesg; }     
           if (rsuffs[eval(-1 + bidplayer)] == '') { rsuffs[eval(-1 + bidplayer)]=retv; }     
    }
    var thisd=new Date();
    if (in_bidding) { 
      prefis='Bidding proceeds after last ' + (cbid + ' (by Player ' + cbidby + ')').replace('None (by Player 1)','Pass').replace('None','Pass') + ' leading bid. '; 
    } else if (cbid != 'None') {
      if (in_kitty) {
      prefis='Kitty decisions of winning bid in this 500 card game is ' + (cbid + ' (by Player ' + ('' + cbidby).replace('1','1,III').replace('2','2,IV').replace('3','3,1').replace('4','4,2').replace('III','3').replace('IV','4') + ')').replace('None (by Player 1)','Pass').replace('None','Pass') + '. '; 
      alert('prefis=' + prefis);
      } else {
      prefis='Winning bid in this 500 card game is ' + (cbid + ' (by Player ' + ('' + cbidby).replace('1','1,III').replace('2','2,IV').replace('3','3,1').replace('4','4,2').replace('III','3').replace('IV','4') + ')').replace('None (by Player 1)','Pass').replace('None','Pass') + '. '; 
      }
    }
    if (mesg.indexOf('Congratulations') == 0) {
      prefis+='Congratulations' + csuffix.replace('  Will resend last email if you cancel this play.', ', again, but last play did not follow suit, so ') + ' ... ';
    } else if (mesg.indexOf('Bad luck') == 0) {
      prefis+='Bad luck' + csuffix.replace('  Will resend last email if you cancel this play.', ', again, but last play did not follow suit, so ') + ' ... ';
    } else {
      prefis+=csuffix.replace('  Will resend last email if you cancel this play.', ' Sorry, but last play did not follow suit, so ... ');
    }
    if (thehand.replace(',','') != '') {
      splitter='youllneverfindthis';
    }
    if (eval('' + emailsms.length) >= eval('' + curplayer)) {
      if (emailsms[eval(-1 + eval('' + curplayer))].indexOf('@') != -1) {
      afi=document.createElement('a');
      afi.target='_blank';
      if (('' + curplayer) != '1' || 1 == 1) {
      if (clong(1).indexOf('@') != -1) {
        for (kth=1; kth<eval('' + nominal_numplayers); kth++) {
          followedby+=', Player ' + clong(eval(1 + kth));
        }
        ccbit='&cc=' + emailsms[0].trim();
        bbbit='(dealt by Player ' + clong(1) + followedby + ') ';
        if (thehand.replace(',','') != '' && 1 == 1) {
          cemstuff='';
          emstuff='';
          //alert(thehand);
          thbits=('' + thehand).split(',');
          for (ith=0; ith<thbits.length; ith++) {
            if (thbits[ith] != '') {
            for (jth=0; jth<spcps.length; jth++) {
              if (spcps[jth].indexOf(thbits[ith].slice(-3) + '.') != -1) {
                emstuff+=' ' + String.fromCodePoint(eval('' + spcps[jth].split('/')[0]));
                if (spcps[jth].slice(-5).substring(0,1).toLowerCase().replace('h','d') == 'd') {
                  cemstuff+=' <font color=red>' + String.fromCodePoint(eval('' + spcps[jth].split('/')[0])) + '</font>';
                } else {
                  cemstuff+=' ' + String.fromCodePoint(eval('' + spcps[jth].split('/')[0]));
                }
          //alert(emstuff);
              }
            }
            }
          }
          if (emstuff != '') {
          //if (prefis == '' && thehand.replace(',','') != '') { alert(mesg); }
          if (prefis == '' && thehand.replace(',','') != '' && mesg.indexOf(' cards are ') != -1) { // && mesg.indexOf(' is hosting at ') != -1) {
            mesg=mesg.replace(' cards are ', ' cards, with trick cards so far being (), are ');
            prefis=' ';
            splitter=' ...';
          } 
    if (prefis != '') {
      if (mesg.indexOf(' (') != -1) {
         var xfrom=' (' + mesg.split(' (')[1].split(')')[0] + ')';
         var xto=' (' + emstuff + ')';
         if (('' + emailsms[eval(-1 + eval('' + curplayer))]).indexOf('@') != -1 &&  ('' + emailsms[eval(-1 + eval('' + curplayer))]).toLowerCase() == ('' + emailsms[eval(-1 + eval('' + curplayer))])) {
            xto=' (' + cemstuff + ')';
         }
         mesg=mesg.replace(xfrom, xto);
      }
    }
          }
          //if (('' + emailsms[0]).indexOf('@') != -1 &&  ('' + emailsms[0]).toLowerCase() == ('' + emailsms[0])) {
          if (('' + emailsms[eval(-1 + eval('' + curplayer))]).indexOf('@') != -1 &&  ('' + emailsms[eval(-1 + eval('' + curplayer))]).toLowerCase() == ('' + emailsms[eval(-1 + eval('' + curplayer))])) {
          bbbit=bbbit.replace(')', ' and Trick ' + tricknumber + ' so far Trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + ' after lead by Player ' + clong(lastwinner) + ' is ' + cemstuff + ' and so you could click a button below or reply to Player ' + clong(1) + ' with [playerNumber].[cardNumber] of your choice)'); 
          } else {
          bbbit=bbbit.replace(')', ' and Trick ' + tricknumber + ' so far Trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + ' after lead by Player ' + clong(lastwinner) + ' is ' + emstuff + ' and so you could reply to Player ' + clong(1) + ' with [playerNumber].[cardNumber] of your choice)'); 
          }
        }
        ccbit='';
      }
      afi.href=inhouse('mailto:' + emailsms[eval(-1 + eval('' + curplayer))] + '?subject=' + encodeURIComponent(prefis + 'Regarding the Five Hundred card game Player ' + clong(1) + ' is hosting at ' + dis + ' ... ' + mesg.split(splitter)[0] + ' ... ' + ' (at ' + thisd + ') ... ') + ccbit + '&body=' + encodeURIComponent(mesg.replace(' cards are ',' ' + bbbit + 'cards are ')));
      } else {
      afi.href=inhouse('mailto:' + emailsms[eval(-1 + eval('' + curplayer))] + '?subject=' + encodeURIComponent(prefis + 'Regarding the Five Hundred card game (Trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's)' + ' you are hosting ' + dis + ' ... ' + mesg.split(' ...')[0] + ' ...') + ccbit + '&body=' + encodeURIComponent(mesg));
      }
      if (afi.href.indexOf('mailto:') == 0) {
      document.head.appendChild(afi); 
      //alert(afi.href);
      afi.click();
      }
      } else if (emailsms[eval(-1 + eval('' + curplayer))].trim() != '') {
      afi=document.createElement('a');
      afi.target='_blank';
      //afi.href='sms:' + emailsms[eval(-1 + eval('' + curplayer))] + '&body=' + encodeURIComponent(mesg);
      if (('' + curplayer) != '1' || 1 == 1) {
      if (clong(1).indexOf('@') != -1 || 11 == 11) {
        for (kth=1; kth<eval('' + nominal_numplayers); kth++) {
          followedby+=', Player ' + clong(eval(1 + kth));
        }
        ccbit='&cc=' + emailsms[0].trim();
        bbbit='(dealt by Player ' + clong(1) + followedby + ') ';
        if (thehand.replace(',','') != '' && 1 == 1) {
          thbits=('' + thehand).split(',');
          emstuff='';
          for (ith=0; ith<thbits.length; ith++) {
            if (thbits[ith] != '') {
            for (jth=0; jth<spcps.length; jth++) {
              if (spcps[jth].indexOf(thbits[ith].slice(-3) + '.') != -1) {
                emstuff+=' ' + String.fromCodePoint(eval('' + spcps[jth].split('/')[0]));
                if (spcps[jth].slice(-5).substring(0,1).toLowerCase().replace('h','d') == 'd') {
                  cemstuff+=' <font color=red>' + String.fromCodePoint(eval('' + spcps[jth].split('/')[0])) + '</font>';
                } else {
                  cemstuff+=' ' + String.fromCodePoint(eval('' + spcps[jth].split('/')[0]));
                }
              }
            }
            }
          }
          if (('' + emailsms[0]).indexOf('@') != -1 &&  ('' + emailsms[0]).toLowerCase() == ('' + emailsms[0])) {
          bbbit=bbbit.replace(')', ' and Trick ' + tricknumber + ' so far Trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + ' after lead by Player ' + clong(lastwinner) + ' is ' + emstuff + ' and so you could click a button below or reply to Player ' + clong(1) + ' with [playerNumber].[cardNumber] of your choice)'); 
          } else {
          bbbit=bbbit.replace(')', ' and Trick ' + tricknumber + ' so far Trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + ' after lead by Player ' + clong(lastwinner) + ' is ' + emstuff + ' and so you could reply to Player ' + clong(1) + ' with [playerNumber].[cardNumber] of your choice)'); 
          }
        }
        ccbit='';
      }
      afi.href='sms:' + emailsms[eval(-1 + eval('' + curplayer))] + '&body=' + encodeURIComponent('Regarding the Five Hundred card game Player ' + clong(1) + ' is hosting at ' + dis + ' (and now is ' + thisd + ') ... ' + mesg.split(splitter)[0] + ' ... ') + ccbit + encodeURIComponent(mesg.replace(' cards are ',' ' + bbbit + 'cards are '));
      } else {
      afi.href='sms:' + emailsms[eval(-1 + eval('' + curplayer))] + '&body=' + encodeURIComponent('Regarding the Five Hundred card game (Trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's)' + ' you are hosting ' + dis + ' ... ' + mesg.split(' ...')[0] + ' ... ') + ccbit + encodeURIComponent(mesg);
      }
      document.head.appendChild(afi); 
      //alert(afi.href);
      afi.click();
      }
    }
    if (mesg.indexOf('Congratulations, Player ') != -1 && csuffix == '') {
    var prevretv=retv;
    var pcurplayer=curplayer;
    var truncmesg=mesg.split(' ... ')[0];
      for (var ijb=1; ijb<=eval('' + nominal_numplayers); ijb++) {
        if (eval('' + ijb) != eval('' + lastwinner)) {
          curplayer=ijb;
          retcom(truncmesg.replace('Congratulations,', 'Bad luck Player ' + clong(ijb) + ' and good luck for '), prevretv);
          curplayer=lastwinner; //pcurplayer;
        }
      }
      retv=prevretv;
      curplayer=lastwinner; //pcurplayer;
    }
    csuffix='';
    return retv;
  }
  
  function clong(inisc) {
    var lastintis='';
    if (('' + inisc).trim() != '') {
    lastintis=('' + inisc).split(' ')[eval(-1 + ('' + inisc).split(' ').length)];
    if (eval('' + emailsms.length) >= eval('' + lastintis)) {
    return '' + inisc + '[' + emailsms[eval(-1 + eval('' + lastintis))] + ']';
    }
    }
    return '' + inisc;
  }
  
  function myalertmc(wh) {
    var aapref='', bbpref='';
    if (in_bidding) { 
      bbpref='In this bidding phase the last winning bid is ' + (cbid + ' (by Player ' + cbidby + ')').replace('None (by Player 1)','Pass').replace('None','Pass') + ' so what is your bid out of Pass,6s,6c,6d,6h,6n,7s,7c,7d,7h,7n,8s,mis' + String.fromCodePoint(232) + 're,8c,8d,8h,8n,9s,9c,9d,9h,9n,10s,10c,10d,10h' + (',open_mis' + String.fromCodePoint(232) + 're,').substring(0,1) + '10n (bearing in mind that a lowercase email address suffices to enter your next bid, via an email)?   ';   
      aapref=bbpref;
    } 
    if (card_game.toUpperCase() == '500ISH') {  aapref+='In this game trumps are ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's, ';  }
    if (curplayer == curplayer) {
    var huhc='yes';
    var cfm='';
    //alert('emailsms.length=' + emailsms.length + ' curplayer=' + curplayer);
    if (eval('' + emailsms.length) >= eval('' + curplayer)) {
    //if (thehand.replace(',','') != '' && wh.indexOf(' (') == -1) {
    //wh+=' ... cards so far in this trick are () ';
    //alert(wh);
    //huhc=retcom(wh.replace('Player 1 ', 'Player 1 (dealer and host) '), ' ');
    //} else {
    huhc=retcom(wh.replace('Player 1 ', 'Player 1 (dealer and host) '), ' ');
    //}
    } else if (in_bidding) {
    cfm=prompt(aapref + 'Player ' + clong(curplayer) + ', do you want to see your cards while other players turn away in popup (alert) window, else enter an email/SMS address/number for you as Player ' + curplayer + '?','');
    if (cfm == null) { 
      huhc=''; 
    } else if (('' + cfm).trim() != '') { 
      var jsbid=false;
      if (in_bidding && cfm.indexOf('@') == -1 && cfm.replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') != '') {
     for (var ibidis=0; ibidis<bids.length; ibidis++) {
      if (cfm.toLowerCase().indexOf('pass') == 0) {
      jsbid=true;
      gd=('' + dis);
      sentanswer='pass    ';
      sentclick();
      } else if ((cfm + ' ').substring(0,3).toLowerCase() == (bids[ibidis] + ' ').substring(0,3).toLowerCase()) {
      jsbid=true;
      gd=('' + dis);
      sentanswer=bids[ibidis] + '    ';
      sentclick();
      }
     }
      }
      if (!jsbid) {
      if (communication_list == '') { 
        communication_list+=cfm; 
        emailsms=communication_list.split(','); 
      } else { 
        communication_list+=',' + cfm;  
        emailsms=communication_list.split(',');  
      }  
      huhc=retcom(wh, ' ');  
      }
    } else { 
      huhc='yes'; 
    }
    } else if (card_game != '500ISH' || donelistis.replace(',','') == '') {
    cfm=prompt(aapref + 'Player ' + clong(curplayer) + ', do you want to see your cards while other players turn away in popup (alert) window, else enter an email/SMS address/number for you as Player ' + curplayer + '?','');
    if (cfm == null) { huhc=''; } else if (('' + cfm).trim() != '') { if (communication_list == '') { communication_list+=cfm; emailsms=communication_list.split(','); } else { communication_list+=',' + cfm;  emailsms=communication_list.split(',');  }  huhc=retcom(wh, ' ');  } else { huhc='yes'; }
    }
    if (huhc.trim() != '' && !in_bidding) { 
      if (card_game != '500ISH' || donelistis.replace(',','') == '') { alert(wh); }
    } else if (huhc.trim() != '' && in_bidding) { 
      cfm=prompt(bbpref + wh); 
    if (cfm == null) { 
      huhc=''; 
    } else if (('' + cfm).trim() != '') { 
      var isbid=false;
      if (in_bidding && cfm.indexOf('@') == -1 && cfm.replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') != '') {
     for (var ibidis=0; ibidis<bids.length; ibidis++) {
      if (cfm.toLowerCase().indexOf('pass') == 0) {
      isbid=true;
      gd=('' + dis);
      sentanswer='pass    ';
      sentclick();
      } else if ((cfm + ' ').substring(0,3).toLowerCase() == (bids[ibidis] + ' ').substring(0,3).toLowerCase()) {
      isbid=true;
      gd=('' + dis);
      sentanswer=bids[ibidis] + '    ';
      sentclick();
      }
     }
      }
      if (!isbid) {
      if (communication_list == '') { 
        communication_list+=cfm; 
        emailsms=communication_list.split(','); 
      } else { 
        communication_list+=',' + cfm;  
        emailsms=communication_list.split(',');  
      }  
      huhc=retcom(wh, ' ');  
      }
    } else { 
      huhc='yes'; 
    }
    }
    }
  }
  
  function whowon() {
    var leadoff=lastwinner;
    var wis=lastwinner, qw=0;
    var tsw=wis, ioff=0;
    var sofarnotrumps=true;
    var oss=scoresuffix, leadis=thishand[qw].slice(-1);
    var osses=scoresuffix.split(',');
    if (thishand[qw].slice(-1).replace('0',trumpsare) != trumpsare && leadis == thishand[qw].slice(-1)) { ioff=13; } else { ioff=0; }
    if (thishand[qw].slice(-1).replace('0',trumpsare) == trumpsare) { sofarnotrumps=false;  }
    var wl=eval(ioff + eval('' + thishand[qw].length));
    var nextoss='', jnext;
    //alert(thehand.replace(/\ /g,'x') + ' ... ' + trumpsare);
    while (eval('' + qw) < eval('' + nominal_numplayers)) {
      if (thishand[qw].slice(-1).replace('0',trumpsare) != trumpsare && leadis == thishand[qw].slice(-1)) { ioff=13; } else { ioff=0; }
      if (eval(ioff + eval('' + thishand[qw].length)) > eval('' + wl) || (sofarnotrumps && thishand[qw].slice(-1).replace('0',trumpsare) == trumpsare)) {
        //if (thishand[qw].slice(-1).replace('0',trumpsare) == trumpsare) {
        if (sofarnotrumps && thishand[qw].slice(-1).replace('0',trumpsare) == trumpsare) { sofarnotrumps=false; leadis=' ';  }
        lastwinner=wis;
        wl=eval(ioff + eval('' + thishand[qw].length));
        //}
      }
      wis++;
      if (wis > eval('' + nominal_numplayers)) { wis=1; }
      qw++;
    }
    //alert('winner=' + lastwinner);
    osses[eval(-1 + lastwinner)]='' + eval(1 + eval('' + osses[eval(-1 + lastwinner)]));
    scoresuffix='' + osses[0];
    for (jnext=1; jnext<eval('' + nominal_numplayers); jnext++) {
      scoresuffix+=',' + osses[jnext];
    }
    if (1 == 2) {
    if (eval('' + emailsms.length) == 0) {
    scoresuffix=scoresuffix;
    } else if (('' + emailsms[0]).indexOf('@') != -1) {
    if (scoresuffix.indexOf(' via ') == -1) { scoresuffix=scoresuffix + ' (via emails to Player 1 perhaps)'; }
    } else if (('' + emailsms[0]).trim() == '') {
    scoresuffix=scoresuffix;
    } else {
    if (scoresuffix.indexOf(' via ') == -1) { scoresuffix=scoresuffix + ' (via SMS to Player 1 perhaps)'; }
    }
    }
    myalertwt('Congratulations, Player ' + clong(lastwinner) + ', you win Trick ' + tricknumber + ' (' + emstuff + ') lead off by Player ' + clong(leadoff) + ' and Trumps ' + trumpsare.replace('c','Club').replace('d','Diamond').replace('s','Spade').replace('h','Heart').replace('0','No Trump') + 's' + '), and lead off, as applicable, for the next trick.  Scores are ' + scoresuffix.split(' (via ')[0]);
    tricknumber++;
    thishand=[];
    curplayer=eval('' + lastwinner);
    var prevcsuff=csuff;
      var hjg='' + curplayer;
      csuff='';
      for (var ipl=0; ipl<hjg.length; ipl++) {
        //alert(hjg.substring(ipl,eval(1 + eval('' + ipl))) + ' has ord ' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0) + ' to ' + eval(8304 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
        csuff+=String.fromCodePoint(eval(8320 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
      }
    thehand=',';
    defstyle=defstyle.replace(' ' + oss + '<', ' ' + scoresuffix + '<');
    if (csuff != prevcsuff) {
    //if (defstyle.indexOf(' (via ') != -1 || eval('' + emailsms.length) == 0) {
    defstyle=defstyle.replace('Click away Player ' + prevcsuff + '', 'Click away Player ' + csuff + '');
    //} else if (('' + emailsms[0]).indexOf('@') != -1) {
    //defstyle=defstyle.replace('Click away Player ' + prevcsuff + '', 'Click away Player ' + csuff + ' (via emails to Player 1 perhaps)');
    //} else if (('' + emailsms[0]).trim() == '') {
    //defstyle=defstyle.replace('Click away Player ' + prevcsuff + '', 'Click away Player ' + csuff + '');
    //} else {
    //defstyle=defstyle.replace('Click away Player ' + prevcsuff + '', 'Click away Player ' + csuff + ' (via SMS to Player 1 perhaps)');
    //}
    }
    document.head.innerHTML+=bpmore(defstyle);
  }
  
  function dolaterz(inwh) {
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
        //alert(34);
     myalertmc(inwh);
     } else if (eval('' + emailsms.length) >= eval('' + curplayer)) {
        //alert(314);
     myalertmc(inwh);
     } else {
     alert(inwh.split(' ...')[0]);
     }
  }
  
  function dolaterx() {
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
         //alert(534);
    myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
     } else if (eval('' + emailsms.length) >= eval('' + curplayer)) {
        //alert(834);
     myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
     }
  }
  
  function popupsim(zkq, zkl) {
      var xkq='' + zkq;
      if (xkq == '0') { xkq='' + deckn; }
      aminmiddle=false; 
      //if (card_game.toLowerCase() == '500ish' && lasttogglenumber == '  ') { lasttogglenumber='';  }
      if (lasttogglenumber != ' ') {
      for (var ihj=0; ihj<spcps.length; ihj++) {
        if (('' + zkl) == spcps[ihj].split('/')[0]) {
          for (var jhj=0; jhj<donelist.length; jhj++) {
          if (('' + donelist[jhj]) == ('' + ihj)) {
          cw=eval(0 + jhj);
          if (card_game.toLowerCase() == '500ish' && ('' + altcw) != '-1') { cw=eval(-1 + altcw); }
          //if (card_game.toLowerCase() == '500ish' && nominal_numplayers && lasttogglenumber != ' ' && eval('' + defstyle.split('url(').length) > eval('' + maybeno(cw))) {
          //      if (defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0].trim().split('>')[eval(-1 + defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0].trim().split('>').length)].indexOf('' + curplayer + '.') != 0) {
          //      console.log('Cw=' + cw + ' and curplayer=' + curplayer + ' and Dbit=' + defstyle.split('url(')[eval(1 + eval('' + cw))].substring(0,350));
          //      lasttogglenumber='  ';
         //       }
         // }
          if (nominal_numplayers && lasttogglenumber.replace('  ',' ') != ' ' && eval('' + defstyle.split('url(').length) > eval('' + maybeno(cw))) {
                console.log('cw=' + cw + ' and dbit=' + defstyle.split('url(')[eval(1 + eval('' + cw))].substring(0,350));
                var cardlook=('' + defstyle.split('url(')[eval(1 + eval('' + cw))]);
                if (cardlook.indexOf('?n=') != -1) {
                //alert('cw=' + cw + ' cardlook=' + cardlook + ' ' + defstyle);
                cardlook='?n=' + cardlook.split('?n=')[1].split('#')[0].split('<')[0] + '#';
                console.log('cw=' + cw + ' cardlook=' + cardlook);
                cardlook=cardlook.split('?n=')[1].split('#')[0].split('<')[0] + '#'; //'' + spcps[eval('' + cw)].substring(6).split('.')[0] + '.';
                console.log('cw=' + cw + ' Cardlook=' + cardlook);
                //alert('cw=' + cw + ' Cardlook=' + cardlook + ' ' + defstyle);
                if (defstyle.indexOf(cardlook) != -1) {
                  xkq=cardlook.replace('?n=','').replace('#','');
                }
                var hh='#';
                if (defstyle.indexOf('?n=' + xkq + '<') != -1 || card_game.toLowerCase() == '500ish') { hh='<'; }
                console.log('hh=' + hh + ' and xkq=' + xkq);
                if (defstyle.indexOf('?n=' + xkq + hh) != -1) {
                  if (lasttogglenumber != ('' + xkq)) { // || card_game.toLowerCase() == '500ish') {
                  lasttogglenumber=('' + xkq);
                  //alert('cw=' + cw + ' and ihj=' + ihj + ' cardlook=' + cardlook);
                  //alert(defstyle.split('?n=' + eval(1 + iuh) + '#')[0].slice(-150) + '?n=' + eval(1 + iuh) + '#');
                  togglefrom='url(' + defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0] + '?n=' + xkq + hh + defstyle.split('?n=' + xkq + hh)[1].split(')')[0] + ')';
                  tfrom=togglefrom.substring(4).split('?')[0].split('#')[0].split(')')[0];
                  //alert(togglefrom);
                  tto=togglefrom.split(hh)[1].split(')')[0];
                  tmid='?' + togglefrom.split('?')[1].split(hh)[0] + hh;
                  toggleto='url(' + tto + tmid + tfrom + ')';
                  //if (defstyle.indexOf(togglefrom) != -1) {
                  //alert(togglefrom + ' to ' + toggleto);
                  //}
                  if (card_game.toLowerCase() != '500ish') {
                  defstyle=defstyle.replace(togglefrom, toggleto);
                  document.head.innerHTML+=bpmore(defstyle);
                  }
                  if (card_of_play == 0) {
                if (card_game.toLowerCase() == '500ish' && thehand.indexOf(',' + hands[eval(0 + cw)] + ',') == -1) {
          //alert('cw=' + cw + ' and ihj=' + ihj + ' and donelist[ihj]=' + donelist[ihj]);
                  //alert(hands[eval(0 + cw)] + ' before is ' + hands[eval(-1 + cw)] + ' after is ' + hands[eval(1 + cw)]);
                  thishand.push(hands[eval(0 + cw)]);
                  thehand+=hands[eval(0 + cw)] + ',';
                  var qs='';
                  for (var kjijk=0; kjijk<cards.length; kjijk++) {
                    if ((cards[kjijk] + '~').indexOf('?n=' + xkq + '~') != -1) {
                      qs=spcps[kjijk].split('/')[0];
                    }
                  }
                  //alert('qs=' + qs + ' and xkq=' + xkq + ' ' + cards[0]);
                  neweyfb='fill:black;'
                  if (eval('' + qs) >= 127153 && eval('' + qs) <= 127182) {
                  //alert('1:red');
                  neweyfb='stroke:red;'
                  }
                  if (hands[cw].replace(/d\./g, 'h.').indexOf('h.') != -1) {
                  defstyle=defstyle.replace(defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0], defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0].replace(eyfb,neweyfb).replace(eypc,neweypc).replace(tfpx,newtpfx + 'margin-top:20px;font-color:red;')).replace('>' + defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0].trim().split('>')[eval(-1 + defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0].trim().split('>').length)], '>' + String.fromCodePoint(eval('' + qs)));
                  } else {
                  defstyle=defstyle.replace(defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0], defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0].replace(eyfb,neweyfb).replace(eypc,neweypc).replace(tfpx,newtpfx + 'margin-top:20px;')).replace('>' + defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0].trim().split('>')[eval(-1 + defstyle.split('url(')[eval(1 + eval('' + cw))].split('?')[0].trim().split('>').length)], '>' + String.fromCodePoint(eval('' + qs)));
                  }
                  neweyfb='fill:black;'
                  document.head.innerHTML+=bpmore(defstyle);
                } else if (card_game.toLowerCase() == '500ish') {
                  return;
                }
                    if (card_game.toLowerCase() != '500ish') { 
                    susslist+='' + cw + ','; 
                    console.log('first card');
                    lastcard='';
                    lasttoggleto=toggleto;
                    lasttogglefrom=togglefrom;
                    lasttto=tto;
                    lasttmid=tmid;
                    lasttfrom=tfrom;
                    if (toggleto.indexOf('images/0') != -1) {
                    lastcard='0' + toggleto.split('images/0')[1].split('.')[0];
                    } else if (toggleto.indexOf('images/1') != -1) {
                    lastcard='1' + toggleto.split('images/1')[1].split('.')[0];
                    }
                    }
                    if (card_game.toLowerCase() == '500ish') {
                    curplayer++;
                    if (curplayer > eval('' + nominal_numplayers)) {
                    curplayer=1;
                    }
                    var wqt='>    Click away Player ' + csuff + ' ' + scoresuffix + '<';
      var hjg='' + curplayer;
      csuff='';
      for (var ipl=0; ipl<hjg.length; ipl++) {
        //alert(hjg.substring(ipl,eval(1 + eval('' + ipl))) + ' has ord ' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0) + ' to ' + eval(8304 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
        csuff+=String.fromCodePoint(eval(8320 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
      }
                    defstyle=defstyle.replace(wqt,'>    Click away Player ' + csuff + ' ' + scoresuffix + '<');
                    document.head.innerHTML+=bpmore(defstyle);
                    if (eval('' + thishand.length) == eval('' + nominal_numplayers)) {
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
        setTimeout(dolaterx,2000); //alert('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
        }
                    whowon();
                    } else {
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
        //alert(12);
        myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
        } else if (eval('' + emailsms.length) >= eval('' + curplayer)) {
        //alert(712);
     myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
     }
                    }
                    } else {
                    //message=('Player ' + curplayer + ', your hand currently holds ' + emojistr[eval(-1 + curplayer)] + ' so do you want to keep card showing, or discard.'); // + lastcard.substring(0,2) + ' ' + ('0' + toggleto.split('images/0')[1].split('.')[0].substring(0,1)));
                    //if (ocp) { ocp.style.cursor='progress'; }
                    //setTimeout(domessagetwo,2000);
                    //} else {
                    card_of_play=1;
                    console.log('First card');
                    }
                    if (card_game.toLowerCase() != '500ish') { 
                    if (ocp) { 
                      ocp.style.cursor='url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10068,10067) + csuff + '</text></svg>") 16 0, crosshair'; 
        if (defstyle.indexOf('data:image/svg') != -1) {
          defstyle=defstyle.replace(prevsb, String.fromCodePoint(10068,10067) + csuff);
          prevsb=String.fromCodePoint(10068,10067) + csuff;
          document.head.innerHTML+=bpmore(defstyle);
        }
                    } else if (defstyle.indexOf('data:image/svg') != -1) {
        defstyle=defstyle.replace(prevsb, String.fromCodePoint(10068,10067) + csuff);
        prevsb=String.fromCodePoint(10068,10067) + csuff;
        document.head.innerHTML+=bpmore(defstyle);
      }
      }
      if (message != '') { alert(gamescoreprefix + ' ... ' + message + ''); }
                   
                    
                    
                    
                 } else {
                    console.log('second card');
                    if (card_game.toLowerCase() == '500ish') { susslist+='' + cw + ','; }
                    if (toggleto.indexOf('images/0') != -1) {
                    console.log('Second card');
                    if ((card_game == 'any_colour' || lastcard.substring(0,2) == ('0' + toggleto.split('images/0')[1].split('.')[0].substring(0,1))) && (card_game == 'memories' || ((card_game == 'zebra' && lastcard.substring(2,3).replace('h','black').replace('d','black').replace('c','red').replace('s','red') == toggleto.split('images/0')[1].split('.')[0].substring(1,2).replace('c','black').replace('s','black').replace('d','red').replace('h','red')) || (card_game == 'any_colour' && lastcard.substring(2,3).replace('c','black').replace('s','black').replace('d','red').replace('h','red') == toggleto.split('images/0')[1].split('.')[0].substring(1,2).replace('c','black').replace('s','black').replace('d','red').replace('h','red')) )  )) {
                    message=('Well done, continue Player ' + curplayer);
                    gamescores[eval(-1 + curplayer)]++;
                    if (card_game.toLowerCase() != '500ish') { 
                    if (ocp) { 
                      ocp.style.cursor='url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10004) + csuff + '</text></svg>") 16 0, progress'; 
        if (defstyle.indexOf('data:image/svg') != -1) {
          defstyle=defstyle.replace(prevsb, String.fromCodePoint(10004) + csuff);
          prevsb=String.fromCodePoint(10004) + csuff;
          document.head.innerHTML+=bpmore(defstyle);
        }
                    } else if (defstyle.indexOf('data:image/svg') != -1) {
        defstyle=defstyle.replace(prevsb, String.fromCodePoint(10004) + csuff);
        prevsb=String.fromCodePoint(10004) + csuff;
        document.head.innerHTML+=bpmore(defstyle);
      }
      }
                     setTimeout(domessage,2000);
                  //defstyle=defstyle.replace(toggleto, togglefrom.replace(/\./g,'.JUNK'));
                  //defstyle=defstyle.replace(lasttoggleto, lasttogglefrom.replace(/\./g,'.JUNK'));
                  //document.head.innerHTML+=defstyle;
                    } else {
                  //defstyle=defstyle.replace(toggleto, togglefrom);
                  //defstyle=defstyle.replace(lasttoggleto, lasttogglefrom);
                  //document.head.innerHTML+=defstyle;
                    curplayer++;
                    if (eval('' + curplayer) > eval('' + nominal_numplayers)) { curplayer=1;    }
                    if (eval('' + curplayer) > eval('' + gamescores.length)) { gamescores.push(0); }
                    message=('Next player ' + curplayer + ' goes now '); // + lastcard + ' ' + toggleto.split('images/0')[1].split('.')[0].substring(1,2) + ' vs ' + toggleto.split('images/0')[1]); // + lastcard.substring(0,2) + ' ' + ('0' + toggleto.split('images/0')[1].split('.')[0].substring(0,1)));
  if (card_game.toLowerCase() != '500ish') { 
                    if (ocp) { 
                      ocp.style.cursor='url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10060) + csuff + '</text></svg>") 16 0, not-allowed'; 
        if (defstyle.indexOf('data:image/svg') != -1) {
          defstyle=defstyle.replace(prevsb, String.fromCodePoint(10060) + csuff);
          prevsb=String.fromCodePoint(10060) + csuff;
          document.head.innerHTML+=bpmore(defstyle);
        }
                    } else if (defstyle.indexOf('data:image/svg') != -1) {
        defstyle=defstyle.replace(prevsb, String.fromCodePoint(10060) + csuff);
        prevsb=String.fromCodePoint(10060) + csuff;
        document.head.innerHTML+=bpmore(defstyle);
      }
      }
                    
                    setTimeout(domessagetwo,2000);
                    }
                    } else if (toggleto.indexOf('images/1') != -1) {
                    if ((card_game == 'any_colour' || lastcard.substring(0,2) == ('1' + toggleto.split('images/1')[1].split('.')[0].substring(0,1))) && (card_game == 'memories' || ((card_game == 'zebra' && lastcard.substring(2,3).replace('h','black').replace('d','black').replace('c','red').replace('s','red') == toggleto.split('images/1')[1].split('.')[0].substring(1,2).replace('c','black').replace('s','black').replace('d','red').replace('h','red')) || (card_game == 'any_colour' && lastcard.substring(2,3).replace('c','black').replace('s','black').replace('d','red').replace('h','red') == toggleto.split('images/1')[1].split('.')[0].substring(1,2).replace('c','black').replace('s','black').replace('d','red').replace('h','red')) )  )) {
                    message=('Well done, continue Player ' + curplayer);
                    gamescores[eval(-1 + curplayer)]++;
                    //if (ocp) { ocp.style.cursor='progress'; }
   if (card_game.toLowerCase() != '500ish') { 
                    if (ocp) { 
                      ocp.style.cursor='url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10004) + csuff + '</text></svg>") 16 0, progress'; 
        if (defstyle.indexOf('data:image/svg') != -1) {
          defstyle=defstyle.replace(prevsb, String.fromCodePoint(10004) + csuff);
          prevsb=String.fromCodePoint(10004) + csuff;
          document.head.innerHTML+=bpmore(defstyle);
        }
                    } else if (defstyle.indexOf('data:image/svg') != -1) {
        defstyle=defstyle.replace(prevsb, String.fromCodePoint(10004) + csuff);
        prevsb=String.fromCodePoint(10004) + csuff;
        document.head.innerHTML+=bpmore(defstyle);
      }
      }
                    
                    setTimeout(domessage,2000);
                  //defstyle=defstyle.replace(toggleto, togglefrom.replace(/\./g,'.JUNK'));
                  //defstyle=defstyle.replace(lasttoggleto, lasttogglefrom.replace(/\./g,'.JUNK'));
                  //document.head.innerHTML+=defstyle;
                    } else {
                  //defstyle=defstyle.replace(toggleto, togglefrom);
                  //defstyle=defstyle.replace(lasttoggleto, lasttogglefrom);
                  //document.head.innerHTML+=defstyle;
                    curplayer++;
                    if (eval('' + curplayer) > eval('' + nominal_numplayers)) { curplayer=1;    }
                    if (eval('' + curplayer) > eval('' + gamescores.length)) { gamescores.push(0); }
                    message=('Next player ' + curplayer + ' goes now '); // + lastcard + ' ' + toggleto.split('images/1')[1].split('.')[0].substring(1,2) + ' vs ' + toggleto.split('images/1')[1]); // + lastcard.substring(0,2) + ' ' + ('1' + toggleto.split('images/1')[1].split('.')[0].substring(0,1)));
       if (card_game.toLowerCase() != '500ish') {                     
       if (ocp) { 
                      ocp.style.cursor='url("data:image/svg+xml;utf8,<svg xmlns=' + "'" + 'http://www.w3.org/2000/svg' + "'" + ' width=' + "'" + '96' + "'" + ' height=' + "'" + '48' + "'" + ' viewport=' + "'" + '0 0 100 100' + "'" + ' style=' + "'" + brad + 'background-color:rgba(255,0,0,0.1);' + eyfb + 'font-family:Verdana;font-size:' + tfpx + "'" + '><text y=' + "'" + eypc + "'" + '>' + String.fromCodePoint(10060) + csuff + '</text></svg>") 16 0, not-allowed'; 
        if (defstyle.indexOf('data:image/svg') != -1) {
          defstyle=defstyle.replace(prevsb, String.fromCodePoint(10060) + csuff);
          prevsb=String.fromCodePoint(10060) + csuff;
          document.head.innerHTML+=bpmore(defstyle);
        }
                    } else if (defstyle.indexOf('data:image/svg') != -1) {
        defstyle=defstyle.replace(prevsb, String.fromCodePoint(10060) + csuff);
        prevsb=String.fromCodePoint(10060) + csuff;
        document.head.innerHTML+=bpmore(defstyle);
      }
      }
                    setTimeout(domessagetwo,2000);
                    }
                    }
                    lasttogglenumber=' ';
                    lastcard='';
                    //lasttto='';
                    //lasttmid='';
                    //lasttfrom='';
                    //lasttoggleto='';
                    //lasttogglefrom='';
                    card_of_play=0;
                  }
                  } 
                }
                }
           }
          }
          }
        }
      }
      //console.log('zkq=' + zkq + ' asq.length=' + asq.length + ' sq.length=' + sq.length);
      //alert('zkq=' + zkq);
      da='' + asq[eval(0 + zkq)]; 
      //console.log('da=' + da);
      //alert('da=' + da);
      dp='' + given + sq[eval('' + zkq)]; 
      //console.log('dp=' + dp);
      //alert('dp=' + dp);
      def=String.fromCodePoint(eval('' + zkl));  
      //documenttitleeq(ps + os + '/' + pg + ' is User: Score/Goes'); 
      // window.close();  // remove from defstyle created background-image list 
      //document.head.innerHTML+="<style> html { background:URL('" + cards[zkl] + "'); background-size:contain;  background-repeat:no-repeat; } </style>";   
      if (zkq != lastzkq || zkl != lastzkl) {
      lastzkq=zkq;
      lastzkl=zkl;
      pa(); 
      }
      }
   }
  
  function sentclick() {
   var togglefrom='', toggleto='', tfrom='', tto='', tmid='', iok=true, icw=0;
   var remote=false;
   var tlen=0;
   var ihjk=0;
    var gono=false;
    var froms='>1.1<', tos='>1.1<';
    var carddesc='', defval=0, ixc, blanks='                                          ';
    var bdl=[];
    var kjn=0;
    var iskitty=false;
    
    var bcp='';
   //alert('here0');
    if (sentanswer.indexOf('.') != -1) {
   //alert('here why');
      if (('' + curplayer) != ('' + sentanswer.split('.')[0])) {
        sentanswer='';
      } else if (('' + curplayer) == ('' + sentanswer.split('.')[0])) {
        var iuh=eval(-1 - eval(eval('' + nominal_numplayers) - eval('' + sentanswer.split('.')[0])) + eval(eval('' + nominal_numplayers) * eval('' + sentanswer.split('.')[1]))   );
              if (eval('' + oplistname.length) > eval('' + iuh) && card_game.toLowerCase() == '500ish') {
              if (oplistname[iuh] == '') {
              popupsim(eval(('' + opltlistt[iuh]).split('.')[1]), eval(('' + opltlistl[iuh]).split('.')[1]));
              } else {
              if (eval(1 + eval(iuh % nominal_numplayers)) == eval('' + curplayer) && iuh != lastsq) {
              lastsq=iuh;
              //alert(defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0]);
              var fgs=defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0].split('<!-- ');
              var zfgs=defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0].split(' ?n=');
              if (fgs.length > 1 && zfgs.length > 1) {
                var repthis='>' + zfgs[0].split('>')[eval(-1 + zfgs[0].split('>').length)] + ' ';
                var cde=fgs[1].split(' ')[1].split('-')[0];
                  if (card_game.toLowerCase() == '500ish' && thehand.indexOf(cde) == -1) {
     if (lastcde == cde && 1 == 7) {
       iok=false;
     } else {
                  var iicw=0;
                  for (var jjcw=0; jjcw<hands.length; jjcw++) {
                    if (hands[jjcw].slice(-3) == cde) { iicw=jjcw; icw=iicw;  }
                  }
     if (eval('' + defstyle.split('url(').length) > eval('' + maybeno(iicw))) {
       iok=true;
       lastcde='';
     } else {
       lastcde=cde;
       iok=false;
     } 
     }         
                  }
     if (iok) {
                for (var iz=0; iz<zsuffs.length; iz++) {
                  zsuffs[iz]=zsuffs[iz].replace(String.fromCodePoint(eval(fgs[1].split(' ')[0].split('-')[0])), ' ');
                  ysuffs[iz]=ysuffs[iz].replace(String.fromCodePoint(eval(fgs[1].split(' ')[0].split('-')[0])) + ',', '');
                }
                  neweyfb='fill:black;'
                  if (eval(fgs[1].split(' ')[0].split('-')[0]) >= 127153 && eval(fgs[1].split(' ')[0].split('-')[0]) <= 127182) {
                   //alert('2:red');
                   neweyfb='stroke:red;'
                  }
                defstyle=defstyle.replace(defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0], defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0].replace(eyfb,neweyfb).replace(eypc,neweypc).replace(tfpx,newtfpx + 'margin-top:20px;font-color:red;').replace(repthis,'>' + String.fromCodePoint(eval(fgs[1].split(' ')[0].split('-')[0])) + ' '));
                  neweyfb='fill:black;'
                document.head.innerHTML+=bpmore(defstyle);
                  if (card_game.toLowerCase() == '500ish' && thehand.indexOf(cde) == -1) {
          //alert('cw=' + cw + ' and ihj=' + ihj + ' and donelist[ihj]=' + donelist[ihj]);
                  //alert(hands[icw] + ' before is ' + hands[icw] + ' after is ' + hands[icw]);
                  thishand.push(hands[icw]);
                  thehand+=hands[icw] + ',';
     }
                    curplayer++;
                    if (curplayer > eval('' + nominal_numplayers)) {
                    curplayer=1;
                    }
                    var wqt='>    Click away Player ' + csuff + ' ' + scoresuffix + '<';
      var hjg='' + curplayer;
      csuff='';
      for (var ipl=0; ipl<hjg.length; ipl++) {
        //alert(hjg.substring(ipl,eval(1 + eval('' + ipl))) + ' has ord ' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0) + ' to ' + eval(8304 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
        csuff+=String.fromCodePoint(eval(8320 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
      }
                    defstyle=defstyle.replace(wqt,'>    Click away Player ' + csuff + ' ' + scoresuffix + '<');
                    document.head.innerHTML+=bpmore(defstyle);
                    if (eval('' + thishand.length) == eval('' + nominal_numplayers)) {
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
        setTimeout(dolaterx,2000); //alert('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
        }
                    whowon();
                    } else {
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
        //alert(15);
        myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
        } else if (eval('' + emailsms.length) >= eval('' + curplayer)) {
        //alert(815);
     myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
     }
                    }
    //} else {
  
  
  //}
    //  }
      sentanswer='';
    }
              } else {
      //alert('here xhuh');
              popupsim(eval(('' + opltlistt[iuh]).split('.')[1]), eval('' + oplistname[iuh]));
              }
              }
              }
              } else { 
      //alert('here zhuh');
              popupsim(eval(('' + opltlistt[iuh]).split('.')[1]), eval(('' + opltlistl[iuh]).split('.')[1]));
              }
          }
           //   }
           //   }
      //alert('here yhuh');
      sentanswer='';
    } else {
      //alert('here huh');
  //alert('here1');
      if (eval('' + sentanswer.length) < 3 || eval('' + sentanswer.length) > 4) {
  //alert('here2');
  if (in_bidding) {
  ma=sentanswer;
  
  //alert('sent ma=' + ma);
  
  if (ma.toLowerCase().indexOf('pass') == 0) {
    passcnt++;
    if (passcnt == 4) {
    
      if (cbid.toLowerCase().replace('pass','none') == 'none') { alert('Reload.');  location.href=document.URL.split('#')[0];  }
      in_bidding=false;
      in_kitty=true;
      curplayer=eval('' + cbidby);
      lastwinner=eval('' + cbidby);
      donelistis=',1,2,3,4,';
      if (cbid.trim().slice(-1).toLowerCase() == 'n' || cbid.toLowerCase().indexOf('mis') != -1) {
        trumpsare='0';
      } else {
        trumpsare=cbid.trim().slice(-1).toLowerCase();
      }
        var thirty=30;
        var threeis='   ';
        var eis=0;
        //alert('hands.length=' + hands.length + ' hands[40]=' + hands[40]);
        for (ixc=0; ixc<hands.length; ixc++) {
          bdl=hands[ixc].split(' ');
          if (eval('' + ixc) >= 40) {
            eis=0;
            //alert('0:' + hands[ixc] + '!');
            threeis=hands[ixc].slice(-3);
            //alert('threeis=' + threeis + ' ... ' + hands[ixc] + '!');
            for (ihjk=0; ihjk<spcps.length; ihjk++) {
              if (spcps[ihjk].indexOf(threeis + '.') != -1) {
                eis=eval('' + spcps[ihjk].split('/')[0]);
              }
            }
            //alert(String.fromCodePoint(eis) + ' threeis=' + threeis + 'zsuffs[]=' + zsuffs[eval(-1 + curplayer)]);
            if (tds_kitty == '') {
              tds_kitty='<tr><td>Kitty</td><td><select name=swap1><option value="">Kitty Card 1 ' + String.fromCodePoint(eis) + ' ... in for ...</option></SELECT></td></TR>';
              thirty--;
              thirty--;
              for (ihjk=0; ihjk<10; ihjk++) {
               tds_kitty=tds_kitty.replace('</SELECT>','<option value="+' + curplayer + '.11,-' + curplayer + '.' + eval(1 + eval('' + ihjk)) + '">' + zsuffs[eval(-1 + curplayer)].trim().split(' ')[eval('' + ihjk)] + '</option></SELECT>');
              }
              tds_kitty=tds_kitty.replace('</SELECT>','</select>');
            } else {
              tlen=eval(-1 + eval('' + tds_kitty.split('</td>').length));
              //alert('tlen=' + tlen + ' ' + tds_kitty + ' ' + zsuffs[eval(-1 + curplayer)].trim().split(' ').length);
              tds_kitty=tds_kitty.replace('</td></TR>','</td><td><select name=swap' + tlen + '><option value="">Kitty Card ' + tlen + ' ' + String.fromCodePoint(eis) + ' ... in for ...</option></SELECT></td></TR>');
              thirty--;
              for (ihjk=0; ihjk<10; ihjk++) {
               tds_kitty=tds_kitty.replace('</SELECT>','<option value="+' + curplayer + '.1' + tlen + ',-' + curplayer + '.' + eval(1 + eval('' + ihjk)) + '">' + zsuffs[eval(-1 + curplayer)].trim().split(' ')[eval('' + ihjk)] + '</option></SELECT>');
              }
              tds_kitty=tds_kitty.replace('</SELECT>','</select>');
            }
          }
          if (bdl[eval(-1 + eval('' + bdl.length))].indexOf('000') == 0) {
             //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'') + blanks.substring(0,17);
            //alert(hands[ixc].replace(' ',blanks.substring(0,20)).replace(/\ /g,'x')); 
            hands[ixc]=hands[ixc].replace(' ',blanks.substring(0,33));
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 33'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          } else if (bdl[eval(-1 + eval('' + bdl.length))].indexOf('11' + trumpsare) == 0) {
            //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'') + blanks.substring(0,17);
            hands[ixc]=hands[ixc].replace(' ',blanks.substring(0,31));
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 31'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          } else if (bdl[eval(-1 + eval('' + bdl.length))].indexOf('11' + trumpsare.replace('c','S').replace('s','C').replace('d','H').replace('h','D').toLowerCase()) == 0) {
            //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'') + blanks.substring(0,16);
            hands[ixc]=hands[ixc].replace(' ',blanks.substring(0,30));
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 30'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          } else if (bdl[eval(-1 + eval('' + bdl.length))].slice(-1) == trumpsare) {
            //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'') + blanks.substring(0,13);
            hands[ixc]=hands[ixc].replace(' ',blanks.substring(0,27));
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 27'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          } else {
            //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'');
            hands[ixc]=hands[ixc];
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 0'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          }
          //alert(tds_kitty);
        }
        tds_kitty=tds_kitty.replace('</td></TR>','</td><td colspan=' + thirty + '></td></tr>');
      
      if (eval('' + emailsms.length) >= eval('' + curplayer)) { 
      //alert('7');
        if (('' + emailsms[eval('' + curplayer)]).trim() != '') {
      alert('8:' + msuffs[eval(-1 + curplayer)]);
        remote=true;
        myalertmc(msuffs[eval(-1 + curplayer)]); //retcom(msuffs[eval(-1 + curplayer)], ' '); //rsuffs[eval(-1 + curplayer)]);
        }
      }
      //alert('9');
      if (1 == 1) {
        if (!remote) { myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);     }
      }
    } else {
      bidplayer++;
      if (eval('' + bidplayer) > eval('' + nominal_numplayer)) {  bidplayer=1; } 
      curplayer=eval('' + bidplayer);
      if (eval('' + emailsms.length) >= eval('' + curplayer)) { 
      //alert('7');
        if (('' + emailsms[eval('' + curplayer)]).trim() != '') {
      //alert('8');
        remote=true;
        retcom(msuffs[eval(-1 + bidplayer)], rsuffs[eval(-1 + bidplayer)]);
        }
      }
      //alert('9');
      if (1 == 1) {
        if (!remote) { myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);     }
      }
    }
  } else {
    passcnt=0;
    var thisbidrank=-1;
    for (var ibidis=0; ibidis<bids.length; ibidis++) {
      if (ma.substring(0,3).toLowerCase() == (bids[ibidis] + ' ').substring(0,3).toLowerCase()) {
      //alert('found bid ' + bids[ibidis]);
        thisbidrank=ibidis;
        if (eval('' + thisbidrank) > eval('' + cbidrank)) {
      //alert('found relevant bid ' + bids[ibidis]);
          cbid=bids[ibidis];
      //alert('1');
          cbidby=eval('' + bidplayer);
      //alert('2');
          cbidrank=ibidis;
      //alert('3');
          bidplayer++;
      //alert('4');
          nominal_numplayer=4;
          if (eval('' + bidplayer) > eval('' + nominal_numplayer)) {  bidplayer=1; } 
      //alert('5');
          
          curplayer=eval('' + bidplayer);
  //alert('sent bid=' + cbid + ' and onto bidplayer=' + curplayer);
        }
        
        // send next
      //alert('6');
        if (eval('' + emailsms.length) >= eval('' + curplayer)) { 
      //alert('7');
        if (('' + emailsms[eval('' + curplayer)]).trim() != '') {
      //alert('8');
        remote=true;
        retcom(msuffs[eval(-1 + bidplayer)], rsuffs[eval(-1 + bidplayer)]);
        }
        }
      //alert('9');
        if (1 == 1) {
        if (!remote) { myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);     }
        }
      }
    }
  }
  }
  }
  
        sentanswer='';
    }
      //alert('here xhuh');
  }
  
  function clickedmaybe() {
    var togglefrom='', toggleto='', tfrom='', tto='', tmid='', icw=0, iok=true;
    if (('' + lastiourx) != '-1' && ('' + lastioury) != '-1') {
       iourx=lastiourx;
       ioury=lastioury;
       iourx=-1;
       ioury=-1;
    }
    if (('' + iourx) != '-1' && ('' + ioury) != '-1') {
     //alert(iourx);
     if (!oplist[0] || 7 == 7) {
              if (card_game.toLowerCase() == '500ish') { console.log('here at x=' + iourx + ' and y=' + ioury + ' ' + opltlistl[0] + ',' + opltlistt[0]); }
       for (var iuh=0; iuh<opltlistl.length; iuh++) {
         if (eval('' + iourx) >= eval('' + opltlistl[iuh]) && eval('' + ioury) >= eval('' + opltlistt[iuh])) {
          if (card_game.toLowerCase() == '500ish') { console.log('passed left and top test'); }
          if (eval('' + iourx) <= eval(eval('' + owidth) + eval('' + opltlistl[iuh])) && eval('' + ioury) <= eval(eval('' + oheight) + eval('' + opltlistt[iuh]))) {
         if (card_game.toLowerCase() == '500ish') { altcw=eval(1 + iuh); console.log(' ... and other ' + curplayer); }             
              if (eval('' + oplistname.length) > eval('' + iuh) && card_game.toLowerCase() == '500ish') {
              if (oplistname[iuh] == '') {
              popupsim(eval(('' + opltlistt[iuh]).split('.')[1]), eval(('' + opltlistl[iuh]).split('.')[1]));
              } else {
              if (eval(1 + eval(iuh % nominal_numplayers)) == eval('' + curplayer) && iuh != lastsq) {
              lastsq=iuh;
              //alert(defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0]);
              var fgs=defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0].split('<!-- ');
              var zfgs=defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0].split(' ?n=');
              if (fgs.length > 1 && zfgs.length > 1) {
                var repthis='>' + zfgs[0].split('>')[eval(-1 + zfgs[0].split('>').length)] + ' ';
                var cde=fgs[1].split(' ')[1].split('-')[0];
                  if (card_game.toLowerCase() == '500ish' && thehand.indexOf(cde) == -1) {
                  if (lastcde == cde && 1 == 7) {
                  iok=false;
                  lastsq=-1;
                  } else {
                  var iicw=0;
                  for (var jjcw=0; jjcw<hands.length; jjcw++) {
                    if (hands[jjcw].slice(-3) == cde) { iicw=jjcw; icw=iicw;   }
                  }
                  //alert('cde=' + cde + ' thehand=' + thehand + ' iicw=' + iicw + ' lessmaybeno(icw)=' + lessmaybeno(iicw));
                  if (eval('' + defstyle.split('url(').length) > eval('' + lessmaybeno(iicw))) {
                  iok=true;
                  lastcde='';
                  } else {
                  iok=false;
                  lastcde=cde;
                  lastsq=-1;
                  return;
                  }
                  }
                  }
                for (var iz=0; iz<zsuffs.length; iz++) {
                  zsuffs[iz]=zsuffs[iz].replace(String.fromCodePoint(eval(fgs[1].split(' ')[0].split('-')[0])), ' ');
                  ysuffs[iz]=ysuffs[iz].replace(String.fromCodePoint(eval(fgs[1].split(' ')[0].split('-')[0])) + ',', '');
                }
                  neweyfb='fill:black;'
                  if (eval(fgs[1].split(' ')[0].split('-')[0]) >= 127153 && eval(fgs[1].split(' ')[0].split('-')[0]) <= 127182) {
                  //alert('3:red');
                  neweyfb='stroke:red;'
                  }
                //alert(defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0].replace(eyfb,neweyfb).replace(eypc,neweypc).replace(tfpx,newtfpx + 'margin-top:20px;font-color:red;').replace(repthis,'>' + String.fromCodePoint(eval(fgs[1].split(' ')[0].split('-')[0]))));
                defstyle=defstyle.replace(defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0], defstyle.split('url(')[eval(1 + iuh)].split('</svg>')[0].replace(eyfb,neweyfb).replace(eypc,neweypc).replace(tfpx,newtfpx + 'margin-top:20px;font-color:red;').replace(repthis,'>' + String.fromCodePoint(eval(fgs[1].split(' ')[0].split('-')[0])) + ' '));
                  neweyfb='fill:black;'
                document.head.innerHTML+=bpmore(defstyle);
                  if (card_game.toLowerCase() == '500ish' && thehand.indexOf(cde) == -1) {
                  icw=0;
                  for (var jcw=0; jcw<hands.length; jcw++) {
                    if (hands[jcw].slice(0-3) == cde) { icw=jcw;   }
                  }
          //alert('cw=' + cw + ' and ihj=' + ihj + ' and donelist[ihj]=' + donelist[ihj]);
                  //alert(hands[icw] + ' before is ' + hands[icw] + ' after is ' + hands[icw]);
                  thishand.push(hands[icw]);
                  thehand+=hands[icw] + ',';
                  }
                    curplayer++;
                    if (curplayer > eval('' + nominal_numplayers)) {
                    curplayer=1;
                    }
                    var wqt='>    Click away Player ' + csuff + ' ' + scoresuffix + '<';
      var hjg='' + curplayer;
      csuff='';
      for (var ipl=0; ipl<hjg.length; ipl++) {
        //alert(hjg.substring(ipl,eval(1 + eval('' + ipl))) + ' has ord ' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0) + ' to ' + eval(8304 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
        csuff+=String.fromCodePoint(eval(8320 + eval(eval('' + hjg.substring(ipl,eval(1 + eval('' + ipl))).charCodeAt(0)) - 48)));
      }
                    defstyle=defstyle.replace(wqt,'>    Click away Player ' + csuff + ' ' + scoresuffix + '<');
                    document.head.innerHTML+=bpmore(defstyle);
                    if (eval('' + thishand.length) == eval('' + nominal_numplayers)) {
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
        setTimeout(dolaterx,2000); //alert('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
        }
                    whowon();
                    } else {
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
        //alert(312);
        myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
        } else if (eval('' + emailsms.length) >= eval('' + curplayer)) {
        //alert(912);
     myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
     }
                    }
                
              } else {
              popupsim(eval(('' + opltlistt[iuh]).split('.')[1]), eval('' + oplistname[iuh]));
              }
              }
              }
              } else { 
              popupsim(eval(('' + opltlistt[iuh]).split('.')[1]), eval(('' + opltlistl[iuh]).split('.')[1]));
              }
              
              
          }
         }
       }
     }
    }
  }
  
  function huh(opl) {
    if (opl) {
      if ((nominal_numplayers || document.URL.indexOf('onewindow=') != -1) || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
        return null;
      } else {
        return opl;
      }
    }
    return null;
  }
  
  function windowopen(one, two, three) {
    if (1 == 1 || (nominal_numplayers || document.URL.indexOf('onewindow=') != -1) || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
      console.log('Here ' + oheight);
      opltlistt.push(('' + eval(-42 + eval(three.split('top=')[1].split(',')[0].split(')')[0]))).split('.')[0] + '.' + kq);
      if (eval('' + opltlistl.length) >= eval('' + opltlistt.length)) {
      opltlistl[eval(-1 + eval('' + opltlistt.length))]='' + eval(three.split('left=')[1].split(',')[0].split(')')[0].split('.')[0] + opltlistl[eval(-1 + eval('' + opltlistt.length))]);
      } else {
      opltlistl.push((three.split('left=')[1].split(',')[0].split(')')[0].split('.')[0] + '.' + one.split('spcp=')[1].split('&')[0]));
      }
      oopltlistl.push((three.split('left=')[1].split(',')[0].split(')')[0].split('.')[0] + '.' + one.split('spcp=')[1].split('&')[0]));
      oopltlistt.push(('' + eval(-42 + eval(three.split('top=')[1].split(',')[0].split(')')[0]))).split('.')[0] + '.' + kq);
      owidth=eval(three.split('width=')[1].split(',')[0].split(')')[0].split('.')[0]);
      //if (card_game.toLowerCase() == '500ish') { tfpx='' + owidth + 'px'; }
      oheight=eval(three.split('height=')[1].split(',')[0].split(')')[0].split('.')[0]);
      if (defstyle.indexOf('background: URL(') != -1) {
      //defstyle=defstyle.split('background: URL(')[0] + 'background-repeat:repeat,no-repeat;background-size:contain,' + owidth + ' ' + oheight + ';background-position:0px 0px,' + ('' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px' + ';background-image: url(//www.rjmprogramming.com.au/rjmquiz_plus.jpg),url(' + cards[eval('' + donelist[eval(-1 + donelist.length)])] + ') ' + (' ' + ('' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px').substring(0,1) + '; } </style>'; //  + ' ' + owidth + ' ' + oheight
      defstyle=defstyle.split('background: URL(')[0] + 'background-repeat:no-repeat;background-size:' + owidth + 'px ' + oheight + 'px;background-position:' + ('' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px' + ';background-image: url(' + trumpgames(altcards[eval('' + donelist[eval(-1 + donelist.length)])],eval('' + donelist[eval(-1 + donelist.length)])) + ') ' + (' ' + ('' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px').substring(0,1) + '; } </style>'; //  + ' ' + owidth + ' ' + oheight
      //defstyle=defstyle.split('background: URL(')[0] + 'background-repeat:no-repeat;background-size:' + owidth + 'px ' + oheight + 'px;background-position:' + ('' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px' + ';background-image: url(' + altcards[eval('' + donelist[eval(-1 + donelist.length)])] + ') ' + (' ' + ('' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px').substring(0,1) + '; } </style>'; //  + ' ' + owidth + ' ' + oheight
      } else {
      defstyle=defstyle.replace(';background-image:',  (',' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px' + ';background-image:');
      defstyle=defstyle.replace('no-repeat','no-repeat,no-repeat');
      defstyle=defstyle.replace('background-size:' + owidth + 'px ' + oheight + 'px','background-size:' + owidth + 'px ' + oheight + 'px,' + owidth + 'px ' + oheight + 'px');
      defstyle=defstyle.replace('; } </style>', ',url(' + trumpgames(altcards[eval('' + donelist[eval(0 + ijk)])],eval('' + donelist[eval(0 + ijk)])) + ') ' + (' ' + ('' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px').substring(0,1) + '; } </style>'); //  + ' ' + owidth + ' ' + oheight
      //defstyle=defstyle.replace('; } </style>', ',url(' + altcards[eval('' + donelist[eval(0 + ijk)])] + ') ' + (' ' + ('' + opltlistl[eval(-1 + opltlistl.length)]).split('.')[0] + 'px ' + ('' + opltlistt[eval(-1 + opltlistt.length)]).split('.')[0] + '' + 'px').substring(0,1) + '; } </style>'); //  + ' ' + owidth + ' ' + oheight
      }
      //console.log('defstyle=' + defstyle);
      //document.head.innerHTML+=defstyle; 
      if ((nominal_numplayers || document.URL.indexOf('onewindow=') != -1) || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
      return null;
      }
    } 
    return window.open(one, two, three);
  } 
  
  function bowerworry(inthree) {
    if (trumpsare == 'c' && inthree == '11s') {
      return '11C';
    } else if (trumpsare == 'd' && inthree == '11h') {
      return '11D';
    } else if (trumpsare == 's' && inthree == '11c') {
      return '11S';
    } else if (trumpsare == 'h' && inthree == '11d') {
      return '11H';
    } 
    return inthree;
  }
  
  function trumpgames(defi, defkl) {
    var gono=false;
    var froms='>1.1<', tos='>1.1<';
    var carddesc='', defval=0, ixc, blanks='                                          ';
    var bdl=[];
    var kjn=0;
    var iskitty=false;
    
    var bcp='';
    if (defi.indexOf('##') != -1) {
      bcp=defi.split('##')[1];
      defi=defi.split('##')[0];
    }
    
    if (card_game.toLowerCase() == "500ish") {
    
      if (bcp != '') { oplistname[eval(-1 + eval('' + defkl))]=bcp; }
      
      if (defi.indexOf('?n=') != -1 && defi.indexOf('back01.gif') != -1) { if (defi.indexOf('?n=') < defi.indexOf('back01.gif')) { gono=true; } } 
      if (defi.indexOf('images/0') != -1) {
         carddesc='0' + defi.split('images/0')[1].substring(0,2);
         if (carddesc.indexOf('01') == 0) {
           defval=13;
         } else if (carddesc == '000') {
           //alert(defi + ' ' + defkl);
           defval=24;
         } else {
           defval=eval(-1 + eval(carddesc.substring(1,2)));
         }
      } else if (defi.indexOf('images/1') != -1) {
         carddesc='1' + defi.split('images/1')[1].substring(0,2);
         if (carddesc.indexOf('11') == 0) {
         defval=eval(-1 * eval(-1 + eval(carddesc.substring(0,2))));
         } else {
         defval=eval(-1 + eval(carddesc.substring(0,2)));
         }
      }
      if (gono) { 
        return defi; 
      } else {
        tcp++;
        if (eval('' + tcp) > eval('' + nominal_numplayers)) {
          tcp=1;
          tcpnum++;
          if (card_game == "500ISH" && ('' + tcpnum).replace('12','11').replace('13','11') == '11' && 1 == 1) {
          //totcpp=40;
          hands.push('' + defkl + blanks.substring(0,Math.abs(defval)) + carddesc); 
          iskitty=true;  // tos='>Kitty' + ' ?n=' + defi.split('?n=')[1].split('#')[0].split('<')[0] + '<';
          } //else {
          tos='>' + tcp + '.' + tcpnum + ' ?n=' + defi.split('?n=')[1].split('#')[0].split('<')[0] + '<';
          //}
        } else {
          if (card_game == "500ISH" && ('' + tcpnum).replace('12','11').replace('13','11') == '11' && 1 == 1) {
          //totcpp=40;
          hands.push('' + defkl + blanks.substring(0,Math.abs(defval)) + carddesc); 
          iskitty=true;  // tos='>Kitty' + ' ?n=' + defi.split('?n=')[1].split('#')[0].split('<')[0] + '<';
          } //else {
          tos='>' + tcp + '.' + tcpnum + ' ?n=' + defi.split('?n=')[1].split('#')[0].split('<')[0] + '<';
          //}
        }
        if (eval('' + hands.length) < eval('' + totcpp) && !iskitty) { //  && !iskitty
        //if (carddesc == '000' || 1 == 11) { alert(('' + defkl + blanks.substring(0,Math.abs(defval)) + carddesc).replace(/\ /g,'x')); }
        hands.push('' + defkl + blanks.substring(0,Math.abs(defval)) + carddesc);
        } else  if ((tcp == 1 && !iskitty && eval('' + hands.length) >= eval('' + totcpp)) || (tcp == 3 && iskitty)) {
        var oneidea=defi.split('?')[0];
        var twoidea=defi.split('#')[1];
        if (oneidea.indexOf('back01.') == -1) {
        
        if (trumpsare == '') {
        if (defi.indexOf('images/0') != -1) {
         trumpsare=defi.split('images/0')[1].substring(1,2);  // joker results in 0 as trumps
        } else if (defi.indexOf('images/1') != -1) {
         trumpsare=defi.split('images/1')[1].substring(1,2);
        }
        //if (iskitty && curplayer == 1) {  alert('Trumps are ' + trumpsare + ' ... ' + curplayer); }  
        }
        
//        trumpsare='h';  // kludge 3
        
        //alert('0:' + defi);
        return defi;
        } else {
        
        if (trumpsare == '') {
        if (twoidea.indexOf('images/0') != -1) {
         trumpsare=twoidea.split('images/0')[1].substring(1,2);  // joker results in 0 as trumps
        } else if (twoidea.indexOf('images/1') != -1) {
         trumpsare=twoidea.split('images/1')[1].substring(1,2);
        }
        //if (iskitty && curplayer == 1) {  alert('TrumPs are ' + trumpsare + ' ... ' + curplayer); }  
        }
        
//        trumpsare='h';  // kludge 3
        
        for (ixc=0; ixc<hands.length; ixc++) {
          bdl=hands[ixc].split(' ');
          if (bdl[eval(-1 + eval('' + bdl.length))].indexOf('000') == 0) {
             //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'') + blanks.substring(0,17);
            //alert(hands[ixc].replace(' ',blanks.substring(0,20)).replace(/\ /g,'x')); 
            hands[ixc]=hands[ixc].replace(' ',blanks.substring(0,33));
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 33'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          } else if (bdl[eval(-1 + eval('' + bdl.length))].indexOf('11' + trumpsare) == 0) {
            //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'') + blanks.substring(0,17);
            hands[ixc]=hands[ixc].replace(' ',blanks.substring(0,31));
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 31'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          } else if (bdl[eval(-1 + eval('' + bdl.length))].indexOf('11' + trumpsare.replace('c','S').replace('s','C').replace('d','H').replace('h','D').toLowerCase()) == 0) {
            //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'') + blanks.substring(0,16);
            hands[ixc]=hands[ixc].replace(' ',blanks.substring(0,30));
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 30'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          } else if (bdl[eval(-1 + eval('' + bdl.length))].slice(-1) == trumpsare) {
            //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'') + blanks.substring(0,13);
            hands[ixc]=hands[ixc].replace(' ',blanks.substring(0,27));
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 27'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          } else {
            //hands[ixc]=hands[ixc].replace(bdl[eval(-1 + eval('' + bdl.length))],'');
            hands[ixc]=hands[ixc];
// if (ixc == 0) { alert('hands[ixc]=' + hands[ixc] + ' trumpsare=' + trumpsare + ' 0'); } 
            if (eval(eval(ixc % nominal_numplayers) + 1) == curplayer || 1 == 1) {
            for (kjn=0; kjn<spcps.length; kjn++) {
             if (spcps[kjn].indexOf(bdl[eval(-1 + eval('' + bdl.length))]) != -1) {
               zsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0]));
               ysuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=' ' + eval(eval(ixc % nominal_numplayers) + 1) + '.' + Math.floor(eval(ixc + eval('' + nominal_numplayers)) / eval('' + nominal_numplayers)) + ':' + String.fromCodePoint(eval(spcps[kjn].split('/')[0])) + ',' + bowerworry(spcps[kjn].slice(-7).split('.')[0]);
             }
            }
            }
          }
        }
        zsuff=zsuffs[eval(-1 + curplayer)];
        if (donelistis.indexOf(',' + curplayer + ',') == -1) {
        if (!in_bidding && !in_kitty) { donelistis+='' + curplayer + ','; }
        //alert(417);
        myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
        } else if (eval('' + emailsms.length) >= eval('' + curplayer)) {
        //alert(817);
     myalertmc('Player ' + curplayer + ' cards are ... ' + zsuffs[eval(-1 + curplayer)]);
     }
        //alert('1:' + twoidea + '?n=' + defi.split('?n=')[1].split('#')[0].split('<')[0] + '#' + oneidea);
        if (!iskitty) { return twoidea + '?n=' + defi.split('?n=')[1].split('#')[0].split('<')[0] + '#' + oneidea; }
        }
        } else {
        tos='><';
        }
      } 
      //alert('2:' + '' + dhicp.split('url(')[1].split(') ')[0].replace(froms,tos) + '');
      if (bcp != '') {  return '' + dhicp.split('url(')[1].split(') ')[0].replace(froms,tos).replace('<text','<!-- ' + bcp + ' ' + carddesc + ' --><text');  }
      return '' + dhicp.split('url(')[1].split(') ')[0].replace(froms,tos) + '';
    }
    return defi;
  }
  
  function wosf(st) {
    cw=st;
  }
  
  function ourprompt(tw, blb, bdef) {
    var kijk;
      console.log('oplist[' + eval('' + tw) + '].document.name=' + oplist[eval('' + tw)].document.name + ' and dragorder[' + curdrag + ']=' + dragorder[eval('' + curdrag)] + ' vs tw=' + tw + ' and overall;goes=' + overallgoes); 
    if (oplist[eval('' + tw)].document.name == ('' + dragorder[eval('' + curdrag)]) && eval('' + curdrag) == eval('' + overallgoes)) {
      console.log('Dragorder[' + curdrag + ']=' + dragorder[eval('' + curdrag)] + ' vs tw=' + tw + ' and overall;goes=' + overallgoes); 
      var decs=documenttitle.split('.');
      curdrag++;
      overallgoes++;
      if (eval('' + decs.length) >= 3) {
        documenttitleeq(documenttitle.replace('.' + decs[1] + '.', '.' + curdrag + '/' + overallgoes + '.'));
      }
      oplist[eval('' + tw)].close();
      if (!nominal_numplayers) {
      defstyle=defstyle.replace(cards[donelist[eval('' + tw)]].split('#')[0].split('gif')[0], cards[donelist[eval('' + tw)]].split('#')[0].split('gif')[0] + 'JUNK');
      document.head.innerHTML+=bpmore(defstyle);
      }
      return null;
    }
    if (eval('' + oplist[eval('' + tw)].screenTop) == eval('' + opltlistt[eval('' + tw)]) && eval('' + oplist[eval('' + tw)].screenLeft) == eval('' + opltlistl[eval('' + tw)])) {
      if (spcps[eval('' + tw)].indexOf('#') != -1) {
      spcps[eval('' + tw)]=spcps[eval('' + tw)].replace(/\#/g,'');
      if (xwogf(tw).indexOf(' dragged to ') != -1) {
console.log('FALSE');
      return null; //false;
      } else {
console.log('TRUE');
      cw=eval('' + tw);
      for (kijk=0; kijk<spcps.length; kijk++) {
      spcps[eval('' + kijk)]=spcps[eval('' + kijk)].replace(/\#/g,'');
      }
      return true; //prompt(blb, bdef); //true;
      }
      } else {
      spcps[eval('' + tw)]+='#';
      }
    } else {
      opltlistt[eval('' + tw)]=eval('' + oplist[eval('' + tw)].screenTop);
      opltlistl[eval('' + tw)]=eval('' + oplist[eval('' + tw)].screenLeft);
      //spcps[eval('' + tw)]=spcps[eval('' + tw)].replace(/\#/g,'');
      spcps[eval('' + tw)]+='#';
      return null; //false;
console.log('False');
    }
console.log('false');
    spcps[eval('' + tw)]+='#';
    if (nullv) {
    nullv=null;
    cw=eval('' + tw);
      for (kijk=0; kijk<spcps.length; kijk++) {
      spcps[eval('' + kijk)]=spcps[eval('' + kijk)].replace(/\#/g,'');
      }
    return true; //prompt(blb, bdef); //true;
    }
    cw=eval('' + tw);
      for (kijk=0; kijk<spcps.length; kijk++) {
      spcps[eval('' + kijk)]=spcps[eval('' + kijk)].replace(/\#/g,'');
      }
    return true; //prompt(blb, bdef); //nullv; //false;
  }
  
  function wond(tw) {
    return true;
    //cw=eval('' + tw);
console.log('tw=' + tw);
    if (eval('' + oplist[eval('' + tw)].screenTop) == eval('' + opltlistt[eval('' + tw)]) && eval('' + oplist[eval('' + tw)].screenLeft) == eval('' + opltlistl[eval('' + tw)])) {
      if (spcps[eval('' + tw)].indexOf('##') != -1) {
      spcps[eval('' + tw)]=spcps[eval('' + tw)].replace('##','');
      if (xwogf(tw).indexOf(' dragged to ') != -1) {
console.log('FALSE');
      return false;
      } else {
console.log('TRUE');
      return true;
      }
      } else {
      spcps[eval('' + tw)]+='#';
      }
    } else {
      opltlistt[eval('' + tw)]=eval('' + oplist[eval('' + tw)].screenTop);
      opltlistl[eval('' + tw)]=eval('' + oplist[eval('' + tw)].screenLeft);
      spcps[eval('' + tw)]=spcps[eval('' + tw)].replace(/\#/g,'');
console.log('False');
    }
console.log('false');
    spcps[eval('' + tw)]+='#';
    return false;
  }
  
  function xwogf(xcw) {
    var sx='', nearest=-1;
    var minl=-1, mint=-1;
    if (eval('' + xcw) >= 0) {
     if (!oplist[eval('' + xcw)].closed) {
     sx=' (' + oplist[eval('' + xcw)].screenLeft + ',' + oplist[eval('' + xcw)].screenTop + ')';
     for (var kijk=0; kijk<spcps.length; kijk++) {
       if (!oplist[kijk].closed) {
       if (eval('' + kijk) != eval('' + xcw)) {
       if (minl < 0) {
        mint=Math.abs(eval(oplist[eval('' + xcw)].screenTop - opltlistt[kijk]));
        minl=Math.abs(eval(oplist[eval('' + xcw)].screenLeft - opltlistl[kijk]));
        sx+=' [' + opltlistt[kijk] + ';' + opltlistl[kijk] + '] ';
        nearest=kijk;
       } else if (eval(eval('' + mint) + eval('' + minl)) > eval(Math.abs(eval(oplist[eval('' + xcw)].screenTop - opltlistt[kijk])) + Math.abs(eval(oplist[eval('' + xcw)].screenLeft - opltlistl[kijk])))   ) {
        nearest=kijk;
        mint=Math.abs(eval(oplist[eval('' + xcw)].screenTop - opltlistt[kijk]));
        minl=Math.abs(eval(oplist[eval('' + xcw)].screenLeft - opltlistl[kijk]));
       }
       }
       }
     }
     if (lastdrag.indexOf(',' + xcw + ',' + nearest + ',') == -1 && eval('' + nearest) != eval('' + xcw) && Math.abs(eval('' + minl) + eval('' + mint)) < 10 && eval('' + nearest) != -1) {
       sx+=' ... dragged to ' + nearest;
       lastdrag=',' + xcw + ',' + nearest + ',' + xcw + ','; 
       //oplist[eval('' + nearest)].focus();
       //oplist[eval('' + cw)].blur();
       oplist[eval('' + xcw)].close();
       if (!nominal_numplayers) {
       defstyle=defstyle.replace(cards[donelist[eval('' + xcw)]].split('#')[0].split('gif')[0], cards[donelist[eval('' + xcw)]].split('#')[0].split('gif')[0] + 'JUNK');
       document.head.innerHTML+=bpmore(defstyle);
       }
     }
     console.log(xcw + sx);
     }
    }
    return '' + xcw + sx;
  }
  
  function closeit(ikl) {
       if (!nominal_numplayers) {
       defstyle=defstyle.replace(cards[eval('' + ikl)].split('#')[0].split('gif')[0], cards[eval('' + ikl)].split('#')[0].split('gif')[0] + 'JUNK');
       document.head.innerHTML+=bpmore(defstyle);
       }
  }
  
  function wogf() {
    var sx='', nearest=-1;
    var minl=-1, mint=-1;
    if (eval('' + cw) >= 0) {
     if (!oplist[eval('' + cw)].closed) {
     sx=' (' + oplist[eval('' + cw)].screenLeft + ',' + oplist[eval('' + cw)].screenTop + ')';
     for (var kijk=0; kijk<spcps.length; kijk++) {
       if (!oplist[kijk].closed) {
       if (eval('' + kijk) != eval('' + cw)) {
       if (minl < 0) {
        mint=Math.abs(eval(oplist[eval('' + cw)].screenTop - opltlistt[kijk]));
        minl=Math.abs(eval(oplist[eval('' + cw)].screenLeft - opltlistl[kijk]));
        sx+=' [' + opltlistt[kijk] + ';' + opltlistl[kijk] + '] ';
        nearest=kijk;
       } else if (eval(eval('' + mint) + eval('' + minl)) > eval(Math.abs(eval(oplist[eval('' + cw)].screenTop - opltlistt[kijk])) + Math.abs(eval(oplist[eval('' + cw)].screenLeft - opltlistl[kijk])))   ) {
        nearest=kijk;
        mint=Math.abs(eval(oplist[eval('' + cw)].screenTop - opltlistt[kijk]));
        minl=Math.abs(eval(oplist[eval('' + cw)].screenLeft - opltlistl[kijk]));
       }
       }
       }
     }
     if (lastdrag.indexOf(',' + cw + ',' + nearest + ',') == -1 && eval('' + nearest) != eval('' + cw) && Math.abs(eval('' + minl) + eval('' + mint)) < 10 && eval('' + nearest) != -1) {
       sx+=' ... dragged to ' + nearest;
       lastdrag=',' + cw + ',' + nearest + ',' + cw + ','; 
       //oplist[eval('' + nearest)].focus();
       //oplist[eval('' + cw)].blur();
       oplist[eval('' + cw)].close();
       if (!nominal_numplayers) {
       defstyle=defstyle.replace(cards[donelist[eval('' + cw)]].split('#')[0].split('gif')[0], cards[donelist[eval('' + cw)]].split('#')[0].split('gif')[0] + 'JUNK');
       document.head.innerHTML+=bpmore(defstyle);
       }
     }
     console.log(cw + sx);
     }
    }
    return '' + cw + sx;
  }
  
  function reputwas() {
    documenttitleeq(wastitle);
  }
  
  function reassess() {
      var retv='', ewq;
      var retcols=[];
      var ir=0;
      if (window.localStorage) {
        try {
          retv=('' + window.localStorage.getItem('cards_usefocus_local')).replace(/^null$/g,'');
          console.log('localStorage=' + retv);
          if (retv != '' && retv != retv.replace(/^undefined/g,'')) { 
            window.localStorage.removeItem('cards_usefocus_local');
          } else if (retv != '' && retv == retv.replace(/^undefined/g,'')) { 
            //alert('0:' + retv);
            retcols=decodeURIComponent(retv).split('~');
            sq=[];
            asq=[];
            for (ir=0; ir<retcols.length; ir++) {
              sq.push(retcols[ir].split('?!')[0] + '?');
              asq.push(retcols[ir].split('?!')[1]);
              nomap=false;
              given='';
            }
            return;
          }
        } catch(ewq) {
        }
      }
      if (window.sessionStorage) {
        try {
          retv=('' + window.sessionStorage.getItem('cards_usefocus_session')).replace(/^null$/g,'');
          console.log('sessionStorage=' + retv);
          if (retv != '' && retv != retv.replace(/^undefined/g,'')) { 
            window.sessionStorage.removeItem('cards_usefocus_session');
          } else if (retv != '' && retv == retv.replace(/^undefined/g,'')) { 
            //alert('1:' + retv);
            retcols=decodeURIComponent(retv).split('~');
            sq=[];
            asq=[];
            for (ir=0; ir<retcols.length; ir++) {
              sq.push(retcols[ir].split('?')[0] + '?');
              asq.push(retcols[ir].split('?')[1]);
              nomap=false;
              given='';
            }
            return;
          }
        } catch(ewq) {
        }
      }
  }
  
  
  function assess(what) {
    var ewq, retv='';
    if (what.toLowerCase().indexOf('memor') == 0) {
      location.href=document.URL.split('?')[0].split('#')[0] + '?card_memories=y';
    }
    if (what.toLowerCase() == '?x') {
      sslistq=[];
      sslista=[];
      if (window.sessionStorage) {
        try {
          window.sessionStorage.removeItem('cards_usefocus_session');
        } catch(ewq) {
        }
        location.href=document.URL.split('#')[0].split('?')[0] + '?rand=' + Math.floor(Math.random() * 198765897); 
        return '';
      }
      return '';
    } else if (what.toLowerCase() == '?!x') {
      lslistq=[];
      lslista=[];
      if (window.localStorage) {
        try {
          window.localStorage.removeItem('cards_usefocus_local');
        } catch(ewq) {
        }
        location.href=document.URL.split('#')[0].split('?')[0] + '?rand=' + Math.floor(Math.random() * 198765897); 
        return '';
      }
      return '';
    } else if (what.toLowerCase().indexOf('?!') != -1) {
      if (what.toLowerCase() == '?!') { 
        location.href=document.URL.split('#')[0].split('?')[0] + '?rand=' + Math.floor(Math.random() * 198765897); 
        return '';
      }
      if (window.localStorage) {
      if (lslistq.length == 0) {
      lslistq.push(what.split('?!')[0]);
      lslista.push(what.split('?!')[1]);
      window.localStorage.setItem('cards_usefocus_local', encodeURIComponent(what));
      } else {
      lslistq.push(what.split('?!')[0]);
      lslista.push(what.split('?!')[1]);
      window.localStorage.setItem('cards_usefocus_local', window.localStorage.getItem('cards_usefocus_local') + encodeURIComponent('~' + what));
      }
      }
      return '';
    } else if (what.toLowerCase().indexOf('?') != -1) {
      if (what.toLowerCase() == '?') { 
        location.href=document.URL.split('#')[0].split('?')[0] + '?rand=' + Math.floor(Math.random() * 198765897); 
        return '';
      }
      if (window.sessionStorage) {
      if (sslistq.length == 0) {
      sslistq.push(what.split('?')[0]);
      sslista.push(what.split('?')[1]);
      window.sessionStorage.setItem('cards_usefocus_session', encodeURIComponent(what));
      } else {
      sslistq.push(what.split('?')[0]);
      sslista.push(what.split('?')[1]);
      window.sessionStorage.setItem('cards_usefocus_session', window.sessionStorage.getItem('cards_usefocus_session') + encodeURIComponent('~' + what));
      }
      }
      return '';
    } else {
      firstbit='';
      if (window.localStorage) {
        try {
          retv=('' + window.localStorage.getItem('cards_usefocus_local')).replace(/^null$/g,'');
          if (retv != '' && nomap) { location.href=document.URL.split('#')[0].split('?')[0] + '?rand=' + Math.floor(Math.random() * 198765897);  }
        } catch(ewq) {
        }
      }
      if (window.sessionStorage) {
        try {
          retv=('' + window.sessionStorage.getItem('cards_usefocus_session')).replace(/^null$/g,'');
          if (retv != '' && nomap) { location.href=document.URL.split('#')[0].split('?')[0] + '?rand=' + Math.floor(Math.random() * 198765897);  }
        } catch(ewq) {
        }
      }
    }
    return what;
  }
  
  function blurb() {
    if (wblurb == '  Hello Player 1' && theblurb == '  If you are player 2 rather than player 1 append space to your answer.') {
      theblurb='';
      wblurb='';
    }
    var twf=theblurb + wblurb + firstbit;
    return twf;
  }
  
  function getnum() {
    return numplayers;
  }
  
  function examinescore() {
    var zs='';
    var dolater=false;
    var incscore=0; incgoes=1;
    var dts=[];
    if (documenttitle.indexOf('/') == -1) { 
      documenttitleeq(wastitle);
      dts=wastitle.split('/');
    } else {
      dts=documenttitle.split('/');
    }
    if ((force || documenttitle.indexOf(':') == -1) && dts.length != 1) {
    if (force) { force=false; }
    dts[1]=dts[1].split(' ')[0].split('.')[0];
    dts[0]=dts[0].split('.')[0];
    if (wblurb == '  Hello Player 1' && theblurb == '  If you are player 2 rather than player 1 append space to your answer.') {
      theblurb='';
      wblurb='';
      curplayer=1;
    }
    if (overallgoes == 2 && numplayers == 1) {
      theblurb='';
      wblurb='';
      curplayer=1;
    }
    if (overallgoes == 2 && dts[0].indexOf(' ') == -1 && theblurb == '  If you are player 2 rather than player 1 append space to your answer.') {
      theblurb='';
      wblurb='';
      curplayer=1;
    }
    if (dts[0] != clastscore) { // || dts[1] != clastgoes) {
      overallgoes++;  // 4 numplayers is 2
      if (theblurb != '' && dts[0].indexOf(' ') == -1) {
        curplayer=1;
        wblurb='  Hello Player ' + eval(1 + eval(overallgoes % numplayers)) + '.'; // + zs;
        theblurb='';
        dolater=true; //lastgoes[0]++;
      } else if (dts[0].indexOf(' ') == -1 && eval(overallgoes % numplayers) == 1 && numplayers != 1) {
        curplayer=1;
        dolater=true; //lastgoes[0]++;
      }
      if (1 == 1) { //dts[0].trim() != ('' + lastscore[eval(-1 + curplayer)])) {
        if (dts[0].trim() != lastdts0.trim()) { incscore++; }
        //if (dts[0].indexOf(' ') == -1 && dts[0].trim() != lastdts0.trim()) { lastscore[eval(-1 + curplayer)]+=incscore;  }
        //if (dts[0].indexOf(' ') == -1 && dts[0].trim() != lastdts0.trim()) { lastscore[eval(-1 + lastcurplayer)]+=incscore;  }
        if (dts[0].indexOf(' ') == -1 && dts[0].trim() != lastdts0.trim()) { lastscore[eval(eval(-1 + overallgoes) % numplayers)]+=incscore;  }
        if (curplayer != 1 && 1 == 7) { lastgoes[eval(numplayers - 1 + eval(overallgoes % numplayers))]++; }
        if (dts[0].trim() != lastdts0.trim()) { overallscore++; }
      } else {
        if (curplayer != 1 && 1 == 7) { lastgoes[eval(numplayers - 1 + eval(overallgoes % numplayers))]++; }
      }
      if (dts[0].indexOf(' ') != -1) {
        numplayers++;
        //alert('new player');
        lastscore.push(incscore);
        curplayer=numplayers; //eval(1 + eval(overallgoes % numplayers));
        if (curplayer == 1 && eval(1 + eval(overallgoes % numplayers)) == 1) {
        lastgoes.push(eval(1 + lastgoes[0]));
        } else {
        lastgoes.push(lastgoes[0]);
        }
        theblurb='  If you are player ' + eval(1 + numplayers) + ' rather than player 1 append space to your answer.'; // + zs;
      } else if (numplayers == 1 && overallgoes == 1) {
        theblurb='  If you are player 2 rather than player 1 append space to your answer.'; // + zs;
      } else if (numplayers == 1 && overallgoes > 1) {
        theblurb=''; //'  If you are player 2 rather than player 1 append space to your answer.'; // + zs;
      } else if (theblurb != '') {
        theblurb='  If you are player ' + eval(1 + numplayers) + ' rather than player 1 append space to your answer.'; // + zs;
        curplayer=eval(0 + eval(overallgoes % numplayers));  // ?
        if (eval(1 + eval(overallgoes % numplayers)) == 1) {
          lastgoes[eval(-1 + numplayers)]=lastgoes[0];
        }
        if (numplayers != 1) { wblurb='  Hello Player ' + eval(1 + eval(overallgoes % numplayers)) + '.'; } // + zs;
        theblurb='';
      } else {
        curplayer=eval(1 + eval(overallgoes % numplayers));
        if (numplayers != 1) { wblurb='  Hello Player ' + eval(1 + eval(overallgoes % numplayers)) + '.'; } // + zs;
        theblurb='';
      }
    if (curplayer == 1) { // && eval(1 + eval(overallgoes % numplayers)) == 1) {
      //zs='!';
      lastgoes[0]++;
      dolater=false;
    }
    if (overallgoes == 2 && dts[0].indexOf(' ') == -1 && theblurb == '  If you are player 2 rather than player 1 append space to your answer.') {
      theblurb='';
      wblurb='';
      curplayer=1;
    }
    lastdts0=dts[0].trim();
    lastcurplayer=curplayer;
    } else if (dts[1] != clastgoes) {
      overallgoes++;
      if (curplayer != 1 && 1 == 7) { lastgoes[eval(numplayers - 1 + eval(overallgoes % numplayers))]++; }
      if (numplayers != 1) {
        curplayer=eval(0 + eval(overallgoes % numplayers));
        if (eval(1 + eval(overallgoes % numplayers)) == 1) {
          lastgoes[eval(-1 + numplayers)]=lastgoes[0];
        }
        if (numplayers != 1) { wblurb='  Hello Player ' + eval(1 + eval(overallgoes % numplayers)) + '.'; } // + zs;
        theblurb='';
      } else if (numplayers == 1 && overallgoes == 1) {
        theblurb='  If you are player 2 rather than player 1 append space to your answer.'; // + zs;
      } else if (numplayers == 1 && overallgoes > 1) {
        theblurb=''; //'  If you are player 2 rather than player 1 append space to your answer.'; // + zs;
      }
    if (curplayer == 1) { // && eval(1 + eval(overallgoes % numplayers)) == 1) {
      //zs='%';
      lastgoes[0]++;
      dolater=false;
    }
    lastdts0=dts[0].trim();
    lastcurplayer=curplayer;
    }
    clastscore=dts[0].trim();
    clastgoes=dts[1].trim();
    // 4/4 2:2/3:3
    if (numplayers != 1) {
    
    var cd=overallgoes;
    for (var qqiuy=0; qqiuy<numplayers; qqiuy++) {
    lastgoes[qqiuy]=0;
    }
    var icd=0;
    
    for (var ikn=0; ikn<overallgoes; ikn++) {
    lastgoes[icd]++;
    icd++;
    if (eval('' + icd) == eval('' + numplayers)) { icd = 0; }
    }
    
    //while (cd > 0) {
    //lastgoes[icd]++;
    //icd++;
    //if (icd == numplayers) { icd = 0; }
    //cd--;
    //}
    
    dolater=false;
    
    //if (eval(overallgoes % numplayers) == 0) {
    //lastgoes[0]=eval(overallgoes / numplayers);
    //}
    
    
    } 
    
    if (1 == 2) {
    if (eval(overallgoes % numplayers) == 0) {
    for (var qiuy=0; qiuy<=eval(-1 + numplayers); qiuy++) {
    lastgoes[qiuy]=lastgoes[0];
    }
    } else {
    for (var iuy=0; iuy<=eval(-1 + curplayer); iuy++) {
    lastgoes[iuy]=lastgoes[0];
    }
    }
    }
    
    //if (eval(overallgoes % numplayers) == 0 && numplayers != 1) {
    //lastgoes[eval(-1 + numplayers)]=lastgoes[0];
    //}
    if (dolater) { lastgoes[0]++; }
    if (numplayers > 1) {
      infill='' + lastscore[0] + '/' + lastgoes[0];
      for (var ijk=1; ijk<lastgoes.length; ijk++) {
        infill=infill.replace('/', ':' + lastscore[ijk] + '/') + ':' + lastgoes[ijk];
      }
      documenttitleeq('' + overallscore + '.' + psecs + '/' + overallgoes + '.' + secs + ' ' + infill + ' is User Score/Goes - RJM Programming - April, 2021 ' + stcprefix);
      wastitle=documenttitle;
    } else {
      documenttitleeq('' + overallscore + '.' + psecs + '/' + overallgoes + '.' + secs + ' is User: Score/Goes - RJM Programming - April, 2021 ' + stcprefix);
      wastitle=documenttitle;
    }
    }
  }
  
  function dothis(inthing) {
    stcprefix=String.fromCodePoint(eval('' + defstcp));
    documenttitleeq(String.fromCodePoint(eval('' + defstcp))); //'🂾';
      
    document.head.innerHTML+=bpmore(defstyle); //"<style> html { background-color: yellow; font-size: 36px; background: URL('//www.rjmprogramming.com.au/rjmquiz_plus.jpg'); background-size: contain; } </style>";
  
    for (ij=0; ij<spcps.length; ij++) {
      if (spcps[ij].indexOf('' + eval(location.search.split('spcp=')[1] ? location.search.split('spcp=')[1].split('&')[0] : defstcp)) == 0) {
        ji=ij;
      }
    }
  
    if (ji >= 0) {  
      fi=document.createElement('link');
      fi.rel='icon';
      fi.href=cards[ji];
      document.head.appendChild(fi); 
      
    }
   
  }
  
  function blater() {
 if (1 == 2 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { 
   window.addEventListener('touchstart', function(evt) {
       evt.preventDefault();
       var touches = evt.changedTouches;
       //if (evt.touches) {
       if (touches[0].pageX) {
       iourx = touches[0].pageX;
       ioury = touches[0].pageY;
       } else if (touches[0].clientX) {
       iourx = touches[0].clientX;
       ioury = touches[0].clientY;
       }
       //alert('x:' + iourx);
       //}
       clickedmaybe();
      }, false);
 } else {
eles = document.querySelectorAll("*")
for (var ele of eles) {
  //console.log('yes well');
  if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { 
   ele.addEventListener('touchstart', function(evt) {
       evt.preventDefault();
       var touches = evt.changedTouches;
       //if (evt.touches) {
       if (touches[0].pageX) {
       iourx = touches[0].pageX;
       ioury = touches[0].pageY;
       } else if (touches[0].clientX) {
       iourx = touches[0].clientX;
       ioury = touches[0].clientY;
       }
       //alert('x:' + iourx);
       //}
       clickedmaybe();
      }, false);
   ele.addEventListener('touchmove', function(evt) {
       evt.preventDefault();
       var touches = evt.changedTouches;
       //if (evt.touches) {
       if (touches[0].pageX) {
       iourx = touches[0].pageX;
       ioury = touches[0].pageY;
       } else if (touches[0].clientX) {
       iourx = touches[0].clientX;
       ioury = touches[0].clientY;
       }
       //alert('x:' + iourx);
       //}
       clickedmaybe();
      }, false);
   ele.addEventListener('click', function(evt) {
       evt.preventDefault();
       var touches = evt.changedTouches;
       //if (evt.touches) {
       if (touches[0].pageX) {
       iourx = touches[0].pageX;
       ioury = touches[0].pageY;
       } else if (touches[0].clientX) {
       iourx = touches[0].clientX;
       ioury = touches[0].clientY;
       }
       //alert('x:' + iourx);
       //}
       ocp=evt.target;
       if (('' + iourx + ',' + ioury) == lastec && lastec != '' && notyet) {
         location.href=document.URL.split('?')[0].split('#')[0] + '?card_memories=y';
       } else if (lastec == '') {
         setTimeout(antilastec, 2000);
         setTimeout(antinotyet, 200);
         notyet=false;
         lastec='' + iourx + ',' + ioury;
       } else {
         setTimeout(antilastec, 2000);
         setTimeout(antinotyet, 200);
         notyet=false;
         lastec='' + iourx + ',' + ioury;
       }
       clickedmaybe();
      }, false);
  } else {
  ele.addEventListener('click', function(evt) {
       if (evt.touches) {
       if (evt.touches[0].pageX) {
       iourx = evt.touches[0].pageX;
       ioury = evt.touches[0].pageY;
       } else {
       iourx = evt.touches[0].clientX;
       ioury = evt.touches[0].clientY;
       }
       //alert('' + iourx);
       } else if (evt.clientX) {
       iourx = evt.clientX; // - elemLeft;
       ioury = evt.clientY; // - elemLeft;
       } else if (!evt.touches) {
       iourx = evt.pageX; // - elemLeft;
       ioury = evt.pageX; // - elemLeft;
       }
       ocp=evt.target;
       if (('' + iourx + ',' + ioury) == lastec && lastec != '' && notyet) {
         location.href=document.URL.split('?')[0].split('#')[0] + '?card_memories=y';
       } else if (lastec == '') {
         setTimeout(antilastec, 2000);
         setTimeout(antinotyet, 200);
         notyet=false;
         lastec='' + iourx + ',' + ioury;
       } else {
         setTimeout(antilastec, 2000);
         setTimeout(antinotyet, 200);
         notyet=false;
         lastec='' + iourx + ',' + ioury;
       }
       clickedmaybe();
    //alert('here');
  });
  ele.addEventListener('dblclick', function(evt) {
     location.href=document.URL.split('?')[0].split('#')[0] + '?card_memories=y';
  });
  }
}
  }
  }
  
  function secsu() {
    var ewd;
    if (eval('' + secs) == 0) {
      if ((nominal_numplayers || document.URL.indexOf('onewindow=') != -1) || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
        flexible=false;
      } else {
        flexible=true;
        //console.log('Flexible=T');
      }
      setTimeout(blater, 2500);
    }
    if (eval('' + overallgoes) < fiftytwo && eval('' + fiftytwo) > 0) { 
      secs++; 
    } else if (documenttitle.indexOf('Congratulations') == -1) {
      documenttitle+=' ... Congratulations!  End of Game!  Refresh webpage to try again.';
    }
    //if (sentanswer != '') {
    //  sentclick(); //alert('click ' + sentanswer + ' square');
    //  sentanswer='';
    //}
    var decs=documenttitle.split('.');
    if (eval('' + decs.length) >= 3) {
      documenttitleeq(documenttitle.replace('.' + decs[2].split(' ')[0] + ' ', '.' + secs + ' '));
    } else {
    ps=documenttitle.split('/')[0].trim(); 
    pg=documenttitle.split('/')[1].split(' ')[0]; 
    if (ps.indexOf('.') == -1 || pg.indexOf('.') == -1) {
    ps=eval('' + overallscore + '.' + psecs); //eval(documenttitle.split('/')[0].trim()); 
    pg=eval('' + overallgoes + '.' + secs); 
    documenttitleeq(documenttitle.replace(documenttitle.split(' ')[0], '' + overallscore + '.' + psecs + '/' + '' + overallgoes + '.' + secs));
    //console.log('documenttitle becomes ' + documenttitle);
    } else {
    ps=eval(ps);
    pg=eval(pg);
    }
    }
    
    if (flexible) {
      if (document.hasFocus()) {
        flexible=false;
        //console.log('Flexible=F');
        lastzkq='';
        lastzkl='';
        owidth=oowidth;
        oheight=ooheight;
        for (var igh=0; igh<oplist.length; igh++) {
          opltlistl[igh]=oopltlistl[igh];
          opltlistt[igh]=oopltlistt[igh];
          if (oplist[igh]) {
        //console.log('Flexible=F' + igh);
            if (!oplist[igh].closed) {
             try {
              oplist[igh].close();
              oplist[igh]=null;
             } catch(ewd) {
             }
            } else {
             oplist[igh]=null;
            }
          }
        }
      }
    }
    setTimeout(secsu,1000);
  }
  
  
  function listenout() {
         secs++;
         documenttitleeq('Listening for ' + secs + ' seconds ...');
         if (gd != '' && ma != '') {
         form = new FormData();
         xhr = new XMLHttpRequest();
         form.append('gamedate', gd);
         form.append('myanswer', ma);
         //alert('sending ma=' + ma + '!');
         xhr.open('post', document.URL.split('?')[0].split('#')[0].replace('.html','.php').replace('.htm','.php'), true);
         xhr.send(form);
         } else {
         if (!doesFileExist(listenforwhat)) {
         setTimeout(listenout, 5000);
         }
         }
  }
  
  if (gd != '' && ma != '') {
  if (1 == 1 || (eval('' + ma.length) >= 3 && eval('' + ma.length) <= 4)) {
  setTimeout(listenout,1000); 
  } else if (in_bidding) {
  
  if (ma.toLowerCase().indexOf('pass') == 0) {
    passcnt++;
    if (passcnt == 4) {
      in_bidding=false;
      curplayer=eval('' + cbidby);
      lastwinner=eval('' + cbidby);
    } else {
      bidplayer++;
      if (eval('' + bidplayer) == eval('' + nominal_numplayer)) {  bidplayer=1; } 
    }
  } else {
    passcnt=0;
    var thisbidrank=-1;
    for (var ibidis=0; ibidis<bids.length; ibidis++) {
      if (ma.substring(0,3).toLowerCase() == (bids[ibidis] + ' ').substring(0,3).toLowerCase()) {
        thisbidrank=ibidis;
        if (eval('' + thisbidrank) > eval('' + cbidrank)) {
          cbid=bids[ibidis];
          cbidby=eval('' + bidplayer);
          cbidrank=ibidis;
          bidplayer++;
          if (eval('' + bidplayer) == eval('' + nominal_numplayer)) {  bidplayer=1; } 
          
          curplayer=eval('' + bidplayer);
        }
        
        // send next
        var remote=false;
        if (eval('' + emailsms.length) >= eval('' + curplayer)) { 
        if (('' + emailsms[eval('' + curplayer)]).trim() != '') {
        remote=true;
        retcom(msuffs[eval(-1 + bidplayer)], rsuffs[eval(-1 + bidplayer)]);
        }
        }
        if (!remote) { ma=prompt('Player ' + bidplayer + ', what is your bid out of pass or [6-10][sdhcn] or mis ?'); if (ma == null) { ma="pass "; } else if (ma.toLowerCase().indexOf('mis') == 0) { ma='misere'; } else if (ma.toLowerCase().indexOf('open') == 0) { ma='open'; } location.href=document.URL.split('?')[0].split('#')[0].replace('.html','.php').replace('.htm','.php') + '?gamedate=' + encodeURIComponent(gd) + '&myanswer=' + encodeURIComponent(ma);     }
      }
    }
  }
  
  
  }
  } else if (1 == 11) {
  setInterval(secsu,1000); 
  }
  
</script>
</head>
</html>