function checksubmit()
{
	var strAlert="";
	var err=0;
	if (document.getElementById('orderForm').ShopperEmail.value.length<5) {strAlert = strAlert+"Please enter an email address.\n";err=1;}
	if (document.getElementById('orderForm').BillingFirstName.value.length<1) {strAlert = strAlert+"Please enter a Billing Firstname.\n";err=1;}
	if (document.getElementById('orderForm').BillingLastName.value.length<1) 	{strAlert = strAlert+"Please enter a Billing Lastname.\n";err=1;}
	if (document.getElementById('orderForm').BillingAddress1.value.length<1) 	{strAlert = strAlert+"Please enter a Billing Address 1.\n";err=1;}
	if (document.getElementById('orderForm').BillingCounty.value.length<1) 	{strAlert = strAlert+"Please enter a Billing County.\n";err=1;}
	if (document.getElementById('orderForm').BillingPostal.value.length<1) 	{strAlert = strAlert+"Please enter a Billing Postcode.\n";err=1;}
	if (document.getElementById('orderForm').ShippingFirstName.value.length<1) {strAlert = strAlert+"Please enter a Shipping Firstname.\n";err=1;}
	if (document.getElementById('orderForm').ShippingLastName.value.length<1) 	{strAlert = strAlert+"Please enter a Shipping Lastname.\n";err=1;}
	if (document.getElementById('orderForm').ShippingAddress1.value.length<1) 	{strAlert = strAlert+"Please enter a Shipping Address 1.\n";err=1;}
	if (document.getElementById('orderForm').ShippingCounty.value.length<1) 	{strAlert = strAlert+"Please enter a Shipping County.\n";err=1;}
	if (document.getElementById('orderForm').ShippingPostal.value.length<1) 	{strAlert = strAlert+"Please enter a Shipping Postcode.\n";err=1;}
	if (err==1)
	{
		alert(strAlert);
	} else {
		document.getElementById('orderForm').submit();
	}
}

function ShippingSame(boxid)
{
	if (boxid.checked==true)
	{
		if (document.getElementById('orderForm').BillingCountry.value != document.getElementById('orderForm').ShippingCountry.value)
		{
			document.getElementById('orderForm').checkedSame.checked=false;
			alert("Country Error - You can only have billing same as country if the delivery country matches the billing country.");
		} else {
			document.getElementById('orderForm').ShippingFirstName.value = document.getElementById('orderForm').BillingFirstName.value;
			document.getElementById('orderForm').ShippingLastName.value = document.getElementById('orderForm').BillingLastName.value;
			document.getElementById('orderForm').ShippingAddress1.value = document.getElementById('orderForm').BillingAddress1.value;
			document.getElementById('orderForm').ShippingAddress2.value = document.getElementById('orderForm').BillingAddress2.value;
			document.getElementById('orderForm').ShippingCity.value = document.getElementById('orderForm').BillingCity.value;
			document.getElementById('orderForm').ShippingCounty.value = document.getElementById('orderForm').BillingCounty.value;
			document.getElementById('orderForm').ShippingPostal.value = document.getElementById('orderForm').BillingPostal.value;
			document.getElementById('orderForm').ShippingPhone.value = document.getElementById('orderForm').BillingPhone.value;
			document.getElementById('orderForm').ShippingCompany.value=document.getElementById('orderForm').BillingCompany.value;
		}
	} else {
		document.getElementById('orderForm').ShippingFirstName.value = "";
		document.getElementById('orderForm').ShippingLastName.value = "";
		document.getElementById('orderForm').ShippingCompany.value="";
		document.getElementById('orderForm').ShippingAddress1.value = "";
		document.getElementById('orderForm').ShippingAddress2.value = "";
		document.getElementById('orderForm').ShippingCity.value = "";
		document.getElementById('orderForm').ShippingCounty.value = "";
		document.getElementById('orderForm').ShippingPostal.value = "";
		document.getElementById('orderForm').ShippingPhone.value = "";
	}
}

