// ==UserScript==
// @name                Yagisan's NW Exploration Badge Sorter
// @namespace           
// @description         Scans the list of badges and determines which exploration badges are missing - Includes locations.
// @include             http://www.nexuswar.com/characters/view.do?characterID=*
// @include             http://nexuswar.com/characters/view.do?characterID=*
// @include             http://www.nexuswar.net/characters/view.do?characterID=*
// @include             http://nexuswar.net/characters/view.do?characterID=*
// ==/UserScript==

// exploration badge list
var badgelist = new Array(61);
var badgelocation = new Array(61);

badgelist[0] = "All Hope Abandon";
badgelist[1] = "All-Seeing";
badgelist[2] = "Ascension";
badgelist[3] = "Big Bang";
badgelist[4] = "Boiling Caldera";
badgelist[5] = "Bosun's Mate";
badgelist[6] = "Bulletridden";
badgelist[7] = "Callihan's";
badgelist[8] = "Cannonball";
badgelist[9] = "Captain Clucky's";
badgelist[10] = "Cromahl-Hult";
badgelist[11] = "End of the Line";
badgelist[12] = "Entombed";
badgelist[13] = "Eresius' Rest";
badgelist[14] = "Eternal Vigil";
badgelist[15] = "Fall of the Watcher";
badgelist[16] = "Favored of Goros";
badgelist[17] = "Flight 19";
badgelist[18] = "Fortified";
badgelist[19] = "Galmath";
badgelist[20] = "Garageman";
badgelist[21] = "Gearsmith";
badgelist[22] = "High Noon";
badgelist[23] = "Ineffable";
badgelist[24] = "Iron Juggernaut";
badgelist[25] = "Ironclad";
badgelist[26] = "Kafa-El's Fall";
badgelist[27] = "Land Ho!";
badgelist[28] = "Liberation";
badgelist[29] = "Miss Elspeth's Lesson";
badgelist[30] = "Nightengale Murder";
badgelist[31] = "Oh, So Thirsty";
badgelist[32] = "One of the Gang";
badgelist[33] = "Paint the Town Red";
badgelist[34] = "Prime Ministries";
badgelist[35] = "Prospects are Good";
badgelist[36] = "Reflective";
badgelist[37] = "Ridley House";
badgelist[38] = "Rudolphus";
badgelist[39] = "Sabotage";
badgelist[40] = "Serial Killer";
badgelist[41] = "Shades of Grey";
badgelist[42] = "Skull Cult";
badgelist[43] = "Snowbound";
badgelist[44] = "Splinter of Chaos";
badgelist[45] = "Static";
badgelist[46] = "Sundial";
badgelist[47] = "The Crypt of Maeval";
badgelist[48] = "The Dead Juggernaut";
badgelist[49] = "The End of Haldos";
badgelist[50] = "The Laughter Has Died";
badgelist[51] = "The Nephilim";
badgelist[52] = "The Pulse";
badgelist[53] = "The Silent Battlefield";
badgelist[54] = "The Silent Voice";
badgelist[55] = "The Swinging Body";
badgelist[56] = "Thrown From Horseback";
badgelist[57] = "Ticker-Tape";
badgelist[58] = "Uncooked";
badgelist[59] = "Uriel's Posting";
badgelist[60] = "Wretched Angel";

