Hrm... don't see why to me. The problem may not be with PHP but with whatever is rendering your source view, or the parsing engine driving it (I'm assuming you're looking at the generated source of the page, here). It may be getting confused by the " inside the double-quoted attribute value (it's thinking that the value of the onclick attribute is "window.open('slideshow.php?c=surinam','', 'width=" or something like that).
Since the window-open attributes aren't HTML attributes, but things for Javascript, I think the width and height don't need quoting. Also, if I remember the syntax for window.open right, if any boolean fields are specified "yes", then any not specified are assumed to be "no". So that might shorten the list further.
For any remaining quotes I guess they'll need to be escaped with . Yes, again. Once for PHP and one for Javascript. And to get the backslashes intended for Javascript through PHP's processing, they'll need to be backslashed. Yes, triple backslashes. So rather than
$prev = "<a href=\"slideshow.php?c=$country\"
onclick=\"window.open('slideshow.php?c=$country','', 'width=\"500\",
height=\"500\", location=\"no\", menubar=\"no\", status=\"no\",toolbar=\"no\",
scrollbars=\"no\", resizable=\"no\"'); return false\">See as slideshow</a>";
it may need to be
$prev = "<a href=\"slideshow.php?c=$country\"
onclick=\"window.open('slideshow.php?c=$country','', 'width=\\\"500\\\",
height=\\\"500\\\", location=\\\"no\\\", menubar=\\\"no\\\", status=\\\"no\\\",toolbar=\\\"no\\\",
scrollbars=\\\"no\\\", resizable=\\\"no\\\"'); return false\">See as slideshow</a>";
I find that when there is a lot of quoting inside quoting inside quoting that heredoc syntax can help. It eliminates one layer of escaping:
$prev =<<<EOT
<a href="slideshow.php?c=$country"
onclick="window.open('slideshow.php?c=$country','', 'width=\"500\",
height=\"500\", location=\"no\", menubar=\"no\", status=\"no\",toolbar=\"no\",
scrollbars=\"no\", resizable=\"no\"'); return false">See as slideshow</a>
EOT;
Of course, I am guessing here - I don't have " missing from my output (which I ran from the command line).