function updateAmount(i)
{
	var dasum = 0;
	dasum += Math.floor(document.form2.syQty.value) * 4;
	dasum += Math.floor(document.form2.qdQty.value) * 5;
	dasum += Math.floor(document.form2.ptQty.value) * 9;
	dasum += Math.floor(document.form2.donate[i].value);
	document.form2.amount.value = Math.floor(dasum).toFixed(2);	
}

function checkIsNumber( inputBox )
{
	var good = false;
	var dasum;
	for (i = 0; i < inputBox.value.length; i++)
	{
		mychar = inputBox.value.charAt(i);
		
		if (mychar >= 0 && mychar <= 9)
		{
			good = true;			
		}
		else
		{
			good = false;
			alert("Please enter a valid numeric Quantity.");
			inputBox.value = "";			
			break;			
		}
	}
	for (i = 0; i < document.form2.donate.length; i++)
	{
		if (document.form2.donate[i].checked)
		{
			updateAmount(i);
			break;
		}
		
	}	
}

function noAmount()
{
	if ( Math.floor(document.form2.amount.value) > 0 )
		return true;
	else
	{
		alert("Please select some donation amount!     \nOR\nSelect number of printed material(s).\nThanks!\n\nTeam Easy Recite Arabic Academy");
		return false;
	}
}
