Look at your template. {$root_url} is part of the <script> tag which is wrapped in {literal}. I use Smarty on a daily basis. That {$root_url} will not get translated inside of the {literal}. Additional, as I mentioned, you have hardcoded the paths so it only works on the "friendly URLs" setting