﻿function OpenProgram(URL, name, f) {
    if (f == -1) {
        w = screen.width;
        h = screen.height;
    } else {
        w = (screen.width - 20);
        h = (screen.height - 100);
    }

    params = '';
    window.open(URL, name, params + 'width=' + w + ', height=' + h + ', left=1, top=1, location=0,status=1,scrollbars=1');

}
function closeWindow() {
    //var browserName = navigator.appName;
    //var browserVer = parseInt(navigator.appVersion);
    var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;

    if (ie7) {
        window.open('', '_parent', '');
        window.close();
    }
    else {
        this.focus();
        self.opener = this;
        self.close();
    }
    var ie6 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
    if (ie6) {
        window.open('', '_parent', '');
        window.close();
    }
    else {
        this.focus();
        self.opener = this;
        self.close();
    }
}
function OpenUser(URL) {
    var params = '';
    var vReturnValue;
    if (URL != null) {
        vReturnValue = window.showModalDialog(URL, self, 'dialogWidth:' + 400 + 'px;dialogHeight:' + 300 + 'px;location=0;status=1;scroll=1');
        //vReturnValue = window.showModalDialog(URL, 'Open', params + 'width=' + 1000 + ', height=' + 650 + ', location=0,status=1,scrollbars=1;resizable: Yes');
    }
}
function refreshParent() {
    window.opener.location.href = window.opener.location.href;
    if (window.opener.progressWindow) {
        window.opener.progressWindow.close()
    }
    window.close();
} 
