title: Javascript title flashing method
body: <p>Ok, I know that this question is similiar to others, but I am not looking for any code, purely just a push in the right direction.</p>
  
  <p>I have some code that will update a browser title based on the values of a table changing. Everytime a new value or message appears in the table I want the browser tab to flash, to notify the user. The problem I am having is that no matter what I do, only the <code>==</code> part of my <code>function()</code> if statement is being called. See my code below..</p>
  
  <pre><code>function newMessage() 
       {
        var oldTitle = "Web Page";
        var msg = "You have a new message";
  
        var timeout = setInterval(function() 
        { 
          document.title = document.title == msg ? '' : msg;
        }, 1000);
  
        window.onmousemove = function() {
            clearInterval(timeout);
            document.title = oldTitle;
            window.onmousemove = null;
        };
       }
  
      function notification()
      {
  
            var table = document.getElementById('refreshMessages');
  
            var counter = 0;
            var firstTr = table.getElementsByTagName("tr")[1];
            var firstTd = firstTr.getElementsByTagName("td")[0];
  
            updater.start();
            updater2.start();
  
            var firstTrUpdate = table.getElementsByTagName("tr")[1];
            var firstTdUpdate = firstTrUpdate.getElementsByTagName("td")[0];
  
            if(firstTd.innerHTML != firstTdUpdate.innerHTML)
             {
               newMessage();
             }
             else if(firstTd.innerHTML == firstTdUpdate.innerHTML)
               {
                  alert(firstTd.innerHTML);
               }
      }
  </code></pre>
  
  <p>The <code>alert()</code> which I have in for testing reasons, shows the value of the cell in question, so I know that my code is accessing the cell and retrieving the data. however the <code>!=</code> part of the if statement never seems to execute. After 4 or 5 hours of looking and re-writing the same code I am at a loss! It doesn't help when you are not too familiar with JavaScript either :) </p>
  
  <p>If anyone could point out my errors to me, or even give me a hint or two I would greatly appreciate it!</p>