function funGetClass(className) {
if(document.getElementsByClassName) {
return document.getElementsByClassName(className);
}
var aClassDiv = [];
var aAll = document.getElementsByTagName("*");
for(var i= 0,l=aAll.length;i<l;i++) {
if (aAll[i].className.indexOf(className)+1) {
aClassDiv.push(aAll[i]);
}
}
return aClassDiv;
}
function fun$(string) {
var perName = string.charAt(0);
var suxName = string.substr(1);
switch (perName) {
case "#": document.getElementById(suxName);break;
case ".": funGetClass(suxName);break;
default: document.getElementsByTagName(string);break;
}
}