var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  function checkEmail(email) { 
    var pattern = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    var emailVal = $("#" + email).val();
    return pattern.test(emailVal);
  }
  $(function() {
    $("#subForm input:submit").click(function() { 
      $('form#subForm').submit(function() { return false; });
      
      var formAction = $("form#subForm").attr("action");
      
      var id = "xdttdi";
      var emailId = id + "-" + id;
      
      if (!checkEmail(emailId)) {
        alert("Please enter a valid email address");
        return;
      }
      
      var str = $("form#subForm").serialize();
      
      // Add form action to end of serialized data
      // CDATA is used to avoid validation errors
      //<![CDATA[
      var serialized = str + "&action=" + formAction;
      // ]]>
      
      $.ajax({
        url: "http://www.leadershipplus.com/proxy.php",
        type: "POST",
        data: serialized,
        success: function(data){
          // Server-side validation
          if (data.search(/invalid/i) != -1) {
            alert('The email address you supplied is invalid and needs to be fixed before you can subscribe to this list.');
          }
          else
          {
            $("#theForm").hide();
            $("#confirmation").slideDown("slow");
            $("#confirmation").tabIndex = -1;
            $("#confirmation").focus(); 

          }
        }
      });
    });
  });
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}
