function setPaymentInfo(isChecked)
{
	with (window.document.frmCheckout) {
		if (isChecked) {
			txtPaymentFirstName.value     = txtShippingFirstName.value;
			txtPaymentLastName.value      = txtShippingLastName.value;
                        txtPaymentEMail.value         = txtShippingEMail.value;
                        txtPaymentPhoneAreaCode.value = txtShippingPhoneAreaCode.value;
                        txtPaymentPhone1.value        = txtShippingPhone1.value;
                        txtPaymentPhone2.value        = txtShippingPhone2.value;
                        txtPaymentCountry.value       = txtShippingCountry.value;
			txtPaymentAddress1.value      = txtShippingAddress1.value;
			txtPaymentAddress2.value      = txtShippingAddress2.value;
			txtPaymentCity.value          = txtShippingCity.value;
                        txtPaymentState.value         = txtShippingState.value;
			txtPaymentPostalCode.value    = txtShippingPostalCode.value;
			txtPaymentFirstName.readOnly     = true;
			txtPaymentLastName.readOnly      = true;
                        txtPaymentEMail.readOnly         = true;
                        txtPaymentPhoneAreaCode.readOnly = true;
                        txtPaymentPhone1.readOnly        = true;
                        txtPaymentPhone2.readOnly        = true;
                        txtPaymentCountry.readOnly       = true;
			txtPaymentAddress1.readOnly      = true;
			txtPaymentAddress2.readOnly      = true;
			txtPaymentState.readOnly         = true;
			txtPaymentCity.readOnly          = true;
			txtPaymentPostalCode.readOnly    = true;
		} else {
			txtPaymentFirstName.readOnly     = false;
			txtPaymentLastName.readOnly      = false;
                        txtPaymentEMail.readOnly         = false;
                        txtPaymentPhoneAreaCode.readOnly = false;
                        txtPaymentPhone1.readOnly        = false;
                        txtPaymentPhone2.readOnly        = false;
                        txtPaymentCountry.readOnly       = false;
			txtPaymentAddress1.readOnly      = false;
			txtPaymentAddress2.readOnly      = false;
			txtPaymentState.readOnly         = false;
			txtPaymentCity.readOnly          = false;
			txtPaymentPostalCode.readOnly    = false;
		}
	}
}


function checkShippingAndPaymentInfo()
{
	with (window.document.frmCheckout) {
		if (isEmpty(txtShippingFirstName, 'Enter first name')) {
			return false;
		} else if (isEmpty(txtShippingLastName, 'Enter last name')) {
			return false;
                } else if (isEmpty(txtShippingEMail, 'Enter e-mail')) {
			return false;
                } else if (validateEmail(txtShippingEMail) != "") {
                        alert(validateEmail(txtShippingEMail));
			return false;
                } else if (isEmpty(txtShippingPhoneAreaCode, 'Enter phone number area code')) {
			return false;
                } else if (isIncomplete(txtShippingPhoneAreaCode, 3)){
                        alert("The Area code is incomplete");
                        return false;
                } else if (isEmpty(txtShippingPhone1, 'Phone number is incomplete')) {
			return false;
                } else if (isIncomplete(txtShippingPhone1, 3)){
                        alert("The first part of the phone number is incomplete");
                        return false;
                } else if (isEmpty(txtShippingPhone2, 'Phone number is incomplete')) {
			return false;
                } else if (isIncomplete(txtShippingPhone2, 4)){
                        alert("The second part of the phone number is incomplete");
                        return false;
                } else if (isEmpty(txtShippingCountry, 'Enter country')) {
			return false;
		} else if (isEmpty(txtShippingAddress1, 'Enter shipping address')) {
			return false;
		} else if (isEmpty(txtShippingState, 'Enter shipping address state')) {
			return false;
		} else if (isEmpty(txtShippingCity, 'Enter shipping address city')) {
			return false;
		} else if (isEmpty(txtShippingPostalCode, 'Enter the shipping address postal/zip code')) {
			return false;
		} else if (isEmpty(txtPaymentFirstName, 'Enter first name')) {
			return false;
		} else if (isEmpty(txtPaymentLastName, 'Enter last name')) {
			return false;
                } else if (isEmpty(txtPaymentEMail, 'Enter e-mail')) {
			return false;
                } else if (validateEmail(txtPaymentEMail) != "") {
                        alert(validateEmail(txtPaymentEMail));
			return false;
                } else if (isEmpty(txtPaymentPhoneAreaCode, 'Enter phone number area code')) {
			return false;
                } else if (isIncomplete(txtPaymentPhoneAreaCode, 3)){
                        alert("The Area code is incomplete");
                        return false;
                } else if (isEmpty(txtPaymentPhone1, 'Phone number is incomplete')) {
			return false;
                } else if (isIncomplete(txtPaymentPhone1, 3)){
                        alert("The first part of the phone number is incomplete");
                        return false;
                } else if (isEmpty(txtPaymentPhone2, 'Phone number is incomplete')) {
			return false;
                } else if (isIncomplete(txtPaymentPhone2, 4)){
                        alert("The second part of the phone number is incomplete");
                        return false;
                } else if (isEmpty(txtPaymentCountry, 'Enter country')) {
			return false;
		} else if (isEmpty(txtPaymentAddress1, 'Enter Payment address')) {
			return false;
		} else if (isEmpty(txtPaymentState, 'Enter Payment address state')) {
			return false;
		} else if (isEmpty(txtPaymentCity, 'Enter Payment address city')) {
			return false;
		} else if (isEmpty(txtPaymentPostalCode, 'Enter the Payment address postal/zip code')) {
			return false;
		} else {
			return true;
		}
	}
}
function checkCreditCardInfo(){
	with (window.document.frmCreditCard) {
                if (isNotFull(txtCardNumber1, 4, 'Card number incomplete')) {
			return false;
		}else if (isNotFull(txtCardNumber2, 4, 'Card number incomplete')) {
			return false;
                }else if (isNotFull(txtCardNumber3, 4, 'Card number incomplete')) {
			return false;
                }else if (isNotFull(txtCardNumber4, 4, 'Card number incomplete')) {
			return false;
                }else{
                	return true;
                }
        }
}

