// zzlib.js -- basic utility and cross-platform event wrappers.

// as it happens, standards seem to be settling down.  This amount of
// indirection might not be necessary.

// hey, everyone on earth's written a getElementsByClassName.  This is
// mine.  Actually, it's by lobo235, and comes up as the first result
// of a google search for the function name.  Whatevs.

function getElementsByClassName(class) {
  var matches = new Array();
  var t = document.getElementsByTagName('*');

  for(var i=0; i<t.length; i++) {
    if(t[i].className.indexOf(' ') >= 0) {
      var c = t[i].className.split(' ');
      for(var j=0; j < c.length; j++) {
        if(c[j] == class) matches.push(t[i]);
      }
    } else if(t[i].className == class) matches.push(t[i]); 
  }
  return matches;
}

