﻿// iTERRA 3.0 custom template JavaScript include: brunner product selector (c) 2007 by evanto media AG

function addOption (field, optiontext, optionvalue) 
{
  newOption = new Option(optiontext, optionvalue, false, false);
  field.options[field.length] = newOption;
}

function clearSelect (field) 
{
  len = field.length - 1;
  for (i = len; i >= 0; i--)
    field.options[i] = null;
}

function fillSubGroup (selectorname) 
{
  if (document.getElementById)
  {
	selectbox = document.getElementById("subgroup_" + selectorname);
	if (selectbox)
	{  				
		masterbox = document.getElementById("productgroup_" + selectorname);
		if (masterbox)
		{  						
			clearSelect(selectbox);
			
			selValue = masterbox.options[masterbox.selectedIndex].value;
			if (selValue == 'KO')
			{
				addOption(selectbox, 'Bitte auswählen..', '');
				addOption(selectbox, 'Klassische Feuerungen', 'KKOF');
				addOption(selectbox, 'Moderne Feuerungen', 'MKOF');
			}
			if (selValue == 'HK')
			{
				addOption(selectbox, 'Bitte auswählen..', '');
				addOption(selectbox, 'Heizkamine aus Guss', 'HAGRF');
				addOption(selectbox, 'Heizkamine aus Stahl', 'HASKK');
			}
			if (selValue == 'GOT')
			{
				addOption(selectbox, 'Bitte auswählen..', '');
				addOption(selectbox, 'Grundofentüren/kleine Tür', 'GOTKT');
				addOption(selectbox, 'Grundofentüren/große Tür', 'GOTGT');
			}
			if (selValue == 'KT')
			{
				addOption(selectbox, 'Bitte auswählen..', '');
				addOption(selectbox, 'Heizungsunterstützung', 'KTHU');
				addOption(selectbox, 'Kachelofenheizung', 'KTKH');
			}
			if (selValue == 'ST')
			{
				addOption(selectbox, 'Bitte auswählen..', '');
				addOption(selectbox, 'Übersicht', 'STUE');
				addOption(selectbox, 'EOSR5', 'EOSR5');
				addOption(selectbox, 'EWM', 'EWM');
				addOption(selectbox, 'USA', 'USA');
				addOption(selectbox, 'Pelletmodul', 'PM');
				addOption(selectbox, 'DZE', 'DZE');
				addOption(selectbox, 'Einzelsteuerungen', 'Einzel');
			}
			if (selValue == 'PM')
			{
				addOption(selectbox, 'Übersicht..', 'PMUE');
			}
			if (selValue == 'DZE')
			{
				addOption(selectbox, 'Übersicht..', 'DZEUE');
			}
			if (selValue == 'Z')
			{
				addOption(selectbox, 'Bitte auswählen..', 'ZUE');
				addOption(selectbox, 'Nachheizflächen', 'ZNHF');				
				addOption(selectbox, 'Rauchgasrohre', 'ZRGR');			
				addOption(selectbox, 'Einbaurahmen', 'ZER');
				addOption(selectbox, 'Luftgitter', 'ZLG');
				addOption(selectbox, 'Herdbauteile', 'ZHBT');
				addOption(selectbox, 'Hausbacköfen', 'ZHBO');
				addOption(selectbox, 'Verarbeitungsmaterial', 'ZVM');
			}
		}
	}
	else
	  alert ("Selectbox not found!");
  }
  return false;
}

