// JavaScript Document


function submitCheck() 
{
if(document.onlineorder.Name.value=="") 
	{
	alert("You must supply your Name to submit your Order.");
	document.onlineorder.Name.focus();
	document.onlineorder.Name.select();
	return false;
	}

var test = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' "
		
// All characters must be digits
// Check each character in Name to see that it is a digit
		
for (var index = 0; index < 36; index ++)
	{
	if(test.indexOf(document.onlineorder.Name.value.charAt(index))< 0) 
		{
		alert("You must supply a valid Name to submit your Order.")
		document.onlineorder.Name.focus();
		document.onlineorder.Name.select();
		return false;
		}  // Something other than a digit found
	}

if((document.onlineorder.contactnumber.value.length < 8) || (document.onlineorder.contactnumber.value.length > 10))
	{ 
	alert("You must supply a valid Phone Number to submit your Order.");
	document.onlineorder.contactnumber.focus();
	document.onlineorder.contactnumber.select();
	return false;
	}		//Incorrect length
		
var test = "0123456789"
		
// All characters must be digits
// Check each character in contact number to see that it is a digit
		
for (var index = 0; index < 11; index ++)
	{
	if(test.indexOf(document.onlineorder.contactnumber.value.charAt(index))< 0)
		{
		alert("The Phone Number must be numeric to submit your Order.")
		document.onlineorder.contactnumber.focus();
		document.onlineorder.contactnumber.select();
		return false;
		}    // Something other than a digit found
	}

if(document.onlineorder.EmailAddress.value=="") 
	{
	alert("You must supply an Email Address to submit your Order."); 
    document.onlineorder.EmailAddress.focus();
    document.onlineorder.EmailAddress.select();
    return false;
	}

if(document.onlineorder.EmailAddress.value.length > 0) 
	{
	var j = new RegExp(); 
    j.compile("@"); 
    if (!j.test(onlineorder["EmailAddress"].value))
		{ 
        alert("You must supply a valid Email Address to submit your Order."); 
        document.onlineorder.EmailAddress.focus();
        document.onlineorder.EmailAddress.select();
        return false;
		}
	} 
	
if (document.onlineorder.StreetAddress.value=="")
	{
	alert("You must supply your Address to submit your Order.");
	document.onlineorder.StreetAddress.focus();
	document.onlineorder.StreetAddress.select();
	return false;
	}

if (document.onlineorder.City.value=="")
	{
	alert("You must supply your City to submit your Order.");
	document.onlineorder.City.focus();
	document.onlineorder.City.select();
	return false;
	}

var test = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' "
		
// All characters must be digits
// Check each character in Name to see that it is a digit
		
for (var index = 0; index < 25; index ++)
	{
	if(test.indexOf(document.onlineorder.City.value.charAt(index))< 0) 
		{
		alert("You must supply a valid City to submit your Order.")
		document.onlineorder.City.focus();
		document.onlineorder.City.select();
		return false;
		}   // Something other than a digit found
	}
	
if(document.onlineorder.PostCode.value.length ==4) 
	{
	len = 4
	}
else
	{
	alert("Postcode must be four digits in length to submit your Inquiry.");
	document.onlineorder.PostCode.focus();
	document.onlineorder.PostCode.select();
	return false;
	}		//Incorrect length
		
var test = "0123456789"
		
// All characters must be digits
// Check each character in PCode to see that it is a digit
		
for (var index = 0; index < 4; index ++)
	{
	if(test.indexOf(document.onlineorder.PostCode.value.charAt(index))< 0) 
		{
		alert("Postcode must be numeric to submit your Inquiry.")
		document.onlineorder.PostCode.focus();
		document.onlineorder.PostCode.select();
		return false;
		}// Something other than a digit found
	}
				 
if(document.onlineorder.Wine0.checked) 
	{
	if((document.onlineorder.w0001.value=="") && (document.onlineorder.w0002.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0001.focus();
		document.onlineorder.w0001.select();
		return false;
		}
	}
if(document.onlineorder.w0001.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0001.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0001.focus();
			document.onlineorder.w0001.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0002.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0002.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0002.focus();
			document.onlineorder.w0002.select();
			return false;    // Something other than a digit found
			}
		}
	}
	
	if(document.onlineorder.Wine1.checked) 
	{
	if((document.onlineorder.w0101.value=="") && (document.onlineorder.w0102.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0101.focus();
		document.onlineorder.w0101.select();
		return false;
		}
	}
if(document.onlineorder.w0101.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0101.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0101.focus();
			document.onlineorder.w0101.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0102.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0102.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0102.focus();
			document.onlineorder.w0102.select();
			return false;    // Something other than a digit found
			}
		}
	}
	
	if(document.onlineorder.Wine2.checked) 
	{
	if((document.onlineorder.w0201.value=="") && (document.onlineorder.w0201.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0201.focus();
		document.onlineorder.w0201.select();
		return false;
		}
	}
if(document.onlineorder.w0201.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0201.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0201.focus();
			document.onlineorder.w0201.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0202.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0202.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0202.focus();
			document.onlineorder.w0202.select();
			return false;    // Something other than a digit found
			}
		}
	}
	
	if(document.onlineorder.Wine3.checked) 
	{
	if((document.onlineorder.w0301.value=="") && (document.onlineorder.w0301.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0301.focus();
		document.onlineorder.w0301.select();
		return false;
		}
	}
if(document.onlineorder.w0301.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0301.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0301.focus();
			document.onlineorder.w0301.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0302.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0302.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0302.focus();
			document.onlineorder.w0302.select();
			return false;    // Something other than a digit found
			}
		}
	}

