/*///////////////////////////////////////////////////////////////////////Ported to jquery from prototype by Joel Lisenby (joel.lisenby@gmail.com)http://joellisenby.comoriginal prototype code by Aarron Walter (aarron@buildingfindablewebsites.com)http://buildingfindablewebsites.comDistrbuted under Creative Commons licensehttp://creativecommons.org/licenses/by-sa/3.0/us////////////////////////////////////////////////////////////////////////*/var emailEntered,	fullnameVal,	splitName,    fnameVal,    lnameVal,    locationVal,	sourceVal;$(document).ready(function() {    $("#SendButton").click(function() {            $(".error").hide();            var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;            var emailaddressVal = $("#email").val();                        if(emailaddressVal == '') {                $("#message").html('<span class="error">Oops. We need an email address before you do that.</span>');                return false;             }            else if(!emailReg.test(emailaddressVal)) {                $("#message").html("<span class='error'>Oops. What kind of email address is that?</span>");                return false;             }             else {                emailEntered = escape($('#email').val());            }            fullnameVal 	= escape($("#fullname").val());			splitName       = fullnameVal.split("%20");			fnameVal		= splitName[0];			lnameVal		= splitName[1];			locationVal		= escape($("#location").val());			sourceVal		= escape($("#source").val());            // emailtypeVal    = $('input:radio[name=emailtype]:checked').val();    });    $('#signup').submit(function() {        $('#newsletter_signup').hide();        $("#message").html("<span class='error'>Adding your email address...</span>");        $.ajax({            url: 'inc/store-address.php', // proper url to your "store-address.php" file            data: 'ajax=true&email=' + emailEntered +'&fname=' + fnameVal + '&lname=' + lnameVal + '&location=' + locationVal +'&source=' + sourceVal + '&fullname=' + fullnameVal,            success: function(msg) {                $('#message').html(msg);            }        });        return false;    });});// $(document).ready(function() {//  $('#signup').submit(function() {//      // update user interface//         // console.log("Sending email", $('#email').val());//      $('#response').html('Adding email address...');//      //      // Prepare query string and send AJAX request//      $.ajax({//          url: 'inc/store-address.php',//          data: 'ajax=true&email=' + escape($('#email').val()),//          success: function(msg) {//                 console.log(msg);//                 $('#response').html(msg);//          }//      });//  //      return false;//  });// });
