No, there are no JS errors.
Here is what my code looks like (by the way my variable is called $menuhtml):
function menuhtml() {
return '
|
<a href="'.$menu0URL.'">'.$menu0LINK.'</a> |
<a href="'.$menu1URL.'">'.$menu1LINK.'</a> |
<a href="'.$menu2URL.'">'.$menu2LINK.'</a> |
<a href="'.$menu3URL.'">'.$menu3LINK.'</a> |
<a href="'.$menu4URL.'">'.$menu4LINK.'</a> |
<a href="'.$menu5URL.'">'.$menu5LINK.'</a> |
<a href="'.$menu6URL.'">'.$menu6LINK.'</a> |
';
}
$menuhtml = menuhtml();
$menuhtml = str_replace('|','<br>',$menuhtml);
echo '
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
if (!useRedirect) { // if dynamic embedding is turned on
if(hasRightVersion) { // if we detected an acceptable version
var oeTags = \'<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="339" height="284">\'
+ \' <param name="movie" value="menu.swf?phpself='.$SERVER["PHP_SELF"].'&b='.$b.'">\'
+ \' <param name="quality" value="high">\'
+ \' <embed src="menu.swf?phpself='.$SERVER["PHP_SELF"].'&b='.$b.'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="339" height="284"><\/embed>\'
+ \'<\/object>\';
document.write(oeTags); // embed the flash movie
} else { // flash is too old or we cannot detect the plugin
// NOTE: height, width are required!
var alternateContent = \'<table width="339" height="284" border="0" cellpadding="0" cellspacing="0"><tr><td><font size="2"><b><div align="right">'.$menuhtml.'</div></font></b></td></tr></table>\';
document.write(alternateContent); // insert non-flash content
}
}
// -->
</SCRIPT>
';
I shall point out that interestingly enough the variables $b and $_SERVER["PHP_SELF"] do come through without a problem but the var $menuhtml doesn't...
also I should point out that if I do an echo $menuhtml; I get a menu, but if I want to print the contents of $menuhtml inside that table inside the JS inside the PHP echo then it won't print.