var arrItems1 = new Array();
var arrItemsGrp1 = new Array();

arrItems1[1] = "Bowls club";
arrItemsGrp1[1] = 1;	
arrItems1[2] = "Church of Scotland Guild";
arrItemsGrp1[2] = 1;	
arrItems1[3] = "Companies";
arrItemsGrp1[3] = 1;	
arrItems1[4] = "Emergency Services";
arrItemsGrp1[4] = 1;	
arrItems1[5] = "Football";
arrItemsGrp1[5] = 1;	
arrItems1[6] = "Forces Clubs";
arrItemsGrp1[6] = 1;	
arrItems1[7] = "Golf";
arrItemsGrp1[7] = 1;	
arrItems1[8] = "Lions";
arrItemsGrp1[8] = 1;	
arrItems1[9] = "Other Contracts";
arrItemsGrp1[9] = 1;	
arrItems1[10] = "Other Schools";
arrItemsGrp1[10] = 1;	
arrItems1[11] = "Other Societies";
arrItemsGrp1[11] = 1;	
arrItems1[12] = "Other Sports";
arrItemsGrp1[12] = 1;	
arrItems1[13] = "Police";
arrItemsGrp1[13] = 1;	
arrItems1[14] = "Primary Schools";
arrItemsGrp1[14] = 1;	
arrItems1[15] = "RAFA";
arrItemsGrp1[15] = 1;	
arrItems1[16] = "RNA";
arrItemsGrp1[16] = 1;	
arrItems1[17] = "Rotary";
arrItemsGrp1[17] = 1;	
arrItems1[18] = "Rover";
arrItemsGrp1[18] = 1;	
arrItems1[19] = "RSCDS";
arrItemsGrp1[19] = 1;	
arrItems1[20] = "Secondary Schools";
arrItemsGrp1[20] = 1;	
arrItems1[21] = "SWRI";
arrItemsGrp1[21] = 1;	
arrItems1[22] = "Symbol Specials";
arrItemsGrp1[22] = 1;	
arrItems1[23] = "Big Promotions Companies";
arrItemsGrp1[23] = 2; 
arrItems1[24] = "Bowls retailers";
arrItemsGrp1[24] = 2; 
arrItems1[25] = "Bowls wholesalers";
arrItemsGrp1[25] = 2; 
arrItems1[26] = "Brands";
arrItemsGrp1[26] = 2; 
arrItems1[27] = "Club Suppliers";
arrItemsGrp1[27] = 2; 
arrItems1[28] = "Corp-wear+Workwear";
arrItemsGrp1[28] = 2; 
arrItems1[29] = "Cricket Shops";
arrItemsGrp1[29] = 2; 
arrItems1[30] = "Department Stores";
arrItemsGrp1[30] = 2; 
arrItems1[31] = "Distillery Shops";
arrItemsGrp1[31] = 2; 
arrItems1[32] = "Embroiderers";
arrItemsGrp1[32] = 2; 
arrItems1[33] = "Exporters";
arrItemsGrp1[33] = 2; 
arrItems1[34] = "Factory Outlets";
arrItemsGrp1[34] = 2; 
arrItems1[35] = "Football Clubs";
arrItemsGrp1[35] = 2; 
arrItems1[36] = "Gift Shop";
arrItemsGrp1[36] = 2; 
arrItems1[37] = "Golf brands";
arrItemsGrp1[37] = 2; 
arrItems1[38] = "Golf retail/pros";
arrItemsGrp1[38] = 2; 
arrItems1[39] = "Golf wholesalers";
arrItemsGrp1[39] = 2; 
arrItems1[40] = "Heritage Shops";
arrItemsGrp1[40] = 2; 
arrItems1[41] = "Mail Order";
arrItemsGrp1[41] = 2; 
arrItems1[42] = "Manufacturers";
arrItemsGrp1[42] = 2; 
arrItems1[43] = "Nat Organisations";
arrItemsGrp1[43] = 2; 
arrItems1[44] = "Other Trade";
arrItemsGrp1[44] = 2; 
arrItems1[45] = "Outdoor wholesalers";
arrItemsGrp1[45] = 2; 
arrItems1[46] = "Outfitters";
arrItemsGrp1[46] = 2; 
arrItems1[47] = "Promotions+Gifts";
arrItemsGrp1[47] = 2; 
arrItems1[48] = "Rugby";
arrItemsGrp1[48] = 2; 
arrItems1[49] = "Rugby";
arrItemsGrp1[49] = 2; 
arrItems1[50] = "School Suppliers";
arrItemsGrp1[50] = 2; 
arrItems1[51] = "Schoolwear brands";
arrItemsGrp1[51] = 2; 
arrItems1[52] = "Scottish Shops";
arrItemsGrp1[52] = 2; 
arrItems1[53] = "Screen Printers";
arrItemsGrp1[53] = 2; 
arrItems1[54] = "Sports mfgr/whlslr";
arrItemsGrp1[54] = 2; 
arrItems1[55] = "Sports retailers";
arrItemsGrp1[55] = 2; 
arrItems1[56] = "Wholesalers";
arrItemsGrp1[56] = 2;

function selectChange(control, controlToPopulate, ItemArray, GroupArray) {
  var myEle ;
  var x ;
  // Empty the second drop down box of any choices
  for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
  if (control.name == "firstChoice") {
    // Empty the third drop down box of any choices
    for (var q=form.thirdChoice.options.length;q>=0;q--) form.thirdChoice.options[q] = null;
  }
  // ADD Default Choice - in case there are no values
  myEle=document.createElement("option");
  theText=document.createTextNode("Choose...");
  myEle.appendChild(theText);
  myEle.setAttribute("value","0");
  controlToPopulate.appendChild(myEle);
  // Now loop through the array of individual items
  // Any containing the same child id are added to
  // the second dropdown box
  control_value = control.value
//	if (control_value==2 || control_value==3)  {
//	control_value=1;
//	}
  
  for ( x = 0 ; x < ItemArray.length  ; x++ ) {
    if ( GroupArray[x] == control_value ) {
      myEle = document.createElement("option") ;
      //myEle.value = x ;
      myEle.setAttribute("value",x);
      // myEle.text = ItemArray[x] ;
      var txt = document.createTextNode(ItemArray[x]);
      myEle.appendChild(txt)
      // controlToPopulate.add(myEle) ;
      controlToPopulate.appendChild(myEle)
    }
  }
}

