﻿/* 屏蔽右s键 */
function nocontextmenu() {
    event.cancelBubble = true;
    event.returnValue = false;
    return false;
}
//document.oncontextmenu = nocontextmenu;



/*****************************************************/

/* 打开窗口 */
function openwin(url, w, h) {
    vReturnValue = window.showModelessDialog(url, window, "dialogWidth=" + w + "px;dialogHeight=" + h + "px;status:no;scroll:yes;help:no;");
    return vReturnValue;
}
/* 打开窗口 模态 */
function openwinm(url, w, h) {
    vReturnValue = window.showModalDialog(url, window, "dialogWidth=" + w + "px;dialogHeight=" + h + "px;status:no;scroll:yes;help:no;");
    return vReturnValue;
}


//showbutton:1显示对话框按钮；0不显示
function popwin(url, title, w, h, callback, showbutton,para) {
    var s = "";
    s = '<div id="day_div">';
    s += '  <iframe frameborder="0" name="day_frm" id="day_frm" width="100%" height="100%" style="margin:0px;padding:0px;" src="' + url + '" onload=""></iframe>';
    s += '</div>';

    $("body").append(s);

    if (showbutton == 1) {
        $("#day_div").dialog({ autoOpen: false, modal: true, title: title, position: "center", height: h, width: w,
            close: function() { /*$('select').show();*/$("#day_div").replaceWith("") },
            buttons: {
                '取消': function() { $(this).dialog("close"); },
                '确定': function() { execScript(callback(para)); $(this).dialog("close"); window.location.reload(); }
            }
        });
    }
    else {
        $("#day_div").dialog({ autoOpen: false, modal: true, title: title, position: "center", height: h, width: w,
            close: function() { /*$('select').show();*/$("#day_div").replaceWith("") }
        });
    }

    //$('select').hide();

    $('#day_div').dialog('open');

}
function popwinclose() {
    $('#day_div').dialog('close');
}

function popdiv(divid, title, w, h, callback) {
    $("#" + divid).dialog({ autoOpen: false, modal: true, title: title, position: "center", height: h, width: w,
        close: function() { },
        buttons: {
            '取消': function() { $(this).dialog("close"); },
            '确定': function() { execScript(callback()); $(this).dialog("close"); }
        }
    });

    $('#' + divid).dialog('open');
}
/*****************************************************/
