(function(parentNode){
// (C) Andrea Giammarchi - Mit Style License
function run(childNodes){
    if(/^(OL|UL)$/.test(childNodes[0].nodeName)){
        parentNode.appendChild(childNodes[0]);
        childNodes.splice.apply(childNodes, [0, 0].concat(clear(childNodes.shift())));
    };
    var firstChild  = childNodes.shift(),
        innerHTML   = firstChild.innerHTML
    ;
    firstChild.innerHTML = "";
    firstChild.nodeName === "LI" ?
        parentNode.lastChild.appendChild(firstChild) :
        parentNode.appendChild(firstChild)
    ;
    setTimeout(function type(){
        firstChild.innerHTML += innerHTML.charAt(0);
        innerHTML = innerHTML.slice(1);
        if(0 < innerHTML.length)
            setTimeout(type, 30);
        else if(0 < childNodes.length)
            wait(firstChild, childNodes);
    }, 30);
};
function wait(firstChild, childNodes){
    var length = 0, innerHTML = firstChild.innerHTML;
    setTimeout(function type(){
        firstChild.innerHTML = ++length % 2 ? innerHTML + "_": innerHTML;
        if(length < 4)
            setTimeout(type, 100);
        else if(childNodes.length)
            childNodes.length === 1 ? setTimeout(function(){run(childNodes)}, 2000) : run(childNodes);
    }, 100);
};
function clear(parentNode){
    for(var childNodes = []; parentNode.firstChild;){
        if(parentNode.firstChild.nodeType === 1)
            childNodes.push(parentNode.firstChild);
        parentNode.removeChild(parentNode.firstChild);
    };
    return childNodes;
};
run(clear(parentNode));
})(document.getElementsByTagName("div")[0]);