Moved java script to separate file