addHighSlideAttribute = function() {
  var isIE = (document.documentElement.getAttribute('style') ==
              document.documentElement.style);
  if (!document.getElementsByTagName) { return; }
  var id = 'contents';
  var element;
  if (id) {
    element = document.getElementById(id)
    if (!element) { return; }
  } else {
    element = document.body;
  }
  var anchors = element.getElementsByTagName('a');
  for (var i = 0, len = anchors.length; i < len; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute('href') && anchor.getAttribute('href').match(/jpg$|gif$|png$|JPG$/)) {
        anchor.className = 'highslide';
      if (!anchors[i].getAttribute('onclick')) {
        isIE ? anchors[i].setAttribute('onclick', new Function('return hs.expand(this)')) :
               anchors[i].setAttribute('onclick','return hs.expand(this)');
        isIE ? anchors[i].setAttribute('onkeypress', new Function('return hs.expand(this)')) :
               anchors[i].setAttribute('onkeypress','return hs.expand(this)');
      }
    }
  }
};