﻿function BrowserNavigate(page) {
    var browser_type = navigator.appName;
    var browser_version = parseInt(navigator.appVersion);
    //if NS 6
    if (browser_type == "Netscape" && browser_version >= 5)
        window.location.replace(page);
    //if IE 4+
    else if (browser_type == "Microsoft Internet Explorer" && browser_version >= 4)
        window.location.replace(page);
    //if NS4+
    else if (browser_type == "Netscape" && browser_version >= 4)
        window.location.replace(page);
    //Default goto page (NOT NS 4+ and NOT IE 4+)
    else
        window.location = page;
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll,resize){
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings =
    'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',resizable' + resize;
    win = window.open(mypage,myname,settings)
}

/* function used to pop elastic windows */
// pop-up function
var newWin = null;
function closeWin() {
    if (newWin != null) {
        if (!newWin.closed)
            newWin.close();
    }
}

function popUp(url, width, height) {
    closeWin();
    var x = screen.width;
    var y = screen.height;
    var parms;
    //var strOptions = "scrollbars,resizable,height=" + height + ",width=" + width;    
    
    if (width != 0 && height != 0) {
        x = width;
        y = height;
    }
    else if (x > 799) {
        x = screen.width - 10;
        y = screen.height - 80;
    }
    parms = new String("width=" + x + ",height=" + y + ",scrollbars=yes,menubar=visible,statusbar=yes,status=yes,location=no,toolbar=no,history=no,resizable=yes,screenX=0,screenY=0,top=0,left=0");
    newWin = window.open(url, 'newWin', parms);
    newWin.focus();
}
