Move javascript from index to gpview