implementation of the black diamond jS libraries.