writting java script for the project