<html>
<head>
<title>Experimental Drag and Drop - RJM Programming- July, 2023 ... thanks to https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData</title>
<meta charset="UTF-8"/>
<style>
th.source {
border: 1px solid transparent;
}
</style>
<script type=text/javascript>
var playerb='Black';
var playerw='White';
var clonedata='', clonedatatwo='', pos3=0, pos4=0, secs=0, score=0, tdid='', tdcheck=true;
var tdnum=location.search.split('tdnum=')[1] ? eval(location.search.split('tdnum=')[1].split('&')[0]) : 9;
var across=location.search.split('across=')[1] ? eval(location.search.split('across=')[1].split('&')[0]) : 3;
var twosubsfrom=['',''], twosubsto=['',''], onenewmove=[];
var trad='', idone='', idtwo='', gval='', idzero='';
var yesnod=true, iyesnod=0, previyesnod=0, noway=true;
var amove='';
if (document.URL.indexOf('/colo' + 'uring_in_was_number_gu' + 'essing_game.') != -1 && ('' + location.hash).indexOf('notice=') == -1) {
location.href='#notice=y';
}
if (document.URL.indexOf('traditional=') != -1) {
trad=decodeURIComponent(document.URL.split('traditional=')[1].split('&')[0]);
}
if (document.URL.indexOf('move=') != -1) {
amove=decodeURIComponent(document.URL.split('move=')[1].split('&')[0]);
}
var movefrom=-1, moveto=-1, nextmove=-1, mirroring=false;
var doverd=0, doverc=0, doverdone=false, lastdovercol='';
var dragh=false;
var sdone=false;
var sourceid='sou' + 'rce';
var shuffle=('' + location.hash + ' ' + location.search + ' ').split('shuffle=')[1] ? true : false;
var yourblurb=location.search.split('yourblurb=')[1] ? decodeURIComponent('' + location.hash + ' ' + location.search.split('yourblurb=')[1].split('&')[0]).replace(/\+/g,' ').replace(/\ \ \ /g,' + ') : '';
var sourcenum=location.search.split('sourcenum=')[1] ? Math.floor(eval(('' + location.search.split('sourcenum=')[1].split('&')[0]) + '.0')) : 1;
if ((document.URL.split('#')[0] + '&').indexOf('sourcenum=&') != -1 && sourcenum == 1) { sourcenum=0; }
var originalsn=sourcenum;
var originalsh=shuffle;
var origsnc='';
var bdone=false;
var lastbco=null;
var lastoh='', prevlastoh='', prevlastih='', prevtih='', lohfulloh='', newlohfulloh='';
var lastih='', loh='', lohoh='';
var lastevid='', bcklastid='';
var lastid='';
var prefx='th';
var itisthiscmove='', lastitisthiscmove=' ';
var fauxmove='';
if (document.URL.indexOf('draughts=') != -1) {
fauxmove=decodeURIComponent(document.URL.split('draughts=')[1].split('&')[0]);
if (fauxmove.trim() != '') {
itisthiscmove=fauxmove.substring(0,1).replace('w','B').replace('b','W').toLowerCase();
if (itisthiscmove == 'b') {
setTimeout(function(){ consolelog(playerb + ', it is your turn. '); }, 3000);
} else if (itisthiscmove == 'w') {
setTimeout(function(){ consolelog(playerw + ', it is your turn. '); }, 3000);
}
}
} else if (document.URL.indexOf('makyek=') != -1) {
fauxmove=decodeURIComponent(document.URL.split('makyek=')[1].split('&')[0]);
if (fauxmove.trim() != '') {
itisthiscmove=fauxmove.substring(0,1).replace('w','B').replace('b','W').toLowerCase();
if (itisthiscmove == 'b') {
setTimeout(function(){ consolelog(playerb + ', it is your turn. '); }, 3000);
} else if (itisthiscmove == 'w') {
setTimeout(function(){ consolelog(playerw + ', it is your turn. '); }, 3000);
}
}
}
var cpa=['bK','wK','bQ','wQ','bR1','wR1','bR2','wR2','bB1','wB1','bB2','wB2','bK1','wK1','bK2','wK2','bP1','wP1','bP2','wP2','bP3','wP3','bP4','wP4','bP5','wP5','bP6','wP6','bP7','wP7','bP8','wP8'];
var staidmap=[4,60,3,59,0,56,7,63, 2,58,5,61, 1,57,6,62, 8,48,9,49,10,50,11,51,12,52,13,53,14,54,15,55];
if (document.URL.indexOf(deq('draughts')) != -1) {
cpa=['bB1','wB1','bB2','wB2','bB3','wB3','bB4','wB4','bB5','wB5','bB6','wB6','bB7','wB7','bB8','wB8','bB9','wB9','bBv','wBv','bBu','wBu','bBt','wBt'];
staidmap=[1,56,3,58,5,60,7,62,8,49,10,51,12,53,14,55,17,40,19,42,21,44,23,46];
} else if (document.URL.indexOf(deq('makyek')) != -1) {
cpa=['bR1','wR1','bR2','wR2','bR3','wR3','bR4','wR4','bR5','wR5','bR6','wR6','bR7','wR7','bR8','wR8','bR9','wR9','bRr','wRr','bRs','wRs','bRt','wRt','bRu','wRu','bRv','wRv','bRx','wRx','bRy','wRy'];
staidmap=[0,56,1,57,2,58,3,59,4,60,5,61,6,62,7,63, 16,40,17,41,18,42,19,43,20,44,21,45,22,46,23,47];
}
var occupiedlist=',', qid='', qqid='';
var blackchecked=false, blackcheckmated=false;
var whitechecked=false, whitecheckmated=false;
var fouroh='', eightoh='', sixoh='', spanzero='', tdtte='';
var wwwtdtte='', wwtdtte='', wtdtte='', wsixoh='', spanfive='', ppt=false;
var domcmds=[];
var wastitle='';
var gev=null, hostid='', prelegal=true, cm='';
var lastmove='', waslastmove='';
var startboard='', endboard='';
var wstartsincheck=false, wendsincheck=false;
var bstartsincheck=false, bendsincheck=false;
var thissquare=-1;
var eightaround=[-1,-1,-1,-1,-1,-1,-1,-1,-1];
var isbad=false, iswrong=false;

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("");
}
}

// If you modify this array, also update default language / dialect below ... thanks to Google https://www.google.com/intl/en/chrome/demos/speech.html
var langs =
[['Afrikaans', ['af-ZA']],
['አማርኛ', ['am-ET']],
['Azərbaycanca', ['az-AZ']],
['বাংলা', ['bn-BD', 'বাংলাদেশ'],
['bn-IN', 'ভারত']],
['Bahasa Indonesia',['id-ID']],
['Bahasa Melayu', ['ms-MY']],
['Català', ['ca-ES']],
['Čeština', ['cs-CZ']],
['Dansk', ['da-DK']],
['Deutsch', ['de-DE']],
['English', ['en-AU', 'Australia'],
['en-CA', 'Canada'],
['en-IN', 'India'],
['en-KE', 'Kenya'],
['en-TZ', 'Tanzania'],
['en-GH', 'Ghana'],
['en-NZ', 'New Zealand'],
['en-NG', 'Nigeria'],
['en-ZA', 'South Africa'],
['en-PH', 'Philippines'],
['en-GB', 'United Kingdom'],
['en-US', 'United States']],
['Español', ['es-AR', 'Argentina'],
['es-BO', 'Bolivia'],
['es-CL', 'Chile'],
['es-CO', 'Colombia'],
['es-CR', 'Costa Rica'],
['es-EC', 'Ecuador'],
['es-SV', 'El Salvador'],
['es-ES', 'España'],
['es-US', 'Estados Unidos'],
['es-GT', 'Guatemala'],
['es-HN', 'Honduras'],
['es-MX', 'México'],
['es-NI', 'Nicaragua'],
['es-PA', 'Panamá'],
['es-PY', 'Paraguay'],
['es-PE', 'Perú'],
['es-PR', 'Puerto Rico'],
['es-DO', 'República Dominicana'],
['es-UY', 'Uruguay'],
['es-VE', 'Venezuela']],
['Euskara', ['eu-ES']],
['Filipino', ['fil-PH']],
['Français', ['fr-FR']],
['Basa Jawa', ['jv-ID']],
['Galego', ['gl-ES']],
['ગુજરાતી', ['gu-IN']],
['Hrvatski', ['hr-HR']],
['IsiZulu', ['zu-ZA']],
['Íslenska', ['is-IS']],
['Italiano', ['it-IT', 'Italia'],
['it-CH', 'Svizzera']],
['ಕನ್ನಡ', ['kn-IN']],
['ភាសាខ្មែរ', ['km-KH']],
['Latviešu', ['lv-LV']],
['Lietuvių', ['lt-LT']],
['മലയാളം', ['ml-IN']],
['मराठी', ['mr-IN']],
['Magyar', ['hu-HU']],
['ລາວ', ['lo-LA']],
['Nederlands', ['nl-NL']],
['नेपाली भाषा', ['ne-NP']],
['Norsk bokmål', ['nb-NO']],
['Polski', ['pl-PL']],
['Português', ['pt-BR', 'Brasil'],
['pt-PT', 'Portugal']],
['Română', ['ro-RO']],
['සිංහල', ['si-LK']],
['Slovenščina', ['sl-SI']],
['Basa Sunda', ['su-ID']],
['Slovenčina', ['sk-SK']],
['Suomi', ['fi-FI']],
['Svenska', ['sv-SE']],
['Kiswahili', ['sw-TZ', 'Tanzania'],
['sw-KE', 'Kenya']],
['ქართული', ['ka-GE']],
['Հայերեն', ['hy-AM']],
['தமிழ்', ['ta-IN', 'இந்தியா'],
['ta-SG', 'சிங்கப்பூர்'],
['ta-LK', 'இலங்கை'],
['ta-MY', 'மலேசியா']],
['తెలుగు', ['te-IN']],
['Tiếng Việt', ['vi-VN']],
['Türkçe', ['tr-TR']],
['اُردُو', ['ur-PK', 'پاکستان'],
['ur-IN', 'بھارت']],
['Ελληνικά', ['el-GR']],
['български', ['bg-BG']],
['Pусский', ['ru-RU']],
['Српски', ['sr-RS']],
['Українська', ['uk-UA']],
['한국어', ['ko-KR']],
['中文', ['cmn-Hans-CN', '普通话 (中国大陆)'],
['cmn-Hans-HK', '普通话 (香港)'],
['cmn-Hant-TW', '中文 (台灣)'],
['yue-Hant-HK', '粵語 (香港)']],
['日本語', ['ja-JP']],
['हिन्दी', ['hi-IN']],
['ภาษาไทย', ['th-TH']]];


function getdover() {
if (document.getElementById('dragoverdelay') && document.getElementById('dragovercountdown')) {
return doverc;
}
return 0;
}

function overdover() {
if (document.getElementById('dragoverdelay') && document.getElementById('dragovercountdown')) {
if (Math.abs(doverd) != eval('' + document.getElementById('dragoverdelay').value)) { doverd=eval('' + document.getElementById('dragoverdelay').value); }
if (doverc == 0 && eval('' + document.getElementById('dragovercountdown').value) == 0) { document.getElementById('source').opacity='0.5'; doverc=doverd; document.getElementById('dragovercountdown').value='' + doverc; document.getElementById('dragovercountdown').style.display='inline-block'; }
}
}

function dover() {
if (document.getElementById('dragoverdelay') && document.getElementById('dragovercountdown')) {
if (Math.abs(doverd) != eval('' + document.getElementById('dragoverdelay').value)) { doverd=eval('' + document.getElementById('dragoverdelay').value); }
if (doverc > 0) { doverc--; document.getElementById('dragovercountdown').value='' + doverc; if (1 == 3) { doverd=-doverd; } }
setTimeout(dover, 1000);
}
}

function thefauxencodeURIComponent(inbit) {
return inbit.toLowerCase().replace(String.fromCharCode(35), "").replace(".", "").replace(".", "").replace(".", "").replace("+", "").replace("+", "").replace("'", "").replace('%27','').replace(/\//g, "").replace(/,/g, "").replace("---","-").replace("---","-").replace(/--/g,"-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-");
}

function lsit() {
var sofarls='';
if (window.localStorage) {
if (('' + window.localStorage.getItem('eightbyeightplayers')).replace(/^null$/g,'').replace(/^undefined$/g,'') != '') {
if (('|' + decodeURIComponent(('' + window.localStorage.getItem('eightbyeightplayers'))) + '|').indexOf('|' + playerb.replace('(white)','').replace('(black)','').trim() + playerw.replace('(black)','').replace('(white)','').trim() + '|') == -1) {
sofarls=(('' + window.localStorage.getItem('eightbyeightplayers')));
window.localStorage.removeItem('eightbyeightplayers');
window.localStorage.setItem('eightbyeightplayers', sofarls + encodeURIComponent('|') + encodeURIComponent(playerb.replace('(white)','').replace('(black)','').trim() + playerw.replace('(black)','').replace('(white)','').trim()));
}
} else {
window.localStorage.setItem('eightbyeightplayers', encodeURIComponent(playerb.replace('(white)','').replace('(black)','').trim() + playerw.replace('(black)','').replace('(white)','').trim()));
}
}
}

function dsumsel() {
var bwsets=[], seloh='', iseloh=0;
if (document.getElementById('dsum') && document.URL.indexOf('/chess') != -1) {
if (document.getElementById('dsum').innerHTML == '') {
if (window.localStorage) {
if (('' + window.localStorage.getItem('eightbyeightplayers')).replace(/^null$/g,'').replace(/^undefined$/g,'') != '') {
bwsets=decodeURIComponent(('' + window.localStorage.getItem('eightbyeightplayers'))).split('|');
if (bwsets.length >= 1) {
seloh='<select style="font-size:8px;opacity:0.5;" onchange="if (this.value.trim().length != 0) { location.href=this.value; } else if (this.value.length != 0) { window.localStorage.removeItem(' + "'eightbyeightplayers'" + '); this.style.display=' + "'none'" + '; }" id=selo title="Stored past player name sets"><option value=""></option></select>';
for (iseloh=0; iseloh<bwsets.length; iseloh++) {
if (eval('' + bwsets[iseloh].split(']').length) >= 3) {
seloh=seloh.replace('</select>', '<option value="' + document.URL.split('/chess')[0] + '/chess_game.php?traditional=chess&bname=' + encodeURIComponent(bwsets[iseloh].split(']')[0] + ']') + '&wname=' + encodeURIComponent(bwsets[iseloh].split(']')[1] + ']') + '">Chess Game ' + bwsets[iseloh].split(']')[0] + '] versus ' + bwsets[iseloh].split(']')[1] + ']</option></select>');
seloh=seloh.replace('</select>', '<option value="' + document.URL.split('/chess')[0] + '/chess_game.php?traditional=draughts&bname=' + encodeURIComponent(bwsets[iseloh].split(']')[0] + ']') + '&wname=' + encodeURIComponent(bwsets[iseloh].split(']')[1] + ']') + '">Draughts Game ' + bwsets[iseloh].split(']')[0] + '] versus ' + bwsets[iseloh].split(']')[1] + ']</option></select>');
seloh=seloh.replace('</select>', '<option value="' + document.URL.split('/chess')[0] + '/chess_game.php?traditional=makyek&bname=' + encodeURIComponent(bwsets[iseloh].split(']')[0] + ']') + '&wname=' + encodeURIComponent(bwsets[iseloh].split(']')[1] + ']') + '">Mak-yek Game ' + bwsets[iseloh].split(']')[0] + '] versus ' + bwsets[iseloh].split(']')[1] + ']</option></select>');
}
seloh=seloh.replace('</select>', '<option value="' + document.URL.split('/chess')[0] + '/chess_game.php' + '">Game Options</option></select>');
seloh=seloh.replace('</select>', '<option value=" ">Forget Saved Player Names Above</option></select>');
}
document.getElementById('dsum').innerHTML=seloh;
}
}
}
}
}
}

function deq(inideais) {
if (document.URL.indexOf(inideais + '=') != -1) {
return inideais + '=';
} else if (document.URL.indexOf('=' + inideais) != -1) {
return '=' + inideais;
}
return "you'l" + "lnever#findth" + "is";
}

function anybw(asq, thebrd, bwenemy, alertallowed) {
thebrd+='&';
isbad=false;
iswrong=false;
var bwfriend=bwenemy.replace('w','!').replace('b','W').replace('!', 'b').toLowerCase();
var okfornow=true, startat=eval('' + asq), twos=[];
var startrow=Math.floor(eval(-1 + asq) / 8);
var startcol=Math.floor(eval(-1 + asq) % 8);
var lastcol=-1, lastrow=-1;
var kposa=[18,-18,17,-17,15,-15,6,-6,10,10];
var pposa=[9,7];
var kgposa=[9,8,7,-1,1,-7,-8,-9];
var ikposa=0;
if (asq == thissquare) {
asq=asq;
}
if (bwfriend == 'w') {
pposa=[-9,-7];
}

//alert('Checking ' + bwfriend + ' King at ' + asq);

// Horizontal check
startat=eval(-1 + asq);
while (startat >= 1 && startat <= 64 && startrow == Math.floor(eval(-1 + startat) / 8)) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(1);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(2);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(3);
return asq;
}
}
}
startat--;
}
startat=eval(1 + asq);
while (startat >= 1 && startat <= 64 && startrow == Math.floor(eval(-1 + startat) / 8)) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(11);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(12);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(13);
return asq;
}
}
}
startat++;
}

// Vertical check
startat=eval(-8 + asq);
while (startat >= 1 && startat <= 64 && startcol == Math.floor(eval(-1 + startat) % 8)) {
//alert('startat=_' + startat);
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(21);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(22);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(23);
return asq;
}
}
}
startat-=8;
}
startat=eval(8 + asq);
while (startat >= 1 && startat <= 64 && startcol == Math.floor(eval(-1 + startat) % 8)) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(24);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(25);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {
isbad=true;
//alert(26);
return asq;
}
}
}
startat+=8;
}

// Diagonal check
lastcol=Math.floor(eval(-1 + asq) % 8);
lastrow=Math.floor(eval(-1 + asq) / 8);
startat=eval(-9 + asq);
while (startat >= 1 && startat <= 64 && Math.abs(lastcol - Math.floor(eval(-1 + startat) % 8)) == 1 && Math.abs(lastrow - Math.floor(eval(-1 + startat) / 8)) == 1) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert('31 ' + bwfriend + ' ' + twos[0].slice(-3) + ' ' + startat + ' ' + asq);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(32);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(33);
return asq;
}
}
}
lastcol=Math.floor(eval(-1 + startat) % 8);
lastrow=Math.floor(eval(-1 + startat) / 8);
startat-=9;
}
lastcol=Math.floor(eval(-1 + asq) % 8);
lastrow=Math.floor(eval(-1 + asq) / 8);
startat=eval(-7 + asq);
while (startat >= 1 && startat <= 64 && Math.abs(lastcol - Math.floor(eval(-1 + startat) % 8)) == 1 && Math.abs(lastrow - Math.floor(eval(-1 + startat) / 8)) == 1) { // && startcol == Math.floor(eval(-1 + startat) % 8)) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(41);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(42);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(43);
return asq;
}
}
}
lastcol=Math.floor(eval(-1 + startat) % 8);
lastrow=Math.floor(eval(-1 + startat) / 8);
startat-=7;
}
lastcol=Math.floor(eval(-1 + asq) % 8);
lastrow=Math.floor(eval(-1 + asq) / 8);
startat=eval(9 + asq);
while (startat >= 1 && startat <= 64 && Math.abs(lastcol - Math.floor(eval(-1 + startat) % 8)) == 1 && Math.abs(lastrow - Math.floor(eval(-1 + startat) / 8)) == 1) { // && startcol == Math.floor(eval(-1 + startat) % 8)) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(44);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(45);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(46);
return asq;
}
}
}
lastcol=Math.floor(eval(-1 + startat) % 8);
lastrow=Math.floor(eval(-1 + startat) / 8);
startat+=9;
}
lastcol=Math.floor(eval(-1 + asq) % 8);
lastrow=Math.floor(eval(-1 + asq) / 8);
startat=eval(7 + asq);
while (startat >= 1 && startat <= 64 && Math.abs(lastcol - Math.floor(eval(-1 + startat) % 8)) == 1 && Math.abs(lastrow - Math.floor(eval(-1 + startat) / 8)) == 1) { // && startcol == Math.floor(eval(-1 + startat) % 8)) {
//alert('checking square ' + startat);
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(51);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(52);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
break;
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) {
isbad=true;
//alert(53);
return asq;
}
}
}
lastcol=Math.floor(eval(-1 + startat) % 8);
lastrow=Math.floor(eval(-1 + startat) / 8);
startat+=7;
}

// Knight check
for (ikposa=0; ikposa<kposa.length; ikposa++) {
startat=eval(kposa[ikposa] + asq);
if (startat >= 1 && startat <= 64 && startrow != Math.floor(eval(-1 + startat) / 8) && startcol != Math.floor(eval(-1 + startat) % 8)) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('K1') != -1 || twos[0].slice(-3).indexOf('K2') != -1) {
isbad=true;
//alert(61);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('K1') != -1 || twos[0].slice(-3).indexOf('K2') != -1) {
isbad=true;
//alert(62);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('K1') != -1 || twos[0].slice(-3).indexOf('K2') != -1) {
isbad=true;
//alert(63);
return asq;
}
}
}
}
}

// Pawn check
for (ikposa=0; ikposa<pposa.length; ikposa++) {
startat=eval(pposa[ikposa] + asq);
if (startat >= 1 && startat <= 64 && startrow != Math.floor(eval(-1 + startat) / 8) && startcol != Math.floor(eval(-1 + startat) % 8)) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('P') != -1) {
isbad=true;
//alert(71);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('P') != -1) {
isbad=true;
//alert(72);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('P') != -1) {
isbad=true;
//alert(73);
return asq;
}
}
}
}
}

// King too near King check
for (ikgposa=0; ikgposa<kgposa.length; ikgposa++) {
startat=eval(kgposa[ikgposa] + asq);
//alert('startat=' + startat + ' and asq=' + asq + ' ' + thebrd);
if (startat >= 1 && startat <= 64) { // && startrow != Math.floor(eval(-1 + startat) / 8) && startcol != Math.floor(eval(-1 + startat) % 8)) {
if (thebrd.indexOf('_' + startat + 'w') != -1) {
twos=thebrd.split('_' + startat + 'w');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('K') != -1 && twos[0].slice(-3).indexOf('K1') == -1 && twos[0].slice(-3).indexOf('K2') == -1) {
iswrong=true;
if (alertallowed) { alert('Kings can not be this close together.'); }
//alert(91);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + 'b') != -1) {
twos=thebrd.split('_' + startat + 'b');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('K') != -1 && twos[0].slice(-3).indexOf('K1') == -1 && twos[0].slice(-3).indexOf('K2') == -1) {
iswrong=true;
if (alertallowed) { alert('Kings can not be this close together.'); }
//alert(92);
return asq;
}
}
} else if (thebrd.indexOf('_' + startat + '&') != -1) {
twos=thebrd.split('_' + startat + '&');
if (twos[0].slice(-3).indexOf(bwfriend) != -1) {
twos[0]=twos[0];
} else if (twos[0].slice(-3).indexOf(bwenemy) != -1) {
if (twos[0].slice(-3).indexOf('K') != -1 && twos[0].slice(-3).indexOf('K1') == -1 && twos[0].slice(-3).indexOf('K2') == -1) {
iswrong=true;
if (alertallowed) { alert('Kings can not be this close together.'); }
//alert(93);
return asq;
}
}
}
}
}

return asq;
}

