document.getElementsByClassName = document.getElementsByClassName || function( className ) {
var atElem = this && this.nodeType && this || document,
elems = atElem.getElementsByTagName( '*' ),
result = [], elem;
for( var i = 0; elem = elems[ i++ ]; ) {
if ( elem.className && ( (" " + elem.className + " ").indexOf( " " + className + " " ) >= 0 ) ) {
result[ result.length ] = elem;
}
}
return result;
}