ah, I see the problem. What happens is that you get your source looking like this:
<script language= Javascript>
alert('test days
$count');
</script>
That's not good. Instead of using \n, you'll need to escape the \ like so: \n
If you do that, then \n should be in your alert, and it will be properly converted to a newline.