Wikipedia:WikiProject National Register of Historic Places/NRHPstatsJSbackups

/*  The following function only works on NRHP list articles; it calculates how many listings in the given county/city have articles, how many have images, and calculates percents.

function Shell { if (typeof(NRHPstatsAuto)!='undefined') { if (NRHPstatsAuto=='false') { if (wgPageName.search("National_Register_of_Historic_Places_listings") != -1) { addPortletLink('p-tb','javascript:ToggleDisp','NRHP Progress stats','t-NRHP','NRHP Progress stats',,); ToggleDisp; } else if (wgPageName == "Wikipedia:WikiProject_National_Register_of_Historic_Places/Progress") { addPortletLink('p-tb','javascript:ToggleDisp','Check stats','t-NRHP','Check stats',,); ToggleDisp; } else { return; }       } else { return; }   } else { return; } }

function ToggleDisp { var Disps = document.getElementsByClassName('NRHPdisp') if (Disps[0].style.display == '') { for (var i=0; i<Disps.length; i++) { Disps[i].style.display='none' }   } else { for (var i=0; i<Disps.length; i++) { Disps[i].style.display='' }   } }

function NumberListings { if (wgPageName.search("National_Register_of_Historic_Places_listings") == -1) return; var table=document.getElementsByClassName('wikitable sortable'); if (table == null) return;

for (var i=0; i<table.length; i++){ var rows=table[i].getElementsByTagName('tr'); var listings=rows.length-1 var images=table[i].getElementsByClassName('image');  // All images in articles have class="image" by default

var unarticled = 0 var stubs = 0 var NRISonly = 0 var unassessed = 0 var untagged = 0 var isNRHPtable = "yes" var tagged = "no" var title = "" var talktitle = "" var TitlesArray = new Array var Duplications = new Array

var UnassessedStr = "" var UntaggedStr = ""

for (var j=1; j= 5) { var link=tds[0].getElementsByTagName('a'); if (link[0].title.search("page does not exist") == -1) { title += "|"+link[0].title // build up string to find dabs talktitle += "|Talk:"+link[0].title // string for checking quality stats TitlesArray.push("Talk:"+link[0].title) Duplications.push(1) for (var k=0; k<TitlesArray.length-1; k++) {                     // if link is duplicated, count whatever if ("Talk:"+link[0].title==TitlesArray[k]) {                 // category it's in (stubs,unassessed,etc.) Duplications[Duplications.length-1] = Duplications[k] + 1 // multiple times below Duplications.splice(k,1); TitlesArray.splice(k,1); }                   }                } else { unarticled++  // redlinks are unarticled }           }            else { isNRHPtable = "no" // Some NRHP lists have tables at the top which show sections; ignore these }       }        if (isNRHPtable == "yes") { if (title.length>0) { title = title.substr(1,title.length-1)   // remove first "|" // query to find out if links are to dab pages var dabs=JSON.parse(                   $.ajax({ dataType: "json", url: mw.util.wikiScript('api'), data: { format: 'json', action: 'query', prop: 'categories', clcategories: 'Category:All disambiguation pages|Category:All articles sourced only to NRIS', cllimit: 'max', titles: title, redirects: 'true' },                       async:false })                   .responseText                ); var k=0 for (var page in dabs.query.pages) { if (dabs.query.pages[page].categories) { var start1=unarticled   // flags to only increment counts once per article var start2=NRISonly for (var category in talkpages.query.pages[page].categories) { if (dabs.query.pages[page].categories[category].title=="Category:All disambiguation pages") { if (start1!=unarticled) unarticled += Duplications[k]   // also count dab links as unarticled }                           if (dabs.query.pages[page].categories[category].title.indexOf("sourced only to NRIS")!=-1) { if (start2!=NRISonly) NRISonly += Duplications[k]       // count NRIS-only stubs tagged by bot }                       }                       }                k++ }

if (dabs.query.redirects) { // check talk pages of resolved redirects for (var r in dabs.query.redirects) { var tempstring = talktitle.split(dabs.query.redirects[r].from) talktitle = tempstring[0]+dabs.query.redirects[r].to+tempstring[1] }               }

// Now look at talk pages to find quality stats

talktitle = talktitle.substr(1,talktitle.length-1)   // remove first "|" var talkpages=JSON.parse(                   $.ajax({ dataType: "json", url: mw.util.wikiScript('api'), data: { format: 'json', action: 'query', prop: 'categories', cllimit: 'max', titles: talktitle, redirects: 'true' },                       async:false })                   .responseText                ); var k=0 for (var page in talkpages.query.pages) { var tagged = "no" if (talkpages.query.pages[page].categories) { var start1=stubs var start2=unassessed for (var category in talkpages.query.pages[page].categories) { if (start1!=stubs || start2!=unassessed) continue    // only increment once per article if (talkpages.query.pages[page].categories[category].title.indexOf("National Register")!=-1) { tagged = "yes" if (talkpages.query.pages[page].categories[category].title.indexOf("Stub")!=-1) { stubs += Duplications[k]  // account for duplicated links }                               if (talkpages.query.pages[page].categories[category].title.indexOf("Unassessed")!=-1) { unassessed += Duplications[k]  // account for duplicated links var str = talkpages.query.pages[page].title str = str.substr(5,str.length-5) UnassessedStr += str + "\n" }                           }                        }                    }                    if (tagged=="no") { untagged += Duplications[k]  // account for duplicated links var str = talkpages.query.pages[page].title str = str.substr(5,str.length-5) UntaggedStr += str + "\n" }                   k++ }           }            var bluelinks = listings - unarticled var startorhigher = bluelinks - stubs - unassessed - untagged var netQuality = Math.round((startorhigher+0.5*stubs-0.25*unassessed-0.5*untagged-0.75*NRISonly)/listings*1000)/10 if (netQuality<0) netQuality = 0 var percentIllustrated = images.length / listings percentIllustrated = Math.round (percentIllustrated * 1000) / 10 var percentArticled = bluelinks / listings percentArticled = Math.round (percentArticled * 1000) / 10 var percentStartorhigher = startorhigher / listings percentStartorhigher = Math.round (percentStartorhigher * 1000) / 10

// display yellow box var str1 = "Total Listings: " + listings str1 += " No. Illustrated: " + images.length + " (" + percentIllustrated               str1 += "%) No. Articled: " + bluelinks + " (" + percentArticled + "%)" var str2 = " No. Stubs: " + stubs var str3 = " No. Start+: " + startorhigher + " (" + percentStartorhigher + "%)" var str4 = " No. Unassessed: " + unassessed var str5 = " No. Untagged: " + untagged var str6 = " Net Quality Rating: " + netQuality + "%" var disp = document.createElement( 'div' )

disp.setAttribute('style', 'font-size:125%; background-color:yellow; width:250px; padding:5px') disp.setAttribute('class', 'NRHPdisp') table[i].parentNode.insertBefore(disp, table[i]) disp.innerHTML = str1 var Span2 = document.createElement('span') Span2.innerHTML = str2 disp.appendChild(Span2) var Span3 = document.createElement('span') Span3.innerHTML = str3 disp.appendChild(Span3) var Span4 = document.createElement('span') Span4.innerHTML = str4 if (unassessed > 0) { disp.appendChild(Span4) Span4.title = UnassessedStr.substr(0,UnassessedStr.length-1) Span4.style.color = 'red' }           var Span5 = document.createElement('span') Span5.innerHTML = str5 if (untagged > 0) { disp.appendChild(Span5) Span5.title = UntaggedStr.substr(0,UntaggedStr.length-1) Span5.style.color = 'red' }           var Span6 = document.createElement('span') Span6.innerHTML = str6 disp.appendChild(Span6) }   }    Shell; }

/*  The following function only triggers on the NRHP Progress page; it adds up totals for each state table as well as for the national table at the top of the page. It outputs a yellow box similar to NumberListings

function NRHPTotals { if (wgPageName != "Wikipedia:WikiProject_National_Register_of_Historic_Places/Progress") return; var table=document.getElementsByClassName('wikitable sortable'); for (var i=0; i<table.length; i++){ var rows=table[i].getElementsByTagName('tr'); var Total = 0 var TotalIllustrated = 0 var TotalArticled = 0 var TotalStubs = 0 var TotalStartPlus = 0 var TotalUnassessed = 0 var TotalUntagged = 0 var CountySub = 0 var CountyIllustratedSub = 0 var CountyArticledSub = 0 var CountyStubsSub = 0 var CountyStartPlusSub = 0 var CountyUnassessedSub = 0 var CountyUntaggedSub = 0 for (var j=1; j999 }               if (isNaN(parseFloat(tds[1].innerHTML))) { tds[1].style.backgroundColor="#FF9999" tds[1].title="Duplicate information needed!" } else { TotalIllustrated = TotalIllustrated - parseFloat(tds[1].innerHTML.replace(/,/g,'')) }               if (isNaN(parseFloat(tds[3].innerHTML))) { tds[3].style.backgroundColor="#FF9999" tds[3].title="Duplicate information needed!" } else { TotalArticled = TotalArticled - parseFloat(tds[3].innerHTML.replace(/,/g,'')) }               if (isNaN(parseFloat(tds[5].innerHTML))) { tds[5].style.backgroundColor="#FF9999" tds[5].title="Duplicate information needed!" } else { TotalStubs = TotalStubs - parseFloat(tds[5].innerHTML.replace(/,/g,'')) }               if (isNaN(parseFloat(tds[6].innerHTML))) { tds[6].style.backgroundColor="#FF9999" tds[6].title="Duplicate information needed!" } else { TotalStartPlus = TotalStartPlus - parseFloat(tds[6].innerHTML.replace(/,/g,'')) }               if (isNaN(parseFloat(tds[8].innerHTML))) { tds[8].style.backgroundColor="#FF9999" tds[8].title="Duplicate information needed!" } else { TotalUnassessed = TotalUnassessed - parseFloat(tds[8].innerHTML.replace(/,/g,'')) }               if (isNaN(parseFloat(tds[9].innerHTML))) { tds[9].style.backgroundColor="#FF9999" tds[9].title="Duplicate information needed!" } else { TotalUntagged = TotalUntagged - parseFloat(tds[9].innerHTML.replace(/,/g,'')) }           }            else { if (CountySub != 0) {   // if inside county sublists, add to subtotal or subtract if duplicates if (isNaN(parseFloat(tds[0].innerHTML))) { if (tds[0].innerHTML.search("ddddd") != -1) { if (isNaN(parseFloat(tds[3].innerHTML))) { // alert if no duplicates there tds[3].style.backgroundColor="#FF9999" tds[3].title="Duplicate information needed!" } else { CountySub = CountySub - parseFloat(tds[3].innerHTML.replace(/,/g,'')) }                           if (isNaN(parseFloat(tds[4].innerHTML))) { tds[4].style.backgroundColor="#FF9999" tds[4].title="Duplicate information needed!" } else { CountyIllustratedSub = CountyIllustratedSub - parseFloat(tds[4].innerHTML.replace(/,/g,'')) }                           if (isNaN(parseFloat(tds[6].innerHTML))) { tds[6].style.backgroundColor="#FF9999" tds[6].title="Duplicate information needed!" } else { CountyArticledSub = CountyArticledSub - parseFloat(tds[6].innerHTML.replace(/,/g,'')) }                           if (isNaN(parseFloat(tds[8].innerHTML))) { tds[8].style.backgroundColor="#FF9999" tds[8].title="Duplicate information needed!" } else { CountyStubsSub = CountyStubsSub - parseFloat(tds[8].innerHTML.replace(/,/g,'')) }                           if (isNaN(parseFloat(tds[9].innerHTML))) { tds[9].style.backgroundColor="#FF9999" tds[9].title="Duplicate information needed!" } else { CountyStartPlusSub = CountyStartPlusSub - parseFloat(tds[9].innerHTML.replace(/,/g,'')) }                           if (isNaN(parseFloat(tds[11].innerHTML))) { tds[11].style.backgroundColor="#FF9999" tds[11].title="Duplicate information needed!" } else { CountyUnassessedSub = CountyUnassessedSub - parseFloat(tds[11].innerHTML.replace(/,/g,'')) }                           if (isNaN(parseFloat(tds[12].innerHTML))) { tds[12].style.backgroundColor="#FF9999" tds[12].title="Duplicate information needed!" } else { CountyUntaggedSub = CountyUntaggedSub - parseFloat(tds[12].innerHTML.replace(/,/g,'')) }                       }                        else { if (!isNaN(parseFloat(tds[3].innerHTML))) { // skip if blank CountySub = CountySub + parseFloat(tds[3].innerHTML.replace(/,/g,'')) }                           if (!isNaN(parseFloat(tds[4].innerHTML))) { CountyIllustratedSub = CountyIllustratedSub + parseFloat(tds[4].innerHTML.replace(/,/g,'')) }                           if (!isNaN(parseFloat(tds[6].innerHTML))) { CountyArticledSub = CountyArticledSub + parseFloat(tds[6].innerHTML.replace(/,/g,'')) }                           if (!isNaN(parseFloat(tds[8].innerHTML))) { CountyStubsSub = CountyStubsSub + parseFloat(tds[8].innerHTML.replace(/,/g,'')) }                           if (!isNaN(parseFloat(tds[9].innerHTML))) { CountyStartPlusSub = CountyStartPlusSub + parseFloat(tds[9].innerHTML.replace(/,/g,'')) }                           if (!isNaN(parseFloat(tds[11].innerHTML))) { CountyUnassessedSub = CountyUnassessedSub + parseFloat(tds[11].innerHTML.replace(/,/g,'')) }                           if (!isNaN(parseFloat(tds[12].innerHTML))) { CountyUntaggedSub = CountyUntaggedSub + parseFloat(tds[12].innerHTML.replace(/,/g,'')) }                       }                    }                    else {    // if now at end of county sublists, total up everything var ScriptCountyPercentIllus = Math.round (CountyIllustratedSub/CountySub * 1000) / 10 var ScriptCountyPercentArt = Math.round (CountyArticledSub/CountySub * 1000) / 10 var ScriptCountyPercentStartPlus = Math.round (CountyStartPlusSub/CountySub * 1000) / 10

// check script output against what's entered var EnteredCountyTotal = parseFloat(tds[3].innerHTML.replace(/,/g,'')) var EnteredCountyIllusTotal = parseFloat(tds[4].innerHTML.replace(/,/g,'')) var EnteredCountyPercentIllus = parseFloat(tds[5].innerHTML.replace(/,/g,'')) var EnteredCountyArtTotal = parseFloat(tds[6].innerHTML.replace(/,/g,'')) var EnteredCountyPercentArt = parseFloat(tds[7].innerHTML.replace(/,/g,'')) var EnteredCountyStubs = parseFloat(tds[8].innerHTML.replace(/,/g,'')) var EnteredCountyStartPlus = parseFloat(tds[9].innerHTML.replace(/,/g,'')) var EnteredCountyPercentStartP = parseFloat(tds[10].innerHTML.replace(/,/g,'')) var EnteredCountyUnass = parseFloat(tds[11].innerHTML.replace(/,/g,'')) var EnteredCountyUntag = parseFloat(tds[12].innerHTML.replace(/,/g,'')) if (EnteredCountyTotal != CountySub && !isNaN(CountySub)) { tds[3].style.backgroundColor="#FF9999" tds[3].title="Script output: " + CountySub }                       if (EnteredCountyIllusTotal != CountyIllustratedSub && !isNaN(CountyIllustratedSub)) { tds[4].style.backgroundColor="#FF9999" tds[4].title="Script output: " + CountyIllustratedSub }                       if (EnteredCountyPercentIllus != ScriptCountyPercentIllus && !isNaN(ScriptCountyPercentIllus)) { tds[5].style.backgroundColor="#FF9999" tds[5].title="Script output: " + ScriptCountyPercentIllus + "%" }                       if (EnteredCountyArtTotal != CountyArticledSub && !isNaN(CountyArticledSub)) { tds[6].style.backgroundColor="#FF9999" tds[6].title="Script output: " + CountyArticledSub }                       if (EnteredCountyPercentArt != ScriptCountyPercentArt && !isNaN(ScriptCountyPercentArt)) { tds[7].style.backgroundColor="#FF9999" tds[7].title="Script output: " + ScriptCountyPercentArt + "%" }                       if (EnteredCountyStubs != CountyStubsSub && !isNaN(CountyStubsSub)) { tds[8].style.backgroundColor="#FF9999" tds[8].title="Script output: " + CountyStubsSub }                       if (EnteredCountyStartPlus != CountyStartPlusSub && !isNaN(CountyStartPlusSub)) { tds[9].style.backgroundColor="#FF9999" tds[9].title="Script output: " + CountyStartPlusSub }                       if (EnteredCountyPercentStartP != ScriptCountyPercentStartPlus && !isNaN(ScriptCountyPercentStartPlus)) { tds[10].style.backgroundColor="#FF9999" tds[10].title="Script output: " + ScriptCountyPercentStartPlus + "%" }                       if (EnteredCountyUnass != CountyUnassessedSub && !isNaN(CountyUnassessedSub)) { tds[11].style.backgroundColor="#FF9999" tds[11].title="Script output: " + CountyUnassessedSub }                       if (EnteredCountyUntag != CountyUntaggedSub && !isNaN(CountyUntaggedSub)) { tds[12].style.backgroundColor="#FF9999" tds[12].title="Script output: " + CountyUntaggedSub }

// update total then reset subtotals Total = Total + CountySub TotalIllustrated = TotalIllustrated + CountyIllustratedSub TotalArticled = TotalArticled + CountyArticledSub TotalStubs = TotalStubs + CountyStubsSub TotalStartPlus = TotalStartPlus + CountyStartPlusSub TotalUnassessed = TotalUnassessed + CountyUnassessedSub TotalUntagged = TotalUntagged + CountyUntaggedSub CountySub = 0 CountyIllustratedSub = 0 CountyArticledSub = 0 CountyStubsSub = 0 CountyStartPlusSub = 0 CountyUnassessedSub = 0 CountyUntaggedSub = 0 }               }                else {   // regular counties if (isNaN(parseFloat(tds[0].innerHTML)) && tds.length == 13) { // if first in line of sublists, begin subtotal if (!isNaN(parseFloat(tds[tds.length-10].innerHTML))) { CountySub = parseFloat(tds[tds.length-10].innerHTML.replace(/,/g,'')) }                       if (!isNaN(parseFloat(tds[tds.length-9].innerHTML))) { CountyIllustratedSub = parseFloat(tds[tds.length-9].innerHTML.replace(/,/g,'')) }                       if (!isNaN(parseFloat(tds[tds.length-7].innerHTML))) { CountyArticledSub = parseFloat(tds[tds.length-7].innerHTML.replace(/,/g,'')) }                       if (!isNaN(parseFloat(tds[tds.length-5].innerHTML))) { CountyStubsSub = parseFloat(tds[tds.length-5].innerHTML.replace(/,/g,'')) }                       if (!isNaN(parseFloat(tds[tds.length-4].innerHTML))) { CountyStartPlusSub = parseFloat(tds[tds.length-4].innerHTML.replace(/,/g,'')) }                       if (!isNaN(parseFloat(tds[tds.length-2].innerHTML))) { CountyUnassessedSub = parseFloat(tds[tds.length-2].innerHTML.replace(/,/g,'')) }                       if (!isNaN(parseFloat(tds[tds.length-1].innerHTML))) { CountyUntaggedSub = parseFloat(tds[tds.length-1].innerHTML.replace(/,/g,'')) }                   }                    else { var RowTotal = parseFloat(tds[tds.length-10].innerHTML.replace(/,/g,'')) if (!isNaN(RowTotal)) Total = Total + RowTotal                                   // skip if blank var RowIllustrated = parseFloat(tds[tds.length-9].innerHTML.replace(/,/g,'')) if (!isNaN(RowIllustrated)) TotalIllustrated = TotalIllustrated + RowIllustrated var RowArticled = parseFloat(tds[tds.length-7].innerHTML.replace(/,/g,'')) if (!isNaN(RowArticled)) TotalArticled = TotalArticled + RowArticled var RowStubs = parseFloat(tds[tds.length-5].innerHTML.replace(/,/g,'')) if (!isNaN(RowStubs)) TotalStubs = TotalStubs + RowStubs var RowStartPlus = parseFloat(tds[tds.length-4].innerHTML.replace(/,/g,'')) if (!isNaN(RowStartPlus)) TotalStartPlus = TotalStartPlus + RowStartPlus var RowUnassessed = parseFloat(tds[tds.length-2].innerHTML.replace(/,/g,'')) if (!isNaN(RowUnassessed)) TotalUnassessed = TotalUnassessed + RowUnassessed var RowUntagged = parseFloat(tds[tds.length-1].innerHTML.replace(/,/g,'')) if (!isNaN(RowUntagged)) TotalUntagged = TotalUntagged + RowUntagged

// check script against what's entered var EnteredPercentIllustrated = parseFloat(tds[tds.length-8].innerHTML.replace(/,/g,'')) var ScriptPercentIllustrated = Math.round(RowIllustrated/RowTotal*1000)/10 var EnteredPercentArticled = parseFloat(tds[tds.length-6].innerHTML.replace(/,/g,'')) var ScriptPercentArticled = Math.round(RowArticled/RowTotal*1000)/10 var EnteredPercentStartPlus = parseFloat(tds[tds.length-3].innerHTML.replace(/,/g,'')) var ScriptPercentStartPlus = Math.round(RowStartPlus/RowTotal*1000)/10 if (EnteredPercentIllustrated != ScriptPercentIllustrated && !isNaN(ScriptPercentIllustrated)) { tds[tds.length-8].style.backgroundColor="#FF9999" tds[tds.length-8].title="Script output: " + ScriptPercentIllustrated + "%" }                       if (EnteredPercentArticled != ScriptPercentArticled && !isNaN(ScriptPercentArticled)) { tds[tds.length-6].style.backgroundColor="#FF9999" tds[tds.length-6].title="Script output: " + ScriptPercentArticled + "%" }                       if (EnteredPercentStartPlus != ScriptPercentStartPlus && !isNaN(ScriptPercentStartPlus)) { tds[tds.length-3].style.backgroundColor="#FF9999" tds[tds.length-3].title="Script output: " + ScriptPercentStartPlus + "%" }                   }                }            }        }

// output totals for each state in yellow box var ScriptTotalPercentIllustrated = Math.round(TotalIllustrated/Total*1000)/10 var ScriptTotalPercentArticled = Math.round(TotalArticled/Total*1000)/10 var ScriptTotalPercentStartPlus = Math.round(TotalStartPlus/Total*1000)/10 var str = "Total Listings: " + Total str = str + " No. Illustrated: " + TotalIllustrated + " (" + ScriptTotalPercentIllustrated           str = str + "%) No. Articled: " + TotalArticled + " (" + ScriptTotalPercentArticled + "%)" str = str + " No. Stubs: " + TotalStubs + " No. Start+: " + TotalStartPlus + " ("           str = str + ScriptTotalPercentStartPlus + "%) No. Unassessed: " + TotalUnassessed str = str + " No. Untagged: " + TotalUntagged var disp = document.createElement( 'div' ) disp.setAttribute('style', 'font-size:125%; background-color:yellow; width:240px; padding:5px') disp.setAttribute('class', 'NRHPdisp') table[i].parentNode.insertBefore(disp, table[i]) disp.innerHTML = str

// check script totals against what's entered var Totaltds=rows[rows.length-1].getElementsByTagName('th') var EnteredTotal = parseFloat(Totaltds[1].innerHTML.replace(/,/g,'')) var EnteredTotalIllustrated = parseFloat(Totaltds[2].innerHTML.replace(/,/g,'')) var EnteredPercentIllustrated = parseFloat(Totaltds[3].innerHTML.replace(/,/g,'')) var EnteredTotalArticled = parseFloat(Totaltds[4].innerHTML.replace(/,/g,'')) var EnteredPercentArticled = parseFloat(Totaltds[5].innerHTML.replace(/,/g,'')) var EnteredStubs = parseFloat(Totaltds[6].innerHTML.replace(/,/g,'')) var EnteredStartPlus = parseFloat(Totaltds[7].innerHTML.replace(/,/g,'')) var EnteredPercentStartPlus = parseFloat(Totaltds[8].innerHTML.replace(/,/g,'')) var EnteredUnassessed = parseFloat(Totaltds[9].innerHTML.replace(/,/g,'')) var EnteredUntagged = parseFloat(Totaltds[10].innerHTML.replace(/,/g,'')) if (EnteredTotal != Total && !isNaN(Total)) { Totaltds[1].style.backgroundColor="#FF9999" Totaltds[1].title="Script output: " + Total }       if (EnteredTotalIllustrated != TotalIllustrated && !isNaN(TotalIllustrated)) { Totaltds[2].style.backgroundColor="#FF9999" Totaltds[2].title="Script output: " + TotalIllustrated }       if (EnteredPercentIllustrated != ScriptTotalPercentIllustrated && !isNaN(ScriptTotalPercentIllustrated)) { Totaltds[3].style.backgroundColor="#FF9999" Totaltds[3].title="Script output: " + ScriptTotalPercentIllustrated + "%" }       if (EnteredTotalArticled != TotalArticled && !isNaN(TotalArticled)) { Totaltds[4].style.backgroundColor="#FF9999" Totaltds[4].title="Script output: " + TotalArticled }       if (EnteredPercentArticled != ScriptTotalPercentArticled && !isNaN(ScriptTotalPercentArticled)) { Totaltds[5].style.backgroundColor="#FF9999" Totaltds[5].title="Script output: " + ScriptTotalPercentArticled + "%" }       if (EnteredStubs != TotalStubs && !isNaN(TotalStubs)) { Totaltds[6].style.backgroundColor="#FF9999" Totaltds[6].title="Script output: " + TotalStubs }       if (EnteredStartPlus != TotalStartPlus && !isNaN(TotalStartPlus)) { Totaltds[7].style.backgroundColor="#FF9999" Totaltds[7].title="Script output: " + TotalStartPlus }       if (EnteredPercentStartPlus != ScriptTotalPercentStartPlus && !isNaN(ScriptTotalPercentStartPlus)) { Totaltds[8].style.backgroundColor="#FF9999" Totaltds[8].title="Script output: " + ScriptTotalPercentStartPlus + "%" }       if (EnteredUnassessed != TotalUnassessed && !isNaN(TotalUnassessed)) { Totaltds[9].style.backgroundColor="#FF9999" Totaltds[9].title="Script output: " + TotalUnassessed }       if (EnteredUntagged != TotalUntagged && !isNaN(TotalUntagged)) { Totaltds[10].style.backgroundColor="#FF9999" Totaltds[10].title="Script output: " + TotalUntagged }

// check national table against what's entered in each state table if (i != 0) { var StateRows = table[0].getElementsByTagName('tr') var ThisStateRow = StateRows[i].getElementsByTagName('td') var StateTableTotal = parseFloat(ThisStateRow[1].innerHTML.replace(/,/g,'')) var StateTableIllustrated = parseFloat(ThisStateRow[2].innerHTML.replace(/,/g,'')) var StateTablePercentIllustrated = parseFloat(ThisStateRow[3].innerHTML.replace(/,/g,'')) var StateTableArticled = parseFloat(ThisStateRow[4].innerHTML.replace(/,/g,'')) var StateTablePercentArticled = parseFloat(ThisStateRow[5].innerHTML.replace(/,/g,'')) var StateTableStubs = parseFloat(ThisStateRow[6].innerHTML.replace(/,/g,'')) var StateTableStartPlus = parseFloat(ThisStateRow[7].innerHTML.replace(/,/g,'')) var StateTablePercentStartPlus = parseFloat(ThisStateRow[8].innerHTML.replace(/,/g,'')) var StateTableUnassessed = parseFloat(ThisStateRow[9].innerHTML.replace(/,/g,'')) var StateTableUntagged = parseFloat(ThisStateRow[10].innerHTML.replace(/,/g,'')) if (EnteredTotal != StateTableTotal) { ThisStateRow[1].style.backgroundColor="#FF9999" ThisStateRow[1].title="Does not match table below! (" + EnteredTotal + ")" }           if (EnteredTotalIllustrated != StateTableIllustrated) { ThisStateRow[2].style.backgroundColor="#FF9999" ThisStateRow[2].title="Does not match table below! (" + EnteredTotalIllustrated + ")" }           if (EnteredPercentIllustrated != StateTablePercentIllustrated) { ThisStateRow[3].style.backgroundColor="#FF9999" ThisStateRow[3].title="Does not match table below! (" + EnteredPercentIllustrated + "%)" }           if (EnteredTotalArticled != StateTableArticled) { ThisStateRow[4].style.backgroundColor="#FF9999" ThisStateRow[4].title="Does not match table below! (" + EnteredTotalArticled + ")" }           if (EnteredPercentArticled != StateTablePercentArticled) { ThisStateRow[5].style.backgroundColor="#FF9999" ThisStateRow[5].title="Does not match table below! (" + EnteredPercentArticled + "%)" }           if (EnteredStubs != StateTableStubs) { ThisStateRow[6].style.backgroundColor="#FF9999" ThisStateRow[6].title="Does not match table below! (" + EnteredStubs + ")" }           if (EnteredStartPlus != StateTableStartPlus) { ThisStateRow[7].style.backgroundColor="#FF9999" ThisStateRow[7].title="Does not match table below! (" + EnteredStartPlus + ")" }           if (EnteredPercentStartPlus != StateTablePercentStartPlus) { ThisStateRow[8].style.backgroundColor="#FF9999" ThisStateRow[8].title="Does not match table below! (" + EnteredPercentStartPlus + "%)" }           if (EnteredUnassessed != StateTableUnassessed) { ThisStateRow[9].style.backgroundColor="#FF9999" ThisStateRow[9].title="Does not match table below! (" + EnteredUnassessed + ")" }           if (EnteredUntagged != StateTableUntagged) { ThisStateRow[10].style.backgroundColor="#FF9999" ThisStateRow[10].title="Does not match table below! (" + EnteredUntagged + ")" }       }    }    Shell; }

addOnloadHook(NumberListings); addOnloadHook(NRHPTotals);