
function getNodeByID(id, nodes){

    var the_node = null;

    for(var i=0; i<nodes.length; i++){
        next_node = nodes[i];
   
        if(next_node.nodeType == 1){
      
            if(next_node.id == id){
                the_node = next_node;
                break;
            } else {
                the_node = getNodeByID(id, next_node.childNodes);
            }
        }
        if(the_node != null){ break; }
    }

    return the_node;
}

function getNodeByClass(class_name, nodes){
    
    var the_node = null;

    for(var i=0; i<nodes.length; i++){
        next_node = nodes[i];
       
        if(next_node.nodeType == 1){   
            if(next_node.className == class_name){
                the_node = next_node;
                break;
            } else {
                the_node = getNodeByClass(class_name, next_node.childNodes);
            }
        }
        if(the_node != null){ break; }
    }

    return the_node;
}

function getNodeByName(name, nodes){

    var the_node = null;

    for(var i=0; i<nodes.length; i++){
        next_node = nodes[i];
  
        if(next_node.nodeType == 1){

            if(next_node.name == name){
                the_node = next_node;
                break;
            } else {
                the_node = getNodeByName(name, next_node.childNodes);
            }
        }
        if(the_node != null){ break; }
    }

    return the_node;
}
