function getElementsByClassName(n) {
var classElements = [];
var allElements = document.getElementsByTagName('*');
for (var i=0; i< allElements.length; i++ ) {
if (allElements[i].className == n ) {
classElements[classElements.length] = allElements[i];
alert(classElements.length);
}
}
return classElements;
}