function setFocus()
{
var oElem  = document.getElementById("managersystemname");
oElem.focus();
}

function systemNotAvailable(oDiv, sSystemName)
{
var sMsg;
var oText1;
var oText2;
var oNode;

sMsg = "The given system is not available:";

if (oDiv.childNodes.length == 0)
    {
    oText1 = document.createTextNode(sMsg);
    oDiv.appendChild(oText1);	
    oNode  = document.createElement("br");
    oDiv.appendChild(oNode);	
    oText2 = document.createTextNode(sSystemName + ".");
    oDiv.appendChild(oText2);	
    } 	
else if (oDiv.childNodes.length == 3)
    {
    oText2 = oDiv.childNodes[2];
    oText2.data = sSystemName + ".";
    }
else
    {
    oText1 = document.createTextNode(sMsg + " " + sSystemName + ".");
    }
}

function goStats()
{
var oDiv;
var sLoc   = "login.html";
var oName  = document.getElementById("statssystemname");
var sValue = new String(oName.value);

sValue = sValue.toLowerCase();

if ((sValue.match("h8")) && (sValue.length == 2))
    {
    sLoc = "http://ritpz02581.rithmic.com:41080/st/pages/rithmic_et.jsp";
    }
else if ((sValue.match("zen-fire")) && (sValue.length == 8))
    {
    sLoc = "http://ritpz02503.rithmic.com:41090/st/pages/rithmic_et.jsp";
    }
else if ((sValue.match("rgmc")) && (sValue.length == 4))
    {
    sLoc = "http://ritpz02501.rithmic.com:41080/st/pages/rithmic_et.jsp";
    }
else if ((sValue.match("rgml")) && (sValue.length == 4))
    {
    sLoc = "http://ritpz06002.rgmadvisors.com:41080/st/pages/rithmic_et.jsp";
    }
else if ((sValue.match("fway")) && (sValue.length == 4))
    {
    sLoc = "http://ritpz02508.rithmic.com:41080/st/pages/rithmic_et.jsp";
    }
else if ((sValue.match("tp01")) && (sValue.length == 4))
    {
    sLoc = "http://ritpz01001.01.rithmic.com:40080/st/pages/rithmic_et.jsp";
    }
else if ((sValue.match("sac")) && (sValue.length == 3))
    {
    sLoc = "http://ritpz01003.01.rithmic.com:40080/st/pages/rithmic_et.jsp";
    }
else
    {
    oDiv = document.getElementById("invalidstatsdiv");	
    systemNotAvailable(oDiv, sValue);
    return;
    }

window.location = sLoc;
}

function goManager()
{
var oDiv;
var sMsg;
var oText;
var sLoc   = "login.html";
var oName  = document.getElementById("managersystemname");
var sValue = new String(oName.value);

sValue = sValue.toLowerCase();

if (sValue.match("rm") && (sValue.length == 2))
    {
    sLoc = "https://rittz01000.01.rithmic.com:40080/rm/pages/rm.jsp";
    }
else
    {
    oDiv = document.getElementById("invalidmanagerdiv");	
    systemNotAvailable(oDiv, sValue);
    return;
    }

window.location = sLoc;
}
