function factuur()
		{
			if (document.getElementById('factuur').style.visibility=='hidden')
			{
				document.getElementById('factuur').style.visibility='visible';
				document.getElementById('factuur2').style.visibility='visible';
			} else
			{
				document.getElementById('factuur').style.visibility='hidden';
				document.getElementById('factuur2').style.visibility='hidden';
			}
		}

		function confirmation( targetId )
		{
			var answer = confirm ("Weet u zeker dat u dit artikel wilt verwijderen uit uw winkelwagen?")
			if (answer){
			window.location = "./cart.php?del=" + targetId;
			}
		}

		function confirmation_bestelling( targetId )
		{
			var answer = confirm ("Weet u zeker dat u deze bestelling wilt verwijderen?")
			if (answer){
			window.location = targetId;
			}
		}

		function confirmation_cat()
		{
			return confirm ('Weet u zeker dat u deze categoriën wilt verwijderen?');
		}

		function copyText(from, to)
		{
			var x = new String();
			var x = document.getElementById(from).value;
			document.getElementById(to).value = x;
		}

		var kopie_bnr_arrInput 		= new Array(0);
		var kopie_bnr_arrInputValue 	= new Array(0);

		function kopie_bnr_addInput(input)
		{
		  kopie_bnr_arrInput.push(kopie_bnr_arrInput.length);
		  kopie_bnr_arrInputValue.push(input);
		  kopie_bnr_display();
		}

		function kopie_bnr_display()
		{
		  for (intI=0; intI<kopie_bnr_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_bnr_createInput(kopie_bnr_arrInput[intI], kopie_bnr_arrInputValue[intI]);
		  }
		}

		function kopie_bnr_saveValue(intId,strValue)
		{
		  kopie_bnr_arrInputValue[intId]=strValue;
		}

		function kopie_bnr_createInput(id,value)
		{
		  return "<br />Kopie: <br />Bestelnummer: <input type='text' id='kopie_bnr_"+ id +"' name='kopie_bnr_"+ id +"' onchange='kopie_bnr_saveValue("+  id +",this.value);' value='"+ value +"' />";
		}

		function kopie_bnr_deleteInput()
		{
		  if (kopie_bnr_arrInput.length > 0) {
		     kopie_bnr_arrInput.pop();
		     kopie_bnr_arrInputValue.pop();
		  }
		  kopie_bnr_display();
		}

		var kopie_klc_arrInput 		= new Array(0);
		var kopie_klc_arrInputValue 	= new Array(0);

		function kopie_klc_addInput(input)
		{
		  kopie_klc_arrInput.push(kopie_klc_arrInput.length);
		  kopie_klc_arrInputValue.push(input);
		  kopie_klc_display();
		}

		function kopie_klc_display()
		{
		  for (intI=0; intI<kopie_klc_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_klc_createInput(kopie_klc_arrInput[intI], kopie_klc_arrInputValue[intI]);
		  }
		}

		function kopie_klc_saveValue(intId,strValue)
		{
		  kopie_klc_arrInputValue[intId]=strValue;
		}

		function kopie_klc_createInput(id,value)
		{
		  return " - Kleurcode: <input type='text' name='kopie_klc_"+ id +"' id='kopie_klc_"+ id +"' onchange='kopie_klc_saveValue("+  id +",this.value);' value='"+ value +"' />";
		}

		function kopie_klc_deleteInput()
		{
		  if (kopie_klc_arrInput.length > 0) {
		     kopie_klc_arrInput.pop();
		     kopie_klc_arrInputValue.pop();
		  }
		  kopie_klc_display();
		}

		var kopie_mou_arrInput 		= new Array(0);
		var kopie_mou_arrInputValue 	= new Array(0);

		function kopie_mou_addInput(selected)
		{
		  kopie_mou_arrInput.push(kopie_mou_arrInput.length);
		  kopie_mou_arrInputValue.push("");
		  kopie_mou_display(selected);
		}

		function kopie_mou_display(selected)
		{
		  for (intI=0; intI<kopie_mou_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_mou_createInput(kopie_mou_arrInput[intI], kopie_mou_arrInputValue[intI],selected);
		  }
		}

		function kopie_mou_createInput(id,value,selected)
		{
		  if (selected == 'short_sleeves')
		  {
			return " <input type='radio' name='kopie_mou_"+ id +"' value='short_sleeves' checked='checked' /> k.m. <input type='radio' name='kopie_mou_"+ id +"' value='long_sleeves' /> l.m. <input type='radio' name='kopie_mou_"+ id +"' value='nosleeves' /> n.v.t.<br />";
		  }

		  if (selected == 'long_sleeves')
		  {
			return " <input type='radio' name='kopie_mou_"+ id +"' value='short_sleeves' /> k.m. <input type='radio' name='kopie_mou_"+ id +"' value='long_sleeves' checked='checked' /> l.m. <input type='radio' name='kopie_mou_"+ id +"' value='nosleeves' /> n.v.t.<br />";
		  }

		  if (selected == 'nosleeves')
		  {
			return " <input type='radio' name='kopie_mou_"+ id +"' value='short_sleeves' /> k.m. <input type='radio' name='kopie_mou_"+ id +"' value='long_sleeves' /> l.m. <input type='radio' name='kopie_mou_"+ id +"' value='nosleeves' checked='checked' /> n.v.t.<br />";
		  }
		}

		function kopie_mou_deleteInput()
		{
		  if (kopie_mou_arrInput.length > 0) {
		     kopie_mou_arrInput.pop();
		     kopie_mou_arrInputValue.pop();
		  }
		  kopie_mou_display();
		}

		var kopie_mer_arrInput 		= new Array(0);
		var kopie_mer_arrInputValue 	= new Array(0);

		function kopie_mer_addInput(input)
		{
		  kopie_mer_arrInput.push(kopie_mer_arrInput.length);
		  kopie_mer_arrInputValue.push(input);
		  kopie_mer_display();
		}

		function kopie_mer_display()
		{
		  for (intI=0; intI<kopie_mer_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_mer_createInput(kopie_mer_arrInput[intI], kopie_mer_arrInputValue[intI]);
		  }
		}

		function kopie_mer_saveValue(intId,strValue)
		{
		  kopie_mer_arrInputValue[intId]=strValue;
		}

		function kopie_mer_createInput(id,value)
		{
		  return "<br />Merk<br/><input type='text' name='kopie_mer_"+ id +"' id='kopie_mer_"+ id +"' onchange='kopie_mer_saveValue("+  id +",this.value);' value='"+ value +"' /><br />";
		}

		function kopie_mer_deleteInput()
		{
		  if (kopie_mer_arrInput.length > 0) {
		     kopie_mer_arrInput.pop();
		     kopie_mer_arrInputValue.pop();
		  }
		  kopie_mer_display();
		}

		var kopie_naa_arrInput 		= new Array(0);
		var kopie_naa_arrInputValue 	= new Array(0);

		function kopie_naa_addInput(input)
		{
		  kopie_naa_arrInput.push(kopie_naa_arrInput.length);
		  kopie_naa_arrInputValue.push(input);
		  kopie_naa_display();
		}

		function kopie_naa_saveValue(intId,strValue)
		{
		  kopie_naa_arrInputValue[intId]=strValue;
		}

		function kopie_naa_display()
		{
		  for (intI=0; intI<kopie_naa_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_naa_createInput(kopie_naa_arrInput[intI], kopie_naa_arrInputValue[intI]);
		  }
		}

		function kopie_naa_createInput(id,value)
		{
		  return "<br />Naam artikel<br/><input type='text' name='kopie_naa_"+ id +"' id='kopie_naa_"+ id +"' onchange='kopie_naa_saveValue("+  id +",this.value);' value='"+ value +"' /><br />";
		}

		function kopie_naa_deleteInput()
		{
		  if (kopie_naa_arrInput.length > 0) {
		     kopie_naa_arrInput.pop();
		     kopie_naa_arrInputValue.pop();
		  }
		  kopie_naa_display();
		}

		var kopie_kle_arrInput 		= new Array(0);
		var kopie_kle_arrInputValue 	= new Array(0);

		function kopie_kle_addInput(input)
		{
		  kopie_kle_arrInput.push(kopie_kle_arrInput.length);
		  kopie_kle_arrInputValue.push(input);
		  kopie_kle_display();
		}

		function kopie_kle_saveValue(intId,strValue)
		{
		  kopie_kle_arrInputValue[intId]=strValue;
		}

		function kopie_kle_display()
		{
		  for (intI=0; intI<kopie_kle_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_kle_createInput(kopie_kle_arrInput[intI], kopie_kle_arrInputValue[intI]);
		  }
		}

		function kopie_kle_createInput(id,value)
		{
		  return "<br />Kleur<br/><input type='text' name='kopie_kle_"+ id +"' id='kopie_kle_"+ id +"' onchange='kopie_kle_saveValue("+  id +",this.value);' value='"+ value +"' /><br /><br />";
		}

		function kopie_kle_deleteInput()
		{
		  if (kopie_kle_arrInput.length > 0) {
		     kopie_kle_arrInput.pop();
		     kopie_kle_arrInputValue.pop();
		  }
		  kopie_kle_display();
		}

		var kopie_apri_arrInput 	= new Array(0);
		var kopie_apri_arrInputValue 	= new Array(0);

		function kopie_apri_addInput(input)
		{
		  kopie_apri_arrInput.push(kopie_apri_arrInput.length);
		  kopie_apri_arrInputValue.push(input);
		  kopie_apri_display();
		}

		function kopie_apri_saveValue(intId,strValue)
		{
		  kopie_apri_arrInputValue[intId]=strValue;
		}

		function kopie_apri_display()
		{
		  for (intI=0; intI<kopie_apri_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_apri_createInput(kopie_apri_arrInput[intI], kopie_apri_arrInputValue[intI]);
		  }
		}

		function kopie_apri_createInput(id,value)
		{
		  kopie_apri_saveValue(id,value);
		  return "Adviesprijs<br/><input type='text' name='kopie_apri_"+ id +"' id='kopie_apri_"+ id +"' onchange='kopie_apri_saveValue("+  id +",this.value);' value='"+ value +"' /> <br /><br />";
		}

		function kopie_apri_deleteInput()
		{
		  if (kopie_apri_arrInput.length > 0) {
		     kopie_apri_arrInput.pop();
		     kopie_apri_arrInputValue.pop();
		  }
		  kopie_apri_display();
		}

		var kopie_pri_arrInput 		= new Array(0);
		var kopie_pri_arrInputValue 	= new Array(0);

		function kopie_pri_addInput(input)
		{
		  kopie_pri_arrInput.push(kopie_pri_arrInput.length);
		  kopie_pri_arrInputValue.push(input);
		  kopie_pri_display();
		}

		function kopie_pri_saveValue(intId,strValue)
		{
		  kopie_pri_arrInputValue[intId]=strValue;
		}

		function kopie_pri_display()
		{
		  for (intI=0; intI<kopie_pri_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_pri_createInput(kopie_pri_arrInput[intI], kopie_pri_arrInputValue[intI]);
		  }
		}

		function kopie_pri_createInput(id,value)
		{
		  return "Prijs<br/><input type='text' name='kopie_pri_"+ id +"' id='kopie_pri_"+ id +"' onchange='kopie_pri_saveValue("+  id +",this.value);' value='"+ value +"' /><br /><br />";
		}

		function kopie_pri_deleteInput()
		{
		  if (kopie_pri_arrInput.length > 0) {
		     kopie_pri_arrInput.pop();
		     kopie_pri_arrInputValue.pop();
		  }
		  kopie_pri_display();
		}

		var kopie_size_arrInput 	= new Array(0);
		var kopie_size_arrInputValue 	= new Array(0);

		function kopie_size_addInput(value)
		{
		  kopie_size_arrInput.push(kopie_size_arrInput.length);
		  kopie_size_arrInputValue.push(value);
		  kopie_size_display();
		}

		function kopie_size_saveValue(intId,strValue)
		{
		  kopie_size_arrInputValue[intId]=strValue;
		}

		function kopie_size_display()
		{
		  for (intI=0; intI<kopie_size_arrInput.length; intI++)
		  {
		    document.getElementById('kopie' + intI).innerHTML += kopie_size_createInput(kopie_size_arrInput[intI], kopie_size_arrInputValue[intI], intI);
		  }
		}

		function kopie_size_createInput(id,value,test)
		{
		  return "<a name='maatvarianten"+ id +"' style='color: black;'>Maten</a><br/><input type='text' name='kopie_size_"+ id +"' id='kopie_size_"+ id +"' onchange='kopie_size_saveValue("+  id +",this.value); kopie_sizes_addInput("+ id +",this.value); kopie_prices_addInput("+ id +", document.getElementById(\"kopie_apri_"+ id +"\").value); kopie_beste_addInput("+ id +", document.getElementById(\"kopie_bnr_"+ id +"\").value)' value='"+ value +"' /><p id='kopie_p_sizes"+ test +"'></p><br /><br />";
		}

		var deleted_fields = [];

		function kopie_size_deleteInput()
		{
		  if (kopie_size_arrInput.length > 0) {
		     kopie_size_arrInput.pop();
		     kopie_size_arrInputValue.pop();
		  }
		  kopie_size_display();
		}

		var kopie_all_sizes			= [];
		var kopie_sizes_arrInput		= [];

		function kopie_sizes_addInput(id, value)
		{
			if (typeof (kopie_all_sizes[id]) == "undefined")
			{
				kopie_all_sizes[id] = [];
			}

			kopie_all_sizes[id][kopie_sizes_arrInput.length] = value;
			kopie_sizes_arrInput.push(kopie_sizes_arrInput.length);
			kopie_sizes_display(id);
		}

		function kopie_sizes_display(id)
		{
			document.getElementById('kopie_p_sizes'+ id).innerHTML = "";

			for (intI=0; intI<kopie_all_sizes[id].length; intI++)
			{
				if (typeof (kopie_all_sizes[id][intI]) != "undefined" && !(intI in deleted_fields) && kopie_all_sizes[id][intI] != "")
				{
					document.getElementById('kopie_p_sizes'+ id).innerHTML += kopie_sizes_createInput(id, intI, kopie_all_sizes[id][intI]);
				}
			}
		}

		function kopie_sizes_saveValue(p,intId,strValue)
		{
		  kopie_all_sizes[p][intId]=strValue;
		}

		function kopie_sizes_createInput(p,id,value)
		{
			return "<br/><input type='text' id='kopie_sizes"+ id +"_p"+ p +"' name='kopie_sizes"+ id +"_p"+ p +"' onchange='kopie_sizes_saveValue("+ p +", "+  id +",this.value); kopie_sizes_addInput("+ p +",this.value); kopie_prices_addInput("+ p +",document.getElementById(\"kopie_apri_"+ p +"\").value); kopie_beste_addInput("+ p +", document.getElementById(\"kopie_bnr_"+ p +"\").value)' value='"+ value +"' /> ";
		}

		function kopie_sizes_deleteInput(p, id)
		{
		  if (kopie_all_sizes[p].length > 0)
		  {
			deleted_fields[id] = "";
			kopie_all_sizes[p][id] = "";
		  }

		  kopie_sizes_display(p);
		  kopie_prices_display(p);
		  kopie_beste_display(p);
		}

		var kopie_all_prices			= [];
		var kopie_prices_arrInput		= [];

		function kopie_prices_addInput(id, adprice)
		{
			if (typeof (kopie_all_prices[id]) == "undefined")
			{
				kopie_all_prices[id] = [];
			}

			kopie_all_prices[id][kopie_prices_arrInput.length] = adprice;
			kopie_prices_arrInput.push(kopie_prices_arrInput.length);
			kopie_prices_display(id);
		}

		function kopie_prices_display(id)
		{
			document.getElementById('kopie_p_sizes'+ id).innerHTML = "";

			for (intI=0; intI<kopie_all_prices[id].length; intI++)
			{
				if (typeof (kopie_all_sizes[id][intI]) != "undefined" && !(intI in deleted_fields))
				{
					document.getElementById('kopie_p_sizes'+ id).innerHTML += kopie_sizes_createInput(id, intI, kopie_all_sizes[id][intI]);
				}

				if (typeof (kopie_all_prices[id][intI]) != "undefined" && !(intI in deleted_fields))
				{
					document.getElementById('kopie_p_sizes'+ id).innerHTML += kopie_prices_createInput(id, intI, kopie_all_prices[id][intI]);
				}
			}
		}

		function kopie_prices_saveValue(p,intId,strValue)
		{
		  kopie_all_prices[p][intId]=strValue;
		}

		function kopie_prices_createInput(p,id,value)
		{
			return "Prijs: € <input type='text' id='kopie_prices"+ id +"_p"+ p +"' name='kopie_prices"+ id +"_p"+ p +"' onchange='kopie_prices_saveValue("+ p +", "+  id +",this.value);' value='"+ value +"' />";
		}

		var kopie_all_beste			= [];
		var kopie_beste_arrInput		= [];

		function kopie_beste_addInput(id, beste)
		{
			//kopie_prices_addInput(id,document.getElementById('kopie_apri_'+id).value);

			if (typeof (kopie_all_beste[id]) == "undefined")
			{
				kopie_all_beste[id] = [];
			}

			kopie_all_beste[id][kopie_beste_arrInput.length] = beste;
			kopie_beste_arrInput.push(kopie_beste_arrInput.length);
			kopie_beste_display(id);
		}

		function kopie_beste_display(id)
		{
			document.getElementById('kopie_p_sizes'+ id).innerHTML = "";

			for (intI=0; intI<kopie_all_beste[id].length; intI++)
			{
				if (typeof (kopie_all_sizes[id][intI]) != "undefined" && !(intI in deleted_fields))
				{
					document.getElementById('kopie_p_sizes'+ id).innerHTML += kopie_sizes_createInput(id, intI, kopie_all_sizes[id][intI]);
				}

				if (typeof (kopie_all_prices[id][intI]) != "undefined" && !(intI in deleted_fields))
				{
					document.getElementById('kopie_p_sizes'+ id).innerHTML += kopie_prices_createInput(id, intI, kopie_all_prices[id][intI]);
				}

				if (typeof (kopie_all_beste[id][intI]) != "undefined" && !(intI in deleted_fields))
				{
					document.getElementById('kopie_p_sizes'+ id).innerHTML += kopie_beste_createInput(id, intI, kopie_all_beste[id][intI]);
				}
			}
		}

		function kopie_beste_saveValue(p,intId,strValue)
		{
		  kopie_all_beste[p][intId]=strValue;
		}

		function kopie_beste_createInput(p,id,value)
		{
			return " Bestelnummer: <input type='text' id='kopie_beste"+ id +"_p"+ p +"' name='kopie_beste"+ id +"_p"+ p +"' onchange='kopie_beste_saveValue("+ p +", "+  id +",this.value);' value='"+ value +"' /> <a href=\"#maatvarianten"+ p +"\" onclick=\"kopie_sizes_deleteInput("+ p +", "+ id +")\">Verwijder deze rij</a><br/>";
		}

		var kopie_oms_arrInput 		= new Array(0);
		var kopie_oms_arrInputValue 	= new Array(0);

		function kopie_oms_addInput(input)
		{
		  kopie_oms_arrInput.push(kopie_oms_arrInput.length);
		  kopie_oms_arrInputValue.push(input);
		  kopie_oms_display();
		}

		function kopie_oms_saveValue(intId,strValue)
		{
		  kopie_oms_arrInputValue[intId]=strValue;
		}

		function kopie_oms_display()
		{
		  for (intI=0; intI<kopie_oms_arrInput.length; intI++)
		  {
			document.getElementById('kopie' + intI).innerHTML += kopie_oms_createInput(kopie_oms_arrInput[intI], kopie_oms_arrInputValue[intI]);
		  }
		}

		function kopie_oms_createInput(id,value)
		{
		  return "<b>Omschrijving</b><br/><textarea class='mceEditor' id='kopie_oms_"+ id +"' name='kopie_oms_"+ id +"' rows='15' cols='80' onchange='kopie_oms_saveValue("+  id +",this.value);'>"+ value +"</textarea><br />";
		}

		function kopie_oms_deleteInput()
		{
		  if (kopie_oms_arrInput.length > 0) {
		     kopie_oms_arrInput.pop();
		     kopie_oms_arrInputValue.pop();
		  }
		  kopie_oms_display();
		}

		var kopie_p_arrInput 		= new Array(0);

		function kopie_p_addInput()
		{
		  kopie_p_arrInput.push(kopie_p_arrInput.length);
		  kopie_p_display();
		}

		function kopie_p_display()
		{
		  document.getElementById('kopie').innerHTML = "";

		  for (intI=0; intI<kopie_p_arrInput.length; intI++)
		  {
			document.getElementById('kopie').innerHTML += kopie_p_createInput(kopie_p_arrInput[intI]);
		  }
		}

		function kopie_p_createInput(id)
		{
		  return "<p id='kopie"+ id +"'></p>";
		}

		function kopie_p_deleteInput()
		{
		  if (kopie_p_arrInput.length > 0) {
		     kopie_p_arrInput.pop();
		  }
		  kopie_p_display();
		}

		var aantalP = 0;

		function fillP()
		{
		    kopie_bnr_addInput(document.getElementById('number').value);
		    kopie_klc_addInput(document.getElementById('colorcode').value);

			function getRadioValue(radioN)
			{
				for(i=0;i<document.additem[radioN].length;i++)
				{
					if (document.additem[radioN][i].checked == true)
					{
						return document.additem[radioN][i].value;
					}
				}
			}

		    kopie_mou_addInput(getRadioValue('sleeves'));
		    kopie_mer_addInput(document.getElementById('brand').value);
		    kopie_naa_addInput(document.getElementById('name').value);
		    kopie_kle_addInput(document.getElementById('color').value);
		    kopie_apri_addInput(document.getElementById('adprice').value);
		    kopie_pri_addInput(document.getElementById('price').value);

		    var size_first_contents = '';
		    if (document.getElementById('size_first').value != undefined)
		    {
			size_first_contents = document.getElementById('size_first').value;
		    }

		    kopie_size_addInput(size_first_contents);

		    if (sizes_arrInput.length >= 1)
		    {
			for (i=0; i<sizes_arrInput.length; i++)
			{
				if (document.getElementById('sizes'+i) != null && document.getElementById('sizes'+i) != undefined && document.getElementById('sizes'+i).value != '')
				{
					var test = kopie_p_arrInput.length - 1;

					kopie_sizes_addInput(test, document.getElementById('sizes'+i).value);
					kopie_prices_addInput(test, document.getElementById('sizes_price'+i).value);
					kopie_beste_addInput(test, document.getElementById('sizes_beste'+i).value)

				}
			}
		    }

			for (intB=0; intB<kopie_all_beste.length; intB++)
			{
				document.getElementById('kopie_p_sizes'+ intB).innerHTML = "";
				// allemaal langsgaan om in te voegen bij bestaande p 's
				for (intI=0; intI<kopie_all_beste[intB].length; intI++)
				{
					if (typeof (kopie_all_sizes[intB][intI]) != "undefined" && kopie_all_sizes[intB][intI] != "")
					{
						document.getElementById('kopie_p_sizes'+ intB).innerHTML += kopie_sizes_createInput(intB, intI, kopie_all_sizes[intB][intI]);
					}

					if (typeof (kopie_all_prices[intB][intI]) != "undefined" && kopie_all_sizes[intB][intI] != "")
					{
						document.getElementById('kopie_p_sizes'+ intB).innerHTML += kopie_prices_createInput(intB, intI, kopie_all_prices[intB][intI]);
					}

					if (typeof (kopie_all_beste[intB][intI]) != "undefined" && kopie_all_sizes[intB][intI] != "")
					{
						document.getElementById('kopie_p_sizes'+ intB).innerHTML += kopie_beste_createInput(intB, intI, kopie_all_beste[intB][intI]);
					}
				}
			}

		    kopie_oms_addInput(tinyMCE.get('descr').getContent());

		    tinyMCE.init(
		    {
			mode : "specific_textareas",
			editor_selector : "mceEditor",
			theme: "advanced",
			theme_advanced_toolbar_location : "top",
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,bullist",
			theme_advanced_buttons2 : "fontselect,fontsizeselect",
			theme_advanced_buttons3 : ""
		    });

		    aantalP++;
		}

		var deleted_fields_edit = [];

		var sizes_arrInput 		= new Array(0);
		var sizes_arrInputValue 	= new Array(0);
		var sizes_arrInputValue_price 	= new Array(0);
		var sizes_arrInputValue_beste 	= new Array(0);

		function sizes_addInput(value,adprice,bestelnr)
		{
		  sizes_arrInput.push(sizes_arrInput.length);
		  sizes_arrInputValue.push(value);
		  sizes_arrInputValue_price.push(adprice);
		  sizes_arrInputValue_beste.push(bestelnr);
		  sizes_display();
		}

		function sizes_display()
		{
		  document.getElementById('sizes').innerHTML = "";

		  for (intI=0; intI<sizes_arrInput.length&&intI<40; intI++)
		  {
		    if (!(intI in deleted_fields_edit))
		    {
			document.getElementById('sizes').innerHTML += sizes_createInput(sizes_arrInput[intI], sizes_arrInputValue[intI], sizes_arrInputValue_price[intI],sizes_arrInputValue_beste[intI]);
		    }
		  }
		}

		function sizes_saveValue(intId,strValue,price,bestelnr)
		{
		  if (price == 0)
		  {
			sizes_arrInputValue[intId]=strValue;
		  }

		  if (price == 1)
		  {
			sizes_arrInputValue_price[intId]=strValue;
		  }

		  if (price == 2)
		  {
			sizes_arrInputValue_beste[intId]=strValue;
		  }
		}

		function sizes_createInput(id,value,value_price,value_beste)
		{
		  var size_copy = document.getElementById('size_first').value;
		  var adprice_copy = document.getElementById('adprice').value;
		  var number_copy = document.getElementById('number').value;

		  return "<br/><input type='text' id='sizes"+ id +"' name='sizes"+ id +"' onchange='sizes_saveValue("+  id +",this.value,0); sizes_addInput(\""+ size_copy +"\","+ adprice_copy +","+ number_copy +");' value='"+ value +"' /> Prijs: € <input type='text' id='sizes_price"+ id +"' name='sizes_price"+ id +"' onchange='sizes_saveValue("+  id +",this.value,1);' value='"+ value_price +"' /> Bestelnr.:  <input type='text' id='sizes_beste"+ id +"' name='sizes_beste"+ id +"' onchange='sizes_saveValue("+  id +",this.value,2);' value='"+ value_beste +"' /> <a href=\"#maatvarianten\" onclick=\"sizes_deleteInput_edit("+ id +")\">Verwijder deze rij</a><br/>";
		}

		function sizes_deleteInput()
		{
		  if (sizes_arrInput.length > 0) {
		     sizes_arrInput.pop();
		     sizes_arrInputValue.pop();
		  }
		  sizes_display();
		}

		function sizes_deleteInput_edit(id)
		{
		  deleted_fields_edit[id] = "";

		  sizes_display();
		}

		var amount_arrInput 		= new Array(0);
		var amount_arrInputValue 	= new Array(0);

		function amount_addInput()
		{
		  amount_arrInput.push(amount_arrInput.length);
		  amount_arrInputValue.push("");
		  amount_display();
		}

		function amount_display()
		{
		  for (intI=0; intI<amount_arrInput.length; intI++)
		  {
		    document.getElementById('percent' + intI).innerHTML += amount_createInput(amount_arrInput[intI], amount_arrInputValue[intI]);
		  }
		}

		function amount_saveValue(intId,strValue)
		{
		  amount_arrInputValue[intId]=strValue;
		}

		function amount_createInput(id,value)
		{
		  return "<input type='text' id='amount "+ id +"' name='amount"+ id +"' onchange='amount_saveValue("+  id +",this.value);' value='"+ value +"' style='width: 80px;' />";
		}

		function amount_deleteInput()
		{
		  if (amount_arrInput.length > 0) {
		     amount_arrInput.pop();
		     amount_arrInputValue.pop();
		  }
		  amount_display();
		}

		var amount2_arrInput 		= new Array(0);
		var amount2_arrInputValue 	= new Array(0);

		function amount2_addInput()
		{
		  amount2_arrInput.push(amount2_arrInput.length);
		  amount2_arrInputValue.push("");
		  amount2_display();
		}

		function amount2_display()
		{
		  for (intI=0; intI<amount2_arrInput.length; intI++)
		  {
		    document.getElementById('percent' + intI).innerHTML += amount2_createInput(amount2_arrInput[intI], amount2_arrInputValue[intI]);
		  }
		}

		function amount2_saveValue(intId,strValue)
		{
		  amount2_arrInputValue[intId]=strValue;
		}

		function amount2_createInput(id,value)
		{
		  return " - <input type='text' id='amount "+ id +"' name='amount2"+ id +"' onchange='amount2_saveValue("+  id +",this.value);' value='"+ value +"' style='width: 80px;' />";
		}

		function amount2_deleteInput()
		{
		  if (amount2_arrInput.length > 0) {
		     amount2_arrInput.pop();
		     amount2_arrInputValue.pop();
		  }
		  amount2_display();
		}

		var percent_arrInput 		= new Array(0);
		var percent_arrInputValue 	= new Array(0);

		function percent_addInput()
		{
		  percent_arrInput.push(percent_arrInput.length);
		  percent_arrInputValue.push("");
		  percent_display();
		}

		function percent_display()
		{
		  for (intI=0; intI<percent_arrInput.length; intI++)
		  {
		    document.getElementById('percent' + intI).innerHTML += percent_createInput(percent_arrInput[intI], percent_arrInputValue[intI]);
		  }
		}

		function percent_saveValue(intId,strValue)
		{
		  percent_arrInputValue[intId]=strValue;
		}

		function percent_createInput(id,value)
		{
		  return " <input type='text' id='percent "+ id +"' name='percent"+ id +"' onchange='percent_saveValue("+  id +",this.value);' value='"+ value +"' style='width: 35px;' /> %";
		}

		function percent_deleteInput()
		{
		  if (percent_arrInput.length > 0) {
		     percent_arrInput.pop();
		     percent_arrInputValue.pop();
		  }
		  percent_display();
		}

		var percent_p_arrInput 		= new Array(0);

		function percent_p_addInput()
		{
		  percent_p_arrInput.push(percent_p_arrInput.length);
		  percent_p_display();
		}

		function percent_p_display()
		{
		  document.getElementById('percentages').innerHTML = "";

		  for (intI=0; intI<percent_p_arrInput.length; intI++)
		  {
		    document.getElementById('percentages').innerHTML += percent_p_createInput(percent_p_arrInput[intI]);
		  }
		}

		function percent_p_createInput(id)
		{
		  return "<p id='percent"+ id +"'></p>";
		}

		function percent_p_deleteInput()
		{
		  if (percent_p_arrInput.length > 0) {
		     percent_p_arrInput.pop();
		  }
		  percent_p_display();
		}

		function fillPercent()
		{
		    amount_addInput();
		    amount2_addInput();
		    percent_addInput();
		}

		function showImage(location,width,height,original,width_orig,height_orig)
		{
			document.getElementById('currentimage').innerHTML = '<img src=' + location + ' width=' + width + 'px" height=' + height + 'px" style="border: 0; cursor: pointer;" title="Klik op deze afbeelding om deze in een apart venster te openen" onClick=javascript:window.open("'+ original +'","blank","toolbar=no,width='+ width_orig +',height='+ height_orig +'") />';
		}
