Moving textbox:

(function () {
    // GLOBAL VARIABLES (Scope in JavaScript is function/object based):
    // ================================================================

    var element;

    function fMoveLeft() {
        var intervalMoveLeft = window.setInterval(function MoveLeft() {
            element.style.left = "" + (parseInt(element.style.left) - 1) + "px";

            if (parseInt(element.style.left) <= 0) {  //ganz links: <= 0
                window.clearInterval(intervalMoveLeft);
                // ToDo: Delete Message div in DOM (When removing an element with standard JavaScript, you must go to it's parent first):
                element.parentNode.removeChild(element);
            }
        }, 25);
    }

    function fChangeTextOrSomethingElse() {
        //var element = document.getElementById("TextId");

        element.style.color = "red";
        element.style.background = "white";
        element.style.borderColor = "black";
        fMoveLeft();
    }



    function fStartMovementRight() {
        var intervalMoveRight = window.setInterval(function MoveRight() {
            element.style.left = "" + (parseInt(element.style.left) + 1) + "px";

            if (parseInt(element.style.left) + element.clientWidth >= document.body.clientWidth) {
                window.clearInterval(intervalMoveRight);
                fChangeTextOrSomethingElse();
            }
        }, 25);
    }

    function fStartApplication() {
        //console.log("Start: fStartApplication");

        // ......................your program....................................
        // ......................your program....................................

        element = document.createElement("div");
        element.style.fontsize = "2em";
        element.style.position = "absolute";
        element.id = "TextId_1"
        element.style.left = "0px"; // ganz links beginnen: "0px"
        element.style.top = "200px";
        element.style.width = "400px"
        element.style.height = "120px";
        element.style.border = "12px solid gold";
        element.style.borderRadius = "27px";
        element.style.background = "red";
        element.style.color = "white";
        element.innerHTML = "   Space: The final frontier<br />   These are the voyages of Matthias and Wilhelm<br />   Its a lifelong mission<br />   To explore strange new worlds<br />   To seek out new life and new civilizations<br />   To boldly go where no man and no woman has gone before";

        document.body.appendChild(element);

        fStartMovementRight();
    }

    function fInit() {
        //console.log("Start: fInit");
        fStartApplication();
    }

    window.addEventListener("load", fInit);

})();