
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;

  strBr = "w3c"; // start by assuming W3C DOM compliant browser
  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(strObjName, strDocName) { // version 2
  var p, strBrowser, obj;

  if (!strDocName) strDocName = document; // if no document name is passed, default

  p = strObjName.indexOf("?");
  strBrowser = suit.pBrowser();

  if (p>0 && parent.frames.length)  // basically, if the doc is part of a frameset
  {
    strDocName = parent.frames[strObjName.substring(p+1)].document;
    strObjName = strObjName.substring(0,p);
  }

  switch(strBrowser)
  {
    case "w3c":
      obj = strDocName.getElementById(strObjName);
      break;
    case "ns4":
      var i;
      obj = strDocName[strObjName];
      for (i=0; !obj && i<strDocName.forms.length; i++) obj = strDocName.forms[i][strObjName];
      for (i=0; !obj && strDocName.layers && i<strDocName.layers.length; i++) obj = suit.pGetObject(strObjName,strDocName.layers[i].document);
      break;
    default:
      suit.pBrError();
      break;
  }

  return obj;
}

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.


