Linking right documents to javascript document so it can orperate as it is meant too