      var version=4;
      var current=null;
      var productList=0;
      var categories = Array();

      // start the function that starts the validation
      function doValidate(){
        var error='';
        formobj=document.register; 
        error+=checkText('First Name',formobj.fname.value);
        error+=checkText('Last Name',formobj.lname.value);
        error+=checkText('Address',formobj.address1.value);
        error+=checkText('City',formobj.city.value);
        error+=checkSelect('State',formobj.state);
        error+=checkText('Zip Code',formobj.zipcode.value);
        error+=checkText('e-mail address',formobj.email.value);
        error+=checkDateParam('m','Purchase Date: Month',formobj.month);
        error+=checkDateParam('y','Purchase Date: Year',formobj.year);
        error+=checkSelect('Product',formobj.product);
        
        if(!error){
          formobj.submit();      
        }else{
          alert(error);
        }
      }
      // end the function that starts the validation

      // start the function that checks a text box for definition.
      function checkText(textVal,value){
        if(value != '') return '';
        return 'Required field '+ textVal +' must not be left empty.' + "\n";
      }
      // end the function that checks a text box for definition.
      
      // start the function that checks a select box for selection
      function checkSelect(textVal,obj){
        if(obj.selectedIndex > 0) return '';
        return 'Required field '+ textVal +' must be selected.' + "\n";
      }
      // end the function that checks a select box for selection

      // start the function that checks a radio box for selection
      function checkRadio(textVal,obj){
        for(i=0;i<obj.length;i++) if(obj[i].status==true) return '';
        return 'Required field '+ textVal +' must be selected.' + "\n";
      }
      // end the function that checks a radio box for selection
      
      function checkDateParam(type,textVal,obj){
        var fldLen=0;
        var myRE = /\d/;
        if(type == 'm' || type=='d'){
          fldLen=2;
        }
        if(type == 'y'){
          fldLen=4;
        }
        if(fldLen != 0){
          if(checkText(textVal,obj.value) != '') return checkText(textVal,obj.value);
          if(obj.value.length != fldLen)  return 'Required field '+ textVal +' must be '+ fldLen +' characters in length.' + "\n";
          for(i=0;i<obj.value.length;i++)if(myRE.exec(obj.value.charAt(i))==null)  return 'Required field '+ textVal +' must contail only numerals.' + "\n";
          return '';    
        }
        return 'Internal Error Please contact the webmaster.';
      }
      
  // start the fuction that will drill down the categories in a select box.
  function selectNext(obj){
    if(version >=4 && obj.selectedIndex >= 0){
      if(obj.selectedIndex == 0 || productList == 0){
        productList=0;
        ref=obj.options[obj.selectedIndex].value;
        undefSelect(obj);
        buildSelect(obj,ref);  
        document.register.category.value='';
      }else{
        for(i=0;i<categories.length;i++){
          if(categories[i].id==obj.options[obj.selectedIndex].value){    
            document.register.category.value=categories[i].pid;
          }
        }
      }
    }
  }
  // end the fuction that will drill down the categories in a select box.

  // start the function to clear the select box
  function undefSelect(obj){
     while (obj.length) obj.options[0] = null;
  }
  // end the function to clear the select box

  // start the function to build the new select box
  function buildSelect(obj,sel){
    if(sel != 0){
      for(i=0;i<categories.length;i++){
        if(categories[i].id==sel){ 
          par=categories[i].pid;
        }
      }
      var optionName = new Option('Previous List...',par, false, false);
      obj.options[obj.length] = optionName;
      obj.selectedIndex=-1;
      if(navigator.appName=="Netscape" && navigator.appVersion.charAt(0)==4){
        obj.options[obj.length-1].color='ff0000';
      }else{
        obj.options[obj.length-1].style.color='ff0000';
      }
    }
    thisList = getList(sel);
    if(thisList.length <= 10 && thisList.length >= 0 && sel == 0) obj.size=thisList.length; 
    else if(thisList.length <= 10 && thisList.length > 0) obj.size=(thisList.length+1); 
    else if (thisList.length == 0) obj.size=2; else obj.size=10;
    for(i=0;i<thisList.length;i++){
      if(thisList[i].isProd==1) productList=1;
      var optionName = new Option(thisList[i].name,thisList[i].id, false, false);
      obj.options[obj.length] = optionName;
    }
  }
  // end the function to build the new select box
  
  // start the function to get the list of items in a category.
  function getList(par){
    var myList = new Array();
    for(i=0;i<categories.length;i++){
      if(categories[i].pid==par) myList[myList.length] = categories[i];
    }
    return myList;
  }  
  // end the function to get the list of items in a category.

  // start the function that creates a category/product item
  function listItem(id,pid,name,isProd){
    this.id=id;
    this.pid=pid;
    this.name=name;
    this.isProd=isProd;
  }
  // end the function that creates a category/product item          
