//Add ECMA262-5 method binding if not supported natively // if (!('bind' in Function.prototype)) { Function.prototype.bind= function(owner) { var that= this; if (arguments.length<=1) { return function() { return that.apply(owner, arguments); }; } else { var args= Array.prototype.slice.call(arguments, 1); return function() { return that.apply(owner, arguments.length===0? args : args.concat(Array.prototype.slice.call(arguments))); }; } }; } // Add ECMA262-5 string trim if not supported natively // if (!('trim' in String.prototype)) { String.prototype.trim= function() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); }; } // Add ECMA262-5 Array methods if not supported natively // if (!('indexOf' in Array.prototype)) { Array.prototype.indexOf= function(find, i /*opt*/) { if (i===undefined) i= 0; if (i<0) i+= this.length; if (i<0) i= 0; for (var n= this.length; ithis.length-1) i= this.length-1; for (i++; i-->0;) /* i++ because from-argument is sadly inclusive */ if (i in this && this[i]===find) return i; return -1; }; } if (!('forEach' in Array.prototype)) { Array.prototype.forEach= function(action, that /*opt*/) { for (var i= 0, n= this.length; i= 0 && node2.sourceIndex >= 0 ? (node1.sourceIndex < node2.sourceIndex && 4) + (node1.sourceIndex > node2.sourceIndex && 2) : 1); } //get a node with a sourceIndex to use function getUseNode(node) { //if the node already has a sourceIndex, use that node if ("sourceIndex" in node) return node; //otherwise, insert a comment (which has a sourceIndex but minimal DOM impact) before the node and use that return node.parentNode.insertBefore(document.createComment(""), node); } }; if (!('getComputedStyle' in window)) { window.getComputedStyle = function (node, style) { if( node.currentStyle ) { return node.currentStyle; } return null; } }