Changed to use wp_enqueue_script

Added a separate function to include with wp_enqueue_script for better compatibility.