<%@ LANGUAGE="JAVASCRIPT" CODEPAGE="1252" %> <% /** ASP.JavaScript Document * Written by: WA Interactive (jeremy@wainteractive.com) * Written for: Kendall-Jackson Winery (contact@kjmail.com) * Written on: January 3, 2005 * Additional Comments: */ Response.AddHeader("Cache-Control", "post-check=5,pre-check=5"); var sThisWebsite = "www.cambriawines.com"; var sEstateName = "Cambria" ; var sFirstName = "" + Request.Form("fname") ; var sLastName = "" + Request.Form("lname") ; var sCompanyName = "" + Request.Form("cname") ; var sMailingAddress = "" + Request.Form("address") ; var sMailingAddress2 = "" + Request.Form("address2") ; var sCity = "" + Request.Form("city") ; var sState = "" + Request.Form("state") ; var sStateName = "" + Request.Form("statename") ; var sZip = "" + Request.Form("zip") ; var sCountry = "" + Request.Form("country") ; var sPhone = "" + Request.Form("phone") ; var sEmail = "" + Request.Form("email") ; var sDryCounty = "" + Request.Form("dry") ; var bPostback = ("" + Request.Form("postback")) == "true" ; var RE_validEmail = /^\w+@[\w\d]+\.\w{2,3}$/i ; var RE_validPhone = /^\d{10}$/ ; var RE_invalidChar = /'/g ; var bComplete = false ; if ( sFirstName == "undefined" ) sFirstName = "" ; if ( sLastName == "undefined" ) sLastName = "" ; if ( sCompanyName == "undefined" ) sCompanyName = "" ; if ( sMailingAddress == "undefined" ) sMailingAddress = "" ; if ( sMailingAddress2 == "undefined" ) sMailingAddress2 = "" ; if ( sCity == "undefined" ) sCity = "" ; if ( sState == "undefined" ) sState = "" ; if ( sZip == "undefined" ) sZip = "" ; if ( sCountry == "undefined" ) sCountry = "" ; if ( sPhone == "undefined" ) sPhone = "" ; if ( sEmail == "undefined" ) sEmail = "" ; if ( sStateName == "undefined" ) sStateName = "" ; if ( sDryCounty == "undefined" ) sDryCounty = "No" ; sState = sState.toUpperCase() ; if ( bPostback && sFirstName.length > 1 && sLastName.length > 1 && sState.length == 2 && sEmail.indexOf("@") + 1 ) { var DBConn = Server.CreateObject("ADODB.Connection") ; var SQL = "INSERT INTO collection (fName,lName,mAddress,mAddress2,city,state,zip,eMail,website,dryCount)" ; SQL += "VALUES ('" + sFirstName.replace(RE_invalidChar, "`") + "','" + sLastName.replace(RE_invalidChar, "`") + "','" + sMailingAddress.replace(RE_invalidChar, "`") + "','" + sMailingAddress2.replace(RE_invalidChar, "`") + "','" + sCity.replace(RE_invalidChar, "`") + "','" + sState + "','" + sZip + "','" + sEmail.replace(RE_invalidChar, "`") + "','"+ sThisWebsite + "','" + sDryCounty + "')" ; DBConn.Open("Provider=SQLOLEDB; Data Source=winker; Initial Catalog=kjemails; User ID=kjcom; Password=59ae56d") ; DBConn.Execute(SQL) ; DBConn.Close() ; bComplete = true ; } %> Santa Barbara County Wines. California Wine Tasting. Cambria Wines.

<%= ( bComplete ) ? "Thank You" : "Join our Mailing List" %>

<% if ( ! bComplete ) { %>

If you would like to receive information on our wines, future releases and events, please complete the form below.

Let us know if you have any questions.

* Indicates a required field.

<% if ( bPostback && ! ( sFirstName.length > 1 ) ) { %>
Please enter your first name <% } %>
<% if ( bPostback && ! ( sLastName.length > 1 ) ) { %>
Please enter your last name <% } %>
<% if ( bPostback && ! ( sState.length == 2 ) ) { %>
Please select your State <% } %>
<% if ( bPostback && ! ( sEmail.indexOf("@") + 1 ) ) { %>
Please enter your Email address <% } %>

<% } else { switch ( sState.toUpperCase() ) { default : // States where shipping is allowed. %>

Thank you for your interest in <%= sEstateName %>. We look forward to sharing with you our future news and events. Have a wonderful day!

<% break ; case "AZ" : case "DE" : case "IN" : case "KY" : case "ME" : case "MT" : case "NJ" : case "OK" : case "RI" : case "SD" : case "TN" : case "VT" : %>

Thank you for your interest in <%= sEstateName %> and your request to be placed on our mailing list. Please be aware that at this time <%= sStateName %> law prohibits us from shipping wine directly to you.

<%= sStateName %> residents are however permitted to make a purchase "onsite" at our winery and ship that purchase to their home address, subject to certain volume limits. So, if you plan to be in this area in the future please include <%= sEstateName %> in your travel plans. We would love to see you.

Separately, we encourage you to contact your State legislators and urge them to repeal the law that prohibits you from having wine shipped to you directly. For more information about how you can get involved please visit www.freethegrapes.org.

Thanks again for your interest in <%= sEstateName %>. We will keep your contact information on file in case the law changes and be back in touch with you at that time.

<% break ; case "GA" : %>

Thank you for your interest in <%= sEstateName %> and your request to be placed on our mailing list. Please be aware that currently your State laws prohibit us from shipping wine directly to you. However, if you make a purchase here at the winery in person, you can, subject to certain volume limits, ship that wine directly to your home address. So, if you plan to be in our area in the future we would love to see you here at the winery.

Also if you do visit, please be sure to ask us about our <%= sEstateName %> wine club. If you sign up for our club while visiting our winery, we are then able to make regular wine club shipments to you based on the wine club schedule.

Separately, we encourage you to get in touch with your State legislators and urge them to change the law. For more information on how to get involved please visit www.freethegrapes.org.

Thanks again for your interest in <%= sEstateName %>. We hope to be able to serve you in the future and will keep your Email address on file in case the law changes.

<% break ; case "AK" : %>

Thank you for your request to be added to the <%= sEstateName %> mailing list. We look forward to sharing with you our future news and events.

For those in dry counties we encourage you to get in touch with your State legislators and urge them to change the law. For more information on how to get involved please visit www.freethegrapes.org.

<% break ; case "AL" : case "AR" : case "KS" : case "LA" : case "MD" : case "MA" : case "MS" : case "PA" : case "UT" : %>

Thank you for your interest in joining the <%= sEstateName %> mailing list. Please be aware that at this time your State law prohibits us from shipping wine to <%= sStateName %>.

We would like to encourage you to contact your State legislators and urge them to change the law. You can also visit www.freethegrapes.org to read about ways to get involved in efforts to permit the direct shipping of wine in your State.

We hope to be able to do business with you in the future and will keep your name on file in the event that the law does change. In the meantime, thanks for your interest in <%= sEstateName %>, and if you plan to be in our area in the future we would love to see you here at the winery.

<% break ; case "NY" : %>

Thank you for your interest in <%= sEstateName %>. We look forward to sharing with you our future news and events. Have a wonderful day!

<% break ; case "HI" : %>

Thank you for your interest in <%= sEstateName %>. We look forward to sharing with you our future news and events. Have a wonderful day!

<% break ; } } %>