////////////////////////////////////////////////////////////////////////////
// SRN FUNCTIONS
// srnfunctions.js
// Generic JavaScript functions.
////////////////////////////////////////////////////////////////////////////

function LoadForm(oFrame) {
        oFrame.document.open();
        oFrame.document.write('<html><body><form name="frmLoadFrame"><input type="hidden" name="SERVICE" value="SCRIPTER"><input type="hidden" name="SCRIPT" value=""><input type="hidden" name="ON" value=""><input type="hidden" name="STU_ID" value=""></form></body></html>');
        oFrame.document.close();
}

function LoadFrameForms() {
        LoadForm(theTab);
        LoadForm(theSel);
        LoadForm(theBody);
        LoadForm(theLeft);
        LoadForm(theRight);
        LoadForm(theFooter);
}

////////////////////////////////////////////////////////////////////////////
// TRIM
// Remove the specified character from the front and end of the string.
// Return the new string.
////////////////////////////////////////////////////////////////////////////
function Trim(myString, trimCharacter)
{
    // Handle the error if trimCharacter is too long
    if (trimCharacter.length > 1){
        alert("Trim error: '" +
        trimCharacter +
        "' is more than one character long.");
        return (myString);
    }
    // Make a copy of the string to work with
    newString = myString;

    // Remove the leading characters
    while (newString.charAt(0) == trimCharacter) {
        newString = newString.substring(1,newString.length);
    }
    // Remove the trailing characters
    while (newString.charAt(newString.length - 1) == trimCharacter) {
        newString = newString.substring(0,newString.length - 1);
    }

    return (newString);
} // trim

////////////////////////////////////////////////////////////////////////////
// TRIM SPACES
// Remove spaces from the front and end of the string.
// Return the new string without the spaces at the start or end.
////////////////////////////////////////////////////////////////////////////
function TrimSpaces (sMyString)
{
sNewString = Trim (sMyString, " ");
return (sNewString);
} // trimspaces

////////////////////////////////////////////////////////
function IsBlank(sString)
{
for (var iNdx = 0; iNdx < sString.length; iNdx++)
   {
   if (sString.charAt(iNdx) != ' ')
      return (false); // String is NOT blank
   } // end for
return (true);  // String is blank
} // end isblank

