function Loading(bool) {
    if (bool) {
        top.$("#loading").show();
    } else {
        setInterval(loadinghide, 800);
    }
}
function loadinghide() {
    top.$("#loading").hide();
}
/**
Top 加载对话窗
msg:提示信息
time：停留时间ms
**/
function TopLoading(msg, time) {
    var _time = 1000;
    if(arguments.length==2){
        _time=arguments[1];
    }
    top.$("#Toploading").show().html(msg);
    top.$('#Toploading').css("left", ($(window).width() - $("#Toploading").width()) / 2);
    setInterval(Toploadinghide, _time);
}
function Toploadinghide() {
    top.$("#Toploading").hide();
}
/* 弹出层
* @url:          表示请求路径
* @_id:          ID
* @_title:       标题名称
* @_width:       宽度
* @_height:      高度
---------------------------------------------------*/
function openDialog(url, _id, _title, _width, _height, left, top,callback) {
    window.top.art.dialog.open(url, {
        id: _id,
        title: _title,
        width: _width,
        height: _height,
        left: left + '%',
        top: top + '%',
        //background: '#000000',
        //opacity: 0.1,
        lock: true,
        resize: false,
        close: function() {
            if (callback) {
                callback();
            }
        }
    }, false);
}
//窗口关闭
function OpenClose(targetWinName) {
    art.dialog.close(targetWinName);
}
/*
* 消息提醒
* @msg 消息
* @type 类型 0：成功，1：失败，2：警告
* @isReload 是否刷新界面
*/
function showTipsMsg(msg, type, time, isReload) {
    var ids = "successId,errorId,warningId".split(","),
    icons = "succeed,error,warning".split(","),
    titles = "操作提示,错误提示,系统提示".split(","),
    index = type ? parseInt(type, 10) : 0;
    time = time || 10;
    window.top.art.dialog({
        id: ids[index],
        title: titles[index],
        content: msg,
        icon: icons[index],
        time: 10,
        /*background: '#000',*/
        opacity: 0.1,
        lock: true,
        okVal: '关闭',
        ok: true
    });
    if (isReload == 1) {
        window.top.main.location.reload();
    }
}
/**
警告提示
msg: 显示消息
callBack：函数
**/
function showConfirmMsg(msg, callBack) {
    window.top.art.dialog({
        id: 'confirmId',
        title: '系统提示',
        content: msg,
        icon: 'warning',
        background: '#000000',
        opacity: 0.1,
        lock: true,
        button: [{
            name: '确定',
            callback: function() {
                callBack(true);
            },
            focus: true
        }, {
            name: '取消',
            callback: function() {
                this.close();
                return false;
            }
        }]
    });
}