/*
----------- FundSys.net(TM) Copyright SySys(R) Corp 2002 ------------
====================================================================
  Created By: BH
  Last Edited By: BH
  Inception Date: 1/1/2002
  Last Edited Date: 1/1/2002
  Description:  None
  File Dependencies: None
===================================================================''*/

/*'''---------------------------------
'' split(str,[delimiter])
--------------------------------------
   Created By: SySys:bh
   Compatibility: IE6
   Description: Splits items from a string into an array where each item is seperated by the give delimiter
   Parameters:
     str: String to split into array
     delimiter: (optional) Delimiter to split items with (default is comma)
   Returns: Array of items that were split (without delimiter)
----------------------------------'''*/ 
function split(str, delimiter){
  if(delimiter==null){delimiter=',';}
  if ((str.length < 1) || (delimiter.length < 1))
    return false;
  var ary = new Array();
  var count = 0;
  var lastPos = -1;
  var curPos = 0;
  //move throught the string spliting each element out and place into array  
  while (curPos != lastPos){
    //reset (allows us to enter loop for first time)
    if(lastPos==-1){
      //reset value of lastPos
      lastPos=0;
    }
    curPos = str.indexOf(delimiter, curPos+1);
    //set the element after the last delimiter and return the array
    if(curPos < 0){
      // ary[count] get set to the values of str.substring
      ary[count] = str.substring(lastPos, str.length );
      return ary;
    }
    //continue if the curPos is not greater than the length of the string
    if(curPos <= str.length){
      ary[count] = str.substring(lastPos , curPos);
      //increment counts
      count += 1;
      lastPos = curPos + 1 ;
      //curPos += 1;
    }  
  } 
  return ary;     
}


/*'''---------------------------------
'' makeArray(n)
--------------------------------------
   Created By: SySys:bh
   Compatibility: IE6
   Description: Creates an array (support for old browsers that do not support Array Constructor)
   Parameters:
     n: Number of elements in array
   Returns: Array of items that were split (without delimiter)
   Notes: Attempting to make this library run on Navigator 2.0,
     so I'm supplying this array creation routine as per
     JavaScript 1.0 documentation.  If you're using 
     Navigator 3.0 or later, you don't need to do this;
     you can use the Array constructor instead.
----------------------------------'''*/ 
function makeArray(n) {
  for (var i = 1; i <= n; i++) {
    this[i] = 0
  } 
  return this
}