/* This script is based on one provided by
The JavaScript Source!! http://javascript.internet.com
Revised by: DeWayne Whitaker :: http://www.aecdfw.com
Original by: Andrew Berry 

Modifications by Stephen Mortimer CABC Ltd*/

var arrItems1 = new Array();
var arrItemsGrp1 = new Array();

arrItems1[0] = "Maximizer Enterprise 9.5";
arrItemsGrp1[0] = 1;
arrItems1[1] = "Maximizer Enterprise 9";
arrItemsGrp1[1] = 1;
arrItems1[2] = "Maximizer Enterprise 8";
arrItemsGrp1[2] = 1;
arrItems1[3] = "Maximizer Enterprise 7.5";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Maximizer Enterprise 7";
arrItemsGrp1[4] = 1;

arrItems1[5] = "Maximizer Professional 9";
arrItemsGrp1[5] = 2;
arrItems1[6] = "Maximizer Professional 8";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Maximizer Professional 7";
arrItemsGrp1[7] = 2;

arrItems1[8] = "Max Exchange for Maximizer Enterprise 9.5";
arrItemsGrp1[8] = 3;
arrItems1[9] = "Max Exchange for Maximizer Enterprise 9";
arrItemsGrp1[9] = 3;
arrItems1[10] = "Max Exchange for Maximizer Enterprise 8";
arrItemsGrp1[10] = 3;
arrItems1[11] = "Max Exchange for Maximizer Enterprise 7.5";
arrItemsGrp1[11] = 3;
arrItems1[12] = "Max Exchange for Maximizer Enterprise 7";
arrItemsGrp1[12] = 3;

var arrItems2 = new Array();
var arrItemsGrp2 = new Array();

arrItems2[21] = "Maximizer Enterprise 9.5 Hot Fix 1 for Service Release 1";
arrItemsGrp2[21] = 0
arrItems2[22] = "Maximizer Enterprise 9.5 Service Pack 1 for Service Release 1";
arrItemsGrp2[22] = 0
arrItems2[23] = "Maximizer Enterprise 9.5 Service Release 1";
arrItemsGrp2[23] = 0
arrItems2[24] = "Maximizer Enterprise 9.5 Hot Fix 2";
arrItemsGrp2[24] = 0

arrItems2[31] = "Maximizer Enterprise 9 Hot Fix 2 for Service Release 2";
arrItemsGrp2[31] = 1
arrItems2[32] = "Maximizer Enterprise 9 Service Pack 3 for Service Release 2";
arrItemsGrp2[32] = 1
arrItems2[33] = "Maximizer Enterprise 9 Service Pack 2 for Service Release 2";
arrItemsGrp2[33] = 1
arrItems2[34] = "Maximizer Enterprise 9 Service Pack 1 for Service Release 2";
arrItemsGrp2[34] = 1
arrItems2[35] = "Maximizer Enterprise 9 Hot Fix 1 Service Release 2";
arrItemsGrp2[35] = 1
arrItems2[36] = "Maximizer Enterprise 9 Service Release 2";
arrItemsGrp2[36] = 1
arrItems2[37] = "Maximizer Enterprise 9 Service Release 1";
arrItemsGrp2[37] = 1

arrItems2[40] = "Maximizer Enterprise 8 Hotfix 5";
arrItemsGrp2[40] = 2
arrItems2[41] = "Maximizer Enterprise 8 Hotfix 4";
arrItemsGrp2[41] = 2
arrItems2[42] = "Maximizer Enterprise 8 Hotfix 3";
arrItemsGrp2[42] = 2
arrItems2[43] = "Maximizer Enterprise 8 Service Release 4A";
arrItemsGrp2[43] = 2
arrItems2[44] = "Maximizer Enterprise 8 Service Release 3";
arrItemsGrp2[44] = 2

arrItems2[50] = "Maximizer Enterprise 7.5 Hotfix 7";
arrItemsGrp2[50] = 3
arrItems2[51] = "Maximizer Enterprise 7.5 Service Release 1";
arrItemsGrp2[51] = 3

