function validateBuy()
{
	fv = new formValidator();
	
	if (fv.isEmpty("quantity"))
		fv.raiseError("Please specify a quantity.");
		
	if (!fv.isNumber("quantity"))
		fv.raiseError("Please specify a numeric value for quantity.");

	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;	
}

function validateCheckOut()
{
	fv = new formValidator();
	
	if (fv.isEmpty("m_1"))
		fv.raiseError("Please specify your name.");
		
	if (fv.isEmpty("m_2"))
		fv.raiseError("Please specify your surname.");
		
	if (fv.isEmpty("m_3"))
		fv.raiseError("Please specify your email sddress.");
	else
	if (!fv.isEmailAddress("m_3"))
		fv.raiseError("Please specify a valid email address.");
		
	if (fv.isEmpty("m_4"))
		fv.raiseError("Please specify a contact number.");
		
	if (fv.isEmpty("m_5"))
		fv.raiseError("Please specify a delivery address line 1.");
		
	if (fv.isEmpty("m_8"))
		fv.raiseError("Please specify a city.");
		
	if (fv.isEmpty("m_9"))
		fv.raiseError("Please specify a postal code.");
		
	if (fv.isEmpty("m_10"))
		fv.raiseError("Please specify a country.");

	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;			
}

function doShippingNotification()
{
	fv = new formValidator();
	
	if (fv.findObj("m_1").value != "ZA")
		alert("Please note that an additional R450 will be charged for delivery as you have specified a country outside of South Africa.");
}
