added js folder

separated scripts into external script files.