IE does not have the hasAttribute method, but it provides getAttribute, which requires you to do it yourself, so that hasAttribute will be taken over in FF/IE
function hasAttribute(elm, attribute){
return elm.getAttribute(attribute) != null;
}
The default method of Array in Javascript does not provide the indexOf method, so you can add it yourself.
BTW: It’s really cool to use prototype to Hack Javascript
if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
i || (i = 0);
var length = this.length;
if (i < 0) i = length + i;
for (; i < length; i++)
if (this[i] === item) return i;
return -1;
};