﻿function myAlert(con) {
    art.dialog({
        content: con,
        lock: true,
        width: '280',
        height: '50'
    }, function () {
        this.close();
    });
}

function DlgForm(url, stitle, swidth, sheight) {
    if (!stitle) {
        stitle = "操作窗口";
    }
    if (!swidth) {
        swidth = '680px';
    }
    if (!sheight) {
        sheight = '550px'
    }
    window.top.art.dialog.open(url, {
        id: 'formDlg',
        title: stitle,
        width: swidth,
        height: sheight,
        lock: true,
        background: '#FFF', // 背景色
        opacity: 0.67,
        ok: function () {
            var iframe = this.iframe.contentWindow;
            if (!iframe.document.body) {
                alert('iframe还没加载完毕呢')
                return false;
            };
            var form = iframe.document.getElementById('dosubmit').click();

            form.submit();
            window.top.art.dialog({ id: 'formDlg' }).close();
            return false;
        },
        cancel: true,
        fixed: true
    });
}
function DlgForm2(url, stitle, swidth, sheight) {
    if (!stitle) {
        stitle = "操作窗口";
    }
    if (!swidth) {
        swidth = '680px';
    }
    if (!sheight) {
        sheight = '550px'
    }
    window.top.art.dialog.open(url, {
        id: 'formDlg',
        title: stitle,
        width: swidth,
        height: sheight,
        lock: true,
        background: '#FFF', // 背景色
        opacity: 0.67,
        cancel: true,
        fixed: true
    });
}
function openwinx(url, name, w, h) {
    if (!w) w = screen.width - 4;
    if (!h) h = screen.height - 95;
    window.open(url, name, "top=100,left=400,width=" + w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
}
function replaceall(str, sptr, sptr1) {
    while (str.indexOf(sptr) >= 0) {
        str = str.replace(sptr, sptr1);
    }
    return str;
}
function popimgbox(addr, title) {
    if (!title)
    { title = "图片展示"; }
    if (addr != "") {

        window.top.art.dialog({
            padding: 0,
            title: title,
            content: '<img src="' + addr + '"  />',
            lock: true,
            fixed: true
        });
    }
    else {
        alert("没有要预览的图片！");
    }
}

function showcaseDlg(ids,cateid ,title) {
    if (!title)
    { title = "案例展示"; }
    else {
        title += "-案例展示";
    }
    var dialog = window.top.art.dialog({
        id: 'ajaxcase',
        padding: '5px',
        title: title,
        background: '#FFF', // 背景色
        opacity: 0.67,
        lock: true,
        fixed:true
    });
    $.ajax({
        url: "/ajaxpage/showcontent.aspx?time=" + new Date().getTime() + "&id=" + ids+"&cateid="+cateid,
        success: function (data) {
            dialog.content(data);
        },
        cache: false
    });
}
