
/* Modified by Alex Spooner, 2007-09-05 */

function customizeProduct(id)
{
	document.getElementById('BD'+id).style.display = 'none';
	document.getElementById('CB'+id).style.display = 'none';
	document.getElementById('CD'+id).style.display = 'block';
	document.getElementById('AB'+id).style.display = 'block';
	eval('document.ProductForm'+id).qty.focus();
}

function wantImp(id,impr)
{
	if (impr==1) document.getElementById('IMP'+id).style.display = 'block';
	else document.getElementById('IMP'+id).style.display = 'none';
}

function checkQty(id,mnimp,mimp)
{
	q = eval('document.ProductForm'+id).qty.value;
	impr = eval('document.ProductForm'+id).imp.value;
	res = true;
	if (q=='')
	{
		msg = 'Please add quantity!';
		res = false;
	}
	else if (isNaN(q))
	{
		msg = 'Quantity is not a number!';
		res = false;
	}
	else if ((q<mnimp && impr==2) || (q<mimp && impr==1))
	{
		msg = 'Quantity is too low!';
		res = false;
	}
	if (!res)
	{
		document.getElementById('QTY'+id).innerHTML = msg;
	}
	else
	{
		document.getElementById('QTY'+id).innerHTML = '';
	}
	return res;
}
