moved popup JS into separate file