this is supposed to color a box around the image to show the rarity BUT it stopped working not to long ago and I can not figure out how to fix it

// ==UserScript==
// @name Subeta Shop Item Rarity Tooltips
// @namespace Shaun Dreclin
// @include *subeta.net/shop.php*
// ==/UserScript==

//A big thank-you to pagewil on stackoverflow.com for this asynchronous for loop!
var asyncLoop = function(o){
var i=-1, length = o.length;
var loop = function(){
i++;
if(i==length){o.callback(); return;}
o.functionToLoop(loop, i);
}; loop();
};

var itemName; var itemNameTooltip; var rarityName; var rarityColor;
asyncLoop({ length: document.getElementsByTagName('img').length, functionToLoop: function(loop, i){ setTimeout(function(){
try {
if(document.getElementsByTagName('img')[i].style.border == "1px solid black" || document.getElementsByTagName('img')[i].style.border == "1px solid white") {
itemName = document.getElementsByTagName('body')[0].innerHTML.split(document.getElementsByTagName('im g')[i].src);
itemName = itemName[1].split("</div>");
itemName = itemName[0].split("\n");
itemName = itemName[2];
while(itemName.indexOf(String.fromCharCode(9)) != -1) { itemName = itemName.replace(String.fromCharCode(9), ""); }

document.getElementsByTagName('img')[i].style.opacity = "0.25";
document.getElementsByTagName('img')[i].style.border = "1px solid white";

GM_xmlhttpRequest({
method: "GET",
url: "http://subeta.net/hover_item.php?name=" + escape(itemName),
onload: function(response) {
itemNameTooltip = unescape(this.url.split("=")[1]);

rarityName = response.responseText.split("'>");
rarityName = rarityName[2].split("</span>");
rarityName = rarityName[0];

rarityColor = rarityName;
rarityColor = rarityColor.replace("Really Common", "999999");
rarityColor = rarityColor.replace("Mundane", "666666");
rarityColor = rarityColor.replace("Common", "333333");
rarityColor = rarityColor.replace("Normal", "000000");
rarityColor = rarityColor.replace("Super Rare", "dd00ff");
rarityColor = rarityColor.replace("Rare", "0099ff");
rarityColor = rarityColor.replace("Retired", "6da877");

for(j in document.getElementsByTagName('img')) {
try {
if(document.getElementsByTagName('img')[j].style.border == "1px solid white") {
itemName = document.getElementsByTagName('body')[0].innerHTML.split(document.getElementsByTagName('im g')[j].src);
itemName = itemName[1].split("</div>");
itemName = itemName[0].split("\n");
itemName = itemName[2];
while(itemName.indexOf(String.fromCharCode(9)) != -1) { itemName = itemName.replace(String.fromCharCode(9), ""); }

if(itemName == itemNameTooltip) {
document.getElementsByTagName('img')[j].style.opacity = "1.0";
document.getElementsByTagName('img')[j].style.border = "2px solid #" + rarityColor;
if(rarityName == "Rare" || rarityName == "Super Rare" || rarityName == "Retired") {
document.getElementsByTagName('img')[j].style.boxShadow = "0px 0px 50px #" + rarityColor;
}
document.getElementsByTagName('img')[j].title = "Rarity: " + rarityName;
}
}
} catch(e) { }
}
}
});
}
} catch(e) { }
loop(); },1); }, callback: function(){ /* Done! */}});
this is a link to one of the sites that it is supposed to work on http://subeta.net/shop.php?shopid=16