WordPress offers a function called wp_localize_script. That function is your best friend for situations like yours. There are plenty of examples here. But I leave you with this good tutorial:
http://pippinsplugins.com/use-wp_localize_script-it-is-awesome/