External js

moved js to external file