This line is going to fail, javascript can't use php to query. What you'll need to do is load up the image paths in Drupal.settings to pass into the js to pick up. See: http://drupal.org/node/304258#drupal-settings