Can someone that knows php and javascript tell me what the heck I am doing wrong. Reason for doing this it to get the source of the scroll from mysql. It appears to me it echos out correctly, yet doesn't work. Thanks
<?php
echo "<script language=\"javascript\">\n";
echo "var marqueewidth=260 \n";
echo "var marqueeheight=10 \n";
echo "var speed=4 \n";
echo "var marqueecontents='...... Call us: <b>(xxx) xxx-xxxx</b> ...</font>' \n";
echo "if (document.all) \n";
echo "document.write('<marquee scrollAmount='+speed+' style=\"width:'+marqueewidth+'\">'+marqueecontents+'</marquee>') \n";
echo "function regenerate(){ \n";
echo "window.location.reload() \n";
echo "} \n";
echo "function regenerate2(){ \n";
echo "if (document.layers){ \n";
echo "setTimeout(\"window.onresize=regenerate\",450) \n";
echo "intializemarquee() \n";
echo "} \n";
echo "} \n";
echo "function intializemarquee(){ \n";
echo "document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')\n";
echo "document.cmarquee01.document.cmarquee02.document.close() \n";
echo "thelength=document.cmarquee01.document.cmarquee02.document.width \n";
echo "scrollit()\n";
echo "}\n";
echo "function scrollit(){ \n";
echo "if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){ \n";
echo "document.cmarquee01.document.cmarquee02.left-=speed \n";
echo "setTimeout(\"scrollit()\",100) \n";
echo "} \n";
echo "else{\n";
echo "document.cmarquee01.document.cmarquee02.left=marqueewidth\n";
echo "scrollit()\n";
echo "}\n";
echo "}\n";
echo "window.onload=regenerate2\n";
echo "<\script>\n";
?>