function findtag(id) {
  var tags = document.getElementsByTagName('a');
  var max = tags.length;
  for(i=0;i<max;i++) {
    var tag = tags[i];
    if (tag.id == id) { return tag; }
  }
}

function colour1(id,t) {
  var tag = findtag(id);
  if (t) { tag.style.color = '#999999'; }
  else { tag.style.color = '#0033CC'; }
}

function applyhover() {
  var tags = document.getElementsByTagName('a');
  var max = tags.length;
  for(i=0;i<max;i++) {
    var tag = tags[i];
    if (tag.id != '') {
      tag.onmouseover = function() { colour1(this.id,true); }
      tag.onmouseout  = function() { colour1(this.id,false); }
    }
  }
}
