>>244
if(elm[i].firstChild.className != "g") continue;

//if(elm[i].firstChild.className != "g") continue;
にする