function wrtincheck(thepiece, theboard) {
//if (theboard.length < 70) { alert('endboard=' + endboard); }
thissquare=-1;
eightaround=[-1,-1,-1,-1,-1,-1,-1,-1,-1];
if (theboard.indexOf(thepiece + '_') == -1 && theboard.indexOf(thepiece.replace('w','!').replace('b','W').replace('!', 'b').toLowerCase() + '_') != -1) {
if (thepiece.substring(0,1) == 'w') {
wstartsincheck=true;
wendsincheck=true;
alert('Checkmate! Congratulations, ' + playerb);
return true;
} else {
bstartsincheck=true;
bendsincheck=true;
alert('Checkmate! Congratulations, ' + playerw);
return true;
}
} else {
// Get this square and eight squares around
//alert('theboard=' + theboard + ' and thepiece=' + thepiece);
thissquare=eval('' + theboard.split(thepiece + '_')[1].split('b')[0].split('w')[0].split('&')[0]);
eightaround[0]=anybw(thissquare, theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
if (isbad && thepiece.substring(0,1) == 'w') {
consolelog(playerw + ', your King is in check.');
}
if (isbad && thepiece.substring(0,1) == 'b') {
consolelog(playerb + ', your King is in check.');
}
if (1 == 7) {
if (eval(-9 + thissquare) >= 1 && eval(-9 + thissquare) <= 64) {
eightaround[1]=anybw(eval(-9 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
}
if (eval(-8 + thissquare) >= 1 && eval(-8 + thissquare) <= 64) {
eightaround[2]=anybw(eval(-8 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
}
if (eval(-7 + thissquare) >= 1 && eval(-7 + thissquare) <= 64) {
eightaround[3]=anybw(eval(-7 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
}
if (eval(-1 + thissquare) >= 1 && eval(-1 + thissquare) <= 64) {
eightaround[4]=anybw(eval(-1 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
}
if (eval(1 + thissquare) >= 1 && eval(1 + thissquare) <= 64) {
eightaround[5]=anybw(eval(1 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
}
if (eval(7 + thissquare) >= 1 && eval(7 + thissquare) <= 64) {
eightaround[6]=anybw(eval(7 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
}
if (eval(8 + thissquare) >= 1 && eval(8 + thissquare) <= 64) {
eightaround[7]=anybw(eval(8 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
}
if (eval(9 + thissquare) >= 1 && eval(9 + thissquare) <= 64) {
eightaround[8]=anybw(eval(9 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false);
}
}
}
}

function checkstartcheck() {
var mbits=amove.split('_'), ppbits=[], prerepbit='', repbit='', tdso=[], itdso=0;
if (document.getElementById('fshare')) {
if (document.getElementById('fshare').innerHTML.indexOf('_') != -1) {
if (tradmove(trad + '&move=' + amove).indexOf('_') != -1) {
startboard=tradmove(trad + '&move=' + amove);
} else {
startboard=document.getElementById('fshare').href.split('&')[0] + '&';
}
if (startboard.indexOf('_') == -1) { startboard=document.getElementById('fshare').innerHTML; }
if (eval('' + mbits.length) >= 3) {
if (startboard.indexOf('_' + mbits[2] + 'w') != -1) {
ppbits=startboard.split('_' + mbits[2] + 'w');
repbit='_' + mbits[2] + 'w';
while (ppbits[0].slice(-1) != 'w' && ppbits[0].slice(-1) != 'b') {
prerepbit=ppbits[0].slice(-1) + prerepbit;
ppbits[0]=ppbits[0].substring(0, eval(-1 + eval('' + ppbits[0].length)));
}
prerepbit=ppbits[0].slice(-1) + prerepbit;
startboard=startboard.replace(prerepbit + repbit, 'w');
} else if (startboard.indexOf('_' + mbits[2] + 'b') != -1) {
ppbits=startboard.split('_' + mbits[2] + 'b');
repbit='_' + mbits[2] + 'b';
while (ppbits[0].slice(-1) != 'w' && ppbits[0].slice(-1) != 'b') {
prerepbit=ppbits[0].slice(-1) + prerepbit;
ppbits[0]=ppbits[0].substring(0, eval(-1 + eval('' + ppbits[0].length)));
}
prerepbit=ppbits[0].slice(-1) + prerepbit;
startboard=startboard.replace(prerepbit + repbit, 'b');
} else if (startboard.indexOf('_' + mbits[2] + '&') != -1) {
ppbits=startboard.split('_' + mbits[2] + '&');
repbit='_' + mbits[2] + '&';
while (ppbits[0].slice(-1) != 'w' && ppbits[0].slice(-1) != 'b') {
prerepbit=ppbits[0].slice(-1) + prerepbit;
ppbits[0]=ppbits[0].substring(0, eval(-1 + eval('' + ppbits[0].length)));
}
prerepbit=ppbits[0].slice(-1) + prerepbit;
startboard=startboard.replace(prerepbit + repbit, '&');
}
}
}
} else {
startboard='';
if (tradmove(trad + '&move=' + amove).indexOf('_') != -1) {
startboard=tradmove(trad + '&move=' + amove);
} else {
tdso=document.getElementsByTagName('td');
for (itdso=0; itdso<tdso.length; itdso++) {
if (tdso[itdso].outerHTML.indexOf(' data-square="') != -1 && tdso[itdso].outerHTML.indexOf(' data-piece="') != -1) {
startboard+=tdso[itdso].outerHTML.split(' data-piece="')[1].split('"')[0] + '_' + tdso[itdso].outerHTML.split(' data-square="')[1].split('"')[0];
}
}
}
if (document.getElementById('fnodz')) {
document.getElementById('fnodz').innerHTML+='<a id=fshare href="mailto:?subject=Chess&body=' + startboard + '" style=display:none;>' + startboard + '</a>';
}
}
if (startboard == '') {
if (tradmove(trad + '&move=' + amove).indexOf('_') != -1) {
startboard=tradmove(trad + '&move=' + amove);
} else {
for (var iix=0; iix<cpa.length; iix++) {
startboard+=cpa[iix] + '_' + eval(1 + staidmap[iix]);
}
}
startboard+='&';
if (document.getElementById('fshare')) {
document.getElementById('fshare').href='mailto:?subject=Chess&body=' + startboard;
document.getElementById('fshare').innerHTML=startboard;
} else if (document.getElementById('fnodz')) {
document.getElementById('fnodz').innerHTML+='<a id=fshare href="mailto:?subject=Chess&body=' + startboard + '" style=display:none;>' + startboard + '</a>';
}

}
if (document.URL.indexOf(deq('draughts')) == -1 && document.URL.indexOf(deq('makyek')) == -1) {
wstartsincheck=wrtincheck('wK', startboard);
bstartsincheck=wrtincheck('bK', startboard);
}

if (iswrong) {
alert('In a chess game the two Kings can not be this close');
}
}

function firstok(inm) {
if (document.URL.indexOf(deq('draughts')) != -1 || document.URL.indexOf(deq('makyek')) != -1) { return inm; }
if (inm == 'bP1_9_17') { return inm; }
if (inm == 'bP1_9_25') { return inm; }
if (inm == 'bP2_10_18') { return inm; }
if (inm == 'bP2_10_26') { return inm; }
if (inm == 'bP3_11_19') { return inm; }
if (inm == 'bP3_11_27') { return inm; }
if (inm == 'bP4_12_20') { return inm; }
if (inm == 'bP4_12_28') { return inm; }
if (inm == 'bP5_13_21') { return inm; }
if (inm == 'bP5_13_29') { return inm; }
if (inm == 'bP6_14_22') { return inm; }
if (inm == 'bP6_14_30') { return inm; }
if (inm == 'bP7_15_23') { return inm; }
if (inm == 'bP7_15_31') { return inm; }
if (inm == 'bP8_16_24') { return inm; }
if (inm == 'bP8_16_32') { return inm; }
if (inm == 'bK1_2_17') { return inm; } //if (inm == 'bK1_3_20') { return inm; }
if (inm == 'bK1_2_20') { return inm; } // if (inm == 'bK1_3_22') { return inm; }
if (inm == 'bK2_7_22') { return inm; } // if (inm == 'bK2_6_23') { return inm; }
if (inm == 'bK2_7_24') { return inm; } // if (inm == 'bK2_6_25') { return inm; }


if (inm == 'wK1_58_41') { return inm; } // if (inm == 'wK1_59_42') { return inm; }
if (inm == 'wK1_58_43') { return inm; } // if (inm == 'wK1_59_44') { return inm; }
if (inm == 'wK2_63_48') { return inm; } // if (inm == 'wK2_62_45') { return inm; }
if (inm == 'wK2_63_46') { return inm; } // if (inm == 'wK2_62_47') { return inm; }
if (inm == 'wP1_49_41') { return inm; }
if (inm == 'wP1_49_33') { return inm; }
if (inm == 'wP2_50_42') { return inm; }
if (inm == 'wP2_50_34') { return inm; }
if (inm == 'wP3_51_43') { return inm; }
if (inm == 'wP3_51_35') { return inm; }
if (inm == 'wP4_52_44') { return inm; }
if (inm == 'wP4_52_36') { return inm; }
if (inm == 'wP5_53_45') { return inm; }
if (inm == 'wP5_53_37') { return inm; }
if (inm == 'wP6_54_46') { return inm; }
if (inm == 'wP6_54_38') { return inm; }
if (inm == 'wP7_55_47') { return inm; }
if (inm == 'wP7_55_39') { return inm; }
if (inm == 'wP8_56_48') { return inm; }
if (inm == 'wP8_56_40') { return inm; }
return '';
}

function tradmove(proposedtm) {
var outp=proposedtm, idoneoh='';
if (gval != '') { return gval; }
if (outp.indexOf('_') != -1 && outp.split('&')[0].indexOf('_') == -1) {
outp='';
for (var iix=0; iix<cpa.length; iix++) {
outp+=cpa[iix] + '_' + eval(1 + staidmap[iix]);
}
startboard=outp + '&';
endboard=outp + '&';
var mbits=amove.split('_'), ppbits=[], prerepbit='', repbit='';
if (eval('' + mbits.length) >= 3) {
if (2 == 12) {
lastmove=amove;
//amove='';
fixamove(lastmove);
consolelog('Chess piece ' + mbits[0] + ' moved from square ' + mbits[1] + ' to ' + mbits[2]);
} else {
if (amove != '') {
lastmove=firstok(amove);
if (lastmove != '') {
var tdsz=document.getElementsByTagName('td'), itdsz=0;
for (itdsz=0; itdsz<tdsz.length; itdsz++) {
if (tdsz[itdsz].outerHTML.indexOf(' data-square="' + mbits[1] + '"') != -1) {
idzero=tdsz[itdsz].id;
mbits[0]=mbits[0].substring(0,1).toLowerCase() + mbits[0].substring(1).substring(0,1).toUpperCase() + mbits[0].substring(2);
//alert(mbits[0] + ' ' + tdsz[itdsz].outerHTML);
if (tdsz[itdsz].outerHTML.indexOf(' data-piece="' + mbits[0] + '"') != -1) {
idone='' + tdsz[itdsz].outerHTML.split(' data-square="' + mbits[1] + '"')[1].split('>')[1].split(' id="')[1].split('"')[0];
idoneoh=document.getElementById(idone).outerHTML;
//alert('175 ' + idone);
//document.getElementById(idone).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
//domcmds.push("document.getElementById('" + idone + "').click();");
} else {
idone='' + tdsz[itdsz].id;
//alert('176 ' + idone);
//tdsz[itdsz].click();
//document.getElementById(idone).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
//domcmds.push("document.getElementById('" + idone + "').click();");
}
}
}
for (itdsz=0; itdsz<tdsz.length; itdsz++) {
if (tdsz[itdsz].outerHTML.indexOf(' data-square="' + mbits[2] + '"') != -1) {
if (tdsz[itdsz].outerHTML.indexOf(' data-piece="') != -1) {
//alert(276);
idtwo='' + tdsz[itdsz].outerHTML.split(' data-square="' + mbits[2] + '"')[1].split('>')[1].split(' id="')[1].split('"')[0];
//document.getElementById(idtwo).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
domcmds.push("document.getElementById('" + idtwo + "').click();");
} else {
//alert(376);
idtwo='' + tdsz[itdsz].id;
if (idoneoh != '') {
document.getElementById(idzero).innerHTML='';
tdsz[itdsz].innerHTML=idoneoh;
if (amove != '') {
lastmove=amove;
document.getElementById('pstatus').setAttribute('data-decided', 'bw');
nextmove=eval('' + mbits[2]);
consolelog('Chess piece ' + mbits[0] + ' moved from square ' + mbits[1] + ' to square ' + mbits[2]);
//amove='';
fixamove(lastmove);
itisthiscmove=amove.substring(0,1).replace('b','!').replace('w','B').replace('!','W').toLowerCase();
}
}
//tdsz[itdsz].click();
//document.getElementById(idtwo).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
//domcmds.push("document.getElementById('" + idone + "').click();");
}
}
}
}
}
}
}
gval=outp + '&' + proposedtm.split('&')[1];
return outp + '&' + proposedtm.split('&')[1];
}
gval=outp;
return outp;
}

function fixabw(thebname, thewname) {
if (document.getElementById('fshare')) {
//alert('HeRe');
var mbits=amove.split('_'), ppbits=[], prerepbit='', repbit='';
if (eval('' + mbits.length) >= 3) {
//if (endboard.indexOf((mbits[0] + '_' + mbits[1])) == -1) { alert('prepostOOPS'); }
//if (document.getElementById('fshare').href.indexOf((mbits[0] + '_' + mbits[1])) == -1) { alert('preOOPS'); }
//if (document.getElementById('fshare').innerHTML.indexOf((mbits[0] + '_' + mbits[1])) == -1) { alert('apreOOPS'); }
//if (document.getElementById('fshare').href.indexOf(encodeURIComponent(mbits[0] + '_' + mbits[1])) == -1) { alert('bpreOOPS'); }
//alert(document.getElementById('fshare').href);
if (document.getElementById('fshare').href.indexOf('_' + mbits[2] + 'w') != -1) { //|| document.getElementById('fshare').href.indexOf('_' + mbits[2] + 'b') != -1document.getElementById('fshare').href.indexOf('_' + mbits[2] + '&') != -1) {
ppbits=document.getElementById('fshare').href.split('_' + mbits[2] + 'w');
repbit='_' + mbits[2] + 'w';
while (ppbits[0].slice(-1) != 'w' && ppbits[0].slice(-1) != 'b') {
prerepbit=ppbits[0].slice(-1) + prerepbit;
ppbits[0]=ppbits[0].substring(0, eval(-1 + eval('' + ppbits[0].length)));
}
prerepbit=ppbits[0].slice(-1) + prerepbit;
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(prerepbit + repbit, 'w');
} else if (document.getElementById('fshare').href.indexOf('_' + mbits[2] + 'b') != -1) { //|| document.getElementById('fshare').href.indexOf('_' + mbits[2] + 'b') != -1document.getElementById('fshare').href.indexOf('_' + mbits[2] + '&') != -1) {
ppbits=document.getElementById('fshare').href.split('_' + mbits[2] + 'b');
repbit='_' + mbits[2] + 'b';
while (ppbits[0].slice(-1) != 'w' && ppbits[0].slice(-1) != 'b') {
prerepbit=ppbits[0].slice(-1) + prerepbit;
ppbits[0]=ppbits[0].substring(0, eval(-1 + eval('' + ppbits[0].length)));
}
prerepbit=ppbits[0].slice(-1) + prerepbit;
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(prerepbit + repbit, 'b');
} else if (document.getElementById('fshare').href.indexOf('_' + mbits[2] + '&') != -1) { //|| document.getElementById('fshare').href.indexOf('_' + mbits[2] + 'b') != -1document.getElementById('fshare').href.indexOf('_' + mbits[2] + '&') != -1) {
ppbits=document.getElementById('fshare').href.split('_' + mbits[2] + '&');
repbit='_' + mbits[2] + '&';
while (ppbits[0].slice(-1) != 'w' && ppbits[0].slice(-1) != 'b') {
prerepbit=ppbits[0].slice(-1) + prerepbit;
ppbits[0]=ppbits[0].substring(0, eval(-1 + eval('' + ppbits[0].length)));
}
prerepbit=ppbits[0].slice(-1) + prerepbit;
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(prerepbit + repbit, '&');
}
//if (document.getElementById('fshare').href.indexOf((mbits[0] + '_' + mbits[1])) == -1) { alert('OOPS'); }
document.getElementById('fshare').href=document.getElementById('fshare').href.replace((mbits[0] + '_' + mbits[1]), (mbits[0] + '_' + mbits[2])).replace(/\+\(black\)\+\(black\)/g,'+(black)').replace(/\+\(white\)\+\(white\)/g,'+(white)').replace('wR_','wR1_');
if (startboard == '') {
startboard=document.getElementById('fshare').href; // new
//if (startboard.indexOf('bP2') == -1) { alert('OoPs'); }
//alert('sb=' + startboard);
}
}
if (decodeURIComponent(document.getElementById('fshare').href).indexOf('bname=' + encodeURIComponent(thebname)) == -1 && decodeURIComponent(document.getElementById('fshare').href).indexOf('bname=') != -1) {
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(encodeURIComponent('bname='), encodeURIComponent('bname=' + encodeURIComponent(thebname) + '&x=x')).replace('wR_','wR1_');
}
if (decodeURIComponent(document.getElementById('fshare').href).indexOf('wname=' + encodeURIComponent(thewname)) == -1 && decodeURIComponent(document.getElementById('fshare').href).indexOf('wname=') != -1) {
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(encodeURIComponent('wname='), encodeURIComponent('wname=' + encodeURIComponent(thewname) + '&x=x')).replace('wR_','wR1_');
}
if (startboard == '') {
if (tradmove(trad + '&move=' + amove).indexOf('_') != -1) {
startboard=tradmove(trad + '&move=' + amove);
} else {
for (var iix=0; iix<cpa.length; iix++) {
startboard+=cpa[iix] + '_' + eval(1 + staidmap[iix]);
}
}
startboard+='&';
if (document.getElementById('fshare')) {
document.getElementById('fshare').href='mailto:?subject=Chess&body=' + startboard;
document.getElementById('fshare').innerHTML=startboard;
} else if (document.getElementById('fnodz')) {
document.getElementById('fnodz').innerHTML+='<a id=fshare href="mailto:?subject=Chess&body=' + startboard + '" style=display:none;>' + startboard + '</a>';
}
endboard=startboard;

}
//alert('startboard=' + startboard);
if (endboard == '') {
if (tradmove(trad + '&move=' + amove).indexOf('_') != -1) {
endboard=tradmove(trad + '&move=' + amove);
//if (endboard.indexOf((mbits[0] + '_' + mbits[1])) == -1) { alert('qprepostOOPS'); } else { alert('good'); }
document.getElementById('fshare').innerHTML=endboard;
if (startboard == '') { startboard=endboard; }
}
}
if (document.getElementById('fshare')) {
if (endboard == '') {
endboard=document.getElementById('fshare').href.split('&')[0] + '&';
if (endboard.indexOf('_') == -1) { endboard=document.getElementById('fshare').innerHTML; }
if (startboard == '') { startboard=endboard; }
}
if (endboard.indexOf('_') == -1 && tradmove(trad + '&move=' + amove).indexOf('_') != -1) {
endboard=tradmove(trad + '&move=' + amove);
if (startboard == '') { startboard=endboard; }
}
//alert('Endboard=' + endboard);
if (document.URL.indexOf(deq('draughts')) == -1 && document.URL.indexOf(deq('makyek')) == -1) {
wendsincheck=wrtincheck('wK', endboard);
if (iswrong) { alert('Kings can not be this close.'); return ' '; }
if (isbad) { return 'w'; }
bendsincheck=wrtincheck('bK', endboard);
if (iswrong) { alert('Kings can not be this close.'); return ' '; }
if (isbad) { return 'b'; }
}
startboard=endboard;
}
}
return '';
}

function fixamove(proposedmove) {
var subjbit='';
var atrue=true, btrue='';
var wasfs='';
if (document.getElementById('fshare')) {
wasfs=document.getElementById('fshare').href;
}
if (document.getElementById('fshare') && twosubsfrom[0] != '' && eval('' + onenewmove.length) == 1 && proposedmove == '') {
//alert('567 ' + wasfs);
proposedmove=onenewmove[0];
var washref=document.getElementById('fshare').href;
if (twosubsfrom[0] == 'bR1') {
washref=washref.replace('bR1_1', 'bR1_4');
washref=washref.replace('bK_5', 'bK_2');
proposedmove='bK_2_3';
endboard=washref.replace('bK_2','bK_3');
} else if (twosubsfrom[0] == 'bR2') {
washref=washref.replace('bR2_8', 'bR2_6');
washref=washref.replace('bK_5', 'bK_8');
proposedmove='bK_8_7';
endboard=washref.replace('bK_8','bK_7');
} else if (twosubsfrom[0] == 'wR1') {
washref=washref.replace('wR1_57', 'wR1_60');
washref=washref.replace('wK_61', 'wK_58');
proposedmove='bK_58_59';
endboard=washref.replace('wK_58','wK_59');
} else if (twosubsfrom[0] == 'wR2') {
washref=washref.replace('wR2_64', 'wR2_62');
washref=washref.replace('wK_61', 'wK_64');
proposedmove='bK_64_63';
endboard=washref.replace('wK_64','wK_63');
}
onenewmove=[];
document.getElementById('fshare').href=washref;
//endboard=washref;
btrue=fixabw(playerb, playerw);
if (btrue != '') {
if (btrue == 'w' && proposedmove.substring(0,1) == 'w') {
onenewmove=[];
atrue=false;
consolelog(playerw + ', your King is in check with this move.');
ouralert(playerw + ', your King is in check with this move.');
if (wasfs != '') {
document.getElementById('fshare').href=wasfs;
endboard=startboard;
}
return atrue;
} else if (btrue == 'b' && proposedmove.substring(0,1) == 'b') {
onenewmove=[];
atrue=false;
consolelog(playerb + ', your King is in check with this move.');
ouralert(playerb + ', your King is in check with this move.');
if (wasfs != '') {
document.getElementById('fshare').href=wasfs;
endboard=startboard;
}
return atrue;
} else if (btrue == 'w' && proposedmove.substring(0,1) == 'b') {
consolelog(playerw + ', your King has been put into check.');
setTimeout(function(){ ouralert(playerw + ', your King has been put into check.'); }, 1000);
} else if (btrue == 'b' && proposedmove.substring(0,1) == 'w') {
consolelog(playerb + ', your King has been put into check.');
setTimeout(function(){ ouralert(playerb + ', your King has been put into check.'); }, 1000);
} else if (btrue == ' ') {
onenewmove=[];
atrue=false;
consolelog('This move has caused Kings to be too close together.');
ouralert('This move has caused Kings to be too close together.');
if (wasfs != '') {
document.getElementById('fshare').href=wasfs;
endboard=startboard;
}
return atrue;
}
}

twosubsfrom[0]='';
twosubsto[0]='';
}
if (document.getElementById('fshare') && proposedmove.trim() != '') {
//if (5 == 5) { endboard=document.getElementById('fshare').innerHTML; if (document.getElementById('fshare').href.indexOf(endboard) != -1) { alert('ouch '); } }
//alert('HeRE ' + proposedmove + ' ' + endboard);

var mbits=proposedmove.split('_');
if (endboard == '') {
if (tradmove(trad + '&move=' + amove).indexOf('_') != -1) {
endboard=tradmove(trad + '&move=' + amove);
}
endboard=document.getElementById('fshare').href;
}
//alert('proposedmove=' + proposedmove);
endboard=endboard.replace(encodeURIComponent(mbits[0] + '_' + mbits[1]), encodeURIComponent(mbits[0] + '_' + mbits[2])).replace((mbits[0] + '_' + mbits[1]), (mbits[0] + '_' + mbits[2]));
//startboard=endboard;
//alert('EndBoard=' + endboard + ' ' + document.getElementById('fshare').href);

btrue=fixabw(playerb, playerw);
if (btrue != '') {
if (btrue == 'w' && proposedmove.substring(0,1) == 'w') {
onenewmove=[];
atrue=false;
consolelog(playerw + ', your King is in check with this move.');
setTimeout(function(){ ouralert(playerw + ', your King is in check with this move.'); itisthiscmove='w'; }, 5000);
if (wasfs != '') {
document.getElementById('fshare').href=wasfs;
endboard=startboard;
}
return atrue;
} else if (btrue == 'b' && proposedmove.substring(0,1) == 'b') {
onenewmove=[];
atrue=false;
consolelog(playerb + ', your King is in check with this move.');
setTimeout(function(){ ouralert(playerb + ', your King is in check with this move.'); itisthiscmove='b'; }, 5000);
if (wasfs != '') {
document.getElementById('fshare').href=wasfs;
endboard=startboard;
}
return atrue;
} else if (btrue == 'w' && proposedmove.substring(0,1) == 'b') {
consolelog(playerw + ', your King has been put into check.');
setTimeout(function(){ ouralert(playerw + ', your King has been put into check.'); }, 5000);
} else if (btrue == 'b' && proposedmove.substring(0,1) == 'w') {
consolelog(playerb + ', your King has been put into check.');
setTimeout(function(){ ouralert(playerb + ', your King has been put into check.'); }, 5000);
} else if (btrue == ' ' && proposedmove.substring(0,1) == 'w') {
onenewmove=[];
atrue=false;
consolelog('This move has caused Kings to be too close together.');
setTimeout(function(){ ouralert('This move has caused Kings to be too close together.'); itisthiscmove='w'; }, 5000);
if (wasfs != '') {
document.getElementById('fshare').href=wasfs;
endboard=startboard;
}
return atrue;
} else if (btrue == ' ' && proposedmove.substring(0,1) == 'b') {
onenewmove=[];
atrue=false;
consolelog('This move has caused Kings to be too close together.');
setTimeout(function(){ ouralert('This move has caused Kings to be too close together.'); itisthiscmove='b'; }, 5000);
if (wasfs != '') {
document.getElementById('fshare').href=wasfs;
endboard=startboard;
}
return atrue;
}
}

//alert(amove + ' vs ' + proposedmove + ' 78 ' + document.getElementById('fshare').href + ' ' + document.getElementById('pstatus').innerHTML);
if (amove == proposedmove && amove.substring(0,1) == 'w') {
setTimeout(function(){ document.getElementById('pstatus').innerHTML=(document.getElementById('pstatus').innerHTML.replace(' Your next move ' + playerb,'') + ' Your next move ' + playerb).replace(/\ \.\.\.\ \.\.\.\ /g,' ...'); }, 2500);
} else if (amove == proposedmove && amove.substring(0,1) == 'b') {
setTimeout(function(){ document.getElementById('pstatus').innerHTML=(document.getElementById('pstatus').innerHTML.replace(' Your next move ' + playerw,'') + ' Your next move ' + playerw).replace(/\ \.\.\.\ \.\.\.\ /g,' ...'); }, 2500);
}
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(/\&$/g, encodeURIComponent('&move='));
if (amove == proposedmove) {
var wrd1='youllneverfindthis';
var wrd2='';
var mmbits=amove.split('_');
if (document.getElementById('fshare').href.indexOf('_' + mmbits[2] + 'w') != -1) {
wrd1=(document.getElementById('fshare').href.split('_' + mmbits[2] + 'w')[0].slice(-3) + '_' + mmbits[2]).replace(/^[0-9]/g,'');
} else if (document.getElementById('fshare').href.indexOf('_' + mmbits[2] + 'b') != -1) {
wrd1=(document.getElementById('fshare').href.split('_' + mmbits[2] + 'b')[0].slice(-3) + '_' + mmbits[2]).replace(/^[0-9]/g,'');
} else if ((document.getElementById('fshare').href + '&').indexOf('_' + mmbits[2] + '&') != -1) {
wrd1=((document.getElementById('fshare').href + '&').split('_' + mmbits[2] + '&')[0].slice(-3) + '_' + mmbits[2]).replace(/^[0-9]/g,'');
}
//if (document.getElementById('fshare').href.indexOf(mmbits[0] + '_' + mmbits[1]) == -1) {
//if (document.getElementById('fshare').href.indexOf(mmbits[0] + '_' + mmbits[2]) != -1) {
// alert('oh');
//}
// alert('oops');
//}
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(wrd1,wrd2).replace(mmbits[0] + '_' + mmbits[1], mmbits[0] + '_' + mmbits[2]);
endboard=document.getElementById('fshare').href;
//} else {
//alert(89);
// document.getElementById('fshare').href=document.getElementById('fshare').innerHTML; // new idea
}
if (amove != proposedmove && decodeURIComponent(document.getElementById('fshare').href).indexOf('move=' + proposedmove) == -1 && decodeURIComponent(document.getElementById('fshare').href).indexOf('move=') != -1) {
//alert('178');
if (document.getElementById('fshare').href.indexOf(encodeURIComponent('&move=')) == -1) {
document.getElementById('fshare').href=document.getElementById('fshare').href.replace('&move=',encodeURIComponent('&wmoveas=')) + encodeURIComponent('&move=');
}
document.getElementById('fshare').href=document.getElementById('fshare').href.replace('&move=',encodeURIComponent('&wmoveas=')).replace(encodeURIComponent('move='), encodeURIComponent('move=' + proposedmove + '&x=x'));
if (document.getElementById('fshare').href.indexOf('body=') != -1 && document.getElementById('fshare').href.indexOf('body=' + encodeURIComponent(document.URL.split('?')[0])) == -1) {
document.getElementById('fshare').href=document.getElementById('fshare').href.replace('body=', 'body=' + encodeURIComponent(document.URL.split('?')[0] + '?wname=' + encodeURIComponent(playerw) + '&bname=' + encodeURIComponent(playerb) + '&traditional='));
}
//alert(document.getElementById('fshare').href);

subjbit=document.getElementById('fshare').href.split('&body=')[1];
//if (eval('' + mbits.length) >= 3) {
// subjbit=subjbit.replace(encodeURIComponent(mbits[0] + '_' + mbits[1]), encodeURIComponent(mbits[0] + '_' + mbits[2]));
//}
if (proposedmove.substring(0,1) == 'w') {
if (playerb.indexOf('[') != -1 && playerb.indexOf('[]') == -1) {
if (playerb.split('[')[1].split(']')[0].indexOf('@') != -1) {
document.getElementById('fshare').href='mailto:' + playerb.split('[')[1].split(']')[0] + '?subject=Chess%20Game&body=' + subjbit.replace(/\ /g,encodeURIComponent('+'));
//alert(document.getElementById('fshare').href);
//if (document.getElementById('fshare').href.indexOf('bP2') == -1) { alert('OoPs1'); }
checkxx(document.getElementById('fshare')).click();
setTimeout(function(){ alert('Email readied for ' + playerb.split('[')[1].split(']')[0]); }, 15000);
} else {
document.getElementById('fshare').href='sms:' + playerb.split('[')[1].split(']')[0] + '&body=' + subjbit.replace(/\ /g,encodeURIComponent('+'));
//alert(document.getElementById('fshare').href);
//if (document.getElementById('fshare').href.indexOf('bP2') == -1) { alert('OoPs2'); }
checkxx(document.getElementById('fshare')).click();
setTimeout(function(){ alert('SMS readied for ' + playerb.split('[')[1].split(']')[0]); }, 15000);
}
}
} else if (proposedmove.substring(0,1) == 'b') {
if (playerw.indexOf('[') != -1 && playerw.indexOf('[]') == -1) {
if (playerw.split('[')[1].split(']')[0].indexOf('@') != -1) {
document.getElementById('fshare').href='mailto:' + playerw.split('[')[1].split(']')[0] + '?subject=Chess%20Game&body=' + subjbit.replace(/\ /g,encodeURIComponent('+'));
//alert(document.getElementById('fshare').href);
//if (document.getElementById('fshare').href.indexOf('bP2') == -1) { alert('OoPs3'); }
checkxx(document.getElementById('fshare')).click();
setTimeout(function(){ alert('Email readied for ' + playerw.split('[')[1].split(']')[0]); }, 15000);
} else {
document.getElementById('fshare').href='sms:' + playerw.split('[')[1].split(']')[0] + '&body=' + subjbit.replace(/\ /g,encodeURIComponent('+'));
//alert(document.getElementById('fshare').href);
//if (document.getElementById('fshare').href.indexOf('bP2') == -1) { alert('OoPs4'); }
checkxx(document.getElementById('fshare')).click();
setTimeout(function(){ alert('SMS readied for ' + playerw.split('[')[1].split(']')[0]); }, 15000);
}
}
}
}
}
return atrue;
}

function checkxx(ina) {
var inas=ina.href.split('&x=x'), opiece='', ineas='';
var inase=ina.href.split(encodeURIComponent('&x=x'));
if (inas.length != 1) {
opiece=(amove + ina.href.split('&x=x')[eval(-1 + ina.href.split('&x=x').length)].split('&')[0]).split('_')[0];
if (opiece != '') {
//alert(65);
if (inas[0].indexOf(opiece) == -1) {
//alert(165);
var tos=document.getElementById('mytable').innerHTML.split(' data-piece="' + opiece + '"');
if (tos.length != 1) {
//alert(265);
var newsq=tos[0].split(' data-square="')[eval(-1 + tos[0].split(' data-square="').length)].split('"')[0];
//alert(ina.href);
ina.href=ina.href.replace(encodeURIComponent('traditional='), encodeURIComponent('traditional=' + opiece + '_' + newsq)).replace('traditional=', 'traditional=' + opiece + '_' + newsq);
}
}
}
inas=ina.href.split(('&x=x'));
ineas=(ina.href.replace(inas[0],'')).split(('&wname='))[0].split(('&bname='))[0].split(('&move='))[0];
if (ineas != '') { ina.href=ina.href.replace(ineas, '&x.x'); }
if (ina.href.split('body=')[1].indexOf((document.URL.replace('https:','http:').split('?')[0] + '?traditional=')) > 0) {
ina.href=ina.href.replace((document.URL.replace('https:','http:').split('?')[0] + '?traditional='), '');
}
} else if (inase.length != 1) {
opiece=(amove + ina.href.split(encodeURIComponent('&x=x'))[eval(-1 + ina.href.split(encodeURIComponent('&x=x')).length)].split(encodeURIComponent('&'))[0]).split('_')[0];
if (opiece != '') {
//alert('465 ' + opiece);
if (inase[0].indexOf(opiece) == -1) {
//alert(1165);
var tos=document.getElementById('mytable').innerHTML.split(' data-piece="' + opiece + '"');
if (tos.length != 1) {
//alert(1265);
var newsq=tos[0].split(' data-square="')[eval(-1 + tos[0].split(' data-square="').length)].split('"')[0];
ina.href=ina.href.replace(encodeURIComponent('traditional='), encodeURIComponent('traditional=' + opiece + '_' + newsq)).replace('traditional=', 'traditional=' + opiece + '_' + newsq);
//alert(ina.href);
}
}
}
inase=ina.href.split(encodeURIComponent('&x='));
ineas=(ina.href.replace(inase[0],'')).split(encodeURIComponent('&wname='))[0].split(encodeURIComponent('&bname='))[0].split(encodeURIComponent('&move='))[0];
if (ineas != '') { ina.href=ina.href.replace(ineas, encodeURIComponent('&x=x')); }
if (ina.href.split('body=')[1].indexOf(encodeURIComponent(document.URL.replace('https:','http:').split('?')[0] + '?traditional=')) > 0) {
ina.href=ina.href.replace(encodeURIComponent(document.URL.replace('https:','http:').split('?')[0] + '?traditional='), '');
}
}
if (document.URL.indexOf(deq('draughts')) != -1) {
ina.href=ina.href.replace(/move/g, 'draughts').replace(/Chess/g, 'Draughts');
} else if (document.URL.indexOf(deq('makyek')) != -1) {
ina.href=ina.href.replace(/move/g, 'makyek').replace(/Chess/g, 'Mak-yek');
}
return ina;
}

function consolelog(what) {
if (document.URL.indexOf('/chess') != -1) {
if (what.indexOf('Chess piece ') != -1) {
if (what.indexOf(' from square ') != -1) {
if (what.indexOf(' square ') != -1) {
lastmove=what.split('Chess piece ')[1].split(' ')[0] + '_' + what.split('Chess piece ')[1].split(' from square ')[1].split(' ')[0] + '_' + what.split('Chess piece ')[1].split(' from square ')[1].split(' square ')[1].split(' ')[0];
}
}
}
if (document.getElementById('pstatus')) {
if (document.getElementById('pstatus').innerHTML.indexOf(' ... Your next move ') != -1) {
document.getElementById('pstatus').innerHTML=('Move just made by ' + document.getElementById('pstatus').innerHTML.split('Your next move ')[eval(-1 + document.getElementById('pstatus').innerHTML.split('Your next move ').length)] + ' ... ' + what).replace(/\ \(black\)\ \(black\)/g,' (black)').replace(/\ \(white\)\ \(white\)/g,' (white)');
} else {
document.getElementById('pstatus').innerHTML+=(' ... ' + what.split(' ... ')[0] + ' ... ').replace(/\ \(black\)\ \(black\)/g,' (black)').replace(/\ \(white\)\ \(white\)/g,' (white)');
}
}
}
if (document.URL.indexOf(deq('draughts')) != -1) {
document.getElementById('pstatus').innerHTML=document.getElementById('pstatus').innerHTML.replace(/Chess\ /g, 'Draughts ');
console.log(what.replace(/Chess\ /g, 'Draughts '));
} else if (document.URL.indexOf(deq('makyek')) != -1) {
document.getElementById('pstatus').innerHTML=document.getElementById('pstatus').innerHTML.replace(/Chess\ /g, 'Mak-yek ');
console.log(what.replace(/Chess\ /g, 'Mak-yek '));
} else {
console.log(what);
}
}

function ouralert(what) {
if (document.URL.indexOf('/chess') != -1) {
if (document.getElementById('pstatus')) {
if (document.getElementById('pstatus').innerHTML.indexOf(' ... ') != -1) {
if (document.getElementById('pstatus').innerHTML.indexOf(' ... Your next move ') != -1) {
document.getElementById('pstatus').innerHTML='Move just made by ' + document.getElementById('pstatus').innerHTML.split('Your next move ')[eval(-1 + document.getElementById('pstatus').innerHTML.split('Your next move ').length)] + ' ... ' + what;
} else {
document.getElementById('pstatus').innerHTML+=' ... ' + what.split(' ... ')[0] + ' ... ';
}
}
}
}
if (document.URL.indexOf(deq('draughts')) != -1) { return alert(what.replace(/Chess\ /g, 'Draughts ')); }
if (document.URL.indexOf(deq('makyek')) != -1) { return alert(what.replace(/Chess\ /g, 'Mak-yek ')); }
return alert(what);
}

function rerefit() {
document.title=wastitle;
}

function delayedrefit() {
refit(gev);
}

function refit(ev) {
var waspl=prelegal;
prelegal=true;
if (wastitle == '') { wastitle=document.title; }
//document.title=itisthiscmove + ' ' + ev.target.id + ' at refit';

//if (ev.target.id == 'mytable') { document.title='mytable'; return true; }

//alert(15643);
if (lastitisthiscmove != itisthiscmove && ev.target.id != 'mytable') {
//alert(5643);
ppt=false;
//document.title=itisthiscmove + ' ' + ev.target.id + ' 1 at refit';
if (itisthiscmove != '' && itisthiscmove != (ev.target.outerHTML.split(' data-piece="')[1]).substring(0,1)) {
if (waspl) { ouralert('It is not your turn.'); }
} else {
lastitisthiscmove=(itisthiscmove + ev.target.outerHTML.split(' data-piece="')[1]).substring(0,1);
itisthiscmove=lastitisthiscmove;
if (itisthiscmove == 'b') {
consolelog('Your next move ' + playerb + ' ... ');
} else {
consolelog('Your next move ' + playerw + ' ... ');
}
//ouralert('no1 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id);
if (ev.target.outerHTML.indexOf(' data-piece="') != -1) {
if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) == (itisthiscmove + ev.target.outerHTML.split(' data-piece="')[1].substring(0,1)).substring(0,1)) {
//document.title=itisthiscmove + ' ' + ev.target.id + ' 1.0 at refit';
lohfulloh=ev.target.outerHTML;
newlohfulloh=ev.target.outerHTML;
hostid=bigv(newlohfulloh).split(' id="')[1].split('"')[0];
lastid=ev.target.id;
}
}
}
} else if (newlohfulloh != ev.target.outerHTML && ev.target.id != 'mytable') {
//ouralert('yes0 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id);
lohfulloh=newlohfulloh;
//document.title=itisthiscmove + ' ' + ev.target.id + ' 2 at refit';
lastoh=newlohfulloh; //ev.target.outerHTML;
lastih='>' + newlohfulloh.split('</')[0].split('>')[eval(-1 + newlohfulloh.split('</')[0].split('>').length)] + '<'; //'>' + ev.target.innerHTML + '<';
console.log('yes ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id);
if (lohfulloh != '') {
console.log("lohfulloh=" + lohfulloh);
//ouralert('yes2 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id);
if (lohfulloh.indexOf(' data-piece="') != -1) {
//ouralert('yes3 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id);
if (ev.target.outerHTML.indexOf(' data-piece="') != -1 && ev.target.outerHTML != lohfulloh) {
//ouralert('yes4 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id);
if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) != lohfulloh.split(' data-piece="')[1].substring(0,1)) {
//ouralert('yes5 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id);
console.log('Potential piece take');
ppt=true;
}
}
}
}
lastid=ev.target.id;
bcklastid=lastid;
loh=ev.target.id;
lohoh=bigv(ev.target.outerHTML.split('>')[0] + '></' + ev.target.outerHTML.substring(1).split(' ')[0].split('>')[0] + '>');


console.log("Drop 3");
if (newlohfulloh.indexOf(' data-piece="' + itisthiscmove + 'R') != -1 && ev.target.outerHTML.indexOf(' data-piece="' + itisthiscmove + 'K') != -1) {
if (mightbecastling(ev.target.outerHTML.split(' data-piece="')[1].split('"')[0], newlohfulloh.split(' data-piece="')[1].split('"')[0], ev.target.outerHTML, newlohfulloh) == 1) {
prelegal=false;
}
} else if (newlohfulloh.indexOf(' data-piece="' + itisthiscmove + 'K') != -1 && ev.target.outerHTML.indexOf(' data-piece="' + itisthiscmove + 'R') != -1) {
if (mightbecastling(ev.target.outerHTML.split(' data-piece="')[1].split('"')[0], newlohfulloh.split(' data-piece="')[1].split('"')[0], ev.target.outerHTML, newlohfulloh) == 1) {
prelegal=false;
}
}

if (!prelegal) {
//ouralert('Illegal move ... please start again');
lastitisthiscmove = itisthiscmove + ' ';
//ouralert(lastitisthiscmove + '!');
hostid='';
} else if (islegal()) {
//alert(5645);
if (hostid != '') {
document.getElementById(hostid).innerHTML='';
} else {
document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(newlohfulloh, '');
}
gev=ev;
setTimeout(gevit,1500); //ev.target.innerHTML=newlohfulloh;
//itisthiscmove=itisthiscmove.replace('w','B').replace('b','W').toLowerCase();
lastitisthiscmove = itisthiscmove + ' ';
hostid='';
} else {
if (waspl) { ouralert('Illegal move ... please start again'); }
lastitisthiscmove = itisthiscmove + ' ';
hostid='';
}


// }
}
setTimeout(rerefit, 3000);
}

function gevit() {
gev.target.innerHTML=newlohfulloh;
if (document.getElementById(newlohfulloh.split(' id="')[1].split('"')[0])) {
adddrop(newlohfulloh.split(' id="')[1].split('"')[0]);
}
//ouralert('' + gev.target.id + '=' + newlohfulloh);
newlohfulloh='';
lastitisthiscmove = itisthiscmove + ' ';
}

function dodoms() {
var stopit=false, dolook=false;
if (playerb == 'Black' && playerw == 'White') {
dolook=true;
}

if (document.getElementById('span4') && fouroh == '') { fouroh=document.getElementById('span4').outerHTML; }
if (document.getElementById('span5') && wsixoh == '') { wsixoh=document.getElementById('span5').outerHTML; }
if (document.getElementById('span6') && sixoh == '') { sixoh=document.getElementById('span6').outerHTML; }
if (document.getElementById('span0') && spanzero == '') { spanzero=document.getElementById('span0').outerHTML; }
if (document.getElementById('span1') && spanfive == '') { spanfive=document.getElementById('span1').outerHTML; }
if (document.getElementById('td22') && tdtte == '') { tdtte=document.getElementById('td22').outerHTML.split('>')[0] + '></td>'; }
if (document.getElementById('td211') && wtdtte == '') { wtdtte=document.getElementById('td211').outerHTML.split('>')[0] + '></td>'; }
if (document.getElementById('td193') && wwtdtte == '') { wwtdtte=document.getElementById('td193').outerHTML.split('>')[0] + '></td>'; }
if (document.getElementById('td11') && wwwtdtte == '') { wwwtdtte=document.getElementById('td11').outerHTML.split('>')[0] + '></td>'; }

if (nextmove != -1) {
var tds=document.getElementsByTagName('td');
for (var itds=0; itds<tds.length; itds++) {
if (tds[itds].outerHTML.indexOf(' data-square="' + nextmove + '"') != -1) {
if (tds[itds].innerHTML.indexOf('</span>') != -1) {
document.getElementById(tds[itds].innerHTML.split(' id="')[1].split('"')[0]).click();
} else {
tds[itds].click();
}
}
}
nextmove=-1;
}

if (document.getElementById('pstatus')) {
if (document.getElementById('pblack')) {
if (('' + document.getElementById('pblack').innerText) != '') {
playerb=document.getElementById('pblack').innerText;
}
}
if (document.getElementById('pwhite')) {
if (('' + document.getElementById('pwhite').innerText) != '') {
playerw=document.getElementById('pwhite').innerText;
}
}
if (dolook && playerb.indexOf('[') != -1 && playerb.indexOf('[]') == -1 && playerw.indexOf('[') != -1 && playerw.indexOf('[]') == -1) {
lsit();
}

if (eval('' + ('' + document.getElementById('pstatus').getAttribute('data-decided')).replace(/^null$/g,'').replace(/^undefined$/g,'').length) == 2) {
if (document.getElementById('pblack')) {
document.getElementById('pblack').style.display='none';
}
if (document.getElementById('pwhite')) {
document.getElementById('pwhite').style.display='none';
}
if (document.getElementById('pvs')) {
document.getElementById('pvs').style.display='none';
}
if (playerb != 'Black' && playerb.indexOf('(black)') == -1) {
playerb+=' (black)';
}
if (playerw != 'White' && playerw.indexOf('(white)') == -1) {
playerw+=' (white)';
}
fixabw(playerb, playerw);
document.getElementById('pstatus').setAttribute('data-decided', document.getElementById('pstatus').getAttribute('data-decided') + ' ');
}

if (eval('' + ('' + document.getElementById('pstatus').getAttribute('data-decided')).replace(/^null$/g,'').replace(/^undefined$/g,'').length) == 3) {
if (document.getElementById('pstatus').innerText == '') {
document.getElementById('pstatus').innerHTML='Welcome to the Chess Game between ' + playerb + ' (black) and ' + playerw + ' (white).';
}
document.getElementById('pstatus').setAttribute('data-decided', document.getElementById('pstatus').getAttribute('data-decided') + ' ');
}

if (eval('' + ('' + document.getElementById('pstatus').getAttribute('data-decided')).replace(/^null$/g,'').replace(/^undefined$/g,'').length) == 4) {
if (itisthiscmove != '') {
if (itisthiscmove == 'b') {
document.getElementById('pstatus').setAttribute('data-decided', document.getElementById('pstatus').getAttribute('data-decided') + ' ');
if (playerb.indexOf(']') == -1) { document.getElementById('pstatus').innerHTML='Your first move ' + playerb + ' ... '; }
} else {
document.getElementById('pstatus').setAttribute('data-decided', document.getElementById('pstatus').getAttribute('data-decided') + ' ');
if (playerw.indexOf(']') == -1) { document.getElementById('pstatus').innerHTML='Your first move ' + playerw + ' ... '; }
}
} else if (lastoh.indexOf(' data-piece="') != -1) {
if (lastoh.indexOf(' data-piece="b') != -1) {
document.getElementById('pstatus').setAttribute('data-decided', document.getElementById('pstatus').getAttribute('data-decided') + ' ');
if (playerb.indexOf(']') == -1) { document.getElementById('pstatus').innerHTML='Your first move ' + playerb + ' ... '; }
} else {
document.getElementById('pstatus').setAttribute('data-decided', document.getElementById('pstatus').getAttribute('data-decided') + ' ');
if (playerw.indexOf(']') == -1) { document.getElementById('pstatus').innerHTML='Your first move ' + playerw + ' ... '; }
}
}
}

if (eval('' + ('' + document.getElementById('pstatus').getAttribute('data-decided')).replace(/^null$/g,'').replace(/^undefined$/g,'').length) == 5) {
}
}
for (var ikj=0; ikj<domcmds.length; ikj++) {
if (!stopit && domcmds[ikj] != '') {
stopit=true;
//if (prompt(domcmds[ikj], domcmds[ikj])) {
//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
// var huh=prompt(domcmds[ikj], domcmds[ikj]);
//}
if (document.URL.indexOf('/chess') != -1) {
eval(domcmds[ikj]);
//rejig();
}
//}
domcmds[ikj]='';

}
}
//domcmds=[];
setTimeout(dodoms, 1000);
}

function innards(inele) {
var outele=inele;
if (inele.indexOf('<span') > 0) {
outele='<span' + inele.split('</span>')[0].split('<span')[eval(-1 + inele.split('</span>')[0].split('<span').length)] + '</span>';
}
//ouralert('innards:' + outele);
return outele;
}

function adddrop(inelid) {
document.getElementById(inelid).addEventListener("drop", (ev) => {
console.log("Drop 1");
if (!document.getElementById('ddcolour')) {
if (lohfulloh != '') {
console.log("lohfulloh=" + lohfulloh);
if (lohfulloh.indexOf(' data-piece="') != -1) {
if (ev.target.outerHTML.indexOf(' data-piece="') != -1 && ev.target.outerHTML != lohfulloh) {
if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) != lohfulloh.split(' data-piece="')[1].substring(0,1)) {
console.log('Potential piece take');
ppt=true;
}
}
}
}
loh=ev.target.id;
lohoh=bigv(ev.target.outerHTML.split('>')[0] + '></' + ev.target.outerHTML.substring(1).split(' ')[0].split('>')[0] + '>');
//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
// document.title='ev.preventDefault(); //1';
//}
ev.preventDefault();
// Get the data, which is the id of the source element
const data = ev.dataTransfer.getData("text");
const source = document.getElementById(data);

console.log('' + ev.target.id);
if (!document.getElementById('callback')) {
lastevid=ev.target.id;
//ouralert(lastevid);
//ev.target.setAttribute('draggable', true);
if (lastoh == '') {
//ouralert('suspicious ' + document.getElementById(sourceid).outerHTML);
lastoh=ev.target.outerHTML;
lastih='>' + ev.target.innerHTML + '<';
lastid=ev.target.id;
} else if (prefx == 'span') {
if (lastid.indexOf(' ') != -1) {
lastid=lastid.trim();
} else {
lastid=ev.target.id;
}
}
if (document.URL.indexOf('/chess') != -1) {
setTimeout(lastohit, 1000);
if (('' + ev.target.style.backgroundColor).indexOf(',0.6') != -1 || ('' + ev.target.style.backgroundColor).indexOf(',0.5') != -1) {
//ouralert('564 ' + ev.target.getAttribute('data-square'));
ev.target.style.filter='invert(1)';
ev.target.style.backgroundColor='rgba(255,255,255,0.6)';
}
}
if (('' + ev.target.id).substring(0,2) == 'td' && secs > 0 && document.URL.indexOf('/planet_') == -1) {
score+=eval(ev.target.innerHTML.substring(0,1));
}
} else if (document.getElementById('callback')) {
secs++;
if (('' + ev.target.getAttribute('data-answer')) == ('' + document.getElementById('source').getAttribute('data-answer')) || ('' + ev.target.getAttribute('data-answer')) == ('' + document.getElementById(sourceid).getAttribute('data-answer'))) {
score++;
document.getElementById('score').innerHTML='Score: ' + score + '/' + secs + '';
} else {
document.getElementById('score').innerHTML='Score: ' + score + '/' + secs + '';
if (document.URL.indexOf('rjmprogramming-com-au.translate.goog') != -1) {
var tdsare=document.getElementsByTagName('td');
for (var itdsare=0; itdsare<tdsare.length; itdsare++) {
if (('' + tdsare[itdsare].getAttribute('data-answer')).replace('null','').trim() != '') {
var zcais=tdsare[itdsare].innerText;
tdsare[itdsare].style.backgroundColor='lightgreen';
if (6 == 6) {
if (6 == 6) {
tdsare[itdsare].innerHTML=tdsare[itdsare].innerHTML.replace(zcais, zcais + ' ✔');
} else {
tdsare[itdsare].innerHTML+=' ✔';
}
}
ouralert('' + zcais + ' ' + String.fromCodePoint(10004));
}
}
} else {
if (document.getElementById('source').outerHTML.indexOf('<ta' + 'ble') == 0) {
ouralert(('Correct answer was ' + document.getElementById(sourceid).getAttribute('data-answer')).replace('null',''));
} else {
ouralert(('Correct answer was ' + document.getElementById('source').getAttribute('data-answer')).replace('null',''));
}
}
}
var secsmore='';
if (('' + document.URL + decodeURIComponent('' + location.hash)).indexOf('notice=') != -1 && ('' + decodeURIComponent('' + location.hash)).indexOf('no_tice=') == -1) { secsmore='¬ice=y'; }
if (document.URL.indexOf('rjmprogramming-com-au.translate.goog') != -1) {
location.href=document.URL.split('&score=')[0] + '&score=' + score + '&secs=' + secs + secsmore;
} else {
location.href=document.getElementById('callback').value + '?score=' + score + '&secs=' + secs + secsmore;
}
}
if (1 == 2) {
clonedatatwo=document.getElementById(sourceid).outerHTML;
document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(clonedatatwo, '');
ev.target.innerHTML=ev.target.innerHTML.substring(0,1) + clonedatatwo;
} else if (secs > 0 && (9 == 9 || ('' + ev.target.id).substring(0,2) == 'td')) {
if (source) { source.style.cursor='progress'; }
clonedatatwo=document.getElementById(sourceid).outerHTML;
andlater();
//document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(clonedatatwo, '');
//ev.target.innerHTML=ev.target.innerHTML.substring(0,1) + clonedatatwo;
//document.getElementById('target').appendChild(source);
if (('' + ev.target.id).substring(0,2) != 'td') {
document.getElementById('target').insertAdjacentHTML('beforeend', clonedatatwo);
} else {
if (source) { source.style.cursor='progress'; }
ev.target.insertAdjacentHTML('beforeend', clonedatatwo);
}
} else {
try {
ev.target.appendChild(source);
} catch(ers) { }
}

if (ev.touches) {
if (ev.touches[0].pageX) {
pos3 = ev.touches[0].pageX;
pos4 = ev.touches[0].pageY;
} else {
pos3 = ev.touches[0].clientX;
pos4 = ev.touches[0].clientY;
}
console.log('pos3 = ' + pos3 + ',pos4 = ' + pos4);
} else if (ev.clientX || ev.clientY) {
pos3 = ev.clientX;
pos4 = ev.clientY;
console.log('pos3 = ' + pos3 + ' ,pos4 = ' + pos4);
} else {
pos3 = ev.pageX;
pos4 = ev.pageY;
console.log('pos3 = ' + pos3 + ', pos4 = ' + pos4);
}
}
});
}

function bigv(inspan) {
var outspan=inspan;
if (inspan.trim().indexOf('<span') == 0 && document.getElementById('target').innerHTML.indexOf(inspan.split('>')[0]) != -1) {
outspan='<' + document.getElementById('target').innerHTML.split(inspan.split('>')[0])[0].split('<')[eval(-1 + document.getElementById('target').innerHTML.split(inspan.split('>')[0])[0].split('<').length)];
outspan+='</' + outspan.substring(1).split(' ')[0].split('>')[0] + '>';
//ouralert('Found ' + outspan);
} //else {
//ouralert('did not find ' + inspan);
//}
return outspan;
}

function bigabb(infind) {
var prefxz='';
var outfind=infind;
var lastchr=infind.slice(-1);
var firstlk=infind.split(lastchr)[0];
var vbits=document.getElementById('target').innerHTML.split(firstlk);
if (eval('' + vbits.length) > 1) {
prefxz='<' + document.getElementById('target').innerHTML.split(firstlk)[0].split('<')[eval(-1 + document.getElementById('target').innerHTML.split(firstlk)[0].split('<').length)];
outfind=prefxz + firstlk + vbits[1].split(lastchr)[0] + lastchr;
}
return outfind;
}

function abb(infind) {
var outfind=infind;
var lastchr=infind.slice(-1);
var firstlk=infind.split(lastchr)[0];
var vbits=document.getElementById('target').innerHTML.split(firstlk);
if (eval('' + vbits.length) > 1) {
outfind=firstlk + vbits[1].split(lastchr)[0] + lastchr;
}
return outfind;
}

function epy(thething, thelook) {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var theid=document.getElementById('mytable').innerHTML.split(thething)[0].split(' id="')[eval(-1 + document.getElementById('mytable').innerHTML.split(thething)[0].split(' id="').length)].split('"')[0];
var thenid='t' + document.getElementById('mytable').innerHTML.split(thelook.split('>')[0])[0].split(' id="t')[eval(-1 + document.getElementById('mytable').innerHTML.split(thelook.split('>')[0])[0].split(' id="t').length)].split('"')[0];
var ithing=innards(thething), thenum=-1, thetds=[], jnum=0, ijk=0;
if (thelook.indexOf(' data-square="') != -1) {
thenum=eval(thelook.split(' data-square="')[1].split('"')[0]);
thetds=document.getElementsByTagName('td');
for (ijk=0; ijk<thetds.length; ijk++) {
if (thetds[ijk].outerHTML.indexOf(' class="black"') != -1 || thetds[ijk].outerHTML.indexOf(' class="white"') != -1) { jnum++; }
if (jnum == thenum || thetds[ijk].outerHTML.indexOf(thelook.split('>')[0]) != -1) {
//ouralert(thenid + ' vs ' + thetds[ijk].id);
thenid=thetds[ijk].id;
if (thetds[ijk].outerHTML.indexOf(thelook.split('>')[0]) != -1) { jnum=-999; }
}
}
}
//ouralert("document.getElementById('" + theid + "').innerHTML=''; " + "document.getElementById('" + thenid + "').innerHTML='" + ithing + "'; ");
domcmds.push("document.getElementById('" + theid + "').innerHTML=''; ");
domcmds.push("document.getElementById('" + thenid + "').innerHTML='" + ithing + "'; ");
}
return thething;
}

function mightbecastling(pthispiece, potherpiece, pthisoh, potheroh) { // thanks to https://www.chessable.com/blog/how-to-castle-in-chess/
var pretval=0, delone='', deltwo='';
var bigih=document.getElementById('target').innerHTML;
var inpthisoh=pthisoh;
var inpotheroh=potheroh;
twosubsfrom[0]='';
if (inpthisoh.indexOf(' data-square="') == -1) {
inpthisoh='<td' + bigih.split(pthisoh)[0].split('<td')[eval(-1 + bigih.split(pthisoh)[0].split('<td').length)];
}
if (inpotheroh.indexOf(' data-square="') == -1) {
inpotheroh='<td' + bigih.split(potheroh)[0].split('<td')[eval(-1 + bigih.split(potheroh)[0].split('<td').length)];
}
if (pthispiece.substring(0,1) != potherpiece.substring(0,1)) { return -5; }
if ((pthispiece.substring(1).substring(0,1) == 'K' && eval('' + pthispiece.length) == 2) && (potherpiece.substring(1).substring(0,1) == 'R' && eval('' + potherpiece.length) == 3)) {
if (pthispiece.substring(0,1) == 'w' && inpthisoh.indexOf(' data-square="61"') != -1 && (inpotheroh.indexOf(' data-square="64"') != -1 || inpotheroh.indexOf(' data-square="57"') != -1)) {
pretval=1;
if (inpotheroh.indexOf(' data-square="57"') != -1 && (bigih.indexOf(abb(' data-square="58">') + '</') == -1 || bigih.indexOf(abb(' data-square="59">') + '</') == -1 || bigih.indexOf(abb(' data-square="60">') + '</') == -1)) {
pretval=-1;
} else if (inpotheroh.indexOf(' data-square="57"') != -1) { //newish
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(pthisoh,'').replace(potheroh,'');
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="60">') + '</', abb(' data-square="60">') + potheroh + '</').replace(abb(' data-square="59">') + '</', abb(' data-square="59">') + pthisoh + '</');

twosubsfrom[0] = 'wR1';

if (wwtdtte != '') { lohoh=wwtdtte; } //rmtwowk
//ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh));
bigih=bigih.replace(epy(pthisoh,' data-square="60">'),'').replace(epy(potheroh,' data-square="59">'),'');
if (bigih.indexOf(lohoh.split('</')[0]) != -1) { lohoh=''; } //else { ouralert('found'); }
//bigih=bigih.replace(abb(' data-square="59">') + '</span>', abb(' data-square="59">') + innards(potheroh) + '</span></td>' + bigv(lohoh).split('</td>')[0]);
bigih=bigih.replace(abb(' data-square="59">') + '</', abb(' data-square="59">') + innards(potheroh) + '</');
// + lohoh);
//ouralert('About to Castle1 the rook ' + abb(' data-square="60">') + innards(potheroh) + '</');
bigih=bigih.replace(bigabb(' data-square="60">') + '</', bigabb(' data-square="60">') + innards(pthisoh) + '</'); // + lohoh.split('</td>')[0]);
//ouralert('About to Castle2 ' + innards(potheroh));
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('target').innerHTML=bigih;
}
//ouralert('About to Castle22 ' + innards(potheroh));
//ouralert('About to Castle223');
if (wwtdtte != '') {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
domcmds.push("document.getElementById('td202').innerHTML='" + wsixoh + "'; ");
domcmds.push("document.getElementById('td203').innerHTML='" + spanfive + "'; ");
domcmds.push("document.getElementById('tr8').innerHTML='" + wwtdtte + "' + document.getElementById('tr8').innerHTML; itisthiscmove='b'; consolelog('Your next move ' + playerb + ' ... '); adddrop('" + lohoh.split(' id="')[1].split('"')[0] + "'); ");
}
}
if (lohoh != '') {
adddrop(lohoh.split(' id="')[1].split('"')[0]);
lohoh='';
}



}
if (inpotheroh.indexOf(' data-square="64"') != -1 && (bigih.indexOf(abb(' data-square="62">') + '</') == -1 || bigih.indexOf(abb(' data-square="63">') + '</') == -1)) {
//ouralert(bigih.split(' data-square="62"')[1].substring(0,40) + '*62');
//ouralert(bigih.split(' data-square="63"')[1].substring(0,40) + '*63');
pretval=-1;
} else if (inpotheroh.indexOf(' data-square="64"') != -1) { //new

twosubsfrom[0] = 'wR2';


//ouralert('About to Castle ' + lastoh);
bigih=bigih.replace(epy(pthisoh,' data-square="63">'),'').replace(epy(potheroh,' data-square="62">'),'');
//ouralert('About to Castle1 the rook ' + abb(' data-square="62">') + innards(potheroh) + '</');
bigih=bigih.replace(abb(' data-square="62">') + '</', abb(' data-square="62">') + innards(potheroh) + '</');
//ouralert('About to Castle12 the king ' + abb(' data-square="63">') + innards(pthisoh) + '</ ... ' + bigih.split(' data-square="63"')[1] + ' +++ ' + lohoh);
if (bigih.indexOf(lohoh.split('</')[0]) != -1) { lohoh=''; }
bigih=bigih.replace(abb(' data-square="63">') + '</td>', abb(' data-square="63">') + innards(pthisoh) + '</td>' + lohoh);
//ouralert('About to Castle2');
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('target').innerHTML=bigih;
}
//ouralert('About to Castle22');
if (lohoh != '') {
adddrop(lohoh.split(' id="')[1].split('"')[0]);
lohoh='';
}
}
}
if (pthispiece.substring(0,1) == 'b' && inpthisoh.indexOf(' data-square="5"') != -1 && (inpotheroh.indexOf(' data-square="8"') != -1 || inpotheroh.indexOf(' data-square="1"') != -1)) {
pretval=1;
if (inpotheroh.indexOf(' data-square="8"') != -1 && (bigih.indexOf(abb(' data-square="6">') + '</') == -1 || bigih.indexOf(abb(' data-square="7">') + '</') == -1)) {
pretval=-1;
} else if (inpotheroh.indexOf(' data-square="8"') != -1) { // new
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(pthisoh,'').replace(potheroh,'');
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="6">') + '</', abb(' data-square="6">') + pthisoh + '</').replace(abb(' data-square="7">') + '</', abb(' data-square="7">') + potheroh + '</');
twosubsfrom[0] = 'bR2';

//if (eightoh != '') { lohoh=eightoh; }
//ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh));

bigih=bigih.replace(epy(pthisoh, ' data-square="7">'),'').replace(epy(potheroh, ' data-square="6">'),'');
//ouralert('About to Castle1 the rook ' + abb(' data-square="6">') + innards(potheroh) + '</');
bigih=bigih.replace(abb(' data-square="6">') + '</', abb(' data-square="6">') + innards(potheroh) + '</');
//ouralert('About to Castle12 the king ' + abb(' data-square="7">') + innards(pthisoh) + '</ ... ' + bigih.split(' data-square="7"')[1] + ' +++ ' + lohoh);
if (bigih.indexOf(lohoh.split('</')[0]) != -1) { lohoh=''; } //else { ouralert('found'); }
//if (bigih.indexOf(abb(' data-square="7">') + '</') == -1) {
// ouralert('Not found ' + bigabb(' data-square="7">') + '</');
//} else {
// ouralert(' ... ' + bigv(lohoh));
//}
//bigih=bigih.replace(abb(' data-square="7">') + '</span>', abb(' data-square="7">') + innards(pthisoh) + '</span></td>' + bigv(lohoh).split('</td>')[0]);
bigih=bigih.replace(abb(' data-square="7">') + '</', abb(' data-square="7">') + innards(pthisoh) + '</');
// + lohoh);
//ouralert('About to Castle2 ' + innards(pthisoh));
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('target').innerHTML=bigih;
}
if (eightoh != '') {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//domcmds.push("document.getElementById('td23').innerHTML='" + innards(potheroh) + "'; ");
//domcmds.push("document.getElementById('td31').innerHTML='" + innards(pthisoh) + "'; ");
//domcmds.push("document.getElementById('td32').innerHTML=''; ");
eightoh=eightoh;
} else {
document.getElementById('tr1').innerHTML+=eightoh;
document.getElementById('td31').innerHTML=innards(pthisoh);
domcmds.push("document.getElementById('td31').innerHTML='" + innards(pthisoh) + "'; ");
}
}
//ouralert('About to Castle22 ' + innards(pthisoh));
//document.getElementById('td31').innerHTML=innards(pthisoh);
//ouralert('About to Castle223');
if (lohoh != '') {
adddrop(lohoh.split(' id="')[1].split('"')[0]);
lohoh='';
}



}
if (inpotheroh.indexOf(' data-square="1"') != -1 && (bigih.indexOf(abb(' data-square="4">') + '</') == -1 || bigih.indexOf(abb(' data-square="2">') + '</') == -1 || bigih.indexOf(abb(' data-square="3">') + '</') == -1)) {
pretval=-1;
} else if (inpotheroh.indexOf(' data-square="1"') != -1) { //newer
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(pthisoh,'').replace(potheroh,'');
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="3">') + '</', abb(' data-square="3">') + pthisoh + '</').replace(abb(' data-square="4">') + '</', abb(' data-square="4">') + potheroh + '</');

twosubsfrom[0] = 'bR1';

if (wwwtdtte != '') { lohoh=wwwtdtte; } //rmtwowk4
//ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh));
bigih=bigih.replace(epy(pthisoh,' data-square="4">'),'').replace(epy(potheroh,' data-square="3">'),'');
if (bigih.indexOf(lohoh.split('</')[0]) != -1) { lohoh=''; } //else { ouralert('found'); }
//bigih=bigih.replace(abb(' data-square="3">') + '</span>', abb(' data-square="3">') + innards(potheroh) + '</span></td>' + bigv(lohoh).split('</td>')[0]);
bigih=bigih.replace(abb(' data-square="3">') + '</', abb(' data-square="3">') + innards(potheroh) + '</');
// + lohoh);
//ouralert('About to Castle1 the rook ' + abb(' data-square="4">') + innards(potheroh) + '</');
bigih=bigih.replace(bigabb(' data-square="4">') + '</', bigabb(' data-square="4">') + innards(pthisoh) + '</'); // + lohoh.split('</td>')[0]);
//ouralert('About to Castle2 ' + innards(potheroh));
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('target').innerHTML=bigih;
}
//ouralert('About to Castle22 ' + innards(potheroh));
//ouralert('About to Castle223');
if (wwwtdtte != '') {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
domcmds.push("document.getElementById('td13').innerHTML='" + fouroh + "'; ");
domcmds.push("document.getElementById('td21').innerHTML='" + spanzero + "'; ");
domcmds.push("document.getElementById('tr1').innerHTML='" + wwwtdtte + "' + document.getElementById('tr1').innerHTML; itisthiscmove='w'; consolelog('Your next move ' + playerw + ' ... '); adddrop('" + lohoh.split(' id="')[1].split('"')[0] + "'); ");
}
}
if (lohoh != '') {
adddrop(lohoh.split(' id="')[1].split('"')[0]);
lohoh='';
}



}
}
} else if ((potherpiece.substring(1).substring(0,1) == 'K' && eval('' + potherpiece.length) == 2) && (pthispiece.substring(1).substring(0,1) == 'R' && eval('' + pthispiece.length) == 3)) {

if (potherpiece.substring(0,1) == 'w' && inpotheroh.indexOf(' data-square="61"') != -1 && (inpthisoh.indexOf(' data-square="64"') != -1 || inpthisoh.indexOf(' data-square="57"') != -1)) {
pretval=1;
if (inpthisoh.indexOf(' data-square="57"') != -1 && (bigih.indexOf(abb(' data-square="58">') + '</') == -1 || bigih.indexOf(abb(' data-square="59">') + '</') == -1 || bigih.indexOf(abb(' data-square="60">') + '</') == -1)) {
pretval=-1;
} else if (inpthisoh.indexOf(' data-square="57"') != -1) { // new
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(pthisoh,'').replace(potheroh,'');
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="60">') + '</', abb(' data-square="60">') + pthisoh + '</').replace(abb(' data-square="59">') + '</', abb(' data-square="59">') + potheroh + '</');

twosubsfrom[0] = 'wR1';


if (wtdtte != '') { lohoh=wtdtte; } //rmtwow
//ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh));
bigih=bigih.replace(epy(pthisoh,' data-square="60">'),'').replace(epy(potheroh,' data-square="59">'),'');
if (bigih.indexOf(lohoh.split('</')[0]) != -1) { lohoh=''; } //else { ouralert('found'); }
//bigih=bigih.replace(abb(' data-square="59">') + '</span>', abb(' data-square="59">') + innards(potheroh) + '</span></td>' + bigv(lohoh).split('</td>')[0]);
bigih=bigih.replace(abb(' data-square="59">') + '</', abb(' data-square="59">') + innards(potheroh) + '</');
// + lohoh);
//ouralert('About to Castle1 the rook ' + abb(' data-square="60">') + innards(potheroh) + '</');
bigih=bigih.replace(bigabb(' data-square="60">') + '</', bigabb(' data-square="60">') + innards(pthisoh) + '</'); // + lohoh.split('</td>')[0]);
//ouralert('About to Castle2 ' + innards(potheroh));
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('target').innerHTML=bigih;
}
//ouralert('About to Castle22 ' + innards(potheroh));
//ouralert('About to Castle223');
if (wtdtte != '') {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {

//document.getElementById('td202').innerHTML=sixoh;
domcmds.push("document.getElementById('td202').innerHTML='" + wsixoh + "'; ");
//document.getElementById('td203').innerHTML=spanzero;
domcmds.push("document.getElementById('td203').innerHTML='" + spanfive + "'; ");
//document.getElementById('td22').innerHTML='';
//domcmds.push("document.getElementById('td22').innerHTML=''; ");
domcmds.push("document.getElementById('tr8').innerHTML=document.getElementById('tr8').innerHTML.replace('" + spanfive + "', '" + spanfive + "</td>' + '" + wtdtte.split('</td>')[0] + "'); itisthiscmove='b'; consolelog('Your next move ' + playerb + ' ... '); adddrop('" + lohoh.split(' id="')[1].split('"')[0] + "'); ");
}
}
if (lohoh != '') {
adddrop(lohoh.split(' id="')[1].split('"')[0]);
lohoh='';
}



}
if (inpthisoh.indexOf(' data-square="64"') != -1 && (bigih.indexOf(abb(' data-square="62">') + '</') == -1 || bigih.indexOf(abb(' data-square="63">') + '</') == -1)) {
ouralert(bigih.split(' data-square="62"')[1].substring(0,40) + '!62');
ouralert(bigih.split(' data-square="63"')[1].substring(0,40) + '!63');
pretval=-1;
} else if (inpthisoh.indexOf(' data-square="64"') != -1) { // new
//ouralert('About to castle');
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(pthisoh,'').replace(potheroh,'');
//ouralert('About to castle1');
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="63">') + '</', abb(' data-square="63">') + pthisoh + '</').replace(abb(' data-square="62">') + '</', abb(' data-square="62">') + potheroh + '</');
//ouralert('About to castle2');
twosubsfrom[0] = 'wR2';

//ouralert('About to Castle ' + lastoh);
bigih=bigih.replace(epy(pthisoh,' data-square="62">'),'').replace(epy(potheroh,' data-square="63">'),'');
if (bigih .indexOf(lohoh.split('</')[0]) != -1) { lohoh=''; }
//ouralert('About to Castle12 the king ' + abb(' data-square="63">') + innards(pthisoh) + '</ ... ' + bigih.split(' data-square="63"')[1] + ' +++ ' + lohoh);
bigih=bigih.replace(abb(' data-square="63">') + '</td>', abb(' data-square="63">') + innards(potheroh) + '</td>');
//ouralert('About to Castle2');
//ouralert('About to Castle1 the rook ' + abb(' data-square="62">') + innards(potheroh) + '</');
if (lohoh == '') {
bigih=bigih.replace(abb(' data-square="62">') + '</', abb(' data-square="62">') + innards(pthisoh) + '</');
} else {
bigih=bigih.replace(bigabb(' data-square="62">') + '</', lohoh + bigabb(' data-square="62">') + innards(pthisoh) + '</');
}
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('target').innerHTML=bigih;
}
//ouralert('About to Castle22');
if (lohoh != '') {
adddrop(lohoh.split(' id="')[1].split('"')[0]);
lohoh='';
}

}
}
if (potherpiece.substring(0,1) == 'b' && inpotheroh.indexOf(' data-square="5"') != -1 && (inpthisoh.indexOf(' data-square="8"') != -1 || inpthisoh.indexOf(' data-square="1"') != -1)) {
pretval=1;
if (inpthisoh.indexOf(' data-square="8"') != -1 && (bigih.indexOf(abb(' data-square="6">') + '</') == -1 || bigih.indexOf(abb(' data-square="7">') + '</') == -1)) {
pretval=-1;
} else if (inpthisoh.indexOf(' data-square="8"') != -1) { // new if
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(pthisoh,'').replace(potheroh,'');
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="6">') + '</', abb(' data-square="6">') + potheroh + '</').replace(abb(' data-square="7">') + '</', abb(' data-square="7">') + pthisoh + '</');
twosubsfrom[0] = 'bR2';


//if (eightoh != '') { lohoh=eightoh; } //rm
//ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh));
bigih=bigih.replace(epy(pthisoh,' data-square="6">'),'').replace(epy(potheroh,' data-square="7">'),'');
//ouralert('About to Castle12 the king ' + abb(' data-square="7">') + innards(potheroh) + '</ ... ' + bigih.split(' data-square="7"')[1] + ' +++ ' + lohoh);
if (bigih.indexOf(lohoh.split('</')[0]) != -1) { lohoh=''; } //else { ouralert('found'); }
//if (bigih.indexOf(abb(' data-square="7">') + '</') == -1) {
// ouralert('Not found ' + bigabb(' data-square="7">') + '</');
//} else {
// ouralert(' ... ' + bigv(lohoh));
//}
//bigih=bigih.replace(abb(' data-square="7">') + '</span>', abb(' data-square="7">') + innards(potheroh) + '</span></td>' + bigv(lohoh).split('</td>')[0]);
bigih=bigih.replace(abb(' data-square="7">') + '</', abb(' data-square="7">') + innards(potheroh) + '</');
// + lohoh);
//ouralert('About to Castle1 the rook ' + abb(' data-square="6">') + innards(potheroh) + '</');
bigih=bigih.replace(bigabb(' data-square="6">') + '</', lohoh + bigabb(' data-square="6">') + innards(pthisoh) + '</');
//ouralert('About to Castle2 ' + innards(potheroh));
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('target').innerHTML=bigih;
}
//ouralert('About to Castle22 ' + innards(potheroh));
//document.getElementById('td31').innerHTML=innards(potheroh);
//ouralert('About to Castle223');
if (sixoh != '') {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//document.getElementById('tr1').innerHTML+=eightoh;
document.getElementById('td23').innerHTML=sixoh;
domcmds.push("document.getElementById('td23').innerHTML='" + sixoh + "'; ");
}
}
if (lohoh != '') {
adddrop(lohoh.split(' id="')[1].split('"')[0]);
lohoh='';
}



}
if (inpthisoh.indexOf(' data-square="1"') != -1 && (bigih.indexOf(abb(' data-square="4">') + '</') == -1 || bigih.indexOf(abb(' data-square="2">') + '</') == -1 || bigih.indexOf(abb(' data-square="3">') + '</') == -1)) {
pretval=-1;
} else if (inpthisoh.indexOf(' data-square="1"') != -1) { // new if
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(pthisoh,'').replace(potheroh,'');
//document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="3">') + '</', abb(' data-square="3">') + potheroh + '</').replace(abb(' data-square="4">') + '</', abb(' data-square="4">') + pthisoh + '</');

twosubsfrom[0] = 'bR1';

if (tdtte != '') { lohoh=tdtte; } //rmtwo
//ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh));
bigih=bigih.replace(epy(pthisoh,' data-square="4">'),'').replace(epy(potheroh,' data-square="3">'),'');
//ouralert('About to Castle12 the king ' + abb(' data-square="7">') + innards(potheroh) + '</ ... ' + bigih.split(' data-square="7"')[1] + ' +++ ' + lohoh);
if (bigih.indexOf(lohoh.split('</')[0]) != -1) { lohoh=''; } //else { ouralert('found'); }
//if (bigih.indexOf(abb(' data-square="7">') + '</') == -1) {
// ouralert('Not found ' + bigabb(' data-square="7">') + '</');
//} else {
// ouralert(' ... ' + bigv(lohoh));
//}
//bigih=bigih.replace(abb(' data-square="3">') + '</span>', abb(' data-square="3">') + innards(potheroh) + '</span></td>' + bigv(lohoh).split('</td>')[0]);
bigih=bigih.replace(abb(' data-square="3">') + '</', abb(' data-square="3">') + innards(potheroh) + '</');
// + lohoh);
//ouralert('About to Castle1 the rook ' + abb(' data-square="4">') + innards(potheroh) + '</');
bigih=bigih.replace(bigabb(' data-square="4">') + '</', bigabb(' data-square="4">') + innards(pthisoh) + '</'); // + lohoh.split('</td>')[0]);
//ouralert('About to Castle2 ' + innards(potheroh));
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('target').innerHTML=bigih;
}
//ouralert('About to Castle22 ' + innards(potheroh));
//document.getElementById('td31').innerHTML=innards(potheroh);
//ouralert('About to Castle223');
if (tdtte != '') {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {

//document.getElementById('td13').innerHTML=sixoh;
domcmds.push("document.getElementById('td13').innerHTML='" + sixoh + "'; ");
//document.getElementById('td21').innerHTML=spanzero;
domcmds.push("document.getElementById('td21').innerHTML='" + spanzero + "'; ");
//document.getElementById('td22').innerHTML='';
//domcmds.push("document.getElementById('td22').innerHTML=''; ");
domcmds.push("document.getElementById('tr1').innerHTML=document.getElementById('tr1').innerHTML.replace('" + spanzero + "', '" + spanzero + "</td>' + '" + tdtte.split('</td>')[0] + "'); itisthiscmove='w'; consolelog('Your next move ' + playerw + ' ... '); adddrop('" + lohoh.split(' id="')[1].split('"')[0] + "'); ");
}
}
if (lohoh != '') {
adddrop(lohoh.split(' id="')[1].split('"')[0]);
lohoh='';
}



}
}
} else {
//ouralert('pthisoh=' + pthisoh + ' and potheroh=' + potheroh);
pretval=-2;
}
if (pretval == 1) {
itisthiscmove=pthispiece.substring(0,1).replace('w','B').replace('b','W').toLowerCase();
if (itisthiscmove == 'b' && playerb.indexOf('[') != -1) {
onenewmove.push(' ');
if (!fixamove('')) { pretval=-9; itisthiscmove=pthispiece.substring(0,1).replace('w','B').replace('b','W').toLowerCase(); }
} else if (itisthiscmove == 'w' && playerw.indexOf('[') != -1) {
onenewmove.push(' ');
if (!fixamove('')) { pretval=-9; itisthiscmove=pthispiece.substring(0,1).replace('w','B').replace('b','W').toLowerCase(); }
}
if (itisthiscmove == 'b' && pretval == 1) {
consolelog('Your next move ' + playerb + ' ... ');
} else if (pretval == 1) {
consolelog('Your next move ' + playerw + ' ... ');
}

}
return pretval;
}

