﻿var boolDebug = false;
//show the debug area by adjusting sizes of root.html, index.html


var debugTimeout;
function Debug(msg,inlineMode)
{
    if (boolDebug == true)
    {
        if (inlineMode)
        {
            try
            {   

                if (glRootWindow.document.getElementById("debugDIV"))
                {
                    if (glRootWindow.document.getElementById("debugDIV").innerHTML != "")
                    {
                        glRootWindow.document.getElementById("debugDIV").innerHTML += "<br/>" + msg;
                    }
                    else
                    {
                        glRootWindow.document.getElementById("debugDIV").style.display = "block";
                        glRootWindow.document.getElementById("debugDIV").innerHTML = "DEBUG: " + msg;
                    }
                    clearTimeout(glRootWindow.debugTimeout);
                    glRootWindow.debugTimeout = setTimeout('glRootWindow.document.getElementById("debugDIV").style.display="none"; glRootWindow.document.getElementById("debugDIV").innerHTML = "";',5000);
                }

            }
            catch(e) {}
        }
        else
        {
            alert(msg);
        }
    }
}


    




