function SelectCheckBox(box, chkName, ac) {
    for (var i = 0; i < document.forms[0].elements.length; i++) {
        var e = document.forms[0].elements[i];
        if (e.type == 'checkbox') {
            var o = e.name.lastIndexOf(chkName);
            if (o != -1) {
                if (ac == 1) {
                    e.checked = true;
                } else {
                    e.checked = false;
                }
            }
        }
    }
}
function UnSelectCheckBox(box, chkName) {
    for (var i = 0; i < document.forms[0].elements.length; i++) {
        var e = document.forms[0].elements[i];
        if (e.type == 'checkbox') {
            var o = e.name.lastIndexOf(chkName);
            if (o != -1)
                if (e.checked)
                e.checked = false;
            else
                e.checked = true;

        }
    }
}

function LiColor(objID)
{
    var box=document.getElementById(objID);
    if(box==null)
    {
        return;
    }
    
    var li=box.getElementsByTagName('li');
    var ii=1;
    for (var j=0;j<li.length;j++){
        if (li[j].parentNode==box || li[j].parentNode.parentNode==box){
            if (ii++%2==0){
                li[j].className="ac";
            }
            else{
                li[j].className="";
            }
        }
    }
}

function ShowObject(obj, objID, checkedShow)
{
    if(obj==null||objID==null)
    {
        return;
    }
    
    var arrobjID=objID.split(',');
    if(arrobjID==null || arrobjID.Length<0)
    {
        return;
    }
    
    var objBox=null;
    for(var i=0;i<arrobjID.length;i++)
    {
        if(arrobjID[i]!=null)
        {
            objBox=document.getElementById(arrobjID[i]);
            if(objBox!=null)
            {
                if(checkedShow==null || checkedShow==false)
                {
                    if(obj.checked)
                    {
                        objBox.style.display="none";
                    }else
                    {
                        objBox.style.display="";
                    }
                }
                else
                {
                    if(obj.checked)
                    {
                        objBox.style.display="";
                    }else
                    {
                        objBox.style.display="none";
                    }
                }
            }
        }
    }
}

function ShowObjectBox(objID)
{
    var obj =document.getElementById(objID);
    if(obj==null)
    {
        return;
    }
    
    if(obj.style.display=='none')
    {
        obj.style.display='';
    }else
    {
        obj.style.display='none';
    }
}