var divs = document.getElementsByTagName('div');

for (i = 0 ; i < divs.length ; i++) {
  if (divs[i].className.match(/\s*fake_a\s*/)) {
    divs[i].onmouseover = function() {
      if (! this.className.match(/\s*hover\s*/)) {
        this.className += ' hover ';
      } // if class contains not 'hover'
    } // div.onmouseover()

    divs[i].onmouseout = function() {
      if (this.className.match(/\s*hover\s*/)) {
        this.className = this.className.replace(/\s*hover\s*/, '');
      } // if class contains 'hover'
    } // div.onmouseout()

    divs[i].onclick = function() {
      var links = this.getElementsByTagName('a')
      for (j = 0 ; j < links.length ; j++) {
        if (links[j].className == 'hidden') {
          location.href = links[j].href;
          break;
        }
      }
    }
  } // if className contains "a"
} // foreach divs


