function checkForm(){
	errorMsg = "";
	if(document.checkoutForm.contact_name.value == "" || document.checkoutForm.contact_name.value == null )
	{
		errorMsg += "Name \n";
		document.checkoutForm.contact_name.className = "highlighted";
	}

	if(document.checkoutForm.buyer_email.value == "" || document.checkoutForm.contact_name.value == null)
	{
		errorMsg += "Email \n";
		document.checkoutForm.buyer_email.className = "highlighted";
	}
	
	if(document.checkoutForm.buyer_billing_address_1.value == "" || document.checkoutForm.contact_name.value == null)
	{
		errorMsg += "Street \n";
		document.checkoutForm.buyer_billing_address_1.className = "highlighted";
	}
	
	if(document.checkoutForm.buyer_billing_city.value == "" || document.checkoutForm.contact_name.value == null)
	{
		errorMsg += "City \n";
		document.checkoutForm.buyer_billing_city.className = "highlighted";
	}
	
	if(document.checkoutForm.buyer_billing_region.value == "" || document.checkoutForm.contact_name.value == null )
	{
		errorMsg += "County \n";
		document.checkoutForm.buyer_billing_region.className = "highlighted";
	}
	
	if(document.checkoutForm.buyer_billing_postcode.value == "" || document.checkoutForm.contact_name.value == null )
	{
		errorMsg += "Postcode \n";
		document.checkoutForm.buyer_billing_postcode.className = "highlighted";
	}
	
		if(document.checkoutForm.buyer_phone.value == "" || document.checkoutForm.contact_name.value == null )
	{
		errorMsg += "Contact Phone Number \n";
		document.checkoutForm.buyer_phone.className = "highlighted";
	}
		
	if(errorMsg != "")
	{
		alert("Please provide the following: \n"+errorMsg);	
		return false;
	} else {
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		if(reg.test(document.checkoutForm.buyer_email.value) == false) {
      		alert('Please provide a valid Email Address');
      		return false;
   		}

		if(document.checkoutForm.buyer_shipping_address_1.value == "" || document.checkoutForm.buyer_shipping_address_1.value == null)
			copyBilling();
		return true;	
	}
	

}

function copyBilling(){
	document.checkoutForm.delivery_contact.value = document.checkoutForm.contact_name.value;
	document.checkoutForm.buyer_shipping_address_1.value = document.checkoutForm.buyer_billing_address_1.value;
	document.checkoutForm.buyer_shipping_address_2.value = document.checkoutForm.buyer_billing_address_2.value
	document.checkoutForm.buyer_shipping_city.value = document.checkoutForm.buyer_billing_city.value
	document.checkoutForm.buyer_shipping_region.value = document.checkoutForm.buyer_billing_region.value 
	document.checkoutForm.buyer_shipping_postcode.value = document.checkoutForm.buyer_billing_postcode.value
}