function Debug_HighLightFieldItem(obj, sFClr, sBClr, sFontWeight)
{
    var objFont = obj;
    
    if (obj.getElementsByTagName("FONT") != null)
    {
        objFont = obj.getElementsByTagName("FONT")[0];
        if (objFont == null)
            objFont = obj;
    }
    
    objFont.style.color = sFClr;
    obj.style.backgroundColor = sBClr;
    
    if (sFontWeight != "")
        objFont.style.fontWeight= sFontWeight;
}

function Debug_HighlightField(iField, iTableIndex)
{
    var objTable   = document.getElementById("tblDataDump-" + iTableIndex);
    var fHighlight = objTable.rows[iField].cells[0].style.backgroundColor != "red";
    
    if (fHighlight)
    {
        Debug_HighLightFieldItem(objTable.rows[iField].cells[0], "white", "red",    "bold");
        Debug_HighLightFieldItem(objTable.rows[iField].cells[1], "red",   "yellow", "bold");
        Debug_HighLightFieldItem(objTable.rows[iField].cells[2], "red",   "yellow", "bold");
    }
    else
    {
        Debug_HighLightFieldItem(objTable.rows[iField].cells[0], "black", "", "normal");
        Debug_HighLightFieldItem(objTable.rows[iField].cells[1], "black", "", "normal");
        Debug_HighLightFieldItem(objTable.rows[iField].cells[2], "black", "", "normal");
    }
}

function Debug_CopyData(iDivIndex)
{
    var objData = document.getElementById("divDataDump-" + iDivIndex);
    var r       = document.body.createTextRange();
    
    r.moveToElementText(objData);
    r.select();
    document.execCommand("Copy");
}

function Debug_DumpData()
{
    var sURL = new String(document.location);
    
    if (sURL.indexOf("&dr=1") >= 0)
        sURL = RemoveParam(sURL, "dr");
    else
        sURL += "&dr=1";
    
    Redirect(sURL, false);    
    return false;
}
