function setPaymentInfo(isChecked)
{
	with (window.document.frmCheckout) {
		if (isChecked) {
			txtPaymentFirstName.value  = txtShippingFirstName.value;
			txtPaymentLastName.value   = txtShippingLastName.value;
			txtPaymentAddress1.value   = txtShippingAddress1.value;
			txtPaymentAddress2.value   = txtShippingAddress2.value;
			txtPaymentPhone.value      = txtShippingPhone.value;
			txtPaymentState.value      = txtShippingState.value;			
			txtPaymentCity.value       = txtShippingCity.value;
			txtPaymentPostalCode.value = txtShippingPostalCode.value;
			
			txtPaymentFirstName.readOnly  = true;
			txtPaymentLastName.readOnly   = true;
			txtPaymentAddress1.readOnly   = true;
			txtPaymentAddress2.readOnly   = true;
			txtPaymentPhone.readOnly      = true;
			txtPaymentState.readOnly      = true;			
			txtPaymentCity.readOnly       = true;
			txtPaymentPostalCode.readOnly = true;			
		} else {
			txtPaymentFirstName.readOnly  = false;
			txtPaymentLastName.readOnly   = false;
			txtPaymentAddress1.readOnly   = false;
			txtPaymentAddress2.readOnly   = false;
			txtPaymentPhone.readOnly      = false;
			txtPaymentState.readOnly      = false;			
			txtPaymentCity.readOnly       = false;
			txtPaymentPostalCode.readOnly = false;			
		}
	}
}

function setShipRate(isChecked)
{
	with (window.document.shipForm) {
		if (isChecked(shipRate1)) {
			shipRate1.value  = shipRate1.value;
			shipRate1.readOnly = true;
			} else {
			shipRate1.readOnly = false;
			}
		if (isChecked(shipRate2)) {
			shipRate2.value  = shipRate2.value;
			shipRate2.readOnly = true;
			} else {
			shipRate2.readOnly = false;
			}
	}
}

function checkAccountInfo()
{
   with (window.document.frmCheckout1) {
   if (isEmpty(txtEmail, 'Enter Email Address')) {
		 return false; 
   } else if (isEmpty(txtPassword, 'Enter Password')) {
			return false;
	 } else {
			return true;
		}
	}
}

function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}


function checkAccountInfo2()
{
   with (window.document.frmCheckout2) {
   if (isEmpty(txtEmail, 'Enter Email Address')) {
			return false;
	 } else if (isEmpty(verifyEmail, 'Verify Email')) {
			return false;
   } else if (isEmpty(txtPassword, 'Enter Password')) {
			return false;
	 } else if (isEmpty(verifyPassword, 'Verify Password')) {
			return false;
	 } else {
			return true;
		}
	}
}

function checkShipAddr(){
  if(document.frmCheckShipAddr.txtShippingFirstName.value.length < 1){
	  alert("Please enter your first name.");
		return false;
	}
	if(document.frmCheckShipAddr.txtShippingLastName.value.length < 1){
	  alert("Please enter your last name.");
		return false;
	}
	if(document.frmCheckShipAddr.txtShippingAddress1.value.length < 1){
	  alert("Please enter your address.");
		return false;
	}
	if(document.frmCheckShipAddr.txtShippingCity.value.length < 1){
	  alert("Please enter your city.");
		return false;
	}
	if(document.frmCheckShipAddr.txtShippingState.value.length < 1){
	  alert("Please enter your state.");
		return false;
	}
	if(document.frmCheckShipAddr.txtShippingPostalCode.value.length < 1){
	  alert("Please enter your postal code.");
		return false;
	}
	
	return true;
}


/*function checkForm()
{
  var txtShippingFirstName, txtShippingLastName, txtShippingAddress1, txtShippingCity, txtShippingState, txtShippingPostalCode, txtShippingPhone, txtEmail,txtPassword;
	with (window.document.frmCheckout) 
	{
	  
      shipFirstName    = txtShippingFirstName;
      shipLastName   = txtShippingLastName;
      shipAddress1 = txtShippingAddress1;
      shipCity = txtShippingCity;
			shipState = txtShippingState;
			shipPostalCode = txtShippingPostalCode;
		  shipPhone = txtShippingPhone;
			email = txtEmail;
			password = txtPassword;
			
   }
	 if(trim(shipFirstName.value) == '')
   {
      alert('Please enter your first name');
      shipFirstName.focus();
      return false;
   }
	 if(trim(shipLastName.value) == '')
   {
      alert('Please enter your last name');
      shipLastName.focus();
      return false;
   }
	 if(trim(shipAddress1.value) == '')
   {
      alert('Please enter your address');
      shipAddress1.focus();
      return false;
   }
	 if(trim(shipCity.value) == '')
   {
      alert('Please enter your city');
      shipCity.focus();
      return false;
   }
	 if(trim(shipState.value) == '')
   {
      alert('Please enter your state');
      shipState.focus();
      return false;
   }
   if(trim(shipPostalCode.value) == '')
   {
      alert('Please enter your postal code');
      shipPostalCode.focus();
      return false;
   }
	 if(trim(shipPhone.value) == '')
   {
      alert('Please enter your phone');
      shipPhone.focus();
      return false;
   }
   if(trim(email.value) == '')
   {
      alert('Please enter your email');
      email.focus();
      return false;
   }
	 if(trim(password.value) == '')
   {
      alert('Please enter your password');
      password.focus();
      return false;
   }		
	 else
   {
      shipFirstName.value    = trim(shipFirstName.value);
      shipLastName.value   = trim(shipLastName.value);
      shipAddress1.value = trim(shipAddress1.value);
			shipCity.value = trim(shipCity.value);
			shipState.value = trim(shipState.value);
			shipPostalCode.value = trim(shipPostalCode.value);
			shipPhone.value = trim(shipPhone.value);
      email.value = trim(email.value);
			password.value = trim(password.value);
			
      return true;
   }
} */


function checkConfirmationInfo()
{
	with (window.document.frmCheckout2) {
		if (isEmpty(txtShippingFirstName, 'Enter first name')) {
			return false;
		} else if (isEmpty(txtShippingLastName, 'Enter last name')) {
			return false;
		} else if (isEmpty(txtShippingAddress1, 'Enter shipping address')) {
			return false;
		} else if (isEmpty(txtShippingPhone, 'Enter phone number')) {
			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(txtEmail, 'Enter the an email address')) {
			return false;
		}	else if (isEmpty(txtPassword, 'Enter a password')) {
			return false;
		} else if (isEmpty(txtPaymentFirstName, 'Enter first name')) {
			return false;
		} else if (isEmpty(txtPaymentLastName, 'Enter last name')) {
			return false;
		} else if (isEmpty(txtPaymentAddress1, 'Enter Payment address')) {
			return false;
		} else if (isEmpty(txtPaymentPhone, 'Enter phone number')) {
			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 if (isEmpty(ccName, 'Enter the name on the your credit card')) {
			return false;
		} else if (isEmpty(ccType, 'Enter the type of credit card you are using')) {
			return false;
		} else if (isEmpty(ccNumber, 'Enter the credit card number')) {
			return false;
		} else if (isEmpty(ccExpMonth, 'Enter the credit card expiration month')) {
			return false;
		} else if (isEmpty(ccExpYear, 'Enter the credit card expiration year')) {
			return false;
		} else {
			return true;
		}
	}
}