function copy_info()
{ if(document.form.same_info.checked == true)
  { document.form.bill_first_name.value = document.form.ship_first_name.value;
    document.form.bill_last_name.value = document.form.ship_last_name.value;
    document.form.bill_address.value = document.form.ship_address.value;
    document.form.bill_city.value = document.form.ship_city.value;
    document.form.bill_state.value = document.form.ship_state.value;
    document.form.bill_zip.value = document.form.ship_zip.value;
  }
  else
  { document.form.bill_first_name.value = "";
    document.form.bill_last_name.value = "";
    document.form.bill_address.value = "";
    document.form.bill_city.value = "";
    document.form.bill_state.value = "";
    document.form.bill_zip.value = "";
  }
}

function confirm_location()
{ if(document.form.delivery_city[0].checked != true)
  { if(confirm("If your Delivery Location is not correct you need to re-enter\nyour delivery location and place your order again.\n\nPROCEED?"))
    { window.location = "http://www.sepulveda2.com/store/index.php";
      return false;
    }
    else
    { document.form.delivery_city[0].focus();
      return false;
    }
  }
}


function regvalidator()
{ // SET DELIVERY STORE VARIABLES
  var gardena_index = document.form.gardena.selectedIndex;
  var gardena_city = document.form.gardena.options[gardena_index].value;
  var laguna_niguel_index = document.form.laguna_niguel.selectedIndex;
  var laguna_niguel_city = document.form.laguna_niguel.options[laguna_niguel_index].value;
  var indio_index = document.form.indio.selectedIndex;
  var indio_city = document.form.indio.options[indio_index].value;
  var san_bernardino_index = document.form.san_bernardino.selectedIndex;
  var san_bernardino_city = document.form.san_bernardino.options[san_bernardino_index].value;
  // SET EMAIL VARIABLES
  var ship_email = document.form.ship_email.value;
  var email_regexp = /^[a-zA-Z0-9_-]{2,}(\.[a-zA-Z0-9_-]+)*@[a-zA-Z0-9_-]{2,}(\.[a-zA-Z0-9_-]{2,})*\.[a-zA-Z]{2,}/;
  // CHECK DELIVERY STORES
  if(gardena_city == "null" && laguna_niguel_city == "null" &&
     indio_city == "null" && san_bernardino_city == "null")
  { alert("Please select your community");
    document.form.gardena.focus();
    return false;
  }
  // CHECK SHIP FIRST NAME
  if(!/^[a-zA-Z]{2}/.test(document.form.ship_first_name.value))
  { alert("Please enter the delivery First Name.");
    document.form.ship_first_name.focus();
    return false;
  }
  // CHECK SHIP LAST NAME
  if(!/^[a-zA-Z]{2}/.test(document.form.ship_last_name.value))
  { alert("Please enter the delivery Last Name.");
    document.form.ship_last_name.focus();
    return false;
  }
  // CHECK SHIP ADDRESS
  if(!/^[a-zA-Z0-9]+\s[a-zA-Z0-9]/.test(document.form.ship_address.value))
  { alert("Please enter the delivery Address.");
    document.form.ship_address.focus();
    return false;
  }
  // CHECK SHIP CITY
  if(!/^[a-zA-Z\s]{4}/.test(document.form.ship_city.value))
  { alert("Please enter the delivery City.");
    document.form.ship_city.focus();
    return false;
  }
  // CHECK SHIP STATE
  if(!/^[a-zA-Z]{2}/.test(document.form.ship_state.value))
  { alert("Please enter the delivery State using the two-letter abbreviation.");
    document.form.ship_state.focus();
    return false;
  }
  // CHECK SHIP ZIP
  if(!/^[\d]{5}/.test(document.form.ship_zip.value))
  { alert("Please enter the delivery Zip Code (5 numbers).");
    document.form.ship_zip.focus();
    return false;
  }
  // CONFIRM SHIP PHONE DAY
  if(!/^[0-9\-\(\)\s]{10,}/.test(document.form.ship_phone_day.value))
  { alert("Please enter your Daytime Phone area code and number.");
    document.form.ship_phone_day.focus();
    return false;
  }
  // CONFIRM SHIP PHONE NIGHT
  if(!/^[0-9\-\(\)\s]{10,}/.test(document.form.ship_phone_night.value))
  { alert("Please enter your Evening Phone area code and number.");
    document.form.ship_phone_night.focus();
    return false;
  }
  // CONFIRM SHIP EMAIL
  if(!email_regexp.test(ship_email) || ship_email.indexOf("www") == 0)
  { alert("Please check the E-Mail address.\n\nUse this format: name@domain.com");
    document.form.ship_email.focus();
    return false;
  }
  if(document.form.ship_email.value != document.form.ship_email2.value)
  { alert("The two delivery E-Mail addresses do not match. Please check them.");
    document.form.ship_email.focus();
    return false;
  }
  // CONFIRM SHIP INTERSECTION
  if(!/^[a-zA-Z0-9\/\-\s\(\),\.&]{6,}/.test(document.form.ship_intersection.value))
  { alert("Please enter a Nearest Intersection.");
    document.form.ship_intersection.focus();
    return false;
  }
return true
}