One of the problems is this (not the full solution!)
Code:
setTimeout(showWindow("text1"), 2000);
This will not do what you expect. It will call showWindow() immediately because you append parentheses () to the function name. After 2 seconds it would run a callback if and only if you would return a function object from showWindow(), which you don't.
Try this
Code:
setTimeout(function() {showWindow("text1")}, 2000);