if(document.onlineorder.Wine4.checked) 
	{
	if((document.onlineorder.w0401.value=="") && (document.onlineorder.w0401.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0401.focus();
		document.onlineorder.w0401.select();
		return false;
		}
	}
if(document.onlineorder.w0401.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0401.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0401.focus();
			document.onlineorder.w0401.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0402.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0402.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0402.focus();
			document.onlineorder.w0402.select();
			return false;    // Something other than a digit found
			}
		}
	}

if(document.onlineorder.Wine5.checked) 
	{
	if((document.onlineorder.w0501.value=="") && (document.onlineorder.w0501.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0501.focus();
		document.onlineorder.w0501.select();
		return false;
		}
	}
if(document.onlineorder.w0501.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0501.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0501.focus();
			document.onlineorder.w0501.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0502.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0502.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0502.focus();
			document.onlineorder.w0502.select();
			return false;    // Something other than a digit found
			}
		}
	}

if(document.onlineorder.Wine6.checked) 
	{
	if((document.onlineorder.w0601.value=="") && (document.onlineorder.w0601.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0601.focus();
		document.onlineorder.w0601.select();
		return false;
		}
	}
if(document.onlineorder.w0601.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0601.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0601.focus();
			document.onlineorder.w0601.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0602.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0602.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0602.focus();
			document.onlineorder.w0602.select();
			return false;    // Something other than a digit found
			}
		}
	}

if(document.onlineorder.Wine7.checked) 
	{
	if((document.onlineorder.w0701.value=="") && (document.onlineorder.w0701.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0701.focus();
		document.onlineorder.w0701.select();
		return false;
		}
	}
if(document.onlineorder.w0701.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0701.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0701.focus();
			document.onlineorder.w0701.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0702.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0702.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0702.focus();
			document.onlineorder.w0702.select();
			return false;    // Something other than a digit found
			}
		}
	}

if(document.onlineorder.Wine8.checked) 
	{
	if((document.onlineorder.w0801.value=="") && (document.onlineorder.w0801.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0801.focus();
		document.onlineorder.w0801.select();
		return false;
		}
	}
if(document.onlineorder.w0801.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0801.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0801.focus();
			document.onlineorder.w0801.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0802.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0802.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0802.focus();
			document.onlineorder.w0802.select();
			return false;    // Something other than a digit found
			}
		}
	}
if(document.onlineorder.Wine9.checked) 
	{
	if((document.onlineorder.w0901.value=="") && (document.onlineorder.w0901.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w0901.focus();
		document.onlineorder.w0901.select();
		return false;
		}
	}
if(document.onlineorder.w0901.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0901.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0901.focus();
			document.onlineorder.w0901.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w0902.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w0902.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w0902.focus();
			document.onlineorder.w0902.select();
			return false;    // Something other than a digit found
			}
		}
	}

if(document.onlineorder.Wine10.checked) 
	{
	if((document.onlineorder.w1001.value=="") && (document.onlineorder.w1001.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w1001.focus();
		document.onlineorder.w1001.select();
		return false;
		}
	}
if(document.onlineorder.w1001.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w1001.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w1001.focus();
			document.onlineorder.w1001.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w1002.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w1002.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w1002.focus();
			document.onlineorder.w1002.select();
			return false;    // Something other than a digit found
			}
		}
	}

if(document.onlineorder.Wine11.checked) 
	{
	if((document.onlineorder.w1101.value=="") && (document.onlineorder.w1101.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w1101.focus();
		document.onlineorder.w1101.select();
		return false;
		}
	}
if(document.onlineorder.w1101.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w1101.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w1101.focus();
			document.onlineorder.w1101.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w1102.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w1102.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w1102.focus();
			document.onlineorder.w1102.select();
			return false;    // Something other than a digit found
			}
		}
	}
if(document.onlineorder.Wine12.checked) 
	{
	if((document.onlineorder.w1201.value=="") && (document.onlineorder.w1201.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w1201.focus();
		document.onlineorder.w1201.select();
		return false;
		}
	}
if(document.onlineorder.w1201.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w1201.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w1201.focus();
			document.onlineorder.w1201.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w1202.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w1202.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w1202.focus();
			document.onlineorder.w1202.select();
			return false;    // Something other than a digit found
			}
		}
	}

if(document.onlineorder.Wine13.checked) 
	{
	if((document.onlineorder.w1301.value=="") && (document.onlineorder.w1301.value==""))
		{
		alert("You must supply a Quantity to place an order.");
		document.onlineorder.w1301.focus();
		document.onlineorder.w1301.select();
		return false;
		}
	}
if(document.onlineorder.w1301.value.length > 0) 
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w1301.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w1301.focus();
			document.onlineorder.w1301.select();
			return false;    // Something other than a digit found
			}
		}
	}
					
if(document.onlineorder.w1302.value.length > 0)
	{ 
	  		
	var test = "0123456789"
		
	// All characters must be digits
	// Check each character in contact number to see that it is a digit
		
	for (var index = 0; index < 3; index ++)
		{
		if(test.indexOf(document.onlineorder.w1302.value.charAt(index))< 0) 
			{
			alert("The Quantity must be numeric to submit your Order.")
			document.onlineorder.w1302.focus();
			document.onlineorder.w1302.select();
			return false;    // Something other than a digit found
			}
		}
	}



}
		  