
    function List(x) {                          // Construct a list.
	this.count     = new Number()      ;
        if ((x == undefined) || (x == null)) {
           x = ""                         ;
	}
	this.assign(x)                     ;
    }
    
    List.prototype.assign = function(x) {       // Assign the data to a list.
        var str = new String(x)            ;
	this.listArray = str.split(",")    ;
        this.count = 0                     ;
    }


    List.prototype.reset = function () {        // Reset the sequential list retrieval.
        this.count = 0                     ;
    }

    List.prototype.iterate = function () {      // Select a items from a list sequentially.
        return (this.listArray[this.count++])   ;
    }

    List.prototype.item    = function (i) {     // Select a particular item from a list.
        return (this.listArray[i])         ;
    }
   
    List.prototype.eof     = function()   {     // Determine if more characters exist in list.
        return (isNaN(this.listArray[this.count])) 
    }

    List.prototype.sort    = function(x)  {
        this.listArray.sort(x)             ;
    }

   function StatisticsProblem(x) {              // Construct a Statistics Problem Storage location.
       this.PartsList = new Array()        ;
       this.Stuff = new String()           ;
       
       if ((x == undefined) || (x == null)) {
           x = ""                          ;
       }
       this.assign(x)                      ;
   }
   
   StatisticsProblem.prototype.assign = function(x) { // Assign a string as a statistics problem.
       this.Stuff = x                      ;
       this.PartsList  = x.split(":")   ;
   }
   
   StatisticsProblem.prototype.type = function() {    // Retrive the statistics problem type.
       var buff    = new String()          ;
       var pattern = new RegExp ("^mode|^median|^mean") ;
       buff = (this.PartsList[0]).match(pattern)  ;
       if (buff == null) {
           buff = "EMPTY - TYPE"           ;
       }
       return buff                         ;
   }
   
   StatisticsProblem.prototype.list = function() {   // Retrive the list of numbers to be examined.
       var buff    = new String()          ;
       var pattern = new RegExp (" [, 0-9]+") ;   
       buff = (this.PartsList[1]).match(pattern)  ;
       if (buff == null) {
           alert("STATISTICS - LIST")      ;
           buff = "EMPTY - LIST"           ;
       }
       return buff                         ;
   }

  
   

