<!DOCTYPE html>
<html>
<head>
<title>Histogram and Pie Chart Twinning - based on Powerball Winning Numbers Since 2010 - State of New York USA - Thanks to https://catalog.data.gov/dataset?q=&sort=views_recent+desc and https://data.ny.gov/api/views/d6yy-54nr/rows.xml and https://www.w3schools.com/xml/xpath_examples.asp</title>
<script type=text/javascript>
// //data.bts.gov/views/kfcv-nyy3/rows.xml##Airports in USA#~
// //data.cityofnewyork.us/api/views/25th-nujf/rows.xml##Female Baby Names in New York City USA#~
// //data.cdc.gov/api/views/ss2j-8ajj/rows.xml#/response/row/row/state/le#Life Expectancy by USA State#~
// https://www.rjmprogramming.com.au/PHP/CalendarChart/calendar_chart.php?title=Red%20Sox%20Attendance&desc=Red%20Sox%20Attendance&data=[newDate(2023,11,03),34],[newDate(2023,11,18),56]
// https://www.rjmprogramming.com.au/PHP/TimelineChart/timeline_chart.php?title=US%20President&desc=US%20President&data=[~one~,newDate(2023,11,10),newDate(2023,11,12)],[~two~,newDate(2023,11,24),newDate(2023,11,26)]
// https://www.rjmprogramming.com.au/PHP/AnnotatedTimelineChart/index.php?title=Sold%20Pencils%20and%20Sold%20Pens&desc1=Sold%20Pencils&title1=Sold%20Pencils%20title1&text1=Sold%20Pencils%20text1&desc2=Sold%20Pens&title2=Sold%20Pens%20title2&text2=Sold%20Pens%20text2&data=[newDate(2023,11,10),5,~adbh~,~teh~,7,~trh~,~trh~],[newDate(2023,11,20),3,~teh~,~teh~,8,~tqh~,~trh~]
// https://www.rjmprogramming.com.au/PHP/BubbleChart/bubble_chart.php?title=Correlation%20between%20life%20expectancy,%20fertility%20rate%20and%20population%20of%20some%20world%20countries%20(2010)&label=%27ID%27&value=Life%20Expectancy,Fertility%20Rate,%27Region%27,Population&data=,%20[~id1~,10,10,%2710%27,10]%20,%20[~id2~,20,20,%2720%27,20]
// https://api.worldbank.org/v2/en/indicator/SP.DYN.LE00.IN?downloadformat=xml
var xtitleis=location.search.split('xtitle=')[1] ? decodeURIComponent(location.search.split('xtitle=')[1].split('&')[0]).replace(/\+/g,' ') : "Powerball Winning Numbers Since 2010 - State of New York USA";
var xurlis=location.search.split('xurl=')[1] ? decodeURIComponent(location.search.split('xurl=')[1].split('&')[0]).replace(/\+/g,' ') : "//data.ny.gov/api/views/d6yy-54nr/rows.xml";
var xbasisis=location.search.split('xbasis=')[1] ? decodeURIComponent(location.search.split('xbasis=')[1].split('&')[0]).replace(/\+/g,' ') : "count";
var xpathis=location.search.split('xpath=')[1] ? decodeURIComponent(location.search.split('xpath=')[1].split('&')[0]).replace(/\+/g,' ') : "/response/row/row/winning_numbers";
var xaskis=location.search.split('xask=')[1] ? decodeURIComponent(location.search.split('xask=')[1].split('&')[0]).replace(/\+/g,' ') : "";
var xdelimis=location.search.split('xdelim=')[1] ? decodeURIComponent(location.search.split('xdelim=')[1].split('&')[0]).replace(/\+/g,' ') : " ";
var xposis=location.search.split('xcountbasisposition=')[1] ? decodeURIComponent(location.search.split('xcountbasisposition=')[1].split('&')[0]).replace(/\+/g,' ') : "";
var xsmsis=location.search.split('sms=')[1] ? decodeURIComponent(location.search.split('sms=')[1].split('&')[0]).replace(/\+/g,' ').replace(/^SMS$/g, '') : "";
var xemailis=location.search.split('email=')[1] ? decodeURIComponent(location.search.split('email=')[1].split('&')[0]).replace(/\+/g,' ').replace(/^Email$/g, ' ') : (document.URL.indexOf('email=') != -1 ? " " : "");
var xlabelis=location.search.split('xlabel=')[1] ? decodeURIComponent(location.search.split('xlabel=')[1].split('&')[0]).replace(/\+/g,' ').replace(/\+/g,' ') : "";
var loptsis=location.search.split('lopts=')[1] ? decodeURIComponent(location.search.split('lopts=')[1].split('&')[0]).replace(/\+/g,' ') : "";
var roptsis=location.search.split('ropts=')[1] ? decodeURIComponent(location.search.split('ropts=')[1].split('&')[0]).replace(/\+/g,' ') : "";
var lextras=loptsis;
var rextras=roptsis;
var xxdelimis=String.fromCharCode(9);
var before='[~', after='~';
var arrflds=[], dtarrflds=[];
var interestingcount=0, myxhr=null;
var fieldsel='';
var huhhuh='geocoded_column';
var froms='youllneverfindthis';
var tos='youllneverfindthis';
var cbextra='';
var laconto=null, lchart=null, lrect=null;
var raconto=null, rchart=null, rrect=null;
var fldsv=[];
if (xbasisis != 'count') {
xposis='';
froms=xbasisis;
tos=xbasisis + ' selected';
}
if (xaskis != '') {
cbextra=' name=xask checked';
}
var formurl=document.URL.split('?')[0].split('#')[0];
var prefix=(formurl == document.URL ? '' : '<details><summary></summary>');
var suffix=(formurl == document.URL ? '' : '</details>');
var typepos=(xposis.replace('0','') == '' ? 'text' : 'number');
var dataprefix=(xposis.replace('0','') == '' ? '' : 'data-');
var formhtml="<hr><div style='width:100%;background-color:cyan;margin:5 5 5 5;border-radius:10px;'>" + prefix + "<h1> <sup style=cursor:pointer; title='Optional display Google Chart options for left hand chart' onclick=lextra_opts();>←</sup>Google Chart<sub style=cursor:pointer; title='Optional display Google Chart options for right hand chart' onclick=rextra_opts();>→</sub> Histogram & Pie Chart XML Data Twinning <select id=selsug onchange=populate(this);><option value=''>Ideas ...</option><option value=\"//data.cityofnewyork.us/api/views/c3uy-2p5r/rows.xml#/response/row/row[name='Nitrogen dioxide (NO2)' and geo_place_name='Bedford Stuyvesant - Crown Heights']/*[self::start_date or self::data_value]#Air Quality - Nitrogen dioxide (NO2) - Bedford Stuyvesant - Crown Heights - City of New York USA#~\">Air Quality - Nitrogen dioxide (NO2) - Bedford Stuyvesant - Crown Heights - City of New York USA</option><option value=\"//data.wa.gov/api/views/f6w7-q2d2/rows.xml#/response/row/row/make#Electric Vehicle Population Data - State of Washington USA - Make#~\">Electric Vehicle Population Data - State of Washington USA - Make</option><option value=\"//data.wa.gov/api/views/f6w7-q2d2/rows.xml#/response/row/row/model#Electric Vehicle Population Data - State of Washington USA - Model#~\">Electric Vehicle Population Data - State of Washington USA - Model</option><option value=\"//data.wa.gov/api/views/f6w7-q2d2/rows.xml#/response/row/row/*[self::make or self::model]#Electric Vehicle Population Data - State of Washington USA - Make and Model#~#Make/Model\">Electric Vehicle Population Data - State of Washington USA - Make and Model</option><option value=\"//data.wa.gov/api/views/f6w7-q2d2/rows.xml#/response/row/row/*[self::geocoded_column]#Electric Vehicle Population Data - State of Washington USA - Locations#~\">Electric Vehicle Population Data - State of Washington USA - Locations</option><option value=\"//data.ny.gov/api/views/d6yy-54nr/rows.xml#/response/row/row/winning_numbers#Powerball Winning Numbers Since 2010 - State of New York USA#+\">Powerball Winning Numbers Since 2010 - State of New York USA</option><option value=\"//data.ny.gov/api/views/d6yy-54nr/rows.xml#/response/row/row/child::*#Powerball Winning Numbers Since 2010 - State of New York USA#+###true\">Powerball Winning Numbers Since 2010 - State of New York USA - Prompted</option><option value=\"//www.rjmprogramming.com.au/HTMLCSS/API_SP.DYN.LE00.IN_DS2_en_xml_v2_6297866.xml#//*[@name='Value' or @name='Country or Area' or @name='Year']#World Development Bank - Life Expectancy at Birth#~\">World Development Bank - Life Expectancy at Birth</option><option value=\"//www.rjmprogramming.com.au/HTMLCSS/API_SP.DYN.LE00.IN_DS2_en_xml_v2_6297866.xml#//field[text() = 'Aruba']/../*[@name='Value' or @name='Country or Area' or @name='Year']#World Development Bank - Life Expectancy at Birth - Aruba#~\">World Development Bank - Life Expectancy at Birth - Aruba</option><option value=\"//www.rjmprogramming.com.au/HTMLCSS/API_SP.DYN.LE00.IN_DS2_en_xml_v2_6297866.xml#//field[text() = '2000']/../*[@name='Value' or @name='Country or Area' or @name='Year']#World Development Bank - Life Expectancy at Birth - 2000#~\">World Development Bank - Life Expectancy at Birth - 2000</option></select></h1><h3> RJM Programming - December, 2023</h3><h4> Thanks to https://catalog.data.gov/dataset?q=&sort=views_recent+desc and https://data.ny.gov/api/views/d6yy-54nr/rows.xml and https://www.w3schools.com/xml/xpath_examples.asp</h4><br><br><form id=myfis method=GET action='" + formurl + "'><div id=dfis></div><br> <input onblur=titletweak(this); type=text name=xtitle id=xtitle title='Histogram and Pie Chart title' placeholder='Histogram and Pie Chart title' value='" + xtitleis + "' style=width:50%;background-color:#f0f0f0;></input><input id=lopts type=hidden name=lopts value=\"" + loptsis + "\"></input><input id=ropts type=hidden name=ropts value=\"" + roptsis + "\"></input> title for<br> <input type=text name=xurl id=xurl title='Public data XML URL' placeholder='Public data XML URL' value='" + xurlis + "' style=width:50%;background-color:#f0f0f0;></input> XML public data items URL<br> <select onchange=titletweak(this); id=xbasis name=xbasis title='Measure basis' style=background-color:#f0f0f0;>" + ("<option value=count>Count</option><option value=mean>Mean (for numeric)</option><option value=median>Median (for numeric)</option><option value=mode>Mode (for numeric)</option><option value=range>Range (for numeric)</option><option value=sum>Sum (for numeric)</option><option value=deviation>Standard Deviation (for numeric)</option>").replace(froms,tos) + "</select> of position <input onchange=titletweak(this); onblur=titletweak(this); type=" + typepos + " " + dataprefix + "onclick=\"if (this.value.length == 0) { this.value='0'; } this.type='number';\" placeholder='Not applicable (ie all) [0]' id=xcountbasisposition name=xcountbasisposition value='" + xposis + "' min=0 step=1 style=width:10%;background-color:#f0f0f0;></input><br> <input type=text name=xpath id=xpath title='XML XPath' placeholder='XML XPath' value=\"" + xpathis + "\" style=width:40%;background-color:#f0f0f0;></input> XML XPath <span id=sask><input onchange=promptabout(this); type=checkbox id=xask" + cbextra + ">Prompted About</input></span><span id=spanflds>" + fieldsel + "</span><br> <input type=text name=xdelim id=xdelim title='XML Data Member delimiter' placeholder='XML Data Member delimiter' value='" + xdelimis + "' style=width:40px;background-color:#f0f0f0;></input> delimits data items regarding position<br><br> <input type=submit value=Display style=background-color:yellow;border-radius:100px;></input> <input type=submit name=email id=email value=Email style=background-color:yellow;border-radius:100px;></input> <input onclick=\"var smsis=doprompt(this); if (smsis != null) { if (smsis.trim() != '') { this.value=smsis; } }\" name=sms id=sms type=submit value=SMS style=background-color:yellow;border-radius:100px;></input><br><br></form>" + suffix + "</div><iframe id=iffld style=display:none; onload=checkif(this); src='" + xurlis.replace('/' + xurlis.split('/')[eval(-1 + xurlis.split('/').length)].replace('API_SP.DYN.LE00.IN_DS2_en_xml_v2_6297866.xml','youllneverfindthis'), '/') + "'></iframe>";
var proposedtitle=xtitleis;
var isn=false;
var ttw=true;
var saskih='<input onchange=promptabout(this); type=checkbox id=xask>Prompted About</input>';
var showbl=false;
var showmg=false;
var outdelim='';
</script>
</head>
<body>
<p id="demo"></p>
<script>
var datasofar='', nums=[], ij=0, jk=0, aso=null, aeo=null;
if (xsmsis.trim() != '' && xsmsis.replace(/\,/g,'').trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
aso = document.createElement("a");
document.body.appendChild(aso);
aso.style = "display: none";
aso.href = 'sms:' + xsmsis + '&body=' + encodeURIComponent(document.URL.replace('&email=', '&emNOWAYail=').replace('&sms=', '&smNOWAYs='));
aso.click();
setTimeout(() => {
document.body.removeChild(aso);
}, 100);
}
if (xemailis != '') {
aeo = document.createElement("a");
document.body.appendChild(aeo);
aeo.style = "display: none";
aeo.href = 'mailto:' + xemailis.trim() + '?subject=Google%20Chart%20Histogram%20and%20Pie%20Chart%20XML%20Data%20Display%20...&body=' + encodeURIComponent(document.URL.replace('&email=', '&emNOWAYail=').replace('&sms=', '&smNOWAYs='));
aeo.click();
setTimeout(() => {
document.body.removeChild(aeo);
}, 100);
}
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
showResult(xhttp.responseXML);
}
};
xhttp.open("GET", xurlis, true);
if (xpathis.indexOf('child::') != -1) {
setTimeout(function(){ xhttp.send(); }, 5000);
} else {
xhttp.send();
}
function showResult(xml) {
var txt = "", jj=0, iioff=0, theblock='block';
var meanval=0.0;
var npush=[];
var spush=[];
var mdev=0.0;
var slast=0;
var dobreak=false;
var prevresult=null;
var ele=null;
var fldcnt=0, isfinal=true, allfldcnt=-1, prefix='', askp=true, fldlens=[-1], inorout=[], firstset=[], newprefix='', ixatatime=0, jix, two=2;
var big=0, bigwhat=1, wasm=0, ovcnt=0;
path = xpathis.replace(/\?$/g, '');
if (path.indexOf(' or self:') != -1) {
ixatatime=eval('' + path.split(' or self:').length);
} else if (1 == 1 && path.indexOf(' or @') != -1) {
ixatatime=eval('' + path.split(' or @').length);
} else if (path.indexOf('/*[self::') != -1) {
ixatatime=1;
two=1;
}
if (path != xpathis || xaskis.trim() != '') {
isfinal=false;
} else {
allfldcnt=0;
}
if (xml.evaluate) {
var nodes = xml.evaluate(path, xml, null, XPathResult.ANY_TYPE, null);
var result = nodes.iterateNext();
while (result) {
try {
if (('' + result.childNodes[0].nodeValue) == 'undefined') { break; }
} catch(ecbghf) {
console.log('0:');
console.log(result);
break;
}
ovcnt++;
for (jix=two; jix<=ixatatime; jix++) {
if (jix == two) {
prefix=yourencodeURIComponent(result.childNodes[0].nodeValue);
//if (ixatatime == 1) { alert(result.childNodes[0].nodeValue); }
if (result.childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') != -1) {
showmg=true;
before='';
after='';
}
if (ixatatime > 1) {
if (jix <= ixatatime) {
result = nodes.iterateNext();
try {
if (('' + result.childNodes[0].nodeValue) == 'undefined') { break; }
} catch(ecbghf) {
console.log('1:');
console.log(result);
break;
}
prefix+=(' ' + yourencodeURIComponent(result.childNodes[0].nodeValue));
}
if (jix < ixatatime) {
result = nodes.iterateNext();
try {
if (('' + result.childNodes[0].nodeValue) == 'undefined' && 7 == 7) { break; }
} catch(ecbgfhf) {
console.log('2:');
console.log(result);
if (7 == 4) { break; }
}
}
}
} else {
try {
prefix+=(' ' + yourencodeURIComponent(result.childNodes[0].nodeValue));
} catch(ecbgefhff) {
console.log('222:');
console.log(result);
if (7 == 4) { break; }
}
if (jix < ixatatime) {
try {
result = nodes.iterateNext();
} catch(ecbgefhf) {
console.log('22:');
console.log(result);
if (7 == 5) { break; }
}
try {
if (('' + result.childNodes[0].nodeValue) == 'undefined') { break; }
} catch(ecbgffhf) {
console.log('3:');
console.log(result);
break;
}
}
}
}
//if (ixatatime > 1) {
// alert('ovcnt=' + ovcnt + ' ' + prefix);
//}
dobreak=false;
try {
//console.log(result.childNodes[0]);
if (fldlens.length > 0 && ('' + yourencodeURIComponent(result.childNodes[0].nodeValue)).length == fldlens[0]) {
isfinal=true;
allfldcnt=fldcnt;
//alert('firstset[1]=' + firstset[1] + ' and firstset[0]=' + firstset[0] + ' and firstset[2]=' + firstset[2] + ' ... ' + firstset.length);
//alert('prefix=' + prefix + ' and newprefix=' + newprefix);
//alert('ovcnt=' + ovcnt + ' and allfldcnt=' + allfldcnt);
}
} catch(enjhgjh) {
console.log('6:');
console.log(result);
if (7 == 5) { break; }
}
if (allfldcnt < 0 && !isfinal) {
if (fldlens[0] == -1) {
fldlens[0]=yourencodeURIComponent(result.childNodes[0].nodeValue).length;
} else {
fldlens.push(yourencodeURIComponent(result.childNodes[0].nodeValue).length);
}
if (eval('' + arrflds.length) > eval('' + firstset.length)) {
askp=prompt('Is this type of field "' + arrflds[eval('' + firstset.length)] + '" ' + ('[' + dtarrflds[eval('' + firstset.length)] + ']').replace(/^\[\]$/g, '') + ' data to be output ... ' + result.childNodes[0].nodeValue, result.childNodes[0].nodeValue);
} else {
askp=prompt('Is this type of field data to be output ... ' + result.childNodes[0].nodeValue, result.childNodes[0].nodeValue);
}
if (askp == null) {
askp='';
inorout.push(false);
firstset.push('');
} else if (askp == result.childNodes[0].nodeValue) {
interestingcount++;
inorout.push(true);
if (result.childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') != -1) {
showmg=true;
before='';
after='';
}
if (prefix == '') {
prefix+=(yourencodeURIComponent(result.childNodes[0].nodeValue));
} else {
//alert('why?');
if (result.childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') != -1 && prefix.replace(' ','').indexOf('POINT(') != -1) {
prefix+=(xdelimis + yourencodeURIComponent(result.childNodes[0].nodeValue));
} else {
prefix+=(xxdelimis + yourencodeURIComponent(result.childNodes[0].nodeValue));
}
}
firstset.push(yourencodeURIComponent(result.childNodes[0].nodeValue));
}
fldcnt++;
prevresult=result;
result = nodes.iterateNext();
try {
if (('' + result.childNodes[0].nodeValue) == 'undefined') { break; }
} catch(enjhgjh) {
console.log('7:');
console.log(result);
break;
}
dobreak=true;
}
if (isfinal && allfldcnt > 0) { //} && prefix == '') {
//alert('ovcnt=' + ovcnt + ' and ovcnt thingo=' + eval(eval(-1 + ovcnt) % allfldcnt) + ' and allfldcnt=' + allfldcnt + ' and ' + firstset[eval(eval(-1 + ovcnt) % allfldcnt)]);
if (1 == 11) {
if (firstset[eval(eval(-1 + ovcnt) % allfldcnt)] != '') {
if (firstset[eval(eval(-1 + ovcnt) % allfldcnt)].length != yourencodeURIComponent(result.childNodes[0].nodeValue).length) {
for (jj=1; jj<=fldlens.length; jj++) {
if (yourencodeURIComponent(result.childNodes[0].nodeValue).length == fldlens[eval(-1 + jj)]) {
ovcnt=eval(0 + jj);
//alert('ovcnt becomes ' + jj + ' where result.childNodes[0].nodeValue=' + result.childNodes[0].nodeValue + ' ' + fldlens[eval(-1 + jj)]);
}
}
}
} else {
for (jj=1; jj<=fldlens.length; jj++) {
if (yourencodeURIComponent(result.childNodes[0].nodeValue).length == fldlens[eval(-1 + jj)]) {
ovcnt=eval(0 + jj);
//alert('ovcnt becomes ' + jj + ' where result.childNodes[0].nodeValue=' + result.childNodes[0].nodeValue + ' ' + fldlens[eval(-1 + jj)]);
}
}
}
}
if (firstset[eval(eval(-1 + ovcnt) % allfldcnt)] != '' || (showmg && interestingcount == 1 && result.childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') == 0)) {
if (newprefix == '') {
//if (prevresult.childNodes[0].nodeValue.length == firstset[eval(eval(-1 + ovcnt) % allfldcnt)].length) {
//newprefix+=(prevresult.childNodes[0].nodeValue);
//} else {
newprefix+=(yourencodeURIComponent(result.childNodes[0].nodeValue));
//}
} else {
//if (prevresult.childNodes[0].nodeValue.length == firstset[eval(eval(-1 + ovcnt) % allfldcnt)].length) {
//newprefix+=(xxdelimis + prevresult.childNodes[0].nodeValue);
//} else {
if (result.childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') != -1 && newprefix.replace(' ','').indexOf('POINT(') != -1) {
newprefix+=(xdelimis + yourencodeURIComponent(result.childNodes[0].nodeValue));
} else {
newprefix+=(xxdelimis + yourencodeURIComponent(result.childNodes[0].nodeValue));
}
//}
}
//alert('ovcnt=' + ovcnt + ' and newprefix=' + newprefix);
}
if (eval(eval(0 + ovcnt) % allfldcnt) == 0) {
//alert(result.childNodes[0].nodeValue);
if (newprefix == '') {
prevresult=result;
result = nodes.iterateNext();
if (('' + result.childNodes[0].nodeValue) == 'undefined') { break; }
dobreak=true;
} else {
dobreak=false;
}
} else {
prevresult=result;
result = nodes.iterateNext();
if (('' + result.childNodes[0].nodeValue) == 'undefined') { break; }
dobreak=true;
}
}
if (!dobreak) {
if (prefix != '') {
txt += prefix + "<br>";
//alert('prefix=' + prefix);
nums=('' + prefix).split(xdelimis);
prefix='';
} else if (newprefix != '') {
txt += newprefix + "<br>";
//if (newprefix.length != firstset[0].length) {
//alert(newprefix + ' vs ' + firstset[0]);
//}
//alert('newprefix = ' + newprefix);
nums=('' + newprefix).split(xdelimis);
newprefix='';
} else if (prefix != '') {
txt += prefix + "<br>";
//alert('prefix = ' + prefix);
nums=('' + prefix).split(xdelimis);
prefix='';
} else {
txt += result.childNodes[0].nodeValue + "<br>";
//alert('result.childNodes[0].nodeValue = ' + result.childNodes[0].nodeValue);
nums=('' + yourencodeURIComponent(result.childNodes[0].nodeValue)).split(xdelimis);
}
//console.log(result.childNodes[0].nodeValue);
isn=false;
if (nums[0].trim() != '') {
if (nums[0].trim().replace(/\-/g,'').replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
isn=true;
} else if (xbasisis != 'count') {
document.getElementById('xbasis').value='count';
isn=false;
document.getElementById('xcountbasisposition').value='0';
xposis='0';
}
}
if (xposis.replace('0','').trim() != '') {
if (eval('' + nums.length) >= eval(xposis.replace('0','').trim())) {
nums=['' + nums[eval(-1 + eval(xposis.replace('0','').trim()))]];
} else if (xposis.replace('0','').trim() != '') {
nums=[];
}
} else if (xbasisis != 'count') {
meanval=0.0;
mdev=0.0;
big=0;
bigwhat=1;
slast=0;
spush=[];
npush=[];
wasm=0;
for (ii=0; ii<nums.length; ii++) {
npush.push(('' + nums[ii]));
meanval+=eval('' + nums[ii]);
}
wasm=meanval;
meanval/=eval('' + nums.length);
npush.sort((a,b) => a-b);
spush.push(1);
for (ii=0; ii<nums.length; ii++) {
mdev+=eval(eval(nums[ii] - meanval) * eval(nums[ii] - meanval));
if (ii > 0) {
if (npush[ii] == npush[eval(-1 + ii)]) {
spush[slast]++;
if (spush[slast] > bigwhat) {
big=slast;
bigwhat=spush[slast];
}
spush.push(0);
} else {
spush.push(1);
slast=eval(-1 + ii);
}
}
}
mdev/=eval('' + nums.length);
if (xbasisis == 'mean') {
nums=['' + meanval.toPrecision(4)];
} else if (xbasisis == 'sum') {
nums=['' + wasm];
} else if (xbasisis == 'median') {
if (eval(eval('' + nums.length) % 2) == 1) {
nums=[('' + npush[eval(-1 + eval('' + npush.length) / 2)])];
} else if (Math.abs(npush[eval(0 + eval('' + nums.length) / 2)] - meanval) < Math.abs(npush[eval(-1 + eval('' + nums.length) / 2)] - meanval)) {
nums=[('' + npush[eval(0 + eval('' + npush.length) / 2)])];
} else {
nums=[('' + npush[eval(-1 + eval('' + npush.length) / 2)])];
}
} else if (xbasisis == 'range') {
nums=[Math.abs(eval(('' + npush[0]) - ('' + npush[eval(-1 + npush.length)])))];
} else if (xbasisis == 'deviation') {
nums=['' + Math.pow(mdev, 0.5).toPrecision(4)];
} else if (xbasisis == 'mode') {
if (bigwhat == 1) {
if (eval(eval('' + nums.length) % 2) == 1) {
nums=[('' + npush[eval(-1 + eval('' + npush.length) / 2)])];
} else if (Math.abs(npush[eval(0 + eval('' + npush.length) / 2)] - meanval) < Math.abs(npush[eval(-1 + eval('' + npush.length) / 2)] - meanval)) {
nums=[('' + npush[eval(0 + eval('' + npush.length) / 2)])];
} else {
nums=[('' + npush[eval(-1 + eval('' + npush.length) / 2)])];
}
} else {
nums=['' + npush[big]];
}
}
}
for (ii=0; ii<nums.length; ii++) {
if (ourencodeURIComponent(nums[ii]) != '') {
if (datasofar.indexOf(',' + before + ourencodeURIComponent(nums[ii]) + after + ',') == -1) {
datasofar+=',' + before + ourencodeURIComponent(nums[ii]) + after + ',1]';
} else {
jk=eval(datasofar.split(',' + before + ourencodeURIComponent(nums[ii]) + after + ',')[1].split(']')[0]);
datasofar=datasofar.replace(',' + before + ourencodeURIComponent(nums[ii]) + after + ',' + jk + ']', ',' + before + ourencodeURIComponent(nums[ii]) + after + ',' + eval(1 + jk) + ']');
}
}
//alert(datasofar);
}
prevresult=result;
result = nodes.iterateNext();
try {
if (('' + result.childNodes[0].nodeValue) == 'undefined') { break; }
} catch(excsd) {
break;
}
}
}
// Code For Internet Explorer
} else if (window.ActiveXObject || xhttp.responseType == "msxml-document") {
xml.setProperty("SelectionLanguage", "XPath");
nodes = xml.selectNodes(path);
for (i = 0; i < nodes.length; i++) {
ovcnt++;
iioff=0;
for (jix=two; jix<=ixatatime; jix++) {
if (jix == two) {
prefix=yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue);
if (nodes[eval(i + iioff)].childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') != -1) {
showmg=true;
before='';
after='';
}
if (ixatatime > 1) {
if (jix <= ixatatime) {
iioff++; //result = nodes.iterateNext();
prefix+=(' ' + yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
}
if (jix < ixatatime) {
iioff++; //result = nodes.iterateNext();
}
}
} else {
prefix+=(' ' + yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
if (jix < ixatatime) {
iioff++; //result = nodes.iterateNext();
}
}
}
dobreak=false;
if (fldlens.length > 0 && yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue).length == fldlens[0]) {
isfinal=true;
allfldcnt=fldcnt;
}
if (allfldcnt < 0 && !isfinal) {
if (fldlens[0] == -1) {
fldlens[0]=yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue).length;
} else {
fldlens.push(yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue).length);
}
if (eval('' + arrflds.length) > eval('' + firstset.length)) {
askp=prompt('Is this type of field "' + arrflds[eval('' + firstset.length)] + '" ' + ('[' + dtarrflds[eval('' + firstset.length)] + ']').replace(/^\[\]$/g, '') + ' data to be output ... ' + nodes[eval(i + iioff)].childNodes[0].nodeValue, nodes[eval(i + iioff)].childNodes[0].nodeValue);
} else {
askp=prompt('Is this type of field data to be output ... ' + nodes[eval(i + iioff)].childNodes[0].nodeValue, nodes[eval(i + iioff)].childNodes[0].nodeValue);
}
if (askp == null) {
askp='';
inorout.push(false);
firstset.push('');
} else if (askp == nodes[eval(i + iioff)].childNodes[0].nodeValue) {
interestingcount++;
inorout.push(true);
if (nodes[eval(i + iioff)].childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') != -1) {
showmg=true;
before='';
after='';
}
if (prefix == '') {
prefix+=(yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
} else {
if (nodes[eval(i + iioff)].childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') != -1 && prefix.replace(' ','').indexOf('POINT(') != -1) {
prefix+=(xdelimis + yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
} else {
prefix+=(xxdelimis + yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
}
}
firstset.push(yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
}
fldcnt++;
//prevresult=result;
iioff++; //result = nodes.iterateNext();
dobreak=true;
}
if (isfinal && allfldcnt > 0) { //} && prefix == '') {
//alert('ovcnt=' + ovcnt + ' and ovcnt thingo=' + eval(eval(-1 + ovcnt) % allfldcnt) + ' and allfldcnt=' + allfldcnt + ' and ' + firstset[eval(eval(-1 + ovcnt) % allfldcnt)]);
if (firstset[eval(eval(-1 + ovcnt) % allfldcnt)] != '' || (showmg && interestingcount == 1 && nodes[eval(i + iioff)].childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') == 0)) {
if (newprefix == '') {
newprefix+=(yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
} else {
if (nodes[eval(i + iioff)].childNodes[0].nodeValue.replace(' ','').indexOf('POINT(') != -1 && newprefix.replace(' ','').indexOf('POINT(') != -1) {
newprefix+=(xdelimis + yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
} else {
newprefix+=(xxdelimis + yourencodeURIComponent(nodes[eval(i + iioff)].childNodes[0].nodeValue));
}
}
//alert('ovcnt=' + ovcnt + ' and newprefix=' + newprefix);
}
if (eval(eval(0 + ovcnt) % allfldcnt) == 0) {
//alert(result.childNodes[0].nodeValue);
if (newprefix == '') {
//prevresult=result;
iioff++; //result = nodes.iterateNext();
dobreak=true;
} else {
dobreak=false;
}
} else {
//prevresult=result;
iioff++; //result = nodes.iterateNext();
dobreak=true;
}
}
if (!dobreak) {
if (prefix != '') {
txt += prefix + "<br>";
nums=('' + prefix).split(xdelimis);
prefix='';
} else if (newprefix != '') {
txt += newprefix + "<br>";
nums=('' + newprefix).split(xdelimis);
newprefix='';
} else if (prefix != '') {
txt += prefix + "<br>";
nums=('' + prefix).split(xdelimis);
prefix='';
} else {
txt += nodes[i].childNodes[0].nodeValue + "<br>";
nums=('' + yourencodeURIComponent(nodes[i].childNodes[0].nodeValue)).split(xdelimis);
}
isn=false;
if (nums[0].trim() != '') {
if (nums[0].trim().replace(/\-/g,'').replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
isn=true;
} else if (xbasisis != 'count') {
document.getElementById('xbasis').value='count';
isn=false;
document.getElementById('xcountbasisposition').value='0';
xposis='0';
}
}
if (xposis.replace('0','').trim() != '') {
if (eval('' + nums.length) >= eval(xposis.replace('0','').trim())) {
nums=['' + nums[eval(-1 + eval(xposis.replace('0','').trim()))]];
} else if (xposis.replace('0','').trim() != '') {
nums=[];
}
} else if (xbasisis != 'count') {
meanval=0.0;
meanval=0.0;
mdev=0.0;
big=0;
bigwhat=1;
slast=0;
spush=[];
npush=[];
wasm=0;
for (ii=0; ii<nums.length; ii++) {
npush.push(('' + nums[ii]));
meanval+=eval('' + nums[ii]);
}
wasm=meanval;
meanval/=eval('' + nums.length);
npush.sort((a,b) => a-b);
spush.push(1);
for (ii=0; ii<nums.length; ii++) {
mdev+=eval(eval(nums[ii] - meanval) * eval(nums[ii] - meanval));
if (ii > 0) {
if (npush[ii] == npush[eval(-1 + ii)]) {
spush[slast]++;
if (spush[slast] > bigwhat) {
big=slast;
bigwhat=spush[slast];
}
spush.push(0);
} else {
spush.push(1);
slast=eval(-1 + ii);
}
}
}
mdev/=eval('' + nums.length);
if (xbasisis == 'mean') {
nums=['' + meanval.toPrecision(4)];
} else if (xbasisis == 'sum') {
nums=['' + wasm];
} else if (xbasisis == 'median') {
if (eval(eval('' + nums.length) % 2) == 1) {
nums=[('' + npush[eval(-1 + eval('' + npush.length)) / 2])];
} else if (Math.abs(npush[eval(0 + eval('' + npush.length) / 2)] - meanval) < Math.abs(npush[eval(-1 + eval('' + npush.length) / 2)] - meanval)) {
nums=[('' + npush[eval(0 + eval('' + npush.length) / 2)])];
} else {
nums=[('' + npush[eval(-1 + eval('' + npush.length) / 2)])];
}
} else if (xbasisis == 'range') {
nums=[Math.abs(eval(('' + npush[0]) - ('' + npush[eval(-1 + npush.length)])))];
} else if (xbasisis == 'deviation') {
nums=['' + Math.pow(mdev, 0.5).toPrecision(4)];
} else if (xbasisis == 'mode') {
if (bigwhat == 1) {
if (eval(eval('' + nums.length) % 2) == 1) {
nums=[('' + npush[eval(-1 + eval('' + npush.length) / 2)])];
} else if (Math.abs(npush[eval(0 + eval('' + npush.length) / 2)] - meanval) < Math.abs(npush[eval(-1 + eval('' + npush.length) / 2)] - meanval)) {
nums=[('' + npush[eval(0 + eval('' + npush.length) / 2)])];
} else {
nums=[('' + npush[eval(-1 + eval('' + npush.length) / 2)])];
}
} else {
nums=['' + npush[big]];
}
}
}
for (ii=0; ii<nums.length; ii++) {
if (ourencodeURIComponent(nums[ii]) != '') {
if (datasofar.indexOf(',' + before + ourencodeURIComponent(nums[ii]) + after + ',') == -1) {
datasofar+=',' + before + ourencodeURIComponent(nums[ii]) + after + ',1]';
} else {
jk=eval(datasofar.split(',' + before + ourencodeURIComponent(nums[ii]) + after + ',')[1].split(']')[0]);
datasofar=datasofar.replace(',' + before + ourencodeURIComponent(nums[ii]) + after + ',' + jk + ']', ',' + before + ourencodeURIComponent(nums[ii]) + after + ',' + eval(1 + jk) + ']');
}
}
}
} // new
i+=iioff;
iioff=0;
}
}
//field[text() = 'Australia']
//field[text() = 'Aruba']/../*[@name='Value' or @name='Country or Area' or @name='Year']
var numtabcols=[], recsare=[], kin=0, okayhere=true, swaponeandzero=false;
//alert(showmg + ' ' + datasofar.split('~')[1]);
if (!showmg && datasofar.indexOf('~') != -1) {
//alert(datasofar.substring(0,80) + ' ' + datasofar.split('~')[1] + ' ' + datasofar.substring(datasofar.split('Congo')[1]));
if (datasofar.split('~')[1].length > 9) {
showbl=true;
numtabcols=datasofar.split('~')[1].split('~')[0].split(String.fromCharCode(32));
if (eval('' + numtabcols.length) >= 2) {
if (eval('' + numtabcols.length) > 2) {
for (kin=2; kin<eval('' + numtabcols.length); kin++) {
if (numtabcols[kin].trim() == '') {
okayhere=false;
} else if (numtabcols[kin].trim().replace(/\./g,'').replace(/\-/g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') != '') {
okayhere=false;
}
}
}
console.log('okayhere=' + okayhere + ' and numtabs.length=' + numtabcols.length);
if (numtabcols[1].trim() != '' && okayhere) {
if (numtabcols[1].indexOf('T') == 10) { swaponeandzero=true; }
console.log('Okayhere=' + okayhere + ' and numtabs.length=' + numtabcols.length + ' +++ ' + datasofar.split('~')[1].split('~')[0] + ' ... ' + numtabcols[1]);
if (swaponeandzero || numtabcols[1].trim().replace(/\./g,'').replace(/\-/g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
console.log('OkayHere=' + okayhere + ' and numtabs.length=' + numtabcols.length);
console.log(datasofar);
// [~2011-12-01T00:00:00 22.88~,2]
var inpts=datasofar.split('[');
var origst='', newst='', arrorig=[], firstl=0;
for (var jinpts=1; jinpts<inpts.length; jinpts++) {
origst='[' + inpts[jinpts].split(']')[0] + ']';
//alert(origst);
arrorig=origst.split(' ');
if (eval('' + arrorig.length) >= 2) {
//newst=arrorig[0] + '~,' + arrorig[1].split('~')[0].replace(/\ /g, ',') + ']';
if (swaponeandzero) {
newst='[~' + arrorig[1] + '~,' + arrorig[0].replace('[~','') + ',' + origst.split(arrorig[1] + ' ')[1].split('~')[0].replace(/\ /g, ',') + ']';
} else {
newst=arrorig[0] + '~,' + origst.replace(arrorig[0] + ' ','').split('~')[0].replace(/\ /g, ',') + ']';
}
if (firstl != 0 && firstl != eval('' + arrorig.length)) {
datasofar=datasofar.replace(origst + ' ,', '').replace(origst + ',', '').replace(origst + '', '');
} else {
datasofar=datasofar.replace(origst, newst);
}
if (jinpts == 1) {
firstl=eval('' + arrorig.length);
//alert(1);
if (eval('' + arrorig.length) > 2 && xurlis.indexOf('rjmprogramming.com.au/HTMLCSS/API_SP.DYN.LE00.IN_DS2_en_xml_v2_6297866.xml') != -1) {
//alert(11);
document.getElementById('xllabel').value='Country';
document.getElementById('xulabel').value='Country';
document.getElementById('xblabel').value='Country';
document.getElementById('xlvalue').value='Year,Life Expectancy at Birth';
document.getElementById('xuvalue').value='Year,Life Expectancy at Birth';
document.getElementById('xbvalue').value='Year,Life Expectancy at Birth';
} else {
//alert(111);
document.getElementById('xlvalue').value='Measure';
document.getElementById('xuvalue').value='Measure';
document.getElementById('xbvalue').value='Measure';
if (eval('' + arrorig.length) > 2) {
//alert(arrorig.length);
for (kin=2; kin<=eval('' + arrorig.length); kin++) {
document.getElementById('xlvalue').value+=',Measure' + kin;
document.getElementById('xuvalue').value+=',Measure' + kin;
document.getElementById('xbvalue').value+=',Measure' + kin;
}
}
}
}
}
}
recsare=datasofar.split(',[');
//alert(datasofar.substring(0,40).replace(/\ /g,'x') + ' ... ' + recsare.length);
recsare.sort();
datasofar='';
for (kin=1; kin<recsare.length; kin++) {
datasofar+=',[' + recsare[kin].trim().replace(/T00\:00\:00/g,'') + ' ';
}
//alert(document.getElementById('xbvalue').value + ' ' + datasofar);
console.log('sort=' + datasofar);
}
}
}
if (datasofar.split('~')[1].split('~')[0].indexOf('T') == 10 && eval('' + recsare.length) == 0) {
recsare=datasofar.split(',[');
//alert(datasofar.substring(0,40).replace(/\ /g,'x') + ' ... ' + recsare.length);
recsare.sort();
datasofar='';
for (kin=1; kin<recsare.length; kin++) {
datasofar+=',[' + recsare[kin].trim().replace(/T00\:00\:00/g,'') + ' ';
}
console.log('sort=' + datasofar);
}
//console.log('thingo' + numtabcols.length + datasofar.split('~')[1].split('~')[0].split(String.fromCharCode(32)).length + '=' + datasofar.split('~')[1].split('~')[0]);
}
}
if (showmg && 3 == 6) {
datasofar=geomixer(datasofar);
//alert(datasofar);
// ,[~POINT (-122.7474291 47.0821119)~,36],[~POINT (-122.0313266 47.6285782) POINT (-122.2012521 47.3931814)~,1],[~POINT (-122.64177 47.737525)~,9],[~POINT (-122.89692 47.043535)~,60],[~POINT (-122.9131017 47.0135926)~,33],[~POINT (-122.388675 47.5415)~,14],[~POINT (-122.611365 47.575195)~,6],[~POINT (-122.179458 47.802589)~,76],
}
if (showmg) {
theblock='none';
} else {
theblock='block';
}
if (xlabelis != '') {
document.getElementById('xblabel').value=xlabelis;
document.getElementById('xllabel').value=xlabelis;
document.getElementById('xulabel').value=xlabelis;
}
//document.getElementById("demo").innerHTML = txt;
document.getElementById('myi').src=document.getElementById('myi').src.replace(encodeURIComponent('Powerball Winning Numbers Since 2010 - State of New York USA'), encodeURIComponent(xtitleis));
document.getElementById('mpi').src=document.getElementById('mpi').src.replace(encodeURIComponent('Powerball Winning Numbers Since 2010 - State of New York USA'), encodeURIComponent(xtitleis));
document.getElementById('xhtitle').value=xtitleis.replace(/\'/g, '');
document.getElementById('xptitle').value=xtitleis.replace(/\'/g, '');
document.getElementById('xbtitle').value=xtitleis.replace(/\'/g, '');
document.getElementById('xutitle').value=xtitleis.replace(/\'/g, '');
document.getElementById('xltitle').value=xtitleis.replace(/\'/g, '');
if (showmg && xurlis.indexOf('//data.wa.gov/api/views/f6w7-q2d2/rows.xml') != -1) {
document.getElementById('xgtitle').value='US;' + xtitleis.split(' - M')[0];
document.getElementById('xmtitle').value=xtitleis.split(' - M')[0].replace(/\'/g, '');
} else {
document.getElementById('xgtitle').value=xtitleis.replace(/\'/g, '');
document.getElementById('xmtitle').value=xtitleis.replace(/\'/g, '');
}
var proposed=document.getElementById('myi').src.split('&data=')[0] + '&data=' + datasofar;
if (eval('' + proposed.length) < 650 && !showbl && !showmg) {
document.getElementById('myi').src=document.getElementById('myi').src.split('&data=')[0] + '&data=' + datasofar;
document.getElementById('mpi').src=document.getElementById('mpi').src.split('&data=')[0] + '&data=' + datasofar.replace(/\]\,\[/g, ']%20,%20[').replace(',[', ',%20[');
} else {
//alert('Here ' + datasofar);
document.getElementById('data').value=datasofar;
//alert(document.getElementById('data').value);
document.getElementById('datap').value=datasofar.replace(/\]\,\[/g, '] , [').replace(',[', ', ['); // ,%20[~45~,23]%20,%20[~
document.getElementById('datal').value=datasofar.replace(/\]\,\[/g, '] , [').replace(',[', ', ['); // ,%20[~45~,23]%20,%20[~
document.getElementById('datab').value=datasofar.replace(/\]\,\[/g, '] , [').replace(',[', ', [').replace(/T00\:00\:00/g,''); // ,%20[~45~,23]%20,%20[~
document.getElementById('datam').value=(datasofar.replace(/\]\,\[/g, '] , [').replace(',[', ' [').split('],')[0] + ']').replace(']]',']');
document.getElementById('datag').value=(datasofar.replace(/\]\,\[/g, '] , [').replace(',[', ' [').split('],')[0] + ']').replace(']]',']');
//alert(document.getElementById('datag').value);
var divs=document.getElementsByTagName('div'), jdivs=0;
if (lextras == '') {
for (jdivs=0; jdivs<divs.length; jdivs++) {
if (divs[jdivs].innerHTML.indexOf('extr' + 'aopts') != -1 && divs[jdivs].innerHTML.indexOf(' class="l"') != -1) {
divs[jdivs].innerHTML=divs[jdivs].innerHTML.replace(' name=', ' data-name=');
document.getElementById(('' + divs[jdivs].id).replace('div','')).value='';
document.getElementById('lopts').value='';
}
}
} else {
for (jdivs=0; jdivs<divs.length; jdivs++) {
if (divs[jdivs].innerHTML.indexOf('extr' + 'aopts') != -1 && divs[jdivs].innerHTML.indexOf(' class="l"') != -1) {
document.getElementById(('' + divs[jdivs].id).replace('div','')).value=lextras;
document.getElementById(('' + divs[jdivs].id).replace('div','')).name='extraopts';
document.getElementById('lopts').value=lextras;
}
}
}
if (rextras == '') {
for (jdivs=0; jdivs<divs.length; jdivs++) {
if (divs[jdivs].innerHTML.indexOf('extr' + 'aopts') != -1 && divs[jdivs].innerHTML.indexOf(' class="r"') != -1) {
divs[jdivs].innerHTML=divs[jdivs].innerHTML.replace(' name=', ' data-name=');
document.getElementById(('' + divs[jdivs].id).replace('div','')).value='';
document.getElementById('ropts').value='';
}
}
} else {
for (jdivs=0; jdivs<divs.length; jdivs++) {
if (divs[jdivs].innerHTML.indexOf('extr' + 'aopts') != -1 && divs[jdivs].innerHTML.indexOf(' class="r"') != -1) {
document.getElementById(('' + divs[jdivs].id).replace('div','')).value=rextras;
document.getElementById(('' + divs[jdivs].id).replace('div','')).name='extraopts';
document.getElementById('ropts').value=rextras;
}
}
}
if (showmg) {
if (1 == 6) { document.getElementById('mybutm').click(); }
document.getElementById('mybutg').click();
} else if (showbl) {
document.getElementById('mybutb').click();
document.getElementById('mybutl').click();
} else {
document.getElementById('mybut').click();
document.getElementById('mybutp').click();
}
}
document.getElementById('myi').style.display='block';
document.getElementById('mpi').style.display=theblock;
if (xposis.replace('0','') != '') {
document.getElementById('xtitle').title=xtitleis;
document.getElementById('xcountbasisposition').type='number';
if (document.getElementById('xtitle').title.indexOf(' ' + xposis + getOrdinal(eval('' + xposis))) != -1) {
document.getElementById('xtitle').title=document.getElementById('xtitle').title.replace(' ' + xposis + getOrdinal(eval('' + xposis)), '');
proposedtitle=document.getElementById('xtitle').title;
xtitleis=proposedtitle;
//alert(document.getElementById('xtitle').title);
}
}
}
function promptabout(sic) {
var bbits=document.getElementById('xpath').value.split('/');
if (sic.checked) {
sic.name='xask';
if (eval('' + bbits.length) > 1) {
if (bbits[eval(-1 + bbits.length)].trim() != '' && bbits[eval(-1 + bbits.length)].indexOf('child::') == -1) {
document.getElementById('xpath').value=document.getElementById('xpath').value.replace('/' + bbits[eval(-1 + bbits.length)], '/child::*');
if (document.getElementById('myfldselopt')) {
document.getElementById('myfldselopt').innerText='Optionally display selected field name(s) value(s) ...';
}
}
}
} else {
document.getElementById('sask').innerHTML=saskih;
}
}
function getOrdinal(n) { // thanks to https://www.sitepoint.com/convert-numbers-to-ordinals-javascript/#:~:text=How%20to%20Get%20the%20Ordinal%20of%20a%20Number&text=The%20function%20getOrdinal%20accepts%20an,change%20the%20ordinal%20if%20necessary.
let ord = 'th';
if (n % 10 == 1 && n % 100 != 11) {
ord = 'st';
} else if (n % 10 == 2 && n % 100 != 12) {
ord = 'nd';
} else if (n % 10 == 3 && n % 100 != 13) {
ord = 'rd';
}
return ord;
}
function doprompt(subo) {
if (subo.id == 'sms') {
return prompt('Please enter SMS number to send to.', '');
}
return '';
}
function antittw() {
ttw=true;
}
function populate(selo) {
if (selo.value.trim() != '') {
var pts=selo.value.split('#');
document.getElementById('sask').innerHTML=saskih;
for (var ipts=0; ipts<pts.length; ipts++) {
switch (ipts) {
case 0:
if (pts[ipts] != '') {
if (document.getElementById('myfldselopt')) {
document.getElementById('myfldselopt').innerText='Optionally display selected field name(s) value(s) ...';
}
document.getElementById('xurl').value=pts[ipts];
if (document.getElementById('iffld')) {
document.getElementById('iffld').src=pts[ipts].replace('/' + pts[ipts].split('/')[eval(-1 + pts[ipts].split('/').length)].replace('API_SP.DYN.LE00.IN_DS2_en_xml_v2_6297866.xml','youllneverfindthis'), '/');
}
if (pts[ipts].indexOf('//data.ny.gov/api/views/d6yy-54nr/rows.xml') == -1) {
document.getElementById('xbasis').value='count';
document.getElementById('xcountbasisposition').value='0';
document.getElementById('xcountbasisposition').type='number';
}
}
break;
case 1:
if (pts[ipts] != '') {
document.getElementById('xpath').value=pts[ipts];
}
break;
case 2:
if (pts[ipts] != '') {
document.getElementById('xtitle').value=pts[ipts];
}
break;
case 3:
if (pts[ipts] != '') {
document.getElementById('xdelim').value=pts[ipts].replace('+',' ');
}
break;
case 4:
if (pts[ipts] != '') {
document.getElementById('xblabel').value=pts[ipts].replace('+',' ');
document.getElementById('xulabel').value=pts[ipts].replace('+',' ');
document.getElementById('xllabel').value=pts[ipts].replace('+',' ');
document.getElementById('dfis').innerHTML='<input type=hidden name=xlabel value="' + pts[ipts].replace('+',' ') + '"></input>';
}
break;
case 5:
if (pts[ipts] != '') {
document.getElementById('xbasis').value=pts[ipts].replace('+',' ');
}
break;
case 6:
if (pts[ipts] != '') {
document.getElementById('xask').checked=true;
document.getElementById('xask').name='xask';
}
break;
default:
break;
}
}
}
}
function titletweak(otxt) {
if (!ttw) { return ''; }
//ttw=false;
//setTimeout(antittw, 3000);
var huh='' + otxt.value;
if (huh != 'count' && otxt.id == 'xbasis') {
if (('' + document.getElementById('xcountbasisposition').value).replace('0','') != '') {
document.getElementById('xcountbasisposition').value='0';
document.getElementById('xcountbasisposition').type='number';
}
if (proposedtitle == document.getElementById('xtitle').title || proposedtitle == xtitleis) {
//alert(proposedtitle);
if (proposedtitle.indexOf('Winning Numbers') != -1) {
//alert(111);
document.getElementById('xtitle').value=proposedtitle.replace('Winning Numbers', 'Winning ' + (huh.substring(0,1).toUpperCase() + huh.substring(1).toLowerCase()).replace(/^Deviation$/g, 'Standard Deviation') + ' Numbers');
} else {
document.getElementById('xtitle').value=proposedtitle + ' ... ' + (huh.substring(0,1).toUpperCase() + huh.substring(1).toLowerCase()).replace(/^Deviation$/g, 'Standard Deviation');
}
}
} else if (huh > '0' && otxt.id == 'xcountbasisposition') {
//alert(1);
if (proposedtitle == document.getElementById('xtitle').title || proposedtitle == xtitleis) {
//alert(proposedtitle);
if (proposedtitle.indexOf('Winning Numbers') != -1) {
//alert(111);
document.getElementById('xtitle').value=proposedtitle.replace('Winning Numbers', 'Winning ' + huh + getOrdinal(eval('' + huh)) + ' Numbers');
} else {
document.getElementById('xtitle').value=proposedtitle + ' ... ' + huh + getOrdinal(eval('' + huh));
}
}
} else if (otxt.id == 'xcountbasisposition') {
if (document.getElementById('xtitle').title.indexOf('Winning Numbers') != -1) {
document.getElementById('xtitle').value=document.getElementById('xtitle').title;
} else {
document.getElementById('xtitle').value=document.getElementById('xtitle').title;
}
} else if (huh != proposedtitle && otxt.id == 'xtitle') {
proposedtitle=huh;
otxt.title=otxt.value;
}
}
function yourencodeURIComponent(inv) {
//if (inv.substring(0,4) == 'Cote') { alert('was=' + inv + 'and ends up as=' + inv.replace(/\'/g,'%27').replace(/\ /g,'%20')); }
if (xdelimis == ' ' || inv.replace(' ','').indexOf('POINT(') == 0) { return inv.replace(/\'/g,'%27'); }
return inv.replace(/\'/g,'%27').replace(/\ /g,'%20');
}
function ourencodeURIComponent(inv) {
inv=inv.replace(/\%27/g,'`').replace(/\'/g,'`');
if (showmg) {
//alert('inv=' + inv + ' and geomix(inv)=' + geomix(inv));
if (inv.indexOf('POINT') == -1 && interestingcount == 1) {
return '';
}
return geomix(inv);
}
return inv; //.replace('T00:00:00','');
}
function geomix(inda) {
var outda='', thisdm='';
// ,[~POINT (-122.7474291 47.0821119)~,36],[~POINT (-122.0313266 47.6285782)~,1],[~POINT (-122.64177 47.737525)~,9],[~POINT (-122.89692 47.043535)~,60],[~POINT (-122.9131017 47.0135926)~,33],[~POINT (-122.388675 47.5415)~,14],[~POINT (-122.611365 47.575195)~,6],[~POINT (-122.179458 47.802589)~,76],
// data=%20[51.4769|-0.0005|~From~,2]%20,%20[51.4769|-0.0005|~To~,2]%20,%20[51.4769|-0.0005|~Greenwich~,2]
if (inda.replace(/\ /g,'').indexOf('POINT(') != -1) {
//alert(inda);
var ptarr=inda.replace(/POINT\ \(/g,'POINT(').split('POINT');
for (var iptarr=1; iptarr<ptarr.length; iptarr++) {
if (ptarr[iptarr].indexOf('(') != -1) {
if (ptarr[iptarr].split('(')[1].indexOf(' ') != -1) {
outda+=thisdm + '[' + ptarr[iptarr].split('(')[1].split(' ')[1].split(')')[0] + '|' + ptarr[iptarr].split('(')[1].split(' ')[0] + '|~' + ptarr[iptarr].split('(')[0].split(String.fromCharCode(9))[0].split('(')[0].replace(/^POINT/g,'') + '~'; // + ptarr[eval(1 + iptarr)].split(']')[0] + ']';
//alert(outda);
thisdm='%20,%20';
}
}
}
return outda;
}
return inda;
}
function geomixer(inda) {
var outda='';
// ,[~POINT (-122.7474291 47.0821119)~,36],[~POINT (-122.0313266 47.6285782)~,1],[~POINT (-122.64177 47.737525)~,9],[~POINT (-122.89692 47.043535)~,60],[~POINT (-122.9131017 47.0135926)~,33],[~POINT (-122.388675 47.5415)~,14],[~POINT (-122.611365 47.575195)~,6],[~POINT (-122.179458 47.802589)~,76],
// data=%20[51.4769|-0.0005|~From~,2]%20,%20[51.4769|-0.0005|~To~,2]%20,%20[51.4769|-0.0005|~Greenwich~,2]
if (inda.replace(/\ /g,'').indexOf('POINT(') != -1) {
var ptarr=inda.replace(/POINT\ \(/g,'POINT(').split('~');
for (var iptarr=1; iptarr<ptarr.length; iptarr+=2) {
if (ptarr[iptarr].indexOf('(') != -1) {
if (ptarr[iptarr].split('(')[1].indexOf(' ') != -1) {
outda+=outdelim + '%20[' + ptarr[iptarr].split('(')[1].split(' ')[1].split(')')[0] + '|' + ptarr[iptarr].split('(')[1].split(' ')[0] + '|~' + ptarr[iptarr].split('(')[0].split(String.fromCharCode(9))[0].split('(')[0].replace(/^POINT/g,'') + '~' + ptarr[eval(1 + iptarr)].split(']')[0] + ']';
//alert(outda);
outdelim='%20,';
}
}
}
return outda;
}
return inda;
}
function addfieldname(osel) {
var wc='', little=osel.value.replace(/\=$/g, ''), andw=' and ', dotdot='', prelittle='';
if (osel.value != '') {
if (little.indexOf('/') != -1 && little.indexOf('/@') != -1) {
if (little.indexOf('~') != -1) {
prelittle=little.split('~')[0];
little=little.substring(eval(1 + eval('' + prelittle.length)))
} else {
prelittle=little.split('/')[0];
little=little.substring(eval(1 + eval('' + prelittle.length)))
}
}
if (osel.value.slice(-1) == '=') {
//*[@name='Value' or @name='Country or Area' or @name='Year']
//field[text() = 'Aruba']/../*[@name='Value' or @name='Country or Area' or @name='Year']
if (document.getElementById('xpath').value.indexOf(']/') == -1) {
if (little.indexOf('@') != -1) {
wc=prompt('Optionally enter a "where" type of sibling related clause (adding to our start for you) ... ' + String.fromCharCode(10) + ' eg. ' + prelittle, prelittle);
little=prelittle;
} else {
wc=prompt('Optionally enter a "where" type of clause (adding to our start for you) ... ' + String.fromCharCode(10) + ' eg. ' + little + '="lookfor"' + String.fromCharCode(10) + ' eg. ' + little + '!="notlookfor"' + String.fromCharCode(10) + ' eg. ' + little + '<998', little);
}
} else {
if (little.indexOf('@') != -1) {
prelittle=' or text() = ' + prelittle.replace(/\=$/g, '').split('/')[0].split('=')[1].split(']')[0];
wc=prompt('Optionally add an "or" subclause to your existant sibling related "where" type of clause (adding to our subclause start for you) ... ' + String.fromCharCode(10) + ' eg. ' + prelittle, prelittle);
little=prelittle;
} else {
little=' and ' + osel.value.replace(/\=$/g, '');
wc=prompt('Optionally add an "and" subclause to your existant "where" type of clause (adding to our subclause start for you) ... ' + String.fromCharCode(10) + ' eg. ' + little + '="lookfor"' + String.fromCharCode(10) + ' eg. ' + little + '!="notlookfor"' + String.fromCharCode(10) + ' eg. ' + little + '<998', little);
}
}
if (wc == null) { wc=''; }
if (wc.trim() != '' && (wc != little || wc.replace(/^\ or\ /g, '@').replace('text()','@').indexOf('@') != -1)) {
if (little.replace('text()','@').indexOf('@') != -1) {
if (document.getElementById('xpath').value.indexOf(']/') == -1) {
document.getElementById('xpath').value=document.getElementById('xpath').value.replace('/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)], '[]/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)]);
//alert(document.getElementById('xpath').value);
document.getElementById('xpath').value=document.getElementById('xpath').value.replace('[]/', '/' + wc + '/');
document.getElementById('myfldselopt').innerText=('Optionally display selected field name(s) value(s)').replace('Optionally display selected field name(s) value(s)','Optionally display selected field name(s) [' + document.getElementById('xpath').value.split('[')[1].split(']')[0] + '] value(s)') + ' ...' + document.getElementById('myfldselopt').innerText.split(' ...')[1]
} else {
if (wc.toLowerCase().replace(/^\ or\ /g, ' and ').indexOf(' and ') == 0) {
andw='';
} else {
document.getElementById('xpath').value=document.getElementById('xpath').value.replace(']/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)], andw + ']/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)]);
}
document.getElementById('xpath').value=document.getElementById('xpath').value.replace(']/', wc.split('/')[0] + ']/');
document.getElementById('myfldselopt').innerText=('Optionally display selected field name(s) value(s)').replace('Optionally display selected field name(s) value(s)','Optionally display selected field name(s) [' + document.getElementById('xpath').value.split('[')[1].split(']')[0] + '] value(s)') + ' ...' + document.getElementById('myfldselopt').innerText.split(' ...')[1]
}
dotdot=document.getElementById('xtitle').value.replace(document.getElementById('xtitle').value.split(' .. ')[0], '');
//alert(dotdot + ' ... ' + document.getElementById('xtitle').value);
document.getElementById('xtitle').value=document.getElementById('xtitle').value.split(' -- ')[0].split((' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. '))[0] + (' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. ') + dotdot;
document.getElementById('xtitle').value=document.getElementById('xtitle').value.replace(/\'/g,'');
xtitleis=document.getElementById('xtitle').value;
//alert('more to do');
} else {
if (document.getElementById('xpath').value.indexOf(']/') == -1) {
document.getElementById('xpath').value=document.getElementById('xpath').value.replace('/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)], '[]/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)]);
document.getElementById('xpath').value=document.getElementById('xpath').value.replace(']/', wc.replace(/\]$/g,'').replace(/^\[/g,'') + ']/');
document.getElementById('myfldselopt').innerText=('Optionally display selected field name(s) value(s)').replace('Optionally display selected field name(s) value(s)','Optionally display selected field name(s) [' + document.getElementById('xpath').value.split('[')[1].split(']')[0] + '] value(s)') + ' ...' + document.getElementById('myfldselopt').innerText.split(' ...')[1]
} else {
if (wc.toLowerCase().replace(/^\ or\ /g, ' and ').indexOf(' and ') == 0) {
andw='';
} else {
document.getElementById('xpath').value=document.getElementById('xpath').value.replace(']/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)], andw + ']/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)]);
}
document.getElementById('xpath').value=document.getElementById('xpath').value.replace(']/', wc.replace(/\]$/g,'').replace(/^\[/g,'') + ']/');
document.getElementById('myfldselopt').innerText=('Optionally display selected field name(s) value(s)').replace('Optionally display selected field name(s) value(s)','Optionally display selected field name(s) [' + document.getElementById('xpath').value.split('[')[1].split(']')[0] + '] value(s)') + ' ...' + document.getElementById('myfldselopt').innerText.split(' ...')[1]
}
dotdot=document.getElementById('xtitle').value.replace(document.getElementById('xtitle').value.split(' .. ')[0], '');
//alert(dotdot + ' ... ' + document.getElementById('xtitle').value);
document.getElementById('xtitle').value=document.getElementById('xtitle').value.split(' -- ')[0].split((' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. '))[0] + (' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. ') + dotdot;
document.getElementById('xtitle').value=document.getElementById('xtitle').value.replace(/\'/g,'');
xtitleis=document.getElementById('xtitle').value;
}
}
osel.value='';
} else if ((little + ' ').substring(0,1) == '@') {
//*[@name='Value' or @name='Country or Area' or @name='Year']
//field[text() = 'Aruba']/../*[@name='Value' or @name='Country or Area' or @name='Year']
if (document.getElementById('xpath').value.indexOf('/*[@') == -1) {
document.getElementById('sask').innerHTML=saskih;
document.getElementById('xpath').value=document.getElementById('xpath').value.replace('/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)], '/*[' + little + ']');
document.getElementById('myfldselopt').innerText=document.getElementById('myfldselopt').innerText.split(' ...')[0] + ' ... ' + little;
document.getElementById('xtitle').value=document.getElementById('xtitle').value.split(' -- ')[0].split((' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. '))[0] + (' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. ') + little;
document.getElementById('xtitle').value=document.getElementById('xtitle').value.replace(/\'/g,'');
xtitleis=document.getElementById('xtitle').value;
} else {
document.getElementById('xpath').value=document.getElementById('xpath').value.replace(/\]$/g, ' or ' + little + ']');
document.getElementById('myfldselopt').innerText+=',' + little;
dotdot=document.getElementById('xtitle').value.replace(document.getElementById('xtitle').value.split(' .. ')[0], '');
document.getElementById('xtitle').value=document.getElementById('xtitle').value.split(' -- ')[0].split((' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. '))[0] + (' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. ') + dotdot + ',' + little;
document.getElementById('xtitle').value=document.getElementById('xtitle').value.replace(/\'/g,'');
xtitleis=document.getElementById('xtitle').value;
}
osel.value='';
} else {
if (document.getElementById('xpath').value.indexOf('/*[self::') == -1) {
document.getElementById('sask').innerHTML=saskih;
document.getElementById('xpath').value=document.getElementById('xpath').value.replace('/' + document.getElementById('xpath').value.split('/')[eval(-1 + document.getElementById('xpath').value.split('/').length)], '/*[self::' + osel.value + ']');
document.getElementById('myfldselopt').innerText=document.getElementById('myfldselopt').innerText.split(' ...')[0] + ' ... ' + osel.value;
document.getElementById('xtitle').value=document.getElementById('xtitle').value.split(' -- ')[0].split((' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. '))[0] + (' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. ') + osel.value;
document.getElementById('xtitle').value=document.getElementById('xtitle').value.replace(/\'/g,'');
xtitleis=document.getElementById('xtitle').value;
} else {
document.getElementById('xpath').value=document.getElementById('xpath').value.replace(/\]$/g, ' or self::' + osel.value + ']');
document.getElementById('myfldselopt').innerText+=',' + osel.value;
dotdot=document.getElementById('xtitle').value.replace(document.getElementById('xtitle').value.split(' .. ')[0], '');
document.getElementById('xtitle').value=document.getElementById('xtitle').value.split(' -- ')[0].split((' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. '))[0] + (' .... ' + (document.getElementById('myfldselopt').innerText + '[]').split('[')[1].split(']')[0] + ' .. ').replace(/^\ \.\.\.\ \ \.\.\ /g, ' .. ') + dotdot + ',' + osel.value;
document.getElementById('xtitle').value=document.getElementById('xtitle').value.replace(/\'/g,'');
xtitleis=document.getElementById('xtitle').value;
}
osel.value='';
}
}
}
function stateChanged() {
var sofardone=',', ifns=0, theattribis='', attribsofardone=',', lastprefix='', myaruba="'Aruba'";
if (myxhr.readyState == 4) {
if (myxhr.status == 200) {
var dtfns=myxhr.responseText.split('"dataTypeName" : "');
var fns=myxhr.responseText.split('"fieldName" : "');
var isokay=eval('' + dtfns.length);
if (eval('' + fns.length) == 1) {
if (document.getElementById('xurl').value.indexOf('rjmprogramming.com.au') != -1) {
arrflds=[];
dtarrflds=[];
fieldsel=' or <select onchange=addfieldname(this); id=myfldsel><option id=myfldselopt value="">Optionally display selected field name(s) value(s) ...</option></select>';
dtfns=myxhr.responseText.split('=');
for (ifns=1; ifns<dtfns.length; ifns++) {
if ((lastprefix + dtfns[eval(-1 + ifns)]).split('<')[eval(-1 + (lastprefix + dtfns[eval(-1 + ifns)]).split('<').length)].split(' ')[0].indexOf('?') == -1 && (lastprefix + dtfns[eval(-1 + ifns)]).split('<')[eval(-1 + (lastprefix + dtfns[eval(-1 + ifns)]).split('<').length)].split(' ')[0].indexOf('"') == -1) {
if (dtfns[ifns].substring(0,1) == '"') {
theattribis=(lastprefix + dtfns[eval(-1 + ifns)]).split('<')[eval(-1 + (lastprefix + dtfns[eval(-1 + ifns)]).split('<').length)].split(' ')[0] + '/@' + dtfns[eval(-1 + ifns)].split(' ')[eval(-1 + dtfns[eval(-1 + ifns)].split(' ').length)] + "='" + dtfns[ifns].substring(1).split('"')[0] + "'";
} else if (dtfns[ifns].substring(0,1) == "'") {
theattribis=(lastprefix + dtfns[eval(-1 + ifns)]).split('<')[eval(-1 + (lastprefix + dtfns[eval(-1 + ifns)]).split('<').length)].split(' ')[0] + '/@' + dtfns[eval(-1 + ifns)].split(' ')[eval(-1 + dtfns[eval(-1 + ifns)].split(' ').length)] + "='" + dtfns[ifns].substring(1).split("'")[0] + "'";
} else {
theattribis=(lastprefix + dtfns[eval(-1 + ifns)]).split('<')[eval(-1 + (lastprefix + dtfns[eval(-1 + ifns)]).split('<').length)].split(' ')[0] + '/@' + dtfns[eval(-1 + ifns)].split(' ')[eval(-1 + dtfns[eval(-1 + ifns)].split(' ').length)] + '=' + dtfns[ifns].split(' ')[0].split('>')[0];
}
//*[@name='Value' or @name='Country or Area' or @name='Year']
//field[text() = 'Aruba']/../*[@name='Value' or @name='Country or Area' or @name='Year']
if (attribsofardone.indexOf(',' + theattribis + ',') == -1 && theattribis.split('=')[0].indexOf(':') == -1) {
//alert(theattribis);
if (eval('' + fldsv.length) <= 1 && attribsofardone == ',') {
fldsv=myxhr.responseText.split('</' + dtfns[eval(-1 + ifns)].split('<')[eval(-1 + dtfns[eval(-1 + ifns)].split('<').length)].split(' ')[0] + '>');
}
attribsofardone+=theattribis + ',';
//alert(theattribis + ' ... ' + attribsofardone);
lastprefix='<' + dtfns[eval(-1 + ifns)].split('<')[eval(-1 + dtfns[eval(-1 + ifns)].split('<').length)].split(' ')[0] + ' ';
//alert(lastprefix + dtfns[ifns]);
} else {
lastprefix='';
//alert(lastprefix);
}
}
}
fns=attribsofardone.substring(0).replace(/\,$/g,'').split(',');
for (ifns=1; ifns<fns.length; ifns++) {
if (sofardone.indexOf(',' + fns[ifns] + ',') == -1) {
sofardone+=fns[ifns] + ',';
if (fns[ifns].indexOf(':@') != 0 && fns[ifns].trim() != '') {
arrflds.push(fns[ifns].split('"')[0]);
if (isokay > eval('' + dtarrflds.length)) {
dtarrflds.push(dtfns[ifns].split('"')[0]);
} else {
dtarrflds.push('');
}
if (eval(-1 + eval('' + fldsv.length)) > eval('' + arrflds.length)) {
myaruba=fldsv[eval(-1 + eval('' + arrflds.length))].split('>')[eval(-1 + fldsv[eval(-1 + eval('' + arrflds.length))].split('>').length)];
if (('' + myaruba).trim() == '') {
myaruba="'" + fldsv[eval(-1 + eval('' + arrflds.length))].split('>')[eval(-1 + fldsv[eval(-1 + eval('' + arrflds.length))].split('>').length)] + "'";
} else if (myaruba.trim().replace(/\-/g,'').replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') != '') {
myaruba="'" + fldsv[eval(-1 + eval('' + arrflds.length))].split('>')[eval(-1 + fldsv[eval(-1 + eval('' + arrflds.length))].split('>').length)] + "'";
}
fieldsel=fieldsel.replace('</select>', '<option value="' + fns[ifns].split('"')[0] + '">' + fns[ifns].split('"')[0] + (' [' + dtarrflds[eval(-1 + dtarrflds.length)] + ']').replace(/^\ \[\]$/g, '') + '</option><option value="' + fns[ifns].split('/')[0] + "[text() = " + myaruba + "]/..~" + fns[ifns].split('"')[0] + '=">' + fns[ifns].split('/')[0] + "[text() = " + myaruba + "]" + ' sibling where clause?</option></select>');
} else {
fieldsel=fieldsel.replace('</select>', '<option value="' + fns[ifns].split('"')[0] + '">' + fns[ifns].split('"')[0] + (' [' + dtarrflds[eval(-1 + dtarrflds.length)] + ']').replace(/^\ \[\]$/g, '') + '</option><option value="' + fns[ifns].split('/')[0] + "[text() = 'Aruba']/..~" + fns[ifns].split('"')[0] + '=">' + fns[ifns].split('/')[0] + "[text() = 'Aruba']" + ' sibling where clause?</option></select>');
}
}
}
}
fns=[];
}
}
for (ifns=1; ifns<fns.length; ifns++) {
if (ifns == 1) {
arrflds=[];
dtarrflds=[];
fieldsel=' or <select onchange=addfieldname(this); id=myfldsel><option id=myfldselopt value="">Optionally display selected field name(s) value(s) ...</option></select>';
}
if (sofardone.indexOf(',' + fns[ifns] + ',') == -1) {
sofardone+=fns[ifns] + ',';
if (fns[ifns].indexOf(':@') != 0 && fns[ifns].trim() != '') {
arrflds.push(fns[ifns].split('"')[0]);
if (isokay > eval('' + dtarrflds.length)) {
dtarrflds.push(dtfns[ifns].split('"')[0]);
} else {
dtarrflds.push('');
}
fieldsel=fieldsel.replace('</select>', '<option value="' + fns[ifns].split('"')[0] + '">' + fns[ifns].split('"')[0] + (' [' + dtarrflds[eval(-1 + dtarrflds.length)] + ']').replace(/^\ \[\]$/g, '') + '</option><option value="' + fns[ifns].split('"')[0] + '=">' + fns[ifns].split('"')[0] + ' where clause?</option></select>');
}
}
}
if (document.getElementById('spanflds')) {
document.getElementById('spanflds').innerHTML=fieldsel;
}
}
}
}
function leftif(iois) {
if (iois != null) {
laconto=(iois.contentWindow || iois.contentDocument);
if (laconto != null) {
if (laconto.document) { laconto = laconto.document; }
if (laconto.body != null) {
lchart=laconto.getElementById('chart_div');
lrect=lchart.getBoundingClientRect();
console.log(lrect);
//lchart.style.width='' + eval(eval(('' + lchart.style.width).replace('px','')) * 2) + 'px';
}
}
}
}
function rightif(iois) {
if (iois != null) {
raconto=(iois.contentWindow || iois.contentDocument);
if (raconto != null) {
if (raconto.document) { raconto = raconto.document; }
if (raconto.body != null) {
rchart=raconto.getElementById('chart_div');
rrect=rchart.getBoundingClientRect();
console.log(rrect);
}
}
}
}
function checkif(iois) {
if (iois != null) {
var aconto=(iois.contentWindow || iois.contentDocument);
if (aconto != null) {
myxhr = new XMLHttpRequest();
//if (iois.src.indexOf('rjmprogramming.com.au') != -1) {
//alert(iois.src);
//}
myxhr.open('GET', iois.src, true);
myxhr.responseType = "text";
myxhr.onreadystatechange=stateChanged;
myxhr.send(null);
console.log(aconto);
//alert(('' + aconto.document));
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
var fns=aconto.body.innerHTML.split('"fieldName" : "');
for (var ifns=1; ifns<fns.length; ifns++) {
if (ifns == 1) {
fieldsel=' or <select onchange=addfieldname(this); id=myfldsel><option id=myfldselopt value="">Optionally display selected field name(s) value(s) ...</option></select>';
}
fieldsel=fieldsel.replace('</select>', '<option value="' + fns[ifns].split('"')[0] + '">' + fns[ifns].split('"')[0] + '</option></select>');
}
if (document.getElementById('spanflds')) {
document.getElementById('spanflds').innerHTML=fieldsel;
}
}
}
}
}
function lextra_opts() {
lextras=prompt('Optionally enter left hand Google Chart non-default comma separated options. ' + String.fromCharCode(10) + " Read more at https://developers.google.com/chart/interactive/docs/basic_customizing_chart" + String.fromCharCode(10) + " Eg. chartArea:{left:20,top:0,width:'90%',height:'95%'}, fontName:'Arial'", lextras);
if (lextras == null) { lextras=''; }
document.getElementById('lopts').value=lextras;
}
function rextra_opts() {
rextras=prompt('Optionally enter right hand Google Chart non-default comma separated options. ' + String.fromCharCode(10) + " Read more at https://developers.google.com/chart/interactive/docs/basic_customizing_chart" + String.fromCharCode(10) + " Eg. chartArea:{left:20,top:0,width:'90%',height:'95%'}, fontName:'Arial'", rextras);
if (rextras == null) { rextras=''; }
document.getElementById('ropts').value=rextras;
}
function incdec(ifid, perch) {
//alert('' + document.getElementById(ifid).width);
if (document.getElementById(ifid)) {
//alert('x:' + document.getElementById(ifid).width);
var waswis=eval('' + eval(('' + document.getElementById(ifid).width).replace('px','')));
var washis=eval('' + eval(('' + document.getElementById(ifid).height).replace('px','')));
//alert(waswis);
var newwis=Math.round(eval(waswis * eval(eval(eval('' + perch) + 100.0) / 100.0)));
var newhis=Math.round(eval(washis * eval(eval(eval('' + perch) + 100.0) / 100.0)));
//alert(newwis);
document.getElementById(ifid).style.width='' + newwis + 'px';
document.getElementById(ifid).style.height='' + newhis + 'px';
document.getElementById(ifid).width='' + newwis + 'px';
document.getElementById(ifid).height='' + newhis + 'px';
}
}
</script>
<form style=display:none; target=myi method=POST action=//www.rjmprogramming.com.au/PHP/HistogramChart/histogram_chart.php>
<input type=hidden value='Powerball Winning Numbers Since 2010 - State of New York USA' name=title id=xhtitle></input>
<input type=hidden value=y name=onclick></input>
<input type=hidden value=Number name=task></input>
<input type=hidden value=Count name=desc></input>
<input type=hidden value=y name=wouldlikeyoutoseekpermission></input>
<div id=divhextraopts><input type=hidden value='' id=hextraopts class="l"></input></div>
<input name=data id=data value='' type=hidden></input>
<input type=submit value=Show id=mybut style='display:none;'></input>
</form>
<form style=display:none; target=mpi method=POST action=//www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php>
<input type=hidden value='Powerball Winning Numbers Since 2010 - State of New York USA' name=title id=xptitle></input>
<input type=hidden value=y name=onclick></input>
<input type=hidden value=Number name=task></input>
<input type=hidden value=Count name=desc></input>
<input type=hidden value=y name=wouldlikeyoutoseekpermission></input>
<div id=divpextraopts><input type=hidden value='' id=pextraopts class="r"></input></div>
<input name=data id=datap value='' type=hidden></input>
<input type=submit value=Show id=mybutp style='display:none;'></input>
</form>
<form style=display:none; target=myi method=POST action=//www.rjmprogramming.com.au/PHP/ColumnChart/column_chart.php>
<input type=hidden value='Powerball Winning Numbers Since 2010 - State of New York USA' name=title id=xltitle></input>
<input type=hidden value=y name=onclick></input>
<input type=hidden value=Count name=value id=xlvalue></input>
<input type=hidden value=Date name=label id=xllabel></input>
<input type=hidden value=y name=wouldlikeyoutoseekpermission></input>
<div id=divcextraopts><input type=hidden value='' id=cextraopts class="l"></input></div>
<input name=data id=datal value='' type=hidden></input>
<input type=submit value=Show id=mybutl style='display:none;'></input>
</form>
<form style=display:none; target=mpi method=POST action=//www.rjmprogramming.com.au/PHP/BarChart/bar_chart.php>
<input type=hidden value='Powerball Winning Numbers Since 2010 - State of New York USA' name=title id=xbtitle></input>
<input type=hidden value=y name=onclick></input>
<input type=hidden value=Count name=value id=xbvalue></input>
<input type=hidden value=Date name=label id=xblabel></input>
<input type=hidden value=y name=wouldlikeyoutoseekpermission></input>
<div id=divbextraopts><input type=hidden value='' id=bextraopts class="r"></input></div>
<input name=data id=datab value='' type=hidden></input>
<input type=submit value=Show id=mybutb style='display:none;'></input>
</form>
<form onsubmit="document.getElementById('myi').width='1020'; document.getElementById('myi').height='630'; " style=display:none; target=myi action=//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php method=POST>
<input type=hidden value='Powerball Winning Numbers Since 2010 - State of New York USA' name=title id=xgtitle></input>
<input type=hidden id=xglabel value="['Lat',"></input>
<input type=hidden id=xgvalue value="'Lon', 'Name']"></input>
<input type=hidden value="1000" name=width></input>
<input type=hidden value="624" name=height></input>
<input type=hidden value="Places" name=country></input>
<input type=hidden value="Count" name=popularity></input>
<input type=hidden name='wouldlikeyoutoseekpermission' id='wouldlikeyoutoseekpermission' value=''></input>
<div id=divgextraopts><input type=hidden value='' id=gextraopts class="l"></input></div>
<input type=hidden name='aregexographicals' value='y'></input>
<input type=hidden name='aregeographicals' value=''></input>
<input name=data id=datag value='' type=hidden></input>
<input type=hidden value=y name=onclick></input>
<input type=submit value=Show id=mybutg style='display:none;'></input>
</form>
<form style=display:none; target=mpi action=//www.rjmprogramming.com.au/PHP/Map/map.php method=POST>
<input type=hidden value='Powerball Winning Numbers Since 2010 - State of New York USA' name=title id=xmtitle></input>
<input type=hidden id=xmlabel value="['Lat'," name=label></input>
<input type=hidden id=xmvalue value="'Lon', 'Name']" name=value></input>
<input type=hidden name='wouldlikeyoutoseekpermission' id='wouldlikeyoutoseekpermission' value=''></input>
<div id=divmextraopts><input type=hidden value='' id=mextraopts class="r"></input></div>
<input name=data id=datam value='' type=hidden></input>
<input type=hidden value=y name=onclick></input>
<input type=submit value=Show id=mybutm style='display:none;'></input>
</form>
<form style=display:none; target=myi action=//www.rjmprogramming.com.au/PHP/BubbleChart/bubble_chart.php method=POST>
<input type=hidden value='Powerball Winning Numbers Since 2010 - State of New York USA' name=title id=xutitle></input>
<input type=hidden id=xulabel value="'ID'" name=label></input>
<input type=hidden id=xuvalue value="Rateone,Ratetwo,'Region',Ratefour" name=value></input>
<div id=divuextraopts><input type=hidden value='' id=uextraopts class="l"></input></div>
<input name=data id=datau value='' type=hidden data-eg=", [~id1~,10,10,'10',10] , [~id2~,20,20,'20',20]"></input>
<input type=hidden value=y name=onclick></input>
<input type=submit value=Show id=mybutu style='display:none;'></input>
</form>
<table style="width:100%;">
<tr><td style='vertical-align:top;padding-top:3px;border-top:3px dotted yellow;border-left:3px dotted yellow;' title="Double click to increase left iframe dimensions by 2% (to decrease right click)" oncontextmenu="incdec('myi',-2);" ondblclick="incdec('myi',2);">
<iframe onload=leftif(this); style='display:none;' width=740 height=600 id='myi' name='myi' src='//www.rjmprogramming.com.au/PHP/HistogramChart/histogram_chart.php?title=Powerball%20Winning%20Numbers%20Since%202010%20-%20State%20of%20New%20York%20USA&onclick=y&task=Number&desc=Count&data=,[~-1~,0],[~-2~,0]' title='Powerball Winning Numbers Since 2010 - State of New York USA'></iframe>
</td><td style='vertical-align:top;padding-top:3px;border-top:3px dotted yellow;border-left:3px dotted yellow;' title="Double click to increase right iframe dimensions by 2% (to decrease right click)" oncontextmenu="incdec('mpi',-2);" ondblclick="incdec('mpi',2);">
<iframe onload=rightif(this); style='display:none;' width=660 height=600 id='mpi' name='mpi' src='//www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php?title=Powerball%20Winning%20Numbers%20Since%202010%20-%20State%20of%20New%20York%20USA&onclick=y&task=Number&desc=Count&data=,[~-1~,0],[~-2~,0]' title='Powerball Winning Numbers Since 2010 - State of New York USA'></iframe>
</td></tr>
</table>
<script>
document.write(formhtml);
</script>
</body>
</html>