added js for datepicker fixed some syntax errors