There are a couple of ways that you could do this, one of which I've done before, the other I haven't, but I have used for XML configuration files.
The first one is to include the variables in a script tag inside the WP header or footer, before the script tag where you include your JS file, for example:
var test = "<?php echo "hello world"; /* the relevant PHP code to echo the data you require */ ?>";
var slider_type = "<?php echo "nivo"; /* same again */ ?>";
The other alternative would be to include the JS inside of a PHP file which is included inside of a script tag.