change window replace in javascript