﻿var URLStr;
function popUpWindow() 
{
    var args = popUpWindow.arguments
    if (args.length < 3) {
        alert('Minimum parameters required are Url,width,height');
        return;
    }

    URLStr = args[0];

    if (typeof ChangeurlforPopUP != "undefined") {
        ChangeurlforPopUP();
    }

    var width = args[1];
    var height = args[2];
    var modalwindow = '';
    var obj;
    if (args.length >= 4) {
        modalwindow = args[3];
        if (args.length = 5) {
            obj = args[4];
        }
    }
    modalwindow = 'true' 
    
    var left = (screen.width / 2) - width / 2;
    var top = (screen.height / 2) - height / 2;
    var style = 'dialogHeight:' + height + 'px;';
    style += ' dialogWidth:' + width + 'px;';
    style += ' dialogTop:' + top + 'px;';
    style += ' dialogLeft:' + left + 'px;';
    style += ' edge:Raised;Center: Yes; help: no; resizable:yes;scroll:yes;status:no;maximize:yes;minimize:yes;';
    var retVal;

    if (modalwindow == 'true') {
        retVal = window.showModalDialog(URLStr, obj, style);
        return (retVal);
    }
    else {
        retVal = window.showModelessDialog(URLStr, 'oWnd', style);
        return (retVal);
    }
}