function crownit(datap, ucc) {
var sps=document.getElementsByTagName('span');
for (var igh=0; igh<sps.length; igh++) {

if ((datap + ' ').substring(0,1) == 'b') {
if (('' + sps[igh].getAttribute('data-piece')) == datap) {
//alert(67);
sps[igh].innerHTML=String.fromCodePoint(9819);
domcmds.push('document.getElementById("' + sps[igh].id + '").setAttribute("data-piece","' + datap.substring(0,2) + ucc + '");');
domcmds.push(' document.getElementById("' + sps[igh].id + '").innerHTML=String.fromCodePoint(9819); ');
//alert('yes');
}
} else if ((datap + ' ').substring(0,1) == 'w') {
if (('' + sps[igh].getAttribute('data-piece')) == datap) {
//alert(167);
sps[igh].innerHTML=String.fromCodePoint(9813);
domcmds.push('document.getElementById("' + sps[igh].id + '").setAttribute("data-piece","' + datap.substring(0,2) + ucc + '");');
domcmds.push(' document.getElementById("' + sps[igh].id + '").innerHTML=String.fromCodePoint(9813); ');
//alert('Yes');
}
}
}
}

function jxthispiece(xthispiece) {
if (xthispiece.substring(2).substring(0,1) == 'v') {
crownit(xthispiece ,'S');
return ('S');
} else if (xthispiece.substring(2).substring(0,1) == 'u') {
crownit(xthispiece ,'R');
return ('R');
} else if (xthispiece.substring(2).substring(0,1) == 't') {
crownit(xthispiece ,'Q');
return ('Q');
} else if (xthispiece.substring(2).substring(0,1) == '0') {
crownit(xthispiece ,'P');
return ('P');
} else if (xthispiece.substring(2).substring(0,1) == '1') {
crownit(xthispiece ,'O');
return ('O');
} else if (xthispiece.substring(2).substring(0,1) == '2') {
crownit(xthispiece ,'N');
return ('N');
} else if (xthispiece.substring(2).substring(0,1) == '3') {
crownit(xthispiece ,'M');
return ('M');
} else if (xthispiece.substring(2).substring(0,1) == '4') {
crownit(xthispiece ,'L');
return ('L');
} else if (xthispiece.substring(2).substring(0,1) == '5') {
crownit(xthispiece ,'K');
return ('K');
} else if (xthispiece.substring(2).substring(0,1) == '6') {
crownit(xthispiece ,'J');
return ('J');
} else if (xthispiece.substring(2).substring(0,1) == '7') {
crownit(xthispiece ,'I');
return ('I');
} else if (xthispiece.substring(2).substring(0,1) == '8') {
crownit(xthispiece ,'H');
return ('H');
} else if (xthispiece.substring(2).substring(0,1) == '9') {
crownit(xthispiece ,'G');
return ('G');
}
return xthispiece.substring(2).substring(0,1);
}

function islegal() {
var mbcrval=0, jhbit='', thissq=-1, ihbit='';
var sat=0, ihthere=false, thispiece='', otherpiece='';
var sfor=1
var retval=true, adjective='', directionally='';
var tpiece='', tdsd=[], itdsd=0;
cm='';
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
console.log(34);
}
if (document.URL.indexOf('/chess') != -1 && !document.getElementById('fdz') && lastoh.indexOf(' id="') != -1 && lastoh.indexOf('<span') == 0) {

if (newlohfulloh != '' && loh != '' && lastid == '') { lastid=loh; } else if (newlohfulloh != '' && bcklastid != '' && lastid == '') { lastid=bcklastid; }

bcklastid='';

if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
console.log(35);
}
console.log('1');
if (document.getElementById('fnodz')) {
console.log('11');
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
console.log(36);
}
if (document.getElementById('mytable').innerHTML.indexOf(lastoh) == -1) {
retval=false;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
console.log('illegal');
}
} else {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
console.log('debatable');
}
var ioff=0;
//if (thispiece.substring(0,1) == 'w') { ioff=1; }
console.log('111');
// document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastoh, '');
// document.getElementById(lastid).innerHTML=lastoh;
// lastoh='';
// lastih='';
var thisid=lastoh.split(' id="')[1].split('"')[0];
thispiece=('' + document.getElementById(thisid).getAttribute('data-piece')).replace(/^null$/g,'').replace(/^undefined$/g,'');
if ((itisthiscmove + thispiece).substring(0,1) != thispiece.substring(0,1)) {
console.log('It is not your turn for a move.' + lohfulloh + ' ' + thisid + ' ' + lastoh);
ouralert('It is not your turn for a move.');
return false;
}
//ouralert('*' + lastid + '!');
if (loh != '') { lastid=loh; }

