js for index copy