Window manager in JS