// Initiele syntax voor start javascript functies.
function set_total() {
var total_pluspunten = 0;
var the_form = window.document.calculator_form;
// Start functie voor Elektriciteit
// Start functietype voor dropdown form element.
if (the_form.ElektriciteitCheck.checked==1) {
// Begin product
if (the_form.Elektriciteit.value=='91') {
   var Elektriciteit_punten = 0;
   total_pluspunten = total_pluspunten+Elektriciteit_punten;
}
// Begin product
if (the_form.Elektriciteit.value=='97') {
   var Elektriciteit_punten = 150;
   total_pluspunten = total_pluspunten+Elektriciteit_punten;
}
// Begin product
if (the_form.Elektriciteit.value=='60') {
   var Elektriciteit_punten = 50;
   total_pluspunten = total_pluspunten+Elektriciteit_punten;
}
// Begin product
if (the_form.Elektriciteit.value=='61') {
   var Elektriciteit_punten = 150;
   total_pluspunten = total_pluspunten+Elektriciteit_punten;
}
// Begin product
if (the_form.Elektriciteit.value=='62') {
   var Elektriciteit_punten = 900;
   total_pluspunten = total_pluspunten+Elektriciteit_punten;
}
// Begin product
if (the_form.Elektriciteit.value=='121') {
   var Elektriciteit_punten = 900;
   total_pluspunten = total_pluspunten+Elektriciteit_punten;
}
// Begin product
if (the_form.Elektriciteit.value=='98') {
   var Elektriciteit_punten = 900;
   total_pluspunten = total_pluspunten+Elektriciteit_punten;
}
} else {
var Elektriciteit_punten = 0;
total_pluspunten = total_pluspunten+Elektriciteit_punten;
}
// Start functie voor Gas
// Start functietype voor dropdown form element.
if (the_form.GasCheck.checked==1) {
// Begin product
if (the_form.Gas.value=='92') {
   var Gas_punten = 0;
   total_pluspunten = total_pluspunten+Gas_punten;
}
// Begin product
if (the_form.Gas.value=='65') {
   var Gas_punten = 50;
   total_pluspunten = total_pluspunten+Gas_punten;
}
// Begin product
if (the_form.Gas.value=='66') {
   var Gas_punten = 200;
   total_pluspunten = total_pluspunten+Gas_punten;
}
// Begin product
if (the_form.Gas.value=='67') {
   var Gas_punten = 1200;
   total_pluspunten = total_pluspunten+Gas_punten;
}
// Begin product
if (the_form.Gas.value=='111') {
   var Gas_punten = 200;
   total_pluspunten = total_pluspunten+Gas_punten;
}
// Begin product
if (the_form.Gas.value=='100') {
   var Gas_punten = 1200;
   total_pluspunten = total_pluspunten+Gas_punten;
}
// Begin product
if (the_form.Gas.value=='122') {
   var Gas_punten = 1200;
   total_pluspunten = total_pluspunten+Gas_punten;
}
} else {
var Gas_punten = 0;
total_pluspunten = total_pluspunten+Gas_punten;
}
// Start functie voor Water
// Start functietype voor geen elementen.
if (the_form.WaterCheck.checked==1) {
var Water_punten = 25; 
total_pluspunten = total_pluspunten+Water_punten;
} else {
var Water_punten = 0;
total_pluspunten = total_pluspunten+Water_punten;
}
// Start functie voor Radio en TV
// Start functietype voor dropdown form element.
if (the_form.RadioenTVCheck.checked==1) {
// Begin product
if (the_form.RadioenTV.value=='101') {
   var RadioenTV_punten = 0;
   total_pluspunten = total_pluspunten+RadioenTV_punten;
   var Obj1 = document.getElementById('RadioenTV_box');
   Obj1.style.display='none';
}
// Begin product
if (the_form.RadioenTV.value=='57') {
   var RadioenTV_punten = 1200;
   total_pluspunten = total_pluspunten+RadioenTV_punten;
   var Obj1 = document.getElementById('RadioenTV_box');
   Obj1.style.display='none';
   var Obj1 = document.getElementById('RadioenTV_box');
   Obj1.style.display='';
  // True: Voeg form elementen van subproducten toe aan module 
if (the_form.Film1Sport1.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+300; 
   total_pluspunten = total_pluspunten+300;
} 
if (the_form.DELTAPluspakket.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+150; 
   total_pluspunten = total_pluspunten+150;
} 
/*if (the_form.Turkspakket.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+150; 
   total_pluspunten = total_pluspunten+150;
} 
if (the_form.Indonesischpakket.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+150; 
   total_pluspunten = total_pluspunten+150;
} */
if (the_form.Film1.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+150; 
   total_pluspunten = total_pluspunten+150;
} 
if (the_form.Sport1.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+150; 
   total_pluspunten = total_pluspunten+150;
} 
if (the_form.EredivisieLive.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+150; 
   total_pluspunten = total_pluspunten+150;
} 
if (the_form.Sportpakket.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+300; 
   total_pluspunten = total_pluspunten+300;
} 
if (the_form.HDPakket.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+150; 
   total_pluspunten = total_pluspunten+150;
} 
if (the_form.Buitenlandpakket.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+150; 
   total_pluspunten = total_pluspunten+150;
} 
if (the_form.TotaalPakket.checked==1) {
   var RadioenTV_punten = RadioenTV_punten+900; 
   total_pluspunten = total_pluspunten+900;
} 
}
// Begin product
if (the_form.RadioenTV.value=='56') {
   var RadioenTV_punten = 900;
   total_pluspunten = total_pluspunten+RadioenTV_punten;
   var Obj1 = document.getElementById('RadioenTV_box');
   Obj1.style.display='none';
}
} else {
var RadioenTV_punten = 0;
total_pluspunten = total_pluspunten+RadioenTV_punten;
}
// Start functie voor Internet van ZeelandNet
// Start functietype voor dropdown form element.
if (the_form.InternetvanZeelandNetCheck.checked==1) {
// Begin product
if (the_form.InternetvanZeelandNet.value=='119') {
   var InternetvanZeelandNet_punten = 1000;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='93') {
   var InternetvanZeelandNet_punten = 0;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='72') {
   var InternetvanZeelandNet_punten = 25;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='73') {
   var InternetvanZeelandNet_punten = 25;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='74') {
   var InternetvanZeelandNet_punten = 250;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='75') {
   var InternetvanZeelandNet_punten = 700;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='76') {
   var InternetvanZeelandNet_punten = 900;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='77') {
   var InternetvanZeelandNet_punten = 1100;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='78') {
   var InternetvanZeelandNet_punten = 1250;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='79') {
   var InternetvanZeelandNet_punten = 1500;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Begin product
if (the_form.InternetvanZeelandNet.value=='113') {
   var InternetvanZeelandNet_punten = 800;
   total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
} else {
var InternetvanZeelandNet_punten = 0;
total_pluspunten = total_pluspunten+InternetvanZeelandNet_punten;
}
// Start functie voor Telefonie van ZeelandNet
// Start functietype voor geen elementen.
if (the_form.TelefonievanZeelandNetCheck.checked==1) {
var TelefonievanZeelandNet_punten = 200; 
total_pluspunten = total_pluspunten+TelefonievanZeelandNet_punten;
} else {
var TelefonievanZeelandNet_punten = 0;
total_pluspunten = total_pluspunten+TelefonievanZeelandNet_punten;
}
// Start functie voor Serviceproducten
// Start functietype voor dropdown form element.
if (the_form.ServiceproductenCheck.checked==1) {
// Begin product
if (the_form.Serviceproducten.value=='89') {
   var Serviceproducten_punten = 1000;
   total_pluspunten = total_pluspunten+Serviceproducten_punten;
}
// Begin product
if (the_form.Serviceproducten.value=='104') {
   var Serviceproducten_punten = 100;
   total_pluspunten = total_pluspunten+Serviceproducten_punten;
}
// Begin product
if (the_form.Serviceproducten.value=='110') {
   var Serviceproducten_punten = 300;
   total_pluspunten = total_pluspunten+Serviceproducten_punten;
}
// Begin product
if (the_form.Serviceproducten.value=='112') {
   var Serviceproducten_punten = 0;
   total_pluspunten = total_pluspunten+Serviceproducten_punten;
}
} else {
var Serviceproducten_punten = 0;
total_pluspunten = total_pluspunten+Serviceproducten_punten;
}
// Start functies voor het printen van totalen in de input type's.
// Haal form elementen binnen om te vullen met de nieuwe waarde.
var tot_Water = document.getElementById('Water_punten');
var tot_RadioenTV = document.getElementById('RadioenTV_punten');
var tot_Elektriciteit = document.getElementById('Elektriciteit_punten');
var tot_Gas = document.getElementById('Gas_punten');
var tot_InternetvanZeelandNet = document.getElementById('InternetvanZeelandNet_punten');
var tot_Serviceproducten = document.getElementById('Serviceproducten_punten');
var tot_TelefonievanZeelandNet = document.getElementById('TelefonievanZeelandNet_punten');
var totaal = document.getElementById('totaal');

// Print objecten op het scherm.
tot_Water.value=Water_punten;
tot_RadioenTV.value=RadioenTV_punten;
tot_Elektriciteit.value=Elektriciteit_punten;
tot_Gas.value=Gas_punten;
tot_InternetvanZeelandNet.value=InternetvanZeelandNet_punten;
tot_Serviceproducten.value=Serviceproducten_punten;
tot_TelefonievanZeelandNet.value=TelefonievanZeelandNet_punten;
totaal.value=total_pluspunten;
var num = new NumberFormat();
num.setInputDecimal(',');
num.setNumber(tot_Water.value); 
num.setPlaces('0', false);
num.setCurrencyValue('$');
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, '.', ',');
tot_Water.value = num.toFormatted();
var num = new NumberFormat();
num.setInputDecimal(',');
num.setNumber(tot_RadioenTV.value); 
num.setPlaces('0', false);
num.setCurrencyValue('$');
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, '.', ',');
tot_RadioenTV.value = num.toFormatted();
var num = new NumberFormat();
num.setInputDecimal(',');
num.setNumber(tot_Elektriciteit.value); 
num.setPlaces('0', false);
num.setCurrencyValue('$');
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, '.', ',');
tot_Elektriciteit.value = num.toFormatted();
var num = new NumberFormat();
num.setInputDecimal(',');
num.setNumber(tot_Gas.value); 
num.setPlaces('0', false);
num.setCurrencyValue('$');
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, '.', ',');
tot_Gas.value = num.toFormatted();
var num = new NumberFormat();
num.setInputDecimal(',');
num.setNumber(tot_InternetvanZeelandNet.value); 
num.setPlaces('0', false);
num.setCurrencyValue('$');
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, '.', ',');
tot_InternetvanZeelandNet.value = num.toFormatted();
var num = new NumberFormat();
num.setInputDecimal(',');
num.setNumber(tot_Serviceproducten.value); 
num.setPlaces('0', false);
num.setCurrencyValue('$');
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, '.', ',');
tot_Serviceproducten.value = num.toFormatted();
var num = new NumberFormat();
num.setInputDecimal(',');
num.setNumber(tot_TelefonievanZeelandNet.value); 
num.setPlaces('0', false);
num.setCurrencyValue('$');
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, '.', ',');
tot_TelefonievanZeelandNet.value = num.toFormatted();
var num = new NumberFormat();
num.setInputDecimal(',');
num.setNumber(totaal.value); 
num.setPlaces('0', false);
num.setCurrencyValue('$');
num.setCurrency(false);
num.setCurrencyPosition(num.LEFT_OUTSIDE);
num.setNegativeFormat(num.LEFT_DASH);
num.setNegativeRed(false);
num.setSeparators(true, '.', ',');
totaal.value = num.toFormatted();
}

