You can't easily call PHP in js. JS is parsed on the client side, and PHP is parsed on the server side - obviously - so any PHP variables you want to access in JS have to be done on the server side.
Basically, instead of serving up a static js file, you call a PHP script, which creates js (or basically text in any form - which can be js) dynamically. You don't need to do anything special, just have it called from inside <script> tags. If you want, you can have the PHP output JSON or XML and then have the JS call that and parse it - but its a hell of a lot more work than just creating the JS file on the fly with the variables already in it.
So, I agree with Steven, for simplicity sake either calling a PHP file in the <script> tag is the most flexible option, and Steven's image directory solution is the most straight forward and quick solution.
The PHP file is the better solution long term, but you can publish your release today if you use Steven's solution, and then develop the PHP file in the next few weeks.
Bookmarks