function catchDataInterface(command) {
    var strAnswer = unFormatFlashString(window.document.DataInterface.GetVariable("Answer"));
    aryReturn = strAnswer.split(Seperate(0));
    objReturn = new Object();
    objReturn.Status = aryReturn[0];
    objReturn.Message = aryReturn[1];
    objReturn.Operation = aryReturn[2];
    objReturn.Data = aryReturn[3];
    if (objReturn.Status == "FAILURE") {
        if (window.document.DataInterface.GetVariable("ShowAlert") == "True") alert("The following error has occured: " + objReturn.Message);
        dataReturn(command, objReturn, false);
    } else {
        dataReturn(command, objReturn, true);
    }
}

function dataReturn(command, args) {
    if (command != "") {
        var aryBranches = args.Data.split(Seperate(1));
        var aryBranch
        var strOutput = "We have immediate needs for Nursing and Allied Health Professionals for contract and per diem opportunities across the state.  Please contact a Recruiter today by calling the Regional Branch Office listed below or apply now by completing our quick online application!<br><a href=\"/public/branches/travel/\" class=\"emphasis\">To learn more about National Travel opportunities, click here!</a>";
        var strBranchLinkName = "";
        for (i = 0; i < aryBranches.length; i++) {
            aryBranch = aryBranches[i].split(Seperate(2));
            if (aryBranch[0] > 0) {
                //0=BranchNumber,1=BranchShortName,2=BranchLongName,3=Address1,4=Address2,5=City,6=TCStateCode,7=PostalCode,8=IsWebSiteEnabled,9=VoicePhone,10=LocalPhone,11=BranchEmail				
                strBranchLinkName = replaceAll(aryBranch[2], " ", "_");
                strOutput += "<p><a href=\"/public/branches/AllBranch.aspx?ID=" + strBranchLinkName.toLowerCase() + "\" class=\"link1\">" + FormatNameCase(aryBranch[2]) + "</a><br> \n"
							 + "&nbsp;&nbsp;" + FormatNameCase(aryBranch[3]) + "<br> \n"
                if (aryBranch[4] != "") strOutput += "&nbsp;&nbsp;" + aryBranch[4] + "<br> \n";
                strOutput += "&nbsp;&nbsp;" + FormatNameCase(aryBranch[5]) + ", " + aryBranch[6] + " " + aryBranch[7] + "<br> \n"

                if (aryBranch[9] != "") strOutput += "<span class=\"emphasis\">Toll Free:</span> \n &nbsp;&nbsp;" + aryBranch[9] + "<br> \n";
                if (aryBranch[12] != "") strOutput += "<span class=\"emphasis\">Fax:</span> \n &nbsp;&nbsp;" + aryBranch[12] + "<br> \n";
                strOutput += "<a href=\"mailto:" + aryBranch[11] + "\" class=\"color1\">" + aryBranch[11] + "</a></p> \n";
            }
        }
        if (i <= 1) strOutput = "We have immediate needs for RNs, LPNs and Allied Health Professionals for contract and per diem opportunities across the state.  Please contact a Recruiter today by calling 800-755-1411 or apply now by completing our quick online application!<br><a href=\"/public/branches/travel/\" class=\"emphasis\">To learn more about National Travel opportunities, click here!</a>";
        window.BranchListingsState.innerHTML = command;
        window.BranchListings.innerHTML = strOutput;
    }
}
