﻿function OpenHelp(URL, NAME) {
    var winl = (screen.width - 500) / 2;
    var wint = (screen.height - 500) / 2;
    winprops = 'height=500,width=500,top=' + wint + ',left=' + winl + ',scrollbars=Yes,menubar=No,status=No,toolbar=No,resizable=Yes'

    if (URL.indexOf('nc=0') < 0) {
        if (URL.indexOf('?') < 0) {
            URL = URL + '?nc=0'
        }
        else {
            URL = URL + '&nc=0'
        }
    }

    var newWin = window.open(URL, NAME, winprops);
    newWin.focus()
}

function OpenHelpCustom(URL, NAME,width,height) {
    var winl = (screen.width - 500) / 2;
    var wint = (screen.height - 500) / 2;
    winprops = 'height='+ height+',width='+width+',top=' + wint + ',left=' + winl + ',scrollbars=Yes,menubar=No,status=No,toolbar=No,resizable=Yes'

    if (URL.indexOf('nc=0') < 0) {
        if (URL.indexOf('?') < 0) {
            URL = URL + '?nc=0'
        }
        else {
            URL = URL + '&nc=0'
        }
    }

    var newWin = window.open(URL, NAME, winprops);
    newWin.focus()
}

function OpenHelpNavigation(URL, NAME) {
    var winl = (screen.width - 920) / 2;
    var wint = (screen.height - 500) / 2;
    winprops = 'height=500,width=920,top=' + wint + ',left=' + winl + ',scrollbars=Yes,menubar=No,status=No,toolbar=No,resizable=Yes'

    if (URL.indexOf('nc=0') < 0) {
        if (URL.indexOf('?') < 0) {
            URL = URL + '?nc=0'
        }
        else {
            URL = URL + '&nc=0'
        }
    }

    var newWin = window.open(URL, NAME, winprops);
    newWin.focus()
}

function OpenSurveyWindow(URL, NAME) {
    var winl = (screen.width - 600) / 2;
    var wint = (screen.height - 700) / 2;
    winprops = 'height=700,width=600,top=' + wint + ',left=' + winl + ',scrollbars=Yes,menubar=No,status=No,toolbar=No,resizable=Yes'

    if (URL.indexOf('nc=0') < 0) {
        if (URL.indexOf('?') < 0) {
            URL = URL + '?nc=0'
        }
        else {
            URL = URL + '&nc=0'
        }
    }

    var newWin = window.open(URL, NAME, winprops);
    newWin.focus()
}