added scripts into template file.

Merged scripts into template file.

Just need to add the spans to the tree for it to work.