﻿
//[说明] 为新打开窗口提供载入提示，在此设置一个提示页的连接。此变量可在用户代码中重设。
//       不使用请设为""。
var loadingPage = "";

//[说明] 为新打开窗口提供载入提示，在此设置一个提示页的 HTML。此变量可在用户代码中重设。
//       不使用请设为""。
var loading = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>系统正在处理中，请等待......</title></head><body style=\"cursor: progress;background-position: center center; background-image: url('Images/Loading.gif');background-repeat: no-repeat;\"></body></html>";

//[说明] 子窗口的控制变量，为了实现让重复弹出的子窗口获得焦点。
var subObject;

//[功能] 打开一个新窗口。
//[返回] 返回对窗口的引用。
//[参数] resize（文本）：是否可以重新调整大小"yes"或"no"。other（文本）：其他参数。
function openWindow(url, width, height, frameName, resize, other) {
    if (!width)
        width = 700;
    if (!height)
        height = 500;
    if (resize != "yes")
        resize = "yes";
    if (!frameName)
        frameName = "Default";
    if (!other)
        other = ", Toolbar=yes, Location=yes, Status=yes, Menubar=yes, Scrollbars=yes";
    else
        if (other != "")
        other = "," + other;

    l = (screen.width - width) / 2 - 5;
    t = (screen.height - height) / 2 - 20;

    if (subObject)
        subObject.close();
    subObject = window.open(loadingPage, frameName,
	"Resizable=" + resize + ", Width=" + width + ", Height=" + height + ", Left=" + l +
	", Top=" + t + other);
    if (loading != "")
        subObject.document.write(loading);
    subObject.document.location.href = url;
    return subObject;
}
