implement javascript for advanced search