Need help with the parseInt() function
<p>How do I get the phrase number from the phrase object using the <em>parseInt() function</em>? I tried to create the function within the <strong>swapFE function</strong> in <strong>var phrasenum</strong> below but it did not work. I think my values are wrong. What should I put there instead? Any help would be greatly appreciated. Thanks in advance! The following is the french phrase number (1-10 or in JavaScript 0-9) and the french an english phrases to be used:</p>

<pre><code>&gt; var english=new Array();
english[0]="This hotel isn't far from the Eiffel Tower.";
english[1]="What time does the train arrive?";
english[2]="We have been waiting for the bus for one half-hour.";
english[3]="This meal is delicious";
english[4]="What day is she going to arrive?";
english[5]="We have eleven minutes before the train leaves!";
english[6]="Living in a foreign country is a good experience.";
english[7]="Excuse me! I'm late!";
english[8]="Is this taxi free?";
english[9]="Be careful when you go down the steps.";

var french=new Array();
french[0]="Cet h&amp;#244;tel n'est pas loin de la Tour Eiffel.";
french[1]="A quelle heure arrive le train?";
french[2]="Nous attendons l'autobus depuis une demi-heure.";
french[3]="Ce repas est d&amp;#233;licieux";
french[4]="Quel jour va-t-elle arriver?";
french[5]="Nous avons onze minutes avant le d&amp;#233;part du train!";
french[6]="Habiter dans un pays &amp;#233;tranger est une bonne exp&amp;#233;rience.";
french[7]="Excusez-moi! Je suis en retard!";
french[8]="Est-ce que ce taxi est libre?";
french[9]="Faites attention quand vous descendez l'escalier.";
</code></pre>

<p>Here are the functions I am working on:</p>

<pre><code>function setUpTranslation() {
   var phrases = document.getElementsByTagName("p");

   for (i = 0; i&lt;phrases.length; i++) {
      phrases[i].number = i;
      phrases[i].childNodes[1].innerHTML = french[i];

      phrases[i].childNodes[1].onmousedown = function() { swapFE(event); }; 
  }

}

function swapFE(e) {
       var phrase = e.srcElement; 

       var phrasenum = parseInt(phrase[1].childNodes[1].innerText);

       alert("French Number = "+phrasenum+"Phrase = "+phrase.childNodes[1]);
}
</code></pre>
