
/**
 * toggles the display property of an element
 */
function toggleElement(objname)
	{
	obj = document.getElementById(objname);

	if (obj.style.display == 'none')
		obj.style.display = 'block';
	else
		obj.style.display = 'none';
	}

/**
 * Sets the recommended product amount in cart
 */
function applyHint(prod, amount)
	{
	$o = document.getElementById('quantity[' + prod + ']');
	$o.value = amount;
	document.getElementById('cartform').submit();
	}

/**
 * Add a bunch of products to a shoppinglist
 */
function addBulkShoppingList()
	{
	a = document.getElementsByTagName('input');
	s = '';

	for (var i=0;i<a.length;i++) 
		{
		name = a[i].name;
		matches = name.match(/quantity\[(.*)\]/);
		if (!(matches == null))
			{
			s += ',' + matches[1];
			}
		}
	clientPopup('', '<iframe class=subframe src=/account/shoppinglist/?action=addBulk&product=' + s + '></iframe>');
	}

