// LSN Web Interface Fixer // version 1.41 // 03/12/2005 // Copyright (c) 2005, Rob Sharp // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html // // -------------------------------------------------------------------- // // This is a Greasemonkey user script. To install it, you need // Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/ // Then restart Firefox and revisit this script. // Under Tools, there will be a new menu item to "Install User Script". // Accept the default configuration and install. // // To uninstall, go to Tools/Manage User Scripts, // select "LSN Web Interface Fixer", and click Uninstall. // // This script has been tested in Firefox V 1.0.7 and Greasmonkey 0.5.3 // // Version History // // 1.0 Initial release // Merged functionailty from the two old Game Status Hider scripts // and removed reliance on Platypus as the latest Greasemonkey // release causes problems with the Platypus scripts. // // 1.1 Added additional URLs to ensure Map selection code is run on all // Challenge types. // // 1.2 Add ability to add custom Tournament text. // // 1.3 Map name is now linked to Count Zeros rather excellent Map HQ. // // 1.4 Added new maps City Dump, Crater, Badlands, Big Brother, // Depot Ruins, Weird Science, and Santas Grotto. // // 1.41 Corrected typo on a map. // // Features // -------- // // Hides the Win/Lose/Draw status of finished games to prevent spoiling // a close final turn. // // Hides League Point changes of finished games on main screen // // Hides the sections of the game detail page that tell you the // game result, final score and League Point changes. // // Allows you to view the last turn/wholegame for games in Waiting status. // // When issuing a direct Player Challenge, if you specify a map it will // automatically select the radio button to play that map. Eliminates all // those "I'm sure I picked a different map" moments. // // Allows you to deploy early on games while waiting for your opponent // to deploy. *Not tested fully* // // Allows you to add your own description to non-tourney games by // clicking on the Tournament section of the screen. // // -------------------------------------------------------------------- // ==UserScript== // @name LSN Web Interface Fixer // @description Fixes various aspects of the LSN Web Interface // @namespace http://www.boringbutgood.com/blog/archive/lsn/ // @include http://codo-linux1.bytemark.co.uk* // ==/UserScript== var ident = document.createElement("div"); ident.innerHTML = '
' + ' This page has been modifed by the LSN' + ' Web Interface Fixer :- Version 1.41
' + '' + 'Mail me with any comments or queries.
'; document.body.appendChild(ident, document.body.firstChild); var allLinks, alltrs, alltabs, allsels, alltourns, alltourns2, thistorun2, thistourn, thisLink, thistr, thistab, thissel, altText, replacement, href, pageAddr, name, newsel, game, gametext; pageAddr = window.location.href; if (pageAddr.match(/GameManager/)){ maplink() allLinks = document.evaluate( '//a[@href]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allLinks.snapshotLength; i++) { thisLink = allLinks.snapshotItem(i); href = thisLink.href; if (/finished/.test(thisLink)) { // GM_log('Found a finished game'); thisLink.innerHTML = "GAME OVER" thisLink.parentNode.replaceChild(thisLink, thisLink); } else { if (/tstatus/.test(thisLink)) { // GM_log('Found a current game'); if (/tstatus=wait/.test(thisLink)) { // GM_log('MAched on tstatus=wait') href = href.replace(/tstatus=wait/g, 'tstatus=turn'); if (href != thisLink.href) { thisLink.href = href; } } } } } // Now we blank out the score for any finished games alltrs = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[5]/TBODY[1]/TR/TD[6]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < alltrs.snapshotLength; i++) { thistr = alltrs.snapshotItem(i); thistr.innerHTML = "-" thistr.parentNode.replaceChild(thistr, thistr); } // Allow manual entry of Tourney details. alltourns = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[4]/TBODY[1]/TR/TD[1]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < alltourns.snapshotLength; i++) { thistourn = alltourns.snapshotItem(i); game = thistourn.innerHTML y = i+2 alltourns2 = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[4]/TBODY[1]/TR[' + y + ']/TD[4]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var ii = 0; ii < alltourns2.snapshotLength; ii++) { thistourn2 = alltourns2.snapshotItem(ii); if (thistourn2.innerHTML == "- ") { thistourn2.innerHTML = GM_getValue(game, "-"); thistourn2.addEventListener('click', settext(game), true); } GM_log(thistourn2.innerHTML); } } alltourns = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[5]/TBODY[1]/TR/TD[1]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < alltourns.snapshotLength; i++) { thistourn = alltourns.snapshotItem(i); game = thistourn.innerHTML y = i+2 alltourns2 = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[5]/TBODY[1]/TR[' + y + ']/TD[4]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var ii = 0; ii < alltourns2.snapshotLength; ii++) { thistourn2 = alltourns2.snapshotItem(ii); if (thistourn2.innerHTML == "- ") { thistourn2.innerHTML = GM_getValue(game, "-"); thistourn2.addEventListener('click', settext(game), true); } GM_log(thistourn2.innerHTML); } } } // End of GameManager address match else // now we remove the tables on the Finished game page to hide End of game scores { if (pageAddr.match(/tstatus=finished/)){ alltrs = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[3]/TBODY[1]/TR[1]/TD/TABLE[1]/TBODY[1]/TR[5]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < alltrs.snapshotLength; i++) { thistr = alltrs.snapshotItem(i); thistr.parentNode.removeChild(thistr); } alltabs = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[1]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < alltabs.snapshotLength; i++) { thistab = alltabs.snapshotItem(i); thistab.parentNode.removeChild(thistab); } } else { if ((pageAddr.match(/PlayerChallengeScenario/)) || (pageAddr.match(/NewOpenChallenge/))){ allsels = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/FORM[1]/TABLE[1]/TBODY[1]/TR[2]/TD[2]/SELECT[1]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allsels.snapshotLength; i++) { thissel = allsels.snapshotItem(i); thissel.setAttribute('onChange', "form.map_type[4].checked=true"); } } } ; } function settext(game) { return function(evt) { gametext = prompt("Enter Tournament description for game " + game); GM_setValue(game, gametext); }; } function maplink() { var maps, links, gamemaps, thismap, alt, replacement; // Map names seem to be padded to 30 chars on the Web Interface maps = ["Access Control ", "Airport ", "Alcatraz ", "Area69 ", "Arena ", "Armoury ", "Assault Craft ", "Attrition ", "Bad Neighborhood ", "Badlands ", "Bank Job ", "Barracks ", "Battle Royale ", "Battlefront ", "Beach Head ", "Beach Strike ", "Behind Schedule ", "Berlin Wall ", "Big Brother ", "Bio Dome ", "Biohazard ", "Blast Radius ", "Boulevard ", "Bunker ", "Bunker Defence ", "Burr Wood ", "Car Park ", "Casa Regnix ", "Cavern ", "Chicken Run ", "City Block ", "City Dump ", "Clash ", "Colony ", "Compound ", "Cover ", "Crater ", "Crossroads ", "Cursed Houses ", "DMZ ", "Danger Room ", "Data Bank ", "Depot ", "Depot Ruins ", "Desert ", "Desolation ", "Devils Gate ", "Docks ", "Downtown ", "Dust ", "Elixir ", "Encounter ", "Enemy HQ ", "English Suburb ", "Estate ", "Face ", "Factory ", "Football ", "Forest ", "Front Line ", "Frontier ", "Garden Hopper ", "Gasoline ", "Gauntlet ", "Genesis ", "Gladiator ", "Grind ", "HQ War ", "High Command ", "Holding Cell ", "Hotel ", "Inferno ", "Infiltration ", "Italy ", "Jungle Fever ", "Labs ", "Labyrinth ", "Laser Bowl ", "Long Shot ", "Lost Highway ", "Manors ", "Mars Embassy ", "Maze ", "Middle of Nowhere ", "Milton Keynes ", "Moon Base ", "Narrow ", "Newtown ", "Nexus ", "No Mans Land ", "Onslaught ", "Outpost ", "Pacman ", "Panic Room ", "Paranoia ", "Phaze ", "Prison Break ", "Quarantine ", "Rat Race ", "Rear Entry ", "Reclamation ", "Relic ", "Renovation ", "Restaurant ", "Ring Road ", "Riverbed ", "Roadblock ", "Robin Hood ", "Ruins ", "Santas Grotto ", "Schools Out ", "Scorched Earth ", "Scrum ", "Shuttle Rescue ", "Siege ", "Signs ", "Sniper Duel ", "Space For Rent ", "St Pauls ", "Stalker ", "Strange Mix ", "Stronghold ", "Sublevel ", "Suburbia ", "Switchback ", "Tangle ", "Tarantula ", "The Cage ", "The Castle of Lord X ", "The Stand ", "Three Little Pigs ", "Tic Tac Toe ", "Titan Factory ", "Titan Hydroponics ", "Titan Minehead ", "Titan Power Grid ", "Titan Spaceport ", "Training Camp ", "Trains ", "UFO ", "Urban Assault ", "Vantage ", "Village ", "Warehouse ", "Warehouse Jungle ", "Waste Complex ", "Weapons Testing ", "Weird Science ", "Wild West "]; links = ["http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/access%20control.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/airport.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/alcatraz.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/area69.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/arena.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/armoury.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/assault%20craft.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/attrition.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/bad%20neighborhood.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/badlands.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/bank%20job.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/barracks.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/battle%20royale.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/battlefront.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/beach%20head.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/beach%20strike.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/behind%20schedule.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/berlin%20wall.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/big%20brother.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/bio%20dome.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/biohazard.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/blast%20radius.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/boulevard.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/bunker.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/bunker%20defence.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/burr%20wood.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/car%20park.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/casa%20regnix.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/cavern.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/chicken%20run.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/city%20block.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/city%20dump.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/clash.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/colony.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/compound.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/cover.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/crater.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/crossroads.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/cursed%20houses.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/dmz.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/danger%20room.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/data%20bank.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/depot.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/depot%20ruins.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/desert.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/desolation.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/devils%20gate.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/docks.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/downtown.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/dust.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/elixir.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/encounter.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/enemy%20hq.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/english%20suburb.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/estate.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/face.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/factory.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/football.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/forest.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/front%20line.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/frontier.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/garden%20hopper.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/gasoline.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/gauntlet.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/genesis.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/gladiator.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/grind.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/hq%20war.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/high%20cmmand.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/holding%20cell.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/hotel.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/inferno.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/infiltration.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/italy.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/jungle%20fever.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/labs.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/labyrinth.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/laser%20bowl.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/long%20shot.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/lost%20highway.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/manors.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/mars%20embassy.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/maze.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/middle%20of%20nowhere.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/milton%20keynes.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/moon%20base.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/narrow.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/newtown.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/nexus.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/no%20mans%20land.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/onslaught.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/outpost.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/pacman.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/panic%20room.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/paranoia.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/phaze.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/prison%20break.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/quarantine.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/rat%20race.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/rear%20entry.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/reclamation.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/relic.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/renovation.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/Restaurant.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/ring%20road.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/riverbed.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/roadblock.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/robin%20hood.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/ruins.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/santas%20grotto.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/schools%20out.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/scorched%20earth.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/scrum.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/shuttle%20rescue.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/siege.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/signs.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/sniper%20duel.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/space%20for%20rent.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/st%20pauls.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/stalker.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/strange%20mix.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/stronghold.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/sublevel.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/suburbia.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/switchback%20.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/tangle.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/tarantula.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/the%20cage.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/the%20castle%20of%20lord%20x.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/the%20stand.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/three%20little%20pigs.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/tic%20tac%20toe.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/titan%20factory.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/titan%20hydroponics.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/titan%20minehead.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/titan%20power%20grid.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/titan%20spaceport.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/training%20camp.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/trains.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/ufo.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/urban%20assault.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/vantage.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/village.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/warehouse.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/warehouse%20jungle.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/waste%20complex.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/weapons%20testing.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/weird%20science.jpg", "http://www.countzero.pwp.blueyonder.co.uk/lsn/maps/wild%20west.jpg"]; gamemaps = document.evaluate( '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[4]/TBODY[1]/TR/TD[3] | /HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[5]/TBODY[1]/TR/TD[3]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < gamemaps.snapshotLength; i++) { thismap = gamemaps.snapshotItem(i); // alt = img.alt.toUpperCase(); for (var j = 0; j < maps.length; j++) { if (thismap.innerHTML == maps[j]) { // replacement = document.createElement("a"); // replacement.innerHTML = thismap.innerHTML // replacement.target = "_blank" // replacement.class = '"tabletext"' // replacement.href = links[j] // thismap.parentNode.replaceChild(replacement, thismap); // replacement = document.createElement("a"); thismap.innerHTML = ' ' + thismap.innerHTML + '' // replacement.target = "_blank" // replacement.class = '"tabletext"' // replacement.href = links[j] // thismap.parentNode.replaceChild(replacement, thismap); } } } }