function setPaymentInfo(isChecked)
{
  with (window.document.frmBilling) 
  {
    if (isChecked) 
    {
			od_payment_first_name.value  = od_shipping_first_name.value;
			od_payment_last_name.value   = od_shipping_last_name.value;					
      od_payment_address1.value   = od_shipping_address1.value;
      od_payment_address2.value   = od_shipping_address2.value;
			od_payment_city.value       = od_shipping_city.value;
			od_payment_state.value      = od_shipping_state.value;						
      od_payment_postal_code.value = od_shipping_postal_code.value;
			od_payment_phone.value      = od_shipping_phone.value;			
    } 
  }
}

function phoneNumber(element)
{
  var re = new RegExp("[^0-9]", "g");
	var phone,sArea,sPrefix,sNumber;

	phone = element.value;
  phone = phone.replace(re,"");

  if(phone.length!=10)
	{
		element.value="";
		return;
	}
			
	sArea = phone.substr(0,3);
	sPrefix=phone.substr(3,3);
	sNumber=phone.substr(5,4);
	phone="("+sArea+")"+sPrefix+"-"+sNumber;
	element.value=phone;
}

function checkShippingInfo()
{
  with (window.document.frmCheckout) 
  {
	  phoneNumber(od_shipping_phone);
    if (isEmpty(od_shipping_first_name, 'Enter first name')) 
      return false;
    else if (isEmpty(od_shipping_last_name, 'Enter last name')) 
      return false;
    else if (isEmpty(od_shipping_address1, 'Enter shipping address')) 
      return false;
    else if (isEmpty(od_shipping_phone, 'Enter phone number'))
      return false;
    else if (isEmpty(od_shipping_state, 'Enter shipping address state'))
      return false;
    else if (isEmpty(od_shipping_city, 'Enter shipping address city')) 
      return false;
    else if (isEmpty(od_shipping_postal_code, 'Enter postal/zip code')) 
             
      return false;
  }
  return true;
}

function checkBillingInfo()
{
  with (window.document.frmBilling) 
  {
	  phoneNumber(od_payment_phone);
    if (isEmpty(od_payment_first_name, 'Enter first name')) 
      return false;
    else if (isEmpty(od_payment_last_name, 'Enter last name')) 
      return false;
    else if (isEmpty(od_payment_address1, 'Enter Payment address')) 
      return false;
    else if (isEmpty(od_payment_phone, 'Enter phone number'))
      return false;
    else if (isEmpty(od_payment_state, 'Enter Payment address state'))
      return false;
    else if (isEmpty(od_payment_city, 'Enter Payment address city')) 
      return false;
    else if (isEmpty(od_payment_postal_code, 'Enter postal/zip code')) 
             
      return false;
  }
  return true;
}


