﻿// JScript 文件

function OpenDialogHelper(){};
//模态对话框
OpenDialogHelper.openModalDlg = function(sPath, oArgs, iX, iY)
{
    //增加模态窗口的高度。
    //iY += 30;
    
	return window.showModalDialog(sPath, oArgs, "dialogWidth:" + iX + "px;dialogHeight:" + iY + "px;help:0;status:0;scroll:0;center:1");
};
//打开页面
OpenDialogHelper.openDlg = function(sPath, oArgs, iX, iY)
{
    //增加模态窗口的高度。
    //iY += 30;
    var w=(window.screen.availWidth-iX)/2;
    var h=(window.screen.availHeight-iY)/2;
    return  window.open(sPath,oArgs,"height="+iY+", width="+iX+", top="+h+", left="+w+", toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=n o, status=yes","");
};
var _e_name;
var _e_value;
//打开页面返回值
OpenDialogHelper.openReturn = function(sPath,e_name,iX, iY,e_value)
{
    if(e_name)
        _e_name=e_name;
    if(e_value)
        _e_value=e_value;
    //增加模态窗口的高度。
    //iY += 30;
    var w=(window.screen.availWidth-iX)/2;
    var h=(window.screen.availHeight-iY)/2;
    return  window.open(sPath,"","height="+iY+", width="+iX+", top="+h+", left="+w+", toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=n o, status=yes","");
	//return window.open(sPath, "", "width=" + iX + ",height=" + iY + ",status=yes");
};
//返回值
OpenDialogHelper.closeReturn = function(name,isclose,value)
{
    if(opener._e_name)
        opener._e_name.value=name;
    if(opener._e_value)
        opener._e_value.value=value;
    opener._e_value=null;
    opener._e_value=null;
    if(isclose)
        window.close();
};