arrItems2[60] = "Maximizer Enterprise 7 Service Release 3";
arrItemsGrp2[60] = 4

arrItems2[70] = "Maximizer Professional 9 Service Pack 2 for Service Release 1";
arrItemsGrp2[70] = 5
arrItems2[71] = "Maximizer Professional 9 Service Pack 1 for Service Release 1";
arrItemsGrp2[71] = 5
arrItems2[72] = "Maximizer Professional 9 Service Release 1";
arrItemsGrp2[72] = 5

arrItems2[80] = "Maximizer Professional 8 Hotfix 2";
arrItemsGrp2[80] = 6
arrItems2[81] = "Maximizer Professional 8 Hotfix 1";
arrItemsGrp2[81] = 6
arrItems2[82] = "Maximizer Professional 8 Service Release 2";
arrItemsGrp2[82] = 6
arrItems2[83] = "Maximizer Professional 8 Service Release 1";
arrItemsGrp2[83] = 6

arrItems2[90] = "Maximizer Professional 7 Service Release 2";
arrItemsGrp2[90] = 7
arrItems2[91] = "Maximizer Professional 7 Hotfix 2";
arrItemsGrp2[91] = 7

arrItems2[100] = "Max Exchange 9.5 Service Release 1";
arrItemsGrp2[100] = 8

arrItems2[110] = "Max Exchange 9 Service Pack 1 for Service Release 2";
arrItemsGrp2[110] = 9
arrItems2[111] = "Max Exchange 9 Service Release 2";
arrItemsGrp2[111] = 9
arrItems2[112] = "Max Exchange 9 Service Release 1";
arrItemsGrp2[112] = 9

arrItems2[120] = "Max Exchange 8 Hotfix 2";
arrItemsGrp2[120] = 10
arrItems2[121] = "Max Exchange 8 Service Release 4A";
arrItemsGrp2[121] = 10
arrItems2[122] = "Max Exchange 8 Service Release 3";
arrItemsGrp2[122] = 10

arrItems2[130] = "Max Exchange 7.5 Service Release 2";
arrItemsGrp2[130] = 11
arrItems2[131] = "Max Exchange 7.5 Hotfix 4";
arrItemsGrp2[131] = 11
arrItems2[132] = "Max Exchange 7.5 Hotfixes 1, 2 & 3";
arrItemsGrp2[132] = 11

arrItems2[140] = "Max Exchange 7 Hotfix 2";
arrItemsGrp2[140] = 12
arrItems2[141] = "Max Exchange 7 Hotfix 1";
arrItemsGrp2[141] = 12

var arrItems3 = new Array();
var arrItemsGrp3 = new Array();

arrItems3[200] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt95/ME95SR1HF1.exe";
arrItemsGrp3[200] = 21
arrItems3[201] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt95/ME95SR1SP1.exe";
arrItemsGrp3[201] = 22
arrItems3[202] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt95/ME95SR1.exe";
arrItemsGrp3[202] = 23
arrItems3[203] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt95/Fix_Users.zip";
arrItemsGrp3[203] = 24

arrItems3[220] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt9/ME9SR2HF2.exe";
arrItemsGrp3[220] = 31
arrItems3[221] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt9/ME9SR2SP3.exe";
arrItemsGrp3[221] = 32
arrItems3[222] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt9/ME9SR2SP2.exe";
arrItemsGrp3[222] = 33
arrItems3[223] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt9/ME9SR2SP1.exe";
arrItemsGrp3[223] = 34
arrItems3[224] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt9/Fix_Users.zip";
arrItemsGrp3[224] = 35
arrItems3[225] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt9/ME9SR2.exe";
arrItemsGrp3[225] = 36
arrItems3[226] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt9/ME9SR1.exe";
arrItemsGrp3[226] = 37

