You might as well just use the javascript inside your php code. PHP doesn't really have it's open.window type function: Just make sure that when you use the javascript you end tag the php:
<?php
echo("
<body bgcolor=#FFFFFF background=background/$background leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 link=$link vlink=$vlink alink=$alink");
?>//end php
onLoad="javascript:window.open('updates.php','QChatStandAlone','width=300,height=310,scrollbars=yes')">
this is what I have on my site, it works fine. hope this helps