var goodthis='';
thissq=-1;
if (document.getElementById(lastid).outerHTML.indexOf('<span') == 0) {
thissq=('' + bigv(document.getElementById(lastid).outerHTML).split(' data-square="')[eval(-1 + bigv(document.getElementById(lastid).outerHTML).split(' data-square="').length)].split('"')[0]).replace(String.fromCharCode(10),'');
lastid=bigv(document.getElementById(lastid).outerHTML).split(' id="')[1].split('"')[0];
if (thissq.substring(0,1) >= '0' && thissq.substring(0,1) <= '9') { goodthis='' + thissq; }
} else {
thissq=('' + document.getElementById(lastid).outerHTML.split(' data-square="')[eval(-1 + document.getElementById(lastid).outerHTML.split(' data-square="').length)].split('"')[0]).replace(String.fromCharCode(10),'');
}
//if (newlohfulloh != '') { ouralert('7:' + thissq + ' ' + document.getElementById(lastid).outerHTML); }
var interim='';
if (thissq.indexOf('<span') == 0) {
interim='<span' + thissq.split('</span>')[0].split('<span')[eval(-1 + thissq.split('</span>')[0].split('<span').length)] + '</span>';
//if (newlohfulloh != '') { ouralert('lastoh=' + lastoh + ' and interim=' + interim + ' and thissq=' + thissq + ' and loh=' + loh); }
if (interim.length < 20 && loh != '') { lastid=loh; interim=document.getElementById(loh).innerHTML; lastih=interim.split('</')[0].split('>')[eval(-1 + interim.split('</')[0].split('>').length)]; }
//lastoh=interim;
//if (newlohfulloh != '') { ouralert(lohfulloh + ' +++ ' + bigv(lastoh) + ' Lastoh=' + lastoh + ' and interim=' + interim + ' and thissq=' + thissq + ' and loh=' + loh); }
if (interim.indexOf('<t') != -1) {
thissq=interim.split(' data-square="')[1].split('"')[0];
//} else {
} else if (bigv(document.getElementById(loh).outerHTML).indexOf(' data-square="') != -1) {
thissq=bigv(document.getElementById(loh).outerHTML).split(' data-square="')[eval(-1 + bigv(lastoh).split(' data-square="').length)].split('"')[0];
//if (document.URL.indexOf('debug') != -1) { ouralert('8253:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); }
thissq=document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="')[eval(-1 + document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="').length)].split('"')[0];
}
} else if (loh != '') {
//if (newlohfulloh != '') { ouralert('77:' + thissq + ' ' + document.getElementById(lastid).outerHTML); }
lastid=loh;
interim=document.getElementById(loh).outerHTML;
lastih=interim.split('</')[0].split('>')[eval(-1 + interim.split('</')[0].split('>').length)];
if (interim.indexOf('<t') != -1) {
thissq=interim.split(' data-square="')[1].split('"')[0];
} else if (bigv(lastoh).indexOf(' data-square="') != -1) {
thissq=bigv(lastoh).split(' data-square="')[eval(-1 + bigv(lastoh).split(' data-square="').length)].split('"')[0];
//if (document.URL.indexOf('debug') != -1) { ouralert('823:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); }
} else {
thissq=document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="')[eval(-1 + document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="').length)].split('"')[0];
}
}
if ((thissq + ' ').substring(0,1) < '0' && loh != '') {
//ouralert('yes');
lastid=loh;
interim=document.getElementById(loh).outerHTML;
//ouralert(interim + ' ... ' + document.getElementById('target').innerHTML.split(interim)[0].slice(-60));
lastih=interim.split('</')[0].split('>')[eval(-1 + interim.split('</')[0].split('>').length)];
if (interim.indexOf('<t') != -1) {
thissq=interim.split(' data-square="')[1].split('"')[0];
//if (document.URL.indexOf('debug') != -1) { ouralert('81:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); }
//ouralert(lastoh + ' +++ ' + interim);
} else if (bigv(lastoh).indexOf(' data-square="') != -1) {
thissq=bigv(lastoh).split(' data-square="')[eval(-1 + bigv(lastoh).split(' data-square="').length)].split('"')[0];
//if (document.URL.indexOf('debug') != -1) { ouralert('82:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); }
} else {
thissq=document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="')[eval(-1 + document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="').length)].split('"')[0];
//if (document.URL.indexOf('debug') != -1) { ouralert('83:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); }
}
}
//thissq=document.getElementById('target').innerHTML.split(lastoh)[0].split(' data-square="')[eval(-1 + document.getElementById('target').innerHTML.split(lastoh)[0].split(' data-square="').length)].split('"')[0];
//if (document.URL.indexOf('debug') != -1) { ouralert('8:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); }
var lastsq=('' + prevtih.split(lastoh)[0].split(' data-square="')[eval(-1 + prevtih.split(lastoh)[0].split(' data-square="').length)].split('"')[0]);
//if (document.URL.indexOf('debug') != -1) { ouralert('9:' + lastsq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); }

if (thissq.substring(0,1) >= '0' && thissq.substring(0,1) <= '9') { if (goodthis != '') { thissq=eval('' + goodthis); } else { thissq=eval('' + thissq); } }
if (lastsq.substring(0,1) >= '0' && lastsq.substring(0,1) <= '9') { lastsq=eval('' + lastsq); }
//if (newlohfulloh != '') { ouralert('777:' + thissq + ' ' + document.getElementById(lastid).outerHTML); }

// 4.2;20,2
//ouralert('lastsq=' + lastsq + ' and thissq=' + thissq + ' and loh=' + loh + ' and lastid=' + lastid);
loh='';
var hshift=Math.floor(Math.abs(eval(eval(-1 + thissq) % 8) - eval(eval(-1 + lastsq) % 8)));
var vshift=Math.floor(eval(ioff + Math.abs(eval(eval(thissq - eval(eval(-1 + thissq) % 8)) / 8) - eval(eval(lastsq - eval(eval(-1 + lastsq) % 8) )) / 8)));

if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
console.log('hshift=' + hshift + ' and vshift=' + vshift);
}

if (document.URL.indexOf(deq('draughts')) != -1 && previyesnod == 0) {
if (thispiece.substring(0,1) == 'b' && thispiece.slice(-1) == thispiece.slice(-1).toLowerCase() && thissq < lastsq) {
ouralert('Draught pieces can not move this way until they become Kings on reaching the other end. ');
return false;
} else if (thispiece.substring(0,1) == 'w' && thispiece.slice(-1) == thispiece.slice(-1).toLowerCase() && thissq > lastsq) {
ouralert('Draught pieces can not move this way until they become Kings on reaching the other end. ');
return false;
}
}

if (document.getElementById(lastid).outerHTML.indexOf(' data-piece="') != -1) {
if (document.URL.indexOf(deq('makyek')) != -1) {
ouralert('Mak-yek pieces can not move this way. ');
return false;
}
otherpiece=document.getElementById(lastid).outerHTML.split(' data-piece="')[1].split('"')[0];
adjective=' occupied';
adjective+=' by ' + otherpiece;
if ((otherpiece + ' ').substring(1).substring(0,1) == 'K' && eval('' + otherpiece.length) == 2) {
if ((thispiece + ' ').substring(1).substring(0,1) == 'K' && eval('' + otherpiece.length) == 2) {
ouralert('Kings can not take kings.');
return false;
} else if ((otherpiece + ' ').substring(0,1) != (thispiece + ' ').substring(0,1) && (otherpiece + ' ').substring(0,1) == 'w') {
cm='Checkmate! Congratulations, ' + playerb; //setTimeout(function(){ ouralert('Checkmate! Congratulations, ' + playerb); }, 2000);
//return false;
} else if ((otherpiece + ' ').substring(0,1) != (thispiece + ' ').substring(0,1) && (otherpiece + ' ').substring(0,1) == 'b') {
cm='Checkmate! Congratulations, ' + playerw; //setTimeout(function(){ ouralert('Checkmate! Congratulations, ' + playerw); }, 2000);
//return false;
}
}
}

if (document.getElementById(lastid).innerHTML.indexOf('<') != -1 || adjective != '') {
adjective=' occupied';
if (document.getElementById(lastid).outerHTML.indexOf(' data-piece="') != -1) {
otherpiece=document.getElementById(lastid).outerHTML.split(' data-piece="')[1].split('"')[0];
adjective+=' by ' + otherpiece;
if (otherpiece.substring(0,1) == thispiece.substring(0,1)) {
consolelog('Chess Piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq);
//ouralert('check castling ' + thispiece + ' ' + otherpiece + ' ' + lastoh + ' ' + document.getElementById(lastid).outerHTML);
mbcrval=mightbecastling(thispiece, otherpiece, lastoh, document.getElementById(lastid).outerHTML);
if (mbcrval <= 0) { //thispiece.substring(1).substring(0,1) == 'K' && eval('' + thispiece.length) == 2) {
if (mbcrval == 0) {
} else if (mbcrval == -1) {
ouralert('Existing pieces between King and Rook prevent castling.');
return false;
} else if (mbcrval == -2) {
if (prelegal) {
ouralert('Only Kings and Rooks can castle.');
return false;
}
} else if (mbcrval == -3) {
} else if (mbcrval == -4) {
} else if (mbcrval == -5) {
ouralert('Only Kings and Rooks of the same colour can castle.');
return false;
} else if (mbcrval == -9) {
ouralert('King has been affected by a move that causes a check or is too close to other King.');
return false;
} else if (mbcrval == -6) {
} else if (mbcrval == -7) {
} else if (hshift == 3 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) {
ouralert('Check regarding castling');
} else if (hshift == 4 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) {
ouralert('Check regarding castling');
} else if (eval(hshift + vshift) >= 3) {
ouralert('Kings do not move this way .');
return false;
} else if ((hshift == 0 || vshift == 0) && eval(hshift + vshift) > 1) {
ouralert('Kings do not move this way .');
return false;
} else if (hshift != 1 || vshift != 1) {
ouralert('Kings do not move this way .');
return false;
} else if (hshift == 3 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) {
ouralert('Check regarding castling');
} else if (hshift == 4 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) {
ouralert('Check regarding castling');
}
} else if (mbcrval != 1) {
ouralert('Except for castling (we will code for later) this is an illegal move.');
return false;
}
} //else { //if (thispiece.substring(1).substring(0,1) == 'P') {
//adjective=' occupied by ' + otherpiece;
//if (hshift == 0) {
//ouralert('Pawns can not move this way .');
// return false;
// } else {
// alert('P ' + hshift + '.' + vshift + ' ' + otherpiece + ' ' + lastoh + ' ... ' + document.getElementById(lastid).outerHTML);
// }
//}

}
if (document.URL.indexOf(deq('draughts')) != -1) {
ouralert('Draught pieces are not allowed to move this way.');
return false;
}
} else if (adjective == '') {
adjective=' unoccupied';
//if (thispiece.substring(1).substring(0,1) == 'P') {
// alert('p ' + hshift + '.' + vshift + ' ' + otherpiece + ' ' + lastoh + ' ... ' + document.getElementById(lastid).outerHTML);
//}
}

if (thissq == lastsq) { return false; }

//ouralert('' + hshift + '.' + vshift);
if ('Chess piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq == 'Chess piece bR1 just moved from square 1 to unoccupied square 5') {
console.log('Normally bad where lastid=' + lastid + ' ... ' + document.getElementById(lastid).outerHTML);
}
if ('Chess piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq == 'Chess piece wR1 just moved from square 57 to unoccupied square 61') {
console.log('Normally is bad where lastid=' + lastid + ' ... ' + document.getElementById(lastid).outerHTML);

}
if (Math.floor(eval(ioff + Math.abs(eval(thissq) - eval(lastsq)) % 8)) == 0) { // && eval(eval(-1 + thissq) / 8) != eval(eval(-1 + lastsq) / 8)) { // 57 vs 41 ... no
directionally=' vertically by ' + vshift;
if (thispiece.substring(1).substring(0,1) == 'B') {
consolelog('Chess Piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq);
if (document.URL.indexOf(deq('draughts')) != -1) {
ouralert('Draught pieces do not move this way.');
} else {
ouralert('Bishops do not move this way.');
}
return false;
}
} else if (Math.floor(eval(eval(-1 + thissq) % 8) == eval(eval(-1 + lastsq) % 8))) {
directionally=' horizontally by ' + hshift;
if (thispiece.substring(1).substring(0,1) == 'B') {
consolelog('Chess Piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq);
ouralert('Bishops do not move this way.');
return false;
}
} else if (thispiece.substring(1).substring(0,1) == 'R' && hshift != 0 && vshift != 0) {
consolelog('Chess Piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq);
if (document.URL.indexOf(deq('makyek')) != -1) {
ouralert('Mak-yek pieces can not move this way. ');
return false;
} else {
ouralert('Rooks do not move this way.');
return false;
}
}
if (thispiece.substring(1).substring(0,1) == 'K' && eval('' + thispiece.length) > 2) {
if (eval(hshift + vshift) != 3 || hshift < 1 || vshift < 1) {
//ouralert('8:' + thissq + ' ' + thisid + ' ' + lastoh);
//ouralert('9:' + lastsq + ' ' + thisid + ' ' + lastoh);
ouralert('Knights can not move this way.');
return false;
}
} else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'K' && eval('' + thispiece.length) == 2) {
if ((otherpiece + ' ').substring(1).substring(0,1) == 'K' && eval('' + otherpiece.length) == 2) {
ouralert('Kings can not take kings.');
return false;
} else if (eval(hshift + vshift) >= 3) {
ouralert('Kings do not move this way .');
return false;
} else if ((hshift == 0 || vshift == 0) && eval(hshift + vshift) > 1) {
ouralert('Kings do not move this way.');
return false;
} else if (hshift != 1 || vshift != 1) {
if (eval(hshift + vshift) > 1) {
ouralert('Kings do not move this way.');
return false;
}
} else if (hshift == 3 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) {
ouralert('Check regarding castling');
} else if (hshift == 4 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) {
ouralert('Check regarding castling');
}
} else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'B') {
//ouralert('' + hshift + ',' + vshift);
//alert('tHeRE ' + thispiece + ' ' + thissq + ' ' + lastsq + ' ' + mbcrval);
yesnod=true;
iyesnod=0;
if (hshift != vshift && document.URL.indexOf(deq('draughts')) != -1) {
ouralert('Draught pieces do not move this way.');
return false;
} else if (hshift != vshift) {
if (document.URL.indexOf(deq('draughts')) != -1) {
ouralert('Draught pieces do not move this way.');
} else {
ouralert('Bishops do not move this way.');
}
return false;
} else if (hshift != vshift && (hshift > 2 || vshift > 2) && document.URL.indexOf(deq('draughts')) != -1) {
ouralert('Draught pieces can not move this way.');
return false;
} else if (hshift == 1 && vshift == 1 && document.URL.indexOf(deq('draughts')) != -1) {
ihbit='';
yesnod=true;
iyesnod=0;
occupiedlist.replace(',' + lastsq + ',', ',');
occupiedlist+='' + thissq + ',';
tdsd=document.getElementsByTagName('td'); // new below
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + lastsq + '"') != -1) {
ihbit=tdsd[itdsd].innerHTML;
jhbit=ihbit;
if (ihbit != '') { //ihbit.indexOf(' data-piece="') != -1) {
if ((thissq <= 8 || thissq >= 57) && thispiece.substring(2).substring(0,1) == thispiece.substring(2).substring(0,1).toLowerCase()) {
jhbit=jhbit.replace(thispiece, thispiece.substring(0,2) + jxthispiece(thispiece));
//alert(jhbit);
}
// alert('why? ' + ihbit);
startboard=startboard.replace(ihbit.split(' data-piece="')[1].split('"')[0] + '_' + lastsq, jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq);
endboard=endboard.replace(ihbit.split(' data-piece="')[1].split('"')[0] + '_' + lastsq, jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq);
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(ihbit.split(' data-piece="')[1].split('"')[0] + '_' + lastsq, jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq).replace(encodeURIComponent(ihbit.split(' data-piece="')[1].split('"')[0] + '_' + lastsq), encodeURIComponent(jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq));
//} else {
// alert(tdsd[itdsd].id);
}
tdsd[itdsd].innerHTML='';
}
}
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + thissq + '"') != -1) {
if (ihbit == '') {
ihbit=lastoh;
jhbit=lastoh;
if ((thissq <= 8 || thissq >= 57) && thispiece.substring(2).substring(0,1) == thispiece.substring(2).substring(0,1).toLowerCase()) {
jhbit=jhbit.replace(thispiece, thispiece.substring(0,2) + jxthispiece(thispiece));
}
startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + lastsq, jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq);
endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + lastsq, jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq);
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + lastsq, jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq).replace(encodeURIComponent(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + lastsq), encodeURIComponent(jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq));
}
tdsd[itdsd].innerHTML=jhbit;
}
}

} else {
//ouralert('' + eval(Math.abs(thissq - lastsq) / hshift));
sat=lastsq;
ihthere=false;
sfor=eval((eval('' + thissq) - eval('' + lastsq)) / hshift);
sat+=sfor;
if (document.URL.indexOf(deq('draughts')) != -1) {

tdsd=document.getElementsByTagName('td');
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) {
if (tdsd[itdsd].innerHTML == '') {
ouralert('Draught pieces will not move this way.');
return false;
}
}
}

}
while (sat != thissq) {
//ouralert('' + sat + ' vs ' + lastsq + ' sfor=' + sfor + ' thissq=' + thissq + ' lastsq=' + lastsq);
if (document.URL.indexOf(deq('draughts')) == -1 && document.getElementById('target').innerHTML.split(' data-square="' + sat + '"')[1].split('>')[1].split('</')[0].trim() != '') {
ouralert('Bishops can not jump over other pieces.');
return false;
} else if (document.URL.indexOf(deq('draughts')) != -1) {
tdsd=document.getElementsByTagName('td');
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) {
if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1) ) != -1) {
ouralert('Draught pieces cannot jump over their own pieces.');
return false;
} else if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) {
if (tdsd[itdsd].innerHTML.indexOf(' data-piece="') == -1) {
startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat), '');
} else {
startboard=startboard.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
endboard=endboard.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), '');
}
tdsd[itdsd].innerHTML='';
occupiedlist=occupiedlist.replace(',' + sat + ',', ',');
occupiedlist+='' + thissq + ',';
if (1 == 1) {
iyesnod=10000;
previyesnod=10000;
yesnod=false;
} else {
yesnod=confirm('Are you finished with your move?');
}
if (yesnod || 8 == 8) {
tdsd=document.getElementsByTagName('td');
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + thissq + '"') != -1) {
tdsd[itdsd].innerHTML=lastoh;
}
}
}
}
}
}
}
if (!yesnod) { break; }
sat+=sfor;
}
}
if (!yesnod && iyesnod == 0) { return false; }
} else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'Q' && hshift != vshift && hshift != 0 && vshift != 0) {
if (hshift != 0 && vshift != 0) {
ouralert('Queens do not move this way.');
return false;
}
} else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'Q' && (hshift == vshift || hshift == 0 || vshift == 0)) {
//alert('Here');
if (hshift != 0) {
sat=lastsq;
ihthere=false;
sfor=eval((eval('' + thissq) - eval('' + lastsq)) / hshift);
sat+=sfor;
while (sat != thissq) {
if (document.getElementById('target').innerHTML.split(' data-square="' + sat + '"')[1].split('>')[1].split('</')[0].trim() != '') {
ouralert('Queens can not jump over other pieces.');
return false;
}
sat+=sfor;
}
} else {
//alert('here');
sat=lastsq;
ihthere=false;
sfor=eval((eval('' + thissq) - eval('' + lastsq)) / vshift);
sat+=sfor;
while (sat != thissq) {
if (document.getElementById('target').innerHTML.split(' data-square="' + sat + '"')[1].split('>')[1].split('</')[0].trim() != '') {
ouralert('Queens can not jump over other pieces.');
return false;
}
sat+=sfor;
}
}
} else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'R' && hshift != 0) {
mbcrval=mightbecastling(thispiece, otherpiece, lastoh, document.getElementById(lastid).outerHTML);
if (mbcrval != 1) {
sat=lastsq;
ihthere=false;
sfor=eval((eval('' + thissq) - eval('' + lastsq)) / hshift);
sat+=sfor;
while (sat != thissq) {
if (document.getElementById('target').innerHTML.split(' data-square="' + sat + '"')[1].split('>')[1].split('</')[0].trim() != '') {
if (document.URL.indexOf(deq('makyek')) != -1) {
ouralert('Mak-yek pieces can not jump over other pieces. ');
return false;
} else {
ouralert('Rooks can not jump over other pieces.');
return false;
}
}
sat+=sfor;
}
}
} else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'R' && vshift != 0) {
mbcrval=mightbecastling(thispiece, otherpiece, lastoh, document.getElementById(lastid).outerHTML);
if (mbcrval != 1) {
sat=lastsq;
ihthere=false;
sfor=eval((eval('' + thissq) - eval('' + lastsq)) / vshift);
sat+=sfor;
while (sat != thissq) {
if (document.getElementById('target').innerHTML.split(' data-square="' + sat + '"')[1].split('>')[1].split('</')[0].trim() != '') {
if (document.URL.indexOf(deq('makyek')) != -1) {
ouralert('Mak-yek pieces can not jump over other pieces. ');
return false;
} else {
ouralert('Rooks can not jump over other pieces.');
return false;
}
}
sat+=sfor;
}
}
} else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'P') {
if (adjective == ' unoccupied') {
if (hshift != 0) {
if (eval(hshift + vshift) > 2) {
ouralert('Pawns can not move this way .');
return false;
} else if (ppt && hshift == 1 && vshift == 1) {
ouralert('Pawns can not move this way .');
return false;
//consolelog('huh pawn');
ppt=ppt;
} else if (!ppt && hshift > 0) {
ouralert('Pawns can not move this way .');
return false;
}
} else if (Math.floor(eval(eval(-1 + eval('' + lastsq)) / 8)) == 6 || Math.floor(eval(eval(-1 + eval('' + lastsq)) / 8)) == 1) {
if (vshift > 2) {
ouralert('Pawns can not move this way .');
return false;
} else if (vshift == 2) {
//ouralert('vshift=' + vshift);
sat=lastsq;
ihthere=false;
sfor=eval((eval('' + thissq) - eval('' + lastsq)) / vshift);
sat+=sfor;
//while (sat != thissq) {
if (document.getElementById('target').innerHTML.split(' data-square="' + sat + '"')[1].split('>')[1].split('</')[0].trim() != '') {
ouralert('Pawns can not jump over other pieces.');
return false;
}
//sat+=sfor;
//}
}
} else if (vshift != 1) {
ouralert('Pawns can not move this way.');
return false;
} else if (thispiece.substring(0,1) == 'w' && eval('' + lastsq) < eval('' + thissq)) {
if (ppt && hshift == 1 && vshift == 1) {
ppt=ppt;
} else {
ouralert('Pawns can not move this way .');
return false;
}
} else if (thispiece.substring(0,1) == 'b' && eval('' + lastsq) > eval('' + thissq)) {
if (ppt && hshift == 1 && vshift == 1) {
ppt=ppt;
} else {
ouralert('Pawns can not move this way .');
return false;
}
}
} else if (hshift != 1 || vshift != 1) {
if (ppt && hshift == 1 && vshift == 1) {
ppt=ppt;
} else {
ouralert('Pawns can not move this way .');
return false;
}
}
}
consolelog('Chess piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq);
prevlastoh=lastoh;
prevlastih=lastih;
setTimeout(prevl, 500);
}
}
}
//ouralert('' + retval + ' ' + thispiece);

if (retval) {
if (document.URL.indexOf(deq('makyek')) != -1) {
tdsd=document.getElementsByTagName('td');
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(thispiece + '_' + lastsq, thispiece + '_' + thissq).replace(encodeURIComponent(thispiece + '_' + lastsq), encodeURIComponent(thispiece + '_' + thissq));
sat=eval(-8 + thissq);
if (sat >= 1 && sat <= 64) {
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) {
if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) {
occupiedlist=occupiedlist.replace(',' + sat + ',', ',');
if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; }
startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), '');
tdsd[itdsd].innerHTML='';
}
}
}
}
sat=eval(8 + thissq);
if (sat >= 1 && sat <= 64) {
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) {
if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) {
occupiedlist=occupiedlist.replace(',' + sat + ',', ',');
if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; }
startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), '');
tdsd[itdsd].innerHTML='';
}
}
}
}
sat=eval(-1 + eval('' + thissq));
if (sat >= 1 && sat <= 64 && Math.floor(eval(eval(-1 + sat) / 8)) == Math.floor(eval(eval(-1 + thissq) / 8))) {
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) {
if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) {
occupiedlist=occupiedlist.replace(',' + sat + ',', ',');
if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; }
startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), '');
tdsd[itdsd].innerHTML='';
}
}
}
}
sat=eval(1 + eval('' + thissq));
if (sat >= 1 && sat <= 64 && Math.floor(eval(eval(-1 + sat) / 8)) == Math.floor(eval(eval(-1 + thissq) / 8))) {
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) {
if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) {
occupiedlist=occupiedlist.replace(',' + sat + ',', ',');
if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; }
startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, '');
document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), '');
tdsd[itdsd].innerHTML='';
}
}
}
}
tdsd=document.getElementsByTagName('td');
var foundstr='';
for (itdsd=0; itdsd<tdsd.length; itdsd++) {
if (tdsd[itdsd].outerHTML.indexOf(' data-square="') != -1) { foundstr+=tdsd[itdsd].outerHTML.split(' data-square="')[1].substring(0,1); }
}
if (foundstr.indexOf('w') == -1 && foundstr.indexOf('b') != -1) {
consolelog('Congratulations on your win with the Mak-yek game, ' + playerb);
ouralert('Congratulations on your win with the Mak-yek game, ' + playerb);
} else if (foundstr.indexOf('w') != -1 && foundstr.indexOf('b') == -1) {
consolelog('Congratulations on your win with the Mak-yek game, ' + playerw);
ouralert('Congratulations on your win with the Mak-yek game, ' + playerw);
}

}
}

if (retval) {
if (iyesnod != 0) {
if (thispiece.substring(0,1).replace('w','B').replace('b','W').toLowerCase() == 'b') {
document.getElementById('mytable').style.cursor='progress';
consolelog(playerw + ', you have ten more seconds on your move. ');
setTimeout(function(){ if (iyesnod == 0) { previyesnod=0; document.getElementById('mytable').style.cursor='pointer'; itisthiscmove='b'; consolelog('Your next move ' + playerb + ' ... '); } }, iyesnod);
} else {
document.getElementById('mytable').style.cursor='progress';
consolelog(playerb + ', you have ten more seconds on your move. ');
setTimeout(function(){ if (iyesnod == 0) { previyesnod=0; document.getElementById('mytable').style.cursor='pointer'; itisthiscmove='w'; consolelog('Your next move ' + playerw + ' ... '); } }, iyesnod);
}
iyesnod=0;
//alert('on timer');
} else {
itisthiscmove=thispiece.substring(0,1).replace('w','B').replace('b','W').toLowerCase();
if (itisthiscmove == 'b') {
consolelog('Your next move ' + playerb + ' ... ');
} else {
consolelog('Your next move ' + playerw + ' ... ');
}
occupiedlist=occupiedlist.replace(',' + lastsq + ',', ',');
occupiedlist+='' + thissq + ',';
}

if (document.URL.indexOf(deq('draughts')) == -1) {
if (thispiece.substring(0,2) == 'wP' && thissq <= 8) {
qid=thisid;
//alert(2675);
qqid='♕⁠';
setTimeout(bbbthen, 4000);
//ouralert(98);
//document.getElementById(thisid).setAttribute('data-piece', document.getElementById(thisid).getAttribute('data-piece').replace('wP','wQ'));
//document.getElementById(thisid).innerHTML='♕⁠';
} else if (thispiece.substring(0,2) == 'bP' && thissq >= 57) {
qid=thisid;
//alert(675);
qqid='♛⁠';
setTimeout(bbbthen, 4000);
//document.getElementById(thisid).setAttribute('data-piece', document.getElementById(thisid).getAttribute('data-piece').replace('bP','bQ'));
//document.getElementById(thisid).innerHTML='♛⁠';
}
}
}
if (mbcrval == 1) { retval=false; }
if (cm != '' && retval) {
setTimeout(function(){ ouralert(cm); }, 2000);
}

if (retval && lastmove != '') {
retval=fixamove(lastmove);
}
lastmove='';
return retval;
}

function bbbthen() {
var thatid=qid;
//ouralert(thatid);
document.getElementById(thatid).innerHTML=qqid;
document.getElementById(thatid).setAttribute('data-piece', document.getElementById(thatid).getAttribute('data-piece').replace('wP','wQ').replace('bP','bQ'));
}

function prevl() {
prevtih=document.getElementById('target').innerHTML;
}

function mirrorperhaps(inn) {
if (!mirroring) { return inn; }
var onnd=Math.floor(eval(inn / 8));
var onnr=eval(inn % 8);
// (7 - 1/8) x 8 + (1 % 8)
//if (inn == 14) { alert(eval(eval(eval(7 - onnd) * 8) + onnr)); }
return eval(eval(eval(7 - onnd) * 8) + onnr);
}

function maybethreeu(inht) {
var outht=inht;
var insh=inht.split(' data-piece="');
if (document.URL.indexOf(deq('draughts')) != -1) {
//alert(outht);
if (insh.length != 1) {
var dpthreeu=insh[1].split('"')[0];
if (dpthreeu.trim() != '' && (' ' + dpthreeu).slice(-1) == (' ' + dpthreeu).slice(-1).toUpperCase() && (' ' + dpthreeu).slice(-1) != (' ' + dpthreeu).slice(-1).toLowerCase()) {
//alert(dpthreeu);
if (dpthreeu.substring(0,1) == 'w') {
outht=inht.split('>')[0] + '>' + String.fromCodePoint(9819) + '</' + inht.substring(1).split(' ')[0].split('>')[0] + '>';
} else if (dpthreeu.substring(0,1) == 'b') {
outht=inht.split('>')[0] + '>' + String.fromCodePoint(9813) + '</' + inht.substring(1).split(' ')[0].split('>')[0] + '>';
}
}
}
}
return outht;
}

function butwhatifchessgame(inspanstuff) {
var outspanstuff=inspanstuff, ii=0, thisth='', tnum=0;
if (document.URL.indexOf('/chess') != -1 && document.URL.indexOf('traditional=') != -1) {
var ths=[];
var ourmap=[];
var thas=inspanstuff.split('</th>');
//alert(thas.length);
for (ii=0; ii<thas.length; ii++) {
if (thas[ii].trim() != '') {
thisth=maybethreeu('<th' + thas[ii].split('<th')[-1 + eval('' + thas[ii].split('<th').length)] + '</th>');
ths.push(thisth);
//alert(thisth);
} // outspanstuff=outspanstuff.replace(thisth, '');
}
var outtg=document.getElementById('mytable').innerHTML;
thas=outtg.split('</td>');
//ouralert(65);
if (trad.indexOf('_') != -1 && trad.indexOf('P') != -1 && document.URL.indexOf(deq('draughts')) == -1) {
if (trad.indexOf('wP') != -1) {
if (eval(trad.split('wP')[1].split('_')[1].split('w')[0].split('b')[0].split('_')[0]) <= 16) {
mirroring=true;
}
}
if (trad.indexOf('bP') != -1) {
if (eval(trad.split('bP')[1].split('_')[1].split('w')[0].split('b')[0].split('_')[0]) >= 49) {
mirroring=true;
}
}


}
//alert(thas.length);
for (ii=0; ii<thas.length; ii++) {
if (trad.indexOf('_') != -1) {
//alert('' + ths.length + ' ' + trad + ' cpa[' + ii + ']=' + cpa[ii] + ' ... ' + occupiedlist);
//if (1 == 1 || cpa[ii] == 'wP1') { alert('Ready ' + cpa[ii]); }
if (tradmove(trad + '&move=' + amove).indexOf(cpa[ii] + '_') != -1) {
//if (cpa[ii] == 'wP1') { alert(eval(-1 + mirrorperhaps(eval(trad.split(cpa[ii] + '_')[1].split('w')[0].split('b')[0])))); }
ourmap.push(eval(-1 + mirrorperhaps(eval(trad.split(cpa[ii] + '_')[1].split('w')[0].split('b')[0].split('_')[0]))));
occupiedlist+='' + eval(-1 + mirrorperhaps(eval(trad.split(cpa[ii] + '_')[1].split('w')[0].split('b')[0].split('_')[0]))) + ',';
//alert(occupiedlist);
} else {
ourmap.push(-1);
occupiedlist+='' + eval(1 + eval('' + staidmap[ii])) + ',';
}
} else if (staidmap[ii] >= 0 && document.URL.indexOf('traditional=mayhem') == -1 && trad.indexOf('_') == -1) {
ourmap.push(staidmap[ii]);
occupiedlist+='' + eval(1 + eval('' + staidmap[ii])) + ',';
//alert(occupiedlist);
} else {
tnum=Math.floor(Math.random() * 64);
occupiedlist+='' + eval(1 + tnum) + ',';
ourmap.push(tnum);
}
}
if (amove.trim() != '') {
//alert(amove);
//if (trad.trim().indexOf(amove.split('_')[0] + '_') == -1) {
//ourmap.push(eval(-1 + mirrorperhaps(eval(trad.trim().split(cpa[ii] + '_')[1].split('w')[0].split('b')[0].split('_')[0]))));
//occupiedlist+='' + eval(-1 + mirrorperhaps(eval(trad.trim().split(cpa[ii] + '_')[1].split('w')[0].split('b')[0].split('_')[0]))) + ',';
//}
var amvs=amove.split('_');
if (eval('' + amvs.length) > 2) {
moveto=mirrorperhaps(eval('' + amvs[2]));
if (movefrom == -1) { movefrom=mirrorperhaps(eval('' + amvs[1])); }
//alert('' + movefrom + ' to ' + moveto);
}
}
//ouralert(165);
var preclick='';
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
preclick='data-';
}
//alert(ths.length);
if (document.URL.indexOf(deq('draughts')) == -1 || 7 == 7) { // new for draughts
for (ii=(-1 + eval('' + ths.length)); ii>=0; ii--) {
if (ourmap[ii] >= 0) {
//ouralert(thas[ii] + ' ... ' + ths[ii]);
outtg=outtg.replace(thas[ourmap[ii]], thas[ourmap[ii]] + ths[ii].replace(/th/g,'span').replace('<span ', '<span style=font-size:60px; data-ontouchstart=fit(this); onmouseover=fit(this); ' + preclick + 'onclick=fit(this); ')); // .replace(/th/g,'SPAN')
}
}
}
document.getElementById('mytable').innerHTML=outtg;
setTimeout(prevl, 500);
return '<td></td>';
}
return outspanstuff;
}

