basic js

basic js functions added. need to be refined.