when you single-quote a Javascript function call, you must double-quote the parameters, and vice-versa e.g.:
echo "onclick = 'window.open(\"http://www.phpfreaks.com\", \"\", \"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300\") return false;'";