function askmore() {
var yb=prompt('Optionally enter your own new sentence to set for the user to unscramble. The assumption is there that an absolute URL as a word represents an image URL where hashtag #leftoff#topoff#width#height could optionally be appended.', '');
if (yb != null) {
if (yb.trim() != '') {
location.href=(document.URL.replace(('#' + location.hash).replace('##','#').replace(/^\#$/g,''),'') + ('#' + location.hash).replace('##','#').replace(/^\#$/g,'')).replace('sourcenum=', 'sourceXnum=').replace('yourblurb=', 'yourXblurb=').replace('?', '?yourblurb=' + encodeURIComponent(yb) + '&sourcenum=&').replace('#','&');
}
}
}

function cloneize() {
var irws=1;
var firsttogo='td33', ifirst=9;
var ielems=0, elems=[];
var wastdcheck=tdcheck;

if (tdcheck) {
setTimeout(dodoms, 1000); //setInterval(dodoms, 1000);
tdcheck=false;

if (document.URL.indexOf('/chess') != -1 && document.URL.indexOf('traditional=') != -1 && document.URL.indexOf('traditional=mayhem') == -1) {
setTimeout(dsumsel, 5000);
setTimeout(checkstartcheck, 3000);
}

if (document.getElementById('td32')) { eightoh=document.getElementById('td32').outerHTML.split('>')[0] + '></td>'; }

if (document.URL.indexOf('/chess') != -1) {
document.getElementById('clone').style.display='none';
}

if (shuffle) {
document.getElementById('spmore').innerHTML='<a title="Set your own sentence for the user to unscramble." style=text-decoration:none;cursor:pointer; onclick=askmore();>+</a>';
}

if (yourblurb != '') {
if (!document.getElementById('ddcolour')) {
document.getElementById('source').innerHTML=yourblurb;
}
yourblurb='';
}

if (sourcenum <= 0 && !sdone) {
var sncx=document.getElementById('source').innerText;
var swordsx=sncx.split(' ');
if (tdnum == 9 && document.URL.indexOf('tdnum=') == -1) {
tdnum=eval('' + swordsx.length);
}
} else if (sourcenum != 1 && !sdone && tdnum == 9) {
tdnum=eval('' + sourcenum);
}

if (tdnum == 3) {
if (document.getElementById('tr3')) {
document.getElementById('tr3').style.display='none';
document.getElementById('tr2').style.display='none';
}
document.getElementById('td11').rowspan='3';
document.getElementById('td12').rowspan='3';
document.getElementById('td13').rowspan='3';
} else if (tdnum == 6) {
if (document.getElementById('tr3')) {
document.getElementById('tr3').style.display='none';
}
document.getElementById('td21').rowspan='2';
document.getElementById('td22').rowspan='2';
document.getElementById('td23').rowspan='2';
} else if (tdnum < 9) {
if (document.getElementById('td33')) {
for (ifirst=9; ifirst>tdnum; ifirst--) {
document.getElementById(firsttogo).style.display='none';
firsttogo=firsttogo.replace('td12','tdx11').replace('td21','tdx12').replace('td21','tdx13').replace('td22','tdx21').replace('td23','tdx22').replace('td31','tdx23').replace('td32','tdx31').replace('td33','tdx32').replace('tdx','td');
}
}
} else if (tdnum > 9) {
var arow='', rownum=4;
if (document.getElementById('target').innerHTML.indexOf('td221') != -1 && document.URL.indexOf('/chess') != -1) {
var wastheih=document.getElementById('target').innerHTML;
//ouralert(wastheih);
for (var ijkx=1; ijkx<=tdnum; ijkx++) {
wastheih=wastheih.replace('>' + ijkx + '<', '><');
}
document.getElementById('target').innerHTML=wastheih;
} else {
for (var ijk=10; ijk<=tdnum; ijk++) {
if (eval(ijk % 3) == 1) {
rownum=eval(1 + eval(eval(-1 + ijk) / 3));
arow='<t' + 'r id=tr' + rownum + '><t' + 'd id=td' + rownum + '1>' + ijk + '</t' + 'd></t' + 'r>';
//ouralert('1:' + ijk + ' ' + arow);
} else if (eval(ijk % 3) == 0) {
arow=arow.replace('</t' + 'r>', '<t' + 'd id=td' + rownum + '3>' + ijk + '</t' + 'd></t' + 'r>');
//ouralert('2:' + ijk + ' ' + arow);
document.getElementById('mytable').innerHTML+=arow;
arow='';
} else {
arow=arow.replace('</t' + 'r>', '<t' + 'd id=td' + rownum + '2>' + ijk + '</t' + 'd></t' + 'r>');
//ouralert('3:' + ijk + ' ' + arow);
}
}
}
document.getElementById('mytable').innerHTML+=arow;
}
}

if (across != 3) {
var sofartd='', two=2;
var wasih=document.getElementById('mytable').innerHTML;
var rowas=wasih.split('</' + 'tr>');
for (irws=1; irws<rowas.length; irws++) {
if (rowas[irws].length > 3 && rowas[irws].replace(String.fromCharCode(10),'').indexOf('</') != 0) {
wasih=wasih.replace(rowas[eval(-1 + irws)] + '</' + 'tr>', rowas[eval(-1 + irws)] + '<!-' + '-/' + 'tr>');
}
}
rowas=wasih.split('<t' + 'r');
for (irws=2; irws<rowas.length; irws++) {
if (rowas[irws].length > 3) {
wasih=wasih.replace('<t' + 'r' + rowas[irws], '<t' + 'r' + rowas[irws].replace(rowas[irws].split('>')[0] + '>', '-' + '->'));
}
}
rowas=wasih.split('</t' + 'd>');
for (irws=0; irws<rowas.length; irws++) {
if (eval(eval(1 + irws) % across) == 0) {
sofartd+=rowas[irws] + '</t' + 'd>';
wasih=wasih.replace(sofartd, sofartd + '</t' + 'r><t' + 'r id=tr' + two + '>');
sofartd='';
two++;
} else {
sofartd+=rowas[irws] + '</t' + 'd>';
}
}
document.getElementById('mytable').innerHTML=wasih;
}

if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1){
document.getElementById(sourceid).setAttribute('contenteditable',false);
document.getElementById('strongs').innerHTML='';
}
if (clonedata != document.getElementById(sourceid).innerHTML) {
clonedata=document.getElementById(sourceid).outerHTML.replace(' id=', ' data-id=');
if (!document.getElementById('callback') && document.URL.indexOf('/chess') == -1) { document.getElementById('clone').style.display='inline-block'; }
}
if (sourcenum != 1 && !sdone) {
sdone=true;
var snc=document.getElementById('source').innerText;
//alert(snc + ' ' + shuffle);
origsnc=snc;
var swords=snc.split(' ');
var ourone=1, onepos=0;
var sarr=[], sarrsofar=',';
var ccbit=' cellpadding=0 cellspacing=0 ', onerand='';
var spanstuff='', kspan=0;
if (eval('' + sourcenum) == eval('' + swords.length) || eval('' + sourcenum) <= 0 || shuffle) {
if (eval('' + sourcenum) <= 0) { sourcenum=eval('' + swords.length); }
for (var inb=0; inb<sourcenum; inb++) {

if (!shuffle) {
//ouralert('*' + swords[inb] + '*');
sarr.push(inb);
} else {
if (sarrsofar == ',') {
onerand='' + Math.floor(Math.random() * sourcenum);
sarrsofar+='' + onerand + ',';
sarr.push(eval(onerand));
} else {
while (sarrsofar.indexOf(',' + onerand + ',') != -1) {
onerand='' + Math.floor(Math.random() * sourcenum);
}
sarrsofar+='' + onerand + ',';
sarr.push(eval(onerand));
}
}

}
ourone=-1;
ccbit=' cellpadding=2 cellspacing=0 ';
setInterval(shufflegamecheck, 3000);
} else if (eval('' + snc.length) > eval('' + sourcenum)) {
ourone=Math.floor(eval(eval('' + snc.length) / eval('' + sourcenum)));
}
//alert('sourcenum=' + sourcenum + ' originalsn.originalsh=' + originalsn + '.' + originalsh);
for (kspan=0; kspan<eval('' + sourcenum); kspan++) {
if (ourone < 0) {
spanstuff+='<span data-piece="' + cpa[kspan] + '" class=source draggable="true" id=span' + kspan + cbi('>' + ('' + swords[sarr[kspan]]).replace(/undefined$/g, '')) + '</span>';
} else if (eval(eval('' + onepos) + eval('' + ourone)) < eval('' + snc.length) && eval(1 + kspan) != eval('' + sourcenum)) {
spanstuff+='<span data-piece="' + cpa[kspan] + '" class=source draggable="true" id=span' + kspan + cbi('>' + snc.substring(onepos).substring(0,ourone)) + '</span>';
} else if (eval('' + onepos) < eval('' + snc.length)) {
//ouralert(snc.substring(onepos));
spanstuff+='<span data-piece="' + cpa[kspan] + '" class=source draggable="true" id=span' + kspan + cbi('>' + snc.substring(onepos)) + '</span>';
} else {
spanstuff+='<span data-piece="' + cpa[kspan] + '" class=source draggable="true" id=span' + kspan + '> </span>';
}
onepos+=ourone;
}
//alert('onepos=' + onepos);
//ouralert(888);
document.getElementById('dsource').innerHTML='<ta' + 'ble' + ccbit + ' id=source style="background-color:#f0f0f0;"><t' + 'r>' + butwhatifchessgame(spanstuff.replace(/span/g, 'th')) + '</t' + 'r></ta' + 'ble><br>';
//document.getElementById('dsource').style.textAlign='left';
if (document.getElementById('mybut') && originalsn <= 0 && originalsh) {
document.getElementById('mybut').innerHTML='Piece Sentence Back Together Again Game';
document.getElementById('dsource').style.width='100%';
document.getElementById('dsource').style.display='inline-block';
document.getElementById('source').align='left';
} //else {
//ouralert(originalsn);
//ouralert(originalsh);
//}
setTimeout(aathen, 50);
setTimeout(cloneize, 100);

if (wastdcheck && document.URL.indexOf('/chess') != -1) {
document.title='Chess Game Practice';
if (document.URL.indexOf('traditional=') != -1) {
document.getElementsByTagName('h4')[0].style.marginTop='-22px';
document.getElementById('target').style.marginTop='-5px';
}

if (1 == 1) {
setTimeout(laterjig, 3000);
} else {
if (document.URL.indexOf(deq('draughts')) != -1) {
var thisda='', thisdq='';
var dtds=document.getElementsByTagName('td');
for (var idts=0; idts<dtds.length; idts++) {
thisda=('' + dtds[idts].getAttribute('data-answer')).replace(/^null$/g,'').replace(/^undefined$/g,'');
if (thisda.replace('0','') != '' && thisda.indexOf('-') != -1 && dtds[idts].innerHTML == '') {
thisdq=('' + dtds[idts].getAttribute('data-square')).replace(/^null$/g,'').replace(/^undefined$/g,'');
//alert(thisda + ' ' + thisdq);
dtds[idts].innerHTML='<span style="font-size:60px;" data-ontouchstart="fit(this);" onmouseover="fit(this);" onclick="fit(this);" data-piece="' + thisda.split('-')[0] + '" class="source" draggable="true" id="span' + thisdq + '">&#' + thisda.split('-')[1] + ';</span>';
//alert(startboard);
adddrop('span' + thisdq);
}
}
}
}


//var rectis=document.getElementsByTagName('td')[0].getBoundingClientRect();
var rectis=document.getElementById('td11').getBoundingClientRect();
var perch=eval(100 * eval('' + screen.height) / eval(eval('' + rectis.height) * 8));
//document.getElementById('mytable').style.height='' + perch + '%';
//document.getElementById('dstyle').innerHTML='<style> #mytable { height: ' + perch + '%; } td { min-height: 12.5%; } </style>';
//alert('' + rectis.height + ' ' + eval(eval('' + rectis.height) * 8));
//document.getElementById('dstyle').innerHTML='<style> html, body , .outer, .inner { height:100%; width:100%; margin:0; } #target { display:block; height: ' + eval(eval('' + rectis.height) * 8) + 'px !important; min-height:100%; } #mytable { display:block; height: ' + eval(eval('' + rectis.height) * 8) + 'px !important; } tr { height: ' + rectis.height + 'px !important; } </style>';
var tbit=' ';
var ourgreen='green';
if (document.URL.indexOf(deq('draughts')) != -1) {
ourgreen='blue';
} else if (document.URL.indexOf(deq('makyek')) != -1) {
ourgreen='magenta';
}
if (document.URL.indexOf(deq('draughts')) != -1 || 1 == 1) { tbit=' margin-top: -34px !important; '; }
document.getElementById('dstyle').innerHTML='<style> h1 { margin-top: -12px; overflow-x: hidden; text-overflow-x: ellipsis; } #pstatus { vertical-align: bottom; overflow-x: hidden; text-overflow-x: ellipsis; font-size: 12px; white-space: nowrap; } body { background-image: linear-gradient(#f0f0f0, #f2f2f2, #f4f4f4, #f6f6f6, #f8f8f8, #fafafa) !important; } #target { ' + tbit + ' border-right: 1px solid transparent !important; background-color: white; } #mytable { border-right: 1px solid transparent !important; } tr { height: ' + eval(4 + eval('' + rectis.height)) + 'px !important; } td { border: 2px dashed ' + ourgreen + '; } #pwhite { background-color: white !important; } #pblack { background-color: white !important; } </style>';

rejig();
}
}

function laterjig() {
if (document.URL.indexOf(deq('draughts')) != -1) {
var thisda='', thisdq='';
var dtds=document.getElementsByTagName('td');
for (var idts=0; idts<dtds.length; idts++) {
thisda=('' + dtds[idts].getAttribute('data-answer')).replace(/^null$/g,'').replace(/^undefined$/g,'');
if (thisda.replace('0','') != '' && thisda.indexOf('-') != -1 && dtds[idts].innerHTML == '') {
thisdq=('' + dtds[idts].getAttribute('data-square')).replace(/^null$/g,'').replace(/^undefined$/g,'');
//alert(thisda + ' ' + thisdq);
dtds[idts].innerHTML='<span style="font-size:60px;" data-ontouchstart="fit(this);" onmouseover="fit(this);" onclick="fit(this);" data-piece="' + thisda.split('-')[0] + '" class="source" draggable="true" id="span' + thisdq + '">&#' + thisda.split('-')[1] + ';</span>';
//alert(startboard);
adddrop('span' + thisdq);
}
}
}
}

function rejig() {
var eword="touchdown";
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) || (trad.trim().indexOf('_') != -1 && amove.trim() != '')) {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { eword="click"; }
if (document.URL.indexOf('traditional=') != -1) {
var ts=26;
if (document.getElementsByTagName('h1')[0].innerHTML.indexOf(' Drop') != -1) {
ts=eval(5 + eval('' + document.getElementsByTagName('h1')[0].innerHTML.indexOf(' Drop')));
}
var huhih=document.getElementsByTagName('h1')[0].innerHTML.substring(ts);
if (huhih.indexOf('Discrete Touch') == -1 && eword == "touchdown") {
document.getElementsByTagName('h1')[0].innerHTML="Discrete<a style=text-decoration:none;cursor:pointer; title=Menu onclick='location.href=document.URL.split(String.fromCharCode(63))[0].split(String.fromCharCode(35))[0];'> </a>Touch" + huhih;
}
}
//document.body.addEventListener("touchdown", (ev) => { gev=ev; refit(ev); });
document.getElementById('mytable').addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
if (1 == 1) {
elems=document.getElementsByTagName('td');
for (ielems=0; ielems<elems.length; ielems++) {
if (('' + elems[ielems].className) == 'black' || ('' + elems[ielems].className) == 'white') {
//document.title='set1';
elems[ielems].addEventListener(eword, (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
if (eword == "touchdown" && amove != "" && movefrom != -1 && moveto != -1) {
if (elems[ielems].outerHTML.indexOf(' data-square="' + movefrom + "'") != -1) {
if (tds[itds].innerHTML.indexOf('</span>') != -1) {
document.getElementById(tds[itds].innerHTML.split(' id="')[1].split('"')[0]).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
} else {
elems[ielems].addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
}
}
if (elems[ielems].outerHTML.indexOf(' data-square="' + moveto + "'") != -1) {
if (tds[itds].innerHTML.indexOf('</span>') != -1) {
document.getElementById(tds[itds].innerHTML.split(' id="')[1].split('"')[0]).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
} else {
elems[ielems].addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
}
}
}

}
}
elems=document.getElementsByTagName('span');
for (ielems=0; ielems<elems.length; ielems++) {
if (('' + elems[ielems].className) == 'source') {
//if (document.title.replace('set1','') == '') { document.title+='set2'; }
elems[ielems].addEventListener(eword, (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
}
}
elems=document.getElementsByTagName('th');
for (ielems=0; ielems<elems.length; ielems++) {
if (('' + elems[ielems].className) == 'source') {
//if (document.title.replace('set1set2','') == '') { document.title+='set3'; }
elems[ielems].addEventListener(eword, (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } });
}
}
}
}

if (movefrom != -1 && moveto != -1) {
var tds=document.getElementsByTagName('td');
for (var itds=0; itds<tds.length; itds++) {
if (tds[itds].outerHTML.indexOf(' data-square="' + movefrom + '"') != -1) {
//alert('here');
if (tds[itds].innerHTML.indexOf('</span>') != -1) {
document.getElementById(tds[itds].innerHTML.split(' id="')[1].split('"')[0]).click();
} else {
tds[itds].click();
}
}
}
nextmove=moveto;
movefrom=-1;
moveto=-1;
}

}


// https://www.puzzles-on-line-niche.com/images/Rebus1pictograph.jpg#0#0#150#120 https://www.puzzles-on-line-niche.com/images/Rebus1pictograph.jpg#150#0#150#120 https://www.puzzles-on-line-niche.com/images/Rebus1pictograph.jpg#0#120#150#120 https://www.puzzles-on-line-niche.com/images/Rebus1pictograph.jpg#150#120#150#120
function cbi(insw) { // #leftoff#topoff#width#height
var outsw=insw;
var ourbp='';
var ourbs='background-size:contain;width:80px;height:80px;';
if (insw.substring(1).toLowerCase().replace(/^\/\//g, 'http://').replace('https:','http:').indexOf('http:') == 0) {
if (eval('' + insw.substring(1).split('#').length) >= 2) {
if (eval('' + insw.substring(1).split('#').length) >= 3) {
if (eval('' + insw.substring(1).split('#').length) < 5) {
ourbp='background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;';
ourbs=' background-size:80px 80px;width:80px;height:80px;';
ourbs+=ourbp;
outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1);
} else {
ourbp='background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;';
//ourbs=' 80px 80px;width:80px;height:80px;';
ourbs=' background-size:' + insw.substring(1).split('#')[3] + 'px ' + insw.substring(1).split('#')[4] + 'px;background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;width:' + insw.substring(1).split('#')[3] + 'px;height:' + insw.substring(1).split('#')[4] + 'px;';
ourbs=' width:' + insw.substring(1).split('#')[3] + 'px;height:' + insw.substring(1).split('#')[4] + 'px;';
ourbs+=ourbp;
outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1);
}
} else {
ourbs+=ourbp;
outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1);
}
} else {
ourbs+=ourbp;
outsw=' style="background:URL(' + insw.substring(1) + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1);
}
} else if (insw.substring(1).toLowerCase().indexOf('data:image/') == 0) {
if (eval('' + insw.substring(1).split('#').length) >= 2) {
if (eval('' + insw.substring(1).split('#').length) >= 3) {
if (eval('' + insw.substring(1).split('#').length) < 5) {
ourbp='background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;';
ourbs=' background-size:80px 80px;width:80px;height:80px;';
ourbs+=ourbp;
outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1);
} else {
ourbp='background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;';
//ourbs=' background-size:80px 80px;width:80px;height:80px;';
ourbs=' background-size:' + insw.substring(1).split('#')[3] + 'px ' + insw.substring(1).split('#')[4] + 'px;background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;width:' + insw.substring(1).split('#')[3] + 'px;height:' + insw.substring(1).split('#')[4] + 'px;';
ourbs=' width:' + insw.substring(1).split('#')[3] + 'px;height:' + insw.substring(1).split('#')[4] + 'px;';
ourbs+=ourbp;
outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1);
}
} else {
ourbs+=ourbp;
outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1);
}
} else {
ourbs+=ourbp;
outsw=' style="background:URL(' + insw.substring(1) + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1);
}
}
return outsw;
}

function workouralert(insg) {
var outsg=insg;
//ouralert('' + sourcenum + ' 1:' + insg);
for (var ii=sourcenum; ii>=1; ii--) {
if (outsg.indexOf('' + ii + 'http') != -1) {
outsg=outsg.replace('' + ii + 'http', 'http');
//ouralert('0:' + outsg);
} else {
outsg=outsg.replace('' + ii, '');
}
}
// ouralert('2:' + outsg);
insg=outsg;
outsg='';
for (var iii=0; iii<insg.length; iii++) {
if (insg.charAt(iii) <= ' ') {
outsg+=' ';
} else {
outsg+=insg.substring(iii).substring(0,1);
}
}
//ouralert('3:' + outsg);
while (outsg.indexOf(' ') != -1) {
outsg=outsg.replace(' ', ' ');
}
//ouralert('4:' + outsg);
return outsg;
}

function shufflegamecheck() {
if (document.URL.indexOf('/chess') == -1) {
if (document.getElementById('source').innerText.trim() == '' && !bdone) {
if (workouralert(document.getElementsByTagName('tab' + 'le')[1].innerText).trim() == origsnc.trim()) {
bdone=true;
ouralert('Congratulations on piecing back together ... ' + String.fromCharCode(10) + String.fromCharCode(10) + origsnc);
} else {
bdone=true;
ouralert('Bad luck not piecing back together ... ' + String.fromCharCode(10) + String.fromCharCode(10) + origsnc + String.fromCharCode(10) + String.fromCharCode(10) + " ... when you got ... " + String.fromCharCode(10) + String.fromCharCode(10) + workouralert(document.getElementsByTagName('tab' + 'le')[1].innerText).trim());
}
location.href=document.URL;
}
}
}

function aathen() {
prefx='th';
if (document.getElementById('span0')) { prefx='span'; document.getElementById('dsource').style.display='none'; }
for (var kspan=0; kspan<eval('' + sourcenum); kspan++) {
//ouralert(document.getElementById(prefx + kspan).outerHTML);
if (prefx == 'span') {
if (document.getElementById(prefx + kspan)) {
document.getElementById(prefx + kspan).onclick=function(event) { lastoh=event.target.outerHTML; lastih='>' + event.target.innerHTML + '<'; };
}
}
if (document.getElementById(prefx + kspan)) {
document.getElementById(prefx + kspan).addEventListener("dragstart", (ev) => {
console.log("dragStart at " + document.URL);
dragh=false;
lohfulloh='';
ppt=false;
console.log("lohfulLoh=" + lohfulloh);
sourceid='' + fit(ev.target).id;
if (lastoh != '') { dragh=true; }
// Change the source element's background color
// to show that drag has started
ev.currentTarget.classList.add("dragging");
// Clear the drag data cache (for all formats/types)
ev.dataTransfer.clearData();
// Set the drag's format and data.
// Use the event target's id for the data
ev.dataTransfer.setData("text/plain", ev.target.id);
//ouralert(ev.target.outerHTML);
if (document.URL.indexOf('/chess') != -1) {
if (!dragh) { ouralert('It is not your turn'); }
}
});
document.getElementById(prefx + kspan).addEventListener("dragend", (ev) =>
fittwo(ev.target).classList.remove("dragging")
);
}
}
//ouralert(spanstuff);
}
}

function bodyev() {
if (document.getElementById('clone').innerHTML.indexOf(' ...') == -1) {
document.getElementById('clone').innerHTML+=' ... Double click (or right click) where you want clone to be';
}
document.body.ondblclick=function(e) {
e = e || window.event;
//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
// document.title='e.preventDefault(); //2';
//}
e.preventDefault();

if (e.touches) {
if (e.touches[0].pageX) {
pos3 = e.touches[0].pageX;
pos4 = e.touches[0].pageY;
} else {
pos3 = e.touches[0].clientX;
pos4 = e.touches[0].clientY;
}
console.log('pos3=' + pos3 + ',pos4=' + pos4);
} else if (e.clientX || e.clientY) {
pos3 = e.clientX;
pos4 = e.clientY;
} else {
pos3 = e.pageX;
pos4 = e.pageY;
}

if (clonedata.indexOf(' style="') != -1) {
document.getElementById('scratchpad').innerHTML+=clonedata.replace(' style="', ' style="position:absolute;left:' + pos3 + 'px;top:' + pos4 + 'px;');
} else if (clonedata.indexOf(" style='") != -1) {
document.getElementById('scratchpad').innerHTML+=clonedata.replace(" style='", " style='position:absolute;left:" + pos3 + "px;top:" + pos4 + "px;");
} else {
document.getElementById('scratchpad').innerHTML+=clonedata.replace(' ', ' style="position:absolute;left:' + pos3 + 'px;top:' + pos4 + 'px;" ');
}
};

document.body.oncontextmenu=function(e) {
e = e || window.event;
//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
// document.title='e.preventDefault(); //3';
//}
e.preventDefault();

if (e.touches) {
if (e.touches[0].pageX) {
pos3 = e.touches[0].pageX;
pos4 = e.touches[0].pageY;
} else {
pos3 = e.touches[0].clientX;
pos4 = e.touches[0].clientY;
}
console.log('pos3=' + pos3 + ',pos4=' + pos4);
} else if (e.clientX || e.clientY) {
pos3 = e.clientX;
pos4 = e.clientY;
} else {
pos3 = e.pageX;
pos4 = e.pageY;
}

if (clonedata.indexOf(' style="') != -1) {
document.getElementById('scratchpad').innerHTML+=clonedata.replace(' style="', ' style="position:absolute;left:' + pos3 + 'px;top:' + pos4 + 'px;');
} else if (clonedata.indexOf(" style='") != -1) {
document.getElementById('scratchpad').innerHTML+=clonedata.replace(" style='", " style='position:absolute;left:" + pos3 + "px;top:" + pos4 + "px;");
} else {
document.getElementById('scratchpad').innerHTML+=clonedata.replace(' ', ' style="position:absolute;left:' + pos3 + 'px;top:' + pos4 + 'px;" ');
}
};

}

function andlaterstill() {
if (document.URL.indexOf('/chess') == -1) {
if (tdid != '') {
//ouralert(8188);
document.getElementById(tdid).innerHTML=document.getElementById(tdid).innerHTML.substring(0,1);
} else if (document.getElementById('mytable').innerHTML.indexOf(clonedatatwo) != '') {
//ouralert(8288);
document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.split('</ta' + 'ble>')[0] + '</ta' + 'ble>';
}
if (document.getElementsByTagName('div')[0].innerHTML.indexOf(clonedatatwo) != -1) {
//ouralert(8388);
document.getElementsByTagName('div')[0].innerHTML=document.getElementsByTagName('div')[0].innerHTML.replace(clonedatatwo,'');
} else if (document.getElementsByTagName('div')[0].innerHTML.indexOf(clonedatatwo.replace('dragging','')) != -1) {
//ouralert(8488);
document.getElementsByTagName('div')[0].innerHTML=document.getElementsByTagName('div')[0].innerHTML.replace(clonedatatwo.replace('dragging',''),'');
} else if (document.body.innerHTML.split('<ta' + 'ble')[0].indexOf(clonedatatwo.replace('dragging','')) != -1) {
//ouralert(8588);
document.body.innerHTML=document.body.innerHTML.replace(document.body.innerHTML.split('<ta' + 'ble')[0], document.body.innerHTML.split('<ta' + 'ble')[0].replace(clonedatatwo.replace('dragging',''),''));
} else if (document.body.innerHTML.split('<ta' + 'ble')[0].indexOf(clonedatatwo) != -1) {
//ouralert(8688);
document.body.innerHTML=document.body.innerHTML.replace(document.body.innerHTML.split('<ta' + 'ble')[0], document.body.innerHTML.split('<ta' + 'ble')[0].replace(clonedatatwo,''));
}
}
tdid='';
}

function andlater() {
var squares=document.getElementsByTagName('td');

for (var ii=1; ii<=tdnum; ii++) {
if (squares[eval(-1 + ii)].innerHTML.indexOf('<') != -1) {
tdid='' + squares[eval(-1 + ii)].id;
}
}
console.log('tdid=' + tdid);
setTimeout(andlaterstill, 100);
}

function scramble() {
if (!document.getElementById('callback')) {
var iso=0, sofar=',';
var squares=document.getElementsByTagName('td');
secs++;
document.getElementById('score').innerHTML='Score: ' + score + '/' + secs + ' seconds';

for (var ii=1; ii<=tdnum; ii++) {
iso=eval(1 + Math.min(eval(-1 + tdnum),Math.floor(Math.random() * tdnum)));
while (sofar.indexOf(',' + iso + ',') != -1) {
iso=eval(1 + Math.min(eval(-1 + tdnum),Math.floor(Math.random() * tdnum)));
}
squares[eval(-1 + ii)].innerHTML='' + iso + squares[eval(-1 + ii)].innerHTML.substring(1);
sofar+='' + iso + ',';
}
}
}

function scoreingame() {
if (document.URL.indexOf('/chess') == -1) {
if (!document.getElementById('callback')) { setInterval(scramble, 1000); }
} else if (document.URL.indexOf(deq('draughts')) != -1) {
window.open('https://wikipedia.org/wiki/English_draughts', '_blank', 'top=100,left=100,height=600,width=600');
location.href=document.URL.split('?')[0].split('#')[0] + '?traditional=draughts&bname=' + encodeURIComponent(playerb) + '&wname=' + encodeURIComponent(playerw);
} else if (document.URL.indexOf(deq('makyek')) != -1) {
window.open('https://wikipedia.org/wiki/Mak-yek', '_blank', 'top=100,left=100,height=600,width=600');
location.href=document.URL.split('?')[0].split('#')[0] + '?traditional=makyek&bname=' + encodeURIComponent(playerb) + '&wname=' + encodeURIComponent(playerw);
} else {
window.open('https://wikipedia.org/wiki/Chess', '_blank', 'top=100,left=100,height=600,width=600');
location.href=document.URL.split('?')[0].split('#')[0] + '?traditional=chess&bname=' + encodeURIComponent(playerb) + '&wname=' + encodeURIComponent(playerw);
}
}

function ouronl() {
for (var i = 0; i < langs.length; i++) {
select_language.options[i] = new Option(langs[i][0], i);
}
// Set default language / dialect ... thanks to Google https://www.google.com/intl/en/chrome/demos/speech.html
select_language.selectedIndex = 10;
updateCountry();
noway=false;
select_dialect.selectedIndex = 11;
showInfo('info_start');
if (document.URL.indexOf('rjmprogramming-com-au.translate.goog') != -1) {
document.getElementById('select_language').style.display='none';
if (window.parent != window) {
noway=noway;
} else if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i)) {
if (window.outerWidth > window.outerHeight) {
document.getElementById('score').scrollIntoView();
} //else {
//var wasthisso=('' + (screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation);
//document.getElementById('score').innerHTML+=' ' + 'wasthisso=';
//document.getElementById('score').innerHTML+=' ' + wasthisso;
//if (('' + wasthisso).indexOf('landscape') != -1) {
//document.getElementById('score').scrollIntoView();
//}
//}
}
}
}

function showInfo(s) { // thanks to Google https://www.google.com/intl/en/chrome/demos/speech.html
if (s) {
for (var child = info.firstChild; child; child = child.nextSibling) {
if (child.style) {
child.style.display = child.id == s ? 'inline' : 'none';
}
}
//info.style.visibility = 'visible';
} else {
info.style.visibility = 'hidden';
}
}

function updateCountry() { // thanks to Google https://www.google.com/intl/en/chrome/demos/speech.html
for (var i = select_dialect.options.length - 1; i >= 0; i--) {
select_dialect.remove(i);
}
var list = langs[select_language.selectedIndex];
for (var i = 1; i < list.length; i++) {
select_dialect.options.add(new Option(list[i][1], list[i][0]));
}
select_dialect.style.visibility = list[1].length == 1 ? 'hidden' : 'hidden';
if (!noway) {
// https://www-rjmprogramming-com-au.translate.goog/HTMLCSS/emoji_object_game.php?_x_tr_sch=http&_x_tr_sl=en&_x_tr_tl=de&_x_tr_hl=en
//alert(select_dialect.value);
if (document.URL.indexOf('rjmprogramming-com-au.translate.goog') == -1 && document.URL.indexOf('//') != -1) {
//location.href='//www-rjmprogramming-com-au.translate.goog/HTMLCSS/emoji_object_game.php?_x_tr_sch=http&_x_tr_sl=en&_x_tr_tl=' + select_dialect.value.split('-')[0] + '&_x_tr_hl=en';
location.href='//www-rjmprogramming-com-au.translate.goog' + document.URL.split('//')[1].split('?')[0].split('#')[0].replace(document.URL.split('//')[1].split('/')[0],'') + '?_x_tr_sch=http&_x_tr_sl=en&_x_tr_tl=' + select_dialect.value.split('-')[0] + '&_x_tr_hl=en';
}
}
}


//setTimeout(cloneize, 2000);

</script>
<style>
div {
margin: 0.5em 0;
padding: 2em;
}

#target,
#source {
border: 1px solid black;
padding: 0.5rem;
}

.dragging {
background-color: pink;
}

td {
border: 1px dotted green;
}

</style>
</head>
<body onload="if (1 == 1) { cloneize(); } score=(location.search.split('score=')[1] ? eval('' + decodeURIComponent(location.search.split('score=')[1].split('&')[0])) : 0); secs=(location.search.split('secs=')[1] ? eval('' + decodeURIComponent(location.search.split('secs=')[1].split('&')[0])) : 0); if (eval(score + secs) != 0) { document.getElementById('score').innerHTML='Score ' + score + '/' + secs; } ouronl(); ">
<h1>Experimental Drag and Drop <button id="mybut" onclick="scoreingame();">Game</button> <select id="select_language" onchange="updateCountry();" style=display:NONE;><option value="0">Afrikaans</option><option value="1">አማርኛ</option><option value="2">Azərbaycanca</option><option value="3">বাংলা</option><option value="4">Bahasa Indonesia</option><option value="5">Bahasa Melayu</option><option value="6">Català</option><option value="7">Čeština</option><option value="8">Dansk</option><option value="9">Deutsch</option><option value="10">English</option><option value="11">Español</option><option value="12">Euskara</option><option value="13">Filipino</option><option value="14">Français</option><option value="15">Basa Jawa</option><option value="16">Galego</option><option value="17">ગુજરાતી</option><option value="18">Hrvatski</option><option value="19">IsiZulu</option><option value="20">Íslenska</option><option value="21">Italiano</option><option value="22">ಕನ್ನಡ</option><option value="23">ភាសាខ្មែរ</option><option value="24">Latviešu</option><option value="25">Lietuvių</option><option value="26">മലയാളം</option><option value="27">मराठी</option><option value="28">Magyar</option><option value="29">ລາວ</option><option value="30">Nederlands</option><option value="31">नेपाली भाषा</option><option value="32">Norsk bokmål</option><option value="33">Polski</option><option value="34">Português</option><option value="35">Română</option><option value="36">සිංහල</option><option value="37">Slovenščina</option><option value="38">Basa Sunda</option><option value="39">Slovenčina</option><option value="40">Suomi</option><option value="41">Svenska</option><option value="42">Kiswahili</option><option value="43">ქართული</option><option value="44">Հայերեն</option><option value="45">தமிழ்</option><option value="46">తెలుగు</option><option value="47">Tiếng Việt</option><option value="48">Türkçe</option><option value="49">اُردُو</option><option value="50">Ελληνικά</option><option value="51">български</option><option value="52">Pусский</option><option value="53">Српски</option><option value="54">Українська</option><option value="55">한국어</option><option value="56">中文</option><option value="57">日本語</option><option value="58">हिन्दी</option><option value="59">ภาษาไทย</option></select></h1>
<h3>RJM Programming <span id=spmore>-</span> July, 2023</h3>
<h3 id="score"></h3>
<h4 id=myh4>Thanks to <a target=_blank title='https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData' href='//developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData'>https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData</a></h4>
<div id=dsource>
<p id="source" class="source" draggable="true" contenteditable="true" style="background-color:#f0f0f0;">
Select this <strong id=strongs>editable</strong> element, drag it to the drop zone and then release the selection
to move the element.
</p>
</div>
<div id="target">Drop Zone
<table style="width:90%;height:30%;" id="mytable">
<tr id=tr1><td id="td11">1</td><td id="td12">2</td><td id="td13">3</td></tr>
<tr id=tr2><td id="td21">4</td><td id="td22">5</td><td id="td23">6</td></tr>
<tr id=tr3><td id="td31">7</td><td id="td32">8</td><td id="td33">9</td></tr>
</table>
</div>

<button id="reset">Reset example</button> <button id="clone" style="display:none;" onclick="bodyev();">Clone content</button>
<div id=scratchpad></div>
<script type=text/javascript>

function aaathen() { //evtarget) {
// ouralert(lastevid);
// if (!document.getElementById(lastevid)) {
// if (document.getElementById(lastevid.replace('x',''))) {
// lastevid=lastevid.replace('x','');
// } else {
lastevid=lastevid.replace('th','span');
// }
// }
evtarget=document.getElementById(lastevid);
if (evtarget && document.getElementById('mytable').innerHTML.indexOf('</span>') != -1 && 1 == 7) {
console.log(' ... ' + evtarget.id);
if (document.getElementById('mytable').innerHTML.indexOf('</th>') != -1 || document.getElementById('mytable').innerHTML.indexOf('</span>') != -1) {
//ouralert('Here');
var hostevid=document.getElementById('mytable').innerHTML.split(evtarget.outerHTML)[0].split(' id="')[1].split('"')[0];
document.getElementById(hostevid).innerHTML=evtarget.outerHTML.replace(/th/g, 'span');
evtarget=document.getElementById(lastevid);
}
evtarget.setAttribute('draggable', true);
evtarget.addEventListener("dragstart", (ev) => {
console.log("dragStart At " + document.URL);
dragh=false;
lohfulloh='';
ppt=false;
console.log("lohfullOh=" + lohfulloh);
sourceid='' + fit(ev.target).id;
if (lastoh != '') { dragh=true; }
// Change the source element's background color
// to show that drag has started
ev.currentTarget.classList.add("dragging");
// Clear the drag data cache (for all formats/types)
ev.dataTransfer.clearData();
// Set the drag's format and data.
// Use the event target's id for the data
ev.dataTransfer.setData("text/plain", ev.target.id);
if (document.URL.indexOf('/chess') != -1) {
if (!dragh) { ouralert('It is not your turn'); }
}
});
evtarget.addEventListener("dragend", (ev) =>
fittwo(ev.target).classList.remove("dragging")
);
console.log(' .+. ' + evtarget.id);
}
}

