<!doctype html>
<html>
<head>
<title>Dams in United States of America - RJM Programming - February, 2017</title>
<script type='text/javascript'>

var iois=null, first_try=true, zero=0;
var cnt=0, dcnt=1, pbarv=0;
var dam_data='', dam_data_arr=[]; // lots of 22
var dam_name_etc=[];

var debug_block = (location.search.split('debug=')[1] ? location.search.split('debug=')[1].split('&')[0] : 'none');
var more_time = (location.search.split('more=')[1] ? location.search.split('more=')[1].split('&')[0] : '0');

var state_lu=["Puerto Rico","PR","Virgin Islands","VI",
"Alabama",
"AL",
"Missouri",
"MO",
"Alaska",
"AK",
"Montana",
"MT",
"Arizona",
"AZ",
"Nebraska",
"NE",
"Arkansas",
"AR",
"Nevada",
"NV",
"California",
"CA",
"New Hampshire",
"NH",
"Colorado",
"CO",
"New Jersey",
"NJ",
"Connecticut",
"CT",
"New Mexico",
"NM",
"Delaware",
"DE",
"New York",
"NY",
"District of Columbia",
"DC",
"North Carolina",
"NC",
"Florida",
"FL",
"North Dakota",
"ND",
"Georgia",
"GA",
"Ohio",
"OH",
"Hawaii",
"HI",
"Oklahoma",
"OK",
"Idaho",
"ID",
"Oregon",
"OR",
"Illinois",
"IL",
"Pennsylvania",
"PA",
"Indiana",
"IN",
"Rhode Island",
"RI",
"Iowa",
"IA",
"South Carolina",
"SC",
"Kansas",
"KS",
"South Dakota",
"SD",
"Kentucky",
"KY",
"Tennessee",
"TN",
"Louisiana",
"LA",
"Texas",
"TX",
"Maine",
"ME",
"Utah",
"UT",
"Maryland",
"MD",
"Vermont",
"VT",
"Massachusetts",
"MA",
"Virginia",
"VA",
"Michigan",
"MI",
"Washington",
"WA",
"Minnesota",
"MN",
"West Virginia",
"WV",
"Mississippi",
"MS",
"Wisconsin",
"WI",
"Wyoming",
"WY"];

function inarr(what) {
for (var kj=zero; kj<eval(dam_data_arr.length); kj++) {
if (dam_data_arr[kj] == what) {
zero=kj;
return kj;
}
}
return -1;
}

