//后台管理界面用到的一些函数

function batch_do(doName,entityName, action)
{
    if (confirm("确定要" + doName + entityName + "?"))
    {
        if (!atleaseOneCheck())
        {
            alert('请至少选择一个' + entityName + '！');
            return;
        }
        var form = document.forms.frmPage;
        //form.action = action + '&autoInc=false';
        form.action = action;
        form.submit();
    }
}

function form_do(action)
{
        var form = document.forms.ec;
        form.action = action + '&autoInc=false';
        form.submit();
}

function openwin(url, width, height, scroll)
{
    if (!document.all)
    {
        document.captureEvents(Event.MOUSEMOVE);
        x = e.pageX + width - 30;
        y = e.pageY + height - 30;
    }
    else
    {
        x = document.body.scrollLeft + event.clientX + width - 30;
        y = document.body.scrollTop + event.clientY + height - 30;
    }
    window.open(url, "newWindow", "height=" + height + ", width=" + width + ", toolbar =no, menubar=no, scrollbars=" + scroll + ", resizable=no, location=no, status=no, top=" + y + ", left=" + x + "") //写成一行
}

//checkbox中至少有一项被选中
function atleaseOneCheck()
{
    var items = document.getElementsByName('chkIds');
    if (items.length > 0) {
        for (var i = 0; i < items.length; i++)
        {
            if (items[i].checked == true)
            {
                return true;
            }
        }
    } else {
        if (items.checked == true) {
            return true;
        }
    }
    return false;
}
