	function InvokeDataChangedAction(A)
	{
		if (dataChanged)
			var agee = confirm("Gegevens zijn gewijzigd,\n wilt u doorgaan zonder op te slaan?");
		else
			agee = true;

		if (agee)
		{
			this.InvokeAction(A)
		}
	}
	function InvokeAction(A)
	{
		document.forms[3].action += A;
		document.forms[3].submit();
	}

	function ToggleMenu(ItemId)
	{
		if (document.getElementById('SubMenu' + ItemId))
		{
			var IsOpen = 'block' == document.getElementById('SubMenu' + ItemId).style.display;
			document.getElementById('SubMenu' + ItemId).style.display = IsOpen ? 'none' : 'block';
		}
	}

	function OpenMenu(ItemId)
	{
		if (document.getElementById('SubMenu' + ItemId))
		{
			document.getElementById('SubMenu' + ItemId).style.display = 'block';
		}
	}

	function DecreaseQuantity(Seqno)
	{
		document.forms[3]['Quantity_' + Seqno].value = parseInt(document.forms[3]['Quantity_' + Seqno].value) - 1;

		var re = new RegExp(/^[0-9]+$/);
		if (document.forms[3]['Quantity_' + Seqno].value < 1 || !re.test(document.forms[3]['Quantity_' + Seqno].value))
		{
			document.forms[3]['Quantity_' + Seqno].value = 1;
		}
	}

	function IncreaseQuantity(Seqno)
	{
		document.forms[3]['Quantity_' + Seqno].value = parseInt(document.forms[3]['Quantity_' + Seqno].value) + 1;

		var re = new RegExp(/^[0-9]+$/);
		if (document.forms[3]['Quantity_' + Seqno].value < 1 || !re.test(document.forms[3]['Quantity_' + Seqno].value))
		{
			document.forms[3]['Quantity_' + Seqno].value = 1;
		}
	}

	function CartAddPrinterProduct(PrinterProductId)
	{
		InvokeAction('Add&PrinterProductId=' + PrinterProductId + '&Quantity=' + document.getElementById('Quantity_' + PrinterProductId).value);
	}
	
	function CartAddBProduct(PrinterProductId)
	{
		InvokeAction('AddB&PrinterProductId=' + PrinterProductId + '&Quantity=' + document.getElementById('Quantity_B' + PrinterProductId).value);
	}
	
	function CartAddProduct(ProductId)
	{
		InvokeAction('Add&ProductId=' + ProductId);
	}

	function CartAddQuickProduct(ProductId, GroupId)
	{
		InvokeAction('Add&GroupId=' + GroupId + '&ProductId=' + ProductId);
	}

	function CartRemoveItem(i)
	{
		InvokeAction('Delete&Seqno=' + i);
	}

	function ViewCart()
	{
		location.href = 'ViewShoppingCart.asp';
	}

	function OrderForm()
	{
		location.href = 'OrderForm.asp';
	}

	function EditCustomer()
	{
		location.href = 'EditCustomer.asp';
	}

	function ViewCustomer()
	{
		location.href = 'MyCustomerPage.asp';
	}

	function SetPassword()
	{
		location.href = 'EditPassword.asp';
	}

	function ViewProduct(ProductId)
	{
		location.href = 'ViewProduct.asp?ProductId=' + ProductId;
	}

	function ViewProductOnKeyDown(e, ProductId)
	{
		var keynum;
		var keychar;
		var numcheck;

		if(window.event) // IE
  		{
  			keynum = e.keyCode;
  		}
		else if(e.which) // Netscape/Firefox/Opera
  		{
  			keynum = e.which;
  		}
		if(keynum==13)
		{
			CartAddProduct(ProductId);
			return false
		}
		else
			return true;
	}
//		keychar = String.fromCharCode(keynum);
//		numcheck = /\d/;
//		return !numcheck.test(keychar);
//	}
