// Shopping cart functions for adding items
function jsf_addItem(prodId,amPrice,ctVal,frmChk)
{
	var fldName = 'item' + prodId;
	var qtyVal = 0;
	var frmDtl = false;
	var frmChckt = false;
	if (ctVal)
	{
		qtyVal = ctVal;
		frmDtl = true;
	}
	else
		qtyVal = document.getElementById(fldName).value;
	if (frmChk)
	{
		frmChckt = true;
	}
	var calcPrice = eval(qtyVal*amPrice);
	var sUrl = 'cartSummary.cfm?addID=' + prodId + '&addQty=' + qtyVal + '&addPrice=' + calcPrice + '&fromDetail=' + frmDtl + '&fromCheckout=' + frmChckt;
	var addFrame = document.getElementById('cartFr');
	
	if(addFrame.cloneNode)
	{
		var newframe = addFrame.cloneNode(false);
		newframe.src = sUrl;
		addFrame.parentNode.replaceChild( newframe ,addFrame );
		return false;
	}
	else
	{
		return true;
	}
}
function jsf_testNum(oObj)
{
	if (isNaN(oObj.value))
	{
		alert('You may only enter numbers in this field.');
		oObj.focus();
	}
	else if (oObj.value.indexOf('.') > -1)
	{
		alert('You may only enter whole numbers in this field.');
		oObj.focus();
	}
	else
		return true;
}
function jsf_processOrder()
{
	alert('Your order will now be sent to Pryme for processing.\n\rYou will be contacted by the appropriate supplier.');
	window.location='orderProcess.cfm';
}