var subName = new Array(23);
var subCategory = new Array(23); 
subName[0]="Semi-Detached";
subCategory[0]="RESIDENTIAL/FARMS"; 
subName[1]="Property_Subtype";
subCategory[1]="property_type";
subName[2]="Commercial";
subCategory[2]="COMMERCIAL/INDUSTRIAL";
subName[3]="Industrial";
subCategory[3]="COMMERCIAL/INDUSTRIAL";
subName[4]="Acreage";
subCategory[4]="LAND";
subName[5]="Lot Exclusive Builder";
subCategory[5]="LAND";
subName[6]="Lot Non-Exclusive Builder";
subCategory[6]="LAND";
subName[7]="Mixed";
subCategory[7]="LAND";
subName[8]="Mobile Home Approved";
subCategory[8]="LAND";
subName[9]="Other";
subCategory[9]="LAND";
subName[10]="Complex";
subCategory[10]="MULTI-FAMILY";
subName[11]="Detached";
subCategory[11]="MULTI-FAMILY";
subName[12]="Duplex";
subCategory[12]="MULTI-FAMILY";
subName[13]="Other";
subCategory[13]="MULTI-FAMILY";
subName[14]="Row";
subCategory[14]="MULTI-FAMILY";
subName[15]="Semi-Detached";
subCategory[15]="MULTI-FAMILY";
subName[16]="Attached";
subCategory[16]="RESIDENTIAL/FARMS";
subName[17]="Condo/Townhouse";
subCategory[17]="RESIDENTIAL/FARMS";
subName[18]="Detached";
subCategory[18]="RESIDENTIAL/FARMS";
subName[19]="Farm";
subCategory[19]="RESIDENTIAL/FARMS";
subName[20]="Mobile Home w/Land";
subCategory[20]="RESIDENTIAL/FARMS";
subName[21]="Mobile Home wo/Land";
subCategory[21]="RESIDENTIAL/FARMS";
subName[22]="Other";
subCategory[22]="RESIDENTIAL/FARMS";
var z = 0;
var r = 0;
var m = 0;
var l = 0;
var c = 0;
function getSubCategories(sel) 
{
removeAllOptions(document.forms['mls'].Property_Subtype);
  var sub;
  var x;
  var getsubcats = sel.options[sel.selectedIndex].value;
  //document.getElementById('choosecategories').options.length = 0;
    for(x = 0; x < 23; x++) {
     sub = subCategory[x].toString();
     if(sub == getsubcats) {
    /*     switch(getsubcats) {
      case "COMMERCIAL/INDUSTRIAL": 
         if (c < 2) {
          document.forms['mls'].subcategories.options[z] = new Option(subName[x],subName[x]);
	  c++;
          z++;
         }

	case "LAND":
         if (l < 6) {
          document.forms['mls'].subcategories.options[z] = new Option(subName[x],subName[x]);
	  l++;
          z++;
         }

	case "MULTI-FAMILY":
         if (m < 6) {
          document.forms['mls'].subcategories.options[z] = new Option(subName[x],subName[x]);
	  m++;
          z++;
         }

	case "RESIDENTIAL/FARMS":
         if (r < 8) {
          document.forms['mls'].subcategories.options[z] = new Option(subName[x],subName[x]);
	  r++;
          z++;
         }
       }
       */
       addOption(document.forms['mls'].Property_Subtype,subName[x],subName[x],true);
//       addOption(document.forms['mls'].Property_Subtype,subName[x],subName[x],false);
        //  z++;
 
      }
     }     
}
