refactor frame.js out into individual function. also moved jquery code out of index file.