badgelocation[0] = "4,4 <img src=http://www.nexuswar.com/r/i/map/planes/stygia.png>Stygia, Outside";
badgelocation[1] = "17,15 <img src=http://www.nexuswar.com/r/i/map/planes/paradise.png>Paradise, Inside";
badgelocation[2] = "1,29 <img src=http://www.nexuswar.com/r/i/map/planes/nimbus.png>The Nimbus, Outside";
badgelocation[3] = "9,33 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[4] = "75,31 <img src=http://www.nexuswar.com/r/i/map/planes/purgatorio.png>Purgatorio, Outside";
badgelocation[5] = "51,54 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Inside";
badgelocation[6] = "26,46 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Inside";
badgelocation[7] = "34,26 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[8] = "28,6 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[9] = "15,23 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Inside";
badgelocation[10] = "6,55 <img src=http://www.nexuswar.com/r/i/map/planes/purgatorio.png>Purgatorio, Outside";
badgelocation[11] = "23,82 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[12] = "7,2 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[13] = "89,16 <img src=http://www.nexuswar.com/r/i/map/planes/purgatorio.png>Purgatorio, Outside";
badgelocation[14] = "83, 43 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[15] = "28,11 <img src=http://www.nexuswar.com/r/i/map/planes/stygia.png>Stygia, Outside";
badgelocation[16] = "56,54 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[17] = "2,20 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[18] = "42,38 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[19] = "3,27 <img src=http://www.nexuswar.com/r/i/map/planes/purgatorio.png>Purgatorio, Outside";
badgelocation[20] = "37,9 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[21] = "13,14 <img src=http://www.nexuswar.com/r/i/map/planes/nimbus.png>The Nimbus, Outside";
badgelocation[22] = "50,37 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[23] = "28,17 <img src=http://www.nexuswar.com/r/i/map/planes/warrens.png>Stygian Warrens, Outside";
badgelocation[24] = "11,2 <img src=http://www.nexuswar.com/r/i/map/planes/stygia.png>Stygia, Outside";
badgelocation[25] = "8,15 <img src=http://www.nexuswar.com/r/i/map/planes/warrens.png>Stygian Warrens, Outside";
badgelocation[26] = "41,17 <img src=http://www.nexuswar.com/r/i/map/planes/stygia.png>Stygia, Outside";
badgelocation[27] = "2,74 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[28] = "37,66 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[29] = "54,34 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Inside";
badgelocation[30] = "18,25 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[31] = "51,37 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[32] = "31,70 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Inside";
badgelocation[33] = "61,16 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[34] = "17,61 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Inside";
badgelocation[35] = "41,66 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[36] = "21,37 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[37] = "3,19 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Inside";
badgelocation[38] = "20,38 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[39] = "42,43 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Outside";
badgelocation[40] = "15,10 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[41] = "28,45 <img src=http://www.nexuswar.com/r/i/map/planes/purgatorio.png>Purgatorio, Outside";
badgelocation[42] = "3,7 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[43] = "31,41 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Inside";
badgelocation[44] = "42,8 <img src=http://www.nexuswar.com/r/i/map/planes/warrens.png>Stygian Warrens, Outside";
badgelocation[45] = "23,18 <img src=http://www.nexuswar.com/r/i/map/planes/nimbus.png>The Nimbus, Outside";
badgelocation[46] = "15,34 <img src=http://www.nexuswar.com/r/i/map/planes/nimbus.png>The Nimbus, Outside";
badgelocation[47] = "19,76 <img src=http://www.nexuswar.com/r/i/map/planes/purgatorio.png>Purgatorio, Outside";
badgelocation[48] = "9,10 <img src=http://www.nexuswar.com/r/i/map/planes/paradise.png>Paradise, Outside";
badgelocation[49] = "26,13 <img src=http://www.nexuswar.com/r/i/map/planes/purgatorio.png>Purgatorio, Inside";
badgelocation[50] = "13,24 <img src=http://www.nexuswar.com/r/i/map/planes/nimbus.png>The Nimbus, Outside";
badgelocation[51] = "26,8 <img src=http://www.nexuswar.com/r/i/map/planes/stygia.png>Stygia, Outside";
badgelocation[52] = "46,6 <img src=http://www.nexuswar.com/r/i/map/planes/warrens.png>Stygian Warrens, Outside";
badgelocation[53] = "4,4 <img src=http://www.nexuswar.com/r/i/map/planes/paradise.png>Paradise, Outside";
badgelocation[54] = "43,78 <img src=http://www.nexuswar.com/r/i/map/planes/purgatorio.png>Purgatorio, Outside";
badgelocation[55] = "20,61 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[56] = "27,62 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[57] = "42,6 <img src=http://www.nexuswar.com/r/i/map/planes/nifleheim.png>Nifleheim, Inside";
badgelocation[58] = "21,45 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";
badgelocation[59] = "12,32 <img src=http://www.nexuswar.com/r/i/map/planes/paradise.png>Paradise, Outside";
badgelocation[60] = "59,54 <img src=http://www.nexuswar.com/r/i/map/planes/valhalla.png>Valhalla, Outside";

var insertbadgelist;
var badgecount = 0;


var badgenode = document.getElementById("profilevitals");
var userbadgelist = badgenode.innerHTML;

function checkbadges() {
  // no badges
  if (userbadgelist.search(/None/) != -1) {
    return;
  }

  insertbadgelist = "<p></p><strong>Yagisan's Exploration Badge Sorter - Updated 5 June 2008 - 9:56pm</strong></br><ul>";
  for (i=0;i<badgelist.length;i++) {
    if (userbadgelist.indexOf(badgelist[i]) != -1) {
        insertbadgelist += "<li style=\"color: #aaaaaa;\"><del>"+badgelist[i]+"</del></li>";
        badgecount++;
    }
    else {
      insertbadgelist += "<li>"+badgelist[i]+"<em> located at <strong>"+badgelocation[i]+"</strong></em></li>";
    }
  }
  insertbadgelist += "</ul>"+badgecount+" out of 61 Exploration Badges";
  insertbadgelist += "<p></p>";
  insertbadgelist += "<p>If this script has been useful to you, please consider donating via paypal.<form action='https://www.paypal.com/cgi-bin/webscr' method='post'><input type='hidden' name='cmd' value='_s-xclick'><input type='image' src='https://www.paypal.com/en_AU/i/btn/btn_donate_SM.gif' border='0' name='submit' alt='Pay here via PayPal'><img alt='' border='0' src='https://www.paypal.com/en_AU/i/scr/pixel.gif' width='1' height='1'><input type='hidden' name='encrypted' value='-----BEGIN PKCS7-----MIIHXwYJKoZIhvcNAQcEoIIHUDCCB0wCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBasMz/JUGRi1KqzCd4SsKwzAwP+gEE3E8F/WS+lT2npk7LT4THyle1hEAInTu1U6hwmFTfTpirngAMcQ2RrFXG3XP6UCPri4cN1ssZ6BNaKSn5R/ya8HlMzZXN6SZbHcYbsEYXJC7A4tHzwMvc5TWP+N/m5VmBCJE0B/ym6IqyjzELMAkGBSsOAwIaBQAwgdwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIj1Jmp+Q1xmKAgbgwUPTHl6aJj//38u3h84MrectjhiORY39d5mPLwBluxg5gCY1VGwEaXbbxWxtnKAl70cw0DSWb77+lLbn8O4tj5lNr8egKgc8Bvs9P/Gr99iw8Iia27N+TGUxsvCeG4qGa45ddi8Syn+E5OqMNbAPe5QrfFEk4BloNJNFYMNNfAfHBdwkV9HT+wc6T0zKvHfmnHYGqw3TRijRcE15CaQHpy635/sflts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