function ValidateRegisterPurchaseForm(f)
{
	if (f.CDKEY1.value.length != 4 || f.CDKEY2.value.length != 4)
	{
		alert('Incorrect CDKEY.');
		return;
	}
	if (f.cname.value == '')
	{
		alert('Please enter your name');
		f.cname.focus();
		return;
	}
	if (! ValidateEmail(f.email.value))
	{
		alert('Please enter your email address');
		f.email.focus();
		return;
	}
	f.submit();
}
function ValidateProductIDForm(f)
{
	var pid = /^[A-Za-z0-9]{4,6}$/
	if (!pid.test(f.ProductID1.value) || !pid.test(f.ProductID2.value) || !pid.test(f.ProductID3.value) || !pid.test(f.ProductID4.value))
	{
		alert('Incorrect Product ID.');
		return false;
	}
	return true;
}
