made further js edits to allow interoperability with jquery plugins added using WP's enqueue script