Following is my code. The issue is , the 2nd javascript [changeText(i)]is not getting executed when it is called by 1st javascript [changeImage(i)] 
(I tried it in firefox and chrome.). I think even the call for the script changeText(i) is not executing. Can you help me to find out the above stated problem? what might be the reason behind changeText(i) is not executing?

```
<html>

  <head>
    <title>Menu</title>

    <script type="text/javascript">
      function changeText(i)
                {

                        switch(i)
                                    {
                            case 'a':   document.getElementById('hed').innerHTML = "Previous Month"+ <?php echo "hai"; ?> ;

                                                break;
                            case 'b':  document.getElementById('hed').innerHTML = "You pressed " + <?php echo "hai"; ?> + i;
                                                break;

                            default: return false;
                        }

        }
    </script>

    <script type="text/javascript">
      function changeImage(i) {

        var img = document.getElementById("img");

        switch (i) {
          case 'a':
            img.src = "graph_bar.php";
            changeText(i);
            break;
          case 'b':
            img.src = "graph_bar1.php";changeText(i);
            break;
          default:
            return false;
        }
      }

    </script>

  </head>

  <body bgcolor="#FFFFFF">

    <div align="center">

      <input type="button" value="Previous-Day" onclick="changeImage('a');" />&nbsp &nbsp
      <input type="button" value="Previous-Month" onclick="changeImage('b');" />

    <table style="width:100%">
      <tr>
        <th>Type of Index: <strong id="hed"> </strong></th>
        <th>

        </th>

      </tr>

    </table>
    <div>

    <img id="img">

    </div>

    </div>

  </body>    
</html>

```