arrItems3[240] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt8/ME8HF5.zip";
arrItemsGrp3[240] = 40
arrItems3[241] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt8/ME8HF4.exe";
arrItemsGrp3[241] = 41
arrItems3[242] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt8/ME8HF3.exe";
arrItemsGrp3[242] = 42
arrItems3[243] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt8/ME8SR4A.exe";
arrItemsGrp3[243] = 43
arrItems3[244] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt8/ME8SR3.exe";
arrItemsGrp3[244] = 44

arrItems3[260] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt75/ME75HF7.exe";
arrItemsGrp3[260] = 50
arrItems3[261] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt75/ME75SR1.exe";
arrItemsGrp3[261] = 51

arrItems3[270] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxEnt7/ME7SR3.exe";
arrItemsGrp3[270] = 60

arrItems3[280] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max9/M9SR1SP2.exe";
arrItemsGrp3[280] = 70
arrItems3[281] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max9/M9SR1SP1.exe";
arrItemsGrp3[281] = 71
arrItems3[282] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max9/M9SR1.exe";
arrItemsGrp3[282] = 72

arrItems3[290] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max8/M8HF2.exe";
arrItemsGrp3[290] = 80
arrItems3[291] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max8/M8HF1.zip";
arrItemsGrp3[291] = 81
arrItems3[292] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max8/M8SR2.exe";
arrItemsGrp3[292] = 82
arrItems3[293] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max8/M8SR1.exe";
arrItemsGrp3[293] = 83

arrItems3[300] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max7/M7SR2.exe";
arrItemsGrp3[300] = 90
arrItems3[301] = "http://www.cabc.co.uk/Support/download/ServicePacks/Max7/M7HF2.exe";
arrItemsGrp3[301] = 91

arrItems3[400] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch95/MX95SR1.exe";
arrItemsGrp3[400] = 100

arrItems3[420] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch95/MX9SR2SP1.exe";
arrItemsGrp3[420] = 110
arrItems3[421] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch95/MX9SR2.exe";
arrItemsGrp3[421] = 111
arrItems3[422] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch95/MX9SR1.exe";
arrItemsGrp3[422] = 112

arrItems3[440] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch8/MX8HF2.exe";
arrItemsGrp3[440] = 120
arrItems3[441] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch8/ME8SR4A.exe";
arrItemsGrp3[441] = 121
arrItems3[442] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch8/ME8SR3.exe";
arrItemsGrp3[442] = 122

arrItems3[450] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch75/MX75SR2.exe";
arrItemsGrp3[450] = 130
arrItems3[451] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch75/MX75HF4.exe";
arrItemsGrp3[451] = 131
arrItems3[452] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch75/MX75HF123.zip";
arrItemsGrp3[452] = 132

arrItems3[460] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch7/MX70HF2.exe";
arrItemsGrp3[460] = 140
arrItems3[461] = "http://www.cabc.co.uk/Support/download/ServicePacks/MaxExch7/ME70HF1.exe";
arrItemsGrp3[461] = 141

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") ;
  myEle.value = 0 ;
  myEle.text = "Select Option" ;
  // controlToPopulate.add(myEle) ;
  controlToPopulate.appendChild(myEle)
  // Now loop through the array of individual items
  // Any containing the same child id are added to
  // the second dropdown box
  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)
    }
  }
}
// -->

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("Select Option");
  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
  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)
    }
  }
}

function selectChangeHidden(control, controlToPopulate, ItemArray, GroupArray) {
  var myEle ;
  var x ;
	// Populate the hidden field with URL Data from the URL Array

  // Now loop through the array of individual items
  // Any containing the same child id are added to
  // the second dropdown box
  for ( x = 0 ; x < ItemArray.length  ; x++ ) {
    if ( GroupArray[x] == control.value ) {
      myEle = form.URL ; 
      //myEle.value = x ;
      myEle.setAttribute("value",x);
      // myEle.text = ItemArray[x] ;
      var txt = ItemArray[x];
      form.URL.value = txt;
      //myEle.value(txt)
      // controlToPopulate.add(myEle) ;
      //controlToPopulate.appendChild(myEle)
    }
  }
}
