javascript for dming