
    // Text for the notes popups for each piece
    var sNotesCoplandAndante = "<span id='coplandandante'><b>Brahms - Trio for Clarinet, Cello and Piano in A minor Op. 114 - Allegro</b><br>Recorded live June 2nd 2008 in Robert J. Werner Recital Hall (CCM)<br>with Adam Clark, piano and Katya Janpoladyan.</span>";
    var sNotesCoplandAllegretto = "<span id='coplandallegretto'><b>Copland - Sonata for Clarinet and Piano - Allegretto guisto</b><br>Arranged by the composer from is Sonata for Violin and Piano<br>Recorded live February 15th 2007 in Robert J. Werner Recital Hall (CCM)<br>with Yu-Wen Yang, piano.</span>";
    var sNotesMilhaudJeu = "<span id='milhaudjeu'><b>Milhaud - Suite pour violon, clarinette et piano- Jeu</b><br />Recorded live February 24th 2007 in Robert J.Werner Recital Hall (CCM)<br>with Ryan Prijic, violin, and Stephen Pierce, piano.</span>";
    var sNotesMiller = "<span id='miller'><b>Elma Miller - La nuit s'ouvre (excerpt)</b><br />Recorded live June 18th 2005 in Oklahoma Clarinet Symposium masterclass.</span>";
    var sNotesBach = "<span id='milhaud'><b>Bach - Minuet</b><br />From Suite No. 1 in G for solo cello arranged for bass clarinet<br />Recorded live February 15th 2007 in Robert J. Werner Recital Hall (CCM)</span>";

    function ShowToolTip(iMessageTextObject, pEvent)
    {
        if (m_bToolTip_Visible == true) { ToolTip_Hide(); return; }

        var iX = pEvent.clientX + document.body.scrollLeft;
        var iY = pEvent.clientY + document.body.scrollTop;

        var iMouseOffsetX = 10;
        var iMouseOffsetY = 0;

        var iMessage = eval("sNotes"+iMessageTextObject);

        // Display
        ToolTip_Show(iMessage, iX, iY, iMouseOffsetX, iMouseOffsetY);
    }

    var m_bToolTip_Visible = false;

    var pToolTip;

    /*
     * Show the div that holds the tooltip at the location given.
     * - Note that iX and iY must be adjusted beforehand if the
     * scrollbar positions are to be accounted for.
     * - If you want the tooltip to appear indefinitely, set iTimer
     * to -1.
     * - It is a good idea to set the width to a positive integer
     * so that the tooltip always appears the same at all locations.
     * If you want it to automatically resize, for example shrink a bit
     * when it hits the page border before forcing the page width to
     * increase, then set iWidth to -1 and the width of the tooltip
     * will be left unset and be determined by the browser. (could
     * behave differently in different browsers.)
     * - iMirrorX is 0 to show tooltip on right of mouse, 1 to show on left.
     * - iMirrorY is 0 to show tooltip below mouse, 1 to show above.
     */
    function ToolTip_Show(sText, iX, iY, iMouseOffsetX, iMouseOffsetY, iWidth)
    {
        pToolTip = document.getElementById("notesdiv");
        var pToolTipText = document.getElementById("ToolTip_Text");
        pToolTipText.innerHTML = sText;

        if (iWidth != -1)
        {
            pToolTip.width = iWidth;
            //pToolTip.style.width = iWidth;
        }
        else
        {
            pToolTip.width = 0; // in case it was set from a previous popup
            //pToolTip.style.width = ""; // this must be cleared in order for FF to set clientWidth. You canNOT use 0.
        }

        // Align the contents of the tooltip (the inner table) to the left, so that if the tooltip div is longer than the contents, they will still appear right by the mouse. This makes it ok to set a standard width for the tooltip, even if we know some of the data will be shorter than it.
        document.getElementById("ToolTipContents").align="left";

        pToolTip.style.left = iX;// + iMouseOffsetX - /*iMirrorX * */ pToolTip.clientWidth;
        pToolTip.style.top = iY;// + iMouseOffsetY - /*iMirrorY * */ pToolTip.clientHeight;

        //pToolTip.style.visibility = 'visible';
        pToolTip.style.display = 'block';

        m_bToolTip_Visible = true;
        //ShowHideMusicControls('block');
    }

    function ToolTip_Hide()
    {
        var pToolTip = document.getElementById("notesdiv");
        pToolTip.style.display = 'none';
        m_bToolTip_Visible = false;
        //ShowHideMusicControls('none')
    }

    // Not very useful since if all the controls disappear then the table shrinks, plus, they reload the video when they reappear!
    function ShowHideMusicControls(bShowHide)
    {
        if (isFirefox)
        {
            document.getElementById("muscontrol1").style.display=bShowHide;
            document.getElementById("muscontrol2").style.display=bShowHide;
            document.getElementById("muscontrol3").style.display=bShowHide;
            document.getElementById("muscontrol4").style.display=bShowHide;
            document.getElementById("muscontrol5").style.display=bShowHide;
            document.getElementById("muscontrol6").style.display=bShowHide;
        }
    }