function changeMenuClass(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}
function MM_callJS(jsStr) { //v2.0
	return eval(jsStr)
}

function toggleState(id) {
	var Obj = document.getElementById(id);
	if (Obj.checked==0) {
		Obj.checked=1;
	}
}
function submit_calculate_form() {
var aantal = 0;
var checkChosenCategories = true;
	var the_form = window.document.calculator_form;
if (the_form.WaterCheck.checked==1) {
		aantal=aantal+1;
if (the_form.Water_punten.value==0) {
		checkChosenCategories = false
	}
	}
if (the_form.RadioenTVCheck.checked==1) {
		aantal=aantal+1;
if (the_form.RadioenTV_punten.value==0) {
		checkChosenCategories = false
	}
	}
if (the_form.ElektriciteitCheck.checked==1) {
		aantal=aantal+1;
if (the_form.Elektriciteit_punten.value==0) {
		checkChosenCategories = false
	}
	}
if (the_form.GasCheck.checked==1) {
		aantal=aantal+1;
if (the_form.Gas_punten.value==0) {
		checkChosenCategories = false
	}
	}
if (the_form.InternetvanZeelandNetCheck.checked==1) {
		aantal=aantal+1;
if (the_form.InternetvanZeelandNet_punten.value==0) {
		checkChosenCategories = false
	}
	}
if (the_form.ServiceproductenCheck.checked==1) {
		aantal=aantal+1;
if (the_form.Serviceproducten_punten.value==0) {
		checkChosenCategories = false
	}
	}
if (the_form.TelefonievanZeelandNetCheck.checked==1) {
		aantal=aantal+1;
if (the_form.TelefonievanZeelandNet_punten.value==0) {
		checkChosenCategories = false
	}
	}
	if (aantal < 2) {
		alert('Deelname aan DELTA PlusPunten is mogelijk bij een minimale afname van 2 producten van DELTA en/of ZeelandNet.');
	}
	if (checkChosenCategories == false) {
		alert('U heeft voor één of meerdere van de door u aangegeven productgroep(en) geen verdere productkeuze gemaakt.');
	}
 if ((aantal > 1) && (checkChosenCategories == true)) {document.calculator_form.submit();
 }
}

