function ValidateStart()
{
   var retVal = true;
   var msg = "";
   
    if (GetField("txtQuantity") == "")
    {
        msg = "Please enter a quantity between 1 and 9.";
        retVal = false;
    } else {
		var q = GetField("txtQuantity");
		if (!IsValidQuantity(q)) {
		    msg = "Please enter a valid quantity (an integer between 1 and 9).";
			retVal = false;
		} 
		if (q >= 10) {
		    msg = ('When ordering larger quantities, please contact our office to discuss favourable discounts.  Call us on 0161 832 3786 or email at cglock@btinternet.com.');
			retVal = false;
			// allow user to continue			
		} 
		if (q < 1) {
		    msg = "You must order one or more CG-Lock(s).";
			retVal = false;			
		}
	}
   
    if (retVal == false)
        alert(msg);
    
    return retVal;
}

function ValidateBilling()
{
	return true;
}

function ValidateShipping()
{
	return true;
}

// Shared functions
function IsValidQuantity(Q)
{//+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/
	if  (/^\d+$/.test(Q)) {
	  return true;	  
	} else {
	  return false;
	}
}

function GetField(FieldName)
{
   return document.getElementById(FieldName).value;
}