$(function() {

  $(".register").click(function() {
	

	var firstname  = $("input#firstname").val();
	var lastname  = $("input#lastname").val();
	var business = $("input#business").val();
	var phone3 = $("input#phone3").val();
	var phone7 = $("input#phone7").val();
	var email = $("input#email").val();  
 
	var address = $("input#address").val();  
	var city = $("input#city").val(); 
	var state = $('input#state').val();
	 
	 
	var zip = $("input#zip").val();
 	
	 
	//var polo = $('input:checkbox[name=polo]:checked').val();
	//if(polo == null)
	//{
	//	polo = "No";
	//}
	//var cocktailhour = $('input:checkbox[name=cocktailhour]:checked').val();
	//if(cocktailhour == null)
	//{
	//	cocktailhour = "No";
	//}
	//var dinner = $('input:checkbox[name=dinner]:checked').val();
	//if(dinner == null)
	//{
	//	dinner = "No";
	//}
	
	var attendees = $('#attendees').val();
	

//var dataString = 'firstname=' + firstname + '&lastname=' + lastname + '&business=' + business + '&phone3=' + phone3 + '&phone7=' + //phone7 + '&email=' + email + '&address=' + address + '&city=' + city + '&state=' + state + '&zip=' + zip + '&polo=' + polo + //'&cocktailhour=' + cocktailhour + '&dinner=' + dinner + '&attendees=' + attendees; 

var dataString = 'firstname=' + firstname + '&lastname=' + lastname + '&business=' + business + '&phone3=' + phone3 + '&phone7=' + phone7 + '&email=' + email + '&address=' + address + '&city=' + city + '&state=' + state + '&zip=' + zip + '&attendees=' + attendees; 

		//var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone;
		//alert (dataString);return false;
		
	  $.ajax({
      type: "POST",
      url: "bin/registration-process.php",
      data: dataString,
      success: function() {
        $('#contact_form').html("<div id='message'></div>");
        $('#message').html("<h2>Contact Form Submitted!</h2>")
        .append("<p>We will be in touch soon.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#message').append("<img id='checkmark' src='images/check.png' />");
        });
      }
     });
    return false;
	});
});
runOnLoad(function(){
  $("input#firstname").select().focus();
});