function examine_dam_data() {
var ij=0,lastij=13,twenty=20,kk,five=5,four=4,prevl=-1;
if (first_try) {
//alert(decodeURIComponent("~KY%2CHAMILTON%201%20%22SLURRY%22%2C%C2%A0%09%2C%C2%A0%09%2CUNIONTOWN%2CUNION%2C60.00000000000%2C480.00000000000%2C0.00000000000%2C0.00000000000%2C0.11000000000%2C%C2%A0%09%2CT%2C%C2%A0%09~]"));
first_try=false;
if (eval(more_time) > 0) {
var hlis=((eval(document.getElementById('pbar').max) / 1) * 1000) - 4000;
//alert(document.getElementById('pbar').max + ' ... ' + hlis);
setTimeout(examine_dam_data, hlis);
} else {
setTimeout(examine_dam_data, 60000);
}
return;
}
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
var at=false;
if (aconto.textContent) at=true;
if (aconto.body.innerHTML.length == 0 && !at) {
cnt++;
iois=document.getElementById('myiframe');
//document.title=aconto.body.innerHTML.length + ' ... ' + cnt + ' ... ' + aconto.body.innerText.substring(0,100);
setTimeout(examine_dam_data, 2000);
} else {
//alert('abi=' + aconto.body.innerHTML.length);
if (document.body.innerText) {
if (aconto.body.innerText.indexOf(String.fromCharCode(10)) != -1) {
//alert('abit=' + aconto.body.innerText.length);
dam_data_arr=aconto.body.innerText.split(String.fromCharCode(10));
//alert('cnt=' + dam_data_arr.length + ' ' + dam_data_arr[0].substring(0,100));
} else {
//alert('zzabt=' + aconto.body.innerHTML.replace(/\<\/td\>/gi,"\n").replace(/(<([^>]+)>)/gi, "").length);
//dam_data_arr=aconto.body.innerHTML.replace(/\<br\>/gi,"\n").replace(/(<([^>]+)>)/gi, "").split(String.fromCharCode(10));
dam_data_arr=aconto.body.innerHTML.replace(/\<\/td\>/gi,"\n").replace(/(<([^>]+)>)/gi, "").split(String.fromCharCode(10));
//alert('zcnt=' + dam_data_arr.length + ' ' + dam_data_arr[0].substring(0,100));
}
} else {
//alert('nextabi=' + aconto.body.innerHTML.length);
if (aconto.textContent) {
//alert('abt=' + aconto.textContent.length);
dam_data_arr=aconto.textContent.split(String.fromCharCode(10));
} else { // thanks to http://www.davidtong.me/innerhtml-innertext-textcontent-html-and-text/
//alert('zabt=' + aconto.body.innerHTML.replace(/\<br\>/gi,"\n").replace(/(<([^>]+)>)/gi, "").length);
dam_data_arr=aconto.body.innerHTML.replace(/\<br\>/gi,"\n").replace(/(<([^>]+)>)/gi, "").split(String.fromCharCode(10));
}
}
//alert(aconto.body.innerText.substring(0,2600));
//alert(dam_data_arr[22]);
//alert('667 at ' + inarr('667'));
for (var kj=22; kj<eval(dam_data_arr.length); kj+=22) {
if (eval(lastij) > eval(dam_data_arr.length) && prevl >= 0) {
ij=prevl;
} else {
ij=lastij; //eval(-8 + kj); //Math.max(eval(lastij + 1),kj);
}
//if (dcnt >= 666) alert(ij + ' before: ' + dcnt + ' ... ' + lastij + ' vs ' + dam_data_arr.length + ' ___ ' + prevl + ' ' + kj);
//if (dcnt == 914) alert(dcnt + ' ...before... ' + ij + ' ... ' + dam_data_arr.length);
if (eval(2 + ij) < eval(dam_data_arr.length)) {
while (('*' + dam_data_arr[ij].trim() + '*').indexOf('*' + dcnt + '*') == -1 && eval(2 + ij) < eval(dam_data_arr.length)) {
//if (dcnt >= 666) alert(ij + ' *' + dam_data_arr[ij].trim() + '* vs *' + dcnt + '*');
ij++;
}
//if (dcnt >= 666) alert(ij + ' andthenbefore: ' + dcnt + ' ... ' + lastij + ' vs ' + dam_data_arr.length + ' ___ ' + prevl);
}
//if (dcnt == 914) alert(dcnt + ' ... ' + ij + ' ... ' + dam_data_arr.length);
lastij=eval(10 + ij);
//if (dcnt >= 666) alert(dcnt + ' .+. ' + lastij + ' vs ' + dam_data_arr.length + ' ___ ' + prevl + ' ' + inarr('' + dcnt));
if (lastij < eval(dam_data_arr.length)) {
prevl=lastij;
} else if (inarr('' + dcnt) != -1) {
ij=inarr('' + dcnt);
}
twenty=20;
for (kk=lastij; kk<=eval(80 + ij); kk++) {
if (kk >= 3 && kk < eval(dam_data_arr.length)) {
if (dam_data_arr[eval(-3 + kk)].indexOf('.') != -1 && dam_data_arr[eval(-3 + kk)].indexOf('0') != -1 && dam_data_arr[eval(-2 + kk)].indexOf('.') != -1 && dam_data_arr[eval(-2 + kk)].indexOf('0') != -1 && dam_data_arr[eval(-1 + kk)].length == 1 && dam_data_arr[kk].length == 2) {
if (dam_data_arr[kk].substring(0,1) >= 'A' && dam_data_arr[kk].substring(0,1) <= 'Z') {
if (dam_data_arr[kk].substring(1,2) >= 'A' && dam_data_arr[kk].substring(1,2) <= 'Z') {
twenty=eval(kk - ij);
}
}
}
}
}
if (eval(twenty + ij) < eval(dam_data_arr.length)) {
//if (eval(dam_data_arr[eval(0 + ij)]) == 980) alert(dam_data_arr[eval(2 + twenty + ij)] + ' ... ' + ij + ' (' + eval(twenty + ij) + ') ' + eval(dam_data_arr.length) + ' ... ' + dam_data_arr[eval(0 + ij)] + ' ... vs ... ' + dam_data_arr[eval(20 + ij)]);
if (dam_data_arr[eval(twenty + ij)].length == 2) {
if (dam_data_arr[eval(5 + ij)].indexOf("-") != -1 && dam_data_arr[eval(5 + ij)].indexOf(".") != -1) {
five=6;
four=5;
} else if (dam_data_arr[eval(3 + ij)].indexOf("-") != -1 && dam_data_arr[eval(3 + ij)].indexOf(".") != -1) {
five=4;
four=3;
} else {
five=5;
four=4;
}
if (dam_data_arr[eval(four + ij)].indexOf("-") != -1 && dam_data_arr[eval(four + ij)].indexOf(".") != -1 && dam_data_arr[eval(five + ij)].indexOf(".") != -1) {
if (dam_data_arr[eval(3 + ij)].substring(0,2).indexOf("-") != -1 || dam_data_arr[eval(3 + ij)].substring(0,2) == "FO") {
dam_name_etc.push((dam_data_arr[eval(twenty + ij)] + ';' + dam_data_arr[eval(1 + ij)] + ';' + dam_data_arr[eval(2 + ij)] + ';' + dam_data_arr[eval(five + ij)] + ',' + dam_data_arr[eval(four + ij)] + ';' + dam_data_arr[eval(7 + ij)] + ';' + dam_data_arr[eval(8 + ij)] + ';' + dam_data_arr[eval(6 + ij)] + ';' + dam_data_arr[eval(14 + ij)] + ';' + dam_data_arr[eval(15 + ij)] + ';' + dam_data_arr[eval(16 + ij)] + ';' + dam_data_arr[eval(17 + ij)] + ';' + dam_data_arr[eval(18 + ij)] + ';' + dam_data_arr[eval(11 + ij)] + ';' + dam_data_arr[eval(12 + ij)] + ';' + dam_data_arr[eval(13 + ij)] + ';' + dam_data_arr[eval(twenty + ij)]).replace(/\'/g,'`').replace(/\"/g,'`').replace(/\.00000000000/g,'.0').replace(/0000000000;/g,';'));
} else {
dam_name_etc.push((dam_data_arr[eval(3 + ij)].substring(0,2) + ';' + dam_data_arr[eval(1 + ij)] + ';' + dam_data_arr[eval(2 + ij)] + ';' + dam_data_arr[eval(five + ij)] + ',' + dam_data_arr[eval(four + ij)] + ';' + dam_data_arr[eval(7 + ij)] + ';' + dam_data_arr[eval(8 + ij)] + ';' + dam_data_arr[eval(6 + ij)] + ';' + dam_data_arr[eval(14 + ij)] + ';' + dam_data_arr[eval(15 + ij)] + ';' + dam_data_arr[eval(16 + ij)] + ';' + dam_data_arr[eval(17 + ij)] + ';' + dam_data_arr[eval(18 + ij)] + ';' + dam_data_arr[eval(11 + ij)] + ';' + dam_data_arr[eval(12 + ij)] + ';' + dam_data_arr[eval(13 + ij)] + ';' + dam_data_arr[eval(3 + ij)].substring(0,2)).replace(/\'/g,'`').replace(/\"/g,'`').replace(/\.00000000000/g,'.0').replace(/0000000000;/g,';'));
}
}
//if (eval(22 + ij) < eval(dam_data_arr.length) && eval(dam_data_arr[eval(22 + ij)]) > 0 && dam_data_arr[eval(22 + ij)].indexOf('.') == -1) dcnt=eval(-1 + eval(dam_data_arr[eval(22 + ij)]));
} //else {
//alert((dam_data_arr[eval(twenty + ij)] + ';' + dam_data_arr[eval(1 + ij)] + ';' + dam_data_arr[eval(2 + ij)] + ';' + dam_data_arr[eval(5 + ij)] + ',' + dam_data_arr[eval(4 + ij)] + ';' + dam_data_arr[eval(7 + ij)] + ';' + dam_data_arr[eval(8 + ij)] + ';' + dam_data_arr[eval(6 + ij)] + ';' + dam_data_arr[eval(14 + ij)] + ';' + dam_data_arr[eval(15 + ij)] + ';' + dam_data_arr[eval(16 + ij)] + ';' + dam_data_arr[eval(17 + ij)] + ';' + dam_data_arr[eval(18 + ij)] + ';' + dam_data_arr[eval(11 + ij)] + ';' + dam_data_arr[eval(12 + ij)] + ';' + dam_data_arr[eval(13 + ij)]));
//}
//} else {
//alert(dcnt + ' ... ' + ij + ' huh');
}
dcnt++;
//if (dcnt == 914) alert(dcnt + ' ...Before... ' + ij + ' ... ' + dam_data_arr.length);
}
//alert(dcnt + ' ... ' + eval(dam_name_etc.length) + ' ... ' + eval(dam_data_arr.length / 22) + ' ... ' + dam_name_etc[0]);
dam_name_etc.sort();
//alert(dcnt + ' ... ' + eval(dam_name_etc.length) + ' ... ' + eval(dam_data_arr.length / 22) + ' ... ' + dam_name_etc[0]);
var lastc='';
for (kk=0; kk<dam_name_etc.length; kk++) {
if (dam_name_etc[kk].split(';')[0] != lastc) {
lastc=dam_name_etc[kk].split(';')[0];
document.getElementById('us_state').innerHTML+="<option value='" + lastc + "'>" + givencodereturnname(lastc) + "</option>";
}
}
}
}
}
} else {
iois=document.getElementById('myiframe');
setTimeout(examine_dam_data, 2000);
}
}

function givencodereturnname(inc) {
if (state_lu.indexOf(inc) != -1) return state_lu[eval(-1 + state_lu.indexOf(inc))];
//alert(inc);
return '';
}

function cstate(tv) {
//alert(tv);
var datah='', things, vsihm=0, toihm=-1;
if (document.getElementById('ihm').value != '') toihm=eval(document.getElementById('ihm').value);
for (var kk=0; kk<dam_name_etc.length; kk++) {
if (dam_name_etc[kk].split(';')[0] == tv) {
if (toihm < 0 || vsihm < toihm) {
things=dam_name_etc[kk].split(';');
//dam_name_etc.push((dam_data_arr[eval(twenty + ij)] + ';' + dam_data_arr[eval(1 + ij)] + ';' + dam_data_arr[eval(2 + ij)] + ';' + dam_data_arr[eval(5 + ij)] + ',' + dam_data_arr[eval(4 + ij)] + ';' + dam_data_arr[eval(7 + ij)] + ';' + dam_data_arr[eval(8 + ij)] + ';' + dam_data_arr[eval(6 + ij)] + ';' + dam_data_arr[eval(14 + ij)] + ';' + dam_data_arr[eval(15 + ij)] + ';' + dam_data_arr[eval(16 + ij)] + ';' + dam_data_arr[eval(17 + ij)] + ';' + dam_data_arr[eval(18 + ij)] + ';' + dam_data_arr[eval(11 + ij)] + ';' + dam_data_arr[eval(12 + ij)] + ';' + dam_data_arr[eval(13 + ij)]));
if (things[3].indexOf(",") != -1 && things[3].indexOf(".") != -1 && things[3].indexOf("-") != -1) {
datah+=",[" + (things[3] + ",").replace(/0\,/g,",").replace(/0\,/g,",").replace(/0\,/g,",").replace(/0\,/g,",").replace(/0\,/g,",") + "~" + encodeURIComponent(dam_name_etc[kk].substring(3).replace(";" + things[3],"").replace(/;/g,",").replace(/\.00000000000/g,'.0')) + "~]";
}
}
vsihm++;
}
}
//alert(datah);
document.getElementById('title').value=givencodereturnname(tv) + " Dams";
document.getElementById('data').value=datah;
document.getElementById('smapif').click();
}

function repbarv() {
if (pbarv == 0 && eval(more_time) > 0) {
document.getElementById('us_state').innerHTML=document.getElementById('us_state').innerHTML.replace(" two ", " " + eval(eval(120 + eval(more_time) * 60) / 60) + " ");
document.getElementById('pbar').max=Math.floor(eval(120 + eval(more_time) * 60));

}
pbarv++;
if (pbarv < eval(document.getElementById('pbar').max)) {
setTimeout(repbarv,1000);
} else {
document.getElementById('more').style.display='block';
}
document.getElementById('pbar').value=pbarv;
}

</script>
</head>
<body style="background-color:yellow;" onload="document.getElementById('ihm').style.display=debug_block; repbarv(); document.getElementById('myiframe').src=document.URL.split('dams_usa.')[0] + 'dams00x020.html'; examine_dam_data();">
<table border=20 cellpadding=10 cellspacing=10>
<tbody>
<tr><td style='vertical-align:top;'>
<h1>Dams in United States of America</h1>
<h3>RJM Programming - February, 2017   <progress id='pbar' value="0" max="120"></progress>   <select style='display:none;' id='more' onchange=" location.href=(document.URL.split('#')[0].replace('more=','moxre=') + '&more=' + this.value).replace('.html&','.html?').replace('.htm&','.htm?'); "><option value=0>Optionally add minutes below to (default 2 minute) loading time (for more data) ...</option><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option></select></h3>
<h3>Thanks to: DATA.GOV <a target=_blank title='' href='https://catalog.data.gov/dataset?metadata_type=geospatial&page=13'>Major Dams of the United States - Direct Download</a><br>
Originator: National Atlas of the United States<br>
Publication_Date: 200603<br>
Title: Major Dams of the United States</h3>
<form onsubmit="document.getElementById('mapif').style.display='block'; return true;" style="display:none;" target="mapif" action="http://www.rjmprogramming.com.au/PHP/Map/map.php" method="POST">
<input type="hidden" value="Dams" id="title" name="title"></input>
<input type="hidden" value="['Lat'," name="label"></input>
<input type="hidden" value="'Lon','Name']" name="value"></input>
<input type='hidden' name='wouldlikeyoutoseekpermission' id='wouldlikeyoutoseekpermission' value=''></input>
<input type="hidden" value="" id="data" name="data"></input>
<input type="hidden" value="y" name="onclick"></input>
<input id="smapif" type="submit" value="Show" style="display:none;"></input>
</form>
<iframe style='display:none;width:600px;height:600px;' id='mapif' name='mapif' href='about:blank'></iframe>
</td><td>
<input style='display:none;' id='ihm' value='-1' type='number' step=1></input><!--br-->
<select size=53 id='us_state' onchange='cstate(this.value);'><option value=''>Please select US state of interest regarding its dams ... in about two minutes</option></select>
</td></tr>
</tbody>
</table>
<iframe style='display:none;' id='myiframe' href='about:blank'></iframe>
</body>
</html>