Reorganizing OPAC files in the same way intranet files were
[koha.git] / koha-tmpl / opac-tmpl / prog / en / js / amazonimages.js
1 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
2 function verify_images() {
3     for (var i = 0; i < document.images.length; i++) {
4         img = document.images[i];
5         if ((img.src.indexOf('images.amazon.com') >= 0) || (img.src.indexOf('g-images.amazon.com') >=0)) {
6             w = img.width;
7             h = img.height;
8             if ((w == 1) || (h == 1)) {
9                 img.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
10             } else if ((img.complete != null) && (!img.complete)) {
11                 img.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
12             }
13         }
14     }
15 }