
function toggleBillingInfo(OrderForm)
{
   if (OrderForm.AsBilling.checked == true)
    {
        OrderForm.BTitle.value = OrderForm.ATitle.value;
        OrderForm.BFName.value = OrderForm.FName.value;
        OrderForm.BFName.value = OrderForm.FName.value;
        OrderForm.BSName.value = OrderForm.SName.value;
        OrderForm.BLineOne.value = OrderForm.LineOne.value;
        OrderForm.BLineTwo.value = OrderForm.LineTwo.value;
        OrderForm.BTown.value = OrderForm.Town.value;
		OrderForm.BCounty.value = OrderForm.County.value;
        OrderForm.BCountry.selectedIndex = OrderForm.Country.selectedIndex;
        OrderForm.BPostcode.value = OrderForm.Postcode.value;
	}
}


function CheckOrderForm() {

var message = "";
var MyOrderForm = document.forms.OrderForm;

if (MyOrderForm.FName.value =="") {
	message += "You have not entered your first name in the delivery address\n";
}
if (MyOrderForm.SName.value =="") {
	message += "You have not entered your last name in the delivery address\n";
}
if (MyOrderForm.LineOne.value == "") {
	message += "You have not entered the first line of your delivery address\n";
}
if (MyOrderForm.Town.value == "") {
	message += "You have not entered the town of your delivery address\n";
}
if (MyOrderForm.County.value == "") {
	message += "You have not entered the county of your delivery address\n";
}
if (MyOrderForm.Country.options[MyOrderForm.Country.selectedIndex].value == "SELECT" ) {
	message += "Please select a country for your delivery address\n";
}
if (MyOrderForm.Postcode.value == "") {
	message += "You have not entered a postcode for your delivery address";
}


if (message) {
var textmessage = "Sorry but we found the following errors" + "\n\n" + message;
alert(textmessage);
return false;
} else {
return true;
}
}


function CheckBilling() {

var message = "";
var MyOrderForm = document.forms.OrderForm;

if (MyOrderForm.BFName.value =="") {
	message += "You have not entered your first name in the billing address\n";
}
if (MyOrderForm.BSName.value =="") {
	message += "You have not entered your last name in the billing address\n";
}
if (MyOrderForm.BLineOne.value == "") {
	message += "You have not entered the first line of your billing address\n";
}
if (MyOrderForm.BTown.value == "") {
	message += "You have not entered the town of your billing address\n";
}
if (MyOrderForm.BCounty.value == "") {
	message += "You have not entered the county of your billing address\n";
}
if (MyOrderForm.BCountry.options[MyOrderForm.BCountry.selectedIndex].value == "SELECT" ) {
	message += "Please select a country for your billing address\n";
}
if (MyOrderForm.BPostcode.value == "") {
	message += "You have not entered a postcode for your billing address";
}		

if (message) {
	var textmessage = "Sorry but we found the following errors" + "\n\n" + message;
	alert(textmessage);
	return false;
} else {
	return true;
}

}
