// Imyejin-free user script
// 2007-04-19
// "THE BEER-WARE LICENSE" (Revision 42):
// <perky@FreeBSD.org> wrote this file. As long as you retain this notice
// you can do whatever you want with this stuff. If we meet some day, and
// you think this stuff is worth it, you can buy me a beer in return.
// Hye-Shik Chang
//
// ==UserScript==
// @name          Imyejin-free World
// @namespace     http://openlook.org/src/
// @description   Replaces Imyejin's images
// @include       http://kldp.org/*
// @exclude       
// ==/UserScript==

var atags = document.getElementsByTagName('a');
for (var i = 0; i < atags.length; i++) {
  if (atags[i].innerHTML == 'imyejin') {
    var imyejinbox = atags[i].parentNode.parentNode;
    var imgtags = imyejinbox.getElementsByTagName('img');
    var numImages = imgtags.length;
    for (var j = 0; j < numImages; j++) {
      altText = document.createTextNode('[imyejin]');
      imgtags[0].parentNode.replaceChild(altText, imgtags[0]);
    }
  }
}
