If a user clicks on a button a new window opens where the user can do irrelevant stuff.
In case the user clicks on the former page the new window gets pushed into the background and the user is not able to see it anymore. That is notmal behaviour so far.
What i need now is that the already opened window comes back to the front on a second button click of the user. Is this possible? How?
You need to keep the window object stored in a variable, say
w. Then you can usefocus()to bring it to the front again: