	function InvokeAction(A)
	{
		document.forms[0].action += A;
		document.forms[0].submit();
	}

	function ViewProduct(Id)
	{
		location.href = 'ViewProduct.asp?ProductId=' + Id;
	}
	
	function ViewProducts(id, ProductTitle)
	{
		location.href = 'ViewProducts.asp?GroupId=' + id + '&Title=' + ProductTitle;
	}

	function ShowName(CompanyName)
	{
		document.getElementById("CompanyName").innerHTML = CompanyName;
	}

	function HideName(CompanyName)
	{
		document.getElementById("CompanyName").innerHTML = '';
	}

	function DecreaseQuantity(Seqno)
	{
		document.forms[0]['Quantity_' + Seqno].value = parseInt(document.forms[0]['Quantity_' + Seqno].value) - 1;

		var re = new RegExp(/^[0-9]+$/);
		if (document.forms[0]['Quantity_' + Seqno].value < 1 || !re.test(document.forms[0]['Quantity_' + Seqno].value))
		{
			document.forms[0]['Quantity_' + Seqno].value = 1;
		}
	}

	function IncreaseQuantity(Seqno)
	{
		document.forms[0]['Quantity_' + Seqno].value = parseInt(document.forms[0]['Quantity_' + Seqno].value) + 1;

		var re = new RegExp(/^[0-9]+$/);
		if (document.forms[0]['Quantity_' + Seqno].value < 1 || !re.test(document.forms[0]['Quantity_' + Seqno].value))
		{
			document.forms[0]['Quantity_' + Seqno].value = 1;
		}
	}

	function CartAddProduct(ProductId)
	{
		InvokeAction('Add&ProductId=' + ProductId);
	}

	function CartAddProductDirectly(ProductId)
	{
		InvokeAction('AddDirectly&ProductId=' + ProductId);
		//location.href = 'ViewProduct.asp?Action=AddDirectly&ProductId=' + ProductId;
	}

	function CartRemoveItem(i)
	{
		if (confirm('Weet u zeker dat u dit product wilt verwijderen?'))
		{
			InvokeAction('Delete&Seqno=' + i);
		}
	}

	function ViewCart()
	{
		location.href = 'Winkelwagen';
	}

	function OrderForm()
	{
		location.href = 'Bestel-formulier';
	}

	function EditCustomer()
	{
		location.href = 'Bewerk-account';
	}

	function ViewCustomer()
	{
		location.href = 'Mijn-account';
	}

	function LogOff()
	{
		location.href = 'Uitloggen';
	}

	function LogOffConfirm()
	{
	if (confirm('Weet u zeker dat u wilt uitloggen (en daarmee de winkelwagen leegt)?'))
		{
		location.href = 'Uitloggen';
		}
	}

	function SetPassword()
	{
		location.href = 'Wachtwoord-wijzigen';
	}
	function OverviewBack(GroupId)
	{
		location.href = 'ViewProducts.asp?GroupId=' + GroupId
	}

	function toggle(object)
	{
		  if (document.getElementById) {
		    if (document.getElementById(object).style.visibility == 'visible')
		      document.getElementById(object).style.visibility = 'hidden';
		    else
		      document.getElementById(object).style.visibility = 'visible';
		  }

		  else if (document.layers && document.layers[object] != null) {
		    if (document.layers[object].visibility == 'visible' ||
		        document.layers[object].visibility == 'show' )
		      document.layers[object].visibility = 'hidden';
		    else
		      document.layers[object].visibility = 'visible';
		  }

		  else if (document.all) {
		    if (document.all[object].style.visibility == 'visible')
		      document.all[object].style.visibility = 'hidden';
		    else
		      document.all[object].style.visibility = 'visible';
		  }

		  return false;
	}

	function SubmitQuery()
	{
		var Query = document.getElementById('Query').value;

		if (Query.length > 0)
		{
			location.href = '/Zoekresultaten?Query=' + Query;
		}
		else
		{
			return false;
		}
	}
	
	var timeout       = 500;
	var closetimer		= 0;
	var ddmenuitem    = 0;
	
	function jsddm_open()
	{	jsddm_canceltimer();
		jsddm_close();
		ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');}
	
	function jsddm_close()
	{	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}
	
	function jsddm_timer()
	{	closetimer = window.setTimeout(jsddm_close, timeout);}
	
	function jsddm_canceltimer()
	{	if(closetimer)
		{	window.clearTimeout(closetimer);
			closetimer = null;}}
	
	$(document).ready(function()
	{	$('#jsddm > li').bind('mouseover', jsddm_open);
		$('#jsddm > li').bind('mouseout',  jsddm_timer);});
	
	document.onclick = jsddm_close;
	
	function Rollon(RollId)
	{
		document.getElementById(RollId).style.BackgroundImage = 'Images/HeadermenuBGhover.jpg';
	}

	function Rolloff(RollId)
	{
		document.getElementById(RollId).style.BackgroundImage = 'Images/HeadermenuBG.jpg';
	}