function lastohit() {
var thtoundo='';
if (lastoh != '') {
if (prefx == 'span' && lastoh.indexOf('<span') != 0) { return ''; } //else if (prefx == 'span') { ouralert('oops ' + lastoh); }
if (1 == 2 && document.getElementById('target').innerHTML.indexOf(lastoh.split('>')[0] + '>') != -1) { // && lastoh.substring(0,3) != '<th') { //document.getElementById('source').innerHTML.indexOf(lastoh.split('>')[0] + '>') == -1 && document.getElementById('source').innerHTML.indexOf(lastoh.replace('>', ' style="cursor: progress;">').split('>')[0] + '>') == -1) {
//ouralert('3:' + lastoh);
tdtoundo=document.getElementById('target').innerHTML.split(lastoh.split('>')[0] + '>')[0].split(' id="')[eval(-1 + document.getElementById('target').innerHTML.split(lastoh.split('>')[0] + '>')[0].split(' id="').length)].split('"')[0]
//if (lastoh.indexOf('<span') == 0) { document.getElementById(lastid).style.display='none'; }
lastevid=lastoh.split(' id="')[1].split('"')[0];
//document.getElementById(lastevid).style.visibility='hidden';
//ouralert('8788 ' + lastoh);
document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastih, '>⁠' + lastoh.replace(' id="', ' id="x').replace(/th/g, 'span').replace(' dragXgable=', ' data-draggable=') + '<');
lastevid='x' + lastoh.split(' id="')[1].split('"')[0];
document.getElementById(tdtoundo).innerHTML='';
setTimeout(aaathen, 2000); //(document.getElementById(lastevid));
} else if (3 == 4 && document.getElementById('target').innerHTML.indexOf(lastoh.replace('>', ' style="cursor: progress;">').split('>')[0] + '>') != -1) { // && lastoh.substring(0,3) != '<th') { //document.getElementById('source').innerHTML.indexOf(lastoh.replace('>', ' style="cursor: progress;">').split('>')[0] + '>') == -1 && document.getElementById('source').innerHTML.indexOf(lastoh.split('>')[0] + '>') == -1) {
//ouralert('4:' + lastoh);
tdtoundo=document.getElementById('target').innerHTML.split(lastoh.replace('>', ' style="cursor: progress;">').split('>')[0] + '>')[0].split(' id="')[eval(-1 + document.getElementById('target').innerHTML.split(lastoh.replace('>', ' style="cursor: progress;">').split('>')[0] + '>')[0].split(' id="').length)].split('"')[0]
//if (lastoh.indexOf('<span') == 0) { document.getElementById(lastid).style.display='none'; }
lastevid=lastoh.split(' id="')[1].split('"')[0];
//document.getElementById(lastevid).style.visibility='hidden';
//ouralert('81788 ' + lastoh);
document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastih, '>⁠' + lastoh.replace(' id="', ' id="x').replace(/th/g, 'span').replace(' dragXgable=', ' data-draggable=') + '<');
lastevid='x' + lastoh.split(' id="')[1].split('"')[0];
document.getElementById(tdtoundo).innerHTML='';
setTimeout(aaathen, 2000); //(document.getElementById(lastevid));
} else if (document.getElementById('target').innerHTML.indexOf(lastih) != -1 || document.getElementById('source').innerHTML.indexOf(lastoh) != -1) {
//ouralert('0:' + prefx + ' ' + lastoh + ' ' + lastih);
lastevid=lastoh.split(' id="')[1].split('"')[0];
if (document.getElementById(lastevid) && lastoh.indexOf('<th') != 0) { // || lastoh.indexOf('<span') != 0)) {
if (prefx == 'th' && document.URL.indexOf('/chess') != -1) { document.getElementById(lastevid).style.visibility='hidden'; } //else { ouralert(lastoh + ' ... ' + document.getElementById('target').innerHTML.indexOf(lastih) + ' ... ' + document.getElementById('target').innerHTML.indexOf(lastoh) + ' ... ' + lastid); }
}
//document.getElementById('source').innerHTML=document.getElementById('source').innerHTML.replace(lastoh, '');
//ouralert(8788);
// document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastih, '>⁠' + lastoh.replace(' id="', ' id="x').replace('<span ').replace(' dragXgable=', ' data-draggable=') + '<');
if (prefx == 'span') {
//ouralert(81788);
if (islegal()) {
//ouralert('82788 ' + lastoh);
document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastoh, '');
document.getElementById(lastid).innerHTML=lastoh;
lastoh='';
lastih='';
}
} else {
lastevid='x' + lastoh.split(' id="')[1].split('"')[0];
setTimeout(aaathen, 2000); //(document.getElementById(lastevid));
}
} else if (document.getElementById('target').innerHTML.indexOf(lastih) != -1 || document.getElementById('source').innerHTML.indexOf(lastoh.replace('>', ' style="cursor: progress;">')) != -1) {
//ouralert('1:' + lastoh);
lastevid=lastoh.split(' id="')[1].split('"')[0];
if (document.getElementById(lastevid) && lastoh.indexOf('<th') != 0) { // || lastoh.indexOf('<span') != 0)) {
if (prefx == 'th' && document.URL.indexOf('/chess') != -1) { document.getElementById(lastevid).style.visibility='hidden'; }
}
//document.getElementById('source').innerHTML=document.getElementById('source').innerHTML.replace(lastoh.replace('>', ' style="cursor: progress;">'), '');
//ouralert(8888);
document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastih, '>⁠' + lastoh.replace(' id="', ' id="x').replace(/th/g, 'span').replace(' dragXgable=', ' data-draggable=') + '<');
if (prefx == 'span') {
if (islegal()) {
document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastoh, '');
document.getElementById(lastid).innerHTML=lastoh;
lastoh='';
lastih='';
}
} else {
lastevid='x' + lastoh.split(' id="')[1].split('"')[0];
setTimeout(aaathen, 2000); //(document.getElementById(lastevid));
}
} //else {
//ouralert('why ' + lastoh + ' not found');
//}
lastoh='';
lastih='';
} //else {
//ouralert('Oops ' + lastoh);
//}
}

function fittwo(evot) {
//if (document.URL.indexOf('/chess') != -1 && (1 == 1 || lastid.indexOf(' ') == -1)) { lastid=evot.id + ' '; ouralert(lastid); }
//lastid=evot.id + ' ';
dragh=false;
return evot;
}

function fit(evo) {
var allclear=true;
if (document.URL.indexOf('/chess') != -1) {
//ouralert('here at fit ' + evo.outerHTML);
if (!dragh) {


console.log(evo.outerHTML);
lastoh=evo.outerHTML;
if (lastoh.indexOf(' data-piece="') != -1) {
console.log(itisthiscmove + ' comparing ' + lastoh.split(' data-piece="')[1].substring(0,1) + ' to ' + (itisthiscmove + lastoh.split(' data-piece="')[1].substring(0,1)).substring(0,1) + ' data-piece found regarding ' + lastoh);
if (lastoh.split(' data-piece="')[1].substring(0,1) != (itisthiscmove + lastoh.split(' data-piece="')[1].substring(0,1)).substring(0,1)) {
if (lohfulloh == '') {
if (lastitisthiscmove == ' ') {
console.log('Found bad example');
lastoh='';
lastih='';
lastid='';
}
} else {
console.log('Use ' + lohfulloh);
allclear=false;
lastoh=lohfulloh;
ppt=true; // maybe okay?
}
}
} else {
console.log('No data-piece found regarding ' + lastoh);
}
if (lastoh != '' && allclear) {
lastih='>' + evo.innerHTML + '<';
lastid=evo.id + ' ';
}
if (lohfulloh == '') {
if (evo.outerHTML.indexOf('<td') == 0 && evo.outerHTML.replace('<th>','<span').indexOf('<span') != -1) {
if (evo.outerHTML.indexOf(' data-piece="') != -1) {
console.log(itisthiscmove + ' comparing ' + lastoh.split(' data-piece="')[1].substring(0,1) + ' to ' + (itisthiscmove + lastoh.split(' data-piece="')[1].substring(0,1)).substring(0,1) + ' data-piece found regarding ' + lastoh);
if (evo.outerHTML.split(' data-piece="')[1].substring(0,1) == (itisthiscmove + evo.outerHTML.split(' data-piece="')[1].substring(0,1)).substring(0,1)) {
lohfulloh=lastoh;
}
}
}

// lohfulloh=lastoh;
console.log("Lohfulloh=" + lohfulloh);
}
}
//ouralert(lastoh);
//if (document.getElementById('target').outerHTML.indexOf('>' + evo.innerHTML + '<') != -1) { ouralert('Re-move >' + evo.innerHTML + '<'); }
}
return evo;
}

setTimeout(dover, 1000);

const source = document.querySelector("#source");
if (document.URL.indexOf('traditional=') == -1) {
source.addEventListener("dragstart", (ev) => {
console.log("dragStart " + document.URL);
dragh=false;
lohfulloh='';
ppt=false;
console.log("lohFulloh=" + lohfulloh);
sourceid='' + fit(ev.target).id;
if (lastoh != '') { dragh=true; }
// Change the source element's background color
// to show that drag has started
ev.currentTarget.classList.add("dragging");
// Clear the drag data cache (for all formats/types)
ev.dataTransfer.clearData();
// Set the drag's format and data.
// Use the event target's id for the data
ev.dataTransfer.setData("text/plain", ev.target.id);
if (document.URL.indexOf('/chess') != -1) {
if (!dragh) { ouralert('It is not your turn'); }
}
});
source.addEventListener("dragend", (ev) =>
fittwo(ev.target).classList.remove("dragging")
);
}

const target = document.querySelector("#target");
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i) && ('' + source.outerHTML).indexOf('<p') == 0 && ('' + target.outerHTML).indexOf('<span') == -1 && ('' + target.outerHTML).indexOf('>Drop Zone') != -1 && document.body.innerHTML.indexOf('Numbe' + 'rs Guessi' + 'ng Ga' + 'me') != -1) {
target.innerHTML='<span id=sdropz>Drop Zone</span>' + target.outerHTML.split('>Drop Zone')[1].split('</div>')[0];
}
target.addEventListener("dragover", (ev) => {
if (document.getElementById('ddcolour')) {
if (getdover() == 0) {
if (lastdovercol != document.getElementById('ddcolour').value) {
lastdovercol=document.getElementById('ddcolour').value;
doverdone=false;
}
if (!doverdone) { doverdone=true; overdover(); }
}
}
if (lastbco) { if (!document.getElementById('ddcolour')) { lastbco.style.backgroundColor='white'; } lastbco=null; }
if (ev.target.outerHTML.indexOf('<table') != 0 && ev.target.outerHTML.indexOf(' data-piece="') != -1) {
if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) == (itisthiscmove + ev.target.outerHTML.split(' data-piece="')[1].substring(0,1)).substring(0,1)) {
lohfulloh=ev.target.outerHTML;
console.log("LOHfulloh=" + lohfulloh);
}
}
//console.log("dragOver " + ev.target.id + ' ' + ('' + ev.target.style.backgroundColor).replace('white','') + ' ' + document.body.innerHTML.indexOf('tab' + 'lece' + 'llb' + 'c'));
//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
// document.title='ev.preventDefault(); //4';
//}
ev.preventDefault();
if (('' + ev.target.id).indexOf('td') == 0 && ('' + ev.target.style.backgroundColor).trim().replace('white','') == '' && document.body.innerHTML.indexOf('Numbe' + 'rs Guessi' + 'ng Ga' + 'me') != -1) {
//document.getElementById(sourceid).style.opacity='0.6';
lastbco=ev.target;
if (document.getElementById('ddcolour')) {
if (getdover() == 0) {
ev.target.style.backgroundColor='' + document.getElementById('ddcolour').value;
}
} else {
ev.target.style.backgroundColor='pink';
if (document.getElementById('mybut')) {
if (document.getElementById('mybut').innerHTML.indexOf(' .. ') == -1) {
document.getElementById('mybut').innerHTML=document.getElementById('mybut').innerHTML.replace(' Game Game', ' Game');
document.getElementById('mybut').innerHTML+=' .. current guess is ' + ev.target.innerHTML;
} else {
document.getElementById('mybut').innerHTML=document.getElementById('mybut').innerHTML.split(' .. ')[0] + ' .. current guess is ' + ev.target.innerHTML;
}
}
if (document.getElementById('sdropz')) {
if (document.getElementById('sdropz').innerHTML.indexOf(' .. ') == -1) {
document.getElementById('sdropz').innerHTML+=' .. current guess is ' + ev.target.innerHTML;
} else {
document.getElementById('sdropz').innerHTML=document.getElementById('sdropz').innerHTML.split(' .. ')[0] + ' .. current guess is ' + ev.target.innerHTML;
}
}
}
if (('' + document.URL + decodeURIComponent('' + location.hash)).indexOf('notice=') != -1 && ('' + decodeURIComponent('' + location.hash)).indexOf('no_tice=') == -1) {
if (document.getElementById('ddcolour')) {
if (getdover() == 0) {
ev.target.style.backgroundColor='' + document.getElementById('ddcolour').value;
}
} else {
ev.target.style.border='2px dashed yellow';
}
}
}
//document.getElementById(sourceid).style.cursor='progress';
//ev.target.style.cursor='progress';
//ev.target.dataTransfer.dropEffect = 'progress';.id)
});
target.addEventListener("drop", (ev) => {
console.log("Drop 2");
if (!document.getElementById('ddcolour')) {
if (lohfulloh != '') {
console.log("lohfulloh=" + lohfulloh);
if (lohfulloh.indexOf(' data-piece="') != -1) {
if (ev.target.outerHTML.indexOf(' data-piece="') != -1 && ev.target.outerHTML != lohfulloh) {
if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) != lohfulloh.split(' data-piece="')[1].substring(0,1)) {
console.log('Potential piece take');
ppt=true;
}
}
}
}
loh=ev.target.id;
lohoh=bigv(ev.target.outerHTML.split('>')[0] + '></' + ev.target.outerHTML.substring(1).split(' ')[0].split('>')[0] + '>');
//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
// document.title='ev.preventDefault(); //5';
//}
ev.preventDefault();
// Get the data, which is the id of the source element
const data = ev.dataTransfer.getData("text");
const source = document.getElementById(data);

console.log('' + ev.target.id);
if (!document.getElementById('callback')) {
lastevid=ev.target.id;
//ouralert(lastevid);
//ev.target.setAttribute('draggable', true);
if (lastoh == '') {
//ouralert('suspicious ' + document.getElementById(sourceid).outerHTML);
lastoh=ev.target.outerHTML;
lastih='>' + ev.target.innerHTML + '<';
lastid=ev.target.id;
} else if (prefx == 'span') {
if (lastid.indexOf(' ') != -1) {
lastid=lastid.trim();
} else {
lastid=ev.target.id;
}
}
setTimeout(lastohit, 1000);
if (('' + ev.target.style.backgroundColor).indexOf(',0.6') != -1 || ('' + ev.target.style.backgroundColor).indexOf(',0.5') != -1) {
//ouralert('564 ' + ev.target.getAttribute('data-square'));
ev.target.style.filter='invert(1)';
ev.target.style.backgroundColor='rgba(255,255,255,0.6)';
}
if (('' + ev.target.id).substring(0,2) == 'td' && secs > 0 && document.URL.indexOf('/planet_') == -1) {
score+=eval(ev.target.innerHTML.substring(0,1));
}
} else if (document.getElementById('callback')) {
secs++;
if (('' + ev.target.getAttribute('data-answer')) == ('' + document.getElementById('source').getAttribute('data-answer')) || ('' + ev.target.getAttribute('data-answer')) == ('' + document.getElementById(sourceid).getAttribute('data-answer'))) {
score++;
document.getElementById('score').innerHTML='Score: ' + score + '/' + secs + '';
} else {
document.getElementById('score').innerHTML='Score: ' + score + '/' + secs + '';
if (document.URL.indexOf('rjmprogramming-com-au.translate.goog') != -1) {
var xtdsare=document.getElementsByTagName('td');
for (var ixtdsare=0; ixtdsare<xtdsare.length; ixtdsare++) {
if (('' + xtdsare[ixtdsare].getAttribute('data-answer')).replace('null','').trim() != '') {
var cais=xtdsare[ixtdsare].innerText;
xtdsare[ixtdsare].style.backgroundColor='lightgreen';
if (6 == 6) {
if (6 == 6) {
xtdsare[ixtdsare].innerHTML=xtdsare[ixtdsare].innerHTML.replace(cais, cais + ' ✔');
} else {
xtdsare[ixtdsare].innerHTML+=' ✔';
}
}
ouralert('' + cais + ' ' + String.fromCodePoint(10004));
}
}
} else {
if (document.getElementById('source').outerHTML.indexOf('<ta' + 'ble') == 0) {
ouralert(('Correct answer was ' + document.getElementById(sourceid).getAttribute('data-answer')).replace('null',''));
} else {
ouralert(('Correct answer was ' + document.getElementById('source').getAttribute('data-answer')).replace('null',''));
}
}
}
var secsmore='';
if (('' + document.URL + decodeURIComponent('' + location.hash)).indexOf('notice=') != -1 && ('' + decodeURIComponent('' + location.hash)).indexOf('no_tice=') == -1) { secsmore='¬ice=y'; }
//location.href=document.getElementById('callback').value + '?score=' + score + '&secs=' + secs;
if (document.URL.indexOf('rjmprogramming-com-au.translate.goog') != -1) {
location.href=document.URL.split('&score=')[0] + '&score=' + score + '&secs=' + secs + secsmore;
} else {
location.href=document.getElementById('callback').value + '?score=' + score + '&secs=' + secs + secsmore;
}
}
if (1 == 2) {
clonedatatwo=document.getElementById(sourceid).outerHTML;
document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(clonedatatwo, '');
ev.target.innerHTML=ev.target.innerHTML.substring(0,1) + clonedatatwo;
} else if (secs > 0 && (9 == 9 || ('' + ev.target.id).substring(0,2) == 'td')) {
if (source) { source.style.cursor='progress'; }
clonedatatwo=document.getElementById(sourceid).outerHTML;
andlater();
//document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(clonedatatwo, '');
//ev.target.innerHTML=ev.target.innerHTML.substring(0,1) + clonedatatwo;
//document.getElementById('target').appendChild(source);
if (('' + ev.target.id).substring(0,2) != 'td') {
document.getElementById('target').insertAdjacentHTML('beforeend', clonedatatwo);
} else {
if (source) { source.style.cursor='progress'; }
ev.target.insertAdjacentHTML('beforeend', clonedatatwo);
}
} else {
try {
ev.target.appendChild(source);
} catch(ers) { }
}

if (ev.touches) {
if (ev.touches[0].pageX) {
pos3 = ev.touches[0].pageX;
pos4 = ev.touches[0].pageY;
} else {
pos3 = ev.touches[0].clientX;
pos4 = ev.touches[0].clientY;
}
console.log('pos3 = ' + pos3 + ',pos4 = ' + pos4);
} else if (ev.clientX || ev.clientY) {
pos3 = ev.clientX;
pos4 = ev.clientY;
console.log('pos3 = ' + pos3 + ' ,pos4 = ' + pos4);
} else {
pos3 = ev.pageX;
pos4 = ev.pageY;
console.log('pos3 = ' + pos3 + ', pos4 = ' + pos4);
}
}
});


const reset = document.querySelector("#reset");
reset.addEventListener("click", () => document.location.reload());

</script>
<style>
@media only screen and (min-device-width: 320px) and (max-device-width: 765px) and (orientation: portrait) {
#target { text-shadow:-1px 1px 1px #ff2d95; }
td[data-answer*="THE "] {
font-size: 10px;
}
}

