	var bIsFirebugReady = (!!window.console && !!window.console.log);

	$(document).ready(
		function (){
			// update the plug-in version
			$("#idPluginVersion").text($.Calculation.version);			
			// bind the recalc function to the quantity fields
			$("select[@name^=qty_item_]").bind("change", recalc);
			$("input[@name^=price_item_]").bind("change", recalc);
			// run the calculation function now
			recalc();
}
	);
	
	function recalc(){
		$("[@id^=total_item]").calc(
			// the equation to use for the calculation
			"qty * price",
			// define the variables used in the equation, these can be a jQuery object
			{
				qty: $("select[@name^=qty_item_]"),
				price: $("[@id^=price_item_]")
			},
			// define the formatting callback, the results of the calculation are passed to this function
			function (s){
				// return the number as a dollar amount
				return "€ " + s.toFixed(2);
			},
			// define the finish callback, this runs after the calculation has been complete
			function ($this){
				// sum the total of the $("[@id^=total_item]") selector
				var sum = $this.sum();
				
				
				$("#grandTotal").text(
					// round the results to 2 digits
					//"€ " + Math.round((sum.toFixed(2)*0.90)* 100) / 100
					"€ " + sum.toFixed(2)
				);
				
				$("#totaalee").text(
					// round the results to 2 digits
					// Math.round((sum.toFixed(2)*0.90)* 100) / 100
					sum.toFixed(2)
				);
				
			}

		);// calc

		$("[@id^=total3_]").calc(
			// the equation to use for the calculation
			"qty3 * price3",
			// define the variables used in the equation, these can be a jQuery object
			{
				qty3: $("select[@name^=qty3_]"),
				price3: $("[@id^=price3_]")
			},
			// define the formatting callback, the results of the calculation are passed to this function
			function (s){
				// return the number as a dollar amount
				return "€ " + s.toFixed(2);
			},
			// define the finish callback, this runs after the calculation has been complete
			function ($this){
				// sum the total of the $("[@id^=total_item]") selector
				var sum = $this.sum();
				
				
				$("#total2_item_1").text(
					// round the results to 2 digits
					"€ " + sum.toFixed(2)
				);
				
				$("#total2_item_2").text(
					// round the results to 2 digits
					sum.toFixed(2)
				);
				
			}

		);// calc


	} // recalc

function check(prijs)
{
if (prijs.qty_item_hout.value=="0" && prijs.qty_item_ehout.value=="0" && prijs.qty_item_bois.value=="0" && prijs.qty_item_ebois.value=="0" && prijs.qty_item_houtb.value=="0" && prijs.qty_item_boisb.value=="0")
   {
      alert("Minimum 1 abonnement.");
      return false;
   }

if (prijs.qty_item_hout.value!="0" && prijs.qty_item_houtb.value!="0")
   {
      alert("Veuillez choisir 'Formule 1 Belgique' ou 'Formule 1 étranger'.");
      return false;
   }

if (prijs.qty_item_bois.value!="0" && prijs.qty_item_boisb.value!="0")
   {
      alert("Veuillez choisir 'Formule 1 Belgique' ou 'Formule 1 étranger'.");
      return false;
   }

if (prijs.qty_item_bois.value!="0" && prijs.qty_item_houtb.value!="0")
   {
      alert("Veuillez choisir 'Formule 1 Belgique' ou 'Formule 1 étranger'.");
      return false;
   }

if (prijs.qty_item_hout.value!="0" && prijs.qty_item_boisb.value!="0")
   {
      alert("Veuillez choisir 'Formule 1 Belgique' ou 'Formule 1 étranger'.");
      return false;
   }

}

function check2(prijsmetkorting)
{
if (prijsmetkorting.qty3_hout2.value=="0" && prijsmetkorting.qty3_ehout2.value=="0" && prijsmetkorting.qty3_bois2.value=="0" && prijsmetkorting.qty3_ebois2.value=="0" && prijsmetkorting.qty3_hout2b.value=="0" && prijsmetkorting.qty3_bois2b.value=="0")
   {
      alert("Minimum 1 abonnement.");
      return false;
   }

if (prijsmetkorting.qty3_hout2.value!="0" && prijsmetkorting.qty3_hout2b.value!="0")
   {
      alert("Veuillez choisir 'Formule 1 Belgique' ou 'Formule 1 étranger'.");
      return false;
   }
   
if (prijsmetkorting.qty3_bois2.value!="0" && prijsmetkorting.qty3_bois2b.value!="0")
   {
      alert("Veuillez choisir 'Formule 1 Belgique' ou 'Formule 1 étranger'.");
      return false;
   }

if (prijsmetkorting.qty3_bois2.value!="0" && prijsmetkorting.qty3_hout2b.value!="0")
   {
      alert("Veuillez choisir 'Formule 1 Belgique' ou 'Formule 1 étranger'.");
      return false;
   }

if (prijsmetkorting.qty3_hout2.value!="0" && prijsmetkorting.qty3_bois2b.value!="0")
   {
      alert("Veuillez choisir 'Formule 1 Belgique' ou 'Formule 1 étranger'.");
      return false;
   }

}

