       // =============
       // Remove all the nodes 
       // =============
       function removeNodes(node){
          while(node.lastChild){ 
            node.removeChild(node.lastChild); 
          }
       }
       
       // =============
       // Insert new link node
       // =============
       function insertLinkNode (doc, node, label, url, target){
           var link = doc.createElement('a');
           link.href=    url;
           link.title=   label;
           if (target != ""){
              link.target=  target;
           }
           link.style.textDecoration="none";
           link.appendChild( doc.createTextNode(label) );
           node.appendChild(link);
       }

       

