$(function() {
	$("#myresume").hide();

	$("#myform.button").click(function() {  
		// validate and process form here  			
		var name = $("input#name").val();
		dataString = 'name=' + name;
		
		$('#myform.button').html('<h3>Uploading...</h3>');		
		$.post("bin/process_application.py", $("#myform").serialize(), function(data){
			$('#application_form').html("<div id='message'></div>");
			$('#message').html("<h2>Thanks for applying!</h2>").append("<p>If you haven't yet submitted your resume please use the form below. We will be in touch soon.</p>");
			$("#myresume").show();
		});	
		
		return false;
	});  
});
