/* 未能缩小。正在返回未缩小的内容。
(1,1): run-time error CSS1019: Unexpected token, found '/'
(1,2): run-time error CSS1019: Unexpected token, found '/'
(2,10): run-time error CSS1031: Expected selector, found 'AWarn('
(2,10): run-time error CSS1025: Expected comma or open brace, found 'AWarn('
(6,10): run-time error CSS1031: Expected selector, found 'AWarnMsg('
(6,10): run-time error CSS1025: Expected comma or open brace, found 'AWarnMsg('
(10,10): run-time error CSS1031: Expected selector, found 'ARight('
(10,10): run-time error CSS1025: Expected comma or open brace, found 'ARight('
(14,10): run-time error CSS1031: Expected selector, found 'ARightMsg('
(14,10): run-time error CSS1025: Expected comma or open brace, found 'ARightMsg('
(19,10): run-time error CSS1031: Expected selector, found 'AError('
(19,10): run-time error CSS1025: Expected comma or open brace, found 'AError('
(23,10): run-time error CSS1031: Expected selector, found 'AErrorMsg('
(23,10): run-time error CSS1025: Expected comma or open brace, found 'AErrorMsg('
(27,10): run-time error CSS1031: Expected selector, found 'ASuccess('
(27,10): run-time error CSS1025: Expected comma or open brace, found 'ASuccess('
(31,10): run-time error CSS1031: Expected selector, found 'AMessage('
(31,10): run-time error CSS1025: Expected comma or open brace, found 'AMessage('
(35,10): run-time error CSS1031: Expected selector, found 'AlertUrlError('
(35,10): run-time error CSS1025: Expected comma or open brace, found 'AlertUrlError('
(39,10): run-time error CSS1031: Expected selector, found 'AlertUrl('
(39,10): run-time error CSS1025: Expected comma or open brace, found 'AlertUrl('
(43,10): run-time error CSS1031: Expected selector, found 'AlertUrlRight('
(43,10): run-time error CSS1025: Expected comma or open brace, found 'AlertUrlRight('
(47,10): run-time error CSS1031: Expected selector, found 'AlertRight('
(47,10): run-time error CSS1025: Expected comma or open brace, found 'AlertRight('
(51,10): run-time error CSS1031: Expected selector, found 'AlertClose('
(51,10): run-time error CSS1025: Expected comma or open brace, found 'AlertClose('
(55,1): run-time error CSS1019: Unexpected token, found '/'
(55,2): run-time error CSS1019: Unexpected token, found '/'
(56,10): run-time error CSS1031: Expected selector, found 'Loading('
(56,10): run-time error CSS1025: Expected comma or open brace, found 'Loading('
(68,10): run-time error CSS1031: Expected selector, found 'CloseLoad('
(68,10): run-time error CSS1025: Expected comma or open brace, found 'CloseLoad('
(72,1): run-time error CSS1019: Unexpected token, found '/'
(72,2): run-time error CSS1019: Unexpected token, found '/'
(73,10): run-time error CSS1031: Expected selector, found 'Add('
(73,10): run-time error CSS1025: Expected comma or open brace, found 'Add('
(77,10): run-time error CSS1031: Expected selector, found 'OpenUrl('
(77,10): run-time error CSS1025: Expected comma or open brace, found 'OpenUrl('
(94,10): run-time error CSS1031: Expected selector, found 'CloseFrame('
(94,10): run-time error CSS1025: Expected comma or open brace, found 'CloseFrame('
(99,10): run-time error CSS1031: Expected selector, found 'GetUrlParam('
(99,10): run-time error CSS1025: Expected comma or open brace, found 'GetUrlParam('
(105,10): run-time error CSS1031: Expected selector, found 'Redirect('
(105,10): run-time error CSS1025: Expected comma or open brace, found 'Redirect('
 */
//警告
function AWarn(ncontent) {
    layer.alert(ncontent, { icon: 0, title:'提示'});
}

function AWarnMsg(ncontent) {
    layer.msg(ncontent, { icon: 0, title:'提示', shade: [0.3, '#000'], time: 2000 });
}

function ARight(ncontent) {
    layer.alert(ncontent, { icon: 1 });
}

function ARightMsg(ncontent) {
    layer.msg(ncontent, { icon: 1, shade: [0.3, '#000'], time: 2000 });
}


function AError(ncontent) {
    layer.alert(ncontent, { icon: 2, title: '提示' });
}

function AErrorMsg(ncontent) {
    layer.msg(ncontent, { icon: 2, title: '提示', shade: [0.3, '#000'], time: 2000 });
}

function ASuccess(ncontent) {
    layer.alert(ncontent, { icon: 6 });
}

function AMessage(ncontent) {
    layer.msg(ncontent, { icon: 2, shade: [0.3, '#000'], time: 2000 });
}

function AlertUrlError(content, url, isParent) {
    layer.msg(content, { icon: 2, shade: [0.3, '#000'], time: 2000 }, function () { isParent ? parent.location.href = url : window.location.href = url; });
}

function AlertUrl(content, url, isParent) {
    layer.msg(content, { time: 2000 }, function () { isParent ? parent.location.href = url : window.location.href = url; });
}

function AlertUrlRight(content, url, isParent) {
    layer.msg(content, { icon: 1, shade: [0.3, '#000'], time: 2000 }, function () { isParent ? parent.location.href = url : window.location.href = url; });
}

function AlertRight(content, isParent) {
    layer.msg(content, { icon: 1, shade: [0.3, '#000'], time: 2000 }, function () { isParent ? parent.location.reload() : window.location.reload(); });
}

function AlertClose(content) {
    layer.msg(content, { time: 2000 }, function () { parent.layer.closeAll(); });
}

//load
function Loading() {
    var title = arguments[0] != undefined ? arguments[0] : '数据提交中，请稍候...';
    var index = layer.msg(title, {
        icon: 16,
        time: 0,
        skin: 'layui-layer-rim',
        shadeClose: false,
        shade: 0
    });
    return index;
}

function CloseLoad(index) {
    layer.close(index);
}

//添加
function Add() {
    OpenUrl(arguments[0], arguments[1], arguments[2], arguments[3]);
}

function OpenUrl() {
    var url = arguments[0];
    var title = arguments[1];
    var width = (arguments[2] != undefined && arguments[2] != 0) ? arguments[2] + "px" : $(window).width() - 40 + "px";
    var height = (arguments[3] != undefined && arguments[3] != 0) ? arguments[3] + "px" : "85%";

    layer.open({
        type: 2,
        title: title,
        skin: 'layui-layer-rim',
        shadeClose: true,
        shade: 0.5,
        area: [width, height],
        content: url
    });
}

function CloseFrame() {
    var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
}

function GetUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return decodeURI(r[2]); return "";
}

function Redirect(href) {
    window.location.href = href;
}