function fillProduct (selectorname) 
{
  if (document.getElementById)
  {
	selectbox = document.getElementById("product_" + selectorname);
	if (selectbox)
	{  				
		masterbox = document.getElementById("subgroup_" + selectorname);
		if (masterbox)
		{  						
			clearSelect(selectbox);
			
			selValue = masterbox.options[masterbox.selectedIndex].value;
			if (selValue == 'KKOF')
			{
				addOption(selectbox, 'Übersicht..', 'HBO');
				addOption(selectbox, 'HBO1', 'HBO1');
				addOption(selectbox, 'HBO4', 'HBO4');
			}
			if (selValue == 'MKOF')
			{
				addOption(selectbox, 'Übersicht..', 'HKD');
				addOption(selectbox, 'HKD2', 'HKD2');
				addOption(selectbox, 'HKD4.1', 'HKD41');
				addOption(selectbox, 'HKD5.1', 'HKD51');
				addOption(selectbox, 'HKD6.1', 'HKD61');
			}
			if (selValue == 'HAGRF')
			{
				addOption(selectbox, 'Übersicht..', 'RF');
				addOption(selectbox, 'RF55.1', 'RF551');
				addOption(selectbox, 'RF66.1', 'RF661');
			}
			if (selValue == 'HASKK')
			{
				addOption(selectbox, 'Übersicht..', 'KK');
				addOption(selectbox, 'KK xx/55 kleiner Korpus (Standard)', 'KK55');
				addOption(selectbox, 'KK xx/67 großer Korpus (Standard)', 'KK67');
				addOption(selectbox, 'Stil (Luxus)', 'KKSTIL');
				addOption(selectbox, 'Architektur (Luxus)', 'KKAR');
				addOption(selectbox, 'Eck (Luxus)', 'KKECK');
				addOption(selectbox, '180° (Luxus)', 'KK180');
			}
			if (selValue == 'GOTKT')
			{
				addOption(selectbox, 'Übersicht..', 'GOT');
				addOption(selectbox, 'HBO10', 'HBO10');
				addOption(selectbox, 'HBO20', 'HBO20');
			}
			if (selValue == 'GOTGT')
			{
				addOption(selectbox, 'Übersicht..', 'GOT');
				addOption(selectbox, 'GOT HKD 5.1/12', 'HKD5112');
				addOption(selectbox, 'GOT HKD 5.1/20', 'HKD5120');
				addOption(selectbox, 'GOT HKD 6.1', 'HKD61G');
				addOption(selectbox, 'GOT 44-55', 'GOT4455');
			}
			if (selValue == 'KTHU')
			{
				addOption(selectbox, 'Übersicht..', 'KT');
				addOption(selectbox, 'Kesselmodul', 'KM');
				addOption(selectbox, 'HKD 4.1w', 'HKD41W');
			}
			if (selValue == 'KTKH')
			{
				addOption(selectbox, 'Übersicht..', 'KT');
				addOption(selectbox, 'HKD 4.1w HWM', 'HKD41HWM');
				addOption(selectbox, 'Kompaktkessel B4/B5/B6', 'KKB');
			}
			if ((selValue == 'STUE') || (selValue == 'EOSR5') || (selValue == 'EWM') || (selValue == 'USA') || (selValue == 'PM') || (selValue == 'DZE') || (selValue == 'Einzel'))
			{
				addOption(selectbox, 'Übersicht..', 'STUE');
			}
			if (selValue == 'PMUE')
			{
				addOption(selectbox, 'Übersicht..', 'PMUE');
			}
			if (selValue == 'DZEUE')
			{
				addOption(selectbox, 'Übersicht..', 'DZEUE');
			}
			if (selValue == 'ZHNF')
			{
				addOption(selectbox, 'Übersicht..', 'ZHNF');
			}
			if (selValue == 'ZRGR')
			{
				addOption(selectbox, 'Übersicht..', 'ZRGR');
			}
			if (selValue == 'ZER')
			{
				addOption(selectbox, 'Übersicht..', 'ZER');
			}
			if (selValue == 'ZLG')
			{
				addOption(selectbox, 'Übersicht..', 'ZLG');
			}
			if (selValue == 'ZHH')
			{
				addOption(selectbox, 'Übersicht..', 'ZHH');
			}
			if (selValue == 'ZVM')
			{
				addOption(selectbox, 'Übersicht..', 'ZVM');
			}
		}
	}
	else
	  alert ("Selectbox not found!");
  }
  return false;
}

