	
function setPaymentInfo(isChecked)
{
	with (window.document.frmCheckout) {
		if (isChecked) {
			txtPaymentAddress1.value   = txtShippingAddress1.value;
			txtPaymentAddress2.value   = txtShippingAddress2.value;
			txtPaymentCity.value       = txtShippingCity.value;
			txtPaymentPostalCode.value = txtShippingPostalCode.value;
			txtPaymentCountry.value    = txtShippingCountry.value;			
			
			txtPaymentAddress1.readOnly   = true;
			txtPaymentAddress2.readOnly   = true;
			txtPaymentCity.readOnly       = true;
			txtPaymentPostalCode.readOnly = true;			
			txtPaymentCountry.readOnly    = true;			
		} else {
			txtPaymentAddress1.readOnly   = false;
			txtPaymentAddress2.readOnly   = false;
			txtPaymentCity.readOnly       = false;
			txtPaymentPostalCode.readOnly = false;			
			txtPaymentCountry.readOnly    = false;			
		}
	}
}


function checkShippingInfo()
{
	with (window.document.frmCheckout) {
		if (isEmpty(txtFirstName, 'Enter first name')) {
			return false;
		} else if (isEmpty(txtLastName, 'Enter last name')) {
			return false;
		} else if (isEmpty(txtJobTitle, 'Enter job title')) {
			return false;
		} else if (isEmpty(txtCompany, 'Enter company')) {
			return false;
		} else if (isEmpty(txtEmail, 'Enter email address')) {
			return false;
		} else if (isEmpty(txtEmail, 'Enter email address')) {
			valcheck = document.getElementById("txtEmail");
			hasDot = txtEmail.value.indexOf(".");
			hasAt = txtEmail.value.indexOf("@");

			if (hasDot == -1 || hasAt == -1)
			{
				alert("Enter a valid email address.");
				txtEmail.focus();
				txtEmail.select();
				return false;
			}
			return false;
		} else if (isEmpty(txtShippingAddress1, 'Enter Delivery address')) {
			return false;
		} else if (isEmpty(txtShippingCity, 'Enter Delivery address city')) {
			return false;
		} else if (isEmpty(txtShippingPostalCode, 'Enter the Delivery address postal/zip code')) {
			return false;
		} else if (isEmpty(txtShippingCountry, 'Enter Delivery address country')) {
			return false;
		} else {
			valid=true;
			valcheck = document.getElementById("taxRegion");
			if (valcheck.value == "0") {
				alert("Select your tax region.");
				valcheck.focus();
				valid=false;
			}
			return valid;
		}
	}
}


function checkSubTotal()
{
	with (window.document.frmCart) {
		if (totalSum.value == '0') {
			alert("Your shopping cart is empty");
			return false;
		}
		else
			return true;
	}
}
