// EXTERNAL VARIABLE
//   isTAImport -- true/false


function openCG(broker, instruction, short)
{
    //URL host name
    if (cgServer == "cg1") {
        server = "Conversion-Gateway.com"; //Revelations
    }
    else {
        server = "209.164.6.146"; //XO
    }

    action = "http://" + server + "/tg/conversion/";

    if (isTAImport) {
        var outputType = document.output.outputType;
        if (outputType != '' && outputType.checked) {
            alert('CSV Output Mode');
            action += "ta_part1.jsp?brk=" + broker;
        }
        else {
            action += "ofx_part1.jsp?brk=" + broker;
        }
    }
    else {
        action += "part1.jsp?brk=" + broker;
    }

    if (instruction != '') {
        action += "&instr=" + instruction;
    }

    if (!short) {
        action += "&sh=n";
    }

    if (isTAImport) {
        window.location.href = action;
    }
    else {
        window.open(action,'','width=725,height=600,resizable=yes,toolbar=no,location=no,status=no,scrollbars=yes');
    }
}
