﻿// JScript File
/*****************************************************************************
* To know whether a check box is checked base on the id.
*****************************************************************************/
function isChecked(p_id)
{
    var ret = false;
    var chk = document.getElementById(p_id);
    if (chk != null)
    {
        ret = chk.checked;
    }
    return ret;
}

/*****************************************************************************
* Check, uncheck all Stock Symbol filter check boxes.
*****************************************************************************/
function setAllCheckBoxes(p_checked)
{
    var arrChk = document.getElementsByName("chkStkFilter");
    for (i = 0; i < arrChk.length; i++)
    {
        arrChk[i].checked = p_checked;
    }
}


/*****************************************************************************
* Check, and set value for value attribute of the button specified by id
*****************************************************************************/
function setBtnValue(p_id, p_value)
{
    var btn = document.getElementById(p_id);
    if (btn != null)
    {
        btn.value = p_value;
    }
}

/*****************************************************************************
* 
*****************************************************************************/
function setWidthByTdOffsetWidth(p_id)
{
    var td = document.getElementById(p_id);
    if (td != null)
    {
        return (" width='" + td.offsetWidth + "px' ");
    }
    else
    {
        return "";
    }
}