function openCenteredWindow() {

    var width = 1010;
    var height = 650;
    var left = parseInt((screen.availWidth / 2) - (width / 2));
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var randomNumber = Math.floor(Math.random() * 2) + 1;

    switch (randomNumber) {
        case 1:
            var url = 'http://server6.enerlink.ca/EnerLinkNet/enerlink.aspx';
            break;
        case 2:
            var url = 'http://server6.enerlink.ca/EnerLinkNet/enerlink.aspx';
            break;
    }

    // Format Size and location
    var windowFeatures = "width=" + width;
    windowFeatures = windowFeatures + ",height=" + height;
    windowFeatures = windowFeatures + ",left=" + left;
    windowFeatures = windowFeatures + ",top=" + top;
    windowFeatures = windowFeatures + ",screenX=" + left;
    windowFeatures = windowFeatures + ",screenY=" + top;

    // Format Options
    windowFeatures = windowFeatures + ",directories=no";
    windowFeatures = windowFeatures + ",location=no";
    windowFeatures = windowFeatures + ",menubar=no";
    windowFeatures = windowFeatures + ",status=no";
    windowFeatures = windowFeatures + ",toolbar=no";

    // Format Optional Settings
    if (screen.availWidth > 1024 && screen.availHeight > 768) {
        // Wider than 1024 AND higher than 768
        windowFeatures = windowFeatures + ",resizable=no, scrollbars=no";
    }
    else {
        // Lower than 1024 OR narrower than 768
        windowFeatures = windowFeatures + ",resizable=yes, scrollbars=yes";
    }

    // Open requested URL
    myWindow = window.open(url, "subWind", windowFeatures);

    // Check for Popup Blocker
    if (!myWindow) {
        // Pop-Ups Not Allowed - Redirect
        myWindow.close();
        window.location = url;
    }
}

