function screen() {
	$("#screen").show();
	$("#box").show("slow");
};

function validate() {
	var validate;
	email = $("#box-email").val();
	window.email = email;
	window.questions = $("#box-questions").val();
	test = $("#input-test").val();
	atPos = email.indexOf("@");
	dotPos = email.lastIndexOf(".");
	if (email == "") {
		$("#validate_line").show();
		validate = "0";
	}
	else if (atPos < 1){
		$("#validate_line").show();
		validate = "0";
	}
	else if (dotPos < atPos) {
		$("#validate_line").show();
		validate = "0";
	}
	else {
		validate = "1";
		stage1();
	};
}

function stage1() {
	$("#span1").hide();
	$("#span2").show();
	$.post("mail.php", { reqmail: email }, 
	   function(data){
		   $("#span2").append(data)
	   });
	
};

function stage2() {
	$("#screen").hide();
	$("#box").hide();
	$.post("ccs.php", {reqmail : email, questions: questions});
};

function closebox() {
	$("#screen").hide();
	$("#box").hide();
};
