﻿function $(id) {
    return (typeof id == "string" ? document.getElementById(id) : id);
}

function $N(name) {
    return document.getElementsByName(name);
}

function $TN(name, root) {
    return root ? $(root).getElementsByTagName(name) : document.getElementsByTagName(name);
}

function exist(id) {
    return $(id) != null;
}

document.getElementsByClassName = function(theName){ 
　　　　var j = 0; 
　　　　var array = []; 
　　　　for(var i = 0;(e = document.getElementsByTagName("*")[i]); i++){ 
　　　　　　if(e.className == theName){ 
　　　　　　　　array[j] = e; 
　　　　　　　　j++; 
　　　　　　} 
　　　　} 
　　　　return array; 
} 