@media only screen and (min-device-width: 320px) and (max-device-width: 765px) and (orientation: landscape) {
#target { text-shadow:-1px 1px 1px #ff2d95; }
td[data-answer*="THE "] {
font-size: 10px;
}
}
}
</style>
<select id="select_dialect" style="visibility: hidden;display:NONE;"><option value="en-AU">Australia</option><option value="en-CA">Canada</option><option value="en-IN">India</option><option value="en-KE">Kenya</option><option value="en-TZ">Tanzania</option><option value="en-GH">Ghana</option><option value="en-NZ">New Zealand</option><option value="en-NG">Nigeria</option><option value="en-ZA">South Africa</option><option value="en-PH">Philippines</option><option value="en-GB">United Kingdom</option><option value="en-US">United States</option></select>
<div id="info" style="visibility: HIDDEN;">
<p id="info_start" style="display: NONE;">
Click on the microphone icon and begin speaking for as long as you like.
</p>
<p id="info_speak_now" style="display:none">
Speak now.
</p>
<p id="info_no_speech" style="display:none">
No speech was detected. You may need to adjust your <a data-href="//support.google.com/chrome/bin/answer.py?hl=en&answer=1407892">microphone
settings</a>.
</p>
<p id="info_no_microphone" style="display:none">
No microphone was found. Ensure that a microphone is installed and that
<a data-href="//support.google.com/chrome/bin/answer.py?hl=en&answer=1407892">
microphone settings</a> are configured correctly.
</p>
<p id="info_allow" style="display:none">
Click the "Allow" button above to enable your microphone.
</p>
<p id="info_denied" style="display:none">
Permission to use microphone was denied.
</p>
<p id="info_blocked" style="display:none">
Permission to use microphone is blocked. To change, go to
chrome://settings/contentExceptions#media-stream
</p>
<p id="info_upgrade" style="display:none">
Web Speech API is not supported by this browser. Upgrade to <a href="//www.google.com/chrome">Chrome</a> version 25 or later.
</p>
</div>
<table width="100%" cellpadding="4" cellspacing="0" border="1" id=mylangt style=display:none; title='Thanks to https://www.loc.gov/standards/iso639-2/php/code_list.php'>
<tbody><tr valign="top" bgcolor="#ffffee">
<th scope="col" width="15%">ISO 639-2 Code</th>
<th scope="col" width="15%">ISO 639-1 Code</th>
<th scope="col" width="20%">English name of Language</th>
<th scope="col" width="25%">French name of Language</th>
<th scope="col" width="25%">German name of Language</th>
</tr><tr valign="top">
<td scope="row">aar</td>
<td>aa</td>
<td>Afar</td>
<td>afar</td>
<td>Danakil-Sprache</td>
</tr><tr valign="top">
<td scope="row">abk</td>
<td>ab</td>
<td>Abkhazian</td>
<td>abkhaze</td>
<td>Abchasisch</td>
</tr><tr valign="top">
<td scope="row">ace</td>
<td> </td>
<td>Achinese</td>
<td>aceh</td>
<td>Aceh-Sprache</td>
</tr><tr valign="top">
<td scope="row">ach</td>
<td> </td>
<td>Acoli</td>
<td>acoli</td>
<td>Acholi-Sprache</td>
</tr><tr valign="top">
<td scope="row">ada</td>
<td> </td>
<td>Adangme</td>
<td>adangme</td>
<td>Adangme-Sprache</td>
</tr><tr valign="top">
<td scope="row">ady</td>
<td> </td>
<td>Adyghe; Adygei</td>
<td>adyghé</td>
<td>Adygisch</td>
</tr><tr valign="top">
<td scope="row">afa</td>
<td> </td>
<td>Afro-Asiatic languages</td>
<td>afro-asiatiques, langues</td>
<td>Hamitosemitische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">afh</td>
<td> </td>
<td>Afrihili</td>
<td>afrihili</td>
<td>Afrihili</td>
</tr><tr valign="top">
<td scope="row">afr</td>
<td>af</td>
<td>Afrikaans</td>
<td>afrikaans</td>
<td>Afrikaans</td>
</tr><tr valign="top">
<td scope="row">ain</td>
<td> </td>
<td>Ainu</td>
<td>aïnou</td>
<td>Ainu-Sprache</td>
</tr><tr valign="top">
<td scope="row">aka</td>
<td>ak</td>
<td>Akan</td>
<td>akan</td>
<td>Akan-Sprache</td>
</tr><tr valign="top">
<td scope="row">akk</td>
<td> </td>
<td>Akkadian</td>
<td>akkadien</td>
<td>Akkadisch</td>
</tr><tr valign="top">
<td scope="row">alb (B)<br>sqi (T)</td>
<td>sq</td>
<td>Albanian</td>
<td>albanais</td>
<td>Albanisch</td>
</tr><tr valign="top">
<td scope="row">ale</td>
<td> </td>
<td>Aleut</td>
<td>aléoute</td>
<td>Aleutisch</td>
</tr><tr valign="top">
<td scope="row">alg</td>
<td> </td>
<td>Algonquian languages</td>
<td>algonquines, langues</td>
<td>Algonkin-Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">alt</td>
<td> </td>
<td>Southern Altai</td>
<td>altai du Sud</td>
<td>Altaisch</td>
</tr><tr valign="top">
<td scope="row">amh</td>
<td>am</td>
<td>Amharic</td>
<td>amharique</td>
<td>Amharisch</td>
</tr><tr valign="top">
<td scope="row">ang</td>
<td> </td>
<td>English, Old (ca.450-1100)</td>
<td>anglo-saxon (ca.450-1100)</td>
<td>Altenglisch</td>
</tr><tr valign="top">
<td scope="row">anp</td>
<td> </td>
<td>Angika</td>
<td>angika</td>
<td>Anga-Sprache</td>
</tr><tr valign="top">
<td scope="row">apa</td>
<td> </td>
<td>Apache languages</td>
<td>apaches, langues</td>
<td>Apachen-Sprachen</td>
</tr><tr valign="top">
<td scope="row">ara</td>
<td>ar</td>
<td>Arabic</td>
<td>arabe</td>
<td>Arabisch</td>
</tr><tr valign="top">
<td scope="row">arc</td>
<td> </td>
<td>Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)</td>
<td>araméen d'empire (700-300 BCE)</td>
<td>Aramäisch</td>
</tr><tr valign="top">
<td scope="row">arg</td>
<td>an</td>
<td>Aragonese</td>
<td>aragonais</td>
<td>Aragonesisch</td>
</tr><tr valign="top">
<td scope="row">arm (B)<br>hye (T)</td>
<td>hy</td>
<td>Armenian</td>
<td>arménien</td>
<td>Armenisch</td>
</tr><tr valign="top">
<td scope="row">arn</td>
<td> </td>
<td>Mapudungun; Mapuche</td>
<td>mapudungun; mapuche; mapuce</td>
<td>Arauka-Sprachen</td>
</tr><tr valign="top">
<td scope="row">arp</td>
<td> </td>
<td>Arapaho</td>
<td>arapaho</td>
<td>Arapaho-Sprache</td>
</tr><tr valign="top">
<td scope="row">art</td>
<td> </td>
<td>Artificial languages</td>
<td>artificielles, langues</td>
<td>Kunstsprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">arw</td>
<td> </td>
<td>Arawak</td>
<td>arawak</td>
<td>Arawak-Sprachen</td>
</tr><tr valign="top">
<td scope="row">asm</td>
<td>as</td>
<td>Assamese</td>
<td>assamais</td>
<td>Assamesisch</td>
</tr><tr valign="top">
<td scope="row">ast</td>
<td> </td>
<td>Asturian; Bable; Leonese; Asturleonese</td>
<td>asturien; bable; léonais; asturoléonais</td>
<td>Asturisch</td>
</tr><tr valign="top">
<td scope="row">ath</td>
<td> </td>
<td>Athapascan languages</td>
<td>athapascanes, langues</td>
<td>Athapaskische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">aus</td>
<td> </td>
<td>Australian languages</td>
<td>australiennes, langues</td>
<td>Australische Sprachen</td>
</tr><tr valign="top">
<td scope="row">ava</td>
<td>av</td>
<td>Avaric</td>
<td>avar</td>
<td>Awarisch</td>
</tr><tr valign="top">
<td scope="row">ave</td>
<td>ae</td>
<td>Avestan</td>
<td>avestique</td>
<td>Avestisch</td>
</tr><tr valign="top">
<td scope="row">awa</td>
<td> </td>
<td>Awadhi</td>
<td>awadhi</td>
<td>Awadhi</td>
</tr><tr valign="top">
<td scope="row">aym</td>
<td>ay</td>
<td>Aymara</td>
<td>aymara</td>
<td>Aymará-Sprache</td>
</tr><tr valign="top">
<td scope="row">aze</td>
<td>az</td>
<td>Azerbaijani</td>
<td>azéri</td>
<td>Aserbeidschanisch</td>
</tr><tr valign="top">
<td scope="row">bad</td>
<td> </td>
<td>Banda languages</td>
<td>banda, langues</td>
<td>Banda-Sprachen (Ubangi-Sprachen)</td>
</tr><tr valign="top">
<td scope="row">bai</td>
<td> </td>
<td>Bamileke languages</td>
<td>bamiléké, langues</td>
<td>Bamileke-Sprachen</td>
</tr><tr valign="top">
<td scope="row">bak</td>
<td>ba</td>
<td>Bashkir</td>
<td>bachkir</td>
<td>Baschkirisch</td>
</tr><tr valign="top">
<td scope="row">bal</td>
<td> </td>
<td>Baluchi</td>
<td>baloutchi</td>
<td>Belutschisch</td>
</tr><tr valign="top">
<td scope="row">bam</td>
<td>bm</td>
<td>Bambara</td>
<td>bambara</td>
<td>Bambara-Sprache</td>
</tr><tr valign="top">
<td scope="row">ban</td>
<td> </td>
<td>Balinese</td>
<td>balinais</td>
<td>Balinesisch</td>
</tr><tr valign="top">
<td scope="row">baq (B)<br>eus (T)</td>
<td>eu</td>
<td>Basque</td>
<td>basque</td>
<td>Baskisch</td>
</tr><tr valign="top">
<td scope="row">bas</td>
<td> </td>
<td>Basa</td>
<td>basa</td>
<td>Basaa-Sprache</td>
</tr><tr valign="top">
<td scope="row">bat</td>
<td> </td>
<td>Baltic languages</td>
<td>baltes, langues</td>
<td>Baltische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">bej</td>
<td> </td>
<td>Beja; Bedawiyet</td>
<td>bedja</td>
<td>Bedauye</td>
</tr><tr valign="top">
<td scope="row">bel</td>
<td>be</td>
<td>Belarusian</td>
<td>biélorusse</td>
<td>Weißrussisch</td>
</tr><tr valign="top">
<td scope="row">bem</td>
<td> </td>
<td>Bemba</td>
<td>bemba</td>
<td>Bemba-Sprache</td>
</tr><tr valign="top">
<td scope="row">ben</td>
<td>bn</td>
<td>Bengali</td>
<td>bengali</td>
<td>Bengali</td>
</tr><tr valign="top">
<td scope="row">ber</td>
<td> </td>
<td>Berber languages</td>
<td>berbères, langues</td>
<td>Berbersprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">bho</td>
<td> </td>
<td>Bhojpuri</td>
<td>bhojpuri</td>
<td>Bhojpuri</td>
</tr><tr valign="top">
<td scope="row">bih</td>
<td>bh</td>
<td>Bihari languages</td>
<td>langues biharis</td>
<td>Bihari (Andere)</td>
</tr><tr valign="top">
<td scope="row">bik</td>
<td> </td>
<td>Bikol</td>
<td>bikol</td>
<td>Bikol-Sprache</td>
</tr><tr valign="top">
<td scope="row">bin</td>
<td> </td>
<td>Bini; Edo</td>
<td>bini; edo</td>
<td>Edo-Sprache</td>
</tr><tr valign="top">
<td scope="row">bis</td>
<td>bi</td>
<td>Bislama</td>
<td>bichlamar</td>
<td>Beach-la-mar</td>
</tr><tr valign="top">
<td scope="row">bla</td>
<td> </td>
<td>Siksika</td>
<td>blackfoot</td>
<td>Blackfoot-Sprache</td>
</tr><tr valign="top">
<td scope="row">bnt</td>
<td> </td>
<td>Bantu languages</td>
<td>bantou, langues</td>
<td>Bantusprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">tib (B)<br>bod (T)</td>
<td>bo</td>
<td>Tibetan</td>
<td>tibétain</td>
<td>Tibetisch</td>
</tr><tr valign="top">
<td scope="row">bos</td>
<td>bs</td>
<td>Bosnian</td>
<td>bosniaque</td>
<td>Bosnisch</td>
</tr><tr valign="top">
<td scope="row">bra</td>
<td> </td>
<td>Braj</td>
<td>braj</td>
<td>Braj-Bhakha</td>
</tr><tr valign="top">
<td scope="row">bre</td>
<td>br</td>
<td>Breton</td>
<td>breton</td>
<td>Bretonisch</td>
</tr><tr valign="top">
<td scope="row">btk</td>
<td> </td>
<td>Batak languages</td>
<td>batak, langues</td>
<td>Batak-Sprache</td>
</tr><tr valign="top">
<td scope="row">bua</td>
<td> </td>
<td>Buriat</td>
<td>bouriate</td>
<td>Burjatisch</td>
</tr><tr valign="top">
<td scope="row">bug</td>
<td> </td>
<td>Buginese</td>
<td>bugi</td>
<td>Bugi-Sprache</td>
</tr><tr valign="top">
<td scope="row">bul</td>
<td>bg</td>
<td>Bulgarian</td>
<td>bulgare</td>
<td>Bulgarisch</td>
</tr><tr valign="top">
<td scope="row">bur (B)<br>mya (T)</td>
<td>my</td>
<td>Burmese</td>
<td>birman</td>
<td>Birmanisch</td>
</tr><tr valign="top">
<td scope="row">byn</td>
<td> </td>
<td>Blin; Bilin</td>
<td>blin; bilen</td>
<td>Bilin-Sprache</td>
</tr><tr valign="top">
<td scope="row">cad</td>
<td> </td>
<td>Caddo</td>
<td>caddo</td>
<td>Caddo-Sprachen</td>
</tr><tr valign="top">
<td scope="row">cai</td>
<td> </td>
<td>Central American Indian languages</td>
<td>amérindiennes de l'Amérique centrale, langues</td>
<td>Indianersprachen, Zentralamerika (Andere)</td>
</tr><tr valign="top">
<td scope="row">car</td>
<td> </td>
<td>Galibi Carib</td>
<td>karib; galibi; carib</td>
<td>Karibische Sprachen</td>
</tr><tr valign="top">
<td scope="row">cat</td>
<td>ca</td>
<td>Catalan; Valencian</td>
<td>catalan; valencien</td>
<td>Katalanisch</td>
</tr><tr valign="top">
<td scope="row">cau</td>
<td> </td>
<td>Caucasian languages</td>
<td>caucasiennes, langues</td>
<td>Kaukasische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">ceb</td>
<td> </td>
<td>Cebuano</td>
<td>cebuano</td>
<td>Cebuano</td>
</tr><tr valign="top">
<td scope="row">cel</td>
<td> </td>
<td>Celtic languages</td>
<td>celtiques, langues; celtes, langues</td>
<td>Keltische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">cze (B)<br>ces (T)</td>
<td>cs</td>
<td>Czech</td>
<td>tchèque</td>
<td>Tschechisch</td>
</tr><tr valign="top">
<td scope="row">cha</td>
<td>ch</td>
<td>Chamorro</td>
<td>chamorro</td>
<td>Chamorro-Sprache</td>
</tr><tr valign="top">
<td scope="row">chb</td>
<td> </td>
<td>Chibcha</td>
<td>chibcha</td>
<td>Chibcha-Sprachen</td>
</tr><tr valign="top">
<td scope="row">che</td>
<td>ce</td>
<td>Chechen</td>
<td>tchétchène</td>
<td>Tschetschenisch</td>
</tr><tr valign="top">
<td scope="row">chg</td>
<td> </td>
<td>Chagatai</td>
<td>djaghataï</td>
<td>Tschagataisch</td>
</tr><tr valign="top">
<td scope="row">chi (B)<br>zho (T)</td>
<td>zh</td>
<td>Chinese</td>
<td>chinois</td>
<td>Chinesisch</td>
</tr><tr valign="top">
<td scope="row">chk</td>
<td> </td>
<td>Chuukese</td>
<td>chuuk</td>
<td>Trukesisch</td>
</tr><tr valign="top">
<td scope="row">chm</td>
<td> </td>
<td>Mari</td>
<td>mari</td>
<td>Tscheremissisch</td>
</tr><tr valign="top">
<td scope="row">chn</td>
<td> </td>
<td>Chinook jargon</td>
<td>chinook, jargon</td>
<td>Chinook-Jargon</td>
</tr><tr valign="top">
<td scope="row">cho</td>
<td> </td>
<td>Choctaw</td>
<td>choctaw</td>
<td>Choctaw-Sprache</td>
</tr><tr valign="top">
<td scope="row">chp</td>
<td> </td>
<td>Chipewyan; Dene Suline</td>
<td>chipewyan</td>
<td>Chipewyan-Sprache</td>
</tr><tr valign="top">
<td scope="row">chr</td>
<td> </td>
<td>Cherokee</td>
<td>cherokee</td>
<td>Cherokee-Sprache</td>
</tr><tr valign="top">
<td scope="row">chu</td>
<td>cu</td>
<td>Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic</td>
<td>slavon d'église; vieux slave; slavon liturgique; vieux bulgare</td>
<td>Kirchenslawisch</td>
</tr><tr valign="top">
<td scope="row">chv</td>
<td>cv</td>
<td>Chuvash</td>
<td>tchouvache</td>
<td>Tschuwaschisch</td>
</tr><tr valign="top">
<td scope="row">chy</td>
<td> </td>
<td>Cheyenne</td>
<td>cheyenne</td>
<td>Cheyenne-Sprache</td>
</tr><tr valign="top">
<td scope="row">cmc</td>
<td> </td>
<td>Chamic languages</td>
<td>chames, langues</td>
<td>Cham-Sprachen</td>
</tr><tr valign="top">
<td scope="row">cnr</td>
<td> </td>
<td>Montenegrin</td>
<td>monténégrin</td>
<td>Montenegrinisch</td>
</tr><tr valign="top">
<td scope="row">cop</td>
<td> </td>
<td>Coptic</td>
<td>copte</td>
<td>Koptisch</td>
</tr><tr valign="top">
<td scope="row">cor</td>
<td>kw</td>
<td>Cornish</td>
<td>cornique</td>
<td>Kornisch</td>
</tr><tr valign="top">
<td scope="row">cos</td>
<td>co</td>
<td>Corsican</td>
<td>corse</td>
<td>Korsisch</td>
</tr><tr valign="top">
<td scope="row">cpe</td>
<td> </td>
<td>Creoles and pidgins, English based</td>
<td>créoles et pidgins basés sur l'anglais</td>
<td>Kreolisch-Englisch (Andere)</td>
</tr><tr valign="top">
<td scope="row">cpf</td>
<td> </td>
<td>Creoles and pidgins, French-based</td>
<td>créoles et pidgins basés sur le français</td>
<td>Kreolisch-Französisch (Andere)</td>
</tr><tr valign="top">
<td scope="row">cpp</td>
<td> </td>
<td>Creoles and pidgins, Portuguese-based</td>
<td>créoles et pidgins basés sur le portugais</td>
<td>Kreolisch-Portugiesisch (Andere)</td>
</tr><tr valign="top">
<td scope="row">cre</td>
<td>cr</td>
<td>Cree</td>
<td>cree</td>
<td>Cree-Sprache</td>
</tr><tr valign="top">
<td scope="row">crh</td>
<td> </td>
<td>Crimean Tatar; Crimean Turkish</td>
<td>tatar de Crimé</td>
<td>Krimtatarisch</td>
</tr><tr valign="top">
<td scope="row">crp</td>
<td> </td>
<td>Creoles and pidgins</td>
<td>créoles et pidgins</td>
<td>Kreolische Sprachen; Pidginsprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">csb</td>
<td> </td>
<td>Kashubian</td>
<td>kachoube</td>
<td>Kaschubisch</td>
</tr><tr valign="top">
<td scope="row">cus</td>
<td> </td>
<td>Cushitic languages</td>
<td>couchitiques, langues</td>
<td>Kuschitische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">wel (B)<br>cym (T)</td>
<td>cy</td>
<td>Welsh</td>
<td>gallois</td>
<td>Kymrisch</td>
</tr><tr valign="top">
<td scope="row">cze (B)<br>ces (T)</td>
<td>cs</td>
<td>Czech</td>
<td>tchèque</td>
<td>Tschechisch</td>
</tr><tr valign="top">
<td scope="row">dak</td>
<td> </td>
<td>Dakota</td>
<td>dakota</td>
<td>Dakota-Sprache</td>
</tr><tr valign="top">
<td scope="row">dan</td>
<td>da</td>
<td>Danish</td>
<td>danois</td>
<td>Dänisch</td>
</tr><tr valign="top">
<td scope="row">dar</td>
<td> </td>
<td>Dargwa</td>
<td>dargwa</td>
<td>Darginisch</td>
</tr><tr valign="top">
<td scope="row">day</td>
<td> </td>
<td>Land Dayak languages</td>
<td>dayak, langues</td>
<td>Dajakisch</td>
</tr><tr valign="top">
<td scope="row">del</td>
<td> </td>
<td>Delaware</td>
<td>delaware</td>
<td>Delaware-Sprache</td>
</tr><tr valign="top">
<td scope="row">den</td>
<td> </td>
<td>Slave (Athapascan)</td>
<td>esclave (athapascan)</td>
<td>Slave-Sprache</td>
</tr><tr valign="top">
<td scope="row">ger (B)<br>deu (T)</td>
<td>de</td>
<td>German</td>
<td>allemand</td>
<td>Deutsch</td>
</tr><tr valign="top">
<td scope="row">dgr</td>
<td> </td>
<td>Dogrib</td>
<td>dogrib</td>
<td>Dogrib-Sprache</td>
</tr><tr valign="top">
<td scope="row">din</td>
<td> </td>
<td>Dinka</td>
<td>dinka</td>
<td>Dinka-Sprache</td>
</tr><tr valign="top">
<td scope="row">div</td>
<td>dv</td>
<td>Divehi; Dhivehi; Maldivian</td>
<td>maldivien</td>
<td>Maledivisch</td>
</tr><tr valign="top">
<td scope="row">doi</td>
<td> </td>
<td>Dogri</td>
<td>dogri</td>
<td>Dogri</td>
</tr><tr valign="top">
<td scope="row">dra</td>
<td> </td>
<td>Dravidian languages</td>
<td>dravidiennes, langues</td>
<td>Drawidische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">dsb</td>
<td> </td>
<td>Lower Sorbian</td>
<td>bas-sorabe</td>
<td>Niedersorbisch</td>
</tr><tr valign="top">
<td scope="row">dua</td>
<td> </td>
<td>Duala</td>
<td>douala</td>
<td>Duala-Sprachen</td>
</tr><tr valign="top">
<td scope="row">dum</td>
<td> </td>
<td>Dutch, Middle (ca.1050-1350)</td>
<td>néerlandais moyen (ca. 1050-1350)</td>
<td>Mittelniederländisch</td>
</tr><tr valign="top">
<td scope="row">dut (B)<br>nld (T)</td>
<td>nl</td>
<td>Dutch; Flemish</td>
<td>néerlandais; flamand</td>
<td>Niederländisch</td>
</tr><tr valign="top">
<td scope="row">dyu</td>
<td> </td>
<td>Dyula</td>
<td>dioula</td>
<td>Dyula-Sprache</td>
</tr><tr valign="top">
<td scope="row">dzo</td>
<td>dz</td>
<td>Dzongkha</td>
<td>dzongkha</td>
<td>Dzongkha</td>
</tr><tr valign="top">
<td scope="row">efi</td>
<td> </td>
<td>Efik</td>
<td>efik</td>
<td>Efik</td>
</tr><tr valign="top">
<td scope="row">egy</td>
<td> </td>
<td>Egyptian (Ancient)</td>
<td>égyptien</td>
<td>Ägyptisch</td>
</tr><tr valign="top">
<td scope="row">eka</td>
<td> </td>
<td>Ekajuk</td>
<td>ekajuk</td>
<td>Ekajuk</td>
</tr><tr valign="top">
<td scope="row">gre (B)<br>ell (T)</td>
<td>el</td>
<td>Greek, Modern (1453-)</td>
<td>grec moderne (après 1453)</td>
<td>Neugriechisch</td>
</tr><tr valign="top">
<td scope="row">elx</td>
<td> </td>
<td>Elamite</td>
<td>élamite</td>
<td>Elamisch</td>
</tr><tr valign="top">
<td scope="row">eng</td>
<td>en</td>
<td>English</td>
<td>anglais</td>
<td>Englisch</td>
</tr><tr valign="top">
<td scope="row">enm</td>
<td> </td>
<td>English, Middle (1100-1500)</td>
<td>anglais moyen (1100-1500)</td>
<td>Mittelenglisch</td>
</tr><tr valign="top">
<td scope="row">epo</td>
<td>eo</td>
<td>Esperanto</td>
<td>espéranto</td>
<td>Esperanto</td>
</tr><tr valign="top">
<td scope="row">est</td>
<td>et</td>
<td>Estonian</td>
<td>estonien</td>
<td>Estnisch</td>
</tr><tr valign="top">
<td scope="row">baq (B)<br>eus (T)</td>
<td>eu</td>
<td>Basque</td>
<td>basque</td>
<td>Baskisch</td>
</tr><tr valign="top">
<td scope="row">ewe</td>
<td>ee</td>
<td>Ewe</td>
<td>éwé</td>
<td>Ewe-Sprache</td>
</tr><tr valign="top">
<td scope="row">ewo</td>
<td> </td>
<td>Ewondo</td>
<td>éwondo</td>
<td>Ewondo</td>
</tr><tr valign="top">
<td scope="row">fan</td>
<td> </td>
<td>Fang</td>
<td>fang</td>
<td>Pangwe-Sprache</td>
</tr><tr valign="top">
<td scope="row">fao</td>
<td>fo</td>
<td>Faroese</td>
<td>féroïen</td>
<td>Färöisch</td>
</tr><tr valign="top">
<td scope="row">per (B)<br>fas (T)</td>
<td>fa</td>
<td>Persian</td>
<td>persan</td>
<td>Persisch</td>
</tr><tr valign="top">
<td scope="row">fat</td>
<td> </td>
<td>Fanti</td>
<td>fanti</td>
<td>Fante-Sprache</td>
</tr><tr valign="top">
<td scope="row">fij</td>
<td>fj</td>
<td>Fijian</td>
<td>fidjien</td>
<td>Fidschi-Sprache</td>
</tr><tr valign="top">
<td scope="row">fil</td>
<td> </td>
<td>Filipino; Pilipino</td>
<td>filipino; pilipino</td>
<td>Pilipino</td>
</tr><tr valign="top">
<td scope="row">fin</td>
<td>fi</td>
<td>Finnish</td>
<td>finnois</td>
<td>Finnisch</td>
</tr><tr valign="top">
<td scope="row">fiu</td>
<td> </td>
<td>Finno-Ugrian languages</td>
<td>finno-ougriennes, langues</td>
<td>Finnougrische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">fon</td>
<td> </td>
<td>Fon</td>
<td>fon</td>
<td>Fon-Sprache</td>
</tr><tr valign="top">
<td scope="row">fre (B)<br>fra (T)</td>
<td>fr</td>
<td>French</td>
<td>français</td>
<td>Französisch</td>
</tr><tr valign="top">
<td scope="row">fre (B)<br>fra (T)</td>
<td>fr</td>
<td>French</td>
<td>français</td>
<td>Französisch</td>
</tr><tr valign="top">
<td scope="row">frm</td>
<td> </td>
<td>French, Middle (ca.1400-1600)</td>
<td>français moyen (1400-1600)</td>
<td>Mittelfranzösisch</td>
</tr><tr valign="top">
<td scope="row">fro</td>
<td> </td>
<td>French, Old (842-ca.1400)</td>
<td>français ancien (842-ca.1400)</td>
<td>Altfranzösisch</td>
</tr><tr valign="top">
<td scope="row">frr</td>
<td> </td>
<td>Northern Frisian</td>
<td>frison septentrional</td>
<td>Nordfriesisch</td>
</tr><tr valign="top">
<td scope="row">frs</td>
<td> </td>
<td>Eastern Frisian</td>
<td>frison oriental</td>
<td>Ostfriesisch</td>
</tr><tr valign="top">
<td scope="row">fry</td>
<td>fy</td>
<td>Western Frisian</td>
<td>frison occidental</td>
<td>Friesisch</td>
</tr><tr valign="top">
<td scope="row">ful</td>
<td>ff</td>
<td>Fulah</td>
<td>peul</td>
<td>Ful</td>
</tr><tr valign="top">
<td scope="row">fur</td>
<td> </td>
<td>Friulian</td>
<td>frioulan</td>
<td>Friulisch</td>
</tr><tr valign="top">
<td scope="row">gaa</td>
<td> </td>
<td>Ga</td>
<td>ga</td>
<td>Ga-Sprache</td>
</tr><tr valign="top">
<td scope="row">gay</td>
<td> </td>
<td>Gayo</td>
<td>gayo</td>
<td>Gayo-Sprache</td>
</tr><tr valign="top">
<td scope="row">gba</td>
<td> </td>
<td>Gbaya</td>
<td>gbaya</td>
<td>Gbaya-Sprache</td>
</tr><tr valign="top">
<td scope="row">gem</td>
<td> </td>
<td>Germanic languages</td>
<td>germaniques, langues</td>
<td>Germanische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">geo (B)<br>kat (T)</td>
<td>ka</td>
<td>Georgian</td>
<td>géorgien</td>
<td>Georgisch</td>
</tr><tr valign="top">
<td scope="row">ger (B)<br>deu (T)</td>
<td>de</td>
<td>German</td>
<td>allemand</td>
<td>Deutsch</td>
</tr><tr valign="top">
<td scope="row">gez</td>
<td> </td>
<td>Geez</td>
<td>guèze</td>
<td>Altäthiopisch</td>
</tr><tr valign="top">
<td scope="row">gil</td>
<td> </td>
<td>Gilbertese</td>
<td>kiribati</td>
<td>Gilbertesisch</td>
</tr><tr valign="top">
<td scope="row">gla</td>
<td>gd</td>
<td>Gaelic; Scottish Gaelic</td>
<td>gaélique; gaélique écossais</td>
<td>Gälisch-Schottisch</td>
</tr><tr valign="top">
<td scope="row">gle</td>
<td>ga</td>
<td>Irish</td>
<td>irlandais</td>
<td>Irisch</td>
</tr><tr valign="top">
<td scope="row">glg</td>
<td>gl</td>
<td>Galician</td>
<td>galicien</td>
<td>Galicisch</td>
</tr><tr valign="top">
<td scope="row">glv</td>
<td>gv</td>
<td>Manx</td>
<td>manx; mannois</td>
<td>Manx</td>
</tr><tr valign="top">
<td scope="row">gmh</td>
<td> </td>
<td>German, Middle High (ca.1050-1500)</td>
<td>allemand, moyen haut (ca. 1050-1500)</td>
<td>Mittelhochdeutsch</td>
</tr><tr valign="top">
<td scope="row">goh</td>
<td> </td>
<td>German, Old High (ca.750-1050)</td>
<td>allemand, vieux haut (ca. 750-1050)</td>
<td>Althochdeutsch</td>
</tr><tr valign="top">
<td scope="row">gon</td>
<td> </td>
<td>Gondi</td>
<td>gond</td>
<td>Gondi-Sprache</td>
</tr><tr valign="top">
<td scope="row">gor</td>
<td> </td>
<td>Gorontalo</td>
<td>gorontalo</td>
<td>Gorontalesisch</td>
</tr><tr valign="top">
<td scope="row">got</td>
<td> </td>
<td>Gothic</td>
<td>gothique</td>
<td>Gotisch</td>
</tr><tr valign="top">
<td scope="row">grb</td>
<td> </td>
<td>Grebo</td>
<td>grebo</td>
<td>Grebo-Sprache</td>
</tr><tr valign="top">
<td scope="row">grc</td>
<td> </td>
<td>Greek, Ancient (to 1453)</td>
<td>grec ancien (jusqu'à 1453)</td>
<td>Griechisch</td>
</tr><tr valign="top">
<td scope="row">gre (B)<br>ell (T)</td>
<td>el</td>
<td>Greek, Modern (1453-)</td>
<td>grec moderne (après 1453)</td>
<td>Neugriechisch</td>
</tr><tr valign="top">
<td scope="row">grn</td>
<td>gn</td>
<td>Guarani</td>
<td>guarani</td>
<td>Guaraní-Sprache</td>
</tr><tr valign="top">
<td scope="row">gsw</td>
<td> </td>
<td>Swiss German; Alemannic; Alsatian</td>
<td>suisse alémanique; alémanique; alsacien</td>
<td>Schweizerdeutsch</td>
</tr><tr valign="top">
<td scope="row">guj</td>
<td>gu</td>
<td>Gujarati</td>
<td>goudjrati</td>
<td>Gujarati-Sprache</td>
</tr><tr valign="top">
<td scope="row">gwi</td>
<td> </td>
<td>Gwich'in</td>
<td>gwich'in</td>
<td>Kutchin-Sprache</td>
</tr><tr valign="top">
<td scope="row">hai</td>
<td> </td>
<td>Haida</td>
<td>haida</td>
<td>Haida-Sprache</td>
</tr><tr valign="top">
<td scope="row">hat</td>
<td>ht</td>
<td>Haitian; Haitian Creole</td>
<td>haïtien; créole haïtien</td>
<td>Haïtien (Haiti-Kreolisch)</td>
</tr><tr valign="top">
<td scope="row">hau</td>
<td>ha</td>
<td>Hausa</td>
<td>haoussa</td>
<td>Haussa-Sprache</td>
</tr><tr valign="top">
<td scope="row">haw</td>
<td> </td>
<td>Hawaiian</td>
<td>hawaïen</td>
<td>Hawaiisch</td>
</tr><tr valign="top">
<td scope="row">heb</td>
<td>he</td>
<td>Hebrew</td>
<td>hébreu</td>
<td>Hebräisch</td>
</tr><tr valign="top">
<td scope="row">her</td>
<td>hz</td>
<td>Herero</td>
<td>herero</td>
<td>Herero-Sprache</td>
</tr><tr valign="top">
<td scope="row">hil</td>
<td> </td>
<td>Hiligaynon</td>
<td>hiligaynon</td>
<td>Hiligaynon-Sprache</td>
</tr><tr valign="top">
<td scope="row">him</td>
<td> </td>
<td>Himachali languages; Western Pahari languages</td>
<td>langues himachalis; langues paharis occidentales</td>
<td>Himachali</td>
</tr><tr valign="top">
<td scope="row">hin</td>
<td>hi</td>
<td>Hindi</td>
<td>hindi</td>
<td>Hindi</td>
</tr><tr valign="top">
<td scope="row">hit</td>
<td> </td>
<td>Hittite</td>
<td>hittite</td>
<td>Hethitisch</td>
</tr><tr valign="top">
<td scope="row">hmn</td>
<td> </td>
<td>Hmong; Mong</td>
<td>hmong</td>
<td>Miao-Sprachen</td>
</tr><tr valign="top">
<td scope="row">hmo</td>
<td>ho</td>
<td>Hiri Motu</td>
<td>hiri motu</td>
<td>Hiri-Motu</td>
</tr><tr valign="top">
<td scope="row">hrv</td>
<td>hr</td>
<td>Croatian</td>
<td>croate</td>
<td>Kroatisch </td>
</tr><tr valign="top">
<td scope="row">hsb</td>
<td> </td>
<td>Upper Sorbian</td>
<td>haut-sorabe</td>
<td>Obersorbisch</td>
</tr><tr valign="top">
<td scope="row">hun</td>
<td>hu</td>
<td>Hungarian</td>
<td>hongrois</td>
<td>Ungarisch</td>
</tr><tr valign="top">
<td scope="row">hup</td>
<td> </td>
<td>Hupa</td>
<td>hupa</td>
<td>Hupa-Sprache</td>
</tr><tr valign="top">
<td scope="row">arm (B)<br>hye (T)</td>
<td>hy</td>
<td>Armenian</td>
<td>arménien</td>
<td>Armenisch</td>
</tr><tr valign="top">
<td scope="row">iba</td>
<td> </td>
<td>Iban</td>
<td>iban</td>
<td>Iban-Sprache</td>
</tr><tr valign="top">
<td scope="row">ibo</td>
<td>ig</td>
<td>Igbo</td>
<td>igbo</td>
<td>Ibo-Sprache</td>
</tr><tr valign="top">
<td scope="row">ice (B)<br>isl (T)</td>
<td>is</td>
<td>Icelandic</td>
<td>islandais</td>
<td>Isländisch</td>
</tr><tr valign="top">
<td scope="row">ido</td>
<td>io</td>
<td>Ido</td>
<td>ido</td>
<td>Ido</td>
</tr><tr valign="top">
<td scope="row">iii</td>
<td>ii</td>
<td>Sichuan Yi; Nuosu</td>
<td>yi de Sichuan</td>
<td>Lalo-Sprache</td>
</tr><tr valign="top">
<td scope="row">ijo</td>
<td> </td>
<td>Ijo languages</td>
<td>ijo, langues</td>
<td>Ijo-Sprache</td>
</tr><tr valign="top">
<td scope="row">iku</td>
<td>iu</td>
<td>Inuktitut</td>
<td>inuktitut</td>
<td>Inuktitut</td>
</tr><tr valign="top">
<td scope="row">ile</td>
<td>ie</td>
<td>Interlingue; Occidental</td>
<td>interlingue</td>
<td>Interlingue</td>
</tr><tr valign="top">
<td scope="row">ilo</td>
<td> </td>
<td>Iloko</td>
<td>ilocano</td>
<td>Ilokano-Sprache</td>
</tr><tr valign="top">
<td scope="row">ina</td>
<td>ia</td>
<td>Interlingua (International Auxiliary Language Association)</td>
<td>interlingua (langue auxiliaire internationale)</td>
<td>Interlingua</td>
</tr><tr valign="top">
<td scope="row">inc</td>
<td> </td>
<td>Indic languages</td>
<td>indo-aryennes, langues</td>
<td>Indoarische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">ind</td>
<td>id</td>
<td>Indonesian</td>
<td>indonésien</td>
<td>Bahasa Indonesia</td>
</tr><tr valign="top">
<td scope="row">ine</td>
<td> </td>
<td>Indo-European languages</td>
<td>indo-européennes, langues</td>
<td>Indogermanische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">inh</td>
<td> </td>
<td>Ingush</td>
<td>ingouche</td>
<td>Inguschisch</td>
</tr><tr valign="top">
<td scope="row">ipk</td>
<td>ik</td>
<td>Inupiaq</td>
<td>inupiaq</td>
<td>Inupik</td>
</tr><tr valign="top">
<td scope="row">ira</td>
<td> </td>
<td>Iranian languages</td>
<td>iraniennes, langues</td>
<td>Iranische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">iro</td>
<td> </td>
<td>Iroquoian languages</td>
<td>iroquoises, langues</td>
<td>Irokesische Sprachen</td>
</tr><tr valign="top">
<td scope="row">ice (B)<br>isl (T)</td>
<td>is</td>
<td>Icelandic</td>
<td>islandais</td>
<td>Isländisch</td>
</tr><tr valign="top">
<td scope="row">ita</td>
<td>it</td>
<td>Italian</td>
<td>italien</td>
<td>Italienisch</td>
</tr><tr valign="top">
<td scope="row">jav</td>
<td>jv</td>
<td>Javanese</td>
<td>javanais</td>
<td>Javanisch</td>
</tr><tr valign="top">
<td scope="row">jbo</td>
<td> </td>
<td>Lojban</td>
<td>lojban</td>
<td>Lojban</td>
</tr><tr valign="top">
<td scope="row">jpn</td>
<td>ja</td>
<td>Japanese</td>
<td>japonais</td>
<td>Japanisch</td>
</tr><tr valign="top">
<td scope="row">jpr</td>
<td> </td>
<td>Judeo-Persian</td>
<td>judéo-persan</td>
<td>Jüdisch-Persisch</td>
</tr><tr valign="top">
<td scope="row">jrb</td>
<td> </td>
<td>Judeo-Arabic</td>
<td>judéo-arabe</td>
<td>Jüdisch-Arabisch</td>
</tr><tr valign="top">
<td scope="row">kaa</td>
<td> </td>
<td>Kara-Kalpak</td>
<td>karakalpak</td>
<td>Karakalpakisch</td>
</tr><tr valign="top">
<td scope="row">kab</td>
<td> </td>
<td>Kabyle</td>
<td>kabyle</td>
<td>Kabylisch</td>
</tr><tr valign="top">
<td scope="row">kac</td>
<td> </td>
<td>Kachin; Jingpho</td>
<td>kachin; jingpho</td>
<td>Kachin-Sprache</td>
</tr><tr valign="top">
<td scope="row">kal</td>
<td>kl</td>
<td>Kalaallisut; Greenlandic</td>
<td>groenlandais</td>
<td>Grönländisch</td>
</tr><tr valign="top">
<td scope="row">kam</td>
<td> </td>
<td>Kamba</td>
<td>kamba</td>
<td>Kamba-Sprache</td>
</tr><tr valign="top">
<td scope="row">kan</td>
<td>kn</td>
<td>Kannada</td>
<td>kannada</td>
<td>Kannada</td>
</tr><tr valign="top">
<td scope="row">kar</td>
<td> </td>
<td>Karen languages</td>
<td>karen, langues</td>
<td>Karenisch</td>
</tr><tr valign="top">
<td scope="row">kas</td>
<td>ks</td>
<td>Kashmiri</td>
<td>kashmiri</td>
<td>Kaschmiri</td>
</tr><tr valign="top">
<td scope="row">geo (B)<br>kat (T)</td>
<td>ka</td>
<td>Georgian</td>
<td>géorgien</td>
<td>Georgisch</td>
</tr><tr valign="top">
<td scope="row">kau</td>
<td>kr</td>
<td>Kanuri</td>
<td>kanouri</td>
<td>Kanuri-Sprache</td>
</tr><tr valign="top">
<td scope="row">kaw</td>
<td> </td>
<td>Kawi</td>
<td>kawi</td>
<td>Kawi</td>
</tr><tr valign="top">
<td scope="row">kaz</td>
<td>kk</td>
<td>Kazakh</td>
<td>kazakh</td>
<td>Kasachisch</td>
</tr><tr valign="top">
<td scope="row">kbd</td>
<td> </td>
<td>Kabardian</td>
<td>kabardien</td>
<td>Kabardinisch</td>
</tr><tr valign="top">
<td scope="row">kha</td>
<td> </td>
<td>Khasi</td>
<td>khasi</td>
<td>Khasi-Sprache</td>
</tr><tr valign="top">
<td scope="row">khi</td>
<td> </td>
<td>Khoisan languages</td>
<td>khoïsan, langues</td>
<td>Khoisan-Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">khm</td>
<td>km</td>
<td>Central Khmer</td>
<td>khmer central</td>
<td>Kambodschanisch</td>
</tr><tr valign="top">
<td scope="row">kho</td>
<td> </td>
<td>Khotanese; Sakan</td>
<td>khotanais; sakan</td>
<td>Sakisch</td>
</tr><tr valign="top">
<td scope="row">kik</td>
<td>ki</td>
<td>Kikuyu; Gikuyu</td>
<td>kikuyu</td>
<td>Kikuyu-Sprache</td>
</tr><tr valign="top">
<td scope="row">kin</td>
<td>rw</td>
<td>Kinyarwanda</td>
<td>rwanda</td>
<td>Rwanda-Sprache</td>
</tr><tr valign="top">
<td scope="row">kir</td>
<td>ky</td>
<td>Kirghiz; Kyrgyz</td>
<td>kirghiz</td>
<td>Kirgisisch</td>
</tr><tr valign="top">
<td scope="row">kmb</td>
<td> </td>
<td>Kimbundu</td>
<td>kimbundu</td>
<td>Kimbundu-Sprache</td>
</tr><tr valign="top">
<td scope="row">kok</td>
<td> </td>
<td>Konkani</td>
<td>konkani</td>
<td>Konkani</td>
</tr><tr valign="top">
<td scope="row">kom</td>
<td>kv</td>
<td>Komi</td>
<td>kom</td>
<td>Komi-Sprache</td>
</tr><tr valign="top">
<td scope="row">kon</td>
<td>kg</td>
<td>Kongo</td>
<td>kongo</td>
<td>Kongo-Sprache</td>
</tr><tr valign="top">
<td scope="row">kor</td>
<td>ko</td>
<td>Korean</td>
<td>coréen</td>
<td>Koreanisch</td>
</tr><tr valign="top">
<td scope="row">kos</td>
<td> </td>
<td>Kosraean</td>
<td>kosrae</td>
<td>Kosraeanisch</td>
</tr><tr valign="top">
<td scope="row">kpe</td>
<td> </td>
<td>Kpelle</td>
<td>kpellé</td>
<td>Kpelle-Sprache</td>
</tr><tr valign="top">
<td scope="row">krc</td>
<td> </td>
<td>Karachay-Balkar</td>
<td>karatchai balkar</td>
<td>Karatschaiisch-Balkarisch</td>
</tr><tr valign="top">
<td scope="row">krl</td>
<td> </td>
<td>Karelian</td>
<td>carélien</td>
<td>Karelisch</td>
</tr><tr valign="top">
<td scope="row">kro</td>
<td> </td>
<td>Kru languages</td>
<td>krou, langues</td>
<td>Kru-Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">kru</td>
<td> </td>
<td>Kurukh</td>
<td>kurukh</td>
<td>Oraon-Sprache</td>
</tr><tr valign="top">
<td scope="row">kua</td>
<td>kj</td>
<td>Kuanyama; Kwanyama</td>
<td>kuanyama; kwanyama</td>
<td>Kwanyama-Sprache</td>
</tr><tr valign="top">
<td scope="row">kum</td>
<td> </td>
<td>Kumyk</td>
<td>koumyk</td>
<td>Kumükisch</td>
</tr><tr valign="top">
<td scope="row">kur</td>
<td>ku</td>
<td>Kurdish</td>
<td>kurde</td>
<td>Kurdisch</td>
</tr><tr valign="top">
<td scope="row">kut</td>
<td> </td>
<td>Kutenai</td>
<td>kutenai</td>
<td>Kutenai-Sprache</td>
</tr><tr valign="top">
<td scope="row">lad</td>
<td> </td>
<td>Ladino</td>
<td>judéo-espagnol</td>
<td>Judenspanisch</td>
</tr><tr valign="top">
<td scope="row">lah</td>
<td> </td>
<td>Lahnda</td>
<td>lahnda</td>
<td>Lahnda</td>
</tr><tr valign="top">
<td scope="row">lam</td>
<td> </td>
<td>Lamba</td>
<td>lamba</td>
<td>Lamba-Sprache (Bantusprache)</td>
</tr><tr valign="top">
<td scope="row">lao</td>
<td>lo</td>
<td>Lao</td>
<td>lao</td>
<td>Laotisch</td>
</tr><tr valign="top">
<td scope="row">lat</td>
<td>la</td>
<td>Latin</td>
<td>latin</td>
<td>Latein</td>
</tr><tr valign="top">
<td scope="row">lav</td>
<td>lv</td>
<td>Latvian</td>
<td>letton</td>
<td>Lettisch</td>
</tr><tr valign="top">
<td scope="row">lez</td>
<td> </td>
<td>Lezghian</td>
<td>lezghien</td>
<td>Lesgisch</td>
</tr><tr valign="top">
<td scope="row">lim</td>
<td>li</td>
<td>Limburgan; Limburger; Limburgish</td>
<td>limbourgeois</td>
<td>Limburgisch</td>
</tr><tr valign="top">
<td scope="row">lin</td>
<td>ln</td>
<td>Lingala</td>
<td>lingala</td>
<td>Lingala</td>
</tr><tr valign="top">
<td scope="row">lit</td>
<td>lt</td>
<td>Lithuanian</td>
<td>lituanien</td>
<td>Litauisch</td>
</tr><tr valign="top">
<td scope="row">lol</td>
<td> </td>
<td>Mongo</td>
<td>mongo</td>
<td>Mongo-Sprache</td>
</tr><tr valign="top">
<td scope="row">loz</td>
<td> </td>
<td>Lozi</td>
<td>lozi</td>
<td>Rotse-Sprache</td>
</tr><tr valign="top">
<td scope="row">ltz</td>
<td>lb</td>
<td>Luxembourgish; Letzeburgesch</td>
<td>luxembourgeois</td>
<td>Luxemburgisch</td>
</tr><tr valign="top">
<td scope="row">lua</td>
<td> </td>
<td>Luba-Lulua</td>
<td>luba-lulua</td>
<td>Lulua-Sprache</td>
</tr><tr valign="top">
<td scope="row">lub</td>
<td>lu</td>
<td>Luba-Katanga</td>
<td>luba-katanga</td>
<td>Luba-Katanga-Sprache</td>
</tr><tr valign="top">
<td scope="row">lug</td>
<td>lg</td>
<td>Ganda</td>
<td>ganda</td>
<td>Ganda-Sprache</td>
</tr><tr valign="top">
<td scope="row">lui</td>
<td> </td>
<td>Luiseno</td>
<td>luiseno</td>
<td>Luiseño-Sprache</td>
</tr><tr valign="top">
<td scope="row">lun</td>
<td> </td>
<td>Lunda</td>
<td>lunda</td>
<td>Lunda-Sprache</td>
</tr><tr valign="top">
<td scope="row">luo</td>
<td> </td>
<td>Luo (Kenya and Tanzania)</td>
<td>luo (Kenya et Tanzanie)</td>
<td>Luo-Sprache</td>
</tr><tr valign="top">
<td scope="row">lus</td>
<td> </td>
<td>Lushai</td>
<td>lushai</td>
<td>Lushai-Sprache</td>
</tr><tr valign="top">
<td scope="row">mac (B)<br>mkd (T)</td>
<td>mk</td>
<td>Macedonian</td>
<td>macédonien</td>
<td>Makedonisch</td>
</tr><tr valign="top">
<td scope="row">mad</td>
<td> </td>
<td>Madurese</td>
<td>madourais</td>
<td>Maduresisch</td>
</tr><tr valign="top">
<td scope="row">mag</td>
<td> </td>
<td>Magahi</td>
<td>magahi</td>
<td>Khotta</td>
</tr><tr valign="top">
<td scope="row">mah</td>
<td>mh</td>
<td>Marshallese</td>
<td>marshall</td>
<td>Marschallesisch</td>
</tr><tr valign="top">
<td scope="row">mai</td>
<td> </td>
<td>Maithili</td>
<td>maithili</td>
<td>Maithili</td>
</tr><tr valign="top">
<td scope="row">mak</td>
<td> </td>
<td>Makasar</td>
<td>makassar</td>
<td>Makassarisch</td>
</tr><tr valign="top">
<td scope="row">mal</td>
<td>ml</td>
<td>Malayalam</td>
<td>malayalam</td>
<td>Malayalam</td>
</tr><tr valign="top">
<td scope="row">man</td>
<td> </td>
<td>Mandingo</td>
<td>mandingue</td>
<td>Malinke-Sprache</td>
</tr><tr valign="top">
<td scope="row">mao (B)<br>mri (T)</td>
<td>mi</td>
<td>Maori</td>
<td>maori</td>
<td>Maori-Sprache</td>
</tr><tr valign="top">
<td scope="row">map</td>
<td> </td>
<td>Austronesian languages</td>
<td>austronésiennes, langues</td>
<td>Austronesische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">mar</td>
<td>mr</td>
<td>Marathi</td>
<td>marathe</td>
<td>Marathi</td>
</tr><tr valign="top">
<td scope="row">mas</td>
<td> </td>
<td>Masai</td>
<td>massaï</td>
<td>Massai-Sprache</td>
</tr><tr valign="top">
<td scope="row">may (B)<br>msa (T)</td>
<td>ms</td>
<td>Malay</td>
<td>malais</td>
<td>Malaiisch</td>
</tr><tr valign="top">
<td scope="row">mdf</td>
<td> </td>
<td>Moksha</td>
<td>moksa</td>
<td>Mokscha-Sprache</td>
</tr><tr valign="top">
<td scope="row">mdr</td>
<td> </td>
<td>Mandar</td>
<td>mandar</td>
<td>Mandaresisch</td>
</tr><tr valign="top">
<td scope="row">men</td>
<td> </td>
<td>Mende</td>
<td>mendé</td>
<td>Mende-Sprache</td>
</tr><tr valign="top">
<td scope="row">mga</td>
<td> </td>
<td>Irish, Middle (900-1200)</td>
<td>irlandais moyen (900-1200)</td>
<td>Mittelirisch</td>
</tr><tr valign="top">
<td scope="row">mic</td>
<td> </td>
<td>Mi'kmaq; Micmac</td>
<td>mi'kmaq; micmac</td>
<td>Micmac-Sprache</td>
</tr><tr valign="top">
<td scope="row">min</td>
<td> </td>
<td>Minangkabau</td>
<td>minangkabau</td>
<td>Minangkabau-Sprache</td>
</tr><tr valign="top">
<td scope="row">mis</td>
<td> </td>
<td>Uncoded languages</td>
<td>langues non codées</td>
<td>Einzelne andere Sprachen</td>
</tr><tr valign="top">
<td scope="row">mac (B)<br>mkd (T)</td>
<td>mk</td>
<td>Macedonian</td>
<td>macédonien</td>
<td>Makedonisch</td>
</tr><tr valign="top">
<td scope="row">mkh</td>
<td> </td>
<td>Mon-Khmer languages</td>
<td>môn-khmer, langues</td>
<td>Mon-Khmer-Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">mlg</td>
<td>mg</td>
<td>Malagasy</td>
<td>malgache</td>
<td>Malagassi-Sprache</td>
</tr><tr valign="top">
<td scope="row">mlt</td>
<td>mt</td>
<td>Maltese</td>
<td>maltais</td>
<td>Maltesisch</td>
</tr><tr valign="top">
<td scope="row">mnc</td>
<td> </td>
<td>Manchu</td>
<td>mandchou</td>
<td>Mandschurisch</td>
</tr><tr valign="top">
<td scope="row">mni</td>
<td> </td>
<td>Manipuri</td>
<td>manipuri</td>
<td>Meithei-Sprache</td>
</tr><tr valign="top">
<td scope="row">mno</td>
<td> </td>
<td>Manobo languages</td>
<td>manobo, langues</td>
<td>Manobo-Sprachen</td>
</tr><tr valign="top">
<td scope="row">moh</td>
<td> </td>
<td>Mohawk</td>
<td>mohawk</td>
<td>Mohawk-Sprache</td>
</tr><tr valign="top">
<td scope="row">mon</td>
<td>mn</td>
<td>Mongolian</td>
<td>mongol</td>
<td>Mongolisch</td>
</tr><tr valign="top">
<td scope="row">mos</td>
<td> </td>
<td>Mossi</td>
<td>moré</td>
<td>Mossi-Sprache</td>
</tr><tr valign="top">
<td scope="row">mao (B)<br>mri (T)</td>
<td>mi</td>
<td>Maori</td>
<td>maori</td>
<td>Maori-Sprache</td>
</tr><tr valign="top">
<td scope="row">may (B)<br>msa (T)</td>
<td>ms</td>
<td>Malay</td>
<td>malais</td>
<td>Malaiisch</td>
</tr><tr valign="top">
<td scope="row">mul</td>
<td> </td>
<td>Multiple languages</td>
<td>multilingue</td>
<td>Mehrere Sprachen</td>
</tr><tr valign="top">
<td scope="row">mun</td>
<td> </td>
<td>Munda languages</td>
<td>mounda, langues</td>
<td>Mundasprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">mus</td>
<td> </td>
<td>Creek</td>
<td>muskogee</td>
<td>Muskogisch</td>
</tr><tr valign="top">
<td scope="row">mwl</td>
<td> </td>
<td>Mirandese</td>
<td>mirandais</td>
<td>Mirandesisch</td>
</tr><tr valign="top">
<td scope="row">mwr</td>
<td> </td>
<td>Marwari</td>
<td>marvari</td>
<td>Marwari</td>
</tr><tr valign="top">
<td scope="row">bur (B)<br>mya (T)</td>
<td>my</td>
<td>Burmese</td>
<td>birman</td>
<td>Birmanisch</td>
</tr><tr valign="top">
<td scope="row">myn</td>
<td> </td>
<td>Mayan languages</td>
<td>maya, langues</td>
<td>Maya-Sprachen</td>
</tr><tr valign="top">
<td scope="row">myv</td>
<td> </td>
<td>Erzya</td>
<td>erza</td>
<td>Erza-Mordwinisch</td>
</tr><tr valign="top">
<td scope="row">nah</td>
<td> </td>
<td>Nahuatl languages</td>
<td>nahuatl, langues</td>
<td>Nahuatl</td>
</tr><tr valign="top">
<td scope="row">nai</td>
<td> </td>
<td>North American Indian languages</td>
<td>nord-amérindiennes, langues</td>
<td>Indianersprachen, Nordamerika (Andere)</td>
</tr><tr valign="top">
<td scope="row">nap</td>
<td> </td>
<td>Neapolitan</td>
<td>napolitain</td>
<td>Neapel / Mundart</td>
</tr><tr valign="top">
<td scope="row">nau</td>
<td>na</td>
<td>Nauru</td>
<td>nauruan</td>
<td>Nauruanisch</td>
</tr><tr valign="top">
<td scope="row">nav</td>
<td>nv</td>
<td>Navajo; Navaho</td>
<td>navaho</td>
<td>Navajo-Sprache</td>
</tr><tr valign="top">
<td scope="row">nbl</td>
<td>nr</td>
<td>Ndebele, South; South Ndebele</td>
<td>ndébélé du Sud</td>
<td>Ndebele-Sprache (Transvaal)</td>
</tr><tr valign="top">
<td scope="row">nde</td>
<td>nd</td>
<td>Ndebele, North; North Ndebele</td>
<td>ndébélé du Nord</td>
<td>Ndebele-Sprache (Simbabwe)</td>
</tr><tr valign="top">
<td scope="row">ndo</td>
<td>ng</td>
<td>Ndonga</td>
<td>ndonga</td>
<td>Ndonga</td>
</tr><tr valign="top">
<td scope="row">nds</td>
<td> </td>
<td>Low German; Low Saxon; German, Low; Saxon, Low</td>
<td>bas allemand; bas saxon; allemand, bas; saxon, bas</td>
<td>Niederdeutsch</td>
</tr><tr valign="top">
<td scope="row">nep</td>
<td>ne</td>
<td>Nepali</td>
<td>népalais</td>
<td>Nepali</td>
</tr><tr valign="top">
<td scope="row">new</td>
<td> </td>
<td>Nepal Bhasa; Newari</td>
<td>nepal bhasa; newari</td>
<td>Newari</td>
</tr><tr valign="top">
<td scope="row">nia</td>
<td> </td>
<td>Nias</td>
<td>nias</td>
<td>Nias-Sprache</td>
</tr><tr valign="top">
<td scope="row">nic</td>
<td> </td>
<td>Niger-Kordofanian languages</td>
<td>nigéro-kordofaniennes, langues</td>
<td>Nigerkordofanische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">niu</td>
<td> </td>
<td>Niuean</td>
<td>niué</td>
<td>Niue-Sprache</td>
</tr><tr valign="top">
<td scope="row">dut (B)<br>nld (T)</td>
<td>nl</td>
<td>Dutch; Flemish</td>
<td>néerlandais; flamand</td>
<td>Niederländisch</td>
</tr><tr valign="top">
<td scope="row">nno</td>
<td>nn</td>
<td>Norwegian Nynorsk; Nynorsk, Norwegian</td>
<td>norvégien nynorsk; nynorsk, norvégien</td>
<td>Nynorsk</td>
</tr><tr valign="top">
<td scope="row">nob</td>
<td>nb</td>
<td>Bokmål, Norwegian; Norwegian Bokmål</td>
<td>norvégien bokmål</td>
<td>Bokmål</td>
</tr><tr valign="top">
<td scope="row">nog</td>
<td> </td>
<td>Nogai</td>
<td>nogaï; nogay</td>
<td>Nogaisch</td>
</tr><tr valign="top">
<td scope="row">non</td>
<td> </td>
<td>Norse, Old</td>
<td>norrois, vieux</td>
<td>Altnorwegisch</td>
</tr><tr valign="top">
<td scope="row">nor</td>
<td>no</td>
<td>Norwegian</td>
<td>norvégien</td>
<td>Norwegisch</td>
</tr><tr valign="top">
<td scope="row">nqo</td>
<td> </td>
<td>N'Ko</td>
<td>n'ko</td>
<td>N'Ko</td>
</tr><tr valign="top">
<td scope="row">nso</td>
<td> </td>
<td>Pedi; Sepedi; Northern Sotho</td>
<td>pedi; sepedi; sotho du Nord</td>
<td>Pedi-Sprache</td>
</tr><tr valign="top">
<td scope="row">nub</td>
<td> </td>
<td>Nubian languages</td>
<td>nubiennes, langues</td>
<td>Nubische Sprachen</td>
</tr><tr valign="top">
<td scope="row">nwc</td>
<td> </td>
<td>Classical Newari; Old Newari; Classical Nepal Bhasa</td>
<td>newari classique</td>
<td>Alt-Newari</td>
</tr><tr valign="top">
<td scope="row">nya</td>
<td>ny</td>
<td>Chichewa; Chewa; Nyanja</td>
<td>chichewa; chewa; nyanja</td>
<td>Nyanja-Sprache</td>
</tr><tr valign="top">
<td scope="row">nym</td>
<td> </td>
<td>Nyamwezi</td>
<td>nyamwezi</td>
<td>Nyamwezi-Sprache</td>
</tr><tr valign="top">
<td scope="row">nyn</td>
<td> </td>
<td>Nyankole</td>
<td>nyankolé</td>
<td>Nkole-Sprache</td>
</tr><tr valign="top">
<td scope="row">nyo</td>
<td> </td>
<td>Nyoro</td>
<td>nyoro</td>
<td>Nyoro-Sprache</td>
</tr><tr valign="top">
<td scope="row">nzi</td>
<td> </td>
<td>Nzima</td>
<td>nzema</td>
<td>Nzima-Sprache</td>
</tr><tr valign="top">
<td scope="row">oci</td>
<td>oc</td>
<td>Occitan (post 1500)</td>
<td>occitan (après 1500)</td>
<td>Okzitanisch</td>
</tr><tr valign="top">
<td scope="row">oji</td>
<td>oj</td>
<td>Ojibwa</td>
<td>ojibwa</td>
<td>Ojibwa-Sprache</td>
</tr><tr valign="top">
<td scope="row">ori</td>
<td>or</td>
<td>Oriya</td>
<td>oriya</td>
<td>Oriya-Sprache</td>
</tr><tr valign="top">
<td scope="row">orm</td>
<td>om</td>
<td>Oromo</td>
<td>galla</td>
<td>Galla-Sprache</td>
</tr><tr valign="top">
<td scope="row">osa</td>
<td> </td>
<td>Osage</td>
<td>osage</td>
<td>Osage-Sprache</td>
</tr><tr valign="top">
<td scope="row">oss</td>
<td>os</td>
<td>Ossetian; Ossetic</td>
<td>ossète</td>
<td>Ossetisch</td>
</tr><tr valign="top">
<td scope="row">ota</td>
<td> </td>
<td>Turkish, Ottoman (1500-1928)</td>
<td>turc ottoman (1500-1928)</td>
<td>Osmanisch</td>
</tr><tr valign="top">
<td scope="row">oto</td>
<td> </td>
<td>Otomian languages</td>
<td>otomi, langues</td>
<td>Otomangue-Sprachen</td>
</tr><tr valign="top">
<td scope="row">paa</td>
<td> </td>
<td>Papuan languages</td>
<td>papoues, langues</td>
<td>Papuasprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">pag</td>
<td> </td>
<td>Pangasinan</td>
<td>pangasinan</td>
<td>Pangasinan-Sprache</td>
</tr><tr valign="top">
<td scope="row">pal</td>
<td> </td>
<td>Pahlavi</td>
<td>pahlavi</td>
<td>Mittelpersisch</td>
</tr><tr valign="top">
<td scope="row">pam</td>
<td> </td>
<td>Pampanga; Kapampangan</td>
<td>pampangan</td>
<td>Pampanggan-Sprache</td>
</tr><tr valign="top">
<td scope="row">pan</td>
<td>pa</td>
<td>Panjabi; Punjabi</td>
<td>pendjabi</td>
<td>Pandschabi-Sprache</td>
</tr><tr valign="top">
<td scope="row">pap</td>
<td> </td>
<td>Papiamento</td>
<td>papiamento</td>
<td>Papiamento</td>
</tr><tr valign="top">
<td scope="row">pau</td>
<td> </td>
<td>Palauan</td>
<td>palau</td>
<td>Palau-Sprache</td>
</tr><tr valign="top">
<td scope="row">peo</td>
<td> </td>
<td>Persian, Old (ca.600-400 B.C.)</td>
<td>perse, vieux (ca. 600-400 av. J.-C.)</td>
<td>Altpersisch</td>
</tr><tr valign="top">
<td scope="row">per (B)<br>fas (T)</td>
<td>fa</td>
<td>Persian</td>
<td>persan</td>
<td>Persisch</td>
</tr><tr valign="top">
<td scope="row">phi</td>
<td> </td>
<td>Philippine languages</td>
<td>philippines, langues</td>
<td>Philippinisch-Austronesisch (Andere)</td>
</tr><tr valign="top">
<td scope="row">phn</td>
<td> </td>
<td>Phoenician</td>
<td>phénicien</td>
<td>Phönikisch</td>
</tr><tr valign="top">
<td scope="row">pli</td>
<td>pi</td>
<td>Pali</td>
<td>pali</td>
<td>Pali</td>
</tr><tr valign="top">
<td scope="row">pol</td>
<td>pl</td>
<td>Polish</td>
<td>polonais</td>
<td>Polnisch</td>
</tr><tr valign="top">
<td scope="row">pon</td>
<td> </td>
<td>Pohnpeian</td>
<td>pohnpei</td>
<td>Ponapeanisch</td>
</tr><tr valign="top">
<td scope="row">por</td>
<td>pt</td>
<td>Portuguese</td>
<td>portugais</td>
<td>Portugiesisch</td>
</tr><tr valign="top">
<td scope="row">pra</td>
<td> </td>
<td>Prakrit languages</td>
<td>prâkrit, langues</td>
<td>Prakrit</td>
</tr><tr valign="top">
<td scope="row">pro</td>
<td> </td>
<td>Provençal, Old (to 1500);Occitan, Old (to 1500)</td>
<td>provençal ancien (jusqu'à 1500); occitan ancien (jusqu'à 1500)</td>
<td>Altokzitanisch</td>
</tr><tr valign="top">
<td scope="row">pus</td>
<td>ps</td>
<td>Pushto; Pashto</td>
<td>pachto</td>
<td>Paschtu</td>
</tr><tr valign="top">
<td scope="row">qaa-qtz</td>
<td> </td>
<td>Reserved for local use</td>
<td>réservée à l'usage local</td>
<td>Reserviert für lokale Verwendung</td>
</tr><tr valign="top">
<td scope="row">que</td>
<td>qu</td>
<td>Quechua</td>
<td>quechua</td>
<td>Quechua-Sprache</td>
</tr><tr valign="top">
<td scope="row">raj</td>
<td> </td>
<td>Rajasthani</td>
<td>rajasthani</td>
<td>Rajasthani</td>
</tr><tr valign="top">
<td scope="row">rap</td>
<td> </td>
<td>Rapanui</td>
<td>rapanui</td>
<td>Osterinsel-Sprache</td>
</tr><tr valign="top">
<td scope="row">rar</td>
<td> </td>
<td>Rarotongan; Cook Islands Maori</td>
<td>rarotonga; maori des îles Cook</td>
<td>Rarotonganisch</td>
</tr><tr valign="top">
<td scope="row">roa</td>
<td> </td>
<td>Romance languages</td>
<td>romanes, langues</td>
<td>Romanische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">roh</td>
<td>rm</td>
<td>Romansh</td>
<td>romanche</td>
<td>Rätoromanisch</td>
</tr><tr valign="top">
<td scope="row">rom</td>
<td> </td>
<td>Romany</td>
<td>tsigane</td>
<td>Romani (Sprache)</td>
</tr><tr valign="top">
<td scope="row">rum (B)<br>ron (T)</td>
<td>ro</td>
<td>Romanian; Moldavian; Moldovan</td>
<td>roumain; moldave</td>
<td>Rumänisch</td>
</tr><tr valign="top">
<td scope="row">rum (B)<br>ron (T)</td>
<td>ro</td>
<td>Romanian; Moldavian; Moldovan</td>
<td>roumain; moldave</td>
<td>Rumänisch</td>
</tr><tr valign="top">
<td scope="row">run</td>
<td>rn</td>
<td>Rundi</td>
<td>rundi</td>
<td>Rundi-Sprache</td>
</tr><tr valign="top">
<td scope="row">rup</td>
<td> </td>
<td>Aromanian; Arumanian; Macedo-Romanian</td>
<td>aroumain; macédo-roumain</td>
<td>Aromunisch</td>
</tr><tr valign="top">
<td scope="row">rus</td>
<td>ru</td>
<td>Russian</td>
<td>russe</td>
<td>Russisch</td>
</tr><tr valign="top">
<td scope="row">sad</td>
<td> </td>
<td>Sandawe</td>
<td>sandawe</td>
<td>Sandawe-Sprache</td>
</tr><tr valign="top">
<td scope="row">sag</td>
<td>sg</td>
<td>Sango</td>
<td>sango</td>
<td>Sango-Sprache</td>
</tr><tr valign="top">
<td scope="row">sah</td>
<td> </td>
<td>Yakut</td>
<td>iakoute</td>
<td>Jakutisch</td>
</tr><tr valign="top">
<td scope="row">sai</td>
<td> </td>
<td>South American Indian languages</td>
<td>sud-amérindiennes, langues</td>
<td>Indianersprachen, Südamerika (Andere)</td>
</tr><tr valign="top">
<td scope="row">sal</td>
<td> </td>
<td>Salishan languages</td>
<td>salishennes, langues</td>
<td>Salish-Sprache</td>
</tr><tr valign="top">
<td scope="row">sam</td>
<td> </td>
<td>Samaritan Aramaic</td>
<td>samaritain</td>
<td>Samaritanisch</td>
</tr><tr valign="top">
<td scope="row">san</td>
<td>sa</td>
<td>Sanskrit</td>
<td>sanskrit</td>
<td>Sanskrit</td>
</tr><tr valign="top">
<td scope="row">sas</td>
<td> </td>
<td>Sasak</td>
<td>sasak</td>
<td>Sasak</td>
</tr><tr valign="top">
<td scope="row">sat</td>
<td> </td>
<td>Santali</td>
<td>santal</td>
<td>Santali</td>
</tr><tr valign="top">
<td scope="row">scn</td>
<td> </td>
<td>Sicilian</td>
<td>sicilien</td>
<td>Sizilianisch</td>
</tr><tr valign="top">
<td scope="row">sco</td>
<td> </td>
<td>Scots</td>
<td>écossais</td>
<td>Schottisch</td>
</tr><tr valign="top">
<td scope="row">sel</td>
<td> </td>
<td>Selkup</td>
<td>selkoupe</td>
<td>Selkupisch</td>
</tr><tr valign="top">
<td scope="row">sem</td>
<td> </td>
<td>Semitic languages</td>
<td>sémitiques, langues</td>
<td>Semitische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">sga</td>
<td> </td>
<td>Irish, Old (to 900)</td>
<td>irlandais ancien (jusqu'à 900)</td>
<td>Altirisch</td>
</tr><tr valign="top">
<td scope="row">sgn</td>
<td> </td>
<td>Sign Languages</td>
<td>langues des signes</td>
<td>Zeichensprachen</td>
</tr><tr valign="top">
<td scope="row">shn</td>
<td> </td>
<td>Shan</td>
<td>chan</td>
<td>Schan-Sprache</td>
</tr><tr valign="top">
<td scope="row">sid</td>
<td> </td>
<td>Sidamo</td>
<td>sidamo</td>
<td>Sidamo-Sprache</td>
</tr><tr valign="top">
<td scope="row">sin</td>
<td>si</td>
<td>Sinhala; Sinhalese</td>
<td>singhalais</td>
<td>Singhalesisch</td>
</tr><tr valign="top">
<td scope="row">sio</td>
<td> </td>
<td>Siouan languages</td>
<td>sioux, langues</td>
<td>Sioux-Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">sit</td>
<td> </td>
<td>Sino-Tibetan languages</td>
<td>sino-tibétaines, langues</td>
<td>Sinotibetische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">sla</td>
<td> </td>
<td>Slavic languages</td>
<td>slaves, langues</td>
<td>Slawische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">slo (B)<br>slk (T)</td>
<td>sk</td>
<td>Slovak</td>
<td>slovaque</td>
<td>Slowakisch</td>
</tr><tr valign="top">
<td scope="row">slo (B)<br>slk (T)</td>
<td>sk</td>
<td>Slovak</td>
<td>slovaque</td>
<td>Slowakisch</td>
</tr><tr valign="top">
<td scope="row">slv</td>
<td>sl</td>
<td>Slovenian</td>
<td>slovène</td>
<td>Slowenisch</td>
</tr><tr valign="top">
<td scope="row">sma</td>
<td> </td>
<td>Southern Sami</td>
<td>sami du Sud</td>
<td>Südsaamisch</td>
</tr><tr valign="top">
<td scope="row">sme</td>
<td>se</td>
<td>Northern Sami</td>
<td>sami du Nord</td>
<td>Nordsaamisch</td>
</tr><tr valign="top">
<td scope="row">smi</td>
<td> </td>
<td>Sami languages</td>
<td>sames, langues</td>
<td>Saamisch</td>
</tr><tr valign="top">
<td scope="row">smj</td>
<td> </td>
<td>Lule Sami</td>
<td>sami de Lule</td>
<td>Lulesaamisch</td>
</tr><tr valign="top">
<td scope="row">smn</td>
<td> </td>
<td>Inari Sami</td>
<td>sami d'Inari</td>
<td>Inarisaamisch</td>
</tr><tr valign="top">
<td scope="row">smo</td>
<td>sm</td>
<td>Samoan</td>
<td>samoan</td>
<td>Samoanisch</td>
</tr><tr valign="top">
<td scope="row">sms</td>
<td> </td>
<td>Skolt Sami</td>
<td>sami skolt</td>
<td>Skoltsaamisch</td>
</tr><tr valign="top">
<td scope="row">sna</td>
<td>sn</td>
<td>Shona</td>
<td>shona</td>
<td>Schona-Sprache</td>
</tr><tr valign="top">
<td scope="row">snd</td>
<td>sd</td>
<td>Sindhi</td>
<td>sindhi</td>
<td>Sindhi-Sprache</td>
</tr><tr valign="top">
<td scope="row">snk</td>
<td> </td>
<td>Soninke</td>
<td>soninké</td>
<td>Soninke-Sprache</td>
</tr><tr valign="top">
<td scope="row">sog</td>
<td> </td>
<td>Sogdian</td>
<td>sogdien</td>
<td>Sogdisch</td>
</tr><tr valign="top">
<td scope="row">som</td>
<td>so</td>
<td>Somali</td>
<td>somali</td>
<td>Somali</td>
</tr><tr valign="top">
<td scope="row">son</td>
<td> </td>
<td>Songhai languages</td>
<td>songhai, langues</td>
<td>Songhai-Sprache</td>
</tr><tr valign="top">
<td scope="row">sot</td>
<td>st</td>
<td>Sotho, Southern</td>
<td>sotho du Sud</td>
<td>Süd-Sotho-Sprache</td>
</tr><tr valign="top">
<td scope="row">spa</td>
<td>es</td>
<td>Spanish; Castilian</td>
<td>espagnol; castillan</td>
<td>Spanisch</td>
</tr><tr valign="top">
<td scope="row">alb (B)<br>sqi (T)</td>
<td>sq</td>
<td>Albanian</td>
<td>albanais</td>
<td>Albanisch</td>
</tr><tr valign="top">
<td scope="row">srd</td>
<td>sc</td>
<td>Sardinian</td>
<td>sarde</td>
<td>Sardisch</td>
</tr><tr valign="top">
<td scope="row">srn</td>
<td> </td>
<td>Sranan Tongo</td>
<td>sranan tongo</td>
<td>Sranantongo</td>
</tr><tr valign="top">
<td scope="row">srp</td>
<td>sr</td>
<td>Serbian</td>
<td>serbe</td>
<td>Serbisch </td>
</tr><tr valign="top">
<td scope="row">srr</td>
<td> </td>
<td>Serer</td>
<td>sérère</td>
<td>Serer-Sprache</td>
</tr><tr valign="top">
<td scope="row">ssa</td>
<td> </td>
<td>Nilo-Saharan languages</td>
<td>nilo-sahariennes, langues</td>
<td>Nilosaharanische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">ssw</td>
<td>ss</td>
<td>Swati</td>
<td>swati</td>
<td>Swasi-Sprache</td>
</tr><tr valign="top">
<td scope="row">suk</td>
<td> </td>
<td>Sukuma</td>
<td>sukuma</td>
<td>Sukuma-Sprache</td>
</tr><tr valign="top">
<td scope="row">sun</td>
<td>su</td>
<td>Sundanese</td>
<td>soundanais</td>
<td>Sundanesisch</td>
</tr><tr valign="top">
<td scope="row">sus</td>
<td> </td>
<td>Susu</td>
<td>soussou</td>
<td>Susu</td>
</tr><tr valign="top">
<td scope="row">sux</td>
<td> </td>
<td>Sumerian</td>
<td>sumérien</td>
<td>Sumerisch</td>
</tr><tr valign="top">
<td scope="row">swa</td>
<td>sw</td>
<td>Swahili</td>
<td>swahili</td>
<td>Swahili</td>
</tr><tr valign="top">
<td scope="row">swe</td>
<td>sv</td>
<td>Swedish</td>
<td>suédois</td>
<td>Schwedisch</td>
</tr><tr valign="top">
<td scope="row">syc</td>
<td> </td>
<td>Classical Syriac</td>
<td>syriaque classique</td>
<td>Syrisch</td>
</tr><tr valign="top">
<td scope="row">syr</td>
<td> </td>
<td>Syriac</td>
<td>syriaque</td>
<td>Neuostaramäisch</td>
</tr><tr valign="top">
<td scope="row">tah</td>
<td>ty</td>
<td>Tahitian</td>
<td>tahitien</td>
<td>Tahitisch</td>
</tr><tr valign="top">
<td scope="row">tai</td>
<td> </td>
<td>Tai languages</td>
<td>tai, langues</td>
<td>Thaisprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">tam</td>
<td>ta</td>
<td>Tamil</td>
<td>tamoul</td>
<td>Tamil</td>
</tr><tr valign="top">
<td scope="row">tat</td>
<td>tt</td>
<td>Tatar</td>
<td>tatar</td>
<td>Tatarisch</td>
</tr><tr valign="top">
<td scope="row">tel</td>
<td>te</td>
<td>Telugu</td>
<td>télougou</td>
<td>Telugu-Sprache</td>
</tr><tr valign="top">
<td scope="row">tem</td>
<td> </td>
<td>Timne</td>
<td>temne</td>
<td>Temne-Sprache</td>
</tr><tr valign="top">
<td scope="row">ter</td>
<td> </td>
<td>Tereno</td>
<td>tereno</td>
<td>Tereno-Sprache</td>
</tr><tr valign="top">
<td scope="row">tet</td>
<td> </td>
<td>Tetum</td>
<td>tetum</td>
<td>Tetum-Sprache</td>
</tr><tr valign="top">
<td scope="row">tgk</td>
<td>tg</td>
<td>Tajik</td>
<td>tadjik</td>
<td>Tadschikisch</td>
</tr><tr valign="top">
<td scope="row">tgl</td>
<td>tl</td>
<td>Tagalog</td>
<td>tagalog</td>
<td>Tagalog</td>
</tr><tr valign="top">
<td scope="row">tha</td>
<td>th</td>
<td>Thai</td>
<td>thaï</td>
<td>Thailändisch</td>
</tr><tr valign="top">
<td scope="row">tib (B)<br>bod (T)</td>
<td>bo</td>
<td>Tibetan</td>
<td>tibétain</td>
<td>Tibetisch</td>
</tr><tr valign="top">
<td scope="row">tig</td>
<td> </td>
<td>Tigre</td>
<td>tigré</td>
<td>Tigre-Sprache</td>
</tr><tr valign="top">
<td scope="row">tir</td>
<td>ti</td>
<td>Tigrinya</td>
<td>tigrigna</td>
<td>Tigrinja-Sprache</td>
</tr><tr valign="top">
<td scope="row">tiv</td>
<td> </td>
<td>Tiv</td>
<td>tiv</td>
<td>Tiv-Sprache</td>
</tr><tr valign="top">
<td scope="row">tkl</td>
<td> </td>
<td>Tokelau</td>
<td>tokelau</td>
<td>Tokelauanisch</td>
</tr><tr valign="top">
<td scope="row">tlh</td>
<td> </td>
<td>Klingon; tlhIngan-Hol</td>
<td>klingon</td>
<td>Klingonisch</td>
</tr><tr valign="top">
<td scope="row">tli</td>
<td> </td>
<td>Tlingit</td>
<td>tlingit</td>
<td>Tlingit-Sprache</td>
</tr><tr valign="top">
<td scope="row">tmh</td>
<td> </td>
<td>Tamashek</td>
<td>tamacheq</td>
<td>Tamašeq</td>
</tr><tr valign="top">
<td scope="row">tog</td>
<td> </td>
<td>Tonga (Nyasa)</td>
<td>tonga (Nyasa)</td>
<td>Tonga (Bantusprache, Sambia)</td>
</tr><tr valign="top">
<td scope="row">ton</td>
<td>to</td>
<td>Tonga (Tonga Islands)</td>
<td>tongan (Îles Tonga)</td>
<td>Tongaisch</td>
</tr><tr valign="top">
<td scope="row">tpi</td>
<td> </td>
<td>Tok Pisin</td>
<td>tok pisin</td>
<td>Neumelanesisch</td>
</tr><tr valign="top">
<td scope="row">tsi</td>
<td> </td>
<td>Tsimshian</td>
<td>tsimshian</td>
<td>Tsimshian-Sprache</td>
</tr><tr valign="top">
<td scope="row">tsn</td>
<td>tn</td>
<td>Tswana</td>
<td>tswana</td>
<td>Tswana-Sprache</td>
</tr><tr valign="top">
<td scope="row">tso</td>
<td>ts</td>
<td>Tsonga</td>
<td>tsonga</td>
<td>Tsonga-Sprache</td>
</tr><tr valign="top">
<td scope="row">tuk</td>
<td>tk</td>
<td>Turkmen</td>
<td>turkmène</td>
<td>Turkmenisch</td>
</tr><tr valign="top">
<td scope="row">tum</td>
<td> </td>
<td>Tumbuka</td>
<td>tumbuka</td>
<td>Tumbuka-Sprache</td>
</tr><tr valign="top">
<td scope="row">tup</td>
<td> </td>
<td>Tupi languages</td>
<td>tupi, langues</td>
<td>Tupi-Sprache</td>
</tr><tr valign="top">
<td scope="row">tur</td>
<td>tr</td>
<td>Turkish</td>
<td>turc</td>
<td>Türkisch</td>
</tr><tr valign="top">
<td scope="row">tut</td>
<td> </td>
<td>Altaic languages</td>
<td>altaïques, langues</td>
<td>Altaische Sprachen (Andere)</td>
</tr><tr valign="top">
<td scope="row">tvl</td>
<td> </td>
<td>Tuvalu</td>
<td>tuvalu</td>
<td>Elliceanisch</td>
</tr><tr valign="top">
<td scope="row">twi</td>
<td>tw</td>
<td>Twi</td>
<td>twi</td>
<td>Twi-Sprache</td>
</tr><tr valign="top">
<td scope="row">tyv</td>
<td> </td>
<td>Tuvinian</td>
<td>touva</td>
<td>Tuwinisch</td>
</tr><tr valign="top">
<td scope="row">udm</td>
<td> </td>
<td>Udmurt</td>
<td>oudmourte</td>
<td>Udmurtisch</td>
</tr><tr valign="top">
<td scope="row">uga</td>
<td> </td>
<td>Ugaritic</td>
<td>ougaritique</td>
<td>Ugaritisch</td>
</tr><tr valign="top">
<td scope="row">uig</td>
<td>ug</td>
<td>Uighur; Uyghur</td>
<td>ouïgour</td>
<td>Uigurisch</td>
</tr><tr valign="top">
<td scope="row">ukr</td>
<td>uk</td>
<td>Ukrainian</td>
<td>ukrainien</td>
<td>Ukrainisch</td>
</tr><tr valign="top">
<td scope="row">umb</td>
<td> </td>
<td>Umbundu</td>
<td>umbundu</td>
<td>Mbundu-Sprache</td>
</tr><tr valign="top">
<td scope="row">und</td>
<td> </td>
<td>Undetermined</td>
<td>indéterminée</td>
<td>Nicht zu entscheiden</td>
</tr><tr valign="top">
<td scope="row">urd</td>
<td>ur</td>
<td>Urdu</td>
<td>ourdou</td>
<td>Urdu</td>
</tr><tr valign="top">
<td scope="row">uzb</td>
<td>uz</td>
<td>Uzbek</td>
<td>ouszbek</td>
<td>Usbekisch</td>
</tr><tr valign="top">
<td scope="row">vai</td>
<td> </td>
<td>Vai</td>
<td>vaï</td>
<td>Vai-Sprache</td>
</tr><tr valign="top">
<td scope="row">ven</td>
<td>ve</td>
<td>Venda</td>
<td>venda</td>
<td>Venda-Sprache</td>
</tr><tr valign="top">
<td scope="row">vie</td>
<td>vi</td>
<td>Vietnamese</td>
<td>vietnamien</td>
<td>Vietnamesisch</td>
</tr><tr valign="top">
<td scope="row">vol</td>
<td>vo</td>
<td>Volapük</td>
<td>volapük</td>
<td>Volapük</td>
</tr><tr valign="top">
<td scope="row">vot</td>
<td> </td>
<td>Votic</td>
<td>vote</td>
<td>Wotisch</td>
</tr><tr valign="top">
<td scope="row">wak</td>
<td> </td>
<td>Wakashan languages</td>
<td>wakashanes, langues</td>
<td>Wakash-Sprachen</td>
</tr><tr valign="top">
<td scope="row">wal</td>
<td> </td>
<td>Wolaitta; Wolaytta</td>
<td>wolaitta; wolaytta</td>
<td>Walamo-Sprache</td>
</tr><tr valign="top">
<td scope="row">war</td>
<td> </td>
<td>Waray</td>
<td>waray</td>
<td>Waray</td>
</tr><tr valign="top">
<td scope="row">was</td>
<td> </td>
<td>Washo</td>
<td>washo</td>
<td>Washo-Sprache</td>
</tr><tr valign="top">
<td scope="row">wel (B)<br>cym (T)</td>
<td>cy</td>
<td>Welsh</td>
<td>gallois</td>
<td>Kymrisch</td>
</tr><tr valign="top">
<td scope="row">wen</td>
<td> </td>
<td>Sorbian languages</td>
<td>sorabes, langues</td>
<td>Sorbisch (Andere)</td>
</tr><tr valign="top">
<td scope="row">wln</td>
<td>wa</td>
<td>Walloon</td>
<td>wallon</td>
<td>Wallonisch</td>
</tr><tr valign="top">
<td scope="row">wol</td>
<td>wo</td>
<td>Wolof</td>
<td>wolof</td>
<td>Wolof-Sprache</td>
</tr><tr valign="top">
<td scope="row">xal</td>
<td> </td>
<td>Kalmyk; Oirat</td>
<td>kalmouk; oïrat</td>
<td>Kalmückisch</td>
</tr><tr valign="top">
<td scope="row">xho</td>
<td>xh</td>
<td>Xhosa</td>
<td>xhosa</td>
<td>Xhosa-Sprache</td>
</tr><tr valign="top">
<td scope="row">yao</td>
<td> </td>
<td>Yao</td>
<td>yao</td>
<td>Yao-Sprache (Bantusprache)</td>
</tr><tr valign="top">
<td scope="row">yap</td>
<td> </td>
<td>Yapese</td>
<td>yapois</td>
<td>Yapesisch</td>
</tr><tr valign="top">
<td scope="row">yid</td>
<td>yi</td>
<td>Yiddish</td>
<td>yiddish</td>
<td>Jiddisch</td>
</tr><tr valign="top">
<td scope="row">yor</td>
<td>yo</td>
<td>Yoruba</td>
<td>yoruba</td>
<td>Yoruba-Sprache</td>
</tr><tr valign="top">
<td scope="row">ypk</td>
<td> </td>
<td>Yupik languages</td>
<td>yupik, langues</td>
<td>Ypik-Sprachen</td>
</tr><tr valign="top">
<td scope="row">zap</td>
<td> </td>
<td>Zapotec</td>
<td>zapotèque</td>
<td>Zapotekisch</td>
</tr><tr valign="top">
<td scope="row">zbl</td>
<td> </td>
<td>Blissymbols; Blissymbolics; Bliss</td>
<td>symboles Bliss; Bliss</td>
<td>Bliss-Symbol</td>
</tr><tr valign="top">
<td scope="row">zen</td>
<td> </td>
<td>Zenaga</td>
<td>zenaga</td>
<td>Zenaga</td>
</tr><tr valign="top">
<td scope="row">zgh</td>
<td> </td>
<td>Standard Moroccan Tamazight</td>
<td>amazighe standard marocain</td>
<td></td>
</tr><tr valign="top">
<td scope="row">zha</td>
<td>za</td>
<td>Zhuang; Chuang</td>
<td>zhuang; chuang</td>
<td>Zhuang</td>
</tr><tr valign="top">
<td scope="row">chi (B)<br>zho (T)</td>
<td>zh</td>
<td>Chinese</td>
<td>chinois</td>
<td>Chinesisch</td>
</tr><tr valign="top">
<td scope="row">znd</td>
<td> </td>
<td>Zande languages</td>
<td>zandé, langues</td>
<td>Zande-Sprachen</td>
</tr><tr valign="top">
<td scope="row">zul</td>
<td>zu</td>
<td>Zulu</td>
<td>zoulou</td>
<td>Zulu-Sprache</td>
</tr><tr valign="top">
<td scope="row">zun</td>
<td> </td>
<td>Zuni</td>
<td>zuni</td>
<td>Zuñi-Sprache</td>
</tr><tr valign="top">
<td scope="row">zxx</td>
<td> </td>
<td>No linguistic content; Not applicable</td>
<td>pas de contenu linguistique; non applicable</td>
<td>Kein linguistischer Inhalt</td>
</tr><tr valign="top">
<td scope="row">zza</td>
<td> </td>
<td>Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki</td>
<td>zaza; dimili; dimli; kirdki; kirmanjki; zazaki</td>
<td>Zazaki</td>
</tr></tbody></table>
<div id=dstyle></div>
</body>
</html>