var asBilling = false

function asBilling_Click(){
	asBilling = document.tehform.sameasabove.checked;
	// if the box has been checked
	if (asBilling) {
		copyValues();
	}
	// if the box has been unchecked
	else
	{
		document.tehform.shiptitle.value = "";
		document.tehform.shipfirstname.value = "";
		document.tehform.shiplastname.value = "";
		document.tehform.shippropname.value = "";
		document.tehform.shipaddress1.value = "";
		document.tehform.shipaddress2.value = "";
		document.tehform.shipcity.value = "";
		document.tehform.shipcountry.value = "";
		document.tehform.shipstate.value = "";
		document.tehform.shippostcode.value = "";
	}
	
}


function copyValues (){
	if (asBilling){
		document.tehform.shiptitle.value = document.tehform.title.value;
		document.tehform.shipfirstname.value = document.tehform.firstname.value;
		document.tehform.shiplastname.value = document.tehform.lastname.value;
		document.tehform.shippropname.value = document.tehform.propname.value;
		document.tehform.shipaddress1.value = document.tehform.address1.value;
		document.tehform.shipaddress2.value = document.tehform.address2.value;
		document.tehform.shipcity.value = document.tehform.city.value;
		document.tehform.shipcountry.value = document.tehform.country.value;
		document.tehform.shipstate.value = document.tehform.state.value;
		document.tehform.shippostcode.value = document.tehform.postcode.value;
	}
}
function checkscript() {
		if (document.tehform.title.value == "")	{
			alert('Please enter your first name');
			return false;
		} else if (document.tehform.intro.value == "")	{
			alert('Please enter your surname');
			return false;
		}
		return true;
	}
