Sorry I could explain myself better...
Basically, all you need is:
<?php
header("Content-Type: text/javascript");
?>
var base_url = '<?php echo urldecode($_GET['base_url']) ?>';
// place your javascript code here
//when you need the base URL, just do something like: base_url.'extensions/something/star.png';
As you can see, we're using PHP to set the MIME type to javascript so browsers recognize it as such.
So, to get the whole $_GET thing working, we need to replace your current script call with:
<script type="text/javascript" src="url/to/extension/javascript.php?base_url=<?php echo urlencode($base_url) ?>"></script>
That's the best I can do to explain it... if you don't get it, think harder?