Update cs-wd.js

Fixed waitforPopup for real this time.