//全选
function chkall(obj,pre)
{
    var arr = document.getElementsByTagName("input");
    for(var i=0;i<arr.length;i++)
    {
        if(arr[i].type =="checkbox" && arr[i].id.indexOf(pre) != -1 && !arr[i].disabled)
        {
            arr[i].checked = obj.checked;
        }
    }
}
//全选 <input type="checkbox" id="selAll" name="selAll" onclick="chkAll('selAll','pid')" />
function chkAll(chkall,strid)
{
    var chkTop = $(chkall);
    var chkBox = document.getElementsByName(strid);
    var nodes=$A(chkBox);
    if(chkTop.checked)
    {
        nodes.each(function(node){
            node.checked= true;
        });
    }
    else
    {
        nodes.each(function(node){
            node.checked= false;
        });
    }
}
//单个点击checked  <input type="checkbox" name="pid" id="pid" value="<%#Eval("PId") %>" onclick="chkSingle('selAll','pid');"/>
function chkSingle(chk1,strid)
{
    //var num = 0;
    var chkTop = $(chk1);
    var chkBox = document.getElementsByName(strid);
    var nodes = $A(chkBox);
    var sltNodes = nodes.select(function(node){
        return node.checked;
    });
    if(sltNodes.length == nodes.length)
    {
        chkTop.checked=true;
    }
    else
    {
        chkTop.checked=false;
    }
   
}
//删除 var strId = ChkOperCheck("pid",Toper.RS("Warn_Delete")); //js
//得到公告、留言删除ID
function ChkOperCheck(ChkId,strWarm)
{
    var strID='';
    var chkBox = document.getElementsByName(ChkId);
    var nodes = $A(chkBox);
    var sltNodes = nodes.select(function(node){
        return node.checked;
    });
    if(sltNodes.length ==0)
    {
        alert(Res.GetValue("Warn_Choose"));
    }
    else if(confirm(strWarm))
    {
        var i=0;
        sltNodes.each(function(node)
        {
            if(i == 0)
            {
                strID = node.value;
            }
            else
            {
                strID += ":" +node.value;
            }
            i++;
        });
    }
    return strID;
}