  	function showForm(){
       	$("form").css("display","inherit");
  		$(".custom").fadeOut('fast', function() {
	  		$(".customize").fadeIn('fast');
		});
  	}
  	
  	function showInstructions(){
	  	$(".instructions").hide().css({visibility: "visible"}).fadeIn("fast");
  	}
	
	$(function() {
	
		if ($("#inputCensor").val() == '1') {
			//replace .censored elements with *
			$(".censor").hide().after('<span class="censored">*</span>');
			$("#inputCensor").val('1').attr('checked','checked');
		}

	
		$("#save").click(function() {
	
			var to = encodeURIComponent($("#inputTo").val());
			var censor = encodeURIComponent($("#inputCensor").val());
			
			var dataString = 'to='+ to + "&censored=" + censor; 
	
			$.ajax({
			  type: "POST",
			  url: "/customize/",
			  data: dataString,
			  success: function(data) {
				$('#customized').html(data);
			  }
			});
			$(".customize").hide();
			$("#recipient").html(", " + $("#inputTo").val() + ".").show();
			$("#customize").hide();
		return false;
		});


		$("#inputCensor").change(function() {
			if ($(this).is(':checked')) {
				//replace .censored elements with *
				$(".censor").hide().after('<span class="censored">*</span>');
				$("#inputCensor").val('1');
			}else{
				$(".censor").show();
				$(".censored").hide();
				$("#inputCensor").val('0');
			}
		});
	});

	
