
function suitClass() {} // empty class constructor
var suit = new suitClass(); // create and instance

// properties of suitClass

suitClass.prototype.pReturnValue = false;
suitClass.prototype.pIntCount = 0;

  //various whitespace properties to work around RegExp cross-browser bugs

suitClass.prototype.pStrWhitespace = new String(" \t\n\r\f");
suitClass.prototype.pArrWhitespace = new Array(suit.pStrWhitespace.length);
for (suit.pIntCount; suit.pIntCount < suit.pStrWhitespace.length; suit.pIntCount++)
{
  suitClass.prototype.pArrWhitespace[suit.pIntCount] = suit.pStrWhitespace.charAt(suit.pIntCount);
}
suit.pIntCount = 0; // reset 


// methods of suitClass

suitClass.prototype.pBrowser = function() { // version 1.0
  var strBr, strApp, intMS, v, strIndex;
    // start by assuming W3C DOM compliant browser
  strBr = "w3c";
  strApp = navigator.appName;
  intMS = strApp.indexOf("Microsoft");

  v = parseInt(navigator.appVersion);  // store the browser version number
  if (v==4 && (intMS != -1))
  {
    strIndex = navigator.appVersion.indexOf("MSIE ") + 5;
    v = parseInt(navigator.appVersion.charAt(strIndex));
  }

  if (v == 4 && document.layers) strBr = "ns4";
  if (v == 4 && (intMS != -1)) strBr = "old";
  if (v <= 3) strBr = "old";

  return strBr;
}

suitClass.prototype.pGetObject = function(objIn, doc) // version 1.2
{
  var objOut, strBr, i;
  if (!doc) doc = document;
  strBr = suit.pBrowser();

  if (strBr == "w3c")
  {
    objOut = doc.getElementById(objIn);
  }
  else if (strBr == "ns4")
  {
    objOut = doc[objIn];
    if (!objOut) for (i=0;i<doc.forms.length;i++) objOut = doc.forms[i][objIn];
    if (!objOut) for (i=0;i<doc.layers.length;i++) objOut = suit.pGetObject(objIn,doc.layers[i].document);
  }
  else {
    objOut = suit.pBrError();
  }

  return objOut;
}

suitClass.prototype.pBrError = function()
{
  alert(
    "This web site uses the Simple User Interface Toolkit (S.U.I.T)./n" +
    "Your browser is not compatible with S.U.I.T. You may experience errors.");
}

suitClass.prototype.pIsBlank = function(strInput) // version 2.0
{
  var i, j, strCharacter, strToEval;
  for (i = 0; i < strInput.length; i++) // for the lnumber of characters in "strInput"
  {
    strCharacter =  strInput.charAt(i);
    strToEval = "strCharacter != suit.pArrWhitespace[0]";
    for (j = 1; j < suit.pArrWhitespace.length; j++)// for the number of character elements in SUIT's array of whitespace characters
    { 
      strToEval += "&& strCharacter != suit.pArrWhitespace[" + j + "]";
    }
    if (eval(strToEval))  return false;
  }
  return true;
}

suitClass.prototype.pCharCounter = function(strInput, strChar)
{
  var i, intCount;
  intCount =0;
  for (i = 0; i < strInput.length; i++) if (strInput.charAt(i) == strChar) intCount = intCount + 1;
  return intCount;
}

// End suitClass methods.


