document.getElementsByClassName = function(name){ try{ var tag = document.getElementsByTagName("*") || document.all; var array = []; for (var i = 0; i < tag.length; i++) { if(tag[i].className == name){ array.push(tag[i]); }; }; if(array.length >= 1){ return array[0]; } return array; }catch(e){} }