help, please, understanding my problem

[email protected] ("Stan")
Newsgroups php.general
Message-ID <[email protected]>
I have a PHP page that has
 require_once("genMyOverlay.js.php");
 .
 .
 .
 echo "<body>";
 echo "<script language=\"JavaScript\">doit(\"mydiv\");</script><br>";
 echo "</body>";

genMyOverlay.js.php contains: createDiv() (see below) that creates a <DIV
ID="mydiv"> and sets it up to overlay a portion of the wbe page and
doit()starts it off.

invoke the web page once and it works like it should.  invoke the web page a
second time (and thereafter until a new session) and it gets error:
 "doit is not defined"

view the source (at the client browser) and it is identical both (all) times

can anyone please help me understand what is happening?

genMyOverlay.js.php contains
 <script language="PHP">
  echo "<script language=\"JavaScript\">";
  echo "function createDiv()";
  echo " {";
   .
   .
   .
  echo " }";
  echo "function doit(ElementID)";
  echo " {";
  echo " creatDIV()";
   .
   .
   .
  echo " }";
  echo "</script>";
 </script>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.