/* jir.js * requires behaviour.js * html looks like: My Title * requires an empty.gif to make sure IR should even happen (imagse are turned on) * this gif can be 1px by 1px with 1 color pallette */ var test = new Image(); var tmp = new Date(); var suffix = tmp.getTime(); test.src = 'empty.gif?'+suffix; test.onload = registerReplacement; function registerReplacement() { Behaviour.register( { '.jir_replace' : function(el) { if(el.id) { var ir = document.createElement('img'); ir.src = el.id; ir.alt = el.firstChild.nodeValue; el.replaceChild(ir, el.firstChild); } } }); }