// Begin - Author: Nicola Simonelli - Alias: Rhamirez (rhamirez@email.it)

// Array per i prodotti
// Definisco gli array
group1_names = new Array(8);
group1_locations = new Array(8);
group2_names = new Array(6);
group2_locations = new Array(6);
group3_names = new Array(4);
group3_locations = new Array(4);
group4_names = new Array(7);
group4_locations = new Array(7);
group5_names = new Array(4);
group5_locations = new Array(4);

// Compilo gli array group1 - AUTOPORTANTI
group1_names[0] = 'Schede in archivio';
group1_locations[0] = '';
group1_names[1] = '- S272Po - vol. 27mc';
group1_locations[1] = 's272po.htm';
group1_names[2] = '- S372P1 - vol. 37mc';
group1_locations[2] = 's372p1.htm';
group1_names[3] = '- S392P1 - vol. 39mc';
group1_locations[3] = 's392p1.htm';
group1_names[4] = '- S383PO/1 - vol. 40mc';
group1_locations[4] = 's383po1.htm';
group1_names[5] = '- S433PO - vol. 43mc';
group1_locations[5] = 's433po.htm';
group1_names[6] = '- S433PO - vol. 45mc';
group1_locations[6] = 's433po45.htm';
group1_names[7] = '- S515PO - vol. 51mc';
group1_locations[7] = 's515po.htm';
group1_names[8] = '- S515PO - vol. 54mc';
group1_locations[8] = 's515po54.htm';

var group1_length = group1_names.length;

// Compilo gli array group2 - RIBALTABILI
group2_names[0] = 'Schede in archivio';
group2_locations[0] = '';
group2_names[1] = '- STCR45 - vol. 45mc';
group2_locations[1] = 'stcr45.htm';
group2_names[2] = '- STCR48 - vol. 48mc';
group2_locations[2] = 'stcr48.htm';
group2_names[3] = '- STCR56/C - vol. 56mc';
group2_locations[3] = 'stcr56c.htm';
group2_names[4] = '- STCR58 - vol. 58mc';
group2_locations[4] = 'stcr58.htm';
group2_names[5] = '- STCR59/1 - vol. 59mc';
group2_locations[5] = 'stcr591.htm';
group2_names[6] = '- STCR59/1 - vol. 62mc';
group2_locations[6] = 'stcr59162.htm';

var group2_length = group2_names.length;

// Compilo gli array group3 - RIMORCHI AUTOPORTANTI
group3_names[0] = 'Schede in archivio';
group3_locations[0] = '';
group3_names[1] = '- R191PO - vol.19mc';
group3_locations[1] = 'r191po.htm';
group3_names[2] = '- B191PO - vol.19mc';
group3_locations[2] = 'b191po.htm';
group3_names[3] = '- B191PO - vol.21mc';
group3_locations[3] = 'b191po21.htm';
group3_names[4] = '- B302PO - vol.30mc';
group3_locations[4] = 'b302po.htm';

var group3_length = group3_names.length;

// Compilo gli array group4 - ATTREZZATURE PER AUTOVEICOLI
group4_names[0] = 'Schede in archivio';
group4_locations[0] = '';
group4_names[1] = '- SAM 182 - vol.18mc';
group4_locations[1] = 'sam182.htm';
group4_names[2] = '- SAM 212 - vol.21mc';
group4_locations[2] = 'sam212.htm';
group4_names[3] = '- SAM 233 - vol.23mc';
group4_locations[3] = 'sam233.htm';
group4_names[4] = '- SAM 253 - vol.25mc';
group4_locations[4] = 'sam253.htm';
group4_names[5] = '- SAM 254 - vol.25mc';
group4_locations[5] = 'sam254.htm';
group4_names[6] = '- SAM 263 - vol.26mc';
group4_locations[6] = 'sam263.htm';
group4_names[7] = '- SAM 283 - vol.28mc';
group4_locations[7] = 'sam283.htm';

var group4_length = group4_names.length;

// Compilo gli array group5 - VEICOLI SPECIALI
group5_names[0] = 'Schede in archivio';
group5_locations[0] = '';
group5_names[1] = '- Cassa mobile';
group5_locations[1] = 'cassamobile.htm';
group5_names[2] = '- Carri ferroviari';
group5_locations[2] = 'carriferroviari.htm';
group5_names[3] = '- VACUUM uso a depressione';
group5_locations[3] = 'vacuum.htm';
group5_names[4] = '- Silo allestimenti ADR';
group5_locations[4] = 'adr.htm';

var group5_length = group5_names.length;

// Trovo la lunghezza del pił grande gruppo di array
var maxLength = group1_length;

if (group2_length > maxLength)
{ maxlength = group2_length; }
if (group3_length > maxLength)
{ maxlength = group3_length; }
if (group4_length > maxLength)
{ maxlength = group4_length; }
if (group5_length > maxLength)
{ maxlength = group5_length; }

// Creo la funzione per la casella di riepilogo
function MenuFiller(choice) {

// Cancella il contenuto della seconda casella
var currentPosition = 0;
while (currentPosition < maxLength) {
document.ProductPicker.Products.options[currentPosition].text = ' ';
document.ProductPicker.Products.options[currentPosition].value = ' ';
++currentPosition; }

// Seleziono il gruppo di prodotti scelto
if (choice == 0) {
document.ProductPicker.Products.options[0].text = 'Schede in archivio';
document.ProductPicker.Products.options[0].value = ' ';
document.ProductPicker.Products.options[0].selected=true; }
else if (choice == 1) {
OutputListSize = group1_length;
arrayName = "group1"; }
else if (choice == 2) {
OutputListSize = group2_length;
arrayName = "group2"; }
else if (choice == 3) {
OutputListSize = group3_length;
arrayName = "group3"; }
else if (choice == 4) {
OutputListSize = group4_length;
arrayName = "group4"; }
else if (choice == 5) {
OutputListSize = group5_length;
arrayName = "group5"; }
var currentPosition = 0;
if (choice > 0) {
while (currentPosition < OutputListSize) {
document.ProductPicker.Products.options[currentPosition].text = eval(arrayName + '_names[currentPosition]');
document.ProductPicker.Products.options[currentPosition].value = eval(arrayName + '_locations[currentPosition]');
++currentPosition; }
document.ProductPicker.Products.options[0].selected=true; } }

// Funzione per la navigazione nella casella
function PageChanger(page) {
if (page != ' ') {
document.location= page;
document.NavForm.ProductGroup.options[0].selected=true; } }

// End
