function copyDetails()
{
	if (document.getElementById('same')) {
		var same = document.getElementById('same');
		
		same.onclick = function() {
			var billing_first_name = document.getElementById('billing_first_name');
			var first_name = document.getElementById('first_name');
			
			var billing_last_name = document.getElementById('billing_last_name');
			var last_name = document.getElementById('last_name');
			
			var billing_company = document.getElementById('billing_company');
			var company = document.getElementById('company');
			
			var billing_address = document.getElementById('billing_address');
			var address = document.getElementById('address');
			
			var billing_address_2 = document.getElementById('billing_address_2');
			var address_2 = document.getElementById('address_2');
			
			var billing_town = document.getElementById('billing_town');
			var town = document.getElementById('town');
			
			var billing_county = document.getElementById('billing_county');
			var county = document.getElementById('county');
			
			var billing_postal_code = document.getElementById('billing_postal_code');
			var postal_code = document.getElementById('postal_code');			
			
			if (billing_first_name.value) { first_name.value = billing_first_name.value; }
			if (billing_last_name.value) { last_name.value = billing_last_name.value; }
			if (billing_company.value) { company.value = billing_company.value; }
			if (billing_address.value) { address.value = billing_address.value; }
			if (billing_address_2.value) { address_2.value = billing_address_2.value; }
			if (billing_town.value) { town.value = billing_town.value; }
			if (billing_county.value) { county.value = billing_county.value; }
			if (billing_postal_code.value) { postal_code.value = billing_postal_code.value; }
			
			return false;
		}
	}
}

addLoadEvent(copyDetails);
